Community
Participate
Working Groups
Build 200411300800 Here's a small single file Test1.java -------------- //import com.mycom.MMM; //import com.mycom.NNN; interface RRR< A extends MMM<A, B>, B extends NNN> {} interface MMM< F extends MMM<F,G>, G extends NNN> { } interface NNN {} class J1 implements MMM<J1, J2> { } class J2 implements NNN { } class J3 implements RRR<J1,J2> {} public class Test1 { public static void main(String[] args) { J3 thing = null; } } ----------- (1) The first time it compiles, it compiles without error. (2) Now, comment out the MMM and NNN interfaces, and create them in another package and uncomment the import statements. It compiles without error. (3) Now recomment out the import statements, and uncomment the MMM and NNN interfaces, then an error (explained below) occurs. (4) Now do a "clean" on the project and the error goes away. The error I'm getting is: Inconsistent classfile encountered: The undefined type parameter G is referenced from within MMM<F>
Reproduced
Generated file looks ok, suspecting signature decoding to be wrong.
Generated file was: // Compiled from MMM.java (version 1.5 : 49.0, no super bit) // Signature: <F::LMMM<TF;TG;>;G::LNNN;>Ljava/lang/Object; abstract public interface MMM extends java.lang.Object { }
Decoding of parameter signatures should perform in 2 passes so as to recreate all type variables prior to initializing them (which may need to reference subsequent - yet not met - variables). Added support for both type and method variables (also noticed that binary method variables were not correctly pointing at the binary method as their declaringElement but binary type instead). Added regression test: GenericTypeTest#test430. Fixed
Verified in 200412140800.
*** Bug 76733 has been marked as a duplicate of this bug. ***