JDK-4933768 : bug in ea2_2 compiler: java.lang.AssertionError: xClassName
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-10-07
  • Updated: 2003-10-07
  • Resolved: 2003-10-07
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 10/07/2003


FULL PRODUCT VERSION :
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)

FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
this error occurs:

java.lang.AssertionError: xClassName
    at com.sun.tools.javac.jvm.ClassWriter.xClassName(ClassWriter.java:384)
    at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:473)
    at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1002)
    at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:883)
    at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:316)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:455)
    at com.sun.tools.javac.main.Main.compile(Main.java:520)
    at com.sun.tools.javac.Main.compile(Main.java:41)
    at com.sun.tools.javac.Main.main(Main.java:32)

when trying to compile the program below:


ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.AssertionError: xClassName
    at com.sun.tools.javac.jvm.ClassWriter.xClassName(ClassWriter.java:384)
    at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:473)
    at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1002)
    at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:883)
    at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:316)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:455)
    at com.sun.tools.javac.main.Main.compile(Main.java:520)
    at com.sun.tools.javac.Main.compile(Main.java:41)
    at com.sun.tools.javac.Main.main(Main.java:32)



REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package test;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        Map<String, Integer> m1 = new HashMap<String, Integer>();
        m1.put("foo", new Integer(1));
        m1.put("bar", 1);

        println("foo=", m1.get("foo"), " bar=", m1.get("bar"));
        println("primitives in varargs: int=", 42, " boolean=", true);

        // following line will not compile
        //int i = m1.get("nak");
//Boxing and unboxing conversions are currently only implemented as
//argument conversions.  It is almost certain that this is not what the
//JSR 201 expert group will specify.  When we have more guidance from
//JSR 201, we will update the prototype.

        wildcards();
        
    }

    public static void wildcards()
    {
        List<Number> src = new ArrayList<Number>();
        src.add(new Integer(1));
        src.add(new Double(2.0));

        List<Number> dest = new ArrayList<Number>();
        
        addAll_1(src, dest);
    }

    public static <E> void addAll_1(List<E> src, List<E> dest) {
        for(E o : src) {
            dest.add(o);
        }
    }
    
        
    

    public static void println(Object... objs) {
        for (int i = 0; i < objs.length; i++) {
            System.out.print(objs[i]);
        }
        System.out.println();
    }
}

---------- END SOURCE ----------
(Incident Review ID: 214597) 
======================================================================

Comments
EVALUATION a dup.
11-06-2004