Community
Participate
Working Groups
For the below application the ((Object[])test) is line is marked as unnecessay. This seemed to happen only in 3.2RC4 and not in previous builds. import java.util.Arrays; class Test { public static void main( String args[] ) { Object test = new Object[] { "Hello", "World" }; System.out.println(Arrays.asList(test)); System.out.println(Arrays.asList((Object[])test)); // Warning here } } If the application is run.. the results are quite different [[Ljava.lang.Object;@1372a1a] [Hello, World]
Reproduced with RC4.
Regression. 3.2RC2 didn't report the problem (haven't checked RC3 yet).
Problem got introduced in RC4. Consequence of fix for bug 139931
Created attachment 41743 [details] Proposed patch The patch is nuking the cast warning in case there is a dimension mismatch (ie. less warnings are going to be emitted no matter what). Thus it is safe. An extra warning is causing grief, since quickfix is going to clean code which it shouldn't. The patch has no influence on codegen, which always was correct here. Just an inacurrate warning notification.
Given the regression was quickly spotted, and it may affect quickfix; we may want to consider it for 3.2RC5. Martin - what is your vote ?
Olivier - pls review the patch
Dani - what is your vote ?
Mike - what is your vote ?
+1
+1 for 3.2RC5. As said earlier, only possible downside of this fix is that we could nuke too many warnings (only for varargs method) if we got the fix wrong.
Actually, since dani went away. Darin - would you please vote instead ?
Tim - what do you think ?
Released for 3.2RC5
Verified with I20060519-0010 for 3.2RC5