Update
This commit is contained in:
@@ -11,6 +11,8 @@ OUTPUT/
|
|||||||
*.csv
|
*.csv
|
||||||
*.pdf
|
*.pdf
|
||||||
Dataset/
|
Dataset/
|
||||||
|
GumTreeInput/
|
||||||
|
*TestParser.java
|
||||||
src/main/java/edu/lu/uni/serval/FixPatternParser/TestParser.java
|
src/main/java/edu/lu/uni/serval/FixPatternParser/TestParser.java
|
||||||
# Package Files #
|
# Package Files #
|
||||||
*.jar
|
*.jar
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package edu.lu.uni.serval.FixPatternMining.App;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import edu.lu.uni.serval.FixPatternMining.FeatureLearner;
|
|
||||||
import edu.lu.uni.serval.config.Configuration;
|
import edu.lu.uni.serval.config.Configuration;
|
||||||
import edu.lu.uni.serval.utils.FileHelper;
|
import edu.lu.uni.serval.utils.FileHelper;
|
||||||
|
|
||||||
@@ -18,6 +17,7 @@ public class Step13 {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
boolean isSupervisedLearning = true;
|
boolean isSupervisedLearning = true;
|
||||||
if (isSupervisedLearning) {// supervised learning
|
if (isSupervisedLearning) {// supervised learning
|
||||||
|
// localization file, feature file,
|
||||||
// label --> possibility --> 90, 80, 70, 60 others ignored, level one localization
|
// label --> possibility --> 90, 80, 70, 60 others ignored, level one localization
|
||||||
// label: clusterNum, re-compute similarity with each element. 90, 80, 70, 60.
|
// label: clusterNum, re-compute similarity with each element. 90, 80, 70, 60.
|
||||||
// similarity: patches --> fixing bug.
|
// similarity: patches --> fixing bug.
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package edu.lu.uni.serval.FixPatternParser;
|
|||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -39,7 +38,7 @@ public class Parser {
|
|||||||
private String originalTree = ""; // Guide of generating patches.
|
private String originalTree = ""; // Guide of generating patches.
|
||||||
private String actionSets = ""; // Guide of generating patches.
|
private String actionSets = ""; // Guide of generating patches.
|
||||||
|
|
||||||
public void parseFixPatterns(File prevFile, File revFile, File diffEntryFile) throws FileNotFoundException, IOException {
|
public void parseFixPatterns(File prevFile, File revFile, File diffEntryFile) {
|
||||||
|
|
||||||
// GumTree results
|
// GumTree results
|
||||||
List<Action> gumTreeResults = new GumTreeComparer().compareTwoFilesWithGumTree(prevFile, revFile);
|
List<Action> gumTreeResults = new GumTreeComparer().compareTwoFilesWithGumTree(prevFile, revFile);
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package edu.lu.uni.serval.FixPatternParser;
|
package edu.lu.uni.serval.FixPatternParser;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import edu.lu.uni.serval.utils.FileHelper;
|
import edu.lu.uni.serval.utils.FileHelper;
|
||||||
|
|
||||||
@@ -43,21 +41,15 @@ public class TestParser {
|
|||||||
|
|
||||||
SingleStatementParser parser = new SingleStatementParser();
|
SingleStatementParser parser = new SingleStatementParser();
|
||||||
// HunkParser parser = new HunkParser();
|
// HunkParser parser = new HunkParser();
|
||||||
try {
|
parser.parseFixPatterns(prevFile, revFile, diffentryFile);
|
||||||
parser.parseFixPatterns(prevFile, revFile, diffentryFile);
|
|
||||||
|
astEditScripts.append(parser.getAstEditScripts());
|
||||||
astEditScripts.append(parser.getAstEditScripts());
|
originalTrees.append(parser.getOriginalTree());
|
||||||
originalTrees.append(parser.getOriginalTree());
|
buggyTrees.append(parser.getBuggyTrees());
|
||||||
buggyTrees.append(parser.getBuggyTrees());
|
actionSets.append(parser.getActionSets());
|
||||||
actionSets.append(parser.getActionSets());
|
tokens.append(parser.getTokensOfSourceCode());
|
||||||
tokens.append(parser.getTokensOfSourceCode());
|
sizes.append(parser.getSizes());
|
||||||
sizes.append(parser.getSizes());
|
patches.append(parser.getPatchesSourceCode());
|
||||||
patches.append(parser.getPatchesSourceCode());
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// break;
|
// break;
|
||||||
|
|||||||
Reference in New Issue
Block a user