RFR: 8262002: java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh failed with "TestCaseScaffoldException: DummyClassWithLVT did not match .class file" [v2]

Alex Menkov amenkov at openjdk.java.net
Wed Apr 21 20:51:51 UTC 2021


On Thu, 15 Apr 2021 03:14:34 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Updated the fix accordingly feedback
>
> test/jdk/java/lang/instrument/ATransformerManagementTestCase.java line 125:
> 
>> 123:         manager.addTransformer(transformer, canRetransform);
>> 124: //        verbosePrint("Added transformer " + transformer
>> 125: //            + " with canRetransform=" + canRetransform);
> 
> I'd suggest to remove the commented out lines.

fixed

> test/jdk/java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.java line 152:
> 
>> 150:         // directory so there is no conflict with the file
>> 151:         // in the test classes directory.
>> 152:         String resourceName = fTargetClassName + ".class";
> 
> This name can be defined out of methods `originalTargetClassFile` and `transformClassFile`. The method name `transformClassFile` is confusing. I'd suggest to rename it to `transformedClassFile` or `modifiedClassFile`. Also, the name `originalTargetClassFile` can be shortened to `originalClassFile`.

done

> test/jdk/java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.java line 186:
> 
>> 184:         int lineNum = 0;
>> 185:         for (String line: out1) {
>> 186:             if (expectedDiffenent(line)) {
> 
> Is it possible to use the `expectedDiffenent()` as a filter to get only needed lines from `disassembleClassFile()`?

It's implemented this way to keep lineNum correct. But it was error here. Fixed now

-------------

PR: https://git.openjdk.java.net/jdk/pull/3426


More information about the serviceability-dev mailing list