This commit is contained in:
mimic
2020-06-08 11:43:24 +02:00
parent e25310a882
commit 296120cf83
9 changed files with 180 additions and 1140 deletions
+8
View File
@@ -5,9 +5,17 @@
<file url="file://$PROJECT_DIR$/gumtree" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/gumtree" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/client" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/gumtree/client" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/client.diff" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/gumtree/client.diff" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/client.diff/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/client.diff/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/client/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/core" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/gumtree/core" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/core/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/gen.jdt" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/gumtree/gen.jdt" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/gen.jdt/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/gen.srcml" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/gumtree/gen.srcml" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/gumtree/gen.srcml/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/richedit" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/richedit" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/richedit/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component> </component>
</project> </project>
+122 -1110
View File
File diff suppressed because it is too large Load Diff
+7
View File
@@ -71,6 +71,10 @@ In order to launch FixMiner, execute [fixminer.sh](python/fixminer.sh)
* Update [config file](src/main/resources/config.yml) with corresponding user paths. * Update [config file](src/main/resources/config.yml) with corresponding user paths.
* Install the project with maven from root. (usage [pom.xml](pom.xml))
```powershell
mvn clean install
```
* Active the conda environment from shell * Active the conda environment from shell
```powershell ```powershell
source activate fixminerEnv source activate fixminerEnv
@@ -81,6 +85,9 @@ In order to launch FixMiner, execute [fixminer.sh](python/fixminer.sh)
bash fixminer.sh [JOB] [CONFIG_FILE] bash fixminer.sh [JOB] [CONFIG_FILE]
e.g. bash fixminer.sh dataset4c /Users/projects/release/fixminer_source/src/main/resources/config.yml e.g. bash fixminer.sh dataset4c /Users/projects/release/fixminer_source/src/main/resources/config.yml
#### Redis Commands
hlen diffEntry
To see number of patches / diff entries computed rich edit
#### Job Types #### Job Types
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
source activate fixminerEnv
PYTHONPATH=$(pwd) python -u python/main.py -root $(pwd)/python -job $2 -prop $1
Binary file not shown.
+2
View File
@@ -17,6 +17,8 @@ def createDS():
pjList = PROJECT_LIST.split(',') pjList = PROJECT_LIST.split(',')
if not os.path.exists(DATASET_PATH): if not os.path.exists(DATASET_PATH):
os.mkdir(DATASET_PATH) os.mkdir(DATASET_PATH)
if not os.path.exists(COMMIT_DFS):
os.mkdir(COMMIT_DFS)
subjects = pd.read_csv(join(ROOT,'data', 'dataset.csv')) subjects = pd.read_csv(join(ROOT,'data', 'dataset.csv'))
@@ -135,7 +135,8 @@ public class Launcher {
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); // log.error(e.getMessage());
e.printStackTrace();
// e.printStackTrace(); // e.printStackTrace();
} }
@@ -58,8 +58,7 @@ public class EnhancedASTDiff {
.filter(x -> !x.getName().startsWith("cocci")) .filter(x -> !x.getName().startsWith("cocci"))
.filter(x -> !x.getName().endsWith(".index")) .filter(x -> !x.getName().endsWith(".index"))
.collect(Collectors.toList()); .collect(Collectors.toList());
} } else {
else {
List<Predicate<File>> allPredicates = new ArrayList<Predicate<File>>(); List<Predicate<File>> allPredicates = new ArrayList<Predicate<File>>();
for (String s : projectList) { for (String s : projectList) {
Predicate<File> predicate = x -> x.getName().endsWith(s); Predicate<File> predicate = x -> x.getName().endsWith(s);
@@ -74,10 +73,6 @@ public class EnhancedASTDiff {
} }
String project = folder.getName(); String project = folder.getName();
List<MessageFile> allMessageFiles = new ArrayList<>(); List<MessageFile> allMessageFiles = new ArrayList<>();
for (File target : folders) { for (File target : folders) {
@@ -104,15 +99,24 @@ public class EnhancedASTDiff {
log.info("{} files to process ...", allMessageFiles.size()); log.info("{} files to process ...", allMessageFiles.size());
} }
boolean finalIsJava = isJava; boolean finalIsJava = isJava;
ProgressBar.wrap(allMessageFiles.stream(). // ProgressBar.wrap(allMessageFiles.stream().
parallel(),"Task"). // parallel(),"Task").
// forEach(m ->
// {
// EDiffHunkParser parser = new EDiffHunkParser();
// parser.parseFixPatterns(m.getPrevFile(),m.getRevFile(), m.getDiffEntryFile(),project,innerPool,srcMLPath,hunkLimit, finalIsJava);
// }
// );
//
// }
allMessageFiles.stream().
parallel().
forEach(m -> forEach(m ->
{ {
EDiffHunkParser parser = new EDiffHunkParser(); EDiffHunkParser parser = new EDiffHunkParser();
parser.parseFixPatterns(m.getPrevFile(), m.getRevFile(), m.getDiffEntryFile(), project, innerPool, srcMLPath, hunkLimit, finalIsJava); parser.parseFixPatterns(m.getPrevFile(), m.getRevFile(), m.getDiffEntryFile(), project, innerPool, srcMLPath, hunkLimit, finalIsJava);
} }
); );
} }
+6 -6
View File
@@ -7,12 +7,12 @@ coccinelle:
dataset: dataset:
# home: /Users/anilkoyuncu/projects/fixminer/fixminer-core/python/data/gumInputLinux # home: /Users/anilkoyuncu/projects/fixminer/fixminer-core/python/data/gumInputLinux
inputPath : /Users/anilkoyuncu/projects/test/fixminer-data/patches inputPath : /Users/anil.koyuncu/projects/release/fixminer-data/patches
repo: /Users/anilkoyuncu/projects/test/fixminer-data/datasets repo: /Users/anil.koyuncu/projects/release/fixminer-data/datasets
fixminer: fixminer:
projectType : java projectType : java
datapath: /Users/anilkoyuncu/projects/test/fixminer-data/ datapath: /Users/anil.koyuncu/projects/release/fixminer-data/
pjName : patches pjName : patches
@@ -22,7 +22,7 @@ fixminer:
hunkLimit : 2 hunkLimit : 2
patchSize : 50 patchSize : 50
projectList : spring-shell,fuse,metadata,commons-codec,commons-collections,commons-compress,commons-configuration,commons-crypto,commons-csv projectList : fuse
inputPath : /Users/anilkoyuncu/projects/test/fixminer-data/patches inputPath : /Users/anil.koyuncu/projects/release/fixminer-data/patches
redisPath : /Users/anilkoyuncu/projects/release/test/fixminer_source/python/data/redis redisPath : /Users/anil.koyuncu/projects/release/fixminer_source/python/data/redis
srcMLPath : /usr/local/bin/srcml srcMLPath : /usr/local/bin/srcml