RFR: JDK-8183372 : Refactor java/lang/Class shell tests to java [v2]
Mandy Chung
mchung at openjdk.java.net
Tue Jan 26 22:46:47 UTC 2021
On Mon, 25 Jan 2021 19:33:08 GMT, Mahendra Chhipa <github.com+34924738+mahendrachhipa at openjdk.org> wrote:
>> test/jdk/java/lang/Class/getEnclosingClass/EnclosingClassTest.java line 103:
>>
>>> 101: createAndWriteEnclosingClasses(enclosingPath, pkg2File, "pkg1.pkg2");
>>> 102:
>>> 103: String javacPath = JDKToolFinder.getJDKTool("javac");
>>
>> You can use `jdk.test.lib.compiler.CompilerUtils` test library to compile the file in process.
>
> I tried to use the CopmilerUtils to compile the file, But this utility is not able to the dependencies of the class. Example it is not able to find the common.TestMe class while try to compile the EnclosingClass.java.
You need to add `--source-path` where it can find the dependent source files.
>> test/jdk/java/lang/Class/getEnclosingClass/EnclosingClassTest.java line 176:
>>
>>> 174: }
>>> 175:
>>> 176: private void check(final Class<?> c, final Class<?> enc,
>>
>> I see that you make all parameters in all methods final. It just adds noise. Can you leave it out?
>
> To avoid the Checkstyle warnings, I added them.
Is it from your IDE configurations? You can turn off Checkstyle warnings. This just adds noise.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2170
More information about the core-libs-dev
mailing list