1991 Type type = readType(nextChar()); |
1991 Type type = readType(nextChar()); |
1992 if (currentOwner.isInterface() && |
1992 if (currentOwner.isInterface() && |
1993 (flags & ABSTRACT) == 0 && !name.equals(names.clinit)) { |
1993 (flags & ABSTRACT) == 0 && !name.equals(names.clinit)) { |
1994 if (majorVersion > Target.JDK1_8.majorVersion || |
1994 if (majorVersion > Target.JDK1_8.majorVersion || |
1995 (majorVersion == Target.JDK1_8.majorVersion && minorVersion >= Target.JDK1_8.minorVersion)) { |
1995 (majorVersion == Target.JDK1_8.majorVersion && minorVersion >= Target.JDK1_8.minorVersion)) { |
1996 currentOwner.flags_field |= DEFAULT; |
1996 if ((flags & STATIC) == 0) { |
1997 flags |= DEFAULT | ABSTRACT; |
1997 currentOwner.flags_field |= DEFAULT; |
|
1998 flags |= DEFAULT | ABSTRACT; |
|
1999 } |
1998 } else { |
2000 } else { |
1999 //protect against ill-formed classfiles |
2001 //protect against ill-formed classfiles |
2000 throw new CompletionFailure(currentOwner, "default method found in pre JDK 8 classfile"); |
2002 throw badClassFile((flags & STATIC) == 0 ? "invalid.default.interface" : "invalid.static.interface", |
|
2003 Integer.toString(majorVersion), |
|
2004 Integer.toString(minorVersion)); |
2001 } |
2005 } |
2002 } |
2006 } |
2003 if (name == names.init && currentOwner.hasOuterInstance()) { |
2007 if (name == names.init && currentOwner.hasOuterInstance()) { |
2004 // Sometimes anonymous classes don't have an outer |
2008 // Sometimes anonymous classes don't have an outer |
2005 // instance, however, there is no reliable way to tell so |
2009 // instance, however, there is no reliable way to tell so |