Generics setup?

I am a little confused about what to do to make generics
working:
Your instructions say to put gjc-rt.jar and collect.jar to lib/generics, however the start scripts uses lib/generics/2.0/ (in idea.bat) on the boot class path.
I have put the jars in both directories :)
When I check the generics box in the compiler settings generic code compiles fine.
However I have not managed to get rid of the errors displayed in the editor whenever I use generic collections, such as List]]>.
I have tried to put add generic sources also and moved them in front of the JDK on the Order tab, but still no luck.

7 comments
Comment actions Permalink

Stephen Kelvin wrote:

I am a little confused about what to do to make generics
working:
Your instructions say to put gjc-rt.jar and collect.jar to lib/generics,
however the start scripts uses lib/generics/2.0/ (in idea.bat) on the boot
class path. I have put the jars in both directories :) When I check the
generics box in the compiler settings generic code compiles fine. However
I have not managed to get rid of the errors displayed in the editor
whenever I use generic collections, such as List<Integer>. I have tried to
put add generic sources also and moved them in front of the JDK on the
Order tab, but still no luck.


You should add collect.jar as a library and move it before JDK in Order tab

Friendly,
Dmitry

--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Not sure if this is a problem, maybe I've just set up things wrong.

IDEA is now marking previously valida code bad if I enable the generics compiler. As the generics compiler is supoosed to be fully backwards compatible, this shouldn't happen. The attached file shows the error.

Now, the disclaimer: I've downloaded the idea823.zip file, unpacked it and copied the jre from the previous EAP. Also, I've copied the idea.exe and idea.lax files from the previous EAP, since I don't feel like running batch files. I edited the idea.lax file to include the same options as the idea.bat (and a few more), namely:

lax.nl.java.option.additional=-Xbootclasspath/p:..
lib
generics
gjc-rt.jar -Xms32m -Xmx92m -XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRation=20 -Dsun.java2d.noddraw=true -Didea.system.path="~
.IntelliJIdea
system" -Didea.config.path="~
.IntelliJIdea
config" -Didea.popup.weight=heavy

I've also added the collect.jar as a library in my project, and pushed it before the JDK in the Order tab. Have I done anything wrong or should I post a tracker request?

0
Comment actions Permalink

Ops, forgot to attach the file.



Attachment(s):
idea-generics-error.gif
0
Comment actions Permalink

I don't think it's a good idea to post a tracker request as a result of a bug in an unsupported environment. My .02.

0
Comment actions Permalink

Same problem here and adding collect.jar as a library before JDK did not
help as well. The sources compile fine but are marked as error in IDEA.

Michael

Dmitry Lomov wrote:

Stephen Kelvin wrote:

>>I am a little confused about what to do to make generics
>>working:
>>Your instructions say to put gjc-rt.jar and collect.jar to lib/generics,
>>however the start scripts uses lib/generics/2.0/ (in idea.bat) on the boot
>>class path. I have put the jars in both directories :) When I check the
>>generics box in the compiler settings generic code compiles fine. However
>>I have not managed to get rid of the errors displayed in the editor
>>whenever I use generic collections, such as List. I have tried to >>put add generic sources also and moved them in front of the JDK on the >>]]>Order tab, but still no luck.


You should add collect.jar as a library and move it before JDK in Order tab

Friendly,
Dmitry


0
Comment actions Permalink

Actually adding collect.jar before the JDK did help for me - only I had to restart IDEA before the error went away.

Now

 list;]]>

is fine, however both

and

are green, though the latter won't compile off course.

I assume this is because the parser recognizes the generics syntax but IDEA's repository does not hold information about template arguments yet?

Generally shoud I already file bugs concerning generics?

0
Comment actions Permalink

Stephen Kelvin wrote:

Actually adding collect.jar before the JDK did help for me - only I had to
restart IDEA before the error went away.

Now

 list;]]>

is fine, however both


and


are green, though the latter won't compile off course.

I assume this is because the parser recognizes the generics syntax but
IDEA's repository does not hold information about template arguments yet?


Well, sort of ;). It holds info, but there are some problems in resolve etc.


Generally shoud I already file bugs concerning generics?


Yes, please do, even at this early stage. We would really like to assemble a
list of things not working - we have one ourselves, but we have probably
overlooked something...

But please check for duplicates. I suggest that we adopt a convention that
any bug concerning generics should have a "Generics:" in title.

Friendly,
Dmitry

--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.