Preventing AssertionError from Types.isSubType (reported by err@netbeans.org). (backported from NetBeans proper) release701
authorJan Lahoda <jlahoda@netbeans.org>
Sun, 10 Jul 2011 21:50:05 +0200
branchrelease701
changeset 632fcb0069e23c5
parent 576 5bcf835607de
child 648 cb630b7113bf
Preventing AssertionError from Types.isSubType (reported by err@netbeans.org). (backported from NetBeans proper)
api/src/org/netbeans/modules/jackpot30/impl/pm/CopyFinder.java
api/test/unit/src/org/netbeans/modules/jackpot30/impl/pm/CopyFinderTest.java
     1.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/pm/CopyFinder.java	Mon Jun 06 21:57:45 2011 +0200
     1.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/pm/CopyFinder.java	Sun Jul 10 21:50:05 2011 +0200
     1.3 @@ -309,7 +309,7 @@
     1.4          return false;
     1.5      }
     1.6  
     1.7 -    private static final Set<TypeKind> IGNORE_KINDS = EnumSet.of(TypeKind.EXECUTABLE, TypeKind.PACKAGE, TypeKind.ERROR);
     1.8 +    private static final Set<TypeKind> IGNORE_KINDS = EnumSet.of(TypeKind.EXECUTABLE, TypeKind.PACKAGE, TypeKind.ERROR, TypeKind.OTHER);
     1.9  
    1.10      private TreePath currentPath;
    1.11  
     2.1 --- a/api/test/unit/src/org/netbeans/modules/jackpot30/impl/pm/CopyFinderTest.java	Mon Jun 06 21:57:45 2011 +0200
     2.2 +++ b/api/test/unit/src/org/netbeans/modules/jackpot30/impl/pm/CopyFinderTest.java	Sun Jul 10 21:50:05 2011 +0200
     2.3 @@ -322,4 +322,16 @@
     2.4                               false,
     2.5                               true);
     2.6      }
     2.7 +    public void testIgnoreOtherKind() throws Exception {
     2.8 +        performVariablesTest("package test; public class Test { private java.util.Collection<String> x() { return java.util.Collections.emptySet(); } } }",
     2.9 +                             "$i{java.lang.Class}",
    2.10 +                             new Pair[] {
    2.11 +                             },
    2.12 +                             new Pair[] {
    2.13 +                             },
    2.14 +                             new Pair[] {
    2.15 +                             },
    2.16 +                             true,
    2.17 +                             true);
    2.18 +    }
    2.19  }