Release some data.

This commit is contained in:
Kui LIU
2017-08-01 15:02:00 +02:00
parent 0d5d858dee
commit 13ed0c16f4
4 changed files with 13 additions and 4 deletions
@@ -165,7 +165,10 @@ public class SingleStatementParser {
// this.actionSets += Configuration.BUGGY_TREE_TOKEN + "\n" + readActionSet(actionSet, "") + "\n";
// this.originalTree += Configuration.BUGGY_TREE_TOKEN + "\n" + actionSet.getOriginalTree().toString() + "\n";
}
actionSets.clear();
}
allActionSets.clear();
gumTreeResults.clear();
}
}
@@ -58,16 +58,14 @@ public class ParseFixPatternWorker extends UntypedActor {
File prevFile = msgFile.getPrevFile();
File diffentryFile = msgFile.getDiffEntryFile();
SingleStatementParser parser = new SingleStatementParser();
log.info("Start to parse file: " + revFile.getPath());
parser.parseFixPatterns(prevFile, revFile, diffentryFile);
editScripts.append(parser.getAstEditScripts());
patchesSourceCode.append(parser.getPatchesSourceCode());
sizes.append(parser.getSizes());
// buggyTrees.append(parser.getBuggyTrees());
tokens.append(parser.getTokensOfSourceCode());
log.info("Finish of parsing file: " + revFile.getPath());
counter ++;
if (counter % 1000 == 0) {
if (counter % 100 == 0) {
FileHelper.outputToFile(editScriptsFilePath + "edistScripts_" + id + ".list", editScripts, true);
FileHelper.outputToFile(patchesSourceCodeFilePath + "patches_" + id + ".list", patchesSourceCode, true);
FileHelper.outputToFile(editScriptSizesFilePath + "sizes_" + id + ".list", sizes, true);
@@ -78,6 +76,7 @@ public class ParseFixPatternWorker extends UntypedActor {
sizes.setLength(0);
// buggyTrees.setLength(0);
tokens.setLength(0);
log.info("Worker #" + id +"Finish of parsing " + counter + " files...");
}
}
@@ -86,7 +85,8 @@ public class ParseFixPatternWorker extends UntypedActor {
FileHelper.outputToFile(editScriptSizesFilePath + "sizes_" + id + ".list", sizes, true);
// FileHelper.outputToFile(buggyTreesFilePath + "buggyTrees_" + id + ".list", buggyTrees, true);
FileHelper.outputToFile(buggyTokensFilePath + "tokens_" + id + ".list", tokens, true);
log.info("Worker #" + id +"Finish of parsing " + counter + " files...");
log.info("Worker #" + id + " finished the work...");
this.getSender().tell("STOP", getSelf());
} else {
@@ -47,4 +47,9 @@ public class Configuration {
// the output path of fix patterns mining.
private static final String MINING_OUTPUT = ROOT_PATH + "MiningOutput/";
public static final String CLUSTER_OUTPUT = MINING_OUTPUT + "ClusteringOutput/clusterResults.list";
// evaluation data
public static final String TEST_INPUT = ROOT_PATH + "TestProjects/";
public static final String TEST_LOCALIZATION_FILE = ROOT_PATH + "TestData/Localization.list";
public static final String TEST_DATA_FILE = ROOT_PATH + "TestData/TestStatements.list";
}
@@ -23,6 +23,7 @@ public class ActionFilter {
// Filter out non-UPD modifications, and modifications of variable names and method names.
uselessActions = findoutUselessActionSets(actionSets, true);
actionSets.removeAll(uselessActions);
uselessActions.clear();
return actionSets;
}