You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Return the set of enumerations belonging to the selector enum type that are NOT listed in case statements.
private Set<FieldBinding> unenumeratedConstants(ReferenceBinding enumType, int constantCount) {
FieldBinding[] enumFields = ((ReferenceBinding) enumType.erasure()).fields();
Set<FieldBinding> unenumerated = new HashSet<>(Arrays.asList(enumFields));
for (int i = 0, max = enumFields.length; i < max; i++) {
FieldBinding enumConstant = enumFields[i];
if ((enumConstant.modifiers & ClassFileConstants.AccEnum) == 0) {
unenumerated.remove(enumConstant);
continue;
}
for (int j = 0; j < constantCount; j++) {
if (TypeBinding.equalsEquals(this.labelExpressions[j].expression.resolvedType, enumType)) {
if (this.labelExpressions[j].expression instanceof NameReference reference) {
FieldBinding field = reference.fieldBinding();
int intValue = field.original().id;
if (enumConstant.id == intValue) {
unenumerated.remove(enumConstant);
break;
}
}
}
}
}
return unenumerated;
}
If I chose the intValue in int intValue = field.original().id; and perform inline local variable refactoring I end up with:
if (enumConstant.id == this.field.original().id) {
this is wrong and fails to compile. I was simply expecting: if (enumConstant.id == field.original().id) { where field is a local. It seems field is mistaken to be a field and the this. qualifier is added to it.
The text was updated successfully, but these errors were encountered:
I have a piece of code that reads:
If I chose the intValue in
int intValue = field.original().id;
and perform inline local variable refactoring I end up with:if (enumConstant.id == this.field.original().id) {
this is wrong and fails to compile. I was simply expecting:
if (enumConstant.id == field.original().id) {
wherefield
is a local. It seemsfield
is mistaken to be a field and the this. qualifier is added to it.The text was updated successfully, but these errors were encountered: