src/share/classes/com/sun/tools/javac/jvm/ClassReader.java

changeset 2099
1b469fd31e35
parent 2047
5f915a0c9615
child 2133
19e8eebfbe52
equal deleted inserted replaced
2098:0be3f1820e8b 2099:1b469fd31e35
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

mercurial