Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 12:53:11 am
Xith3D CommunityXith3D InternalsDeveloper discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)Usages of SomeClass<?> and SomeClass extends BaseClass<SomeClass> problems
Pages: [1]
Print
Author Topic: Usages of SomeClass<?> and SomeClass extends BaseClass<SomeClass> problems  (Read 1925 times)
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« on: 11. September 2007, 11:24:22 am »

There were some changes lately regarding the usage of generics that leads to an uncompilable state using an official sun JDK.

Due to an compiler bug there are several incompatible type errors. I didn't even know that mixins (SomeClass extends BaseClass<SomeClass>) like they lately introduced in the GLSLShader code are allowed at all.

There is a workaround to first cast an incomplete type to Object and then to the desired type, but since some API calls return SomeClass<?> (see shader loader), this would require the user to be aware of the problem and use workaround it themselves, which is IMO undesirable.

I would rather change back to returning a simple base interface instead of an incomplete type (SomeClass<?>).

Any thoughts?
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 11. September 2007, 06:08:22 pm »

I didn't know, that actually makes a difference. I recently installed Eclipse Europa and it had some more strict default warning levels, which I considered to be good. So I fixed, what was marked. Missing <?> was one of these warnings. Well this worning might not be as worthy as the other ones, since it's much more readable without the question mark. At least it compiles fine this way on my system. Is this maybe a Java 5/6 difference? You're using Java 5 aren't you? I will see, what I can change to make it compilable on your system again.

Marvin

btw. If you want to install Eclipse Europa and have a 64 bit Machine/OS/JDK, you might not find the right eclipse download directly. The one on the main download page is wrong. It's for 32 bit only. You'll have to click on download->by project->Eclipse project. Really strange, that they added no link to that list of other releases. And that they used the 32 bit version as the default download while you cannot even buy a 32 bit machine anymore Huh
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #2 on: 11. September 2007, 06:53:26 pm »

no, it's a bug in the current JDK 1.6 javac and also did not compile with an older 1.5 release. I will try the latest 1.5 tomorrow, since the bug report states, this is a regression from 1.5b11.

... And I (and probably many other potential xith-users) won't install eclipse Wink
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 11. September 2007, 07:38:38 pm »

no, it's a bug in the current JDK 1.6 javac and also did not compile with an older 1.5 release. I will try the latest 1.5 tomorrow, since the bug report states, this is a regression from 1.5b11.

I'm using Java 1.6 (build 1.6.0-b105) and it compiles just fine.

... And I (and probably many other potential xith-users) won't install eclipse Wink

Well, not many, but some or a few Wink

Marvin
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #4 on: 11. September 2007, 07:42:31 pm »

I'm using Java 1.6 (build 1.6.0-b105) and it compiles just fine.
Sure? Doesn't eclipse come with an own compiler? I tried the offically latest sun jdk 1.6.0_02 and it does not compile... and the bug is marked as "in progress" - is the b105 a preview release?
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 11. September 2007, 07:45:23 pm »

Sure? Doesn't eclipse come with an own compiler?

AFAIK the builtin compile is only used to parse the code for IDE features. But the actual compiling is done by the "included" compiler.

I tried the offically latest sun jdk 1.6.0_02 and it does not compile... and the bug is marked as "in progress" - is the b105 a preview release?

I don't know.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 11. September 2007, 07:50:57 pm »

I have installed 1.6U2 now and it also compiles just fine.

Marvin

EDIT: And I tried jdk 1.5 U10. Also no compile errors.
« Last Edit: 11. September 2007, 07:52:42 pm by Marvin Fröhlich » Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #7 on: 12. September 2007, 03:43:12 pm »

cylab's right, Eclipse has its own compiler (ecj), so Marvin you'll have to try compiling by hand (e.g. with ant) to test the bugs..
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #8 on: 12. September 2007, 03:49:35 pm »

We already discussed this yesterday via icq and marvin added the double cast workaround where needed. It compiles fine using JDK 1.6U2 now. I hope sun will resolve this issue soon.
Logged

'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #9 on: 12. September 2007, 03:58:33 pm »

Ok then.
I hope so, too, it looks like a very nasty bug...
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic