[O] Optimize
This commit is contained in:
@@ -36,19 +36,16 @@ public class GumTreeComparer {
|
|||||||
log.info("Null GumTree of Revised File: " + revFile.getPath());
|
log.info("Null GumTree of Revised File: " + revFile.getPath());
|
||||||
throw new NullPointerException(revFile.getPath());
|
throw new NullPointerException(revFile.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (oldTree != null && newTree != null) {
|
if (oldTree == null || newTree == null) return null;
|
||||||
Matcher m = Matchers.getInstance().getMatcher(oldTree, newTree);
|
|
||||||
m.match();
|
|
||||||
ActionGenerator ag = new ActionGenerator(oldTree, newTree, m.getMappings());
|
|
||||||
ag.generate();
|
|
||||||
List<Action> actions = ag.getActions(); // change actions from bug to patch
|
|
||||||
|
|
||||||
return actions;
|
Matcher m = Matchers.getInstance().getMatcher(oldTree, newTree);
|
||||||
}
|
m.match();
|
||||||
|
ActionGenerator ag = new ActionGenerator(oldTree, newTree, m.getMappings());
|
||||||
|
ag.generate();
|
||||||
|
List<Action> actions = ag.getActions(); // change actions from bug to patch
|
||||||
|
|
||||||
return null;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Action> compareCFilesWithGumTree(File prevFile, File revFile) {
|
public List<Action> compareCFilesWithGumTree(File prevFile, File revFile) {
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ public class GumTreeCComparer {
|
|||||||
newTree = new SrcmlCTreeGenerator(srcmlPath).generateFromFile(revFile).getRoot();
|
newTree = new SrcmlCTreeGenerator(srcmlPath).generateFromFile(revFile).getRoot();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (oldTree == null) {
|
if (oldTree == null) {
|
||||||
|
e.printStackTrace();
|
||||||
log.info("Null GumTree of Previous File: " + prevFile.getPath());
|
log.info("Null GumTree of Previous File: " + prevFile.getPath());
|
||||||
throw new NullPointerException(prevFile.getPath());
|
throw new NullPointerException(prevFile.getPath());
|
||||||
} else if (newTree == null) {
|
} else if (newTree == null) {
|
||||||
|
e.printStackTrace();
|
||||||
log.info("Null GumTree of Revised File: " + revFile.getPath());
|
log.info("Null GumTree of Revised File: " + revFile.getPath());
|
||||||
throw new NullPointerException(revFile.getPath());
|
throw new NullPointerException(revFile.getPath());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user