Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e886b5f359 | |||
| 5ab2d6f582 | |||
| e33f306af3 | |||
| 5c2d78e370 |
+22
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019 SnT,University of Luxembourg
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -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.
|
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
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
|
|||||||
@@ -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('_')[0].split('-')[1])
|
||||||
matches['sizes']=matches['pairs_key'].apply(lambda x:x.split(root)[1].split('/')[0].split('-')[1])
|
matches['sizes']=matches['pairs_key'].apply(lambda x:x.split(root)[1].split('/')[0].split('-')[1])
|
||||||
if level == 'tokens':
|
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':
|
# if level == 'tokens':
|
||||||
# matches['actions'] = matches['pairs_key'].apply(lambda x: x.split('/')[0].split('-')[2])
|
# 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])
|
# 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]
|
match = matches[matches['sizes'] == s]
|
||||||
|
|
||||||
if level == 'tokens':
|
if level == 'tokens':
|
||||||
actions = match['tokens'].unique().tolist()
|
actions = match['actions'].unique().tolist()
|
||||||
for action in actions:
|
for action in actions:
|
||||||
match = match[match['tokens'] == action]
|
match = match[match['actions'] == action]
|
||||||
clusterCore(clusterPath, level, match, pairsPath, root, s,action)
|
clusterCore(clusterPath, level, match, pairsPath, root, s,action)
|
||||||
# elif level == 'tokens':
|
# elif level == 'tokens':
|
||||||
# actions = match['actions'].unique().tolist()
|
# actions = match['actions'].unique().tolist()
|
||||||
@@ -200,7 +200,10 @@ def dumpFilesCore(t):
|
|||||||
jdk8 = os.environ["JDK8"]
|
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
|
# 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)
|
os.makedirs(clusterSavePath, exist_ok=True)
|
||||||
shutil.copy(filePath,join(clusterSavePath,dumpFile))
|
shutil.copy(filePath,join(clusterSavePath,dumpFile))
|
||||||
# with open(join(clusterSavePath, dumpFile), 'w', encoding='utf-8') as writeFile:
|
# with open(join(clusterSavePath, dumpFile), 'w', encoding='utf-8') as writeFile:
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<akka.version>2.4.17</akka.version>
|
<akka.version>2.4.17</akka.version>
|
||||||
<logback.version>1.1.2</logback.version>
|
<logback.version>1.2.0</logback.version>
|
||||||
<slf4j-api.version>1.7.7</slf4j-api.version>
|
<slf4j-api.version>1.7.7</slf4j-api.version>
|
||||||
<gumtree.version>2.0.0-SNAPSHOT</gumtree.version>
|
<gumtree.version>2.0.0-SNAPSHOT</gumtree.version>
|
||||||
<junit.version>4.12</junit.version>
|
<junit.version>4.12</junit.version>
|
||||||
|
|||||||
@@ -151,13 +151,14 @@ public class CompareTrees {
|
|||||||
|
|
||||||
public static boolean newCoreCompare( String treeType,ArrayList<String> errorPairs, HashMap<String, String> filenames,JedisPool outerPool ) {
|
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()) {
|
try (Jedis outer = outerPool.getResource()) {
|
||||||
pairName = outer.spop("compare");
|
pairName = outer.spop("compare");
|
||||||
}
|
// }
|
||||||
|
if(pairName.equals("0"))
|
||||||
|
return true;
|
||||||
String matchKey = null;
|
String matchKey = null;
|
||||||
try {
|
// try {
|
||||||
|
|
||||||
String[] split = pairName.split("/");
|
String[] split = pairName.split("/");
|
||||||
|
|
||||||
@@ -235,7 +236,7 @@ public class CompareTrees {
|
|||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
errorPairs.add(matchKey);
|
errorPairs.add(pairName);
|
||||||
if (pairName == null)
|
if (pairName == null)
|
||||||
return false;
|
return false;
|
||||||
log.debug("{} not comparable", pairName);
|
log.debug("{} not comparable", pairName);
|
||||||
|
|||||||
Reference in New Issue
Block a user