-
Bug
-
Resolution: Fixed
-
P5
-
19
-
None
-
b17
The AsVarargsCollector::asCollectorCache field is marked as `@Stable` but doesn't follow the contract for Stable fields.
The contract for Stable, as described in [1], states:
> A field may be annotated as stable if all of its component variables
> changes value at most once.
...
> Since all fields begin with a default value of null for references
> (resp., zero for primitives), it follows that this annotation indicates
> that the first non-null (resp., non-zero) value stored in the field
> will never be changed.
The AsVarargsCollector::asTypeUncached method updates the `asCollectorCache` field.
This was discovered by the OpenJ9 project while investigating a test issue in the CatchExceptionTest.java [2] test case related to the `getCatcher` method.
[1] https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
[2] https://github.com/openjdk/jdk/blob/master/test/jdk/java/lang/invoke/MethodHandles/CatchExceptionTest.java
The contract for Stable, as described in [1], states:
> A field may be annotated as stable if all of its component variables
> changes value at most once.
...
> Since all fields begin with a default value of null for references
> (resp., zero for primitives), it follows that this annotation indicates
> that the first non-null (resp., non-zero) value stored in the field
> will never be changed.
The AsVarargsCollector::asTypeUncached method updates the `asCollectorCache` field.
This was discovered by the OpenJ9 project while investigating a test issue in the CatchExceptionTest.java [2] test case related to the `getCatcher` method.
[1] https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
[2] https://github.com/openjdk/jdk/blob/master/test/jdk/java/lang/invoke/MethodHandles/CatchExceptionTest.java