Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renamed fields and getters/setters
  • Loading branch information
cheestree committed Mar 14, 2026
commit 96905c1ce4ddb7f29a4fcf2a857147816117b4d4
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@

public class Enum extends Expression {

private final String enumTypeName;
private final String enumConstantName;
private final String typeName;
private final String constName;

public Enum(String enumTypeName, String enumConstantName) {
this.enumTypeName = enumTypeName;
this.enumConstantName = enumConstantName;
public Enum(String typeName, String constName) {
this.typeName = typeName;
this.constName = constName;
}

public String getEnumTypeName() {
return enumTypeName;
public String getTypeName() {
return typeName;
}

public String getEnumConstantName() {
return enumConstantName;
public String getConstName() {
return constName;
}

@Override
Expand All @@ -45,15 +45,15 @@ public boolean isBooleanTrue() {

@Override
public String toString() {
return enumTypeName + "." + enumConstantName;
return typeName + "." + constName;
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((enumTypeName == null) ? 0 : enumTypeName.hashCode());
result = prime * result + ((enumConstantName == null) ? 0 : enumConstantName.hashCode());
result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
result = prime * result + ((constName == null) ? 0 : constName.hashCode());
return result;
}

Expand All @@ -64,11 +64,11 @@ public boolean equals(Object obj) {
if (obj == null || getClass() != obj.getClass())
return false;
Enum other = (Enum) obj;
return enumTypeName.equals(other.enumTypeName) && enumConstantName.equals(other.enumConstantName);
return typeName.equals(other.typeName) && constName.equals(other.constName);
}

@Override
public Expression clone() {
return new Enum(enumTypeName, enumConstantName);
return new Enum(typeName, constName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ public Expr<?> visitUnaryExpression(UnaryExpression exp) throws LJError {

@Override
public Expr<?> visitEnum(Enum en) throws LJError {
return ctx.makeEnum(en.getEnumTypeName(), en.getEnumConstantName());
return ctx.makeEnum(en.getTypeName(), en.getConstName());
}
}
Loading