Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies slig
I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies slig [message #261401] Thu, 17 July 2008 21:15 Go to next message
Julia Smith is currently offline Julia SmithFriend
Messages: 22
Registered: July 2009
Junior Member
If I have a generic such as:

class Mumble
{
class Mingle
{
}
}

class Foo<T extends Mumble>
{

}

and then use:

T.Mingle bings = null;

The eclipse compiler eats this fine. Javac (version 6) rejects it with
the following error:

cannot select from a type variable.


I'm not sure who exactly is at fault here, Sun, language versioning
issues with javac or if the eclipse compiler has a few holes here.
Re: I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies [message #261406 is a reply to message #261401] Thu, 17 July 2008 21:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zx.code9.com

> I'm not sure who exactly is at fault here, Sun, language versioning
> issues with javac or if the eclipse compiler has a few holes here.

Can you file a bug against JDT Core?

https://bugs.eclipse.org/bugs/enter_bug_wizard.cgi

Cheers,

~ Chris
Re: I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies [message #261414 is a reply to message #261401] Thu, 17 July 2008 22:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Julia,

I've encountered a few differences in the past as well, though in my
opinion, the Eclipse one was has always been the more sensible one.
This problem is indeed a very odd one. I'm not sure what rules
specifically apply to this case, but I agree it seems very odd to be
able to selected a nested class from type parameter.

Chris's advice to file a bugzilla is definitely good. Please post the
bugzilla number to the newsgroup.


Julia Smith wrote:
> If I have a generic such as:
>
> class Mumble
> {
> class Mingle
> {
> }
> }
>
> class Foo<T extends Mumble>
> {
>
> }
>
> and then use:
>
> T.Mingle bings = null;
>
> The eclipse compiler eats this fine. Javac (version 6) rejects it with
> the following error:
>
> cannot select from a type variable.
>
>
> I'm not sure who exactly is at fault here, Sun, language versioning
> issues with javac or if the eclipse compiler has a few holes here.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies [message #261420 is a reply to message #261414] Fri, 18 July 2008 02:10 Go to previous messageGo to next message
Julia Smith is currently offline Julia SmithFriend
Messages: 22
Registered: July 2009
Junior Member
Ed Merks wrote:
> Julia,
>
> I've encountered a few differences in the past as well, though in my
> opinion, the Eclipse one was has always been the more sensible one.
> This problem is indeed a very odd one. I'm not sure what rules
> specifically apply to this case, but I agree it seems very odd to be
> able to selected a nested class from type parameter.
> Chris's advice to file a bugzilla is definitely good. Please post the
> bugzilla number to the newsgroup.
>
>
> Julia Smith wrote:
>> If I have a generic such as:
>>
>> class Mumble
>> {
>> class Mingle
>> {
>> }
>> }
>>
>> class Foo<T extends Mumble>
>> {
>> }
>>
>> and then use:
>>
>> T.Mingle bings = null;
>>
>> The eclipse compiler eats this fine. Javac (version 6) rejects it with
>> the following error:
>>
>> cannot select from a type variable.
>>
>>
>> I'm not sure who exactly is at fault here, Sun, language versioning
>> issues with javac or if the eclipse compiler has a few holes here.
>>
>>
OK, but I have a question to ask first. Does eclipse run it's compiler
against an compliance test suite? Or Sun putting that out in the
stratosphere still? I would be surprised if the likes of Plum Hall or
what not doesn't have something to bang generics.
Re: I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies [message #261437 is a reply to message #261420] Fri, 18 July 2008 09:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: markus.milleder.generali.at

Julia Smith wrote:

> OK, but I have a question to ask first. Does eclipse run it's compiler
> against an compliance test suite? Or Sun putting that out in the
> stratosphere still? I would be surprised if the likes of Plum Hall or
> what not doesn't have something to bang generics.

The Eclipse Java Compiler passes the JCK tests. (Java Compatibility Kit ->
the tests to pass to be allowed to call something "Java" officially).

The exact handling of generics has differed between the javac and ecj
several times already for corner cases. There have been cases where ecj
was right and javac wrong (e.g. Bug 156183). Search for JDT bugs with
"generics" in the summary to get an idea (note that Eclipse 3.1 introduced
Java 5 support).
Re: I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies [message #261487 is a reply to message #261437] Fri, 18 July 2008 15:38 Go to previous messageGo to next message
Julia Smith is currently offline Julia SmithFriend
Messages: 22
Registered: July 2009
Junior Member
Markus Milleder wrote:
> Julia Smith wrote:

> The Eclipse Java Compiler passes the JCK tests. (Java Compatibility Kit
> -> the tests to pass to be allowed to call something "Java" officially).
>
Yeh, I've had experience with it, testing VM ports.

> The exact handling of generics has differed between the javac and ecj
> several times already for corner cases. There have been cases where ecj
> was right and javac wrong (e.g. Bug 156183). Search for JDT bugs with
> "generics" in the summary to get an idea (note that Eclipse 3.1
> introduced Java 5 support).

Kudos then, because I have to agree Sun's compiler seems a bit snitty.

I'll bundle up some test cases in the next day or so. Since I've also
had problems with annotation processing I have to ask if the expected
compliance annotation processing is Java6 for Europa.

I tried 3.4 but there are rendering bugs, SVN wasn't working and it
didn't seem to make any difference with AP. Too many problems for me to
swallow ATM.

The only way I can get annotations to "work" with eclipse is to export a
build.xml file, use javac after modifying my shell environment to point
to 6, then add an ant builder. Gets the job done.

Thanks for the info.
Re: I'm still not thrilled by the eclipse java compiler. It is more lax or at the very least varies [message #261493 is a reply to message #261487] Sat, 19 July 2008 06:35 Go to previous message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
"Julia Smith" <invisiblesun@mac.com> wrote in message
news:g5qddd$otu$1@build.eclipse.org...
> I'll bundle up some test cases in the next day or so. Since I've also had
> problems with annotation processing I have to ask if the expected
> compliance annotation processing is Java6 for Europa.

My understanding from the Eclipse member companies that are JCK licensees is
that Eclipse 3.4 passes the Java 6 compiler JCK, which does include
annotation processing tests. Certainly our intention is to be compatible
with javac with regard to annotation processing.

That said, the JCK tests the command-line compiler (ecj) and there are some
differences between the ecj implementation of annotation processing and the
IDE implementation; not with regard to the typesystem, but with regard to
Filer, Messager, and the other platform-related parts of the API. In
particular, there are some Filer methods that are unimplemented in the IDE
implementation, simply because we were focused on trying to be compatible at
the command line and in the typesystem APIs.

If you have specific problems or incompatibilities, please do file a bug
against JDT/APT. At this point I'm a one-person part-time volunteer "team",
and I can use all the testing help that I can get.

Thanks,
-Walter Harley
JDT APT lead
Previous Topic:add existing project via command line?
Next Topic:How to create a wizard that uses templates
Goto Forum:
  


Current Time: Fri Apr 19 20:46:14 GMT 2024

Powered by FUDForum. Page generated in 0.08987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top