You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Nathan Beyer <nb...@gmail.com> on 2006/12/01 00:43:24 UTC
Re: [build] Classlib is not buildable with the common javac. Is it correct?
What version of the JDK RI compiler are you using? I know that there
were changes between update 7 and update 8 which fixed a compiler bug
that ECJ did not have.
I'm pretty sure it was this particular bug, as I've run into the
ReferenceQueue problem with Sun's compiler before.
-Nathan
On 11/30/06, Nataly Naumova <na...@gmail.com> wrote:
> Hi all!
>
> Recently I've found out that our classlib is not buildable with the
> common javac's. I've tested with SUN and Bea ones, and the result was
> negative. The log is :
>
> -compile:
> [javac] Compiling 3075 source files to
> D:\nsnaumov\test\Harmony-classlib-src_20061129_0000\build\classes
> [javac] D:\nsnaumov\test\Harmony-classlib-src_20061129_0000\modules\awt\src\main\java\common\org\apache\harmony\awt\gl\font\FontManager.java:805:
> inconvertible types
> [javac] found : java.lang.ref.Reference<capture of ? extends
> java.awt.peer.FontPeer>
> [javac] required:
> org.apache.harmony.awt.gl.font.FontManager.HashMapReference
> [javac] while ((r = (HashMapReference)queue.poll()) != null) {
> [javac] ^
> [javac] D:\nsnaumov\test\Harmony-classlib-src_20061129_0000\modules\swing\src\main\java\common\javax\swing\text\html\StyleSheet.java:818:
> reference to removeAttributes is ambiguous, both method
> removeAttributes(javax.swing.text.AttributeSet,java.util.Enumeration<?>)
> in javax.swing.text.StyleContext and method
> removeAttributes(javax.swing.text.AttributeSet,javax.swing.text.html.StyleSheet.NameConverterEnumeration)
> in javax.swing.text.html.StyleSheet match
> [javac] return removeAttributes(old, new
> NameConverterEnumeration(old, rem));
> [javac] ^
> [javac] D:\nsnaumov\test\Harmony-classlib-src_20061129_0000\modules\swing\src\main\java\common\javax\swing\text\html\StyleSheet.java:823:
> reference to removeAttributes is ambiguous, both method
> removeAttributes(javax.swing.text.AttributeSet,java.util.Enumeration<?>)
> in javax.swing.text.StyleContext and method
> removeAttributes(javax.swing.text.AttributeSet,javax.swing.text.html.StyleSheet.NameConverterEnumeration)
> in javax.swing.text.html.StyleSheet match
> [javac] return removeAttributes(old, new
> NameConverterEnumeration(names));
> [javac] ^
> [javac] Note: * uses or overrides a deprecated API.
> [javac] Note: Recompile with -Xlint:deprecation for details.
> [javac] Note: Some input files use unchecked or unsafe operations.
> [javac] Note: Recompile with -Xlint:unchecked for details.
> [javac] 3 errors
>
> It seems that there is a bug in Eclipse compiler. If we bring the
> second situation to the simplier one there will be a small testcase
> here :
>
> A.java:
> interface A<T> {
> }
>
> B.java:
> class B {
> void remove(A<?> x) {
> }
> }
>
> C.java:
> class C extends B {
> void test() {
> remove(new D());
> }
> void remove(D x) {
> }
> private static final class D implements A {
> }
> }
>
> These sources are successfully compiled by ejc.jar, but cause the
> compile-time error with SUN or BEA javac -
>
> ####
> C.java:3: reference to remove is ambiguous, both method remove(A<?>)
> in B and method remove(C.D) in C match
> remove(new D());
> ^
> 1 error
> ###
>
> The question is: Is such situation applicable for Harmony? If no -
> should we file a bug against Eclipse compiler?
>
> Thanks.
>
> --
> Nataly Naumova,
> Intel Middleware Products Division
>
Re: [build] Classlib is not buildable with the common javac. Is it
correct?
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
Can you offer a patch that makes it work on both?
geir
Nataly Naumova wrote:
> Hi again,
>
> On 12/1/06, Nathan Beyer <nb...@gmail.com> wrote:
>> What version of the JDK RI compiler are you using?
>
> I'm using javac's from:
> SUN's one:
> 1.5.0_06
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> BEA's one:
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
> R25.0.0-75, G
> tegy singleparpar))
>
> There is the same error with SUN 1.5.0_08.
> I think it's rather ecj.jar bug than javac's one.. Such situations
> shouldn't be compiled, I'm sure that it's possible to find an exact
> place in java spec to show it.
>
> Thanks.
Re: [build] Classlib is not buildable with the common javac. Is it correct?
Posted by Nataly Naumova <na...@gmail.com>.
Hi again,
On 12/1/06, Nathan Beyer <nb...@gmail.com> wrote:
> What version of the JDK RI compiler are you using?
I'm using javac's from:
SUN's one:
1.5.0_06
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
BEA's one:
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, G
tegy singleparpar))
There is the same error with SUN 1.5.0_08.
I think it's rather ecj.jar bug than javac's one.. Such situations
shouldn't be compiled, I'm sure that it's possible to find an exact
place in java spec to show it.
Thanks.
--
Nataly Naumova,
Intel Middleware Products Division