changeset 1886:2912d9b3bbff

Cleanup: *) minimize diffs with JDK 8 master *) cleanup unused features: - private methods in interfaces - 'package' as a modifier
author mcimadamore
date Mon, 25 Feb 2013 16:01:41 +0000
parents 37abd4f2b379
children b0d74332d31f
files src/share/classes/com/sun/tools/javac/code/Flags.java src/share/classes/com/sun/tools/javac/code/Source.java src/share/classes/com/sun/tools/javac/comp/Check.java src/share/classes/com/sun/tools/javac/jvm/CRTable.java src/share/classes/com/sun/tools/javac/parser/JavacParser.java src/share/classes/com/sun/tools/javac/resources/compiler.properties test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.out test/tools/javac/defaultMethods/package/TestPackageAsModifier.java test/tools/javac/defaultMethods/private/Private01.java test/tools/javac/defaultMethods/syntax/TestDefaultMethodsSyntax.java test/tools/javac/diags/examples.not-yet.txt
diffstat 11 files changed, 37 insertions(+), 382 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/Flags.java	Fri Feb 22 16:57:52 2013 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Flags.java	Mon Feb 25 16:01:41 2013 +0000
@@ -68,7 +68,6 @@
         if ((mask&INTERFACE) != 0) flags.add(Flag.INTERFACE);
         if ((mask&ABSTRACT) != 0) flags.add(Flag.ABSTRACT);
         if ((mask&DEFAULT) != 0) flags.add(Flag.DEFAULT);
-        if ((mask&PACKAGE_PRIVATE) != 0) flags.add(Flag.PACKAGE);
         if ((mask&STRICTFP) != 0) flags.add(Flag.STRICTFP);
         if ((mask&BRIDGE) != 0) flags.add(Flag.BRIDGE);
         if ((mask&SYNTHETIC) != 0) flags.add(Flag.SYNTHETIC);
@@ -268,42 +267,35 @@
      * the public class in a source file, that could block implicit compilation.
      */
     public static final long AUXILIARY = 1L<<44;
-    
+
     /**
-     * Shadow flag for package access.
+     * Flag that marks that a symbol is not available in the current profile
      */
-    public static final long PACKAGE_PRIVATE = 1L<<45;
+    public static final long NOT_IN_PROFILE = 1L<<45;
+
     
     /**
      * Flag that marks inference variables used in a 'throws' clause
      */
     public static final long THROWS = 1L<<46;
 
-    /**
-     * Flag that marks that a symbol is not available in the current profile
-     */
-    public static final long NOT_IN_PROFILE = 1L<<45;
-
     /** Modifier masks.
      */
     public static final int
         AccessFlags           = PUBLIC | PROTECTED | PRIVATE,
-        LocalClassFlags       = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,        
+        LocalClassFlags       = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
+        MemberClassFlags      = LocalClassFlags | INTERFACE | AccessFlags,
         ClassFlags            = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
         InterfaceVarFlags     = FINAL | STATIC | PUBLIC,
-        InterfaceMethodFlags  = ABSTRACT | PUBLIC;
-        
+        VarFlags              = AccessFlags | FINAL | STATIC |
+                                VOLATILE | TRANSIENT | ENUM,
+        ConstructorFlags      = AccessFlags,
+        InterfaceMethodFlags  = ABSTRACT | PUBLIC,
+        MethodFlags           = AccessFlags | ABSTRACT | STATIC | NATIVE |
+                                SYNCHRONIZED | FINAL | STRICTFP;
     public static final long
-        ExtendedAccessFlags         = AccessFlags | PACKAGE_PRIVATE,
-        VarFlags                    = ExtendedAccessFlags | FINAL | STATIC |
-                                           VOLATILE | TRANSIENT | ENUM,
-        ConstructorFlags            = ExtendedAccessFlags,
-        MethodFlags                 = ExtendedAccessFlags | ABSTRACT | STATIC | NATIVE |
-                                      SYNCHRONIZED | FINAL | STRICTFP,
-        ExtendedClassFlags          = ClassFlags | PACKAGE_PRIVATE,
-        MemberClassFlags            = LocalClassFlags | INTERFACE | ExtendedAccessFlags,        
-        ExtendedStandardFlags       = (long)StandardFlags | DEFAULT | PACKAGE_PRIVATE,
-        InterfaceMethodMask         = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
+        ExtendedStandardFlags       = (long)StandardFlags | DEFAULT,
+        InterfaceMethodMask         = ABSTRACT | STATIC | PUBLIC | STRICTFP | DEFAULT,
         LocalVarFlags               = FINAL | PARAMETER;
 
 
