Community
Participate
Working Groups
N20070327-0010 Problems in the first element of an array initializer suppress problems in subsequent elements: public class Try { String[] m(String arg) { System.out.println(argument + argument); return new String[] { argument + argument, argument/*no problem*/ }; } } I would expect that the last 'argument' is also flagged as error. This would e.g. allow the 'Rename In File' quick assist to include it when started on the first 'argument'.
We could indeed by a little more fault tolerant, and keep trying to report more errors at once (as we usually try to do where it makes sense).
Added ArrayTest#test013
Created attachment 62086 [details] Proposed patch
Released for 3.3M7. Fixed
Test org.eclipse.jdt.ui.tests.quickfix.UnresolvedVariablesQuickFixTest#testVarInAnnotation3 needs to be updated.
The following test case: public class E { public @interface Annot { float[] value(); } @Annot(value={x}) class Inner { } } now reports two errors instead of one: x cannot be resolved The value for annotation attribute E.Annot.value must be a constant expression Prior to the fix, only the first error was reported. The second error can be seen as a secondary error.
Agreed. Fixed the other case as well, added AnnotationTest#test226.
Created attachment 62375 [details] Second part of the patch (for regression induced)
Verified for 3.3M7 with I20070427-0010