RFR: 8256154: Some TestNG tests require default constructors

Lance Andersen lancea at openjdk.java.net
Thu Nov 19 16:48:06 UTC 2020


On Thu, 19 Nov 2020 16:36:02 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> test/jdk/java/lang/StackWalker/Basic.java line 116:
>> 
>>> 114:     /** For TestNG */
>>> 115:     public Basic() {
>>> 116:         depth = 0;
>> 
>> Is the assignment really ended here?  I only see:
>> 
>> Basic test = new Basic(depth[0]);
>> 
>> So I would assume you would be fine with an empty constructor?
>
> `depth` is `final`, so it needs to be assigned. but this could be replaced with `this(0)`

Ah, missed the final on depth :-)

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

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


More information about the core-libs-dev mailing list