--- a/src/share/classes/com/sun/tools/javac/code/Source.java	Fri Feb 22 16:57:52 2013 +0000
+++ b/src/share/classes/com/sun/tools/javac/code/Source.java	Mon Feb 25 16:01:41 2013 +0000
@@ -203,15 +203,9 @@
     public boolean allowDefaultMethods() {
         return compareTo(JDK1_8) >= 0;
     }
-    public boolean allowPackageModifier() {
-        return compareTo(JDK1_8) >= 0;
-    }
     public boolean allowStaticInterfaceMethods() {
         return compareTo(JDK1_8) >= 0;
     }
-    public boolean allowPrivateInterfaceMethods() {
-        return compareTo(JDK1_8) >= 0;
-    }
     public boolean allowStrictMethodClashCheck() {
         return compareTo(JDK1_8) >= 0;
     }
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Fri Feb 22 16:57:52 2013 +0000
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Feb 25 16:01:41 2013 +0000
@@ -1064,9 +1064,9 @@
                 } else
                     mask = ConstructorFlags;
             }  else if ((sym.owner.flags_field & INTERFACE) != 0) {
-                if ((flags & (DEFAULT | STATIC | PRIVATE)) != 0) {
+                if ((flags & (DEFAULT | STATIC)) != 0) {
                     mask = InterfaceMethodMask;
-                    implicit = (flags & PRIVATE) != 0 ? 0 : PUBLIC;
+                    implicit = PUBLIC;
                     if ((flags & DEFAULT) != 0) {
                         implicit |= ABSTRACT;
                     }
@@ -1104,7 +1104,7 @@
                 // Nested interfaces and enums are always STATIC (Spec ???)
                 if ((flags & (INTERFACE | ENUM)) != 0 ) implicit = STATIC;
             } else {
-                mask = ExtendedClassFlags;
+                mask = ClassFlags;
             }
             // Interfaces are always ABSTRACT
             if ((flags & INTERFACE) != 0) implicit |= ABSTRACT;
@@ -1143,14 +1143,6 @@
                                 DEFAULT)
                  &&
                  checkDisjoint(pos, flags,
-                                PRIVATE,
-                                DEFAULT)
-                 &&
-                 (sym.kind == TYP || (sym.owner.flags_field & INTERFACE) == 0 || checkDisjoint(pos, flags,
-                                PRIVATE,
-                                STATIC))
-                 &&
-                 checkDisjoint(pos, flags,
                                ABSTRACT | INTERFACE,
                                FINAL | NATIVE | SYNCHRONIZED)
                  &&
@@ -1163,10 +1155,6 @@
                                PUBLIC | PROTECTED)
                  &&
                  checkDisjoint(pos, flags,
-                               PACKAGE_PRIVATE,
-                               PUBLIC | PROTECTED | PRIVATE)
-                 &&
-                 checkDisjoint(pos, flags,
                                FINAL,
                                VOLATILE)
                  &&
--- a/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Fri Feb 22 16:57:52 2013 +0000
+++ b/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Mon Feb 25 16:01:41 2013 +0000
@@ -475,12 +475,6 @@
             result = sr;
         }
 
