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