-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P2
-
Affects Version/s: 10
-
Component/s: core-libs
-
b34
The APIs StringConcatFactory.makeConcat & makeConcatWithConstants when passed with MHs.publicLookup() errors out with StringConcatException. The documentation doesnt unambiguously mention restrictions on lookup param.
StringConcatFactory.makeConcat(MethodHandles.publicLookup(), "name", concatType); -> generates StringConcatException
whereas
StringConcatFactory.makeConcat(MethodHandles.lookup(), "name", concatType); -> works fine.
As per documentation:
"lookup - Represents a lookup context with the accessibility privileges of the caller" -> accessibility privileges can be spelt out more precisely. As in, of the PUBLIC/MODULE/PACKAGE/PRIVATE/PROTECTED privileges, what privileges the caller should hold to use the API.
StringConcatFactory.makeConcat(MethodHandles.publicLookup(), "name", concatType); -> generates StringConcatException
whereas
StringConcatFactory.makeConcat(MethodHandles.lookup(), "name", concatType); -> works fine.
As per documentation:
"lookup - Represents a lookup context with the accessibility privileges of the caller" -> accessibility privileges can be spelt out more precisely. As in, of the PUBLIC/MODULE/PACKAGE/PRIVATE/PROTECTED privileges, what privileges the caller should hold to use the API.
- csr for
-
JDK-8192037 Lookup argument for StringConcatFactory.makeConcat & makeConcatWithConstants cannot have privileges less than PRIVATE
-
- Closed
-