mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
Removed @EqualsHashCode from generator nodes
This commit is contained in:
parent
a104e77dbc
commit
c5dd2694e5
10 changed files with 0 additions and 162 deletions
|
@ -9,13 +9,11 @@ package org.eclipse.xtext.generator.trace.node
|
|||
|
||||
import java.util.List
|
||||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
class CompositeGeneratorNode implements IGeneratorNode {
|
||||
|
||||
val List<IGeneratorNode> children = newArrayList
|
||||
|
|
|
@ -8,13 +8,11 @@
|
|||
package org.eclipse.xtext.generator.trace.node
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
class IndentNode extends CompositeGeneratorNode {
|
||||
|
||||
String indentationString
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
package org.eclipse.xtext.generator.trace.node
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode
|
||||
import org.eclipse.xtext.util.Strings
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
class NewLineNode implements IGeneratorNode {
|
||||
|
||||
String lineDelimiter
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
package org.eclipse.xtext.generator.trace.node
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode
|
||||
import org.eclipse.xtext.util.Strings
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
class TextNode implements IGeneratorNode {
|
||||
|
||||
CharSequence text
|
||||
|
|
|
@ -8,14 +8,12 @@
|
|||
package org.eclipse.xtext.generator.trace.node
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode
|
||||
import org.eclipse.xtext.generator.trace.ILocationData
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
class TraceNode extends CompositeGeneratorNode {
|
||||
|
||||
ILocationData sourceLocation
|
||||
|
|
|
@ -9,7 +9,6 @@ package org.eclipse.xtext.generator.trace.node;
|
|||
|
||||
import java.util.List;
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode;
|
||||
import org.eclipse.xtend2.lib.StringConcatenation;
|
||||
import org.eclipse.xtext.generator.trace.node.IGeneratorNode;
|
||||
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
|
||||
|
@ -19,7 +18,6 @@ import org.eclipse.xtext.xbase.lib.Pure;
|
|||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
@SuppressWarnings("all")
|
||||
public class CompositeGeneratorNode implements IGeneratorNode {
|
||||
private final List<IGeneratorNode> children = CollectionLiterals.<IGeneratorNode>newArrayList();
|
||||
|
@ -48,31 +46,4 @@ public class CompositeGeneratorNode implements IGeneratorNode {
|
|||
public List<IGeneratorNode> getChildren() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
CompositeGeneratorNode other = (CompositeGeneratorNode) obj;
|
||||
if (this.children == null) {
|
||||
if (other.children != null)
|
||||
return false;
|
||||
} else if (!this.children.equals(other.children))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((this.children== null) ? 0 : this.children.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
package org.eclipse.xtext.generator.trace.node;
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode;
|
||||
import org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode;
|
||||
import org.eclipse.xtext.xbase.lib.Pure;
|
||||
|
||||
|
@ -16,7 +15,6 @@ import org.eclipse.xtext.xbase.lib.Pure;
|
|||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
@SuppressWarnings("all")
|
||||
public class IndentNode extends CompositeGeneratorNode {
|
||||
private String indentationString;
|
||||
|
@ -33,33 +31,4 @@ public class IndentNode extends CompositeGeneratorNode {
|
|||
public void setIndentationString(final String indentationString) {
|
||||
this.indentationString = indentationString;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
IndentNode other = (IndentNode) obj;
|
||||
if (this.indentationString == null) {
|
||||
if (other.indentationString != null)
|
||||
return false;
|
||||
} else if (!this.indentationString.equals(other.indentationString))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + ((this.indentationString== null) ? 0 : this.indentationString.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
package org.eclipse.xtext.generator.trace.node;
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode;
|
||||
import org.eclipse.xtend2.lib.StringConcatenation;
|
||||
import org.eclipse.xtext.generator.trace.node.IGeneratorNode;
|
||||
import org.eclipse.xtext.util.Strings;
|
||||
|
@ -18,7 +17,6 @@ import org.eclipse.xtext.xbase.lib.Pure;
|
|||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
@SuppressWarnings("all")
|
||||
public class NewLineNode implements IGeneratorNode {
|
||||
private String lineDelimiter;
|
||||
|
@ -68,34 +66,4 @@ public class NewLineNode implements IGeneratorNode {
|
|||
public void setIfNotEmpty(final boolean ifNotEmpty) {
|
||||
this.ifNotEmpty = ifNotEmpty;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
NewLineNode other = (NewLineNode) obj;
|
||||
if (this.lineDelimiter == null) {
|
||||
if (other.lineDelimiter != null)
|
||||
return false;
|
||||
} else if (!this.lineDelimiter.equals(other.lineDelimiter))
|
||||
return false;
|
||||
if (other.ifNotEmpty != this.ifNotEmpty)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((this.lineDelimiter== null) ? 0 : this.lineDelimiter.hashCode());
|
||||
result = prime * result + (this.ifNotEmpty ? 1231 : 1237);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
package org.eclipse.xtext.generator.trace.node;
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode;
|
||||
import org.eclipse.xtend2.lib.StringConcatenation;
|
||||
import org.eclipse.xtext.generator.trace.node.IGeneratorNode;
|
||||
import org.eclipse.xtext.util.Strings;
|
||||
|
@ -18,7 +17,6 @@ import org.eclipse.xtext.xbase.lib.Pure;
|
|||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
@SuppressWarnings("all")
|
||||
public class TextNode implements IGeneratorNode {
|
||||
private CharSequence text;
|
||||
|
@ -47,31 +45,4 @@ public class TextNode implements IGeneratorNode {
|
|||
public void setText(final CharSequence text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
TextNode other = (TextNode) obj;
|
||||
if (this.text == null) {
|
||||
if (other.text != null)
|
||||
return false;
|
||||
} else if (!this.text.equals(other.text))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((this.text== null) ? 0 : this.text.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
package org.eclipse.xtext.generator.trace.node;
|
||||
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtend.lib.annotations.EqualsHashCode;
|
||||
import org.eclipse.xtext.generator.trace.ILocationData;
|
||||
import org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode;
|
||||
import org.eclipse.xtext.xbase.lib.Pure;
|
||||
|
@ -17,7 +16,6 @@ import org.eclipse.xtext.xbase.lib.Pure;
|
|||
* @author Sven Efftinge - initial contribution and API
|
||||
*/
|
||||
@Accessors
|
||||
@EqualsHashCode
|
||||
@SuppressWarnings("all")
|
||||
public class TraceNode extends CompositeGeneratorNode {
|
||||
private ILocationData sourceLocation;
|
||||
|
@ -34,33 +32,4 @@ public class TraceNode extends CompositeGeneratorNode {
|
|||
public void setSourceLocation(final ILocationData sourceLocation) {
|
||||
this.sourceLocation = sourceLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
TraceNode other = (TraceNode) obj;
|
||||
if (this.sourceLocation == null) {
|
||||
if (other.sourceLocation != null)
|
||||
return false;
|
||||
} else if (!this.sourceLocation.equals(other.sourceLocation))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Pure
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + ((this.sourceLocation== null) ? 0 : this.sourceLocation.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue