Compare commits

...

3 Commits

Author SHA1 Message Date
dependabot[bot] 27d6adf722 Bump junit from 4.12 to 4.13.1 in /richedit
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 20:57:33 +00:00
mimic e33f306af3 updated readme with structure of cluster folders 2020-06-10 12:02:39 +02:00
mimic 5c2d78e370 fix compare 0 bug and cluster of tokens 2020-06-10 11:52:26 +02:00
4 changed files with 35 additions and 11 deletions
+21 -1
View File
@@ -126,7 +126,27 @@ A log file (app.log) is created after every execution of the [fixminer.sh]((pyth
8. __stats__: Calculate frequency statistics of the patterns under statsactions.csv in datapath. The information is also written in app.log file.
7. __patterns__ : Export FixPatterns of APR integration under patterns folder located in datapath/
9. __patterns__ : Export FixPatterns of APR integration under patterns folder located in datapath/
##### Structure of the cluster folders
```powershell
|--- actions : Action clusters
|------ReturnStatement : AST Node type
|---------4 : The size of the rich edit script
|------------0 : 0th Action cluster of ReturnStatement of rich edit size 4
|--------------- filename : 0th member of the cluster
|--- tokens : Token clusters
|------ReturnStatement : AST Node type
|---------4 : The size of the rich edit script
|------------0 : 0th Action cluster of ReturnStatement of rich edit size 4
|---------------0 : 0th Token cluster of ReturnStatement of rich edit size 4 of 0th action cluster
|----------------- filename : 0th member of the cluster
```
<!--
+7 -4
View File
@@ -87,7 +87,7 @@ def loadPairMulti(root,clusterPath,level):
# matches['sizes']=matches['pairs_key'].apply(lambda x:x.split('_')[0].split('-')[1])
matches['sizes']=matches['pairs_key'].apply(lambda x:x.split(root)[1].split('/')[0].split('-')[1])
if level == 'tokens':
matches['tokens']=matches['pairs_key'].apply(lambda x:x.split('/')[0].split('-')[2])
matches['actions']=matches['pairs_key'].apply(lambda x:x.split('/')[0].split('-')[2])
# if level == 'tokens':
# matches['actions'] = matches['pairs_key'].apply(lambda x: x.split('/')[0].split('-')[2])
# matches['tokens']=matches['pairs_key'].apply(lambda x:x.split('/')[0].split('-')[3])
@@ -125,9 +125,9 @@ def cluster(clusterPath,pairsPath, level):
match = matches[matches['sizes'] == s]
if level == 'tokens':
actions = match['tokens'].unique().tolist()
actions = match['actions'].unique().tolist()
for action in actions:
match = match[match['tokens'] == action]
match = match[match['actions'] == action]
clusterCore(clusterPath, level, match, pairsPath, root, s,action)
# elif level == 'tokens':
# actions = match['actions'].unique().tolist()
@@ -200,7 +200,10 @@ def dumpFilesCore(t):
jdk8 = os.environ["JDK8"]
# cmd = "JAVA_HOME='"+jdk8+"' java -jar "+ join(DATA_PATH,'FixPatternMiner-1.0.1.jar') + " " + join(DATA_PATH,'app.properties')+" PATTERN " +key
clusterSavePath = join(clusterPath, root, s, str(idx))
if level == 'tokens':
clusterSavePath = join(clusterPath, root, s, action, str(idx))
else:
clusterSavePath = join(clusterPath, root, s, str(idx))
os.makedirs(clusterSavePath, exist_ok=True)
shutil.copy(filePath,join(clusterSavePath,dumpFile))
# with open(join(clusterSavePath, dumpFile), 'w', encoding='utf-8') as writeFile:
Executable → Regular
+1 -1
View File
@@ -22,7 +22,7 @@
<logback.version>1.1.2</logback.version>
<slf4j-api.version>1.7.7</slf4j-api.version>
<gumtree.version>2.0.0-SNAPSHOT</gumtree.version>
<junit.version>4.12</junit.version>
<junit.version>4.13.1</junit.version>
<redis.version>2.8.1</redis.version>
<commons.version>1.3</commons.version>
<commons-io.version>2.4</commons-io.version>
@@ -151,13 +151,14 @@ public class CompareTrees {
public static boolean newCoreCompare( String treeType,ArrayList<String> errorPairs, HashMap<String, String> filenames,JedisPool outerPool ) {
String pairName;
String pairName = null;
try (Jedis outer = outerPool.getResource()) {
pairName = outer.spop("compare");
}
// }
if(pairName.equals("0"))
return true;
String matchKey = null;
try {
// try {
String[] split = pairName.split("/");
@@ -235,7 +236,7 @@ public class CompareTrees {
// break;
}
}catch (Exception e) {
errorPairs.add(matchKey);
errorPairs.add(pairName);
if (pairName == null)
return false;
log.debug("{} not comparable", pairName);