Community
Participate
Working Groups
Build Identifier: 20100218-1602 Given the following code: class A { class B { private static final String TAG1 = "tag1", TAG2 = "tag2"; } String X = B.TAG1, Y = B.TAG2; } If you convert class B to toplevel, then you are warned about needing to change the visibility of TAG1 and TAG2 to default. After refactoring you get: class B { static final String TAG1; static final String TAG2; } which loses the String literal initializer values. Reproducible: Always Steps to Reproduce: (as above)
Created attachment 178759 [details] First stab Unfortunately, the patch is too ugly for M2. I tried to use a WeakHashMap, but I had to discover that WHM leaks values, unless the map is used again after a key has been garbage collected... . Waiting for bug 325131 which will make a good fix possible.
Created attachment 180499 [details] Fix
Fixed in HEAD.
Created attachment 180878 [details] Fix 2 The original fix didn't work in cases where a multi-field declaration had to be split and the new fragment got touched twice. Fixed in HEAD.
Verified in I20101025-1800.