Previously the current class was used as declaring class; that resulted in correct code if the current class is a nested class which does not extend the class declaring the field, or if the current class is anonymous (would result in 1.field).
Example code:
class RelinkingTest {
public static final String CONSTANT = "test";
Object o = new Object() {
@Override
public String toString() {
return CONSTANT;
}
};
class Nested {
@Override
public String toString() {
return CONSTANT;
}
}
}
Decompiled output:
class RelinkingTest {
public static final String CONSTANT = "test";
Object o = new Object(){
public String toString() {
return _1.CONSTANT;
}
};
RelinkingTest() {
}
class Nested {
Nested() {
}
public String toString() {
return Nested.CONSTANT;
}
}
}
Previously the current class was used as declaring class; that resulted in correct code if the current class is a nested class which does not extend the class declaring the field, or if the current class is anonymous (would result in
1.field
).Example code:
Decompiled output: