Fixed 'IDEA-128676: Initializer in a nested class disappears'
This commit is contained in:
parent
887c093afd
commit
c672e5bc83
@ -208,7 +208,9 @@ public class InitializerProcessor {
|
||||
AssignmentExprent asexpr = (AssignmentExprent)exprent;
|
||||
if(asexpr.getLeft().type == Exprent.EXPRENT_FIELD) {
|
||||
FieldExprent fexpr = (FieldExprent)asexpr.getLeft();
|
||||
if(!fexpr.isStatic() && fexpr.getClassname().equals(cl.qualifiedName)) {
|
||||
if(!fexpr.isStatic() && fexpr.getClassname().equals(cl.qualifiedName) &&
|
||||
cl.hasField(fexpr.getName(), fexpr.getDescriptor().descriptorString)) { // check for the physical existence of the field. Could be defined in a superclass.
|
||||
|
||||
if(isExprentIndependent(asexpr.getRight(), lstMethWrappers.get(i))) {
|
||||
String fieldKey = InterpreterUtil.makeUniqueKey(fexpr.getName(), fexpr.getDescriptor().descriptorString);
|
||||
if(fieldWithDescr == null) {
|
||||
|
@ -118,6 +118,10 @@ public class StructClass {
|
||||
// public methods
|
||||
// *****************************************************************************
|
||||
|
||||
public boolean hasField(String name, String descriptor) {
|
||||
return getField(name, descriptor) != null;
|
||||
}
|
||||
|
||||
public StructField getField(String name, String descriptor) {
|
||||
return fields.getWithKey(InterpreterUtil.makeUniqueKey(name, descriptor));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user