fix javaNullPointer

This commit is contained in:
Haoye TIAN
2020-03-06 10:19:47 +01:00
parent 62aa417523
commit da5a365dcf
4 changed files with 19 additions and 16 deletions
@@ -23,7 +23,8 @@ public class Launcher {
Properties appProps = new Properties(); Properties appProps = new Properties();
// String appConfigPath = "/Users/anil.koyuncu/projects/fixminer/fixminer_source/src/main/resource/app.properties"; // String appConfigPath = "/Users/anil.koyuncu/projects/fixminer/fixminer_source/src/main/resource/app.properties";
String appConfigPath = args[0]; // String appConfigPath = args[0];
String appConfigPath = "src/main/resource/app.properties";
appProps.load(new FileInputStream(appConfigPath)); appProps.load(new FileInputStream(appConfigPath));
// String portInner = appProps.getProperty("portInner","6380"); // String portInner = appProps.getProperty("portInner","6380");
@@ -40,12 +41,12 @@ public class Launcher {
String redisPath = appProps.getProperty("redisPath","FORKJOIN"); String redisPath = appProps.getProperty("redisPath","FORKJOIN");
String srcMLPath = appProps.getProperty("srcMLPath","FORKJOIN"); String srcMLPath = appProps.getProperty("srcMLPath","FORKJOIN");
String parameter = args[2]; // String parameter = args[2];
// String parameter = "L1"; String parameter = "L1";
// String parameter = "if"; // String parameter = "if";
// String parameter = "add"; // String parameter = "add";
String jobType = args[1]; // String jobType = args[1];
// String jobType = "RICHEDITSCRIPT"; String jobType = "RICHEDITSCRIPT";
// String jobType = "LOAD"; // String jobType = "LOAD";
// String jobType = "COMPARE"; // String jobType = "COMPARE";
@@ -93,6 +94,7 @@ public class Launcher {
case "L1": case "L1":
// job = "shape"; // job = "shape";
job = "single"; job = "single";
compareDBName = "clusterl0-gumInputALL.rdb"; compareDBName = "clusterl0-gumInputALL.rdb";
break; break;
case "L2": case "L2":
@@ -66,7 +66,7 @@ public class CompareTrees {
Integer numberOfWorkers = Integer.valueOf(numOfWorkers); Integer numberOfWorkers = Integer.valueOf(numOfWorkers);
final ExecutorService executor = Executors.newWorkStealingPool(numberOfWorkers); final ExecutorService executor = Executors.newWorkStealingPool(numberOfWorkers);
ArrayList<Future<?>> results = new ArrayList<Future<?>>(); ArrayList<Future<?>> results = new ArrayList<Future<?>>();
for (int i = 1; i <numberOfWorkers ; i++) { for (int i = 0; i <numberOfWorkers ; i++) {
// schedule the work // schedule the work
@@ -159,7 +159,7 @@ public class EDiffHelper {
if(actionSet.getParent() == null){ if(actionSet.getParent() == null || ( actionSet.getParent().getAction().getClass().equals(Update.class) && ((Update) actionSet.getParent().getAction()).getflag() == false)){
//root //root
// parent = new Tree(newType,""); // parent = new Tree(newType,"");
@@ -175,7 +175,7 @@ public class EDiffHelper {
if (subActions.size() != 0){ if (subActions.size() != 0){
for (HierarchicalActionSet subAction : subActions) { for (HierarchicalActionSet subAction : subActions) {
if(actionSet.getParent() == null){ if(actionSet.getParent() == null || ( actionSet.getParent().getAction().getClass().equals(Update.class) && ((Update) actionSet.getParent().getAction()).getflag() == false)){
children = parent; children = parent;
} }
getTargetTree(subAction,children,null,tc); getTargetTree(subAction,children,null,tc);
@@ -199,7 +199,7 @@ public class EDiffHelper {
log.error("More than 1"); log.error("More than 1");
} }
newType = keysByValue.get(0); newType = keysByValue.get(0);
if(actionSet.getParent() == null){ if(actionSet.getParent() == null || ( actionSet.getParent().getAction().getClass().equals(Update.class) && ((Update) actionSet.getParent().getAction()).getflag() == false)){
//root //root
// parent = new Tree(newType,""); // parent = new Tree(newType,"");
@@ -215,7 +215,7 @@ public class EDiffHelper {
if (subActions.size() != 0){ if (subActions.size() != 0){
for (HierarchicalActionSet subAction : subActions) { for (HierarchicalActionSet subAction : subActions) {
if(actionSet.getParent() == null){ if(actionSet.getParent() == null || ( actionSet.getParent().getAction().getClass().equals(Update.class) && ((Update) actionSet.getParent().getAction()).getflag() == false)){
children = parent; children = parent;
} }
getASTTree(subAction,children,null,tc); getASTTree(subAction,children,null,tc);
@@ -461,7 +461,7 @@ public class EDiffHelper {
}else{ }else{
new Exception("unknow action"); new Exception("unknow action");
} }
if(actionSet.getParent() == null){ if(actionSet.getParent() == null || ( actionSet.getParent().getAction().getClass().equals(Update.class) && ((Update) actionSet.getParent().getAction()).getflag() == false)){
//root //root
parent = tc.createTree(newType, "", null); parent = tc.createTree(newType, "", null);
@@ -476,7 +476,7 @@ public class EDiffHelper {
if (subActions.size() != 0){ if (subActions.size() != 0){
for (HierarchicalActionSet subAction : subActions) { for (HierarchicalActionSet subAction : subActions) {
if(actionSet.getParent() == null){ if(actionSet.getParent() == null || ( actionSet.getParent().getAction().getClass().equals(Update.class) && ((Update) actionSet.getParent().getAction()).getflag() == false)){
children = parent; children = parent;
} }
getActionTree(subAction,children,null,tc); getActionTree(subAction,children,null,tc);
+5 -4
View File
@@ -3,15 +3,16 @@ pjName = gumInput
portInner = 6380 portInner = 6380
portDumps = 6399 portDumps = 6399
parallelism = AKKA parallelism = AKKA
numOfWorkers = 30 numOfWorkers = 20
hostname = localhost hostname = localhost
hunkLimit = 10 hunkLimit = 10
#inputPath = /Users/anilkoyuncu/projects/gumInputLinux #inputPath = /Users/anilkoyuncu/projects/gumInputLinux
inputPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/gumInputLinux inputPath = /Users/haoye.tian/Documents/University/data/fixminer-data/gumInput
redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis redisPath = /Users/haoye.tian/Documents/University/project/fixminer-core/python/data/redis
#srcMLPath= /Users/anil.koyuncu/Downloads/srcML/src2srcml #srcMLPath= /Users/anil.koyuncu/Downloads/srcML/src2srcml
srcMLPath= /Users/anil.koyuncu/Downloads/srcML.0.9.5/bin/srcml srcMLPath= /Users/haoye.tian/Do\
cuments/University/project/srcML0.9.5/bin/srcml
actionType = ALL actionType = ALL
eDiffTimeout = 900 eDiffTimeout = 900