From a38c5b7099ccd6b51b527a60b633bc72b2e580e7 Mon Sep 17 00:00:00 2001 From: Aakash Gnanakumar Date: Mon, 22 Jan 2024 16:59:05 -0800 Subject: [PATCH] removed unnecessary changes --- .../ibm/wala/ipa/callgraph/AnalysisScope.java | 1 - .../core/tests/callGraph/CallGraphTest.java | 4 +-- .../core/tests/cha/AnalysisScopeTest.java | 19 +--------- gradle/wrapper/gradle-wrapper.properties | 6 ++-- gradlew | 14 ++++---- z-out.java | 35 ------------------- 6 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 z-out.java diff --git a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java index d07017869d..55f4b21af1 100644 --- a/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java +++ b/core/src/main/java/com/ibm/wala/ipa/callgraph/AnalysisScope.java @@ -352,7 +352,6 @@ public String toString() { } public String toJson() { - // StringBuilder result = new StringBuilder(); HashMap res = new HashMap<>(); HashMap> loaders = new HashMap<>(); for (ClassLoaderReference loader : loadersByName.values()) { diff --git a/core/src/test/java/com/ibm/wala/core/tests/callGraph/CallGraphTest.java b/core/src/test/java/com/ibm/wala/core/tests/callGraph/CallGraphTest.java index 9dcf85eb39..cf60e65d01 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/callGraph/CallGraphTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/callGraph/CallGraphTest.java @@ -302,7 +302,7 @@ public void testPrimordial() if (useShortProfile()) { return; } - + AnalysisScope scope = CallGraphTestUtil.makeJ2SEAnalysisScope( "primordial.txt", @@ -680,4 +680,4 @@ public boolean hasEdge(MethodReference src, MethodReference dst) { } }; } -} +} \ No newline at end of file diff --git a/core/src/test/java/com/ibm/wala/core/tests/cha/AnalysisScopeTest.java b/core/src/test/java/com/ibm/wala/core/tests/cha/AnalysisScopeTest.java index 5a50500709..ad28a586e0 100644 --- a/core/src/test/java/com/ibm/wala/core/tests/cha/AnalysisScopeTest.java +++ b/core/src/test/java/com/ibm/wala/core/tests/cha/AnalysisScopeTest.java @@ -1,6 +1,5 @@ package com.ibm.wala.core.tests.cha; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -19,24 +18,8 @@ import java.nio.file.Paths; import org.junit.jupiter.api.Test; -import com.google.gson.Gson; - public class AnalysisScopeTest { - @Test - public void toJsonTest() throws IOException { - AnalysisScope scope = - AnalysisScopeReader.instance.readJavaScope( - TestConstants.WALA_TESTDATA, - // new FileProvider().getFile("J2SEClassHierarchyExclusions.txt"), - new FileProvider().getFile("GUIExclusions.txt"), - AnalysisScopeTest.class.getClassLoader()); - Gson gson = new Gson(); - String exp = gson.toJson("scope.toString()"); - System.out.println(scope.toJson()); - assertEquals(exp, scope.toJson()); - } - @Test public void testJarInputStream() throws IOException, ClassHierarchyException { AnalysisScope scope = @@ -72,4 +55,4 @@ public void testBaseScope() throws IOException, ClassHierarchyException { ClassLoaderReference.Application, "Ljava/awt/AlphaComposite")), "found unexpected class"); } -} +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41b59bedc4..e1b846c9d5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionSha256Sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/gradlew b/gradlew index 1aa94a4269..0adc8e1a53 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/z-out.java b/z-out.java deleted file mode 100644 index f4f67996fb..0000000000 --- a/z-out.java +++ /dev/null @@ -1,35 +0,0 @@ -// Example Code - -public class example { - public String convert_to_json(T dataStructure) throws IOException { - Gson gson = new Gson(); - System.out.println("gson"); - String json_format = gson.toJson(dataStructure); - FileWriter writer = new FileWriter("output2.json"); - writer.write(json_format); - writer.close(); - return json_format; - } - public String main() { - String out = convert_to_json("null"); - return out; - } - -} - -// example output - -{ - { - "Class_Name": "example", - "Functions": ["convert_to_json", "main"] - }, - { - "Class_Name": "convert_to_json", - "Functions": ["Gson", "toJson", "FileWriter", "write", "close"] - }, - { - "Class_Name": "main", - "Functions": ["convert_to_json"] - } -}