-        public void visitReference(JCMemberReference tree) {
-            SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
-            sr.mergeWith(csp(tree.expr));
-            result = sr;
-        }
-
         public void visitIdent(JCIdent tree) {
             SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
             result = sr;
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Fri Feb 22 16:57:52 2013 +0000
+++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Feb 25 16:01:41 2013 +0000
@@ -162,8 +162,6 @@
         this.allowStaticInterfaceMethods = source.allowStaticInterfaceMethods();
         this.allowIntersectionTypesInCast = source.allowIntersectionTypesInCast();
         this.allowTypeAnnotations = source.allowTypeAnnotations();
-        this.allowPackageModifier = source.allowPackageModifier();
-        this.allowPrivateInterfaceMethods = source.allowPrivateInterfaceMethods();
         this.keepDocComments = keepDocComments;
         docComments = newDocCommentTable(keepDocComments, fac);
         this.keepLineMap = keepLineMap;
@@ -241,16 +239,6 @@
      */
     boolean allowStaticInterfaceMethods;
 
-
-    /** Switch: should we allow 'package' as a modifier?
-     */
-    boolean allowPackageModifier;
-    
-    
-    /** Switch: should we allow private (instance) methods in interfaces?
-     */
-    boolean allowPrivateInterfaceMethods;
-
     /** Switch: should we allow intersection types in cast?
      */
     boolean allowIntersectionTypesInCast;
@@ -2759,12 +2747,9 @@
      *           | "@" Annotation
      */
     JCModifiers modifiersOpt() {
-        return modifiersOpt(null, false);
+        return modifiersOpt(null);
     }
-    JCModifiers modifiersOpt(boolean skipPackage) {
-        return modifiersOpt(null, skipPackage);
-    }
-    protected JCModifiers modifiersOpt(JCModifiers partial, boolean skipPackage) {
+    protected JCModifiers modifiersOpt(JCModifiers partial) {
         long flags;
         ListBuffer<JCAnnotation> annotations = new ListBuffer<JCAnnotation>();
         int pos;
@@ -2797,7 +2782,6 @@
             case STRICTFP    : flag = Flags.STRICTFP; break;
             case MONKEYS_AT  : flag = Flags.ANNOTATION; break;
             case DEFAULT     : checkDefaultMethods(); flag = Flags.DEFAULT; break;
-            case PACKAGE     : if (skipPackage) break loop; checkPackageModifier(); flag = Flags.PACKAGE_PRIVATE; break;
             case ERROR       : flag = 0; nextToken(); break;
             default: break loop;
             }
@@ -3053,22 +3037,18 @@
         boolean seenPackage = false;
         List<JCAnnotation> packageAnnotations = List.nil();
         if (token.kind == MONKEYS_AT)
-            mods = modifiersOpt(true);
+            mods = modifiersOpt();
 
         if (token.kind == PACKAGE) {
-            if (peekToken(LAX_IDENTIFIER)) {
-                seenPackage = true;
-                if (mods != null) {
-                    checkNoMods(mods.flags);
-                    packageAnnotations = mods.annotations;
-                    mods = null;
-                }
-                nextToken();
-                pid = qualident(false);
-                accept(SEMI);
-            } else {
-                mods = modifiersOpt(mods, false);
+            seenPackage = true;
+            if (mods != null) {
+                checkNoMods(mods.flags);
+                packageAnnotations = mods.annotations;
+                mods = null;
             }
+            nextToken();
+            pid = qualident(false);
+            accept(SEMI);
         }
         ListBuffer<JCTree> defs = new ListBuffer<JCTree>();
         boolean checkForImports = true;
@@ -3148,7 +3128,7 @@
             nextToken();
             return toP(F.at(pos).Skip());
         } else {
-            return classOrInterfaceOrEnumDeclaration(modifiersOpt(mods, false), docComment);
+            return classOrInterfaceOrEnumDeclaration(modifiersOpt(mods), docComment);
         }
     }
 
@@ -3495,9 +3475,6 @@
         if (isInterface && (mods.flags & Flags.STATIC) != 0) {
             checkStaticInterfaceMethods();
         }
-        if (isInterface && (mods.flags & Flags.PRIVATE) != 0) {
-            checkPrivateInterfaceMethods();
-        }
         JCVariableDecl prevReceiverParam = this.receiverParam;
         try {
             this.receiverParam = null;
@@ -4022,18 +3999,6 @@
             allowTypeAnnotations = true;
         }
     }
