JavaFileAnalyzer2 extends JavaParserBaseListener implements FileAnalyzer { @Override public Map<ConstructId, Construct> getConstructs() throws FileAnalysisException { if (this.constructs == null) { try { this.constructs = new TreeMap<ConstructId, Construct>(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (final InputStream is2 = new BufferedInputStream(new FileInputStream(this.file))) { int cc = -1; while ((cc = is2.read()) >= 0) baos.write(cc); } baos.flush(); this.input = new ANTLRInputStream(new ByteArrayInputStream(baos.toByteArray())); JavaLexer lexer = new JavaLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); JavaParser parser = new JavaParser(tokens); CompilationUnitContext ctx = parser.compilationUnit(); ParseTreeWalker walker = new ParseTreeWalker(); walker.walk(this, ctx); } catch (FileNotFoundException e) { throw new FileAnalysisException(e.getMessage(), e); } catch (RecognitionException e) { throw new FileAnalysisException( "ANTLR exception while analysing class file [" + this.file.getName() + "]: " + e.getMessage(), e); } catch (IOException e) { throw new FileAnalysisException( "I/O exception while analysing class file [" + this.file.getName() + "]: " + e.getMessage(), e); } catch (Exception e) { throw new FileAnalysisException( "Exception of type [" + e.getClass().getSimpleName() + "] while analyzing file [" + this.file.toPath().toAbsolutePath() + "]: " + e.getMessage(), e); } } return this.constructs; }  @Override String[] getSupportedFileExtensions(); @Override boolean canAnalyze(File _file); @Override void analyze(final File _file); void setFile(File _file); @Override void enterPackageDeclaration(@NotNull JavaParser.PackageDeclarationContext ctx); @Override void enterEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx); @Override void exitEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx); @Override void enterInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx); @Override void exitInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx); @Override void enterClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx); @Override void exitClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx); @Override void enterClassBody(@NotNull JavaParser.ClassBodyContext ctx); @Override void exitClassBody(@NotNull JavaParser.ClassBodyContext ctx); @Override void enterMethodDeclaration(@NotNull JavaParser.MethodDeclarationContext ctx); @Override void exitMethodDeclaration(
      org.eclipse.steady.java.antlr.JavaParser.MethodDeclarationContext ctx); @Override void enterConstructorDeclaration(@NotNull JavaParser.ConstructorDeclarationContext ctx); @Override void exitConstructorDeclaration(
      org.eclipse.steady.java.antlr.JavaParser.ConstructorDeclarationContext ctx); @Override Map<ConstructId, Construct> getConstructs(); @Override boolean containsConstruct(ConstructId _id); @Override Construct getConstruct(ConstructId _id); @Override boolean hasChilds(); @Override Set<FileAnalyzer> getChilds(boolean _recursive);  }
