test_class.file: lang-java/src/test/java/org/eclipse/steady/java/JavaFileAnalyzer2Test.java
test_class.identifier: JavaFileAnalyzer2Test
test_case.body: @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();
  
        // The parsing should produce the following 5 elements:
        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)");
  
        // Assertions
        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_case.class_method_signature: JavaFileAnalyzer2Test.testVanilla()
test_case.full_signature: @Test public void testVanilla()
test_case.identifier: testVanilla
test_case.invocations: buildFileAnalyzer getConstructs parseClassQName parseConstructorQName parseMethodQName parseMethodQName assertEquals size assertTrue containsKey assertTrue containsKey assertTrue containsKey assertTrue containsKey assertTrue containsKey printStackTrace assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testVanilla()
focal_class.declarator: log = org.apache.logging.log4j.LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: constructs = null
focal_class.modifier: private
focal_class.original_string: private Map<ConstructId, Construct> constructs = null;
focal_class.type: Map<ConstructId, Construct>
focal_class.var_name: constructs
focal_class.declarator: input = null
focal_class.modifier: private
focal_class.original_string: private ANTLRInputStream input = null;
focal_class.type: ANTLRInputStream
focal_class.var_name: input
focal_class.declarator: file = null
focal_class.modifier: private
focal_class.original_string: private File file = null;
focal_class.type: File
focal_class.var_name: file
focal_class.declarator: contextStack = new ContextStack()
focal_class.modifier: private final
focal_class.original_string: private final ContextStack contextStack = new ContextStack();
focal_class.type: ContextStack
focal_class.var_name: contextStack
focal_class.declarator: constructIdBuilder = new ConstructIdBuilder()
focal_class.modifier: private final
focal_class.original_string: private final ConstructIdBuilder constructIdBuilder = new ConstructIdBuilder();
focal_class.type: ConstructIdBuilder
focal_class.var_name: constructIdBuilder
focal_class.file: lang-java/src/main/java/org/eclipse/steady/java/JavaFileAnalyzer2.java
focal_class.identifier: JavaFileAnalyzer2
focal_class.interfaces: implements FileAnalyzer
focal_class.class_method_signature: JavaFileAnalyzer2.getSupportedFileExtensions()
focal_class.full_signature: @Override public String[] getSupportedFileExtensions()
focal_class.identifier: getSupportedFileExtensions
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getSupportedFileExtensions()
focal_class.class_method_signature: JavaFileAnalyzer2.canAnalyze(File _file)
focal_class.full_signature: @Override public boolean canAnalyze(File _file)
focal_class.identifier: canAnalyze
focal_class.modifiers: @Override public
focal_class.parameters: (File _file)
focal_class.return: boolean
focal_class.signature: boolean canAnalyze(File _file)
focal_class.class_method_signature: JavaFileAnalyzer2.analyze(final File _file)
focal_class.full_signature: @Override public void analyze(final File _file)
focal_class.identifier: analyze
focal_class.modifiers: @Override public
focal_class.parameters: (final File _file)
focal_class.return: void
focal_class.signature: void analyze(final File _file)
focal_class.class_method_signature: JavaFileAnalyzer2.setFile(File _file)
focal_class.full_signature: public void setFile(File _file)
focal_class.identifier: setFile
focal_class.modifiers: public
focal_class.parameters: (File _file)
focal_class.return: void
focal_class.signature: void setFile(File _file)
focal_class.class_method_signature: JavaFileAnalyzer2.saveConstruct(ConstructId _id, String _body)
focal_class.full_signature: private void saveConstruct(ConstructId _id, String _body)
focal_class.identifier: saveConstruct
focal_class.modifiers: private
focal_class.parameters: (ConstructId _id, String _body)
focal_class.return: void
focal_class.signature: void saveConstruct(ConstructId _id, String _body)
focal_class.class_method_signature: JavaFileAnalyzer2.enterPackageDeclaration(@NotNull JavaParser.PackageDeclarationContext ctx)
focal_class.full_signature: @Override public void enterPackageDeclaration(@NotNull JavaParser.PackageDeclarationContext ctx)
focal_class.identifier: enterPackageDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.PackageDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void enterPackageDeclaration(@NotNull JavaParser.PackageDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.enterEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.full_signature: @Override public void enterEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.identifier: enterEnumDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void enterEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.exitEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.full_signature: @Override public void exitEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.identifier: exitEnumDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void exitEnumDeclaration(@NotNull JavaParser.EnumDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.enterInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.full_signature: @Override public void enterInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.identifier: enterInterfaceDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void enterInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.exitInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.full_signature: @Override public void exitInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.identifier: exitInterfaceDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void exitInterfaceDeclaration(@NotNull JavaParser.InterfaceDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.enterClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.full_signature: @Override public void enterClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.identifier: enterClassDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void enterClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.exitClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.full_signature: @Override public void exitClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.identifier: exitClassDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void exitClassDeclaration(@NotNull JavaParser.ClassDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.enterClassBody(@NotNull JavaParser.ClassBodyContext ctx)
focal_class.full_signature: @Override public void enterClassBody(@NotNull JavaParser.ClassBodyContext ctx)
focal_class.identifier: enterClassBody
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.ClassBodyContext ctx)
focal_class.return: void
focal_class.signature: void enterClassBody(@NotNull JavaParser.ClassBodyContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.exitClassBody(@NotNull JavaParser.ClassBodyContext ctx)
focal_class.full_signature: @Override public void exitClassBody(@NotNull JavaParser.ClassBodyContext ctx)
focal_class.identifier: exitClassBody
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.ClassBodyContext ctx)
focal_class.return: void
focal_class.signature: void exitClassBody(@NotNull JavaParser.ClassBodyContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.enterMethodDeclaration(@NotNull JavaParser.MethodDeclarationContext ctx)
focal_class.full_signature: @Override public void enterMethodDeclaration(@NotNull JavaParser.MethodDeclarationContext ctx)
focal_class.identifier: enterMethodDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.MethodDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void enterMethodDeclaration(@NotNull JavaParser.MethodDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.exitMethodDeclaration(
        org.eclipse.steady.java.antlr.JavaParser.MethodDeclarationContext ctx)
focal_class.full_signature: @Override public void exitMethodDeclaration(
        org.eclipse.steady.java.antlr.JavaParser.MethodDeclarationContext ctx)
focal_class.identifier: exitMethodDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (
        org.eclipse.steady.java.antlr.JavaParser.MethodDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void exitMethodDeclaration(
        org.eclipse.steady.java.antlr.JavaParser.MethodDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.enterConstructorDeclaration(@NotNull JavaParser.ConstructorDeclarationContext ctx)
focal_class.full_signature: @Override public void enterConstructorDeclaration(@NotNull JavaParser.ConstructorDeclarationContext ctx)
focal_class.identifier: enterConstructorDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull JavaParser.ConstructorDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void enterConstructorDeclaration(@NotNull JavaParser.ConstructorDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.exitConstructorDeclaration(
        org.eclipse.steady.java.antlr.JavaParser.ConstructorDeclarationContext ctx)
focal_class.full_signature: @Override public void exitConstructorDeclaration(
        org.eclipse.steady.java.antlr.JavaParser.ConstructorDeclarationContext ctx)
focal_class.identifier: exitConstructorDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (
        org.eclipse.steady.java.antlr.JavaParser.ConstructorDeclarationContext ctx)
focal_class.return: void
focal_class.signature: void exitConstructorDeclaration(
        org.eclipse.steady.java.antlr.JavaParser.ConstructorDeclarationContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.getConstructContent(ParserRuleContext ctx)
focal_class.full_signature: private final String getConstructContent(ParserRuleContext ctx)
focal_class.identifier: getConstructContent
focal_class.modifiers: private final
focal_class.parameters: (ParserRuleContext ctx)
focal_class.return: String
focal_class.signature: String getConstructContent(ParserRuleContext ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.isOfExpectedType(JavaId _jid, JavaId.Type[] _types, boolean _throw_exception)
focal_class.full_signature: private boolean isOfExpectedType(JavaId _jid, JavaId.Type[] _types, boolean _throw_exception)
focal_class.identifier: isOfExpectedType
focal_class.modifiers: private
focal_class.parameters: (JavaId _jid, JavaId.Type[] _types, boolean _throw_exception)
focal_class.return: boolean
focal_class.signature: boolean isOfExpectedType(JavaId _jid, JavaId.Type[] _types, boolean _throw_exception)
focal_class.class_method_signature: JavaFileAnalyzer2.getParameters(JavaParser.FormalParameterListContext _ctx)
focal_class.full_signature: private List<String> getParameters(JavaParser.FormalParameterListContext _ctx)
focal_class.identifier: getParameters
focal_class.modifiers: private
focal_class.parameters: (JavaParser.FormalParameterListContext _ctx)
focal_class.return: List<String>
focal_class.signature: List<String> getParameters(JavaParser.FormalParameterListContext _ctx)
focal_class.class_method_signature: JavaFileAnalyzer2.getConstructs()
focal_class.full_signature: @Override public Map<ConstructId, Construct> getConstructs()
focal_class.identifier: getConstructs
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<ConstructId, Construct>
focal_class.signature: Map<ConstructId, Construct> getConstructs()
focal_class.class_method_signature: JavaFileAnalyzer2.containsConstruct(ConstructId _id)
focal_class.full_signature: @Override public boolean containsConstruct(ConstructId _id)
focal_class.identifier: containsConstruct
focal_class.modifiers: @Override public
focal_class.parameters: (ConstructId _id)
focal_class.return: boolean
focal_class.signature: boolean containsConstruct(ConstructId _id)
focal_class.class_method_signature: JavaFileAnalyzer2.getConstruct(ConstructId _id)
focal_class.full_signature: @Override public Construct getConstruct(ConstructId _id)
focal_class.identifier: getConstruct
focal_class.modifiers: @Override public
focal_class.parameters: (ConstructId _id)
focal_class.return: Construct
focal_class.signature: Construct getConstruct(ConstructId _id)
focal_class.class_method_signature: JavaFileAnalyzer2.hasChilds()
focal_class.full_signature: @Override public boolean hasChilds()
focal_class.identifier: hasChilds
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasChilds()
focal_class.class_method_signature: JavaFileAnalyzer2.getChilds(boolean _recursive)
focal_class.full_signature: @Override public Set<FileAnalyzer> getChilds(boolean _recursive)
focal_class.identifier: getChilds
focal_class.modifiers: @Override public
focal_class.parameters: (boolean _recursive)
focal_class.return: Set<FileAnalyzer>
focal_class.signature: Set<FileAnalyzer> getChilds(boolean _recursive)
focal_class.class_method_signature: JavaFileAnalyzer2.indent(int _i)
focal_class.full_signature: private final String indent(int _i)
focal_class.identifier: indent
focal_class.modifiers: private final
focal_class.parameters: (int _i)
focal_class.return: String
focal_class.signature: String indent(int _i)
focal_class.class_method_signature: JavaFileAnalyzer2.printDeclarationStack()
focal_class.full_signature: private String printDeclarationStack()
focal_class.identifier: printDeclarationStack
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String printDeclarationStack()
focal_class.superclass: extends JavaParserBaseListener
focal_method.body: @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;
    }
focal_method.class_method_signature: JavaFileAnalyzer2.getConstructs()
focal_method.full_signature: @Override public Map<ConstructId, Construct> getConstructs()
focal_method.identifier: getConstructs
focal_method.invocations: read write flush toByteArray compilationUnit walk getMessage getName getMessage getName getMessage getSimpleName getClass toAbsolutePath toPath getMessage
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Map<ConstructId, Construct>
focal_method.signature: Map<ConstructId, Construct> getConstructs()