From cd87b1f01460a06ac9b5f8171f826720f8030eee Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Wed, 15 Mar 2023 16:28:00 +0800 Subject: [PATCH] reserve for parameter at compiler --- build.gradle | 12 ++++++++---- .../java/org/bdware/sc/boundry/test/ACIndexTest.java | 12 ++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index dbf9341..592f7b6 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,11 @@ plugins { group = "org.bdware.sc" version = "1.8.0" - +tasks.withType(JavaCompile) { + // options.compilerArgs << '-Xlint:none' + // options.compilerArgs << '-Xlint:deprecation' << "-Werror" + options.compilerArgs << '-parameters' +} repositories { mavenCentral() mavenLocal() @@ -49,10 +53,10 @@ dependencies { testImplementation 'junit:junit:4.13.2' } tasks.jar.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) - task classJar(type: Jar, dependsOn: classes) { classifier = "jar" } + jar { String libs = '' configurations.runtimeClasspath.each { @@ -62,8 +66,8 @@ jar { // uncomment this when publish, // while develop at local use "false" configurations.runtimeClasspath.filter { - // it.getAbsolutePath().contains("/lib/") - false + it.getAbsolutePath().contains("/lib/") + // false }.collect { it.isDirectory() ? it : zipTree(it) } diff --git a/src/test/java/org/bdware/sc/boundry/test/ACIndexTest.java b/src/test/java/org/bdware/sc/boundry/test/ACIndexTest.java index b492e60..4bd6b57 100644 --- a/src/test/java/org/bdware/sc/boundry/test/ACIndexTest.java +++ b/src/test/java/org/bdware/sc/boundry/test/ACIndexTest.java @@ -2,12 +2,17 @@ package org.bdware.sc.boundry.test; import org.bdware.sc.boundry.AccountIndex; import org.bdware.sc.boundry.JavaScriptEntry; +import org.bdware.sc.boundry.utils.AESUtil; import org.bdware.sc.engine.DesktopEngine; +import org.junit.Test; import wrp.jdk.nashorn.api.scripting.ScriptObjectMirror; import wrp.jdk.nashorn.internal.objects.Global; import wrp.jdk.nashorn.internal.runtime.Context; import wrp.jdk.nashorn.internal.runtime.ScriptObject; +import java.lang.reflect.Method; +import java.lang.reflect.Parameter; + public class ACIndexTest { public static void main(String[] args) { AccountIndex index = AccountIndex.createIndex(); @@ -38,4 +43,11 @@ public class ACIndexTest { long end = System.currentTimeMillis(); System.out.println(end - start); } + + @Test + public void test() throws NoSuchMethodException { + Method abc = AESUtil.class.getMethod("encrypt", String.class, String.class); + Parameter[] param = abc.getParameters(); + System.out.println(param[0].getName()); + } }