@Test public void testClassWithoutPackage() { try { final JavaFileAnalyzer2 jfa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer( new File("./src/test/java/ClassWithoutPackage.java")); final Map<ConstructId, Construct> constructs_from_java = jfa.getConstructs(); final ClassFileAnalyzer cfa = (ClassFileAnalyzer) FileAnalyzerFactory.buildFileAnalyzer( new File("./target/test-classes/ClassWithoutPackage.class")); final Map<ConstructId, Construct> constructs_from_class = cfa.getConstructs(); final JavaClassId cl = JavaId.parseClassQName("ClassWithoutPackage"); final JavaConstructorId co = JavaId.parseConstructorQName("ClassWithoutPackage()"); final JavaMethodId m = JavaId.parseMethodQName("ClassWithoutPackage.foo()"); assertEquals(3, constructs_from_java.size()); assertTrue(constructs_from_java.containsKey(cl)); assertTrue(constructs_from_java.containsKey(co)); assertTrue(constructs_from_java.containsKey(m)); assertEquals(3, constructs_from_class.size()); assertTrue(constructs_from_class.containsKey(cl)); assertTrue(constructs_from_java.containsKey(co)); assertTrue(constructs_from_class.containsKey(m)); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } }
@Test public void testAnonClassInInterfaceInit() { try { final JavaFileAnalyzer2 jfa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer( new File("./src/test/java/org/eclipse/steady/java/test/ConfigurationKey.java")); final Map<ConstructId, Construct> constructs = jfa.getConstructs(); final JavaPackageId p = new JavaPackageId("org.eclipse.steady.java.test"); final JavaClassId anon1 = JavaId.parseClassQName("org.eclipse.steady.java.test.ConfigurationKey$1"); final JavaMethodId anon1_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.ConfigurationKey$1.compare(ConfigurationKey,ConfigurationKey)"); final JavaClassId anon2 = JavaId.parseClassQName("org.eclipse.steady.java.test.ConfigurationKey$2"); final JavaMethodId anon2_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.ConfigurationKey$2.compare(ConfigurationKey,ConfigurationKey)"); assertEquals(5, constructs.size()); assertTrue(constructs.containsKey(p)); assertTrue(constructs.containsKey(anon1)); assertTrue(constructs.containsKey(anon1_m)); assertTrue(constructs.containsKey(anon2)); assertTrue(constructs.containsKey(anon2_m)); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } }
@Test public void testNamedClassInInterfaceAndAnonClassInConstructor() { try { final JavaFileAnalyzer2 jfa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer( new File( "./src/test/java/org/eclipse/steady/java/test/HttpRequestCompletionLog.java")); final Map<ConstructId, Construct> constructs = jfa.getConstructs(); final JavaPackageId p = new JavaPackageId("org.eclipse.steady.java.test"); final JavaClassId named_class = JavaId.parseClassQName("org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder"); final JavaConstructorId named_class_cons = JavaId.parseConstructorQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder(String,String)"); final JavaMethodId named_class_m1 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.forTarget(String,String)"); final JavaMethodId named_class_m2 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withStartTimeInMillis(long)"); final JavaMethodId named_class_m3 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withDurationInMillis(long)"); final JavaMethodId named_class_m4 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withRequestEntitySizeInBytes(long)"); final JavaMethodId named_class_m5 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withResponseEntitySizeInBytes(long)"); final JavaMethodId named_class_m6 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withResponseStatus(int)"); final JavaMethodId named_class_m7 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withResponseReasonPhrase(String)"); final JavaMethodId named_class_m8 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.withResponseContentType(String)"); final JavaMethodId named_class_m9 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder.build()"); final JavaClassId anon_class = JavaId.parseClassQName("org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1"); final JavaMethodId anon_class_m1 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.toString()"); final JavaMethodId anon_class_m2 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getDestination()"); final JavaMethodId anon_class_m3 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getTargetPath()"); final JavaMethodId anon_class_m4 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getStartTimeInMillis()"); final JavaMethodId anon_class_m5 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getDurationInMillis()"); final JavaMethodId anon_class_m6 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getRequestEntitySizeInBytes()"); final JavaMethodId anon_class_m7 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getResponseEntitySizeInBytes()"); final JavaMethodId anon_class_m8 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getResponseStatus()"); final JavaMethodId anon_class_m9 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getResponseReasonPhrase()"); final JavaMethodId anon_class_m10 = JavaId.parseMethodQName( "org.eclipse.steady.java.test.HttpRequestCompletionLog$Builder$1.getResponseContentType()"); assertEquals(23, constructs.size()); assertTrue(constructs.containsKey(p)); assertTrue(constructs.containsKey(named_class)); assertTrue(constructs.containsKey(named_class_cons)); assertTrue(constructs.containsKey(named_class_m1)); assertTrue(constructs.containsKey(named_class_m2)); assertTrue(constructs.containsKey(named_class_m3)); assertTrue(constructs.containsKey(named_class_m4)); assertTrue(constructs.containsKey(named_class_m5)); assertTrue(constructs.containsKey(named_class_m6)); assertTrue(constructs.containsKey(named_class_m7)); assertTrue(constructs.containsKey(named_class_m8)); assertTrue(constructs.containsKey(named_class_m9)); assertTrue(constructs.containsKey(anon_class)); assertTrue(constructs.containsKey(anon_class_m1)); assertTrue(constructs.containsKey(anon_class_m2)); assertTrue(constructs.containsKey(anon_class_m3)); assertTrue(constructs.containsKey(anon_class_m4)); assertTrue(constructs.containsKey(anon_class_m5)); assertTrue(constructs.containsKey(anon_class_m6)); assertTrue(constructs.containsKey(anon_class_m7)); assertTrue(constructs.containsKey(anon_class_m8)); assertTrue(constructs.containsKey(anon_class_m9)); assertTrue(constructs.containsKey(anon_class_m10)); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } }
@Test public void testEnumAndNamedClassesInMethod() { try { final JavaFileAnalyzer2 jfa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer( new File("./src/test/java/org/eclipse/steady/java/test/ConfigKey.java")); final Map<ConstructId, Construct> constructs = jfa.getConstructs(); final JavaPackageId p = new JavaPackageId("org.eclipse.steady.java.test"); final JavaEnumId e = JavaId.parseEnumQName("org.eclipse.steady.java.test.ConfigKey"); final JavaConstructorId enum_c1 = JavaId.parseConstructorQName( "org.eclipse.steady.java.test.ConfigKey(Class,String,String)"); final JavaMethodId enum_m1 = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey.getType()"); final JavaMethodId enum_m2 = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey.getKey()"); final JavaMethodId enum_m3 = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey.getDefaultValue()"); final JavaMethodId enum_m4 = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey.fromKey(String)"); final JavaClassId anon_class = JavaId.parseClassQName("org.eclipse.steady.java.test.ConfigKey$1"); final JavaMethodId anon_class_m1 = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey$1.foo()"); final JavaClassId nc1 = JavaId.parseClassQName("org.eclipse.steady.java.test.ConfigKey$1InnerClass1"); final JavaConstructorId nc1_c = JavaId.parseConstructorQName("org.eclipse.steady.java.test.ConfigKey$1InnerClass1()"); final JavaMethodId nc1_m = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey$1InnerClass1.foo()"); final JavaClassId nc2 = JavaId.parseClassQName("org.eclipse.steady.java.test.ConfigKey$1InnerClass2"); final JavaMethodId nc2_m = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey$1InnerClass2.foo()"); final JavaClassId nc3 = JavaId.parseClassQName("org.eclipse.steady.java.test.ConfigKey$2InnerClass1"); final JavaConstructorId nc3_c = JavaId.parseConstructorQName("org.eclipse.steady.java.test.ConfigKey$2InnerClass1()"); final JavaMethodId nc3_m = JavaId.parseMethodQName("org.eclipse.steady.java.test.ConfigKey$2InnerClass1.foo()"); assertEquals(17, constructs.size()); assertTrue(constructs.containsKey(p)); assertTrue(constructs.containsKey(e)); assertTrue(constructs.containsKey(enum_c1)); assertTrue(constructs.containsKey(enum_m1)); assertTrue(constructs.containsKey(enum_m2)); assertTrue(constructs.containsKey(enum_m3)); assertTrue(constructs.containsKey(enum_m4)); assertTrue(constructs.containsKey(anon_class)); assertTrue(constructs.containsKey(anon_class_m1)); assertTrue(constructs.containsKey(nc1)); assertTrue(constructs.containsKey(nc1_c)); assertTrue(constructs.containsKey(nc1_m)); assertTrue(constructs.containsKey(nc2)); assertTrue(constructs.containsKey(nc2_m)); assertTrue(constructs.containsKey(nc3)); assertTrue(constructs.containsKey(nc3_c)); assertTrue(constructs.containsKey(nc3_m)); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } }
@Test public void testVanilla() { try { final JavaFileAnalyzer2 jfa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer( new File("./src/test/java/org/eclipse/steady/java/test/Vanilla.java")); final Map<ConstructId, Construct> constructs = jfa.getConstructs(); final JavaPackageId p = new JavaPackageId("org.eclipse.steady.java.test"); final JavaClassId cl = JavaId.parseClassQName("org.eclipse.steady.java.test.Vanilla"); final JavaConstructorId cons = JavaId.parseConstructorQName("org.eclipse.steady.java.test.Vanilla(String)"); final JavaMethodId meth = JavaId.parseMethodQName("org.eclipse.steady.java.test.Vanilla.foo(String)"); final JavaMethodId meth2 = JavaId.parseMethodQName("org.eclipse.steady.java.test.Vanilla.vuln(String)"); assertEquals(5, constructs.size()); assertTrue(constructs.containsKey(p)); assertTrue(constructs.containsKey(cl)); assertTrue(constructs.containsKey(cons)); assertTrue(constructs.containsKey(meth)); assertTrue(constructs.containsKey(meth2)); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } }
@Test public void testCxfClasses() throws FileAnalysisException { final FileAnalyzer fv = FileAnalyzerFactory.buildFileAnalyzer( Paths.get( "./src/test/resources/ws_security_1438423/src/main/java/org/apache/cxf/ws/security/cache") .toFile()); final Map<ConstructId, Construct> constructs = fv.getConstructs(); assertEquals(35, constructs.size()); }
@Test public void testNestedDeclarationMess() { try { final File file = new File("./src/test/java/org/eclipse/steady/java/test/NestedDeclarations.java"); final FileAnalyzer fa = FileAnalyzerFactory.buildFileAnalyzer(file); final Map<ConstructId, Construct> constructs = fa.getConstructs(); final JavaPackageId p = new JavaPackageId("org.eclipse.steady.java.test"); final JavaClassId cl1 = JavaId.parseClassQName("org.eclipse.steady.java.test.NestedDeclarations"); final JavaMethodId cl1_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations.doSomething()"); final JavaClassId cl2 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$DoSomethingElse$DoThis"); final JavaMethodId cl2_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$DoSomethingElse$DoThis.doThis()"); final JavaClassId cl3 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$DoSomethingElse$DoThis$1"); final JavaMethodId cl3_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$DoSomethingElse$DoThis$1.doThat()"); final JavaClassId cl4 = JavaId.parseClassQName("org.eclipse.steady.java.test.NestedDeclarations$1"); final JavaMethodId cl4_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$1.doSomethingElse()"); final JavaClassId cl5 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$DoThis"); final JavaMethodId cl5_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$DoThis.doThis()"); final JavaClassId cl6 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$DoThis$1"); final JavaMethodId cl6_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$DoThis$1.doThat()"); final JavaClassId cl7 = JavaId.parseClassQName("org.eclipse.steady.java.test.NestedDeclarations$2"); final JavaMethodId cl7_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$2.doSomething()"); final JavaClassId cl8 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$1DoThat"); final JavaMethodId cl8_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$1DoThat.doThat()"); final JavaClassId cl9 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$1DoThat$1"); final JavaMethodId cl9_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$1DoThat$1.doThis()"); final JavaEnumId e = JavaId.parseEnumQName("org.eclipse.steady.java.test.NestedDeclarations$Foo"); final JavaMethodId e_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$Foo.bar()"); final JavaClassId cl10 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$Foo$1DoThis"); final JavaMethodId cl10_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$Foo$1DoThis.doThis()"); final JavaClassId cl11 = JavaId.parseClassQName( "org.eclipse.steady.java.test.NestedDeclarations$Foo$1DoThis$1"); final JavaMethodId cl11_m = JavaId.parseMethodQName( "org.eclipse.steady.java.test.NestedDeclarations$Foo$1DoThis$1.doThat()"); assertEquals(25, constructs.size()); assertTrue(constructs.containsKey(p)); assertTrue(constructs.containsKey(cl1)); assertTrue(constructs.containsKey(cl1_m)); assertTrue(constructs.containsKey(cl2)); assertTrue(constructs.containsKey(cl2_m)); assertTrue(constructs.containsKey(cl3)); assertTrue(constructs.containsKey(cl3_m)); assertTrue(constructs.containsKey(cl4)); assertTrue(constructs.containsKey(cl4_m)); assertTrue(constructs.containsKey(cl5)); assertTrue(constructs.containsKey(cl5_m)); assertTrue(constructs.containsKey(cl6)); assertTrue(constructs.containsKey(cl6_m)); assertTrue(constructs.containsKey(cl7)); assertTrue(constructs.containsKey(cl7_m)); assertTrue(constructs.containsKey(cl8)); assertTrue(constructs.containsKey(cl8_m)); assertTrue(constructs.containsKey(cl9)); assertTrue(constructs.containsKey(cl9_m)); assertTrue(constructs.containsKey(e)); assertTrue(constructs.containsKey(e_m)); assertTrue(constructs.containsKey(cl10)); assertTrue(constructs.containsKey(cl10_m)); assertTrue(constructs.containsKey(cl11)); assertTrue(constructs.containsKey(cl11_m)); } catch (FileAnalysisException e) { System.err.println(e.getMessage()); assertTrue(false); } }
@Test public void testGenerics() { try { final JavaFileAnalyzer2 jfa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer( new File("./src/test/java/org/eclipse/steady/java/test/Generics.java")); final Map<ConstructId, Construct> constructs = jfa.getConstructs(); final JavaPackageId p = new JavaPackageId("org.eclipse.steady.java.test"); final JavaClassId cl = JavaId.parseClassQName("org.eclipse.steady.java.test.Generics"); final JavaConstructorId cons = JavaId.parseConstructorQName("org.eclipse.steady.java.test.Generics(Map)"); final JavaMethodId meth = JavaId.parseMethodQName( "org.eclipse.steady.java.test.Generics.foo(String,Collection,List)"); assertEquals(4, constructs.size()); assertTrue(constructs.containsKey(p)); assertTrue(constructs.containsKey(cl)); assertTrue(constructs.containsKey(cons)); assertTrue(constructs.containsKey(meth)); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } }
@Test public void testCxfClass() { try { final File file = new File( "./src/test/resources/ws_security_1438423/src/main/java/org/apache/cxf/ws/security/wss4j/SAMLUtils.java"); final FileAnalyzer fa = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer(file); final Map<ConstructId, Construct> constructs = fa.getConstructs(); assertEquals(13, constructs.size()); } catch (FileAnalysisException e) { System.err.println(e.getMessage()); assertTrue(false); } }
@Test public void testCompareConstructCreation() { FileSearch fs = new FileSearch(new String[] {"class"}); Set<Path> class_files = fs.search(Paths.get("./target/test-classes/org/eclipse/steady/java/test/"), 1); Set<ConstructId> c_from_class = new HashSet<ConstructId>(); String filename = null; for (Path p : class_files) { filename = p.getFileName().toString(); if (filename.startsWith("TestAnon")) { FileAnalyzer fa; try { fa = FileAnalyzerFactory.buildFileAnalyzer(p.toFile()); c_from_class.addAll(fa.getConstructs().keySet()); } catch (FileAnalysisException e) { e.printStackTrace(); assertTrue(false); } } } Set<ConstructId> c_from_java = new HashSet<ConstructId>(); File p = null; try { p = Paths.get("./src/test/java/org/eclipse/steady/java/test/TestAnon.java").toFile(); FileAnalyzer fa2 = (JavaFileAnalyzer2) FileAnalyzerFactory.buildFileAnalyzer(p); c_from_java.addAll(fa2.getConstructs().keySet()); } catch (FileAnalysisException e) { e.printStackTrace(); } assertTrue(this.compareConstructSets(c_from_class, c_from_java)); }