summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2012-09-26 15:16:16 +0100
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2012-09-26 15:16:16 +0100
commitcd3ebd72a7d59734fcf99e8ed85331b74445df1f (patch)
tree476a173edde6aa73e24e3435fbd81a36e53b5a19
parent4d4db712cf4df4feb4d7b98bb1b5b448218500b3 (diff)
downloadclasspath-cd3ebd72a7d59734fcf99e8ed85331b74445df1f.tar.gz
Warning cleanup in tools (gjdoc & rmic).
2012-09-24 Andrew John Hughes <gnu_andrew@member.fsf.org> * tools/com/sun/javadoc/Doc.java: Add type parameter to Comparable. * tools/gnu/classpath/tools/doclets/AbstractDoclet.java: (tagletMap): Use type parameters. (packageGroups): Likewise. (tagletPath): Removed, unused. (mentionedTags): Use type parameters. (optionNoEmailWarn): Removed, unused. (optionTagletPath): Likewise. (DocletOptionTaglet): Likewise. (DocletOptionGroup.set(String[])): Add type aprameters to groupPackages. (DocletOptionTagletPath): Removed, unused. (commonOptions): Remove optionTagletPath. (nameToOptionMap): Add type parameters. (getOptionLength(String)): Remove unnecessary cast. (getKnownDirectSubclasses(ClassDoc)): Add type parameters. (IndexKey): Add type parameter to Comparable. (IndexKey.compareTo(IndexKey)): Update to use specific type. (categorizedIndex): Use type parameters. (getCategorizedIndex()): Likewise. (indexByName): Likewise. (getIndexByName()): Likewise. (printTaglets(Tag[],TagletContext,TagletPrinter,boolean)): Likewise. (addUsedBy(Map,ClassDoc,UsageType,Doc,PackageDoc)): Likewise. (collectUsage()): Likewise. (usedClassToPackagesMap): Likewise. (getUsageOfClass(ClassDoc)): Likewise. (UsageType): Add type parameter to Comparable. (UsageType.compareTo(UsageType)): Update to use specific type. (getPackageGroups()): Use type parameters. * tools/gnu/classpath/tools/doclets/PackageMatcher.java: (patterns): Use type parameters. (filter(Packagedoc[])): Likewise. (match(PackageDoc)): Likewise. * tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java: (externalDocSets): Use type parameters. (packageNameToDocSet)): Likewise. (printPackagePage(File,String,PackageDoc,PackageDoc,PackageDoc)): Likewise. (TreeNode): Add type parameter to Comparable. (TreeNode.children): Use type parameters. (TreeNode.compareTo(TreeNode)): Update to use specific type. (addClassTreeNode(Map,ClassDoc)): Use type parameters. (addInterfacetreeNode(Map,ClassDoc)): Likewise. (printClassTree(HtmlPage,ClassDoc[])): Likewise. (printInterfaceTree(HtmlPage,ClassDoc[])): Likewise. (printFullTreePage()): Likewise. (printIndexEntry(HtmlPage,Doc)): Likewise. (printPackagesMenuPage()): Likewise. (printClassMenuSection(HtmlPage,Collection,String)): Likewise. (printClassMenuList(HtmlPage,ClassDoc[],boolean)): Likewise. (printSplitIndex()): Likewise. (printIndexPage(int,int,Character,List)): Likewise. (printSerializationPage()): Likewise. (printDeprecationPage()): Likewise. (getMemberDocURL(HtmlPage,ProgramElementDoc)): Likewise. (createTypeHref(HtmlPage,Type,boolean)): Likewise. (getPackageURL(PackageDoc)): Remove redundant cast. (getClassURL(ClassDoc)): Likewise. * tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java: (primitiveNames): Add type parameters. (findClassCache): Likewise. (findClass(String,String): Likewise. (createInstance(ClassDoc,PackageDoc,ClassDoc[],PackageDoc[], char[],int,int,List)): Likewise. (resolve()): Likewise. (typeMap): Likewise. (typeForString(String)): Likewise.. (equals(Object)): Likewise. (maybeSerMethodList): Likewise. (setMaybeSerMethodList(List)): Likewise. (findFieldValue(String,ClassDoc,String,Set)): Likewise. (getValue(String,Set)): Likewise. (compareTo(Doc)): Use specific type. (importStatementList): Use type parameters. (setImportStatementList(List)): Likewise. * tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java: (compareTo(Doc)): Use specific type. * tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java: Expand imports. (findClass(String)): Don't use full class name for String. (compareTo(Doc)): Use specific type. * tools/gnu/classpath/tools/gjdoc/DocImpl.java: (compareTo(Doc)): Use specific type. * tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java: (compareTo(Doc)): Use specific type. * tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java: (createFromSource(ClassDoc,PackageDoc,char[],int,int)): Use type parameters. Remove unused lastFieldDefStart variable. (constantValue(Set)): Use type parameters. * tools/gnu/classpath/tools/gjdoc/Main.java: (option_overview): Removed unused field. (option_classpath): Likewise. (option_sourcepath): Add type parameters. (option_extdirs): Removed unused field. (option_verbose): Likewise. (option_java_flags): Likewise. (option_subpackages): Add type parameters. (option_exclude): Likewise. (startDoclet(List)): Likewise. (addFoundPackages(String,Set)): Likewise. (findPackages(String,File,Set)): Likewise. (start(String[])): Likewise. (addJavaLangClasses()): Commented out, apparently unused. (options): Add type parameters. (initOptions()): Likewise. Remove redundant variable setting. * tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java: (compareTo(Doc)): Use specific type. * tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java: (allClassesSet): Use type parameters. (ordinaryClassesList): Likewise. (exceptionsList): Likewise. (interfacesList): Likewise. (errorsList): Likewise. (resolve()): Likewise. (toClassDocArray(Collection)): Likewise. (compareTo(Doc)): Use specific type. * tools/gnu/classpath/tools/gjdoc/Parser.java: Expand import statements. (process(Parser,char[],int,int)): Add type parameters. (processedFiles): Add type parameters. (processSourceFile(File,boolean,String,String)): Add type parameters. (classOpened(char[],int,int)): Likewise. (toArray(List,T[])): Likewise. (classClosed()): Likewise. (Context.fieldList): Likewise. (Context.filteredFieldList): Likewise. (Context.sfieldList): Likewise. (Context.methodList): Likewise. (Context.filteredMethodList): Likewise. (Context.maybeSerMethodList): Likewise. (Context.constructorList): Likewise. (Context.filteredConstructorList): Likewise. (Context.innerClassesList): Likewise. (Context.filteredInnerClassesList): Likewise. * tools/gnu/classpath/tools/gjdoc/RootDocImpl.java: (findSourceFiles(String)): Add type parameters. * tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java: (evaluate(String,Set,EvaluatorEnvironment)): Add type parameters. * tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java: (getValue(String,Set)): Add type parameters. * tools/gnu/classpath/tools/gjdoc/expr/Type.java: (clazz): Add type parameters. (Type(Class)): Likewise. * tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java: (keep): Remove unused field. (errors): Add type parameter. (compile): Remove unused field. (classpath): Likewise. (clazz): Add type parameter. (mRemoteInterfaces): Likewise. (run(String[])): Add type parameters. (processClass(String)): Likewise. (getException()): Remove unnecessary cast. (typeArray(Class[])): Add type parameter. (param(Method,int)): Add type parameter. Use Integer.valueOf. (generateClassConstant(MethodVisitor,Class)): Add type parameters. (generateClassArray(MethodVisitor,Class)): Likewise. (generateStub()): Remove unused variables stubclassname, size & endReturnTryCatch. Remove unnecessary casts and add type parameters. (generateSkel()): Remove unused variable skelclassname. Use Long.valueOf. (generateMethodSkel(MethodVisitor,Method,Variables)): Add type parameters. (typeArg(Class)): Add type parameter. (readMethod(Class)): Likewise. (writeMethod(Class)): Likewise. (returnOpcode(Class)): Likewise. (loadOpcode(Class)): Likewise. (storeOpcode(Class)): Likewise. (unboxMethod(Class)): Likewise. (box(Class)): Likewise. (size(Class)): Likewise. (sortExceptions(Class[])): Add type parameters. (setup(boolean,boolean,boolean,boolean,boolean,boolean, boolean,boolean,boolean,boolean,String,String,String,String)): Remove unused variables keep & classpath. (findRemoteMethods()): Add type parameters. (MethodRef.exceptions): Add type parameter. (MethodRef.removeSubclasses(Class[])): Add type parameters. (MethodRef.intersectExceptions(Method)): Likewise. * tools/gnu/classpath/tools/rmic/Main.java: (backends): Add type parameter. (run(String[])): Remove redundant cast. * tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java: (getArgumentList()): Add type parameters. (getArgumentNames()): Likewise. (getThrows()): Likewise. (getStaticMethodDeclarations()): Likewise. * tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java: Add type parameter to Comparable. (implementedRemotes): Add type parameter. (extraImports): Likewise. (methods): Likewise. (interfaces): Likewise. (compile(Class)): Add type parameters. (getId(Class)): Add type parameter. (getIdList(Collection)): Add type parameters. (generateStub()): Add type parameters. (generateTie()): Likewise. (compare(AbstractMethodGenerator,AbstractMethodGenerator)): Use more specific types. (getImportStatements()): Add type parameters. * tools/gnu/classpath/tools/rmic/Variables.java: (free): Add type parameter. (names): Add type parameters. (wides): Add type parameter. (declared): Likewise. (allocateNow(Object,int)): Use Integer.valueOf. (allocate(Object,int)): Add type parameters. (deallocate(Object)): Remove redundant cast. Use Integer.valueOf. (get(Object)): Remove redundant cast. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
-rw-r--r--ChangeLog220
-rw-r--r--tools/com/sun/javadoc/Doc.java4
-rw-r--r--tools/gnu/classpath/tools/doclets/AbstractDoclet.java205
-rw-r--r--tools/gnu/classpath/tools/doclets/PackageMatcher.java12
-rw-r--r--tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java122
-rw-r--r--tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java52
-rw-r--r--tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java11
-rw-r--r--tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java25
-rw-r--r--tools/gnu/classpath/tools/gjdoc/DocImpl.java6
-rw-r--r--tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java12
-rw-r--r--tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java13
-rw-r--r--tools/gnu/classpath/tools/gjdoc/Main.java122
-rw-r--r--tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java12
-rw-r--r--tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java26
-rw-r--r--tools/gnu/classpath/tools/gjdoc/Parser.java148
-rw-r--r--tools/gnu/classpath/tools/gjdoc/RootDocImpl.java10
-rw-r--r--tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java6
-rw-r--r--tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java6
-rw-r--r--tools/gnu/classpath/tools/gjdoc/expr/Type.java6
-rw-r--r--tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java126
-rw-r--r--tools/gnu/classpath/tools/rmic/Main.java6
-rw-r--r--tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java8
-rw-r--r--tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java58
-rw-r--r--tools/gnu/classpath/tools/rmic/Variables.java27
24 files changed, 663 insertions, 580 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a91ed313..305bbdb34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,223 @@
+2012-09-24 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * tools/com/sun/javadoc/Doc.java:
+ Add type parameter to Comparable.
+ * tools/gnu/classpath/tools/doclets/AbstractDoclet.java:
+ (tagletMap): Use type parameters.
+ (packageGroups): Likewise.
+ (tagletPath): Removed, unused.
+ (mentionedTags): Use type parameters.
+ (optionNoEmailWarn): Removed, unused.
+ (optionTagletPath): Likewise.
+ (DocletOptionTaglet): Likewise.
+ (DocletOptionGroup.set(String[])): Add type aprameters to
+ groupPackages.
+ (DocletOptionTagletPath): Removed, unused.
+ (commonOptions): Remove optionTagletPath.
+ (nameToOptionMap): Add type parameters.
+ (getOptionLength(String)): Remove unnecessary cast.
+ (getKnownDirectSubclasses(ClassDoc)): Add type parameters.
+ (IndexKey): Add type parameter to Comparable.
+ (IndexKey.compareTo(IndexKey)): Update to use specific type.
+ (categorizedIndex): Use type parameters.
+ (getCategorizedIndex()): Likewise.
+ (indexByName): Likewise.
+ (getIndexByName()): Likewise.
+ (printTaglets(Tag[],TagletContext,TagletPrinter,boolean)): Likewise.
+ (addUsedBy(Map,ClassDoc,UsageType,Doc,PackageDoc)): Likewise.
+ (collectUsage()): Likewise.
+ (usedClassToPackagesMap): Likewise.
+ (getUsageOfClass(ClassDoc)): Likewise.
+ (UsageType): Add type parameter to Comparable.
+ (UsageType.compareTo(UsageType)): Update to use specific type.
+ (getPackageGroups()): Use type parameters.
+ * tools/gnu/classpath/tools/doclets/PackageMatcher.java:
+ (patterns): Use type parameters.
+ (filter(Packagedoc[])): Likewise.
+ (match(PackageDoc)): Likewise.
+ * tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java:
+ (externalDocSets): Use type parameters.
+ (packageNameToDocSet)): Likewise.
+ (printPackagePage(File,String,PackageDoc,PackageDoc,PackageDoc)): Likewise.
+ (TreeNode): Add type parameter to Comparable.
+ (TreeNode.children): Use type parameters.
+ (TreeNode.compareTo(TreeNode)): Update to use specific type.
+ (addClassTreeNode(Map,ClassDoc)): Use type parameters.
+ (addInterfacetreeNode(Map,ClassDoc)): Likewise.
+ (printClassTree(HtmlPage,ClassDoc[])): Likewise.
+ (printInterfaceTree(HtmlPage,ClassDoc[])): Likewise.
+ (printFullTreePage()): Likewise.
+ (printIndexEntry(HtmlPage,Doc)): Likewise.
+ (printPackagesMenuPage()): Likewise.
+ (printClassMenuSection(HtmlPage,Collection,String)): Likewise.
+ (printClassMenuList(HtmlPage,ClassDoc[],boolean)): Likewise.
+ (printSplitIndex()): Likewise.
+ (printIndexPage(int,int,Character,List)): Likewise.
+ (printSerializationPage()): Likewise.
+ (printDeprecationPage()): Likewise.
+ (getMemberDocURL(HtmlPage,ProgramElementDoc)): Likewise.
+ (createTypeHref(HtmlPage,Type,boolean)): Likewise.
+ (getPackageURL(PackageDoc)): Remove redundant cast.
+ (getClassURL(ClassDoc)): Likewise.
+ * tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java:
+ (primitiveNames): Add type parameters.
+ (findClassCache): Likewise.
+ (findClass(String,String): Likewise.
+ (createInstance(ClassDoc,PackageDoc,ClassDoc[],PackageDoc[],
+ char[],int,int,List)): Likewise.
+ (resolve()): Likewise.
+ (typeMap): Likewise.
+ (typeForString(String)): Likewise..
+ (equals(Object)): Likewise.
+ (maybeSerMethodList): Likewise.
+ (setMaybeSerMethodList(List)): Likewise.
+ (findFieldValue(String,ClassDoc,String,Set)): Likewise.
+ (getValue(String,Set)): Likewise.
+ (compareTo(Doc)): Use specific type.
+ (importStatementList): Use type parameters.
+ (setImportStatementList(List)): Likewise.
+ * tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java:
+ (compareTo(Doc)): Use specific type.
+ * tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java:
+ Expand imports.
+ (findClass(String)): Don't use full class name for String.
+ (compareTo(Doc)): Use specific type.
+ * tools/gnu/classpath/tools/gjdoc/DocImpl.java:
+ (compareTo(Doc)): Use specific type.
+ * tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java:
+ (compareTo(Doc)): Use specific type.
+ * tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java:
+ (createFromSource(ClassDoc,PackageDoc,char[],int,int)):
+ Use type parameters. Remove unused lastFieldDefStart
+ variable.
+ (constantValue(Set)): Use type parameters.
+ * tools/gnu/classpath/tools/gjdoc/Main.java:
+ (option_overview): Removed unused field.
+ (option_classpath): Likewise.
+ (option_sourcepath): Add type parameters.
+ (option_extdirs): Removed unused field.
+ (option_verbose): Likewise.
+ (option_java_flags): Likewise.
+ (option_subpackages): Add type parameters.
+ (option_exclude): Likewise.
+ (startDoclet(List)): Likewise.
+ (addFoundPackages(String,Set)): Likewise.
+ (findPackages(String,File,Set)): Likewise.
+ (start(String[])): Likewise.
+ (addJavaLangClasses()): Commented out, apparently unused.
+ (options): Add type parameters.
+ (initOptions()): Likewise. Remove redundant variable
+ setting.
+ * tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java:
+ (compareTo(Doc)): Use specific type.
+ * tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java:
+ (allClassesSet): Use type parameters.
+ (ordinaryClassesList): Likewise.
+ (exceptionsList): Likewise.
+ (interfacesList): Likewise.
+ (errorsList): Likewise.
+ (resolve()): Likewise.
+ (toClassDocArray(Collection)): Likewise.
+ (compareTo(Doc)): Use specific type.
+ * tools/gnu/classpath/tools/gjdoc/Parser.java:
+ Expand import statements.
+ (process(Parser,char[],int,int)): Add type parameters.
+ (processedFiles): Add type parameters.
+ (processSourceFile(File,boolean,String,String)): Add type
+ parameters.
+ (classOpened(char[],int,int)): Likewise.
+ (toArray(List,T[])): Likewise.
+ (classClosed()): Likewise.
+ (Context.fieldList): Likewise.
+ (Context.filteredFieldList): Likewise.
+ (Context.sfieldList): Likewise.
+ (Context.methodList): Likewise.
+ (Context.filteredMethodList): Likewise.
+ (Context.maybeSerMethodList): Likewise.
+ (Context.constructorList): Likewise.
+ (Context.filteredConstructorList): Likewise.
+ (Context.innerClassesList): Likewise.
+ (Context.filteredInnerClassesList): Likewise.
+ * tools/gnu/classpath/tools/gjdoc/RootDocImpl.java:
+ (findSourceFiles(String)): Add type parameters.
+ * tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java:
+ (evaluate(String,Set,EvaluatorEnvironment)): Add type parameters.
+ * tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java:
+ (getValue(String,Set)): Add type parameters.
+ * tools/gnu/classpath/tools/gjdoc/expr/Type.java:
+ (clazz): Add type parameters.
+ (Type(Class)): Likewise.
+ * tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java:
+ (keep): Remove unused field.
+ (errors): Add type parameter.
+ (compile): Remove unused field.
+ (classpath): Likewise.
+ (clazz): Add type parameter.
+ (mRemoteInterfaces): Likewise.
+ (run(String[])): Add type parameters.
+ (processClass(String)): Likewise.
+ (getException()): Remove unnecessary cast.
+ (typeArray(Class[])): Add type parameter.
+ (param(Method,int)): Add type parameter. Use Integer.valueOf.
+ (generateClassConstant(MethodVisitor,Class)): Add type parameters.
+ (generateClassArray(MethodVisitor,Class)): Likewise.
+ (generateStub()): Remove unused variables stubclassname, size
+ & endReturnTryCatch. Remove unnecessary casts and add type
+ parameters.
+ (generateSkel()): Remove unused variable skelclassname.
+ Use Long.valueOf.
+ (generateMethodSkel(MethodVisitor,Method,Variables)):
+ Add type parameters.
+ (typeArg(Class)): Add type parameter.
+ (readMethod(Class)): Likewise.
+ (writeMethod(Class)): Likewise.
+ (returnOpcode(Class)): Likewise.
+ (loadOpcode(Class)): Likewise.
+ (storeOpcode(Class)): Likewise.
+ (unboxMethod(Class)): Likewise.
+ (box(Class)): Likewise.
+ (size(Class)): Likewise.
+ (sortExceptions(Class[])): Add type parameters.
+ (setup(boolean,boolean,boolean,boolean,boolean,boolean,
+ boolean,boolean,boolean,boolean,String,String,String,String)):
+ Remove unused variables keep & classpath.
+ (findRemoteMethods()): Add type parameters.
+ (MethodRef.exceptions): Add type parameter.
+ (MethodRef.removeSubclasses(Class[])): Add type parameters.
+ (MethodRef.intersectExceptions(Method)): Likewise.
+ * tools/gnu/classpath/tools/rmic/Main.java:
+ (backends): Add type parameter.
+ (run(String[])): Remove redundant cast.
+ * tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java:
+ (getArgumentList()): Add type parameters.
+ (getArgumentNames()): Likewise.
+ (getThrows()): Likewise.
+ (getStaticMethodDeclarations()): Likewise.
+ * tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java:
+ Add type parameter to Comparable.
+ (implementedRemotes): Add type parameter.
+ (extraImports): Likewise.
+ (methods): Likewise.
+ (interfaces): Likewise.
+ (compile(Class)): Add type parameters.
+ (getId(Class)): Add type parameter.
+ (getIdList(Collection)): Add type parameters.
+ (generateStub()): Add type parameters.
+ (generateTie()): Likewise.
+ (compare(AbstractMethodGenerator,AbstractMethodGenerator)): Use
+ more specific types.
+ (getImportStatements()): Add type parameters.
+ * tools/gnu/classpath/tools/rmic/Variables.java:
+ (free): Add type parameter.
+ (names): Add type parameters.
+ (wides): Add type parameter.
+ (declared): Likewise.
+ (allocateNow(Object,int)): Use Integer.valueOf.
+ (allocate(Object,int)): Add type parameters.
+ (deallocate(Object)): Remove redundant cast.
+ Use Integer.valueOf.
+ (get(Object)): Remove redundant cast.
+
2012-08-09 Dodji Seketeli <dodji@redhat.com>
Use accessor functions to manipulate xmlOutputBuffer
diff --git a/tools/com/sun/javadoc/Doc.java b/tools/com/sun/javadoc/Doc.java
index 554720d69..f1d82d94d 100644
--- a/tools/com/sun/javadoc/Doc.java
+++ b/tools/com/sun/javadoc/Doc.java
@@ -1,5 +1,5 @@
/* Doc.java -- Model of an item to document.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package com.sun.javadoc;
* This interface is the super-interface of all items that can have
* Javadoc comments associated with them.
*/
-public interface Doc extends java.io.Serializable, Comparable
+public interface Doc extends java.io.Serializable, Comparable<Doc>
{
/**
diff --git a/tools/gnu/classpath/tools/doclets/AbstractDoclet.java b/tools/gnu/classpath/tools/doclets/AbstractDoclet.java
index 4369782f9..9e1fac62e 100644
--- a/tools/gnu/classpath/tools/doclets/AbstractDoclet.java
+++ b/tools/gnu/classpath/tools/doclets/AbstractDoclet.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.doclets.AbstractDoclet
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -103,25 +103,20 @@ public abstract class AbstractDoclet
* Mapping from tag type to Taglet for user Taglets specified on
* the command line.
*/
- protected Map tagletMap = new LinkedHashMap();
+ protected Map<String,Taglet> tagletMap = new LinkedHashMap<String,Taglet>();
/**
* Stores the package groups specified in the user
* options. Contains objects of type PackageGroup.
*/
- private List packageGroups = new LinkedList();
-
- /**
- * The current classpath for loading taglet classes.
- */
- private String tagletPath;
+ private List<PackageGroup> packageGroups = new LinkedList<PackageGroup>();
/**
* Keeps track of the tags mentioned by the user during option
* processiong so that an error can be emitted if a tag is
* mentioned more than once.
*/
- private List mentionedTags = new LinkedList();
+ private List<Taglet> mentionedTags = new LinkedList<Taglet>();
public static int optionLength(String option) {
return instance.getOptionLength(option);
@@ -226,9 +221,6 @@ public abstract class AbstractDoclet
new DocletOptionFile("-d",
new File(System.getProperty("user.dir")));
- private DocletOptionFlag optionNoEmailWarn =
- new DocletOptionFlag("-noemailwarn");
-
private DocletOptionFlag optionAuthor =
new DocletOptionFlag("-author");
@@ -253,93 +245,12 @@ public abstract class AbstractDoclet
private DocletOptionColonSeparated optionExcludeDocFilesSubDir =
new DocletOptionColonSeparated("-excludedocfilessubdir");
- private DocletOptionTagletPath optionTagletPath =
- new DocletOptionTagletPath("-tagletpath");
-
private DocletOptionTag optionTaglet =
new DocletOptionTag("-taglet");
private DocletOptionTag optionTag =
new DocletOptionTag("-tag");
- private class DocletOptionTaglet
- extends DocletOption
- {
- DocletOptionTaglet(String optionName)
- {
- super(optionName);
- }
-
- public int getLength()
- {
- return 2;
- }
-
- public boolean set(String[] optionArr)
- {
-
- boolean tagletLoaded = false;
-
- String useTagletPath = AbstractDoclet.this.tagletPath;
- if (null == useTagletPath) {
- useTagletPath = System.getProperty("java.class.path");
- }
-
- try {
- Class tagletClass;
- try {
- tagletClass
- = new FileSystemClassLoader(useTagletPath).loadClass(optionArr[1]);
- }
- catch (ClassNotFoundException e) {
- // If not found on specified tagletpath, try default classloader
- tagletClass
- = Class.forName(optionArr[1]);
- }
- Method registerTagletMethod
- = tagletClass.getDeclaredMethod("register", new Class[] { java.util.Map.class });
-
- if (!registerTagletMethod.getReturnType().equals(Void.TYPE)) {
- printError("Taglet class '" + optionArr[1] + "' found, but register method doesn't return void.");
- }
- else if (registerTagletMethod.getExceptionTypes().length > 0) {
- printError("Taglet class '" + optionArr[1] + "' found, but register method contains throws clause.");
- }
- else if ((registerTagletMethod.getModifiers() & (Modifier.STATIC | Modifier.PUBLIC | Modifier.ABSTRACT)) != (Modifier.STATIC | Modifier.PUBLIC)) {
- printError("Taglet class '" + optionArr[1] + "' found, but register method isn't public static, or is abstract..");
- }
- else {
- Map tempMap = new HashMap();
- registerTagletMethod.invoke(null, new Object[] { tempMap });
- tagletLoaded = true;
- String name = (String)tempMap.keySet().iterator().next();
- Taglet taglet = (Taglet)tempMap.get(name);
- tagletMap.put(name, taglet);
- mentionedTags.add(taglet);
- }
- }
- catch (NoSuchMethodException e) {
- printError("Taglet class '" + optionArr[1] + "' found, but doesn't contain the register method.");
- }
- catch (SecurityException e) {
- printError("Taglet class '" + optionArr[1] + "' cannot be loaded: " + e.getMessage());
- }
- catch (InvocationTargetException e) {
- printError("Taglet class '" + optionArr[1] + "' found, but register method throws exception: " + e.toString());
- }
- catch (IllegalAccessException e) {
- printError("Taglet class '" + optionArr[1] + "' found, but there was a problem when accessing the register method: " + e.toString());
- }
- catch (IllegalArgumentException e) {
- printError("Taglet class '" + optionArr[1] + "' found, but there was a problem when accessing the register method: " + e.toString());
- }
- catch (ClassNotFoundException e) {
- printError("Taglet class '" + optionArr[1] + "' cannot be found.");
- }
- return tagletLoaded;
- }
- }
-
private class DocletOptionGroup
extends DocletOption
{
@@ -364,7 +275,7 @@ public abstract class AbstractDoclet
packageMatcher.addWildcard(packageWildcard);
}
- SortedSet groupPackages = packageMatcher.filter(rootDoc.specifiedPackages());
+ SortedSet<PackageDoc> groupPackages = packageMatcher.filter(rootDoc.specifiedPackages());
packageGroups.add(new PackageGroup(optionArr[1], groupPackages));
@@ -376,27 +287,6 @@ public abstract class AbstractDoclet
}
}
-
- private class DocletOptionTagletPath
- extends DocletOption
- {
- DocletOptionTagletPath(String optionName)
- {
- super(optionName);
- }
-
- public int getLength()
- {
- return 2;
- }
-
- public boolean set(String[] optionArr)
- {
- AbstractDoclet.this.tagletPath = optionArr[1];
- return true;
- }
- }
-
private class DocletOptionTag
extends DocletOption
{
@@ -528,7 +418,6 @@ public abstract class AbstractDoclet
optionGroup,
optionDocFilesSubDirs,
optionExcludeDocFilesSubDir,
- optionTagletPath,
optionTaglet,
optionTag,
};
@@ -558,12 +447,12 @@ public abstract class AbstractDoclet
nameToOptionMap.put(option.getName(), option);
}
- private Map nameToOptionMap = new HashMap();
+ private Map<String,DocletOption> nameToOptionMap = new HashMap<String,DocletOption>();
private int getOptionLength(String optionName)
{
registerOptions();
- DocletOption option = (DocletOption)nameToOptionMap.get(optionName.toLowerCase());
+ DocletOption option = nameToOptionMap.get(optionName.toLowerCase());
if (null != option) {
return option.getLength();
}
@@ -572,9 +461,9 @@ public abstract class AbstractDoclet
}
}
- protected List getKnownDirectSubclasses(ClassDoc classDoc)
+ protected List<ClassDoc> getKnownDirectSubclasses(ClassDoc classDoc)
{
- List result = new LinkedList();
+ List<ClassDoc> result = new LinkedList<ClassDoc>();
if (!"java.lang.Object".equals(classDoc.qualifiedName())) {
ClassDoc[] classes = rootDoc.classes();
for (int i=0; i<classes.length; ++i) {
@@ -587,7 +476,7 @@ public abstract class AbstractDoclet
}
protected static class IndexKey
- implements Comparable
+ implements Comparable<IndexKey>
{
private String name;
private String lowerName;
@@ -608,9 +497,9 @@ public abstract class AbstractDoclet
return lowerName.hashCode();
}
- public int compareTo(Object other)
+ public int compareTo(IndexKey ik)
{
- return lowerName.compareTo(((IndexKey)other).lowerName);
+ return lowerName.compareTo(ik.lowerName);
}
public String getName()
@@ -619,29 +508,29 @@ public abstract class AbstractDoclet
}
}
- private Map categorizedIndex;
+ private Map<Character,List<Doc>> categorizedIndex;
- protected Map getCategorizedIndex()
+ protected Map<Character,List<Doc>> getCategorizedIndex()
{
if (null == categorizedIndex) {
- categorizedIndex = new LinkedHashMap();
+ categorizedIndex = new LinkedHashMap<Character,List<Doc>>();
- Map indexMap = getIndexByName();
- LinkedList keys = new LinkedList(); //indexMap.keySet().size());
+ Map<IndexKey,Doc> indexMap = getIndexByName();
+ LinkedList<IndexKey> keys = new LinkedList<IndexKey>(); //indexMap.keySet().size());
keys.addAll(indexMap.keySet());
Collections.sort(keys);
- Iterator it = keys.iterator(); //indexMap.keySet().iterator();
+ Iterator<IndexKey> it = keys.iterator(); //indexMap.keySet().iterator();
char previousCategoryLetter = '\0';
Character keyLetter = null;
while (it.hasNext()) {
- IndexKey key = (IndexKey)it.next();
+ IndexKey key = it.next();
char firstChar = Character.toUpperCase(key.getName().charAt(0));
if (firstChar != previousCategoryLetter) {
keyLetter = new Character(firstChar);
previousCategoryLetter = firstChar;
- categorizedIndex.put(keyLetter, new LinkedList());
+ categorizedIndex.put(keyLetter, new LinkedList<Doc>());
}
- List letterList = (List)categorizedIndex.get(keyLetter);
+ List<Doc> letterList = categorizedIndex.get(keyLetter);
letterList.add(indexMap.get(key));
}
}
@@ -650,16 +539,16 @@ public abstract class AbstractDoclet
}
- private Map indexByName;
+ private Map<IndexKey,Doc> indexByName;
- protected Map getIndexByName()
+ protected Map<IndexKey,Doc> getIndexByName()
{
if (null == indexByName) {
// Create index
// Collect index
- indexByName = new HashMap(); //TreeMap();
+ indexByName = new HashMap<IndexKey,Doc>(); //TreeMap();
// Add packages to index
@@ -709,10 +598,9 @@ public abstract class AbstractDoclet
protected void printTaglets(Tag[] tags, TagletContext context, TagletPrinter output, boolean inline)
{
- for (Iterator it = tagletMap.keySet().iterator(); it.hasNext(); ) {
- String tagName = (String)it.next();
- Object o = tagletMap.get(tagName);
- Taglet taglet = (Taglet)o;
+ for (Iterator<String> it = tagletMap.keySet().iterator(); it.hasNext(); ) {
+ String tagName = it.next();
+ Taglet taglet = tagletMap.get(tagName);
Doc doc = context.getDoc();
if (inline == taglet.isInlineTag()
&& ((doc == null
@@ -724,14 +612,14 @@ public abstract class AbstractDoclet
|| (doc instanceof PackageDoc && taglet.inPackage())
|| ((doc.isClass() || doc.isInterface()) && taglet.inType()))))) {
- List tagsOfThisType = new LinkedList();
+ List<Tag> tagsOfThisType = new LinkedList<Tag>();
for (int i=0; i<tags.length; ++i) {
if (tags[i].name().substring(1).equals(tagName)) {
tagsOfThisType.add(tags[i]);
}
}
- Tag[] tagletTags = (Tag[])tagsOfThisType.toArray(new Tag[tagsOfThisType.size()]);
+ Tag[] tagletTags = tagsOfThisType.toArray(new Tag[tagsOfThisType.size()]);
String tagletString;
if (taglet instanceof StandardTaglet) {
@@ -778,24 +666,24 @@ public abstract class AbstractDoclet
/**
* @param usedClassToPackagesMap ClassDoc to (PackageDoc to (UsageType to (Set of Doc)))
*/
- private void addUsedBy(Map usedClassToPackagesMap,
+ private void addUsedBy(Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> usedClassToPackagesMap,
ClassDoc usedClass, UsageType usageType, Doc user, PackageDoc userPackage)
{
- Map packageToUsageTypeMap = (Map)usedClassToPackagesMap.get(usedClass);
+ Map<PackageDoc,Map<UsageType,Set<Doc>>> packageToUsageTypeMap = usedClassToPackagesMap.get(usedClass);
if (null == packageToUsageTypeMap) {
- packageToUsageTypeMap = new HashMap();
+ packageToUsageTypeMap = new HashMap<PackageDoc,Map<UsageType,Set<Doc>>>();
usedClassToPackagesMap.put(usedClass, packageToUsageTypeMap);
}
- Map usageTypeToUsersMap = (Map)packageToUsageTypeMap.get(userPackage);
+ Map<UsageType,Set<Doc>> usageTypeToUsersMap = packageToUsageTypeMap.get(userPackage);
if (null == usageTypeToUsersMap) {
- usageTypeToUsersMap = new TreeMap();
+ usageTypeToUsersMap = new TreeMap<UsageType,Set<Doc>>();
packageToUsageTypeMap.put(userPackage, usageTypeToUsersMap);
}
- Set userSet = (Set)usageTypeToUsersMap.get(usageType);
+ Set<Doc> userSet = usageTypeToUsersMap.get(usageType);
if (null == userSet) {
- userSet = new TreeSet(); // FIXME: we need the collator from Main here
+ userSet = new TreeSet<Doc>(); // FIXME: we need the collator from Main here
usageTypeToUsersMap.put(usageType, userSet);
}
userSet.add(user);
@@ -806,7 +694,8 @@ public abstract class AbstractDoclet
*/
private Map collectUsage() {
- Map _usedClassToPackagesMap = new HashMap();
+ Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> _usedClassToPackagesMap =
+ new HashMap<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>>();
ClassDoc[] classes = rootDoc.classes();
for (int i = 0, ilim = classes.length; i < ilim; ++ i) {
@@ -816,9 +705,9 @@ public abstract class AbstractDoclet
// classes implementing
InterfaceRelation relation
= (InterfaceRelation)getInterfaceRelations().get(clazz);
- Iterator it = relation.implementingClasses.iterator();
+ Iterator<ClassDoc> it = relation.implementingClasses.iterator();
while (it.hasNext()) {
- ClassDoc implementor = (ClassDoc)it.next();
+ ClassDoc implementor = it.next();
addUsedBy(_usedClassToPackagesMap,
clazz, UsageType.CLASS_IMPLEMENTING, implementor, implementor.containingPackage());
}
@@ -915,18 +804,18 @@ public abstract class AbstractDoclet
return _usedClassToPackagesMap;
}
- private Map usedClassToPackagesMap = null;
+ private Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> usedClassToPackagesMap = null;
- protected Map getUsageOfClass(ClassDoc classDoc)
+ protected Map<PackageDoc,Map<UsageType,Set<Doc>>> getUsageOfClass(ClassDoc classDoc)
{
if (null == this.usedClassToPackagesMap) {
this.usedClassToPackagesMap = collectUsage();
}
- return (Map)this.usedClassToPackagesMap.get(classDoc);
+ return this.usedClassToPackagesMap.get(classDoc);
}
protected static class UsageType
- implements Comparable
+ implements Comparable<UsageType>
{
public static final UsageType CLASS_DERIVED_FROM = new UsageType("class-derived-from");
public static final UsageType CLASS_IMPLEMENTING = new UsageType("class-implementing");
@@ -943,9 +832,9 @@ public abstract class AbstractDoclet
this.id = id;
}
- public int compareTo(Object other)
+ public int compareTo(UsageType ut)
{
- return this.id.compareTo(((UsageType)other).id);
+ return this.id.compareTo(ut.id);
}
public String toString() {
@@ -976,7 +865,7 @@ public abstract class AbstractDoclet
return MessageFormat.format(getString(key), new Object[] { value1 });
}
- protected List getPackageGroups()
+ protected List<PackageGroup> getPackageGroups()
{
return packageGroups;
}
diff --git a/tools/gnu/classpath/tools/doclets/PackageMatcher.java b/tools/gnu/classpath/tools/doclets/PackageMatcher.java
index 196b74c88..39f1103e4 100644
--- a/tools/gnu/classpath/tools/doclets/PackageMatcher.java
+++ b/tools/gnu/classpath/tools/doclets/PackageMatcher.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.doclets.PackageMatcher
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ import com.sun.javadoc.PackageDoc;
*/
public class PackageMatcher
{
- private Set patterns = new HashSet();
+ private Set<Pattern> patterns = new HashSet<Pattern>();
/**
* Add a wildcard to be matched. Wildcards can contain asterisk
@@ -117,9 +117,9 @@ public class PackageMatcher
* array given will be put into the output list if it matches one
* or more of the wildcards added to this PackageMatcher before.
*/
- public SortedSet filter(PackageDoc[] packageDocs)
+ public SortedSet<PackageDoc> filter(PackageDoc[] packageDocs)
{
- SortedSet result = new TreeSet();
+ SortedSet<PackageDoc> result = new TreeSet<PackageDoc>();
for (int i=0; i<packageDocs.length; ++i) {
if (match(packageDocs[i])) {
result.add(packageDocs[i]);
@@ -134,9 +134,9 @@ public class PackageMatcher
*/
public boolean match(PackageDoc packageDoc)
{
- Iterator it = patterns.iterator();
+ Iterator<Pattern> it = patterns.iterator();
while (it.hasNext()) {
- Pattern pattern = (Pattern)it.next();
+ Pattern pattern = it.next();
Matcher matcher = pattern.matcher(packageDoc.name());
if (matcher.matches()) {
return true;
diff --git a/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java b/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
index fc5f045ef..4fcb427a2 100644
--- a/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
+++ b/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.doclets.htmldoclet.HtmlDoclet
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -109,12 +109,12 @@ public class HtmlDoclet
/**
* Contains ExternalDocSet.
*/
- private List externalDocSets = new LinkedList();
+ private List<ExternalDocSet> externalDocSets = new LinkedList<ExternalDocSet>();
/**
* Contains String->ExternalDocSet.
*/
- private Map packageNameToDocSet = new HashMap();
+ private Map<String,ExternalDocSet> packageNameToDocSet = new HashMap<String, ExternalDocSet>();
/**
* Cache for version string from resource /version.properties
@@ -682,7 +682,7 @@ public class HtmlDoclet
HtmlPage output = newHtmlPage(new File(packageDir, "package-summary" + filenameExtension),
pathToRoot);
- Set keywords = new LinkedHashSet();
+ Set<String> keywords = new LinkedHashSet<String>();
keywords.add(packageDoc.name() + " packages");
output.beginPage(getPageTitle(packageDoc.name()), getOutputCharset(),
@@ -725,10 +725,10 @@ public class HtmlDoclet
}
static class TreeNode
- implements Comparable
+ implements Comparable<TreeNode>
{
ClassDoc classDoc;
- SortedSet children = new TreeSet();
+ SortedSet<TreeNode> children = new TreeSet<TreeNode>();
TreeNode(ClassDoc classDoc) {
TreeNode.this.classDoc = classDoc;
@@ -739,9 +739,9 @@ public class HtmlDoclet
return classDoc.equals(((TreeNode)other).classDoc);
}
- public int compareTo(Object other)
+ public int compareTo(TreeNode other)
{
- return classDoc.compareTo(((TreeNode)other).classDoc);
+ return classDoc.compareTo(other.classDoc);
}
public int hashCode()
@@ -750,9 +750,9 @@ public class HtmlDoclet
}
}
- private TreeNode addClassTreeNode(Map treeMap, ClassDoc classDoc)
+ private TreeNode addClassTreeNode(Map<String,TreeNode> treeMap, ClassDoc classDoc)
{
- TreeNode node = (TreeNode)treeMap.get(classDoc.qualifiedName());
+ TreeNode node = treeMap.get(classDoc.qualifiedName());
if (null == node) {
node = new TreeNode(classDoc);
treeMap.put(classDoc.qualifiedName(), node);
@@ -766,9 +766,9 @@ public class HtmlDoclet
return node;
}
- private TreeNode addInterfaceTreeNode(Map treeMap, ClassDoc classDoc)
+ private TreeNode addInterfaceTreeNode(Map<String,TreeNode> treeMap, ClassDoc classDoc)
{
- TreeNode node = (TreeNode)treeMap.get(classDoc.qualifiedName());
+ TreeNode node = treeMap.get(classDoc.qualifiedName());
if (null == node) {
node = new TreeNode(classDoc);
treeMap.put(classDoc.qualifiedName(), node);
@@ -781,7 +781,7 @@ public class HtmlDoclet
}
}
else {
- TreeNode rootNode = (TreeNode)treeMap.get("<root>");
+ TreeNode rootNode = treeMap.get("<root>");
if (null == rootNode) {
rootNode = new TreeNode(null);
treeMap.put("<root>", rootNode);
@@ -849,10 +849,9 @@ public class HtmlDoclet
if (!node.children.isEmpty()) {
output.beginElement("li", "class", "level");
output.beginElement("ul");
- Iterator it = node.children.iterator();
+ Iterator<TreeNode> it = node.children.iterator();
while (it.hasNext()) {
- TreeNode child = (TreeNode)it.next();
- printPackageTreeRec(output, child, node);
+ printPackageTreeRec(output, it.next(), node);
}
output.endElement("ul");
output.endElement("li");
@@ -861,7 +860,7 @@ public class HtmlDoclet
private void printClassTree(HtmlPage output, ClassDoc[] classDocs)
{
- Map classTreeMap = new HashMap();
+ Map<String,TreeNode> classTreeMap = new HashMap<String,TreeNode>();
for (int i=0; i<classDocs.length; ++i) {
ClassDoc classDoc = classDocs[i];
@@ -870,7 +869,7 @@ public class HtmlDoclet
}
}
- TreeNode root = (TreeNode)classTreeMap.get("java.lang.Object");
+ TreeNode root = classTreeMap.get("java.lang.Object");
if (null != root) {
output.div(CssClass.PACKAGE_TREE_SECTION_TITLE, "Class Hierarchy");
output.beginDiv(CssClass.PACKAGE_TREE);
@@ -881,7 +880,7 @@ public class HtmlDoclet
private void printInterfaceTree(HtmlPage output, ClassDoc[] classDocs)
{
- Map interfaceTreeMap = new HashMap();
+ Map<String,TreeNode> interfaceTreeMap = new HashMap<String,TreeNode>();
for (int i=0; i<classDocs.length; ++i) {
ClassDoc classDoc = classDocs[i];
@@ -890,14 +889,14 @@ public class HtmlDoclet
}
}
- TreeNode interfaceRoot = (TreeNode)interfaceTreeMap.get("<root>");
+ TreeNode interfaceRoot = interfaceTreeMap.get("<root>");
if (null != interfaceRoot) {
- Iterator it = interfaceRoot.children.iterator();
+ Iterator<TreeNode> it = interfaceRoot.children.iterator();
if (it.hasNext()) {
output.div(CssClass.PACKAGE_TREE_SECTION_TITLE, "Interface Hierarchy");
output.beginDiv(CssClass.PACKAGE_TREE);
while (it.hasNext()) {
- TreeNode node = (TreeNode)it.next();
+ TreeNode node = it.next();
printPackageTreeRec(output, node, null);
}
output.endDiv(CssClass.PACKAGE_TREE);
@@ -947,10 +946,10 @@ public class HtmlDoclet
output.beginDiv(CssClass.FULL_TREE_PACKAGELIST);
output.div(CssClass.FULL_TREE_PACKAGELIST_HEADER, "Package Hierarchies:");
output.beginDiv(CssClass.FULL_TREE_PACKAGELIST_ITEM);
- Set allPackages = getAllPackages();
- Iterator it = allPackages.iterator();
+ Set<PackageDoc> allPackages = getAllPackages();
+ Iterator<PackageDoc> it = allPackages.iterator();
while (it.hasNext()) {
- PackageDoc packageDoc = (PackageDoc)it.next();
+ PackageDoc packageDoc = it.next();
output.beginAnchor(getPackageURL(packageDoc) + "tree" + filenameExtension);
output.print(packageDoc.name());
output.endAnchor();
@@ -975,8 +974,6 @@ public class HtmlDoclet
{
output.beginDiv(CssClass.INDEX_ENTRY);
output.beginDiv(CssClass.INDEX_ENTRY_KEY);
- String anchor = null;
- String description = null;
if (entry instanceof PackageDoc) {
output.beginAnchor(getPackageURL((PackageDoc)entry) + "package-summary" + filenameExtension);
output.print(entry.name());
@@ -1105,10 +1102,10 @@ public class HtmlDoclet
output.beginDiv(CssClass.PACKAGE_MENU_LIST);
- Set packageDocs = getAllPackages();
- Iterator it = packageDocs.iterator();
+ Set<PackageDoc> packageDocs = getAllPackages();
+ Iterator<PackageDoc> it = packageDocs.iterator();
while (it.hasNext()) {
- PackageDoc packageDoc = (PackageDoc)it.next();
+ PackageDoc packageDoc = it.next();
output.beginSpan(CssClass.PACKAGE_MENU_ENTRY);
output.beginAnchor(getPackageURL(packageDoc) + "classes" + filenameExtension,
null,
@@ -1153,9 +1150,9 @@ public class HtmlDoclet
{
if (!classDocs.isEmpty()) {
output.div(CssClass.CLASS_MENU_SUBTITLE, header);
- Iterator it = classDocs.iterator();
+ Iterator<ClassDoc> it = classDocs.iterator();
while (it.hasNext()) {
- ClassDoc classDoc = (ClassDoc)it.next();
+ ClassDoc classDoc = it.next();
printClassMenuEntry(output, classDoc);
}
}
@@ -1166,10 +1163,10 @@ public class HtmlDoclet
output.beginDiv(CssClass.CLASS_MENU_LIST);
if (categorized) {
- Set classes = new TreeSet();
- Set interfaces = new TreeSet();
- Set exceptions = new TreeSet();
- Set errors = new TreeSet();
+ Set<ClassDoc> classes = new TreeSet<ClassDoc>();
+ Set<ClassDoc> interfaces = new TreeSet<ClassDoc>();
+ Set<ClassDoc> exceptions = new TreeSet<ClassDoc>();
+ Set<ClassDoc> errors = new TreeSet<ClassDoc>();
for (int i=0; i<classDocs.length; ++i) {
ClassDoc classDoc = classDocs[i];
@@ -1253,13 +1250,13 @@ public class HtmlDoclet
private void printSplitIndex()
throws IOException
{
- Map categorizedIndex = getCategorizedIndex();
- Iterator it = categorizedIndex.keySet().iterator();
+ Map<Character,List<Doc>> categorizedIndex = getCategorizedIndex();
+ Iterator<Character> it = categorizedIndex.keySet().iterator();
int n = 1;
int count = categorizedIndex.size();
while (it.hasNext()) {
- Character c = (Character)it.next();
- List classList = (List)categorizedIndex.get(c);
+ Character c = it.next();
+ List<Doc> classList = categorizedIndex.get(c);
printIndexPage(n++, count, c, classList);
}
}
@@ -1270,7 +1267,7 @@ public class HtmlDoclet
printIndexPage(0, 0, null, null);
}
- private void printIndexPage(int index, int maxIndex, Character letter, List classList)
+ private void printIndexPage(int index, int maxIndex, Character letter, List<Doc> classList)
throws IOException
{
String pageName = "alphaindex";
@@ -1334,12 +1331,12 @@ public class HtmlDoclet
printIndexCategory(output, letter, classList);
}
else {
- Map categorizedIndex = getCategorizedIndex();
- Iterator categoryIt = categorizedIndex.keySet().iterator();
+ Map<Character,List<Doc>> categorizedIndex = getCategorizedIndex();
+ Iterator<Character> categoryIt = categorizedIndex.keySet().iterator();
while (categoryIt.hasNext()) {
- letter = (Character)categoryIt.next();
- classList = (List)categorizedIndex.get(letter);
+ letter = categoryIt.next();
+ classList = categorizedIndex.get(letter);
output.anchorName(letter.toString());
printIndexCategory(output, letter, classList);
}
@@ -1420,13 +1417,13 @@ public class HtmlDoclet
output.div(CssClass.SERIALIZED_TITLE, "Serialized Form");
- Iterator it = getAllPackages().iterator();
+ Iterator<PackageDoc> it = getAllPackages().iterator();
while (it.hasNext()) {
- PackageDoc packageDoc = (PackageDoc)it.next();
+ PackageDoc packageDoc = it.next();
- List serializableClasses = new LinkedList();
+ List<ClassDoc> serializableClasses = new LinkedList<ClassDoc>();
ClassDoc[] classes = packageDoc.allClasses();
for (int i=0; i<classes.length; ++i) {
ClassDoc classDoc = classes[i];
@@ -1438,9 +1435,9 @@ public class HtmlDoclet
if (!serializableClasses.isEmpty()) {
output.div(CssClass.SERIALIZED_PACKAGE_HEADER, "Package " + packageDoc.name());
- Iterator cit = serializableClasses.iterator();
+ Iterator<ClassDoc> cit = serializableClasses.iterator();
while (cit.hasNext()) {
- ClassDoc classDoc = (ClassDoc)cit.next();
+ ClassDoc classDoc = cit.next();
output.anchorName(classDoc.qualifiedTypeName());
@@ -1500,13 +1497,13 @@ public class HtmlDoclet
output.div(CssClass.DEPRECATION_TITLE, "Deprecated API");
- List deprecatedInterfaces = new LinkedList();
- List deprecatedExceptions = new LinkedList();
- List deprecatedErrors = new LinkedList();
- List deprecatedClasses = new LinkedList();
- List deprecatedFields = new LinkedList();
- List deprecatedMethods = new LinkedList();
- List deprecatedConstructors = new LinkedList();
+ List<ClassDoc> deprecatedInterfaces = new LinkedList<ClassDoc>();
+ List<ClassDoc> deprecatedExceptions = new LinkedList<ClassDoc>();
+ List<ClassDoc> deprecatedErrors = new LinkedList<ClassDoc>();
+ List<ClassDoc> deprecatedClasses = new LinkedList<ClassDoc>();
+ List<FieldDoc> deprecatedFields = new LinkedList<FieldDoc>();
+ List<MethodDoc> deprecatedMethods = new LinkedList<MethodDoc>();
+ List<ConstructorDoc> deprecatedConstructors = new LinkedList<ConstructorDoc>();
ClassDoc[] classDocs = getRootDoc().classes();
for (int i=0; i<classDocs.length; ++i) {
@@ -2870,7 +2867,7 @@ public class HtmlDoclet
PackageDoc packageDoc = classDoc.containingPackage();
ExternalDocSet externalDocSet = null;
if (classDoc.containingPackage().name().length() > 0) {
- externalDocSet = (ExternalDocSet)packageNameToDocSet.get(packageDoc.name());
+ externalDocSet = packageNameToDocSet.get(packageDoc.name());
}
StringBuffer result = new StringBuffer();
result.append(getClassDocURL(output, classDoc));
@@ -2900,14 +2897,13 @@ public class HtmlDoclet
String url = null;
if (null != asClassDoc && asClassDoc.isIncluded()) {
url = getClassDocURL(output, asClassDoc);
- }
+ }
else if (!type.isPrimitive()) {
if (type.qualifiedTypeName().length() > type.typeName().length()) {
String packageName = type.qualifiedTypeName();
packageName = packageName.substring(0, packageName.length() - type.typeName().length() - 1);
- ExternalDocSet externalDocSet
- = (ExternalDocSet)packageNameToDocSet.get(packageName);
+ ExternalDocSet externalDocSet = packageNameToDocSet.get(packageName);
if (null != externalDocSet) {
url = externalDocSet.getClassDocURL(packageName, type.typeName());
}
@@ -2950,7 +2946,7 @@ public class HtmlDoclet
private String getPackageURL(PackageDoc packageDoc)
{
if (packageDoc.name().length() > 0) {
- ExternalDocSet externalDocSet = (ExternalDocSet)packageNameToDocSet.get(packageDoc.name());
+ ExternalDocSet externalDocSet = packageNameToDocSet.get(packageDoc.name());
String url;
if (null != externalDocSet) {
url = externalDocSet.getPackageDocURL(packageDoc.name());
@@ -2974,7 +2970,7 @@ public class HtmlDoclet
{
ExternalDocSet externalDocSet = null;
if (classDoc.containingPackage().name().length() > 0) {
- externalDocSet = (ExternalDocSet)packageNameToDocSet.get(classDoc.containingPackage().name());
+ externalDocSet = packageNameToDocSet.get(classDoc.containingPackage().name());
}
if (null != externalDocSet) {
return externalDocSet.getClassDocURL(classDoc.containingPackage().name(),
diff --git a/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java b/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java
index b38c2b083..b0e2127c8 100644
--- a/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.ClassDocImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -103,9 +103,9 @@ public class ClassDocImpl
return filter ? filteredFields : unfilteredFields;
}
- private static Set primitiveNames;
+ private static Set<String> primitiveNames;
static {
- primitiveNames = new HashSet();
+ primitiveNames = new HashSet<String>();
primitiveNames.add("int");
primitiveNames.add("long");
primitiveNames.add("char");
@@ -116,11 +116,11 @@ public class ClassDocImpl
primitiveNames.add("boolean");
}
- private Map findClassCache = new HashMap();
+ private Map<String,ClassDoc> findClassCache = new HashMap<String,ClassDoc>();
public ClassDoc findClass(String className, String dimension)
{
- ClassDoc cached = (ClassDoc)findClassCache.get(className + dimension);
+ ClassDoc cached = findClassCache.get(className + dimension);
if (null != cached) {
return cached;
}
@@ -324,7 +324,7 @@ public class ClassDocImpl
ClassDoc[] importedClasses,
PackageDoc[] importedPackages,
char[] source, int startIndex, int endIndex,
- List importStatementList) throws ParseException, IOException {
+ List<String> importStatementList) throws ParseException, IOException {
String superclassName = "java.lang.Object";
@@ -334,7 +334,7 @@ public class ClassDocImpl
importedPackages,
null);
rc.setImportStatementList(importStatementList);
- List implementedInterfaces = new ArrayList();
+ List<String> implementedInterfaces = new ArrayList<String>();
String word="";
int item=0;
@@ -511,7 +511,7 @@ public class ClassDocImpl
ClassDoc[] interfaces=new ClassDoc[implementedInterfaces.size()];
for (int i=0; i<interfaces.length; ++i) {
- interfaces[i]=new ClassDocProxy((String)implementedInterfaces.get(i), rc);
+ interfaces[i]=new ClassDocProxy(implementedInterfaces.get(i), rc);
}
rc.setInterfaces(interfaces);
@@ -643,10 +643,10 @@ public class ClassDocImpl
}
}
- List isSerMethodList=new ArrayList();
+ List<MethodDoc> isSerMethodList = new ArrayList<MethodDoc>();
if (null != maybeSerMethodList) {
- for (Iterator it=maybeSerMethodList.iterator(); it.hasNext(); ) {
+ for (Iterator<MethodDoc> it = maybeSerMethodList.iterator(); it.hasNext(); ) {
MethodDocImpl method=(MethodDocImpl)it.next();
method.resolve();
@@ -664,7 +664,7 @@ public class ClassDocImpl
isSerMethodList.add(method);
}
}
- this.serializationMethods=(MethodDoc[])isSerMethodList.toArray(new MethodDoc[0]);
+ this.serializationMethods = isSerMethodList.toArray(new MethodDoc[isSerMethodList.size()]);
maybeSerMethodList=null;
}
}
@@ -795,10 +795,10 @@ public class ClassDocImpl
this.importedClasses=importedClasses;
}
- private static Map typeMap = new HashMap();
+ private static Map<String,Type> typeMap = new HashMap<String,Type>();
Type typeForString(String typeName) throws ParseException {
- String orgTypename=typeName;
+ //String orgTypename=typeName;
int ndx=typeName.indexOf('[');
String dim="";
if (ndx>=0) {
@@ -815,7 +815,7 @@ public class ClassDocImpl
return classDoc;
}
- Type type = (Type)typeMap.get(typeName+dim);
+ Type type = typeMap.get(typeName+dim);
if (null!=type) {
try {
if (type.dimension().equals(dim)) {
@@ -995,9 +995,9 @@ public class ClassDocImpl
return (o!=null) && (o instanceof ClassDoc) && ((ClassDoc)o).qualifiedName().equals(qualifiedName());
}
- private List maybeSerMethodList;
+ private List<MethodDoc> maybeSerMethodList;
- void setMaybeSerMethodList(List maybeSerMethodList) {
+ void setMaybeSerMethodList(List<MethodDoc> maybeSerMethodList) {
this.maybeSerMethodList=maybeSerMethodList;
}
@@ -1061,7 +1061,7 @@ public class ClassDocImpl
private Object findFieldValue(String identifier,
ClassDoc classDoc,
String fieldName,
- Set visitedFields)
+ Set<FieldDoc> visitedFields)
throws UnknownIdentifierException, IllegalExpressionException
{
while (classDoc != null) {
@@ -1097,7 +1097,7 @@ public class ClassDocImpl
throw new UnknownIdentifierException(identifier);
}
- public Object getValue(String identifier, Set visitedFields)
+ public Object getValue(String identifier, Set<FieldDoc> visitedFields)
throws UnknownIdentifierException, IllegalExpressionException
{
int ndx = identifier.lastIndexOf('.');
@@ -1124,13 +1124,13 @@ public class ClassDocImpl
}
// Compares this Object with the specified Object for order.
- public int compareTo(java.lang.Object o) {
+ public int compareTo(Doc d) {
int rc;
- if (o instanceof ClassDocImpl) {
+ if (d instanceof ClassDocImpl) {
ClassDocImpl c1 = this;
- ClassDocImpl c2 = (ClassDocImpl)o;
+ ClassDocImpl c2 = (ClassDocImpl)d;
if (null != c1.containingClass() && null == c2.containingClass()) {
rc = c1.containingClass().compareTo(c2);
@@ -1153,10 +1153,10 @@ public class ClassDocImpl
}
}
- rc = super.compareTo(o);
+ rc = super.compareTo(d);
if (0 == rc) {
return Main.getInstance().getCollator().compare(containingPackage().name(),
- ((ClassDocImpl)o).containingPackage().name());
+ c2.containingPackage().name());
}
else {
return rc;
@@ -1167,11 +1167,11 @@ public class ClassDocImpl
}
}
- private List importStatementList;
+ private List<String> importStatementList;
- public void setImportStatementList(List importStatementList)
+ public void setImportStatementList(List<String> importStatementList)
{
- this.importStatementList = new LinkedList();
+ this.importStatementList = new LinkedList<String>();
this.importStatementList.addAll(importStatementList);
}
diff --git a/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java b/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java
index 253cf5ec4..aa06addf7 100644
--- a/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java
+++ b/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.ClassDocProxy
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -155,13 +155,8 @@ public class ClassDocProxy implements ClassDoc, WritableType {
}
// Compares this Object with the specified Object for order.
- public int compareTo(java.lang.Object o) {
- if (o instanceof Doc) {
- return Main.getInstance().getCollator().compare(name(), ((Doc)o).name());
- }
- else {
- return 0;
- }
+ public int compareTo(Doc d) {
+ return Main.getInstance().getCollator().compare(name(), d.name());
}
public TypeVariable[] typeParameters() { return new TypeVariable[0]; }
diff --git a/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java b/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java
index 9a81cb793..9b911d310 100644
--- a/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.ClassDocReflectedImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,7 +37,17 @@
package gnu.classpath.tools.gjdoc;
-import com.sun.javadoc.*;
+import com.sun.javadoc.Doc;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.ConstructorDoc;
+import com.sun.javadoc.FieldDoc;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.SeeTag;
+import com.sun.javadoc.SourcePosition;
+import com.sun.javadoc.Tag;
+import com.sun.javadoc.TypeVariable;
+
import java.util.Map;
import java.util.HashMap;
@@ -104,7 +114,7 @@ public class ClassDocReflectedImpl
public boolean definesSerializableFields() { return false; }
public FieldDoc[] fields() { return new FieldDoc[0]; }
public FieldDoc[] fields(boolean filtered) { return new FieldDoc[0]; }
- public ClassDoc findClass(java.lang.String className) { return null; }
+ public ClassDoc findClass(String className) { return null; }
public ClassDoc[] importedClasses() { return new ClassDoc[0]; }
public PackageDoc[] importedPackages() { return new PackageDoc[0]; }
public ClassDoc[] innerClasses() { return new ClassDoc[0]; }
@@ -195,13 +205,8 @@ public class ClassDocReflectedImpl
public String toString() { return "ClassDocReflectedImpl{"+qualifiedName()+"}"; }
- public int compareTo(java.lang.Object o) {
- if (o instanceof Doc) {
- return Main.getInstance().getCollator().compare(name(), ((Doc)o).name());
- }
- else {
- return 0;
- }
+ public int compareTo(Doc d) {
+ return Main.getInstance().getCollator().compare(name(), d.name());
}
public String dimension() { return dimension; }
diff --git a/tools/gnu/classpath/tools/gjdoc/DocImpl.java b/tools/gnu/classpath/tools/gjdoc/DocImpl.java
index ecd810040..dfa1a7a3c 100644
--- a/tools/gnu/classpath/tools/gjdoc/DocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/DocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.DocImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,8 +71,8 @@ public abstract class DocImpl implements Doc, TagContainer {
}
// Compares this Object with the specified Object for order.
- public int compareTo(java.lang.Object o) {
- return Main.getInstance().getCollator().compare(name(), ((Doc)o).name());
+ public int compareTo(Doc d) {
+ return Main.getInstance().getCollator().compare(name(), d.name());
}
// Return the first sentence of the comment as tags.
diff --git a/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java b/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java
index d5b1b1eb0..8f2a49c99 100644
--- a/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.ExecutableMemberDocImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -402,14 +402,14 @@ public class ExecutableMemberDocImpl extends MemberDocImpl implements Executable
}
- public int compareTo(Object other) {
+ public int compareTo(Doc d) {
int rc;
- if (other instanceof MemberDocImpl) {
- MemberDocImpl otherMember = (MemberDocImpl)other;
+ if (d instanceof MemberDocImpl) {
+ MemberDocImpl otherMember = (MemberDocImpl)d;
rc = name().compareTo(otherMember.name());
if (0 == rc) {
- if (other instanceof ExecutableMemberDocImpl) {
- rc = signature().compareTo(((ExecutableMemberDocImpl)other).signature());
+ if (d instanceof ExecutableMemberDocImpl) {
+ rc = signature().compareTo(((ExecutableMemberDocImpl)d).signature());
if (0 == rc) {
return containingClass().compareTo(otherMember.containingClass());
}
diff --git a/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java b/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java
index f99024daa..4fa8e5d6b 100644
--- a/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.FieldDocImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -95,11 +95,11 @@ public class FieldDocImpl
}
}
- public static Collection createFromSource(ClassDoc containingClass,
- PackageDoc containingPackage,
- char[] source, int startIndex, int endIndex) {
+ public static Collection<FieldDoc> createFromSource(ClassDoc containingClass,
+ PackageDoc containingPackage,
+ char[] source, int startIndex, int endIndex) {
- List rcList=new ArrayList();
+ List<FieldDoc> rcList=new ArrayList<FieldDoc>();
FieldDocImpl fd=new FieldDocImpl(containingClass,
containingPackage,
@@ -120,7 +120,6 @@ public class FieldDocImpl
final int STATE_COMMENT = 7;
final int STATE_LINECOMMENT = 8;
- int lastFieldDefStart = ndx;
int state = STATE_FIELDNAME;
int prevState = state;
@@ -298,7 +297,7 @@ public class FieldDocImpl
return constantValue(new HashSet());
}
- public Object constantValue(Set visitedFields) {
+ public Object constantValue(Set<FieldDoc> visitedFields) {
if (!isStatic()
|| !isFinal()
|| (!type().isPrimitive() && !"java.lang.String".equals(type().qualifiedTypeName()))
diff --git a/tools/gnu/classpath/tools/gjdoc/Main.java b/tools/gnu/classpath/tools/gjdoc/Main.java
index d0fd296e6..feb30863d 100644
--- a/tools/gnu/classpath/tools/gjdoc/Main.java
+++ b/tools/gnu/classpath/tools/gjdoc/Main.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.Main
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -142,11 +142,6 @@ public final class Main
private String option_doclet = "gnu.classpath.tools.doclets.htmldoclet.HtmlDoclet";
/**
- * Option "-overview": path to the special overview file.
- */
- private String option_overview;
-
- /**
* Option "-coverage": which members to include in generated documentation.
*/
private int option_coverage = COVERAGE_PROTECTED;
@@ -162,30 +157,10 @@ public final class Main
private String option_docletpath;
/**
- * Option "-classpath": path to additional classes.
- */
- private String option_classpath;
-
- /**
* Option "-sourcepath": path to the Java source files to be documented.
* FIXME: this should be a list of paths
*/
- private List option_sourcepath = new ArrayList();
-
- /**
- * Option "-extdirs": path to Java extension files.
- */
- private String option_extdirs;
-
- /**
- * Option "-verbose": Be verbose when generating documentation.
- */
- private boolean option_verbose;
-
- /**
- * Option "-nowarn": Do not print warnings.
- */
- private boolean option_nowarn;
+ private List<File> option_sourcepath = new ArrayList<File>();
/**
* Option "-locale:" Specify the locale charset of Java source files.
@@ -198,11 +173,6 @@ public final class Main
private String option_encoding;
/**
- * Option "-J": Specify flags to be passed to Java runtime.
- */
- private List option_java_flags = new LinkedList(); //ArrayList();
-
- /**
* Option "-source:" should be 1.4 to handle assertions, 1.1 is no
* longer supported.
*/
@@ -212,12 +182,12 @@ public final class Main
* Option "-subpackages": list of subpackages to be recursively
* added.
*/
- private List option_subpackages = new ArrayList();
+ private List<String> option_subpackages = new ArrayList<String>();
/**
* Option "-exclude": list of subpackages to exclude.
*/
- private List option_exclude = new ArrayList();
+ private List<String> option_exclude = new ArrayList<String>();
/**
* Option "-breakiterator" - whether to use BreakIterator for
@@ -263,7 +233,7 @@ public final class Main
*
* @param allOptions List of all command line tokens
*/
- private boolean startDoclet(List allOptions)
+ private boolean startDoclet(List<String> allOptions)
{
try
@@ -273,7 +243,7 @@ public final class Main
Debug.log(1, "loading doclet class...");
- Class docletClass;
+ Class<?> docletClass;
if (null != option_docletpath) {
try {
@@ -341,14 +311,14 @@ public final class Main
//--- Feed the custom command line tokens to the Doclet
// stores all recognized options
- List options = new LinkedList();
+ List<String[]> options = new LinkedList<String[]>();
// stores packages and classes defined on the command line
- List packageAndClasses = new LinkedList();
+ List<String> packageAndClasses = new LinkedList<String>();
- for (Iterator it = allOptions.iterator(); it.hasNext();)
+ for (Iterator<String> it = allOptions.iterator(); it.hasNext();)
{
- String option = (String) it.next();
+ String option = it.next();
Debug.log(9, "parsing option '" + option + "'");
@@ -448,13 +418,13 @@ public final class Main
// check that it exists and find out whether it is a class
// or a package
- for (Iterator it = option_subpackages.iterator(); it.hasNext();)
+ for (Iterator<String> it = option_subpackages.iterator(); it.hasNext();)
{
- String subpackage = (String) it.next();
- Set foundPackages = new LinkedHashSet();
+ String subpackage = it.next();
+ Set<String> foundPackages = new LinkedHashSet<String>();
- for (Iterator pit = option_sourcepath.iterator(); pit.hasNext(); ) {
- File sourceDir = (File)pit.next();
+ for (Iterator<File> pit = option_sourcepath.iterator(); pit.hasNext(); ) {
+ File sourceDir = pit.next();
File packageDir = new File(sourceDir, subpackage.replace('.', File.separatorChar));
findPackages(subpackage, packageDir, foundPackages);
}
@@ -463,14 +433,14 @@ public final class Main
}
if (option_all) {
- Set foundPackages = new LinkedHashSet();
- for (Iterator pit = option_sourcepath.iterator(); pit.hasNext(); ) {
- File sourceDir = (File)pit.next();
+ Set<String> foundPackages = new LinkedHashSet<String>();
+ for (Iterator<File> pit = option_sourcepath.iterator(); pit.hasNext(); ) {
+ File sourceDir = pit.next();
findPackages("", sourceDir, foundPackages);
}
addFoundPackages(null, foundPackages);
- for (Iterator packageIt = foundPackages.iterator(); packageIt.hasNext(); ) {
- String packageName = (String)packageIt.next();
+ for (Iterator<String> packageIt = foundPackages.iterator(); packageIt.hasNext(); ) {
+ String packageName = packageIt.next();
if (null == packageName) {
packageName = "";
}
@@ -478,16 +448,16 @@ public final class Main
}
}
- for (Iterator it = packageAndClasses.iterator(); it.hasNext();)
+ for (Iterator<String> it = packageAndClasses.iterator(); it.hasNext();)
{
- String classOrPackage = (String) it.next();
+ String classOrPackage = it.next();
boolean foundSourceFile = false;
if (classOrPackage.endsWith(".java")) {
- for (Iterator pit = option_sourcepath.iterator(); pit.hasNext() && !foundSourceFile; ) {
- File sourceDir = (File)pit.next();
+ for (Iterator<File> pit = option_sourcepath.iterator(); pit.hasNext() && !foundSourceFile; ) {
+ File sourceDir = pit.next();
File sourceFile = new File(sourceDir, classOrPackage);
if (sourceFile.exists() && !sourceFile.isDirectory()) {
rootDoc.addSpecifiedSourceFile(sourceFile);
@@ -525,8 +495,8 @@ public final class Main
//--- Create one file object each for a possible package directory
// and a possible class file, and find out if they exist.
- List packageDirs = rootDoc.findSourceFiles(classOrPackageRelPath);
- List sourceFiles = rootDoc.findSourceFiles(classOrPackageRelPath + ".java");
+ List<File> packageDirs = rootDoc.findSourceFiles(classOrPackageRelPath);
+ List<File> sourceFiles = rootDoc.findSourceFiles(classOrPackageRelPath + ".java");
boolean packageDirExists = !packageDirs.isEmpty();
boolean sourceFileExists = !sourceFiles.isEmpty();
@@ -554,10 +524,10 @@ public final class Main
else
if (packageDirExists) {
- Iterator packageDirIt = packageDirs.iterator();
+ Iterator<File> packageDirIt = packageDirs.iterator();
boolean packageDirFound = false;
while (packageDirIt.hasNext()) {
- File packageDir = (File)packageDirIt.next();
+ File packageDir = packageDirIt.next();
if (packageDir.isDirectory()) {
rootDoc.addSpecifiedPackageName(classOrPackage);
packageDirFound = true;
@@ -671,19 +641,19 @@ public final class Main
}
}
- private void addFoundPackages(String subpackage, Set foundPackages)
+ private void addFoundPackages(String subpackage, Set<String> foundPackages)
{
if (foundPackages.isEmpty()) {
reporter.printWarning("No classes found under subpackage " + subpackage);
}
else {
boolean onePackageAdded = false;
- for (Iterator rit = foundPackages.iterator(); rit.hasNext();) {
- String foundPackage = (String)rit.next();
+ for (Iterator<String> rit = foundPackages.iterator(); rit.hasNext();) {
+ String foundPackage = rit.next();
boolean excludeThisPackage = false;
- for (Iterator eit = option_exclude.iterator(); eit.hasNext();) {
- String excludePackage = (String)eit.next();
+ for (Iterator<String> eit = option_exclude.iterator(); eit.hasNext();) {
+ String excludePackage = eit.next();
if (foundPackage.equals(excludePackage) ||
foundPackage.startsWith(excludePackage + ":")) {
excludeThisPackage = true;
@@ -817,7 +787,7 @@ public final class Main
*/
private void findPackages(String subpackage,
File packageDir,
- Set result)
+ Set<String> result)
{
File[] files = packageDir.listFiles();
if (null != files) {
@@ -1026,7 +996,7 @@ public final class Main
//--- Collect unparsed arguments in array and resolve references
// to external argument files.
- List arguments = new ArrayList(args.length);
+ List<String> arguments = new ArrayList<String>(args.length);
for (int i = 0; i < args.length; ++i)
{
@@ -1062,7 +1032,7 @@ public final class Main
// Contains objects of type String[], where each entry
// specifies an option along with its aguments.
- List options = new LinkedList();
+ List<String[]> options = new LinkedList<String[]>();
//--- This will hold all command line tokens not recognized
// to be part of a standard option.
@@ -1070,17 +1040,17 @@ public final class Main
// Contains objects of type String, where each entry is
// one unrecognized token.
- List customOptions = new LinkedList();
+ List<String> customOptions = new LinkedList<String>();
rootDoc = new RootDocImpl();
reporter = rootDoc.getReporter();
//--- Iterate over all options given on the command line
- for (Iterator it = arguments.iterator(); it.hasNext();)
+ for (Iterator<String> it = arguments.iterator(); it.hasNext();)
{
- String arg = (String) it.next();
+ String arg = it.next();
//--- Check if gjdoc recognizes this option as a standard option
// and remember the options' argument count
@@ -1129,8 +1099,7 @@ public final class Main
//--- Create an array of String arrays from the dynamic array built above
- String[][] optionArr = (String[][]) options.toArray(new String[options
- .size()][0]);
+ String[][] optionArr = options.toArray(new String[options.size()][0]);
//--- Validate all options and issue warnings/errors
@@ -1181,6 +1150,7 @@ public final class Main
return reporter.getErrorCount();
}
+ /*
private void addJavaLangClasses()
throws IOException
{
@@ -1201,6 +1171,7 @@ public final class Main
}
}
}
+ */
/**
* Helper class for parsing command line arguments. An instance of this class
@@ -1241,7 +1212,7 @@ public final class Main
* Initialized only once by method initOptions(). FIXME: Rename to
* 'optionProcessors'.
*/
- private static Map options = null;
+ private static Map<String,OptionProcessor> options = null;
/**
* Initialize all OptionProcessor objects needed to scan/parse command line
@@ -1251,7 +1222,7 @@ public final class Main
private void initOptions()
{
- options = new HashMap();
+ options = new HashMap<String,OptionProcessor>();
//--- Put one OptionProcessor object into the map
// for each option recognized.
@@ -1261,7 +1232,7 @@ public final class Main
void process(String[] args)
{
- option_overview = args[0];
+ System.err.println("WARNING: Unsupported option -overview ignored");
}
});
options.put("-public", new OptionProcessor(1)
@@ -1328,7 +1299,7 @@ public final class Main
void process(String[] args)
{
- option_nowarn = true;
+ System.err.println("WARNING: Unsupported option -nowarn ignored");
}
});
options.put("-source", new OptionProcessor(2)
@@ -1412,7 +1383,6 @@ public final class Main
void process(String[] args)
{
- option_verbose = true;
System.err.println("WARNING: Unsupported option -verbose ignored");
}
});
diff --git a/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java b/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java
index acc812863..87ed585fe 100644
--- a/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.MemberDocImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -170,15 +170,15 @@ public abstract class MemberDocImpl extends ProgramElementDocImpl implements Mem
return Main.getInstance().includeAccessLevel(accessLevel);
}
- public int compareTo(Object o) {
- if (o instanceof MemberDocImpl) {
- int rc=name().compareTo(((MemberDocImpl)o).name());
+ public int compareTo(Doc d) {
+ if (d instanceof MemberDocImpl) {
+ int rc=name().compareTo(((MemberDocImpl)d).name());
if (rc==0)
- rc=containingClass().qualifiedName().compareTo(((MemberDocImpl)o).containingClass().qualifiedName());
+ rc=containingClass().qualifiedName().compareTo(((MemberDocImpl)d).containingClass().qualifiedName());
return rc;
}
else {
- return super.compareTo(o);
+ return super.compareTo(d);
}
}
diff --git a/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java b/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java
index 84960bcf3..770a62756 100644
--- a/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.PackageDocImpl
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,11 +46,11 @@ class PackageDocImpl extends DocImpl implements GjdocPackageDoc {
private String packageName;
private File packageDirectory;
- private Set allClassesSet = new TreeSet();
- private List ordinaryClassesList = new ArrayList();
- private List exceptionsList = new ArrayList();
- private List interfacesList = new ArrayList();
- private List errorsList = new ArrayList();
+ private Set<ClassDoc> allClassesSet = new TreeSet<ClassDoc>();
+ private List<ClassDoc> ordinaryClassesList = new ArrayList<ClassDoc>();
+ private List<ClassDoc> exceptionsList = new ArrayList<ClassDoc>();
+ private List<ClassDoc> interfacesList = new ArrayList<ClassDoc>();
+ private List<ClassDoc> errorsList = new ArrayList<ClassDoc>();
private ClassDoc[] allClasses;
private ClassDoc[] ordinaryClasses;
@@ -70,8 +70,8 @@ class PackageDocImpl extends DocImpl implements GjdocPackageDoc {
}
public void resolve() {
- for (Iterator it=allClassesSet.iterator(); it.hasNext(); ) {
- ClassDocImpl classDoc=(ClassDocImpl)it.next();
+ for (Iterator<ClassDoc> it = allClassesSet.iterator(); it.hasNext(); ) {
+ ClassDocImpl classDoc = (ClassDocImpl) it.next();
try {
classDoc.resolve();
} catch (ParseException e) {
@@ -153,9 +153,9 @@ class PackageDocImpl extends DocImpl implements GjdocPackageDoc {
return this.errors;
}
- private ClassDoc[] toClassDocArray(Collection classDocList)
+ private ClassDoc[] toClassDocArray(Collection<ClassDoc> classDocList)
{
- ClassDoc[] result = (ClassDoc[])classDocList.toArray(new ClassDoc[classDocList.size()]);
+ ClassDoc[] result = classDocList.toArray(new ClassDoc[classDocList.size()]);
Arrays.sort(result);
return result;
}
@@ -193,9 +193,9 @@ class PackageDocImpl extends DocImpl implements GjdocPackageDoc {
return packageName;
}
- public int compareTo(Object o) {
- if (o!=null && o instanceof PackageDocImpl)
- return name().compareTo(((PackageDocImpl)o).name());
+ public int compareTo(Doc d) {
+ if (d !=null && d instanceof PackageDocImpl)
+ return name().compareTo(((PackageDocImpl)d).name());
else
return 0;
}
diff --git a/tools/gnu/classpath/tools/gjdoc/Parser.java b/tools/gnu/classpath/tools/gjdoc/Parser.java
index d355b5384..af6b6b432 100644
--- a/tools/gnu/classpath/tools/gjdoc/Parser.java
+++ b/tools/gnu/classpath/tools/gjdoc/Parser.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.Parser
- Copyright (C) 2001, 2005, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005, 2008, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,21 +37,38 @@
package gnu.classpath.tools.gjdoc;
-import java.io.*;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.ConstructorDoc;
+import com.sun.javadoc.FieldDoc;
+import com.sun.javadoc.MethodDoc;
+import com.sun.javadoc.PackageDoc;
+
+import gnu.classpath.tools.IOToolkit;
+import gnu.classpath.tools.NotifyingInputStreamReader;
+import gnu.classpath.tools.MalformedInputListener;
+import gnu.classpath.tools.MalformedInputEvent;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.Reader;
+
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;
-import java.util.*;
-import com.sun.javadoc.*;
-
-import gnu.classpath.tools.IOToolkit;
-import gnu.classpath.tools.NotifyingInputStreamReader;
-import gnu.classpath.tools.MalformedInputListener;
-import gnu.classpath.tools.MalformedInputEvent;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.Stack;
class IgnoredFileParseException extends ParseException
{
@@ -356,11 +373,11 @@ import gnu.classpath.tools.MalformedInputEvent;
if (endIndex-startIndex<=1) return endIndex;
//assert (parser.ctx!=null);
- Collection fields=FieldDocImpl.createFromSource(parser.ctx.classDoc,
- parser.ctx.classDoc.containingPackage(),
- source, startIndex, endIndex);
+ Collection<FieldDoc> fields = FieldDocImpl.createFromSource(parser.ctx.classDoc,
+ parser.ctx.classDoc.containingPackage(),
+ source, startIndex, endIndex);
- for (Iterator it=fields.iterator(); it.hasNext(); ) {
+ for (Iterator<FieldDoc> it=fields.iterator(); it.hasNext(); ) {
FieldDocImpl field=(FieldDocImpl)it.next();
boolean fieldHasSerialTag=!field.isTransient() && !field.isStatic(); //field.hasSerialTag();
if ((field.isIncluded() || fieldHasSerialTag) && parser.getAddComments()) {
@@ -408,27 +425,26 @@ import gnu.classpath.tools.MalformedInputEvent;
parser.setLastComment(null);
if (execDoc.isMethod()) {
- parser.ctx.methodList.add(execDoc);
- if (execDoc.isIncluded()) {
- parser.ctx.filteredMethodList.add(execDoc);
+ MethodDoc methDoc = (MethodDoc) execDoc;
+ parser.ctx.methodList.add(methDoc);
+ if (methDoc.isIncluded()) {
+ parser.ctx.filteredMethodList.add(methDoc);
}
- }
- else {
- parser.ctx.constructorList.add(execDoc);
- if (execDoc.isIncluded()) {
- parser.ctx.filteredConstructorList.add(execDoc);
- }
- }
-
- if (execDoc.isMethod()
- && (execDoc.name().equals("readObject")
- || execDoc.name().equals("writeObject")
- || execDoc.name().equals("readExternal")
- || execDoc.name().equals("writeExternal")
- || execDoc.name().equals("readResolve"))) {
+ if (methDoc.name().equals("readObject")
+ || methDoc.name().equals("writeObject")
+ || methDoc.name().equals("readExternal")
+ || methDoc.name().equals("writeExternal")
+ || methDoc.name().equals("readResolve")) {
// FIXME: add readExternal here?
- parser.ctx.maybeSerMethodList.add(execDoc);
+ parser.ctx.maybeSerMethodList.add(methDoc);
+ }
+ } else {
+ ConstructorDoc constDoc = (ConstructorDoc) execDoc;
+ parser.ctx.constructorList.add(constDoc);
+ if (constDoc.isIncluded()) {
+ parser.ctx.filteredConstructorList.add(constDoc);
+ }
}
return endIndex;
@@ -764,7 +780,7 @@ public class Parser {
return processedFiles.size();
}
- static Set processedFiles = new HashSet();
+ static Set<File> processedFiles = new HashSet<File>();
ClassDocImpl processSourceFile(File file, boolean addComments,
String encoding, String expectedPackageName)
@@ -803,8 +819,8 @@ public class Parser {
try {
parse(source, 0, sourceLevelComponents);
- ClassDoc[] importedClasses=(ClassDoc[])importedClassesList.toArray(new ClassDoc[0]);
- PackageDoc[] importedPackages=(PackageDoc[])importedPackagesList.toArray(new PackageDoc[0]);
+ ClassDoc[] importedClasses = importedClassesList.toArray(new ClassDoc[importedClassesList.size()]);
+ PackageDoc[] importedPackages = importedPackagesList.toArray(new PackageDoc[importedPackagesList.size()]);
if (Main.DESCEND_IMPORTED) {
for (int i=0; i<importedClasses.length; ++i) {
@@ -909,7 +925,7 @@ public class Parser {
ClassDocImpl classDoc
= ClassDocImpl.createInstance((ctx!=null)?(ctx.classDoc):null, currentPackage,
null,
- (PackageDoc[])importedPackagesList.toArray(new PackageDoc[0]),
+ importedPackagesList.toArray(new PackageDoc[importedPackagesList.size()]),
source, startIndex, endIndex,
importedStatementList);
@@ -921,11 +937,11 @@ public class Parser {
}
if (importedClassesList.isEmpty()) {
- for (Iterator it=importedStringList.iterator(); it.hasNext(); ) {
- importedClassesList.add(new ClassDocProxy((String)it.next(), classDoc));
+ for (Iterator<String> it=importedStringList.iterator(); it.hasNext(); ) {
+ importedClassesList.add(new ClassDocProxy(it.next(), classDoc));
}
}
- classDoc.setImportedClasses((ClassDoc[])importedClassesList.toArray(new ClassDoc[0]));
+ classDoc.setImportedClasses(importedClassesList.toArray(new ClassDoc[importedClassesList.size()]));
currentPackage.addClass(classDoc);
@@ -945,26 +961,24 @@ public class Parser {
//Debug.log(9,"ctx="+ctx);
}
- private Doc[] toArray(List list, Doc[] template)
+ private <T> T[] toArray(List<T> list, T[] template)
{
- Doc[] result = (Doc[])list.toArray(template);
- return result;
+ return list.toArray(template);
}
void classClosed() throws ParseException, IOException {
- ctx.classDoc.setFields((FieldDoc[])toArray(ctx.fieldList,
- new FieldDoc[0]));
- ctx.classDoc.setFilteredFields((FieldDoc[])toArray(ctx.filteredFieldList,
- new FieldDoc[0]));
- ctx.classDoc.setSerializableFields((FieldDoc[])toArray(ctx.sfieldList, new FieldDoc[0]));
- ctx.classDoc.setMethods((MethodDoc[])toArray(ctx.methodList, new MethodDoc[0]));
- ctx.classDoc.setFilteredMethods((MethodDoc[])toArray(ctx.filteredMethodList, new MethodDoc[0]));
+ ctx.classDoc.setFields(toArray(ctx.fieldList,new FieldDoc[ctx.fieldList.size()]));
+ ctx.classDoc.setFilteredFields(toArray(ctx.filteredFieldList,new FieldDoc[ctx.filteredFieldList.size()]));
+ ctx.classDoc.setSerializableFields(toArray(ctx.sfieldList, new FieldDoc[ctx.sfieldList.size()]));
+ ctx.classDoc.setMethods(toArray(ctx.methodList, new MethodDoc[ctx.methodList.size()]));
+ ctx.classDoc.setFilteredMethods(toArray(ctx.filteredMethodList, new MethodDoc[ctx.filteredMethodList.size()]));
ctx.classDoc.setMaybeSerMethodList(ctx.maybeSerMethodList);
- ctx.classDoc.setConstructors((ConstructorDoc[])toArray(ctx.constructorList, new ConstructorDoc[0]));
- ctx.classDoc.setFilteredConstructors((ConstructorDoc[])toArray(ctx.filteredConstructorList, new ConstructorDoc[0]));
-
- ctx.classDoc.setInnerClasses((ClassDocImpl[])toArray(ctx.innerClassesList, new ClassDocImpl[0]));
- ctx.classDoc.setFilteredInnerClasses((ClassDocImpl[])toArray(ctx.filteredInnerClassesList, new ClassDocImpl[0]));
+ ctx.classDoc.setConstructors(toArray(ctx.constructorList, new ConstructorDoc[ctx.constructorList.size()]));
+ ctx.classDoc.setFilteredConstructors(toArray(ctx.filteredConstructorList,
+ new ConstructorDoc[ctx.filteredConstructorList.size()]));
+ ctx.classDoc.setInnerClasses(toArray(ctx.innerClassesList, new ClassDocImpl[ctx.innerClassesList.size()]));
+ ctx.classDoc.setFilteredInnerClasses(toArray(ctx.filteredInnerClassesList,
+ new ClassDocImpl[ctx.filteredInnerClassesList.size()]));
ctx.classDoc.setBoilerplateComment(boilerplateComment);
Main.getRootDoc().addClassDoc(ctx.classDoc);
@@ -993,16 +1007,16 @@ public class Parser {
class Context {
Context(ClassDocImpl classDoc) { this.classDoc=classDoc; }
ClassDocImpl classDoc = null;
- List fieldList = new LinkedList();
- List filteredFieldList = new LinkedList();
- List sfieldList = new LinkedList();
- List methodList = new LinkedList();
- List filteredMethodList = new LinkedList();
- List maybeSerMethodList = new LinkedList();
- List constructorList = new LinkedList();
- List filteredConstructorList = new LinkedList();
- List innerClassesList = new LinkedList();
- List filteredInnerClassesList = new LinkedList();
+ List<FieldDoc> fieldList = new LinkedList<FieldDoc>();
+ List<FieldDoc> filteredFieldList = new LinkedList<FieldDoc>();
+ List<FieldDoc> sfieldList = new LinkedList<FieldDoc>();
+ List<MethodDoc> methodList = new LinkedList<MethodDoc>();
+ List<MethodDoc> filteredMethodList = new LinkedList<MethodDoc>();
+ List<MethodDoc> maybeSerMethodList = new LinkedList<MethodDoc>();
+ List<ConstructorDoc> constructorList = new LinkedList<ConstructorDoc>();
+ List<ConstructorDoc> filteredConstructorList = new LinkedList<ConstructorDoc>();
+ List<ClassDocImpl> innerClassesList = new LinkedList<ClassDocImpl>();
+ List<ClassDocImpl> filteredInnerClassesList = new LinkedList<ClassDocImpl>();
}
File currentFile = null;
@@ -1016,10 +1030,10 @@ public class Parser {
List allClassesList = new LinkedList();
List interfacesList = new LinkedList();
- List importedClassesList = new LinkedList();
- List importedStringList = new LinkedList();
- List importedPackagesList = new LinkedList();
- List importedStatementList = new LinkedList();
+ List<ClassDoc> importedClassesList = new LinkedList<ClassDoc>();
+ List<String> importedStringList = new LinkedList<String>();
+ List<PackageDoc> importedPackagesList = new LinkedList<PackageDoc>();
+ List<String> importedStatementList = new LinkedList<String>();
List referencedClassesList = new LinkedList();
diff --git a/tools/gnu/classpath/tools/gjdoc/RootDocImpl.java b/tools/gnu/classpath/tools/gjdoc/RootDocImpl.java
index 09d1be73b..dd76ffada 100644
--- a/tools/gnu/classpath/tools/gjdoc/RootDocImpl.java
+++ b/tools/gnu/classpath/tools/gjdoc/RootDocImpl.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.RootDocImpl
- Copyright (C) 2001, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2007, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -409,11 +409,11 @@ public class RootDocImpl
}
}
- List findSourceFiles(String relPath) {
+ List<File> findSourceFiles(String relPath) {
- List result = new LinkedList();
- for (Iterator it = sourcePath.iterator(); it.hasNext(); ) {
- File path = (File)it.next();
+ List<File> result = new LinkedList<File>();
+ for (Iterator<File> it = sourcePath.iterator(); it.hasNext(); ) {
+ File path = it.next();
File file = new File(path, relPath);
if (file.exists()) {
result.add(file);
diff --git a/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java b/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java
index d12da3519..efa88603c 100644
--- a/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java
+++ b/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.expr.Evaluator
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,6 +37,8 @@ exception statement from your version. */
package gnu.classpath.tools.gjdoc.expr;
+import com.sun.javadoc.FieldDoc;
+
import java.io.StringReader;
import java.math.BigInteger;
import antlr.RecognitionException;
@@ -68,7 +70,7 @@ public class Evaluator
* array access) or references unknown static fields.
*/
public static Object evaluate(String expression,
- Set visitedFields,
+ Set<FieldDoc> visitedFields,
EvaluatorEnvironment environment)
throws IllegalExpressionException
{
diff --git a/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java b/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java
index cf4df8938..cdb1f9048 100644
--- a/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java
+++ b/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.expr.EvaluatorEnvironment
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,10 +37,12 @@ exception statement from your version. */
package gnu.classpath.tools.gjdoc.expr;
+import com.sun.javadoc.FieldDoc;
+
import java.util.Set;
public interface EvaluatorEnvironment
{
- public Object getValue(String identifier, Set visitedFields)
+ public Object getValue(String identifier, Set<FieldDoc> visitedFields)
throws IllegalExpressionException, UnknownIdentifierException;
}
diff --git a/tools/gnu/classpath/tools/gjdoc/expr/Type.java b/tools/gnu/classpath/tools/gjdoc/expr/Type.java
index 92382c41a..4e0ef0ea4 100644
--- a/tools/gnu/classpath/tools/gjdoc/expr/Type.java
+++ b/tools/gnu/classpath/tools/gjdoc/expr/Type.java
@@ -1,5 +1,5 @@
/* gnu.classpath.tools.gjdoc.expr.Type
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,9 +51,9 @@ class Type
public static final Type STRING = new Type(String.class);
public static final Type NULL = new Type(null);
- private Class clazz;
+ private Class<?> clazz;
- private Type(Class clazz)
+ private Type(Class<?> clazz)
{
this.clazz = clazz;
}
diff --git a/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java b/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java
index 9ac103c75..790407bae 100644
--- a/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java
+++ b/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java
@@ -1,5 +1,5 @@
/* ClassRmicCompiler.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+ Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2012
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,26 +76,23 @@ public class ClassRmicCompiler
{
private String[] args;
private int next;
- private List errors = new ArrayList();
- private boolean keep = false;
+ private List<Exception> errors = new ArrayList<Exception>();
private boolean need11Stubs = true;
private boolean need12Stubs = true;
- private boolean compile = true;
private boolean verbose;
private boolean noWrite;
private String destination;
- private String classpath;
private ClassLoader loader;
private int errorCount = 0;
- private Class clazz;
+ private Class<?> clazz;
private String classname;
private String classInternalName;
private String fullclassname;
private MethodRef[] remotemethods;
private String stubname;
private String skelname;
- private List mRemoteInterfaces;
+ private List<Class<?>> mRemoteInterfaces;
/**
* @return true if run was successful
@@ -126,9 +123,9 @@ public class ClassRmicCompiler
}
if (errors.size() > 0)
{
- for (Iterator it = errors.iterator(); it.hasNext(); )
+ for (Iterator<Exception> it = errors.iterator(); it.hasNext(); )
{
- Exception ex = (Exception) it.next();
+ Exception ex = it.next();
logError(ex);
}
}
@@ -146,7 +143,7 @@ public class ClassRmicCompiler
remotemethods = null;
stubname = null;
skelname = null;
- mRemoteInterfaces = new ArrayList();
+ mRemoteInterfaces = new ArrayList<Class<?>>();
analyzeClass(cls);
generateStub();
@@ -175,7 +172,7 @@ public class ClassRmicCompiler
*/
public Exception getException()
{
- return errors.size() == 0 ? null : (Exception) errors.get(0);
+ return errors.size() == 0 ? null : errors.get(0);
}
private void findClass()
@@ -202,7 +199,7 @@ public class ClassRmicCompiler
}
}
- private static Type[] typeArray(Class[] cls)
+ private static Type[] typeArray(Class<?>[] cls)
{
Type[] t = new Type[cls.length];
for (int i = 0; i < cls.length; i++)
@@ -231,11 +228,11 @@ public class ClassRmicCompiler
private static final String forName = "class$";
- private static Object param(Method m, int argIndex)
+ private static List<Object> param(Method m, int argIndex)
{
- List l = new ArrayList();
+ List<Object> l = new ArrayList<Object>();
l.add(m);
- l.add(new Integer(argIndex));
+ l.add(Integer.valueOf(argIndex));
return l;
}
@@ -283,10 +280,10 @@ public class ClassRmicCompiler
cv.visitMaxs(-1, -1);
}
- private void generateClassConstant(MethodVisitor cv, Class cls) {
+ private void generateClassConstant(MethodVisitor cv, Class<?> cls) {
if (cls.isPrimitive())
{
- Class boxCls;
+ Class<?> boxCls;
if (cls.equals(Boolean.TYPE))
boxCls = Boolean.class;
else if (cls.equals(Character.TYPE))
@@ -321,7 +318,7 @@ public class ClassRmicCompiler
new Type[] { Type.getType(String.class) }));
}
- private void generateClassArray(MethodVisitor code, Class[] classes)
+ private void generateClassArray(MethodVisitor code, Class<?>[] classes)
{
code.visitLdcInsn(new Integer(classes.length));
code.visitTypeInsn(Opcodes.ANEWARRAY, typeArg(Class.class));
@@ -352,7 +349,7 @@ public class ClassRmicCompiler
desc.append(m.getName() + "(");
// signature
- Class[] sig = m.getParameterTypes();
+ Class<?>[] sig = m.getParameterTypes();
for (int j = 0; j < sig.length; j++)
{
desc.append(getPrettyName(sig[j]));
@@ -418,7 +415,6 @@ public class ClassRmicCompiler
throws IOException
{
stubname = fullclassname + "_Stub";
- String stubclassname = classname + "_Stub";
File file = new File((destination == null ? "." : destination)
+ File.separator
+ stubname.replace('.', File.separatorChar)
@@ -433,7 +429,7 @@ public class ClassRmicCompiler
Type.getType(RemoteStub.class).getInternalName();
String[] remoteInternalNames =
- internalNameArray((Class[]) mRemoteInterfaces.toArray(new Class[] {}));
+ internalNameArray(mRemoteInterfaces.toArray(new Class[mRemoteInterfaces.size()]));
stub.visit
(Opcodes.V1_2, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL, classInternalName,
null, superInternalName, remoteInternalNames);
@@ -601,10 +597,10 @@ public class ClassRmicCompiler
for (int i = 0; i < remotemethods.length; i++)
{
Method m = remotemethods[i].meth;
- Class[] sig = m.getParameterTypes();
- Class returntype = m.getReturnType();
- Class[] except = sortExceptions
- ((Class[]) remotemethods[i].exceptions.toArray(new Class[0]));
+ Class<?>[] sig = m.getParameterTypes();
+ Class<?> returntype = m.getReturnType();
+ Class<?>[] except = sortExceptions
+ (remotemethods[i].exceptions.toArray(new Class<?>[remotemethods[i].exceptions.size()]));
MethodVisitor code = stub.visitMethod
(Opcodes.ACC_PUBLIC,
@@ -664,9 +660,8 @@ public class ClassRmicCompiler
for (int j = 0; j < sig.length; j++)
{
- int size = size(sig[j]);
int insn = loadOpcode(sig[j]);
- Class box = sig[j].isPrimitive() ? box(sig[j]) : null;
+ Class<?> box = sig[j].isPrimitive() ? box(sig[j]) : null;
code.visitVarInsn(Opcodes.ALOAD, var.get("argArray"));
code.visitLdcInsn(new Integer(j));
@@ -695,7 +690,7 @@ public class ClassRmicCompiler
}
// push remote operation opcode
- code.visitLdcInsn(new Long(remotemethods[i].hash));
+ code.visitLdcInsn(Long.valueOf(remotemethods[i].hash));
code.visitMethodInsn
(Opcodes.INVOKEINTERFACE,
Type.getInternalName(RemoteRef.class),
@@ -710,7 +705,7 @@ public class ClassRmicCompiler
if (! returntype.equals(Void.TYPE))
{
int retcode = returnOpcode(returntype);
- Class boxCls =
+ Class<?> boxCls =
returntype.isPrimitive() ? box(returntype) : null;
code.visitTypeInsn
(Opcodes.CHECKCAST, typeArg(boxCls == null ? returntype : boxCls));
@@ -797,7 +792,7 @@ public class ClassRmicCompiler
// get j'th arg to remote method
code.visitVarInsn(loadOpcode(sig[j]), var.get(param(m, j)));
- Class argCls =
+ Class<?> argCls =
sig[j].isPrimitive() ? sig[j] : Object.class;
// out.writeFoo
@@ -872,7 +867,7 @@ public class ClassRmicCompiler
Type.getMethodDescriptor
(Type.getType(ObjectInput.class), new Type[] {}));
- Class readCls =
+ Class<?> readCls =
returntype.isPrimitive() ? returntype : Object.class;
code.visitMethodInsn
(Opcodes.INVOKEINTERFACE,
@@ -936,8 +931,6 @@ public class ClassRmicCompiler
Type.getType(Exception.class) }));
code.visitInsn(Opcodes.ATHROW);
- Label endReturnTryCatch = new Label();
-
// catch IOException
code.visitTryCatchBlock
(beginReturnTryCatch, handler, handler,
@@ -1024,7 +1017,6 @@ public class ClassRmicCompiler
private void generateSkel() throws IOException
{
skelname = fullclassname + "_Skel";
- String skelclassname = classname + "_Skel";
File file = new File(destination == null ? "" : destination
+ File.separator
+ skelname.replace('.', File.separatorChar)
@@ -1119,7 +1111,7 @@ public class ClassRmicCompiler
{
// assign opnum if hash matches supplied hash
dispatch.visitVarInsn(Opcodes.LLOAD, var.get("hash"));
- dispatch.visitLdcInsn(new Long(remotemethods[i].hash));
+ dispatch.visitLdcInsn(Long.valueOf(remotemethods[i].hash));
Label notIt = new Label();
dispatch.visitInsn(Opcodes.LCMP);
dispatch.visitJumpInsn(Opcodes.IFNE, notIt);
@@ -1214,7 +1206,7 @@ public class ClassRmicCompiler
private void generateMethodSkel(MethodVisitor cv, Method m, Variables var)
{
- Class[] sig = m.getParameterTypes();
+ Class<?>[] sig = m.getParameterTypes();
Label readArgs = new Label();
cv.visitLabel(readArgs);
@@ -1235,7 +1227,7 @@ public class ClassRmicCompiler
// dup input stream
cv.visitVarInsn(Opcodes.ALOAD, var.get("objectinput"));
- Class readCls = sig[i].isPrimitive() ? sig[i] : Object.class;
+ Class<?> readCls = sig[i].isPrimitive() ? sig[i] : Object.class;
// in.readFoo()
cv.visitMethodInsn
@@ -1314,7 +1306,7 @@ public class ClassRmicCompiler
(Opcodes.INVOKEVIRTUAL, Type.getInternalName(clazz), m.getName(),
Type.getMethodDescriptor(m));
- Class returntype = m.getReturnType();
+ Class<?> returntype = m.getReturnType();
if (! returntype.equals(Void.TYPE))
{
cv.visitVarInsn
@@ -1338,7 +1330,7 @@ public class ClassRmicCompiler
{
// out.writeFoo(result)
cv.visitVarInsn(loadOpcode(returntype), var.deallocate("result"));
- Class writeCls = returntype.isPrimitive() ? returntype : Object.class;
+ Class<?> writeCls = returntype.isPrimitive() ? returntype : Object.class;
cv.visitMethodInsn
(Opcodes.INVOKEINTERFACE,
Type.getInternalName(ObjectOutput.class),
@@ -1370,7 +1362,7 @@ public class ClassRmicCompiler
Type.getInternalName(IOException.class));
}
- private static String typeArg(Class cls)
+ private static String typeArg(Class<?> cls)
{
if (cls.isArray())
return Type.getDescriptor(cls);
@@ -1378,7 +1370,7 @@ public class ClassRmicCompiler
return Type.getInternalName(cls);
}
- private static String readMethod(Class cls)
+ private static String readMethod(Class<?> cls)
{
if (cls.equals(Void.TYPE))
throw new IllegalArgumentException("can not read void");
@@ -1406,7 +1398,7 @@ public class ClassRmicCompiler
return method;
}
- private static String writeMethod(Class cls)
+ private static String writeMethod(Class<?> cls)
{
if (cls.equals(Void.TYPE))
throw new IllegalArgumentException("can not read void");
@@ -1434,7 +1426,7 @@ public class ClassRmicCompiler
return method;
}
- private static int returnOpcode(Class cls)
+ private static int returnOpcode(Class<?> cls)
{
int returncode;
if (cls.equals(Boolean.TYPE))
@@ -1461,7 +1453,7 @@ public class ClassRmicCompiler
return returncode;
}
- private static int loadOpcode(Class cls)
+ private static int loadOpcode(Class<?> cls)
{
if (cls.equals(Void.TYPE))
throw new IllegalArgumentException("can not load void");
@@ -1489,7 +1481,7 @@ public class ClassRmicCompiler
return loadcode;
}
- private static int storeOpcode(Class cls)
+ private static int storeOpcode(Class<?> cls)
{
if (cls.equals(Void.TYPE))
throw new IllegalArgumentException("can not load void");
@@ -1517,7 +1509,7 @@ public class ClassRmicCompiler
return storecode;
}
- private static String unboxMethod(Class primitive)
+ private static String unboxMethod(Class<?> primitive)
{
if (! primitive.isPrimitive())
throw new IllegalArgumentException("can not unbox nonprimitive");
@@ -1545,12 +1537,12 @@ public class ClassRmicCompiler
return method;
}
- public static Class box(Class cls)
+ public static Class<?> box(Class<?> cls)
{
if (! cls.isPrimitive())
throw new IllegalArgumentException("can only box primitive");
- Class box;
+ Class<?> box;
if (cls.equals(Boolean.TYPE))
box = Boolean.class;
else if (cls.equals(Byte.TYPE))
@@ -1573,7 +1565,7 @@ public class ClassRmicCompiler
return box;
}
- private static int size(Class cls) {
+ private static int size(Class<?> cls) {
if (cls.equals(Long.TYPE) || cls.equals(Double.TYPE))
return 2;
else
@@ -1583,7 +1575,7 @@ public class ClassRmicCompiler
/**
* Sort exceptions so the most general go last.
*/
- private Class[] sortExceptions(Class[] except)
+ private Class<?>[] sortExceptions(Class<?>[] except)
{
for (int i = 0; i < except.length; i++)
{
@@ -1591,7 +1583,7 @@ public class ClassRmicCompiler
{
if (except[i].isAssignableFrom(except[j]))
{
- Class tmp = except[i];
+ Class<?> tmp = except[i];
except[i] = except[j];
except[j] = tmp;
}
@@ -1605,14 +1597,12 @@ public class ClassRmicCompiler
boolean noWrite, boolean verbose, boolean force, String classpath,
String bootclasspath, String extdirs, String outputDirectory)
{
- this.keep = keep;
this.need11Stubs = need11Stubs;
this.need12Stubs = need12Stubs;
this.verbose = verbose;
this.noWrite = noWrite;
// Set up classpath.
- this.classpath = classpath;
StringTokenizer st =
new StringTokenizer(classpath, File.pathSeparator);
URL[] u = new URL[st.countTokens()];
@@ -1638,15 +1628,15 @@ public class ClassRmicCompiler
private void findRemoteMethods()
throws RMICException
{
- List rmeths = new ArrayList();
- for (Class cur = clazz; cur != null; cur = cur.getSuperclass())
+ List<Method> rmeths = new ArrayList<Method>();
+ for (Class<?> cur = clazz; cur != null; cur = cur.getSuperclass())
{
- Class[] interfaces = cur.getInterfaces();
+ Class<?>[] interfaces = cur.getInterfaces();
for (int i = 0; i < interfaces.length; i++)
{
if (java.rmi.Remote.class.isAssignableFrom(interfaces[i]))
{
- Class remoteInterface = interfaces[i];
+ Class<?> remoteInterface = interfaces[i];
if (verbose)
System.out.println
("[implements " + remoteInterface.getName() + "]");
@@ -1684,11 +1674,11 @@ public class ClassRmicCompiler
boolean[] skip = new boolean[rmeths.size()];
for (int i = 0; i < skip.length; i++)
skip[i] = false;
- List methrefs = new ArrayList();
+ List<MethodRef> methrefs = new ArrayList<MethodRef>();
for (int i = 0; i < rmeths.size(); i++)
{
if (skip[i]) continue;
- Method current = (Method) rmeths.get(i);
+ Method current = rmeths.get(i);
MethodRef ref = new MethodRef(current);
for (int j = i+1; j < rmeths.size(); j++)
{
@@ -1703,7 +1693,7 @@ public class ClassRmicCompiler
}
// Convert into a MethodRef array and sort them
- remotemethods = (MethodRef[])
+ remotemethods =
methrefs.toArray(new MethodRef[methrefs.size()]);
Arrays.sort(remotemethods);
}
@@ -1748,7 +1738,7 @@ public class ClassRmicCompiler
{
Method meth;
long hash;
- List exceptions;
+ List<Class<?>> exceptions;
private String sig;
MethodRef(Method m) {
@@ -1784,12 +1774,12 @@ public class ClassRmicCompiler
return true;
}
- private static List removeSubclasses(Class[] classes)
+ private static List<Class<?>> removeSubclasses(Class<?>[] classes)
{
- List list = new ArrayList();
+ List<Class<?>> list = new ArrayList<Class<?>>();
for (int i = 0; i < classes.length; i++)
{
- Class candidate = classes[i];
+ Class<?> candidate = classes[i];
boolean add = true;
for (int j = 0; j < classes.length; j++)
{
@@ -1806,17 +1796,17 @@ public class ClassRmicCompiler
public void intersectExceptions(Method m)
{
- List incoming = removeSubclasses(m.getExceptionTypes());
+ List<Class<?>> incoming = removeSubclasses(m.getExceptionTypes());
- List updated = new ArrayList();
+ List<Class<?>> updated = new ArrayList<Class<?>>();
for (int i = 0; i < exceptions.size(); i++)
{
- Class outer = (Class) exceptions.get(i);
+ Class<?> outer = exceptions.get(i);
boolean addOuter = false;
for (int j = 0; j < incoming.size(); j++)
{
- Class inner = (Class) incoming.get(j);
+ Class<?> inner = incoming.get(j);
if (inner.equals(outer) || inner.isAssignableFrom(outer))
addOuter = true;
diff --git a/tools/gnu/classpath/tools/rmic/Main.java b/tools/gnu/classpath/tools/rmic/Main.java
index 868fc758e..02f72441a 100644
--- a/tools/gnu/classpath/tools/rmic/Main.java
+++ b/tools/gnu/classpath/tools/rmic/Main.java
@@ -1,5 +1,5 @@
/* Main.java -- RMI stub generator.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -236,7 +236,7 @@ public class Main
System.exit(1);
}
- ArrayList backends = new ArrayList();
+ ArrayList<RmicBackend> backends = new ArrayList<RmicBackend>();
// FIXME: need an IDL RmicBackend
// FIXME: need a ClassGiopRmicCompiler RmicBackend
@@ -262,7 +262,7 @@ public class Main
for (int i = 0; i < backends.size(); i++)
{
- RmicBackend b = (RmicBackend) backends.get(i);
+ RmicBackend b = backends.get(i);
b.setup(keep, need11Stubs, need12Stubs,
iiop, poa, false, warnings,
noWrite, verbose, force, classpath,
diff --git a/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java b/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java
index e02f086ef..d533f1220 100644
--- a/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java
+++ b/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java
@@ -86,7 +86,7 @@ public class RmiMethodGenerator
{
StringBuilder b = new StringBuilder();
- Class[] args = method.getParameterTypes();
+ Class<?>[] args = method.getParameterTypes();
for (int i = 0; i < args.length; i++)
{
@@ -108,7 +108,7 @@ public class RmiMethodGenerator
{
StringBuilder b = new StringBuilder();
- Class[] args = method.getParameterTypes();
+ Class<?>[] args = method.getParameterTypes();
for (int i = 0; i < args.length; i++)
{
@@ -128,7 +128,7 @@ public class RmiMethodGenerator
{
StringBuilder b = new StringBuilder();
- Class[] args = method.getExceptionTypes();
+ Class<?>[] args = method.getExceptionTypes();
for (int i = 0; i < args.length; i++)
{
@@ -184,7 +184,7 @@ public class RmiMethodGenerator
public String getStaticMethodDeclarations()
{
StringBuilder b = new StringBuilder();
- Class[] args = method.getParameterTypes();
+ Class<?>[] args = method.getParameterTypes();
for (int i = 0; i < args.length; i++)
{
diff --git a/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java b/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
index dd35c2bd5..cf1b0b679 100644
--- a/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
+++ b/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
@@ -1,5 +1,5 @@
/* SourceGiopRmicCompiler -- Central GIOP-based RMI stub and tie compiler class.
- Copyright (C) 2006, 2008 Free Software Foundation
+ Copyright (C) 2006, 2008, 2012 Free Software Foundation
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import java.util.TreeSet;
* @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
*/
public class SourceGiopRmicCompiler
- extends Generator implements Comparator, RmicBackend
+ extends Generator implements Comparator<AbstractMethodGenerator>, RmicBackend
{
/** The package name. */
protected String packag;
@@ -74,17 +74,18 @@ public class SourceGiopRmicCompiler
/**
* The Remote's, implemented by this class.
*/
- protected Collection implementedRemotes = new HashSet();
+ protected Collection<Class<?>> implementedRemotes = new HashSet<Class<?>>();
/**
* The extra classes that must be imported.
*/
- protected Collection extraImports = new HashSet();
+ protected Collection<String> extraImports = new HashSet<String>();
/**
* The methods we must implement.
*/
- protected Collection methods = new HashSet();
+ protected Collection<AbstractMethodGenerator> methods =
+ new HashSet<AbstractMethodGenerator>();
/**
* The map of all code generator variables.
@@ -228,7 +229,7 @@ public class SourceGiopRmicCompiler
* @param remote
* the class to compile.
*/
- public synchronized void compile(Class remote)
+ public synchronized void compile(Class<?> remote)
{
reset();
String s;
@@ -261,7 +262,7 @@ public class SourceGiopRmicCompiler
+ implName);
// Get the implemented remotes.
- Class[] interfaces = remote.getInterfaces();
+ Class<?>[] interfaces = remote.getInterfaces();
for (int i = 0; i < interfaces.length; i++)
{
@@ -277,11 +278,11 @@ public class SourceGiopRmicCompiler
vars.put("#idList", getIdList(implementedRemotes));
// Collect and process methods.
- Iterator iter = implementedRemotes.iterator();
+ Iterator<Class<?>> iter = implementedRemotes.iterator();
while (iter.hasNext())
{
- Class c = (Class) iter.next();
+ Class<?> c = iter.next();
Method[] m = c.getMethods();
// Check if throws RemoteException.
@@ -374,7 +375,7 @@ public class SourceGiopRmicCompiler
* the interface, for that the repository Id must be created.
* @return the repository id
*/
- public String getId(Class c)
+ public String getId(Class<?> c)
{
return "RMI:" + c.getName() + ":0000000000000000";
}
@@ -386,25 +387,25 @@ public class SourceGiopRmicCompiler
* the collection of interfaces
* @return the fully formatted string array.
*/
- public String getIdList(Collection remotes)
+ public String getIdList(Collection<Class<?>> remotes)
{
StringBuilder b = new StringBuilder();
// Keep the Ids sorted, ensuring, that the same order will be preserved
// between compilations.
- TreeSet sortedIds = new TreeSet();
+ TreeSet<String> sortedIds = new TreeSet<String>();
- Iterator iter = remotes.iterator();
+ Iterator<Class<?>> iter = remotes.iterator();
while (iter.hasNext())
{
- sortedIds.add(getId((Class) iter.next()));
+ sortedIds.add(getId(iter.next()));
}
- iter = sortedIds.iterator();
- while (iter.hasNext())
+ Iterator<String> iterIds = sortedIds.iterator();
+ while (iterIds.hasNext())
{
- b.append(" \"" + iter.next() + "\"");
- if (iter.hasNext())
+ b.append(" \"" + iterIds.next() + "\"");
+ if (iterIds.hasNext())
b.append(", \n");
}
return b.toString();
@@ -421,10 +422,10 @@ public class SourceGiopRmicCompiler
// Generate methods.
StringBuilder b = new StringBuilder();
- Iterator iter = methods.iterator();
+ Iterator<AbstractMethodGenerator> iter = methods.iterator();
while (iter.hasNext())
{
- AbstractMethodGenerator m = (AbstractMethodGenerator) iter.next();
+ AbstractMethodGenerator m = iter.next();
b.append(m.generateStubMethod());
}
@@ -474,7 +475,7 @@ public class SourceGiopRmicCompiler
HashFinder hashFinder = new HashFinder();
// Find the hash character position:
- Iterator iter = methods.iterator();
+ Iterator<AbstractMethodGenerator> iter = methods.iterator();
String[] names = new String[methods.size()];
int p = 0;
@@ -489,7 +490,8 @@ public class SourceGiopRmicCompiler
vars.put("#hashCharPos", Integer.toString(hashCharPosition));
- ArrayList sortedMethods = new ArrayList(methods);
+ ArrayList<AbstractMethodGenerator> sortedMethods =
+ new ArrayList<AbstractMethodGenerator>(methods);
Collections.sort(sortedMethods, this);
iter = sortedMethods.iterator();
@@ -515,10 +517,10 @@ public class SourceGiopRmicCompiler
return output;
}
- public int compare(Object a, Object b)
+ public int compare(AbstractMethodGenerator ag1, AbstractMethodGenerator ag2)
{
- MethodGenerator g1 = (MethodGenerator) a;
- MethodGenerator g2 = (MethodGenerator) b;
+ MethodGenerator g1 = (MethodGenerator) ag1;
+ MethodGenerator g2 = (MethodGenerator) ag2;
return g1.getHashChar() - g2.getHashChar();
}
@@ -530,12 +532,12 @@ public class SourceGiopRmicCompiler
*/
protected String getImportStatements()
{
- TreeSet imp = new TreeSet();
+ TreeSet<String> imp = new TreeSet<String>();
- Iterator it = extraImports.iterator();
+ Iterator<String> it = extraImports.iterator();
while (it.hasNext())
{
- String ic = it.next().toString();
+ String ic = it.next();
imp.add("import " + ic + ";\n");
}
diff --git a/tools/gnu/classpath/tools/rmic/Variables.java b/tools/gnu/classpath/tools/rmic/Variables.java
index 1fc6a8095..14ba6493a 100644
--- a/tools/gnu/classpath/tools/rmic/Variables.java
+++ b/tools/gnu/classpath/tools/rmic/Variables.java
@@ -1,6 +1,5 @@
/* Variables.java --
- Copyright (c) 2004, 2005
- Free Software Foundation, Inc.
+ Copyright (c) 2004, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,10 +43,10 @@ import java.util.Iterator;
class Variables
{
- private final HashSet free = new HashSet();
- private final HashMap names = new HashMap();
- private final HashSet wides = new HashSet();
- private final HashSet declared = new HashSet();
+ private final HashSet<Integer> free = new HashSet<Integer>();
+ private final HashMap<Object,Integer> names = new HashMap<Object,Integer>();
+ private final HashSet<Object> wides = new HashSet<Object>();
+ private final HashSet<Object> declared = new HashSet<Object>();
private boolean allocated = false;
public void declare(Object name)
@@ -77,7 +76,7 @@ class Variables
{
// total allocation size is first unallocated slot
int i = free.size() + names.size() + wides.size();
- names.put(name, new Integer(i));
+ names.put(name, Integer.valueOf(i));
if (size == 2) wides.add(name);
return i;
}
@@ -103,10 +102,10 @@ class Variables
if (size == 2)
{
// look for consecutive free slots
- for (Iterator it = free.iterator(); it.hasNext(); )
+ for (Iterator<Integer> it = free.iterator(); it.hasNext(); )
{
- Integer i = (Integer) it.next();
- Integer next = new Integer(i.intValue() + 1);
+ Integer i = it.next();
+ Integer next = Integer.valueOf(i.intValue() + 1);
if (free.contains(next))
{
free.remove(i);
@@ -119,7 +118,7 @@ class Variables
}
else if (free.size() > 0)
{
- Integer i = (Integer) free.iterator().next();
+ Integer i = free.iterator().next();
free.remove(i);
names.put(name, i);
return i.intValue();
@@ -136,11 +135,11 @@ class Variables
if (declared.contains(name))
throw new IllegalStateException(name + " can't be deallocated");
- Integer i = (Integer) names.get(name);
+ Integer i = names.get(name);
names.remove(name);
free.add(i);
if (wides.remove(name))
- free.add(new Integer(i.intValue() + 1));
+ free.add(Integer.valueOf(i.intValue() + 1));
return i.intValue();
}
@@ -149,6 +148,6 @@ class Variables
if (! names.containsKey(name))
throw new IllegalArgumentException("no variable " + name);
- return ((Integer) names.get(name)).intValue();
+ return names.get(name).intValue();
}
}