Bug 80083

Summary: VerifyError on String-Operator += when using generics
Product: [Eclipse Project] JDT Reporter: Ingo R. Homann <ingo.homann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ingo R. Homann CLA 2004-12-03 04:12:36 EST
The Bug occurs in the following code:

import java.util.ArrayList;

public class Bug
{

  public static void main(String[] args)
  {
    ArrayList<String> l = new ArrayList<String>();
    l.add("x");
    String s = "";
    s += l.get(0); // X
  }

}

It compiles correctly, but will not by loaded in the RuntimeEnvironment 
(VerifyError).

Replacing line "X" with "s=s+l.get(0);" will solve it.

The bug is sometimes hard to find, because the compiler does not show it, and 
it is legal code (I think).
Comment 1 Philipe Mulet CLA 2004-12-09 18:11:14 EST
Implicit conversion were computed independantly from #computeConversion which
also   ensures generic casts are inserted.
Added regression test: GenericTypeTest#test434.
Fixed
Comment 2 Olivier Thomann CLA 2004-12-14 22:56:46 EST
Verified in 200412140800