Generic types

 

Configuring generics support

CodeGuide supports generic types as defined in Java Specification Request (JSR) 14 as well as new language features as defined in JSR 201. More information about JSR 14 and JSR 201 can be obtained at the Java Community Process website. Please check the Where to get help chapter in the First Steps section for details.

 

To enable support for Generic types in CodeGuide you have to select the Java 1.5 sources option in the Source code | Analysis section of the Preferences Dialog.

 

 

If you want to use the generic collection API you have to download the prototype implementation of javac for generic types. The prototype implementation can be downloaded from http://developer.java.sun.com/developer/earlyAccess/adding_generics/. After downloading and unpacking you have to adjust the Path to this package in the Integration section of the Preferences Dialog.

 

 

Now you can start using Generic types in you application.

 

 

Automatically migrating sources to generics

 

CodeGuide may automatically convert your project to make use of generic types. Select Refactor | Generify project.

 

 

CodeGuide will analyze the whole project and search for occurrences of yet not parameterized generic types, e.g. all usages of collections (like List, Set, etc). will be annotated with appropriate types (like List<String>, Set<Integer>, etc.). This will provide you with a good starting point to make use of generics.