test_class.file: lang-java/src/test/java/org/eclipse/steady/java/WarAnalyzerTest.java
test_class.identifier: WarAnalyzerTest
test_case.body: @Test
    @Category(Slow.class)
    public void testAnalyze() {
      try {
        final WarAnalyzer wa = new WarAnalyzer();
        wa.analyze(new File("./src/test/resources/examples.war"));
        wa.setWorkDir(Paths.get("./target"));
        wa.setRename(true);
        WarAnalyzer.setAppContext(new Application("dummy-group", "dummy-artifact", "0.0.1-SNAPSHOT"));
        wa.call();
  
        // 15 archives in WEB-INF/lib
        final Set<FileAnalyzer> fas = wa.getChilds(true);
        assertEquals(15, fas.size());
  
        // 15 constructs in classes in WEB-INF/classes
        final Set<ConstructId> cids = wa.getConstructIds();
        assertEquals(15, cids.size());
      } catch (Exception e) {
        e.printStackTrace();
        assertTrue(false);
      }
    }
test_case.class_method_signature: WarAnalyzerTest.testAnalyze()
test_case.full_signature: @Test @Category(Slow.class) public void testAnalyze()
test_case.identifier: testAnalyze
test_case.invocations: analyze setWorkDir get setRename setAppContext call getChilds assertEquals size getConstructIds assertEquals size printStackTrace assertTrue
test_case.modifiers: @Test @Category(Slow.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAnalyze()
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: INCL_SPACE = "vulas.core.instr.static.inclSpace"
focal_class.modifier: private static final
focal_class.original_string: private static final String INCL_SPACE = "vulas.core.instr.static.inclSpace";
focal_class.type: String
focal_class.var_name: INCL_SPACE
focal_class.declarator: INCL_BACKEND_URL = "vulas.core.instr.static.inclBackendUrl"
focal_class.modifier: private static final
focal_class.original_string: private static final String INCL_BACKEND_URL = "vulas.core.instr.static.inclBackendUrl";
focal_class.type: String
focal_class.var_name: INCL_BACKEND_URL
focal_class.declarator: instrumentedClasses = new HashMap<JavaId, ClassVisitor>()
focal_class.modifier: private
focal_class.original_string: private Map<JavaId, ClassVisitor> instrumentedClasses = new HashMap<JavaId, ClassVisitor>();
focal_class.type: Map<JavaId, ClassVisitor>
focal_class.var_name: instrumentedClasses
focal_class.declarator: tmpDir = null
focal_class.modifier: private
focal_class.original_string: private Path tmpDir = null;
focal_class.type: Path
focal_class.var_name: tmpDir
focal_class.declarator: inclDir = null
focal_class.modifier: private
focal_class.original_string: private Path inclDir = null;
focal_class.type: Path
focal_class.var_name: inclDir
focal_class.declarator: mgr = null
focal_class.modifier: private
focal_class.original_string: private ArchiveAnalysisManager mgr = null;
focal_class.type: ArchiveAnalysisManager
focal_class.var_name: mgr
focal_class.declarator: nestedAnalyzers = null
focal_class.modifier: private
focal_class.original_string: private Set<FileAnalyzer> nestedAnalyzers = null;
focal_class.type: Set<FileAnalyzer>
focal_class.var_name: nestedAnalyzers
focal_class.declarator: ignoredIncludes = new HashSet<Path>()
focal_class.modifier: private
focal_class.original_string: private Set<Path> ignoredIncludes = new HashSet<Path>();
focal_class.type: Set<Path>
focal_class.var_name: ignoredIncludes
focal_class.file: lang-java/src/main/java/org/eclipse/steady/java/WarAnalyzer.java
focal_class.identifier: WarAnalyzer
focal_class.class_method_signature: WarAnalyzer.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: WarAnalyzer.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: WarAnalyzer.setIncludeDir(Path _p)
focal_class.full_signature: public void setIncludeDir(Path _p)
focal_class.identifier: setIncludeDir
focal_class.modifiers: public
focal_class.parameters: (Path _p)
focal_class.return: void
focal_class.signature: void setIncludeDir(Path _p)
focal_class.class_method_signature: WarAnalyzer.setRename(boolean _b)
focal_class.full_signature: public void setRename(boolean _b)
focal_class.identifier: setRename
focal_class.modifiers: public
focal_class.parameters: (boolean _b)
focal_class.return: void
focal_class.signature: void setRename(boolean _b)
focal_class.class_method_signature: WarAnalyzer.createInstrumentedArchive()
focal_class.full_signature: @Override protected synchronized void createInstrumentedArchive()
focal_class.identifier: createInstrumentedArchive
focal_class.modifiers: @Override protected synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void createInstrumentedArchive()
focal_class.class_method_signature: WarAnalyzer.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: WarAnalyzer.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: WarAnalyzer.getConstructIds()
focal_class.full_signature: @Override public synchronized Set<ConstructId> getConstructIds()
focal_class.identifier: getConstructIds
focal_class.modifiers: @Override public synchronized
focal_class.parameters: ()
focal_class.return: Set<ConstructId>
focal_class.signature: Set<ConstructId> getConstructIds()
focal_class.class_method_signature: WarAnalyzer.getInputStream(String _regex, JarEntry _entry)
focal_class.full_signature: @Override public InputStream getInputStream(String _regex, JarEntry _entry)
focal_class.identifier: getInputStream
focal_class.modifiers: @Override public
focal_class.parameters: (String _regex, JarEntry _entry)
focal_class.return: InputStream
focal_class.signature: InputStream getInputStream(String _regex, JarEntry _entry)
focal_class.superclass: extends JarAnalyzer
focal_method.body: @Override
    public void analyze(final File _file) throws FileAnalysisException {
      try {
        super.analyze(_file);
  
        // Extract the WAR
        if (this.workDir != null) this.tmpDir = Paths.get(this.workDir.toString(), "war_analysis");
        else {
          try {
            this.tmpDir = java.nio.file.Files.createTempDirectory("war_analysis_");
          } catch (IOException e) {
            throw new IllegalStateException("Unable to create temp directory", e);
          }
        }
        this.jarWriter.extract(this.tmpDir);
  
        // Add WEB-INF/classes to the classpath
        try {
          JarAnalyzer.insertClasspath(
              Paths.get(this.tmpDir.toString(), "WEB-INF", "classes").toString());
        } catch (Exception e) {
          // No problem at all if instrumentation is not requested.
          // If instrumentation is requested, however, some classes may not compile
          WarAnalyzer.log.error(
              this.toString() + ": Error while updating the classpath: " + e.getMessage());
        }
      } catch (IllegalStateException e) {
        log.error("IllegalStateException when analyzing file [" + _file + "]: " + e.getMessage());
        throw new FileAnalysisException(
            "Error when analyzing file [" + _file + "]: " + e.getMessage(), e);
      } catch (IOException e) {
        log.error("IOException when analyzing file [" + _file + "]: " + e.getMessage());
        throw new FileAnalysisException(
            "Error when analyzing file [" + _file + "]: " + e.getMessage(), e);
      } catch (Exception e) {
        log.error("Exception when analyzing file [" + _file + "]: " + e.getMessage());
        throw new FileAnalysisException(
            "Error when analyzing file [" + _file + "]: " + e.getMessage(), e);
      }
    }
focal_method.class_method_signature: WarAnalyzer.analyze(final File _file)
focal_method.full_signature: @Override public void analyze(final File _file)
focal_method.identifier: analyze
focal_method.invocations: analyze get toString createTempDirectory extract insertClasspath toString get toString error toString getMessage error getMessage getMessage error getMessage getMessage error getMessage getMessage
focal_method.modifiers: @Override public
focal_method.parameters: (final File _file)
focal_method.return: void
focal_method.signature: void analyze(final File _file)