-    void checkPackageModifier() {
-        if (!allowPackageModifier) {
-            log.error(token.pos, "pckge.mod.not.supported.in.source", source.name);
-            allowPackageModifier = true;
-        }
-    }
-    void checkPrivateInterfaceMethods() {
-        if (!allowStaticInterfaceMethods) {
-            log.error(token.pos, "private.intf.methods.not.supported.in.source", source.name);
-            allowStaticInterfaceMethods = true;
-        }
-    }
 
     /*
      * a functional source tree and end position mappings
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Feb 22 16:57:52 2013 +0000
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Feb 25 16:01:41 2013 +0000
@@ -2255,17 +2255,6 @@
     static interface methods are not supported in -source {0}\n\
     (use -source 8 or higher to enable static interface methods)
 
-
-# 0: string
-compiler.err.pckge.mod.not.supported.in.source=\
-    ''package'' as a modifier is not supported in -source {0}\n\
-    (use -source 8 or higher to enable ''package'' as a modifier)
-
-# 0: string
-compiler.err.private.intf.methods.not.supported.in.source=\
-    private interface methods are not supported in -source {0}\n\
-    (use -source 8 or higher to enable private interface methods)
-
 ########################################
 # Diagnostics for verbose resolution
 # used by Resolve (debug only)
--- a/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.out	Fri Feb 22 16:57:52 2013 +0000
+++ b/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.out	Mon Feb 25 16:01:41 2013 +0000
@@ -1,2 +1,3 @@
-AnnotatedPackage2.java:9:12: compiler.err.expected3: class, interface, enum
-1 error
+AnnotatedPackage2.java:9:8: compiler.err.expected: token.identifier
+AnnotatedPackage2.java:9:10: compiler.err.expected3: class, interface, enum
+2 errors
--- a/test/tools/javac/defaultMethods/package/TestPackageAsModifier.java	Fri Feb 22 16:57:52 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary Automatic test for checking support for 'package' as modifier
- */
-
-import com.sun.source.util.JavacTask;
-import java.net.URI;
-import java.util.Arrays;
-import java.util.List;
-import javax.tools.Diagnostic;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileObject;
-import javax.tools.SimpleJavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.ToolProvider;
-
-
-public class TestPackageAsModifier {
-
-    static int checkCount = 0;
-
-    enum VersionKind {
-        PRE_LAMBDA("7"),
-        LAMBDA("8");
-
-        String versionString;
-
-        VersionKind(String versionString) {
-            this.versionString = versionString;
-        }
-
-        List<String> getOptions() {
-            return Arrays.asList("-source", versionString);
-        }
-    }
-
-    enum ModifierKind {
-        NONE(""),
-        PUBLIC("public"),
-        PROTECTED("protected"),
-        PRIVATE("private"),
-        PACKAGE("package");
-
-        String modStr;
-
-        private ModifierKind(String modStr) {
-            this.modStr = modStr;
-        }
-        
-        static boolean intersect(ModifierKind mk, ModifierKind... mks) {
-            for (ModifierKind mk2 : mks) {
-                if (mk == mk2) return true;
-            }
-            return false;
-        }
-    }
-    
-    enum PackageKind {
-        PACKAGE("package foo;"),
-        NO_PACKAGE("");
-        
-        String packageKind;
-
-        PackageKind(String packageKind) {
-            this.packageKind = packageKind;
-        }
-    }
-    
-    enum AnnotationKind {
-        ANNO("@Anno"),
-        NO_ANNO("");
-        
-        String annoString;
-
-        AnnotationKind(String annoString) {
-            this.annoString = annoString;
-        }
-    }
-
-    enum DeclKind {
-        ABSTRACT_CLASS("abstract class Foo { }"),
-        CLASS("class Foo { }"),
-        ENUM("enum Foo { }"),
-        INTERFACE("interface Foo { }"),
-        ANNOTATION("@interface Foo { }"),
-        VAR("String foo;"),
-        METHOD("String foo() { return null; }");
-
-        String declStr;
-
-        private DeclKind(String declStr) {
-            this.declStr = declStr;
-        }
-    }
-
-    public static void main(String... args) throws Exception {
-
-        //create default shared JavaCompiler - reused across multiple compilations
-        JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
-        StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
-
-        for (VersionKind vk : VersionKind.values()) {
-            for (AnnotationKind ak : AnnotationKind.values()) {
-                for (PackageKind pk : PackageKind.values()) {
-                    for (ModifierKind modk1 : ModifierKind.values()) {
-                        for (ModifierKind modk2 : ModifierKind.values()) {
-                            for (DeclKind dk : DeclKind.values()) {
-                                new TestPackageAsModifier(vk, ak, pk, modk1, modk2, dk).run(comp, fm);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        System.out.println("Total check executed: " + checkCount);
-    }
-
-    VersionKind vk;
-    AnnotationKind ak;
-    PackageKind pk;
-    ModifierKind modk1, modk2;
-    DeclKind dk;
-    JavaSource source;
-    DiagnosticChecker diagChecker;
-
-    public TestPackageAsModifier(VersionKind vk, AnnotationKind ak, PackageKind pk, ModifierKind modk1, ModifierKind modk2, DeclKind dk) {
-        this.vk = vk;
-        this.ak = ak;
-        this.pk = pk;
-        this.modk1 = modk1;
-        this.modk2 = modk2;
-        this.dk = dk;
-        this.source = new JavaSource();
-        this.diagChecker = new DiagnosticChecker();
-    }
-
-    class JavaSource extends SimpleJavaFileObject {
-
-        String template = "#AK\n" +
-                          "#PK\n" +
-                          "class Test {\n" +
-                          "   #MOD1 #MOD2 #DK\n" +
-                          "}\n" +
-                          "@interface Anno { }\n";
-
-        String source;
-
-        public JavaSource() {
-            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
-            source = template.replaceAll("#AK", ak.annoString)
-                    .replaceAll("#PK", pk.packageKind)
-                    .replaceAll("#MOD1", modk1.modStr)
-                    .replaceAll("#MOD2", modk2.modStr)
-                    .replaceAll("#DK", dk.declStr);
-        }
-
-        @Override
-        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
-            return source;
-        }
-    }
-
-    void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
-        JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
-                vk.getOptions(), null, Arrays.asList(source));
-        try {
-            ct.analyze();
-        } catch (Throwable ex) {
-            throw new AssertionError("Error thrown when analyzing the following source:\n" + source.getCharContent(true));
-        }
-        check();
-    }
-
-    void check() {
-        boolean errorExpected = ModifierKind.intersect(ModifierKind.PACKAGE, modk1, modk2) &&
-                vk == VersionKind.PRE_LAMBDA;
-
-        errorExpected |= !ModifierKind.intersect(ModifierKind.NONE, modk1, modk2);
-        
-        errorExpected |= pk == PackageKind.PACKAGE && ak == AnnotationKind.ANNO;
-
-        checkCount++;
-        if (diagChecker.errorFound != errorExpected) {
-            throw new AssertionError("Problem when compiling source:\n" + source.getCharContent(true) +
-                    "\nfound error: " + diagChecker.errorFound);
-        }
-    }
-
-    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
-
-        boolean errorFound;
-
-        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
-            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
-                errorFound = true;
-            }
-        }
-    }
-}
--- a/test/tools/javac/defaultMethods/private/Private01.java	Fri Feb 22 16:57:52 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @summary smoke test for private interface methods featuring accessor methods
- * @compile Private01.java
- */
-public class Private01 {
-    interface P {
-        private void foo() { System.out.println("foo!" + this); }
-        default void m() {
-           new Object() { void test() { foo(); } }.test();
-        }
-    }
-
-    public static void main(String[] args) {
-        P p = new P() {};
-        p.m(); p.foo();
-    }
-}
--- a/test/tools/javac/defaultMethods/syntax/TestDefaultMethodsSyntax.java	Fri Feb 22 16:57:52 2013 +0000
+++ b/test/tools/javac/defaultMethods/syntax/TestDefaultMethodsSyntax.java	Mon Feb 25 16:01:41 2013 +0000
@@ -87,8 +87,7 @@
         static boolean compatible(MethodKind mk, ModifierKind mod1, ModifierKind mod2, EnclosingKind ek) {
             if (intersect(ABSTRACT, mod1, mod2) || intersect(NATIVE, mod1, mod2)) {
                 return mk == MethodKind.NO_BODY;
-            } else if (intersect(DEFAULT, mod1, mod2) || intersect(STATIC, mod1, mod2)
-                    || intersect(PRIVATE, mod1, mod2)) {
+            } else if (intersect(DEFAULT, mod1, mod2) || intersect(STATIC, mod1, mod2)) {
                 return mk == MethodKind.BODY;
             } else {
                 return ek == EnclosingKind.INTERFACE ?
@@ -98,6 +97,7 @@
 
         boolean compatible(EnclosingKind ek) {
             switch (this) {
+                case PRIVATE:
                 case PROTECTED:
                     return ek != EnclosingKind.INTERFACE;
                 default:
@@ -149,16 +149,16 @@
 
         static Result[][] allowedModifierPairs = {
             /*                     NONE  PUBLIC  PROTECTED  PRIVATE  ABSTRACT  STATIC  NATIVE  SYNCHRONIZED  FINAL  STRICTFP  DEFAULT */
-            /* NONE */           { T   , T    , C        , T       , T       , T     , C     , C           , C    , C       , I   },
+            /* NONE */           { T   , T    , C        , C       , T       , T     , C     , C           , C    , C       , I   },
             /* PUBLIC */         { T   , F    , F        , F       , T       , T     , C     , C           , C    , C       , I   },
             /* PROTECTED */      { C   , F    , F        , F       , C       , C     , C     , C           , C    , C       , F   },
-            /* PRIVATE */        { T   , F    , F        , F       , F       , C     , C     , C           , C    , T       , F   },
+            /* PRIVATE */        { C   , F    , F        , F       , F       , C     , C     , C           , C    , C       , F   },
             /* ABSTRACT */       { T   , T    , C        , F       , F       , F     , F     , F           , F    , F       , F   },
             /* STATIC */         { T   , T    , C        , C       , F       , F     , C     , C           , C    , T       , F   },
             /* NATIVE */         { C   , C    , C        , C       , F       , C     , F     , C           , C    , F       , F   },
             /* SYNCHRONIZED */   { C   , C    , C        , C       , F       , C     , C     , F           , C    , C       , F   },
             /* FINAL */          { C   , C    , C        , C       , F       , C     , C     , C           , F    , C       , F   },
-            /* STRICTFP */       { C   , C    , C        , T       , F       , T     , F     , C           , C    , F       , I   },
+            /* STRICTFP */       { C   , C    , C        , C       , F       , T     , F     , C           , C    , F       , I   },
             /* DEFAULT */        { I   , I    , F        , F       , F       , F     , F     , F           , F    , I       , F   }};
     }
 
@@ -266,9 +266,6 @@
 
         errorExpected |= ModifierKind.intersect(ModifierKind.STATIC, modk1, modk2) &&
                 ek == EnclosingKind.INTERFACE && vk == VersionKind.PRE_LAMBDA;
-        
-        errorExpected |= ModifierKind.intersect(ModifierKind.PRIVATE, modk1, modk2) &&
-                ek == EnclosingKind.INTERFACE && vk == VersionKind.PRE_LAMBDA;
 
         checkCount++;
         if (diagChecker.errorFound != errorExpected) {
--- a/test/tools/javac/diags/examples.not-yet.txt	Fri Feb 22 16:57:52 2013 +0000
+++ b/test/tools/javac/diags/examples.not-yet.txt	Mon Feb 25 16:01:41 2013 +0000
@@ -110,7 +110,5 @@
 compiler.warn.unexpected.archive.file                   # Paths: zip file with unknown extn
 compiler.warn.unknown.enum.constant                     # in bad class file
 compiler.warn.unknown.enum.constant.reason              # in bad class file
-compiler.err.private.intf.methods.not.supported.in.source                        #LAMBDA
-compiler.err.pckge.mod.not.supported.in.source                                   #LAMBDA
 compiler.misc.incompatible.arg.types.in.mref                                     #LAMBDA
 compiler.misc.static.method.in.unbound.lookup                                    #LAMBDA