Community
Participate
Working Groups
Run the attached script. ecj will put: ----------------------------------------------- 1. ERROR in src\pkg2\SubFoo.java (at line 6) Field field = fields.get("test"); ^^^^^^^^^^^^^^^^^^ The type Foo<T>.Field is not visible ----------------------------------------------- which does not make sense. First, it does not complain about the 'Field field = null' declaration, which should be equally problematic if the Field type was invisible. Second, the Field type is protected in the super and thus _is_ visible anyhow. One workaround is to make the Field type public. More surprisingly, removing the type parameter of the Foo and SubFoo classes also makes the problem disappear.
Created attachment 87963 [details] The script to run
Bug in visibility check, was not properly stepping through erased types (this explains why manually removing type parameters did seem to address the issue).
Created attachment 88069 [details] Proposed patch
re: comment 2. Most type visibility checks where actually behaving properly, but one code path did fail. Field/methods were fine already.
Released for 3.4M5. Added GenericTypeTest#test1268 Fixed
Verified for 3.4M5 using build I20080204-0010
Is there any chance that this fix is also applied to maintenance release 3.3.2 ? Indeed, this bug was not there in release 3.3.1.1 and has been introduced in the maintenance branch for 3.3.2.
Released fix in 3.3.x maintenance branch (post 3.3.2). Unfortunately, Laurent, 3.3.2 is out already. If you are desperate, we could post a JDT/Core patch including this fix (based on 3.3.2 + this fix).
*** Bug 230466 has been marked as a duplicate of this bug. ***
*** Bug 232174 has been marked as a duplicate of this bug. ***
Fix is available in 3.4 and in 3.3 maintenance branch post 3.3.2. A patch is posted at: http://www.eclipse.org/jdt/core/r3.3/index.php#UPDATES (use the 3.3.3 preview)