[Jastadd] [bug report] absence of AbstractWildcardType.createQualifiedAccess()

From: Na, Hyunik <hina_at_kaist.ac.kr>
Date: Wed, 25 Apr 2012 14:23:34 +0900

Hello JastAddJ developers,

 

Compiling java/util/HashMap.java in OpenJDK 1.6 with JastAddJ (rev. 9238)
produces the following entry in the constant pool.

 

           const #358 = Asciz
(Ljava/util/Map<L_at_primitive/Unknown;L_at_primitive/Unknown;>;)V;

 

And the illegal string "_at_primitive/Unknown" in the HashMap.class make it
impossible to compile other 1138 java files in the library

which load HashMap.class during their compilation.

 

_at_primitive/Unknown appears also for three other java files:

           . sun/management/MappedMXBeanType.java,

           . sun/swing/SwingUtilities2.java,

           . sun/util/LocaleServiceProviderPool.java

, and it also prohibits compilation of 725 other java files which loads
three corresponding .class files during their compilation.

 

I spent some time to find the cause of this problem, and got the impression
that absence of AbstractWildcardType.createQualifiedAccess() is probably the
cause.

That is, AbstractWildcardType should override TypeDecl's
createQualifiedAccess().

 

Because it does not in current JastAddJ, invocation of
createQualifiedAccess() on a WildcardExtendsType object (for example) is
dispatched to TypeDecl's createQualifiedAccess(),

and produces a TypeAccess object whose package is "wildcards", and id is "?
extends .".

And, querying type() on this TypeAccess object seems to produce Unknown
type.

 

So, I added the following line into Java1.5Frontend

 

           public Access AbstractWildcardType.createQualifiedAccess() {
return createBoundAccess(); }

 

and it seems that the _at_primitive/Unknown disappears from the class files
with this addition.

 

This problem of "_at_primitive/Unknown" in the signatures happens very rarely
(in only four out of 7638 java files in the OpenJDK 1.6 libaray).

It seems to happen during some "transformation" which I don't understand.

( In case of HashMap, it happens in a synthesized method whose parameter
type is Map<? extends K, ? extends V> where K and V is the type variables of
HashMap. )

 

Is that addition appropriate? Does it cause any other problems in the
compiler?

 

- Hyunik
Received on Wed Apr 25 2012 - 07:23:49 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 16 2014 - 17:19:06 CEST