Bug 79797 - [1.5] Inconsistent classfile - moving code around
Summary: [1.5] Inconsistent classfile - moving code around
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 76733 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-30 13:25 EST by Bart Geraci CLA
Modified: 2004-12-20 09:34 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Geraci CLA 2004-11-30 13:25:24 EST
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>
Comment 1 Philipe Mulet CLA 2004-12-01 09:13:44 EST
Reproduced
Comment 2 Philipe Mulet CLA 2004-12-01 09:21:24 EST
Generated file looks ok, suspecting signature decoding to be wrong.
Comment 3 Philipe Mulet CLA 2004-12-01 09:22:04 EST
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 {
}
Comment 4 Philipe Mulet CLA 2004-12-01 10:57:13 EST
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
Comment 5 Olivier Thomann CLA 2004-12-14 22:45:54 EST
Verified in 200412140800.
Comment 6 Philipe Mulet CLA 2004-12-20 09:34:18 EST
*** Bug 76733 has been marked as a duplicate of this bug. ***