GenericsAuroraFAQ 

HOME INDEX SEARCH GO  

 <<O>>  Difference Topic GenericsAuroraFAQ (r1.6 - 10 Jun 2004 - JacquesMorel)
Added:
>
>

This is the generics guide for Aurora. For Pallada (IDEA 4.1) look at GenericsFAQ

Added:
>
>

  1. As of 2.4, you need to copy the classes of gjc-rt.jar into collect.jar
Added:
>
>

Alternatively use the wizard in IDEA for that. It can be found in the menu Tools/Set Up JSR014 Implementation. However don't forget to do step 3.

Added:
>
>

%META:TOPICMOVED{by="JacquesMorel" date="1086846238" from="Main.GenericsAuroFAQ" to="Main.GenericsAuroraFAQ"}%


 <<O>>  Difference Topic GenericsAuroraFAQ (r1.5 - 02 Feb 2004 - MarkAronszajn)
Changed:
<
<

Here is a simple How To Guide to get started with java generics. Please feel free to make any correction or addition that you think are necessary to make the transition easier.

>
>

Here is a simple How To Guide to get started with java generics. Please feel free to make any corrections or additions that you think are necessary to make the transition easier.


 <<O>>  Difference Topic GenericsAuroraFAQ (r1.4 - 29 Oct 2003 - AlexeyEfimov)
Added:
>
>

Using JSR Adapter for compiling

Added:
>
>

Using standard javac ANT task for compiling

You can compile generics code by javac ANT task:

  <javac
    fork="yes"
    includejavaruntime="yes"
    destdir="${project.classes}"
    bootclasspath="${generics.home}/collect.jar"
    classpathref="project.classpath"
    debug="on"
    source="1.5"
    >
    <compilerarg value="-J-Xbootclasspath/p:${generics.home}/gjc-rt.jar"/>
    <src path="${project.src}"/>
    <include name="**/*.java"/>
  </javac>

Using sinjdoc tool for JavaDoc generation

You must have sinjdoc installed. For generation javadocs you may use follow script:

  <fileset dir="${project.src}" id="project.src.java">
    <include name="**/*.java" />
  </fileset>
  <pathconvert pathsep=" " property="project.src.files" refid="project.src.java"/>

  <java jar="${sinjdoc.home}/sinjdoc.jar" fork="true">
    <jvmarg line="-Xbootclasspath/p:${generics.home}/gjc-rt.jar"/>
    <classpath refid="project.classpath" />
    <arg value="-protected" />
    <arg value="-author" />
    <arg value="-version" />
    <arg value="-use" />
    <arg value="-source" />
    <arg value="1.5" />
    <arg value="-d" />
    <arg value="${project.build}/${project.name}/docs/api" />
    <arg value="-sourcepath" />
    <arg value="${project.src}" />

    <arg line="${project.src.files}" />
  </java>

 <<O>>  Difference Topic GenericsAuroraFAQ (r1.3 - 17 Sep 2003 - JacquesMorel)
Changed:
<
<

http://www-106.ibm.com/developerworks/java/library/j-djc02113.html

>
>

javadoc and javap for generics


 <<O>>  Difference Topic GenericsAuroraFAQ (r1.2 - 01 Sep 2003 - JacquesMorel)
Added:
>
>

Here is a simple How To Guide to get started with java generics. Please feel free to make any correction or addition that you think are necessary to make the transition easier.

TOC: No TOC in "Main.GenericsAuroraFAQ"

Changed:
<
<

  1. Download the Early Access JSR14 prototype from here or used the cached copy from here
>
>

  1. Download the Early Access JSR14 prototype from here
Changed:
<
<

General info on java 1.5 generics support

>
>

Tips

General info on java 1.5 generics support

Changed:
<
<

%META:FILEATTACHMENT{name="adding_generics-2_2-ea.zip" attr="" comment="Early Access 2.2 Generics JSR14 compiler" date="1062389629" path="C:\Download\Java\JDK\adding_generics-2_2-ea.zip" size="1621924" user="JacquesMorel" version="1.1"}%

>
>

Known issues

OutOfMemoryError using Generics

See http://www.intellij.net/tracker/idea/viewSCR?publicId=14522 for more detail.


 <<O>>  Difference Topic GenericsAuroraFAQ (r1.1 - 01 Sep 2003 - JacquesMorel)
Added:
>
>

%META:TOPICINFO{author="JacquesMorel" date="1062392880" format="1.0" version="1.1"}% %META:TOPICPARENT{name="UnofficialAuroraFAQ"}%

Installation

  1. Download the Early Access JSR14 prototype from here or used the cached copy from here
  2. Extract it anywhere. We will call JSR14_HOME that directory
  3. Copy JSR14_HOME/collect.jar and JSR14_HOME/gjc-rt.jar to IDEA_HOME/lib/generics (you have to create the directory)

