From 16f673490dc4e2891c6ceb32cf4da4e8991b0d23 Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Thu, 22 Jun 2017 09:50:31 +0200 Subject: [PATCH 1/3] Fix all remaining Eclipse "Unnecessary Code" warnings There were only three left, all fairly straightforward to fix. --- .../wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java | 3 +-- .../src/com/ibm/wala/ipa/slicer/SDGSupergraph.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/com.ibm.wala.cast.java.ecj/src/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java b/com.ibm.wala.cast.java.ecj/src/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java index 796787785..344d404a5 100644 --- a/com.ibm.wala.cast.java.ecj/src/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java +++ b/com.ibm.wala.cast.java.ecj/src/com/ibm/wala/cast/java/translator/jdt/JDTJava2CAstTranslator.java @@ -180,7 +180,6 @@ import com.ibm.wala.util.debug.Assertions; // * boxing (YUCK). see resolveBoxing() // * enums (probably in simplename or something. but using resolveConstantExpressionValue() possible) -@SuppressWarnings("unchecked") public abstract class JDTJava2CAstTranslator { protected boolean dump = false; @@ -2371,7 +2370,7 @@ public abstract class JDTJava2CAstTranslator { // First compute the control flow edges for the various case labels for (int i = 0; i < cases.size(); i++) { - Statement se = (Statement) cases.get(i); + Statement se = cases.get(i); if (se instanceof SwitchCase) { SwitchCase c = (SwitchCase) se; diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/SDGSupergraph.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/SDGSupergraph.java index ff5d797eb..7bc22f67a 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/SDGSupergraph.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/SDGSupergraph.java @@ -15,7 +15,6 @@ import java.util.Iterator; import com.ibm.wala.dataflow.IFDS.ISupergraph; import com.ibm.wala.ipa.callgraph.CGNode; import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; -import com.ibm.wala.ipa.slicer.Slicer.ControlDependenceOptions; import com.ibm.wala.ssa.SSAAbstractInvokeInstruction; import com.ibm.wala.util.Predicate; import com.ibm.wala.util.collections.EmptyIterator; From 7d29573a26791c8c6c7d2ac1ac9b8adf5725bc68 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Thu, 22 Jun 2017 14:32:47 +0200 Subject: [PATCH 2/3] Remove code to scan call sites for max param count We cannot find any case where this code fixes a problem, and it doesn't seem to be a good fix anyway. --- com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/PDG.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/PDG.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/PDG.java index 3f97d695e..b941e0b69 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/PDG.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/PDG.java @@ -934,16 +934,6 @@ public class PDG implements NumberedGraph { ArrayList list = new ArrayList(); int paramCount = node.getMethod().getNumberOfParameters(); - for (Iterator callers = cg.getPredNodes(node); callers.hasNext(); ) { - CGNode caller = callers.next(); - IR callerIR = caller.getIR(); - for (Iterator sites = cg.getPossibleSites(caller, node); sites.hasNext(); ) { - for (SSAAbstractInvokeInstruction inst : callerIR.getCalls(sites.next())) { - paramCount = Math.max(paramCount, inst.getNumberOfParameters()-1); - } - } - } - for (int i = 1; i <= paramCount; i++) { ParamCallee s = new ParamCallee(node, i); delegate.addNode(s); From 469734f61e7ccbd6d8e99cf26b102ff24e9f8cb4 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Thu, 22 Jun 2017 16:09:55 +0200 Subject: [PATCH 3/3] Various fixes to nodejs project config files * Fix pom.xml to be like other projects * Check for existence of nodejs download before re-downloading * Fix Eclipse config files to be like other projects --- com.ibm.wala.cast.js.nodejs/.classpath | 9 +- com.ibm.wala.cast.js.nodejs/.project | 5 - com.ibm.wala.cast.js.nodejs/build.properties | 12 +- com.ibm.wala.cast.js.nodejs/build.xml | 8 +- com.ibm.wala.cast.js.nodejs/pom.xml | 167 +++---------------- 5 files changed, 43 insertions(+), 158 deletions(-) diff --git a/com.ibm.wala.cast.js.nodejs/.classpath b/com.ibm.wala.cast.js.nodejs/.classpath index df7400135..a5cda6d1d 100644 --- a/com.ibm.wala.cast.js.nodejs/.classpath +++ b/com.ibm.wala.cast.js.nodejs/.classpath @@ -6,7 +6,7 @@ - + @@ -22,12 +22,7 @@ - - - - - - + diff --git a/com.ibm.wala.cast.js.nodejs/.project b/com.ibm.wala.cast.js.nodejs/.project index 8dfcf872e..ff94f75fc 100644 --- a/com.ibm.wala.cast.js.nodejs/.project +++ b/com.ibm.wala.cast.js.nodejs/.project @@ -20,11 +20,6 @@ - - org.eclipse.m2e.core.maven2Builder - - - org.eclipse.m2e.core.maven2Nature diff --git a/com.ibm.wala.cast.js.nodejs/build.properties b/com.ibm.wala.cast.js.nodejs/build.properties index 3a91edd24..1e594bfcb 100644 --- a/com.ibm.wala.cast.js.nodejs/build.properties +++ b/com.ibm.wala.cast.js.nodejs/build.properties @@ -1,9 +1,13 @@ -source.. = src/,\ - dat/ bin.includes = META-INF/,\ .,\ lib/json-20160212.jar,\ OSGI-INF/l10n/bundle.properties,\ - OSGI-INF/ + OSGI-INF/,\ + dat/ +output.. = bin/ +source.. = dat/,\ + src/ javacProjectSettings = true -output.. = target/classes/ +bin.excludes = dat/core-modules/.eslintrc,\ + dat/core-modules/.gitignore,\ + dat/core-modules/.gitkeep diff --git a/com.ibm.wala.cast.js.nodejs/build.xml b/com.ibm.wala.cast.js.nodejs/build.xml index 34d20bdc2..fd5f00b1c 100644 --- a/com.ibm.wala.cast.js.nodejs/build.xml +++ b/com.ibm.wala.cast.js.nodejs/build.xml @@ -5,7 +5,11 @@ - + + + + + @@ -36,4 +40,4 @@ - \ No newline at end of file + diff --git a/com.ibm.wala.cast.js.nodejs/pom.xml b/com.ibm.wala.cast.js.nodejs/pom.xml index ccae0041f..782f4a177 100644 --- a/com.ibm.wala.cast.js.nodejs/pom.xml +++ b/com.ibm.wala.cast.js.nodejs/pom.xml @@ -38,146 +38,33 @@ - - org.apache.maven.plugins - maven-dependency-plugin - 2.9 - - - copy-dependencies - process-resources - - copy-dependencies - - - ${basedir}/lib - false - false - true - - - - + + maven-dependency-plugin + + + + copy + + + + + org.mozilla + rhino + 1.7.6 + jar + false + + + org.json + json + 20160212 + + + ${basedir}/lib + + + + - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.eclipse.tycho - - - tycho-source-plugin - - - [0.23.1,) - - - plugin-source - - - - - - - - - - org.eclipse.tycho - - - tycho-compiler-plugin - - - [0.23.1,) - - - compile - - - - - - - - - - org.eclipse.tycho - - - tycho-packaging-plugin - - - [0.23.1,) - - - build-qualifier - validate-id - validate-version - - - - - - - - - - org.apache.maven.plugins - - - maven-antrun-plugin - - - [1.7,) - - - run - - - - - - - - - - org.apache.maven.plugins - - - maven-dependency-plugin - - - [2.9,) - - - copy-dependencies - - - - - - - - - - - - - - - org.json - json - 20160212 - -