test_class.file: patch-analyzer/src/test/java/org/eclipse/steady/patcha/FileComparatorTest.java
test_class.identifier: FileComparatorTest
test_case.body: @Test
    public void testFileComparatorOnPy() {
      // Create instance of FileComparator
      try {
        final FileComparator c =
            new FileComparator(
                new File("./src/test/resources/flask-oidc_e4ce5/flask_oidc/__init__.py"),
                new File("./src/test/resources/flask-oidc_f2ef8/flask_oidc/__init__.py"),
                null,
                null,
                null,
                null);
        final Set<ConstructChange> changes = c.identifyChanges();
        for (ConstructChange chg : changes) System.out.println(chg);
        assertEquals(5, changes.size());
      } catch (IOException e) {
        System.err.println(e.getMessage());
        assertTrue(false);
      } catch (FileAnalysisException e) {
        System.err.println(e.getMessage());
        assertTrue(false);
      }
    }
test_case.class_method_signature: FileComparatorTest.testFileComparatorOnPy()
test_case.full_signature: @Test public void testFileComparatorOnPy()
test_case.identifier: testFileComparatorOnPy
test_case.invocations: identifyChanges println assertEquals size println getMessage assertTrue println getMessage assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFileComparatorOnPy()
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: defAnalyzer
focal_class.modifier: private
focal_class.original_string: private FileAnalyzer defAnalyzer, fixAnalyzer = null;
focal_class.type: FileAnalyzer
focal_class.var_name: defAnalyzer
focal_class.declarator: changes = null
focal_class.modifier: private
focal_class.original_string: private Set<ConstructChange> changes = null;
focal_class.type: Set<ConstructChange>
focal_class.var_name: changes
focal_class.declarator: revision = null
focal_class.modifier: private
focal_class.original_string: private String revision = null;
focal_class.type: String
focal_class.var_name: revision
focal_class.declarator: repo = null
focal_class.modifier: private
focal_class.original_string: private String repo = null;
focal_class.type: String
focal_class.var_name: repo
focal_class.declarator: repoPath = null
focal_class.modifier: private
focal_class.original_string: private String repoPath = null;
focal_class.type: String
focal_class.var_name: repoPath
focal_class.declarator: timeStamp = null
focal_class.modifier: private
focal_class.original_string: private String timeStamp = null;
focal_class.type: String
focal_class.var_name: timeStamp
focal_class.file: patch-analyzer/src/main/java/org/eclipse/steady/patcha/FileComparator.java
focal_class.identifier: FileComparator
focal_class.class_method_signature: FileComparator.FileComparator(FileChange _c, String _rev, String _time_stamp)
focal_class.full_signature: public  FileComparator(FileChange _c, String _rev, String _time_stamp)
focal_class.identifier: FileComparator
focal_class.modifiers: public
focal_class.parameters: (FileChange _c, String _rev, String _time_stamp)
focal_class.signature:  FileComparator(FileChange _c, String _rev, String _time_stamp)
focal_class.class_method_signature: FileComparator.FileComparator(
        File _def, File _fix, String _rev, String _repo, String _repo_path, String _time_stamp)
focal_class.full_signature: public  FileComparator(
        File _def, File _fix, String _rev, String _repo, String _repo_path, String _time_stamp)
focal_class.identifier: FileComparator
focal_class.modifiers: public
focal_class.parameters: (
        File _def, File _fix, String _rev, String _repo, String _repo_path, String _time_stamp)
focal_class.signature:  FileComparator(
        File _def, File _fix, String _rev, String _repo, String _repo_path, String _time_stamp)
focal_class.class_method_signature: FileComparator.identifyChanges()
focal_class.full_signature: public Set<ConstructChange> identifyChanges()
focal_class.identifier: identifyChanges
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<ConstructChange>
focal_class.signature: Set<ConstructChange> identifyChanges()
focal_method.body: public Set<ConstructChange> identifyChanges() {
      if (this.changes == null) {
        this.changes = new TreeSet<ConstructChange>();
  
        // Loop constructs of defective file (if any)
        // Add to changes if construct has been modified (!equals) or does not exist any longer
        if (this.defAnalyzer != null) {
          try {
            for (ConstructId key : this.defAnalyzer.getConstructs().keySet()) {
              if (this.fixAnalyzer != null && this.fixAnalyzer.containsConstruct(key)) {
                if (!this.defAnalyzer.getConstruct(key).equals(this.fixAnalyzer.getConstruct(key))) {
                  // Modification (MOD)
                  final ConstructChange c =
                      new ConstructChange(
                          this.repo,
                          this.repoPath,
                          this.defAnalyzer.getConstruct(key),
                          this.fixAnalyzer.getConstruct(key),
                          this.revision,
                          this.timeStamp);
  
                  // Always add the construct change, no matter the signature change (if any)
                  // if(c.hasSignatureChange())
                  this.changes.add(c);
                }
              } else {
                this.changes.add(
                    new ConstructChange(
                        this.repo,
                        this.repoPath,
                        this.defAnalyzer.getConstruct(key),
                        null,
                        this.revision,
                        this.timeStamp));
              }
            }
          } catch (FileAnalysisException e) {
            FileComparator.log.error(
                "Error while comparing defective and fixed version: " + e.getMessage(), e);
          }
        }
        // Loop constructs of fixed file (if any)
        // Add to changes if construct has been modified (!equals) or does not exist any longer
        if (this.fixAnalyzer != null) {
          try {
            for (ConstructId key : this.fixAnalyzer.getConstructs().keySet()) {
              if (this.defAnalyzer != null && this.defAnalyzer.containsConstruct(key)) {
                if (!this.fixAnalyzer.getConstruct(key).equals(this.defAnalyzer.getConstruct(key))) {
                  // Modification (MOD)
                  final ConstructChange chg =
                      new ConstructChange(
                          this.repo,
                          this.repoPath,
                          this.defAnalyzer.getConstruct(key),
                          this.fixAnalyzer.getConstruct(key),
                          this.revision,
                          this.timeStamp);
  
                  // Always add the construct change if not existing yet, no matter the signature
                  // change (if any)
                  if (!this.changes.contains(chg)) // && chg.hasSignatureChange())
                  this.changes.add(chg);
                }
              } else {
                this.changes.add(
                    new ConstructChange(
                        this.repo,
                        this.repoPath,
                        null,
                        this.fixAnalyzer.getConstruct(key),
                        this.revision,
                        this.timeStamp));
              }
            }
          } catch (FileAnalysisException e) {
            FileComparator.log.error(
                "Error while comparing defective and fixed version: " + e.getMessage(), e);
          }
        }
      }
      return changes;
    }
focal_method.class_method_signature: FileComparator.identifyChanges()
focal_method.full_signature: public Set<ConstructChange> identifyChanges()
focal_method.identifier: identifyChanges
focal_method.invocations: keySet getConstructs containsConstruct equals getConstruct getConstruct getConstruct getConstruct add add getConstruct error getMessage keySet getConstructs containsConstruct equals getConstruct getConstruct getConstruct getConstruct contains add add getConstruct error getMessage
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Set<ConstructChange>
focal_method.signature: Set<ConstructChange> identifyChanges()