Set up an IDEA project

  1. Open the Project Properties
  2. Select the Main Module properties
  3. In the Library tab add IDEA_HOME/lib/generics/collect.jar
     
    ProjectPropertiesMainModuleLibrariesTab.jpg
     
  4. In the Order tab, put collect.jar first (before the JDK)
     
    ProjectPropertiesMainModuleOrderTab.jpg
     
  5. Select the Compiler properties
  6. Select the option Use generics-enabled compiler
     
    ProjectPropertiesCompiler.jpg
     
  7. Restart IDEA

Set up Ant

  1. Add a property named jsr14.home that points to JSR14_HOME
    <property name="jsr14.home" value="<<JSR14_HOME>>"/>
  2. Add collect.jar in first in any compilation classpath
  3. Download the compiler adapter generously donated by Cortex eBusiness (maker of clover one of the greatest java coverage tool) here or use the cached version here and save it either in your project or your ant install
  4. Add jsr14adapter-1.2.jar to your Ant classpath. In IDEA:
    1. Go to the Ant tool window/Properties
       
      AntToolWindowProperties.jpg
       
    2. Add jsr14adapter-1.2.jar to the Additional Classpath
       
      AntToolWindowPropertiesClasspath.jpg
       
  5. Change your javac target to add the following attributes
    <javac destdir="${dir.build.classes}"
             source="1.5"
             compiler="com.cortexeb.Jsr14CompilerAdapter"
             srcdir="${dir.plugin.util.src}:${dir.src}:${dir.additional.src}">
             <classpath refid="compile.classpath"/>
          </javac>
  6. Add this to your junit task
    <junit fork="yes">
    ...
    <jvmarg value="-Xbootclasspath/p:${jsr14.home}/gjc-rt.jar"/> </junit>
  7. You are set

General info on java 1.5 generics support

http://www-106.ibm.com/developerworks/java/library/j-djc02113.html

%META:FILEATTACHMENT{name="adding_generics-2_2-ea.zip" attr="" comment="Early Access 2.2 Generics JSR14 compiler" date="1062389629" path="C:\Download\Java\JDK\adding_generics-2_2-ea.zip" size="1621924" user="JacquesMorel" version="1.1"}% %META:FILEATTACHMENT{name="ProjectPropertiesMainModuleLibrariesTab.jpg" attr="h" comment="Project Properties/Main Module/Libraries tab" date="1062389743" path="C:\My Documents\My Pictures\ProjectPropertiesMainModuleLibrariesTab.jpg" size="49709" user="JacquesMorel" version="1.1"}% %META:FILEATTACHMENT{name="ProjectPropertiesMainModuleOrderTab.jpg" attr="h" comment="Project Properties/Main Module/Order tab" date="1062389787" path="C:\My Documents\My Pictures\ProjectPropertiesMainModuleOrderTab.jpg" size="50780" user="JacquesMorel" version="1.1"}% %META:FILEATTACHMENT{name="ProjectPropertiesCompiler.jpg" attr="h" comment="Project Properties/Main Module/Compiler" date="1062389886" path="C:\My Documents\My Pictures\ProjectPropertiesCompiler.jpg" size="52932" user="JacquesMorel" version="1.1"}% %META:FILEATTACHMENT{name="jsr14adapter-1.2.jar" attr="" comment="Cortex eBusiness Ant Compiler Adapter to generics " date="1062390568" path="C:\Dev\IDEAPlugins\PluginUtil\lib\jsr14adapter-1.2.jar" size="2078" user="JacquesMorel" version="1.1"}% %META:FILEATTACHMENT{name="AntToolWindowProperties.jpg" attr="h" comment="Ant Tool Window Properties button" date="1062392554" path="C:\My Documents\My Pictures\AntToolWindowProperties.jpg" size="9800" user="JacquesMorel" version="1.1"}% %META:FILEATTACHMENT{name="AntToolWindowPropertiesClasspath.jpg" attr="h" comment="Ant Tool Window Properties additional classpath" date="1062392592" path="C:\My Documents\My Pictures\AntToolWindowPropertiesClasspath.jpg" size="28364" user="JacquesMorel" version="1.1"}%


View | Diffs | r1.6 | > | r1.5 | > | r1.4 | More

e d i t a t t a c h r e f - b y d i f f s
Ideas,requests,problems regarding this site? Send feedback.
Copyright @ 2000-2003 by the contribution authors. All material on this collaboration tool is the property of the contributing authors.

Revision r1.1 - 01 Sep 2003 - 05:08 GMT - JacquesMorel
Revision r1.6 - 10 Jun 2004 - 05:49 GMT - JacquesMorel
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding this site? Send feedback.