RFR: 8141678: sun.invoke.util.Wrapper eagerly initializes all integral type caches

John Rose john.r.rose at oracle.com
Thu Nov 12 00:42:56 UTC 2015


On Nov 9, 2015, at 3:37 PM, Claes Redestad <claes.redestad at oracle.com> wrote:
> 
> so we should add some test cases that guards against Wrapper.zero references leaking through the public API and add stronger wording to Wrapper.zero documentation?
> 
> I turned your test case below into a jtreg test, included added variants for the other integral primitive types:
> 
> http://cr.openjdk.java.net/~redestad/scratch/wrapperTest.01/ <http://cr.openjdk.java.net/~redestad/scratch/wrapperTest.01/>
> 
> 1. int, short and long cases behave as expected: Wrapper.zero doesn't escape

Did any of these tests find a bug with any version of your code?  If not, I don't think they pull their weight.

> 2. void -> byte -> Object and void -> char -> Object box to null (test passes with 8141678 applied); bug or intended?

That would be a bug, but the test does not perform those changes.  It goes void -> Character (null) -> Object (null).


More information about the core-libs-dev mailing list