new
This commit is contained in:
@@ -108,7 +108,7 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>
|
<mainClass>
|
||||||
edu.lu.uni.serval.FixPatternParser.cluster.AkkaTreeLoader
|
edu.lu.uni.serval.FixPatternParser.violations.TestHunkParser
|
||||||
</mainClass>
|
</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
|
|||||||
+7
-7
@@ -41,18 +41,18 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
|||||||
public void parseFixPatterns(File prevFile, File revFile, File diffentryFile) {
|
public void parseFixPatterns(File prevFile, File revFile, File diffentryFile) {
|
||||||
List<HierarchicalActionSet> actionSets = parseChangedSourceCodeWithGumTree2(prevFile, revFile);
|
List<HierarchicalActionSet> actionSets = parseChangedSourceCodeWithGumTree2(prevFile, revFile);
|
||||||
|
|
||||||
boolean isUpdate =
|
// boolean isUpdate =
|
||||||
actionSets.stream().allMatch(p -> p.getAction() instanceof Update);
|
// actionSets.stream().allMatch(p -> p.getAction() instanceof Update);
|
||||||
int hunkSet = 0;
|
int hunkSet = 0;
|
||||||
if(isUpdate){
|
// if(isUpdate){
|
||||||
for (HierarchicalActionSet actionSet : actionSets) {
|
for (HierarchicalActionSet actionSet : actionSets) {
|
||||||
|
|
||||||
|
|
||||||
FileOutputStream f = null;
|
FileOutputStream f = null;
|
||||||
try {
|
try {
|
||||||
String pj = diffentryFile.getParent().split("GumTreeInputBug4")[1];
|
String pj = diffentryFile.getParent().split("GumTreeInputBug13April")[1];
|
||||||
String root = diffentryFile.getParent().split("GumTreeInputBug4")[0];
|
String root = diffentryFile.getParent().split("GumTreeInputBug13April")[0];
|
||||||
String hunkTreeFileName = root+"GumTreeOutput2/" +pj.replace("DiffEntries","ActionSetDumps/") + diffentryFile.getName() + "_" + String.valueOf(hunkSet);
|
String hunkTreeFileName = root+"GumTreeOutput13April/" +pj.replace("DiffEntries","ActionSetDumps/") + diffentryFile.getName() + "_" + String.valueOf(hunkSet);
|
||||||
f = new FileOutputStream(new File(hunkTreeFileName));
|
f = new FileOutputStream(new File(hunkTreeFileName));
|
||||||
ObjectOutputStream o = new ObjectOutputStream(f);
|
ObjectOutputStream o = new ObjectOutputStream(f);
|
||||||
o.writeObject(actionSet);
|
o.writeObject(actionSet);
|
||||||
@@ -67,7 +67,7 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
|||||||
hunkSet++;
|
hunkSet++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
// public void parseFixPatterns(File prevFile, File revFile, File diffentryFile) {
|
// public void parseFixPatterns(File prevFile, File revFile, File diffentryFile) {
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ public class TestHunkParser {
|
|||||||
outputPath = args[0];
|
outputPath = args[0];
|
||||||
}else{
|
}else{
|
||||||
// inputPath = "/Users/anilkoyuncu/bugStudy/dataset/GumTreeInputBug4";
|
// inputPath = "/Users/anilkoyuncu/bugStudy/dataset/GumTreeInputBug4";
|
||||||
inputPath = "/Volumes/data/bugStudy_backup/dataset/GumTreeInputBug4";
|
inputPath = "/Users/anilkoyuncu/bugStudy/dataset/GumTreeInputBug13April";
|
||||||
// outputPath = "/Users/anilkoyuncu/bugStudy/code/python/GumTreeOutput2/";
|
// outputPath = "/Users/anilkoyuncu/bugStudy/code/python/GumTreeOutput2/";
|
||||||
outputPath = "/Users/anilkoyuncu/bugStudy/dataset/GumTreeOutput2";
|
outputPath = "/Users/anilkoyuncu/bugStudy/dataset/GumTreeOutput13April";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ public class TestHunkParser {
|
|||||||
try {
|
try {
|
||||||
log.info("Akka begins...");
|
log.info("Akka begins...");
|
||||||
system = ActorSystem.create("Mining-FixPattern-System");
|
system = ActorSystem.create("Mining-FixPattern-System");
|
||||||
parsingActor = system.actorOf(ParseFixPatternActor.props(1, editScriptsFilePath,
|
parsingActor = system.actorOf(ParseFixPatternActor.props(100, editScriptsFilePath,
|
||||||
patchesSourceCodeFilePath, buggyTokensFilePath, editScriptSizesFilePath), "mine-fix-pattern-actor");
|
patchesSourceCodeFilePath, buggyTokensFilePath, editScriptSizesFilePath), "mine-fix-pattern-actor");
|
||||||
parsingActor.tell(msg, ActorRef.noSender());
|
parsingActor.tell(msg, ActorRef.noSender());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user