testhunkparser
This commit is contained in:
@@ -87,7 +87,7 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>
|
<mainClass>
|
||||||
edu.lu.uni.serval.MultipleThreadsParser.AkkaParser2
|
edu.lu.uni.serval.FixPatternParser.violations.TestHunkParser
|
||||||
</mainClass>
|
</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
|
|||||||
@@ -27,30 +27,37 @@ public class TestHunkParser {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// input data
|
// input data
|
||||||
File folder = new File("/Users/anilkoyuncu/bugStudy/code/python/GumTreeInput");
|
|
||||||
|
// String rootPath = "/Users/anilkoyuncu/bugStudy";
|
||||||
|
String rootPath = args[0];
|
||||||
|
String inputPath = args[1];
|
||||||
|
String outputPath = args[0] + "/GumTreeOutputBug/";
|
||||||
|
|
||||||
|
|
||||||
|
File folder = new File(inputPath);
|
||||||
File[] listOfFiles = folder.listFiles();
|
File[] listOfFiles = folder.listFiles();
|
||||||
Stream<File> stream = Arrays.stream(listOfFiles);
|
Stream<File> stream = Arrays.stream(listOfFiles);
|
||||||
List<File> folders = stream
|
List<File> folders = stream
|
||||||
.filter(x -> !x.getName().startsWith("."))
|
.filter(x -> !x.getName().startsWith("."))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
List<File> targetList = new ArrayList<File>();
|
// List<File> targetList = new ArrayList<File>();
|
||||||
for (File f:folders){
|
// for (File f:folders){
|
||||||
for(File f1 :f.listFiles()){
|
// for(File f1 :f.listFiles()){
|
||||||
if (!f1.getName().startsWith(".")){
|
// if (!f1.getName().startsWith(".")){
|
||||||
targetList.add(f1);
|
// targetList.add(f1);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (File target : targetList) {
|
for (File target : folders) {
|
||||||
final List<MessageFile> msgFiles = getMessageFiles(target.toString() + "/"); //"/Users/anilkoyuncu/bugStudy/code/python/GumTreeInput/Apache/CAMEL/"
|
final List<MessageFile> msgFiles = getMessageFiles(target.toString() + "/"); //"/Users/anilkoyuncu/bugStudy/code/python/GumTreeInput/Apache/CAMEL/"
|
||||||
System.out.println(msgFiles.size());
|
System.out.println(msgFiles.size());
|
||||||
if(msgFiles.size() == 0)
|
if(msgFiles.size() == 0)
|
||||||
continue;
|
continue;
|
||||||
String pjName = target.getName();
|
String pjName = target.getName();
|
||||||
// output path
|
// output path
|
||||||
String GUM_TREE_OUTPUT = Configuration.ROOT_PATH + pjName + "/";
|
String GUM_TREE_OUTPUT = outputPath + pjName + "/";
|
||||||
final String editScriptsFilePath = GUM_TREE_OUTPUT + "editScripts.list";
|
final String editScriptsFilePath = GUM_TREE_OUTPUT + "editScripts.list";
|
||||||
final String patchesSourceCodeFilePath =GUM_TREE_OUTPUT + "patchSourceCode.list";
|
final String patchesSourceCodeFilePath =GUM_TREE_OUTPUT + "patchSourceCode.list";
|
||||||
final String buggyTokensFilePath = GUM_TREE_OUTPUT + "tokens.list";
|
final String buggyTokensFilePath = GUM_TREE_OUTPUT + "tokens.list";
|
||||||
|
|||||||
Reference in New Issue
Block a user