Community
Participate
Working Groups
Top of BETA_JAVA7 branch. The following code triggers an AIOOB from the compiler. public class X<T> { X(T t) {} X<String> f = new X<>(new Y()); } (Y needs to be undefined to trigger the error)
Created attachment 195297 [details] Proposed patch Patch under test
Added org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_7.test0029() as a regression test.
Created attachment 195299 [details] Proposed patch Actually, I like this patch better.
Released in BETA_JAVA7 branch.
I meant to fix QAE in a similar manner, but forgot: Now the following program continues to trigger AIOOB: public class X { class I<T> { I(T t) {} } X.I<String> f = new X().new I<>(new Y()); } Patch will follow shortly.
Created attachment 195460 [details] Additional fix + test This patch addresses QAE. Other subtypes of AllocationExpression will undergo similar change via bug 343693.
Verified using v_B65.