Bug 237931 - [1.6][compiler] wrong signature of String[][] in class file
Summary: [1.6][compiler] wrong signature of String[][] in class file
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 10:17 EDT by kurt CLA
Modified: 2008-08-29 04:56 EDT (History)
2 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
Proposed fix + regression tests for HEAD (2.92 KB, patch)
2008-07-08 10:02 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression tests for 3.3 maintenance (3.21 KB, patch)
2008-07-08 10:58 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kurt CLA 2008-06-20 10:17:34 EDT
Build ID: I20080609-1311

Steps To Reproduce:
1. compile class (see "more information") for java 1.6
2. check (dump) .class-file DM2.class
3. signature is "[L[Ljava/lang/String;;" - results in error at least when loaded by another classloader: java.lang.ClassFormatError: Illegal class name "[L[Ljava/lang/String;;" in class file a/lng/pkg/name/DM2

4. compile class (see "more information") for java 1.4
5. check (dump) .class-file DM2.class
6. signature is ok - no problems with other classloaders



More information:
package a.lng.pkg.name;
public class DM2 {
  static class DL {
    public void setDL(String[][] strings) {
      for (int i = 0; i < strings.length; i++) {
        System.out.println(strings[i][0] + "=" + strings[i][1]);
      }
    }
  }
  String[][] sa;
  protected DM2() {
    super();
    sa = new String[][] { {"1", "2" }, {"3", "4" } };
  }
  public DL anyDL(String dkPfx, String fldTbl, String map, String ntrSfx) {
    DL dl = new DL();
    dl.setDL(sa);
    // --- eclipse-1.6-compiler (works fine on eclipse-1.4-compiler):
    //     generated code for 1.6: "[L[Ljava/lang/String;;"
    String[][] ss =
      new String[][] { {"prefix", dkPfx != null ? dkPfx : "" },
        {"table", fldTbl != null ? fldTbl : "" },
        {"map", map != null ? map : "" },
        {"suffix", ntrSfx != null ? ntrSfx : "" } };
    dl.setDL(ss);
    // --- end
    return dl;
  }
}
Comment 1 Olivier Thomann CLA 2008-07-08 09:30:46 EDT
Reproduced.
I am working on it.
Philippe, this might be a candidate for 3.4.1.
Comment 2 Philipe Mulet CLA 2008-07-08 09:58:16 EDT
+1 for 3.4.1 (even earlier if needed)
Comment 3 Olivier Thomann CLA 2008-07-08 10:02:32 EDT
Created attachment 106822 [details]
Proposed fix + regression tests for HEAD
Comment 4 Olivier Thomann CLA 2008-07-08 10:03:24 EDT
Same patch can also be applied in 3.4 maintenance.
Comment 5 Olivier Thomann CLA 2008-07-08 10:04:28 EDT
Thanks for the test case.
Released for 3.5M1.

Will release shortly for 3.4.1.
Comment 6 Olivier Thomann CLA 2008-07-08 10:08:45 EDT
Released for 3.4.1.
Comment 7 Olivier Thomann CLA 2008-07-08 10:58:05 EDT
Created attachment 106828 [details]
Proposed fix + regression tests for 3.3 maintenance

Patch to apply on 3.3 maintenance stream.
Comment 8 Olivier Thomann CLA 2008-07-08 10:58:24 EDT
Backported to 3.3 maintenance.
Comment 9 Kent Johnson CLA 2008-08-06 12:36:34 EDT
Verified for 3.5M1 using I20080805-1307
Comment 10 Frederic Fusier CLA 2008-08-29 04:56:58 EDT
Verified for 3.4.1 using M20080827-2000.