From 52f8ab05f26c028d2372565544681af2ade534f6 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Mon, 16 May 2022 01:20:15 -0400 Subject: [PATCH] [-] Remove commented code --- python/dataset4j.py | 2 +- python/fixminer.sh | 6 -- .../main/java/edu/lu/uni/serval/Launcher.java | 98 ++++--------------- 3 files changed, 20 insertions(+), 86 deletions(-) delete mode 100644 python/fixminer.sh diff --git a/python/dataset4j.py b/python/dataset4j.py index 334cc01..d8912ab 100644 --- a/python/dataset4j.py +++ b/python/dataset4j.py @@ -96,7 +96,7 @@ def create_dataset(cfg: dict, project_list: str = PROJECT_LIST): raise NotImplementedError(f'Unknown limitCommitsBeforeDays type: {type(value)}. ' f'Only timedelta and int/float (days) are supported.') - print(f'> Has {len(commits)} comments before filtering for date < {end_date}') + print(f'> Has {len(commits)} commits before filtering for date < {end_date}') commits = commits[commits.commitDate < end_date] commits = commits[commits.commit.isin(fixes)] diff --git a/python/fixminer.sh b/python/fixminer.sh deleted file mode 100644 index 2fc18e3..0000000 --- a/python/fixminer.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - - -source activate fixminerEnv - -PYTHONPATH=$(pwd) python -u main.py -root $(pwd) -job $2 -prop $1 diff --git a/richedit/src/main/java/edu/lu/uni/serval/Launcher.java b/richedit/src/main/java/edu/lu/uni/serval/Launcher.java index 960cfac..26dbab5 100755 --- a/richedit/src/main/java/edu/lu/uni/serval/Launcher.java +++ b/richedit/src/main/java/edu/lu/uni/serval/Launcher.java @@ -16,34 +16,16 @@ import java.util.Properties; /** * Created by anilkoyuncu on 14/04/2018. */ -public class Launcher { +public class Launcher +{ private static Logger log = LoggerFactory.getLogger(Launcher.class); - public static void main(String[] args) throws IOException { - - + public static void main(String[] args) throws IOException + { Properties appProps = new Properties(); -// String hostname = "Unknown"; -// try -// { -// InetAddress addr; -// addr = InetAddress.getLocalHost(); -// hostname = addr.getHostName(); -// } -// catch (UnknownHostException ex) -// { -// System.out.println("Hostname can not be resolved"); -// } -// String appConfigPath; -// if (hostname.equals("Unknown")){ -// appConfigPath = "src/main/resource/app.properties"; -// } -// else{ -// appConfigPath = "src/main/resource/"+hostname.split("\\.")[0]+".app.properties"; -// } - if(args.length != 2) + if (args.length != 2) { System.out.println("Proper Usage is: \n\tfirst argument full path to .properties file (e.g. an example is located under resources) \n\tsecond argument jobType (e.g RICHEDITSCRIPT, COMPARE)"); System.exit(0); @@ -52,14 +34,10 @@ public class Launcher { String appConfigPath = args[0]; Yaml yaml = new Yaml(); -// InputStream inputStream = this.getClass() -// .getClassLoader() -// .getResourceAsStream("customer.yaml"); Map obj = yaml.load(new FileInputStream(appConfigPath)); appProps.load(new FileInputStream(appConfigPath)); Map fixminer = (Map) obj.get("fixminer"); -// String numOfWorkers = appProps.getProperty("numOfWorkers", "10"); String numOfWorkers = String.valueOf(fixminer.get("numOfWorkers")); String portDumps = String.valueOf(fixminer.get("portDumps")); String projectType = (String) fixminer.get("projectType"); @@ -72,80 +50,42 @@ public class Launcher { String redisPath = (String) fixminer.get("redisPath"); String srcMLPath = (String) fixminer.get("srcMLPath"); -// String parameter = args[2]; -// String parameter = "L1"; String jobType = args[1]; -// String jobType = "RICHEDITSCRIPT"; -// jobType = "COMPARE"; - - - mainLaunch( numOfWorkers, jobType, portDumps,projectType,input,redisPath, srcMLPath,hunkLimit,projectList,patchSize); - + mainLaunch(numOfWorkers, jobType, portDumps, projectType, input, redisPath, srcMLPath, hunkLimit, projectList, patchSize); } - public static void mainLaunch(String numOfWorkers, String jobType, String portDumps, String projectType, String input, String redisPath,String srcMLPath,String hunkLimit,String[] projectList,String patchSize){ - - + public static void mainLaunch(String numOfWorkers, String jobType, String portDumps, String projectType, String input, String redisPath, String srcMLPath, String hunkLimit, String[] projectList, String patchSize) + { String dbDir; String dumpsName; String gumInput; - dumpsName = "dumps-"+projectType+".rdb"; + dumpsName = "dumps-" + projectType + ".rdb"; gumInput = input; dbDir = redisPath; - - try { - switch (jobType) { + try + { + switch (jobType) + { case "RICHEDITSCRIPT": - EnhancedASTDiff.main(gumInput, portDumps, dbDir, dumpsName, srcMLPath,hunkLimit,projectList,patchSize,projectType); + EnhancedASTDiff.main(gumInput, portDumps, dbDir, dumpsName, srcMLPath, hunkLimit, projectList, patchSize, projectType); break; case "COMPARE": -// String job; -// String compareDBName; -// switch (parameter){ -// case "L1": -//// job = "shape"; -// job = "single"; -// compareDBName = "clusterl0-gumInputALL.rdb"; -// break; -// case "L2": -// job = "action"; -// compareDBName = "clusterl1-gumInputALL.rdb"; -// break; -// case "L3": -// job = "token"; -// compareDBName = "clusterl2-gumInputALL.rdb"; -// break; -// default: -// throw new Error("unknown level please specify L1,L2,L3"); -// } - - - CompareTrees.main(redisPath, portDumps,dumpsName, numOfWorkers); + CompareTrees.main(redisPath, portDumps, dumpsName, numOfWorkers); break; -// case "PATTERN": -// ClusterToPattern.main(portDumps,redisPath, dumpsName, parameter); -// break; default: throw new Error("unknown Job"); - } - } catch (Exception e) { -// log.error(e.getMessage()); + } + catch (Exception e) + { e.printStackTrace(); -// e.printStackTrace(); - } - - - - - } - + } }