RFR: JDK-8183372 : Refactor java/lang/Class shell tests to java [v4]
Mandy Chung
mchung at openjdk.java.net
Mon Feb 1 23:59:45 UTC 2021
On Thu, 28 Jan 2021 00:34:08 GMT, Brent Christian <bchristi at openjdk.org> wrote:
>> Mahendra Chhipa has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Implemented the review comments.
>
> test/jdk/java/lang/Class/getEnclosingClass/EnclosingClassTest.java line 158:
>
>> 156: private void match(final String actual, final String expected) {
>> 157: System.out.println("actual:" + actual + "expected:" + expected);
>> 158: assert ((actual == null && expected == null) || actual.equals(expected.trim()));
>
> I think we need to figure out where the extra space is coming from, if the test worked before, but now fails without adding the `trim()`.
>
> Also, I think it would be better to throw an exception instead of using `assert`, so the test works with or without assertions being enabled.
Good catch. I missed your comment about this change.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2170
More information about the core-libs-dev
mailing list