6765045: Remove rawtypes warnings from langtools

Removed all occurrences of rawtypes warnings from langtools

Reviewed-by: jjg, bpatel
This commit is contained in:
Maurizio Cimadamore 2009-01-13 13:27:14 +00:00
parent a23159ffac
commit 795b53a014
60 changed files with 229 additions and 231 deletions

View File

@ -66,7 +66,7 @@ javac.no.jdk.warnings = -XDignore.symbol.file=true
# set the following to -version to verify the versions of javac being used # set the following to -version to verify the versions of javac being used
javac.version.opt = javac.version.opt =
# in time, there should be no exceptions to -Xlint:all # in time, there should be no exceptions to -Xlint:all
javac.lint.opts = -Xlint:all,-deprecation,-fallthrough,-serial,-unchecked,-cast,-rawtypes javac.lint.opts = -Xlint:all,-deprecation,-fallthrough,-serial,-unchecked,-cast
# options for the <javadoc> task for javac # options for the <javadoc> task for javac
javadoc.jls3.url=http://java.sun.com/docs/books/jls/ javadoc.jls3.url=http://java.sun.com/docs/books/jls/

View File

@ -74,7 +74,7 @@ public abstract class Trees {
ClassLoader cl = arg.getClass().getClassLoader(); ClassLoader cl = arg.getClass().getClassLoader();
Class<?> c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl); Class<?> c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl);
argType = Class.forName(argType.getName(), false, cl); argType = Class.forName(argType.getName(), false, cl);
Method m = c.getMethod("instance", new Class[] { argType }); Method m = c.getMethod("instance", new Class<?>[] { argType });
return (Trees) m.invoke(null, new Object[] { arg }); return (Trees) m.invoke(null, new Object[] { arg });
} catch (Throwable e) { } catch (Throwable e) {
throw new AssertionError(e); throw new AssertionError(e);

View File

@ -281,7 +281,7 @@ public class Apt extends ListBuffer<Env<AttrContext>> {
// Discovery process // Discovery process
// List of annotation processory factory instances // List of annotation processory factory instances
java.util.Iterator providers = null; java.util.Iterator<AnnotationProcessorFactory> providers = null;
{ {
/* /*
* If a factory is provided by the user, the * If a factory is provided by the user, the

View File

@ -217,7 +217,7 @@ class AnnotationProxyMaker {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
public void visitEnum(Attribute.Enum e) { public void visitEnum(Attribute.Enum e) {
if (runtimeType.isEnum()) { if (runtimeType.isEnum()) {
String constName = e.value.toString(); String constName = e.value.toString();
@ -225,7 +225,7 @@ class AnnotationProxyMaker {
value = Enum.valueOf((Class)runtimeType, constName); value = Enum.valueOf((Class)runtimeType, constName);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
value = new EnumConstantNotPresentExceptionProxy( value = new EnumConstantNotPresentExceptionProxy(
(Class)runtimeType, constName); (Class<Enum<?>>)runtimeType, constName);
} }
} else { } else {
value = null; // indicates a type mismatch value = null; // indicates a type mismatch

View File

@ -130,8 +130,8 @@ class Constants {
append((EnumConstantDeclarationImpl) val); append((EnumConstantDeclarationImpl) val);
} else if (val instanceof AnnotationMirror) { } else if (val instanceof AnnotationMirror) {
append((AnnotationMirrorImpl) val); append((AnnotationMirrorImpl) val);
} else if (val instanceof Collection) { } else if (val instanceof Collection<?>) {
append((Collection) val); append((Collection<?>) val);
} else { } else {
appendUnquoted(val.toString()); appendUnquoted(val.toString());
} }
@ -234,7 +234,7 @@ class Constants {
* and separated by ", ". Useful for array-valued annotation * and separated by ", ". Useful for array-valued annotation
* elements. * elements.
*/ */
void append(Collection vals) { void append(Collection<?> vals) {
buf.append('{'); buf.append('{');
boolean first = true; boolean first = true;
for (Object val : vals) { for (Object val : vals) {

View File

@ -95,14 +95,14 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
* @param unicode Unicode for which member list information to be generated. * @param unicode Unicode for which member list information to be generated.
* @param memberlist List of members for the unicode character. * @param memberlist List of members for the unicode character.
*/ */
protected void generateContents(Character unicode, List memberlist) { protected void generateContents(Character unicode, List<? extends Doc> memberlist) {
anchor("_" + unicode + "_"); anchor("_" + unicode + "_");
h2(); h2();
strong(unicode.toString()); strong(unicode.toString());
h2End(); h2End();
dl(); dl();
for (int i = 0; i < memberlist.size(); i++) { for (int i = 0; i < memberlist.size(); i++) {
Doc element = (Doc)memberlist.get(i); Doc element = memberlist.get(i);
if (element instanceof MemberDoc) { if (element instanceof MemberDoc) {
printDescription((MemberDoc)element); printDescription((MemberDoc)element);
} else if (element instanceof ClassDoc) { } else if (element instanceof ClassDoc) {

View File

@ -317,7 +317,7 @@ public abstract class AbstractMemberWriter {
* format for listing the API. Call methods from the sub-class to complete * format for listing the API. Call methods from the sub-class to complete
* the generation. * the generation.
*/ */
protected void printDeprecatedAPI(List deprmembers, String headingKey) { protected void printDeprecatedAPI(List<Doc> deprmembers, String headingKey) {
if (deprmembers.size() > 0) { if (deprmembers.size() > 0) {
writer.tableIndexSummary(); writer.tableIndexSummary();
writer.tableHeaderStart("#CCCCFF"); writer.tableHeaderStart("#CCCCFF");
@ -377,12 +377,12 @@ public abstract class AbstractMemberWriter {
} }
} }
protected void navDetailLink(List members) { protected void navDetailLink(List<?> members) {
printNavDetailLink(members.size() > 0? true: false); printNavDetailLink(members.size() > 0? true: false);
} }
protected void navSummaryLink(List members, protected void navSummaryLink(List<?> members,
VisibleMemberMap visibleMemberMap) { VisibleMemberMap visibleMemberMap) {
if (members.size() > 0) { if (members.size() > 0) {
printNavSummaryLink(null, true); printNavSummaryLink(null, true);
@ -390,7 +390,7 @@ public abstract class AbstractMemberWriter {
} else { } else {
ClassDoc icd = classdoc.superclass(); ClassDoc icd = classdoc.superclass();
while (icd != null) { while (icd != null) {
List inhmembers = visibleMemberMap.getMembersFor(icd); List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
if (inhmembers.size() > 0) { if (inhmembers.size() > 0) {
printNavSummaryLink(icd, true); printNavSummaryLink(icd, true);
return; return;

View File

@ -96,12 +96,12 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
* @param list list of the sub-classes at this level. * @param list list of the sub-classes at this level.
* @param isEnum true if we are generating a tree for enums. * @param isEnum true if we are generating a tree for enums.
*/ */
protected void generateLevelInfo(ClassDoc parent, List list, protected void generateLevelInfo(ClassDoc parent, List<ClassDoc> list,
boolean isEnum) { boolean isEnum) {
if (list.size() > 0) { if (list.size() > 0) {
ul(); ul();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
ClassDoc local = (ClassDoc)list.get(i); ClassDoc local = list.get(i);
printPartialInfo(local); printPartialInfo(local);
printExtendsImplements(parent, local); printExtendsImplements(parent, local);
generateLevelInfo(local, classtree.subs(local, isEnum), generateLevelInfo(local, classtree.subs(local, isEnum),
@ -119,9 +119,9 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
* other classes in this run will derive from these classes. * other classes in this run will derive from these classes.
* @param heading Heading for the tree. * @param heading Heading for the tree.
*/ */
protected void generateTree(List list, String heading) { protected void generateTree(List<ClassDoc> list, String heading) {
if (list.size() > 0) { if (list.size() > 0) {
ClassDoc firstClassDoc = (ClassDoc)list.get(0); ClassDoc firstClassDoc = list.get(0);
printTreeHeading(heading); printTreeHeading(heading);
generateLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null, generateLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null,
list, list,

View File

@ -137,9 +137,9 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
* @param classlist Sorted list of classes. * @param classlist Sorted list of classes.
* @param wantFrames True if we want frames. * @param wantFrames True if we want frames.
*/ */
protected void generateContents(List classlist, boolean wantFrames) { protected void generateContents(List<Doc> classlist, boolean wantFrames) {
for (int i = 0; i < classlist.size(); i++) { for (int i = 0; i < classlist.size(); i++) {
ClassDoc cd = (ClassDoc)(classlist.get(i)); ClassDoc cd = (ClassDoc)classlist.get(i);
if (!Util.isCoreClass(cd)) { if (!Util.isCoreClass(cd)) {
continue; continue;
} }

View File

@ -38,7 +38,7 @@ import java.util.*;
public class ClassUseWriter extends SubWriterHolderWriter { public class ClassUseWriter extends SubWriterHolderWriter {
final ClassDoc classdoc; final ClassDoc classdoc;
Set pkgToPackageAnnotations = null; Set<PackageDoc> pkgToPackageAnnotations = null;
final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations; final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter; final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
@ -220,8 +220,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
false))); false)));
tableHeaderEnd(); tableHeaderEnd();
for (Iterator it = pkgSet.iterator(); it.hasNext();) { for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
PackageDoc pkg = (PackageDoc)it.next(); PackageDoc pkg = it.next();
generatePackageUse(pkg); generatePackageUse(pkg);
} }
tableEnd(); tableEnd();
@ -240,8 +240,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
false))); false)));
tableHeaderEnd(); tableHeaderEnd();
for (Iterator it = pkgToPackageAnnotations.iterator(); it.hasNext();) { for (Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator(); it.hasNext();) {
PackageDoc pkg = (PackageDoc)it.next(); PackageDoc pkg = it.next();
trBgcolorStyle("white", "TableRowColor"); trBgcolorStyle("white", "TableRowColor");
summaryRow(0); summaryRow(0);
//Just want an anchor here. //Just want an anchor here.
@ -259,8 +259,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
} }
protected void generateClassList() throws IOException { protected void generateClassList() throws IOException {
for (Iterator it = pkgSet.iterator(); it.hasNext();) { for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
PackageDoc pkg = (PackageDoc)it.next(); PackageDoc pkg = it.next();
anchor(pkg.name()); anchor(pkg.name());
tableIndexSummary(); tableIndexSummary();
tableHeaderStart("#CCCCFF"); tableHeaderStart("#CCCCFF");

View File

@ -355,7 +355,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
classDoc.qualifiedName().equals("org.omg.CORBA.Object")) { classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
return; // Don't generate the list, too huge return; // Don't generate the list, too huge
} }
List subclasses = classtree.subs(classDoc, false); List<ClassDoc> subclasses = classtree.subs(classDoc, false);
if (subclasses.size() > 0) { if (subclasses.size() > 0) {
dl(); dl();
dt(); dt();
@ -371,7 +371,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
*/ */
public void writeSubInterfacesInfo() { public void writeSubInterfacesInfo() {
if (classDoc.isInterface()) { if (classDoc.isInterface()) {
List subInterfaces = classtree.allSubs(classDoc, false); List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false);
if (subInterfaces.size() > 0) { if (subInterfaces.size() > 0) {
dl(); dl();
dt(); dt();
@ -393,7 +393,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
classDoc.qualifiedName().equals("java.io.Serializable")) { classDoc.qualifiedName().equals("java.io.Serializable")) {
return; // Don't generate the list, too big return; // Don't generate the list, too big
} }
List implcl = classtree.implementingclasses(classDoc); List<ClassDoc> implcl = classtree.implementingclasses(classDoc);
if (implcl.size() > 0) { if (implcl.size() > 0) {
dl(); dl();
dt(); dt();
@ -409,7 +409,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
public void writeImplementedInterfacesInfo() { public void writeImplementedInterfacesInfo() {
//NOTE: we really should be using ClassDoc.interfaceTypes() here, but //NOTE: we really should be using ClassDoc.interfaceTypes() here, but
// it doesn't walk up the tree like we want it to. // it doesn't walk up the tree like we want it to.
List interfaceArray = Util.getAllInterfaces(classDoc, configuration); List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
if (classDoc.isClass() && interfaceArray.size() > 0) { if (classDoc.isClass() && interfaceArray.size() > 0) {
dl(); dl();
dt(); dt();
@ -425,7 +425,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
public void writeSuperInterfacesInfo() { public void writeSuperInterfacesInfo() {
//NOTE: we really should be using ClassDoc.interfaceTypes() here, but //NOTE: we really should be using ClassDoc.interfaceTypes() here, but
// it doesn't walk up the tree like we want it to. // it doesn't walk up the tree like we want it to.
List interfaceArray = Util.getAllInterfaces(classDoc, configuration); List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
if (classDoc.isInterface() && interfaceArray.size() > 0) { if (classDoc.isInterface() && interfaceArray.size() > 0) {
dl(); dl();
dt(); dt();
@ -438,7 +438,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter
/** /**
* Generate links to the given classes. * Generate links to the given classes.
*/ */
private void writeClassLinks(int context, List list) { private void writeClassLinks(int context, List<?> list) {
Object[] typeList = list.toArray(); Object[] typeList = list.toArray();
//Sort the list to be printed. //Sort the list to be printed.
print(' '); print(' ');

View File

@ -194,10 +194,10 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void writeConstantMembers(ClassDoc cd, List fields) { public void writeConstantMembers(ClassDoc cd, List<FieldDoc> fields) {
currentClassDoc = cd; currentClassDoc = cd;
for (int i = 0; i < fields.size(); ++i) { for (int i = 0; i < fields.size(); ++i) {
writeConstantMember((FieldDoc)(fields.get(i))); writeConstantMember(fields.get(i));
} }
} }

View File

@ -238,7 +238,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
return VisibleMemberMap.CONSTRUCTORS; return VisibleMemberMap.CONSTRUCTORS;
} }
protected void navSummaryLink(List members) { protected void navSummaryLink(List<?> members) {
printNavSummaryLink(classdoc, printNavSummaryLink(classdoc,
members.size() > 0? true: false); members.size() > 0? true: false);
} }

View File

@ -1728,13 +1728,13 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param descList the array of {@link AnnotationDesc}. * @param descList the array of {@link AnnotationDesc}.
*/ */
private boolean writeAnnotationInfo(int indent, Doc doc, AnnotationDesc[] descList, boolean lineBreak) { private boolean writeAnnotationInfo(int indent, Doc doc, AnnotationDesc[] descList, boolean lineBreak) {
List annotations = getAnnotations(indent, descList, lineBreak); List<String> annotations = getAnnotations(indent, descList, lineBreak);
if (annotations.size() == 0) { if (annotations.size() == 0) {
return false; return false;
} }
fontNoNewLine("-1"); fontNoNewLine("-1");
for (Iterator iter = annotations.iterator(); iter.hasNext();) { for (Iterator<String> iter = annotations.iterator(); iter.hasNext();) {
print((String) iter.next()); print(iter.next());
} }
fontEnd(); fontEnd();
return true; return true;
@ -1792,8 +1792,8 @@ public class HtmlDocletWriter extends HtmlDocWriter {
annotationTypeValues.add(annotationValue); annotationTypeValues.add(annotationValue);
} }
annotation.append(annotationTypeValues.size() == 1 ? "" : "{"); annotation.append(annotationTypeValues.size() == 1 ? "" : "{");
for (Iterator iter = annotationTypeValues.iterator(); iter.hasNext(); ) { for (Iterator<AnnotationValue> iter = annotationTypeValues.iterator(); iter.hasNext(); ) {
annotation.append(annotationValueToString((AnnotationValue) iter.next())); annotation.append(annotationValueToString(iter.next()));
annotation.append(iter.hasNext() ? "," : ""); annotation.append(iter.hasNext() ? "," : "");
} }
annotation.append(annotationTypeValues.size() == 1 ? "" : "}"); annotation.append(annotationTypeValues.size() == 1 ? "" : "}");
@ -1820,11 +1820,11 @@ public class HtmlDocletWriter extends HtmlDocWriter {
return type.typeName() + type.dimension() + ".class"; return type.typeName() + type.dimension() + ".class";
} }
} else if (annotationValue.value() instanceof AnnotationDesc) { } else if (annotationValue.value() instanceof AnnotationDesc) {
List list = getAnnotations(0, List<String> list = getAnnotations(0,
new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()}, new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()},
false); false);
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
for (Iterator iter = list.iterator(); iter.hasNext(); ) { for (Iterator<String> iter = list.iterator(); iter.hasNext(); ) {
buf.append(iter.next()); buf.append(iter.next());
} }
return buf.toString(); return buf.toString();

View File

@ -51,7 +51,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
super(writer, classdoc); super(writer, classdoc);
} }
public List members(ClassDoc cd) { public List<FieldDoc> members(ClassDoc cd) {
return Util.asList(cd.serializableFields()); return Util.asList(cd.serializableFields());
} }

View File

@ -49,7 +49,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
* The classes to be documented. Use this to filter out classes * The classes to be documented. Use this to filter out classes
* that will not be documented. * that will not be documented.
*/ */
private Set documentedClasses; private Set<ClassDoc> documentedClasses;
/** /**
* The name of the output file. * The name of the output file.

View File

@ -54,7 +54,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
/** /**
* List to store the order groups as specified on the command line. * List to store the order groups as specified on the command line.
*/ */
private List groupList; private List<String> groupList;
/** /**
* Construct the PackageIndexWriter. Also constructs the grouping * Construct the PackageIndexWriter. Also constructs the grouping

View File

@ -63,8 +63,8 @@ public class PackageUseWriter extends SubWriterHolderWriter {
ClassDoc usedClass = content[i]; ClassDoc usedClass = content[i];
Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName()); Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName());
if (usingClasses != null) { if (usingClasses != null) {
for (Iterator it = usingClasses.iterator(); it.hasNext(); ) { for (Iterator<ClassDoc> it = usingClasses.iterator(); it.hasNext(); ) {
ClassDoc usingClass = (ClassDoc)it.next(); ClassDoc usingClass = it.next();
PackageDoc usingPackage = usingClass.containingPackage(); PackageDoc usingPackage = usingClass.containingPackage();
Set<ClassDoc> usedClasses = usingPackageToUsedClasses Set<ClassDoc> usedClasses = usingPackageToUsedClasses
.get(usingPackage.name()); .get(usingPackage.name());
@ -136,9 +136,9 @@ public class PackageUseWriter extends SubWriterHolderWriter {
printText("doclet.ClassUse_Packages.that.use.0", printText("doclet.ClassUse_Packages.that.use.0",
getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false)); getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false));
tableHeaderEnd(); tableHeaderEnd();
Iterator it = usingPackageToUsedClasses.keySet().iterator(); Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
PackageDoc pkg = configuration.root.packageNamed((String)it.next()); PackageDoc pkg = configuration.root.packageNamed(it.next());
generatePackageUse(pkg); generatePackageUse(pkg);
} }
tableEnd(); tableEnd();
@ -147,9 +147,9 @@ public class PackageUseWriter extends SubWriterHolderWriter {
} }
protected void generateClassList() throws IOException { protected void generateClassList() throws IOException {
Iterator itp = usingPackageToUsedClasses.keySet().iterator(); Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator();
while (itp.hasNext()) { while (itp.hasNext()) {
String packageName = (String)itp.next(); String packageName = itp.next();
PackageDoc usingPackage = configuration.root.packageNamed(packageName); PackageDoc usingPackage = configuration.root.packageNamed(packageName);
if (usingPackage != null) { if (usingPackage != null) {
anchor(usingPackage.name()); anchor(usingPackage.name());
@ -160,11 +160,10 @@ public class PackageUseWriter extends SubWriterHolderWriter {
getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false), getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false),
getPackageLink(usingPackage,Util.getPackageName(usingPackage), false)); getPackageLink(usingPackage,Util.getPackageName(usingPackage), false));
tableHeaderEnd(); tableHeaderEnd();
Iterator itc = Iterator<ClassDoc> itc =
((Collection)usingPackageToUsedClasses.get(packageName)) usingPackageToUsedClasses.get(packageName).iterator();
.iterator();
while (itc.hasNext()) { while (itc.hasNext()) {
printClassRow((ClassDoc)itc.next(), packageName); printClassRow(itc.next(), packageName);
} }
tableEnd(); tableEnd();
space(); space();

View File

@ -441,13 +441,13 @@ public abstract class Configuration {
* @param customTagStrs the set two dimentional arrays of strings. These arrays contain * @param customTagStrs the set two dimentional arrays of strings. These arrays contain
* either -tag or -taglet arguments. * either -tag or -taglet arguments.
*/ */
private void initTagletManager(Set customTagStrs) { private void initTagletManager(Set<String[]> customTagStrs) {
tagletManager = tagletManager == null ? tagletManager = tagletManager == null ?
new TagletManager(nosince, showversion, showauthor, message) : new TagletManager(nosince, showversion, showauthor, message) :
tagletManager; tagletManager;
String[] args; String[] args;
for (Iterator it = customTagStrs.iterator(); it.hasNext(); ) { for (Iterator<String[]> it = customTagStrs.iterator(); it.hasNext(); ) {
args = (String[]) it.next(); args = it.next();
if (args[0].equals("-taglet")) { if (args[0].equals("-taglet")) {
tagletManager.addCustomTag(args[1], tagletpath); tagletManager.addCustomTag(args[1], tagletpath);
continue; continue;

View File

@ -103,7 +103,7 @@ public interface ConstantsSummaryWriter {
* @param cd the class whose constants are being documented. * @param cd the class whose constants are being documented.
* @param fields the constants being documented. * @param fields the constants being documented.
*/ */
public abstract void writeConstantMembers(ClassDoc cd, List fields); public abstract void writeConstantMembers(ClassDoc cd, List<FieldDoc> fields);
/** /**
* Document the given constants. * Document the given constants.

View File

@ -97,22 +97,22 @@ public abstract class AbstractBuilder {
* @param elements the XML elements that specify which components to * @param elements the XML elements that specify which components to
* document. * document.
*/ */
protected void build(List elements) { protected void build(List<?> elements) {
for (int i = 0; i < elements.size(); i++ ) { for (int i = 0; i < elements.size(); i++ ) {
Object element = elements.get(i); Object element = elements.get(i);
String component = (String) String component = (String)
((element instanceof String) ? ((element instanceof String) ?
element : element :
((List) element).get(0)); ((List<?>) element).get(0));
try { try {
invokeMethod("build" + component, invokeMethod("build" + component,
element instanceof String ? element instanceof String ?
new Class[] {} : new Class<?>[] {} :
new Class[] {List.class}, new Class<?>[] {List.class},
element instanceof String ? element instanceof String ?
new Object[] {} : new Object[] {} :
new Object[] {((List) element).subList(1, new Object[] {((List<?>) element).subList(1,
((List) element).size())}); ((List<?>) element).size())});
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
e.printStackTrace(); e.printStackTrace();
configuration.root.printError("Unknown element: " + component); configuration.root.printError("Unknown element: " + component);
@ -138,7 +138,7 @@ public abstract class AbstractBuilder {
* @param paramClasses the types for each parameter. * @param paramClasses the types for each parameter.
* @param params the parameters of the method. * @param params the parameters of the method.
*/ */
protected abstract void invokeMethod(String methodName, Class[] paramClasses, protected abstract void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception; throws Exception;
} }

View File

@ -69,7 +69,7 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder {
* *
* @param elements {@inheritDoc} * @param elements {@inheritDoc}
*/ */
public void build(List elements) { public void build(List<?> elements) {
if (hasMembersToDocument()) { if (hasMembersToDocument()) {
super.build(elements); super.build(elements);
} }

View File

@ -92,7 +92,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void invokeMethod(String methodName, Class[] paramClasses, public void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -122,7 +122,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* *
* @param elements the XML elements that specify how to document a class. * @param elements the XML elements that specify how to document a class.
*/ */
public void buildAnnotationTypeDoc(List elements) throws Exception { public void buildAnnotationTypeDoc(List<?> elements) throws Exception {
build(elements); build(elements);
writer.close(); writer.close();
copyDocFiles(); copyDocFiles();
@ -197,7 +197,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a member summary is * @param elements the XML elements that specify how a member summary is
* documented. * documented.
*/ */
public void buildMemberSummary(List elements) throws Exception { public void buildMemberSummary(List<?> elements) throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getMemberSummaryBuilder(writer).build(elements); getMemberSummaryBuilder(writer).build(elements);
writer.completeMemberSummaryBuild(); writer.completeMemberSummaryBuild();
@ -209,7 +209,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a annotation type * @param elements the XML elements that specify how a annotation type
* members are documented. * members are documented.
*/ */
public void buildAnnotationTypeOptionalMemberDetails(List elements) public void buildAnnotationTypeOptionalMemberDetails(List<?> elements)
throws Exception { throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getAnnotationTypeOptionalMemberBuilder(writer).build(elements); getAnnotationTypeOptionalMemberBuilder(writer).build(elements);
@ -221,7 +221,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a annotation type * @param elements the XML elements that specify how a annotation type
* members are documented. * members are documented.
*/ */
public void buildAnnotationTypeRequiredMemberDetails(List elements) public void buildAnnotationTypeRequiredMemberDetails(List<?> elements)
throws Exception { throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getAnnotationTypeRequiredMemberBuilder(writer).build(elements); getAnnotationTypeRequiredMemberBuilder(writer).build(elements);

View File

@ -95,7 +95,7 @@ public class AnnotationTypeOptionalMemberBuilder extends
* @param elements the XML elements that specify how to construct this * @param elements the XML elements that specify how to construct this
* documentation. * documentation.
*/ */
public void buildAnnotationTypeOptionalMember(List elements) { public void buildAnnotationTypeOptionalMember(List<?> elements) {
if (writer == null) { if (writer == null) {
return; return;
} }
@ -108,7 +108,7 @@ public class AnnotationTypeOptionalMemberBuilder extends
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void invokeMethod(String methodName, Class[] paramClasses, public void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {

View File

@ -116,7 +116,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void invokeMethod(String methodName, Class[] paramClasses, public void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -135,7 +135,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
* @param classDoc the {@link ClassDoc} we want to check. * @param classDoc the {@link ClassDoc} we want to check.
* @return a list of members that will be documented. * @return a list of members that will be documented.
*/ */
public List members(ClassDoc classDoc) { public List<ProgramElementDoc> members(ClassDoc classDoc) {
return visibleMemberMap.getMembersFor(classDoc); return visibleMemberMap.getMembersFor(classDoc);
} }
@ -161,7 +161,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this * @param elements the XML elements that specify how to construct this
* documentation. * documentation.
*/ */
public void buildAnnotationTypeRequiredMember(List elements) { public void buildAnnotationTypeRequiredMember(List<?> elements) {
if (writer == null) { if (writer == null) {
return; return;
} }

View File

@ -108,7 +108,7 @@ public class ClassBuilder extends AbstractBuilder {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void invokeMethod(String methodName, Class[] paramClasses, public void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -138,7 +138,7 @@ public class ClassBuilder extends AbstractBuilder {
* *
* @param elements the XML elements that specify how to document a class. * @param elements the XML elements that specify how to document a class.
*/ */
public void buildClassDoc(List elements) throws Exception { public void buildClassDoc(List<?> elements) throws Exception {
build(elements); build(elements);
writer.close(); writer.close();
copyDocFiles(); copyDocFiles();
@ -293,7 +293,7 @@ public class ClassBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a member summary is * @param elements the XML elements that specify how a member summary is
* documented. * documented.
*/ */
public void buildMemberSummary(List elements) throws Exception { public void buildMemberSummary(List<?> elements) throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getMemberSummaryBuilder(writer).build(elements); getMemberSummaryBuilder(writer).build(elements);
writer.completeMemberSummaryBuild(); writer.completeMemberSummaryBuild();
@ -305,7 +305,7 @@ public class ClassBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how a enum constants are * @param elements the XML elements that specify how a enum constants are
* documented. * documented.
*/ */
public void buildEnumConstantsDetails(List elements) throws Exception { public void buildEnumConstantsDetails(List<?> elements) throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getEnumConstantsBuilder(writer).build(elements); getEnumConstantsBuilder(writer).build(elements);
} }
@ -315,7 +315,7 @@ public class ClassBuilder extends AbstractBuilder {
* *
* @param elements the XML elements that specify how a field is documented. * @param elements the XML elements that specify how a field is documented.
*/ */
public void buildFieldDetails(List elements) throws Exception { public void buildFieldDetails(List<?> elements) throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getFieldBuilder(writer).build(elements); getFieldBuilder(writer).build(elements);
} }
@ -326,7 +326,7 @@ public class ClassBuilder extends AbstractBuilder {
* @param elements the XML elements that specify how to document a * @param elements the XML elements that specify how to document a
* constructor. * constructor.
*/ */
public void buildConstructorDetails(List elements) throws Exception { public void buildConstructorDetails(List<?> elements) throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getConstructorBuilder(writer).build(elements); getConstructorBuilder(writer).build(elements);
} }
@ -336,7 +336,7 @@ public class ClassBuilder extends AbstractBuilder {
* *
* @param elements the XML elements that specify how a method is documented. * @param elements the XML elements that specify how a method is documented.
*/ */
public void buildMethodDetails(List elements) throws Exception { public void buildMethodDetails(List<?> elements) throws Exception {
configuration.getBuilderFactory(). configuration.getBuilderFactory().
getMethodBuilder(writer).build(elements); getMethodBuilder(writer).build(elements);
} }

View File

@ -109,7 +109,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void invokeMethod(String methodName, Class[] paramClasses, public void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -144,7 +144,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the list of elements describing constant summary * @param elements the list of elements describing constant summary
* documentation. * documentation.
*/ */
public void buildConstantSummary(List elements) throws Exception { public void buildConstantSummary(List<?> elements) throws Exception {
build(elements); build(elements);
writer.close(); writer.close();
} }
@ -186,7 +186,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the XML elements that represent the components * @param elements the XML elements that represent the components
* of documentation for each package. * of documentation for each package.
*/ */
public void buildConstantSummaries(List elements) { public void buildConstantSummaries(List<?> elements) {
PackageDoc[] packages = configuration.packages; PackageDoc[] packages = configuration.packages;
printedPackageHeaders = new HashSet<String>(); printedPackageHeaders = new HashSet<String>();
for (int i = 0; i < packages.length; i++) { for (int i = 0; i < packages.length; i++) {
@ -204,7 +204,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the list of XML elements that make up package * @param elements the list of XML elements that make up package
* documentation. * documentation.
*/ */
public void buildPackageConstantSummary(List elements) { public void buildPackageConstantSummary(List<?> elements) {
build(elements); build(elements);
} }
@ -214,7 +214,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
* @param elements the list of XML elements that make up the class * @param elements the list of XML elements that make up the class
* constant summary. * constant summary.
*/ */
public void buildClassConstantSummary(List elements) { public void buildClassConstantSummary(List<?> elements) {
ClassDoc[] classes = currentPackage.name().length() > 0 ? ClassDoc[] classes = currentPackage.name().length() > 0 ?
currentPackage.allClasses() : currentPackage.allClasses() :
configuration.classDocCatalog.allClasses( configuration.classDocCatalog.allClasses(
@ -297,8 +297,8 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
private boolean hasConstantField (ClassDoc classDoc) { private boolean hasConstantField (ClassDoc classDoc) {
VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc,
VisibleMemberMap.FIELDS, configuration.nodeprecated); VisibleMemberMap.FIELDS, configuration.nodeprecated);
List fields = visibleMemberMapFields.getLeafClassMembers(configuration); List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration);
for (Iterator iter = fields.iterator(); iter.hasNext(); ) { for (Iterator<?> iter = fields.iterator(); iter.hasNext(); ) {
FieldDoc field = (FieldDoc) iter.next(); FieldDoc field = (FieldDoc) iter.next();
if (field.constantValueExpression() != null) { if (field.constantValueExpression() != null) {
classDocsWithConstFields.add(classDoc); classDocsWithConstFields.add(classDoc);

View File

@ -138,7 +138,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
*/ */
public void invokeMethod( public void invokeMethod(
String methodName, String methodName,
Class[] paramClasses, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -156,7 +156,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
* *
* @return a list of constructors that will be documented. * @return a list of constructors that will be documented.
*/ */
public List members(ClassDoc classDoc) { public List<ProgramElementDoc> members(ClassDoc classDoc) {
return visibleMemberMap.getMembersFor(classDoc); return visibleMemberMap.getMembersFor(classDoc);
} }
@ -175,7 +175,7 @@ public class ConstructorBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this * @param elements the XML elements that specify how to construct this
* documentation. * documentation.
*/ */
public void buildConstructorDoc(List elements) { public void buildConstructorDoc(List<?> elements) {
if (writer == null) { if (writer == null) {
return; return;
} }

View File

@ -120,7 +120,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
*/ */
public void invokeMethod( public void invokeMethod(
String methodName, String methodName,
Class[] paramClasses, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -139,7 +139,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
* @param classDoc the {@link ClassDoc} we want to check. * @param classDoc the {@link ClassDoc} we want to check.
* @return a list of enum constants that will be documented. * @return a list of enum constants that will be documented.
*/ */
public List members(ClassDoc classDoc) { public List<ProgramElementDoc> members(ClassDoc classDoc) {
return visibleMemberMap.getMembersFor(classDoc); return visibleMemberMap.getMembersFor(classDoc);
} }
@ -165,7 +165,7 @@ public class EnumConstantBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this * @param elements the XML elements that specify how to construct this
* documentation. * documentation.
*/ */
public void buildEnumConstant(List elements) { public void buildEnumConstant(List<?> elements) {
if (writer == null) { if (writer == null) {
return; return;
} }

View File

@ -121,7 +121,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
*/ */
public void invokeMethod( public void invokeMethod(
String methodName, String methodName,
Class[] paramClasses, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -140,7 +140,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
* @param classDoc the {@link ClassDoc} we want to check. * @param classDoc the {@link ClassDoc} we want to check.
* @return a list of fields that will be documented. * @return a list of fields that will be documented.
*/ */
public List members(ClassDoc classDoc) { public List<ProgramElementDoc> members(ClassDoc classDoc) {
return visibleMemberMap.getMembersFor(classDoc); return visibleMemberMap.getMembersFor(classDoc);
} }
@ -166,7 +166,7 @@ public class FieldBuilder extends AbstractMemberBuilder {
* @param elements the XML elements that specify how to construct this * @param elements the XML elements that specify how to construct this
* documentation. * documentation.
*/ */
public void buildFieldDoc(List elements) { public void buildFieldDoc(List<?> elements) {
if (writer == null) { if (writer == null) {
return; return;
} }

View File

@ -78,9 +78,9 @@ public class LayoutParser extends DefaultHandler {
* *
* @return List the list of XML elements parsed. * @return List the list of XML elements parsed.
*/ */
public List parseXML(String root) { public List<?> parseXML(String root) {
if (xmlElementsMap.containsKey(root)) { if (xmlElementsMap.containsKey(root)) {
return (List) xmlElementsMap.get(root); return xmlElementsMap.get(root);
} }
try { try {
List<Object> xmlElements = new ArrayList<Object>(); List<Object> xmlElements = new ArrayList<Object>();

View File

@ -170,7 +170,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
* @return a list of methods that will be documented. * @return a list of methods that will be documented.
* @see VisibleMemberMap * @see VisibleMemberMap
*/ */
public List members(int type) { public List<ProgramElementDoc> members(int type) {
return visibleMemberMaps[type].getLeafClassMembers(configuration); return visibleMemberMaps[type].getLeafClassMembers(configuration);
} }
@ -179,7 +179,7 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
*/ */
public void invokeMethod( public void invokeMethod(
String methodName, String methodName,
Class[] paramClasses, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -339,9 +339,9 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
*/ */
private void buildInheritedSummary(MemberSummaryWriter writer, private void buildInheritedSummary(MemberSummaryWriter writer,
VisibleMemberMap visibleMemberMap) { VisibleMemberMap visibleMemberMap) {
for (Iterator iter = visibleMemberMap.getVisibleClassesList().iterator(); for (Iterator<ClassDoc> iter = visibleMemberMap.getVisibleClassesList().iterator();
iter.hasNext();) { iter.hasNext();) {
ClassDoc inhclass = (ClassDoc) (iter.next()); ClassDoc inhclass = iter.next();
if (! (inhclass.isPublic() || if (! (inhclass.isPublic() ||
Util.isLinkable(inhclass, configuration))) { Util.isLinkable(inhclass, configuration))) {
continue; continue;

View File

@ -116,7 +116,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
*/ */
public void invokeMethod( public void invokeMethod(
String methodName, String methodName,
Class[] paramClasses, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -135,7 +135,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
* @param classDoc the {@link ClassDoc} we want to check. * @param classDoc the {@link ClassDoc} we want to check.
* @return a list of methods that will be documented. * @return a list of methods that will be documented.
*/ */
public List members(ClassDoc classDoc) { public List<ProgramElementDoc> members(ClassDoc classDoc) {
return visibleMemberMap.getMembersFor(classDoc); return visibleMemberMap.getMembersFor(classDoc);
} }
@ -158,7 +158,7 @@ public class MethodBuilder extends AbstractMemberBuilder {
/** /**
* Build the method documentation. * Build the method documentation.
*/ */
public void buildMethodDoc(List elements) { public void buildMethodDoc(List<?> elements) {
if (writer == null) { if (writer == null) {
return; return;
} }

View File

@ -88,7 +88,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
*/ */
public void invokeMethod( public void invokeMethod(
String methodName, String methodName,
Class[] paramClasses, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -120,7 +120,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/** /**
* Build the package documentation. * Build the package documentation.
*/ */
public void buildPackageDoc(List elements) throws Exception { public void buildPackageDoc(List<?> elements) throws Exception {
build(elements); build(elements);
packageWriter.close(); packageWriter.close();
Util.copyDocFiles( Util.copyDocFiles(
@ -162,7 +162,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/** /**
* Build the package summary. * Build the package summary.
*/ */
public void buildSummary(List elements) { public void buildSummary(List<?> elements) {
build(elements); build(elements);
} }

View File

@ -130,7 +130,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/** /**
* Build the serialized form. * Build the serialized form.
*/ */
public void buildSerializedForm(List elements) throws Exception { public void buildSerializedForm(List<?> elements) throws Exception {
build(elements); build(elements);
writer.close(); writer.close();
} }
@ -138,7 +138,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public void invokeMethod(String methodName, Class[] paramClasses, public void invokeMethod(String methodName, Class<?>[] paramClasses,
Object[] params) Object[] params)
throws Exception { throws Exception {
if (DEBUG) { if (DEBUG) {
@ -159,7 +159,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/** /**
* Build the contents. * Build the contents.
*/ */
public void buildSerializedFormSummaries(List elements) { public void buildSerializedFormSummaries(List<?> elements) {
PackageDoc[] packages = configuration.packages; PackageDoc[] packages = configuration.packages;
for (int i = 0; i < packages.length; i++) { for (int i = 0; i < packages.length; i++) {
currentPackage = packages[i]; currentPackage = packages[i];
@ -170,7 +170,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/** /**
* Build the package serialized for for the current package being processed. * Build the package serialized for for the current package being processed.
*/ */
public void buildPackageSerializedForm(List elements) { public void buildPackageSerializedForm(List<?> elements) {
String foo = currentPackage.name(); String foo = currentPackage.name();
ClassDoc[] classes = currentPackage.allClasses(false); ClassDoc[] classes = currentPackage.allClasses(false);
if (classes == null || classes.length == 0) { if (classes == null || classes.length == 0) {
@ -189,7 +189,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
writer.writePackageHeader(Util.getPackageName(currentPackage)); writer.writePackageHeader(Util.getPackageName(currentPackage));
} }
public void buildClassSerializedForm(List elements) { public void buildClassSerializedForm(List<?> elements) {
ClassDoc[] classes = currentPackage.allClasses(false); ClassDoc[] classes = currentPackage.allClasses(false);
Arrays.sort(classes); Arrays.sort(classes);
for (int j = 0; j < classes.length; j++) { for (int j = 0; j < classes.length; j++) {
@ -368,7 +368,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
/** /**
* build the information for the method. * build the information for the method.
*/ */
public void buildMethodInfo(List elements) { public void buildMethodInfo(List<?> elements) {
if(configuration.nocomment){ if(configuration.nocomment){
return; return;
} }
@ -478,7 +478,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
* Build the summaries for the methods that belong to the given * Build the summaries for the methods that belong to the given
* class. * class.
*/ */
public void buildSerializableMethods(List elements) { public void buildSerializableMethods(List<?> elements) {
MemberDoc[] members = currentClass.serializationMethods(); MemberDoc[] members = currentClass.serializationMethods();
if (members.length > 0) { if (members.length > 0) {
for (int i = 0; i < members.length; i++) { for (int i = 0; i < members.length; i++) {
@ -492,7 +492,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
* Build the summaries for the fields that belong to the given * Build the summaries for the fields that belong to the given
* class. * class.
*/ */
public void buildSerializableFields(List elements) { public void buildSerializableFields(List<?> elements) {
MemberDoc[] members = currentClass.serializableFields(); MemberDoc[] members = currentClass.serializableFields();
if (members.length > 0) { if (members.length > 0) {
for (int i = 0; i < members.length; i++) { for (int i = 0; i < members.length; i++) {

View File

@ -100,7 +100,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
} }
ParamTag[] tags = input.isTypeVariableParamTag ? ParamTag[] tags = input.isTypeVariableParamTag ?
input.method.typeParamTags() : input.method.paramTags(); input.method.typeParamTags() : input.method.paramTags();
Map rankMap = getRankMap(input.isTypeVariableParamTag ? Map<String, String> rankMap = getRankMap(input.isTypeVariableParamTag ?
(Object[]) input.method.typeParameters() : (Object[]) input.method.typeParameters() :
(Object[]) input.method.parameters()); (Object[]) input.method.parameters());
for (int i = 0; i < tags.length; i++) { for (int i = 0; i < tags.length; i++) {
@ -262,7 +262,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
* @return the TagletOutput representation of this <code>Tag</code>. * @return the TagletOutput representation of this <code>Tag</code>.
*/ */
private TagletOutput processParamTags(boolean isNonTypeParams, private TagletOutput processParamTags(boolean isNonTypeParams,
ParamTag[] paramTags, Map rankMap, TagletWriter writer, ParamTag[] paramTags, Map<String, String> rankMap, TagletWriter writer,
Set<String> alreadyDocumented) { Set<String> alreadyDocumented) {
TagletOutput result = writer.getOutputInstance(); TagletOutput result = writer.getOutputInstance();
if (paramTags.length > 0) { if (paramTags.length > 0) {
@ -277,7 +277,7 @@ public class ParamTaglet extends BaseTaglet implements InheritableTaglet {
"doclet.Type_Parameters_warn", "doclet.Type_Parameters_warn",
paramName); paramName);
} }
String rank = (String) rankMap.get(pt.parameterName()); String rank = rankMap.get(pt.parameterName());
if (rank != null && alreadyDocumented.contains(rank)) { if (rank != null && alreadyDocumented.contains(rank)) {
writer.getMsgRetriever().warning(pt.position(), writer.getMsgRetriever().warning(pt.position(),
isNonTypeParams ? isNonTypeParams ?

View File

@ -212,7 +212,7 @@ public class TagletManager {
URLClassLoader appClassLoader = new URLClassLoader(pathToURLs(cpString)); URLClassLoader appClassLoader = new URLClassLoader(pathToURLs(cpString));
customTagClass = appClassLoader.loadClass(classname); customTagClass = appClassLoader.loadClass(classname);
Method meth = customTagClass.getMethod("register", Method meth = customTagClass.getMethod("register",
new Class[] {Class.forName("java.util.Map")}); new Class<?>[] {java.util.Map.class});
Object[] list = customTags.values().toArray(); Object[] list = customTags.values().toArray();
Taglet lastTag = (list != null && list.length > 0) Taglet lastTag = (list != null && list.length > 0)
? (Taglet) list[list.length-1] : null; ? (Taglet) list[list.length-1] : null;
@ -705,9 +705,9 @@ public class TagletManager {
* Initialize lowercase version of standard Javadoc tags. * Initialize lowercase version of standard Javadoc tags.
*/ */
private void initStandardTagsLowercase() { private void initStandardTagsLowercase() {
Iterator it = standardTags.iterator(); Iterator<String> it = standardTags.iterator();
while (it.hasNext()) { while (it.hasNext()) {
standardTagsLowercase.add(((String)it.next()).toLowerCase()); standardTagsLowercase.add(it.next().toLowerCase());
} }
} }

View File

@ -177,9 +177,9 @@ public class ClassTree {
bases.add(cd); bases.add(cd);
} }
} }
List intfacs = Util.getAllInterfaces(cd, configuration); List<Type> intfacs = Util.getAllInterfaces(cd, configuration);
for (Iterator iter = intfacs.iterator(); iter.hasNext();) { for (Iterator<Type> iter = intfacs.iterator(); iter.hasNext();) {
add(implementingclasses, ((Type) iter.next()).asClassDoc(), cd); add(implementingclasses, iter.next().asClassDoc(), cd);
} }
} }
@ -278,13 +278,13 @@ public class ClassTree {
//If class x implements a subinterface of cd, then it follows //If class x implements a subinterface of cd, then it follows
//that class x implements cd. //that class x implements cd.
Iterator implementingClassesIter, subInterfacesIter = subinterfaces.listIterator(); Iterator<ClassDoc> implementingClassesIter, subInterfacesIter = subinterfaces.listIterator();
ClassDoc c; ClassDoc c;
while(subInterfacesIter.hasNext()){ while(subInterfacesIter.hasNext()){
implementingClassesIter = implementingclasses((ClassDoc) implementingClassesIter = implementingclasses(
subInterfacesIter.next()).listIterator(); subInterfacesIter.next()).listIterator();
while(implementingClassesIter.hasNext()){ while(implementingClassesIter.hasNext()){
c = (ClassDoc)implementingClassesIter.next(); c = implementingClassesIter.next();
if(! result.contains(c)){ if(! result.contains(c)){
result.add(c); result.add(c);
} }
@ -328,9 +328,9 @@ public class ClassTree {
List<ClassDoc> list = subs(cd, isEnum); List<ClassDoc> list = subs(cd, isEnum);
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
cd = list.get(i); cd = list.get(i);
List tlist = subs(cd, isEnum); List<ClassDoc> tlist = subs(cd, isEnum);
for (int j = 0; j < tlist.size(); j++) { for (int j = 0; j < tlist.size(); j++) {
ClassDoc tcd = (ClassDoc)tlist.get(j); ClassDoc tcd = tlist.get(j);
if (!list.contains(tcd)) { if (!list.contains(tcd)) {
list.add(tcd); list.add(tcd);
} }
@ -345,7 +345,7 @@ public class ClassTree {
* thw classdoc for java.lang.Object, since this is the base class for all * thw classdoc for java.lang.Object, since this is the base class for all
* classes. * classes.
*/ */
public List baseclasses() { public List<ClassDoc> baseclasses() {
return baseclasses; return baseclasses;
} }
@ -353,7 +353,7 @@ public class ClassTree {
* Return the list of base interfaces. This is the list of interfaces * Return the list of base interfaces. This is the list of interfaces
* which do not have super-interface. * which do not have super-interface.
*/ */
public List baseinterfaces() { public List<ClassDoc> baseinterfaces() {
return baseinterfaces; return baseinterfaces;
} }
@ -361,7 +361,7 @@ public class ClassTree {
* Return the list of base enums. This is the list of enums * Return the list of base enums. This is the list of enums
* which do not have super-enums. * which do not have super-enums.
*/ */
public List baseEnums() { public List<ClassDoc> baseEnums() {
return baseEnums; return baseEnums;
} }
@ -369,7 +369,7 @@ public class ClassTree {
* Return the list of base annotation types. This is the list of * Return the list of base annotation types. This is the list of
* annotation types which do not have super-annotation types. * annotation types which do not have super-annotation types.
*/ */
public List baseAnnotationTypes() { public List<ClassDoc> baseAnnotationTypes() {
return baseAnnotationTypes; return baseAnnotationTypes;
} }
} }

View File

@ -184,12 +184,12 @@ public class ClassUseMapper {
this.classtree = classtree; this.classtree = classtree;
// Map subclassing, subinterfacing implementing, ... // Map subclassing, subinterfacing implementing, ...
for (Iterator it = classtree.baseclasses().iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = classtree.baseclasses().iterator(); it.hasNext();) {
subclasses((ClassDoc)it.next()); subclasses(it.next());
} }
for (Iterator it = classtree.baseinterfaces().iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = classtree.baseinterfaces().iterator(); it.hasNext();) {
// does subinterfacing as side-effect // does subinterfacing as side-effect
implementingClasses((ClassDoc)it.next()); implementingClasses(it.next());
} }
// Map methods, fields, constructors using a class. // Map methods, fields, constructors using a class.
ClassDoc[] classes = root.classes(); ClassDoc[] classes = root.classes();
@ -279,12 +279,12 @@ public class ClassUseMapper {
List<ClassDoc> impl = classtree.implementingclasses(cd); List<ClassDoc> impl = classtree.implementingclasses(cd);
if (impl != null) { if (impl != null) {
ret.addAll(impl); ret.addAll(impl);
for (Iterator it = impl.iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = impl.iterator(); it.hasNext();) {
ret.addAll(subclasses((ClassDoc)it.next())); ret.addAll(subclasses(it.next()));
} }
} }
for (Iterator it = subinterfaces(cd).iterator(); it.hasNext();) { for (Iterator<ClassDoc> it = subinterfaces(cd).iterator(); it.hasNext();) {
ret.addAll(implementingClasses((ClassDoc)it.next())); ret.addAll(implementingClasses(it.next()));
} }
addAll(classToImplementingClass, cd, ret); addAll(classToImplementingClass, cd, ret);
} }
@ -328,8 +328,7 @@ public class ClassUseMapper {
private <T> List<T> refList(Map<String,List<T>> map, ClassDoc cd) { private <T> List<T> refList(Map<String,List<T>> map, ClassDoc cd) {
List<T> list = map.get(cd.qualifiedName()); List<T> list = map.get(cd.qualifiedName());
if (list == null) { if (list == null) {
@SuppressWarnings("unchecked") List<T> l = new ArrayList<T>();
List<T> l = new ArrayList();
list = l; list = l;
map.put(cd.qualifiedName(), list); map.put(cd.qualifiedName(), list);
} }
@ -348,8 +347,7 @@ public class ClassUseMapper {
private Set<ClassDoc> classSet(ClassDoc cd) { private Set<ClassDoc> classSet(ClassDoc cd) {
Set<ClassDoc> clsSet = classToClass.get(cd.qualifiedName()); Set<ClassDoc> clsSet = classToClass.get(cd.qualifiedName());
if (clsSet == null) { if (clsSet == null) {
@SuppressWarnings("unchecked") Set<ClassDoc> s = new TreeSet<ClassDoc>();
Set<ClassDoc> s = new TreeSet();
clsSet = s; clsSet = s;
classToClass.put(cd.qualifiedName(), clsSet); classToClass.put(cd.qualifiedName(), clsSet);
} }

View File

@ -152,7 +152,7 @@ public class Group {
* *
* @return true if package name format found in the map, else false. * @return true if package name format found in the map, else false.
*/ */
boolean foundGroupFormat(Map map, String pkgFormat) { boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
if (map.containsKey(pkgFormat)) { if (map.containsKey(pkgFormat)) {
configuration.message.error("doclet.Same_package_name_used", pkgFormat); configuration.message.error("doclet.Same_package_name_used", pkgFormat);
return true; return true;
@ -239,7 +239,7 @@ public class Group {
* Return the list of groups, in the same order as specified * Return the list of groups, in the same order as specified
* on the command line. * on the command line.
*/ */
public List getGroupList() { public List<String> getGroupList() {
return groupList; return groupList;
} }
} }

View File

@ -86,9 +86,9 @@ public class ImplementedMethods {
* from the array passed. * from the array passed.
*/ */
private void buildImplementedMethodList(boolean sort) { private void buildImplementedMethodList(boolean sort) {
List intfacs = Util.getAllInterfaces(classdoc, configuration, sort); List<Type> intfacs = Util.getAllInterfaces(classdoc, configuration, sort);
for (Iterator iter = intfacs.iterator(); iter.hasNext(); ) { for (Iterator<Type> iter = intfacs.iterator(); iter.hasNext(); ) {
Type interfaceType = (Type) iter.next(); Type interfaceType = iter.next();
MethodDoc found = Util.findMethod(interfaceType.asClassDoc(), method); MethodDoc found = Util.findMethod(interfaceType.asClassDoc(), method);
if (found != null) { if (found != null) {
removeOverriddenMethod(found); removeOverriddenMethod(found);

View File

@ -114,7 +114,7 @@ public class IndexBuilder {
this.noDeprecated = noDeprecated; this.noDeprecated = noDeprecated;
this.classesOnly = classesOnly; this.classesOnly = classesOnly;
buildIndexMap(configuration.root); buildIndexMap(configuration.root);
Set set = indexmap.keySet(); Set<Character> set = indexmap.keySet();
elements = set.toArray(); elements = set.toArray();
Arrays.sort(elements); Arrays.sort(elements);
} }
@ -215,7 +215,7 @@ public class IndexBuilder {
* *
* @return Map index map. * @return Map index map.
*/ */
public Map getIndexMap() { public Map<Character,List<Doc>> getIndexMap() {
return indexmap; return indexmap;
} }
@ -225,8 +225,8 @@ public class IndexBuilder {
* @param index index Unicode character. * @param index index Unicode character.
* @return List member list for specific Unicode character. * @return List member list for specific Unicode character.
*/ */
public List getMemberList(Character index) { public List<Doc> getMemberList(Character index) {
return (List)indexmap.get(index); return indexmap.get(index);
} }
/** /**

View File

@ -88,10 +88,10 @@ public class Util {
/** /**
* Return the list of ProgramElementDoc objects as Array. * Return the list of ProgramElementDoc objects as Array.
*/ */
public static ProgramElementDoc[] toProgramElementDocArray(List list) { public static ProgramElementDoc[] toProgramElementDocArray(List<ProgramElementDoc> list) {
ProgramElementDoc[] pgmarr = new ProgramElementDoc[list.size()]; ProgramElementDoc[] pgmarr = new ProgramElementDoc[list.size()];
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
pgmarr[i] = (ProgramElementDoc)(list.get(i)); pgmarr[i] = list.get(i);
} }
return pgmarr; return pgmarr;
} }
@ -416,9 +416,9 @@ public class Util {
continue; continue;
} }
results.put(interfaceClassDoc, interfaceType); results.put(interfaceClassDoc, interfaceType);
List superInterfaces = getAllInterfaces(interfaceType, configuration, sort); List<Type> superInterfaces = getAllInterfaces(interfaceType, configuration, sort);
for (Iterator iter = superInterfaces.iterator(); iter.hasNext(); ) { for (Iterator<Type> iter = superInterfaces.iterator(); iter.hasNext(); ) {
Type t = (Type) iter.next(); Type t = iter.next();
results.put(t.asClassDoc(), t); results.put(t.asClassDoc(), t);
} }
} }
@ -438,7 +438,7 @@ public class Util {
return resultsList; return resultsList;
} }
public static List getAllInterfaces(Type type, Configuration configuration) { public static List<Type> getAllInterfaces(Type type, Configuration configuration) {
return getAllInterfaces(type, configuration, true); return getAllInterfaces(type, configuration, true);
} }
@ -480,9 +480,9 @@ public class Util {
if (raw) if (raw)
interfaceType = interfaceType.asClassDoc(); interfaceType = interfaceType.asClassDoc();
results.put(interfaceClassDoc, interfaceType); results.put(interfaceClassDoc, interfaceType);
List superInterfaces = getAllInterfaces(interfaceType, configuration); List<Type> superInterfaces = getAllInterfaces(interfaceType, configuration);
for (Iterator iter = superInterfaces.iterator(); iter.hasNext(); ) { for (Iterator<Type> iter = superInterfaces.iterator(); iter.hasNext(); ) {
Type superInterface = (Type) iter.next(); Type superInterface = iter.next();
results.put(superInterface.asClassDoc(), superInterface); results.put(superInterface.asClassDoc(), superInterface);
} }
} }
@ -495,8 +495,8 @@ public class Util {
} }
public static List<ProgramElementDoc> asList(ProgramElementDoc[] members) { public static <T extends ProgramElementDoc> List<T> asList(T[] members) {
List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>(); List<T> list = new ArrayList<T>();
for (int i = 0; i < members.length; i++) { for (int i = 0; i < members.length; i++) {
list.add(members[i]); list.add(members[i]);
} }

View File

@ -116,7 +116,7 @@ public class VisibleMemberMap {
* *
* @return the list of visible classes in this map. * @return the list of visible classes in this map.
*/ */
public List getVisibleClassesList() { public List<ClassDoc> getVisibleClassesList() {
sort(visibleClasses); sort(visibleClasses);
return visibleClasses; return visibleClasses;
} }
@ -130,8 +130,8 @@ public class VisibleMemberMap {
*/ */
private List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration) { private List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration) {
List<ProgramElementDoc> results = new ArrayList<ProgramElementDoc>(); List<ProgramElementDoc> results = new ArrayList<ProgramElementDoc>();
for (Iterator iter = visibleClasses.iterator(); iter.hasNext(); ) { for (Iterator<ClassDoc> iter = visibleClasses.iterator(); iter.hasNext(); ) {
ClassDoc currentClass = (ClassDoc) iter.next(); ClassDoc currentClass = iter.next();
if (currentClass != classdoc && if (currentClass != classdoc &&
currentClass.isPackagePrivate() && currentClass.isPackagePrivate() &&
!Util.isLinkable(currentClass, configuration)) { !Util.isLinkable(currentClass, configuration)) {
@ -203,10 +203,10 @@ public class VisibleMemberMap {
} }
} }
private void purgeMemberLevelMap(List list, String level) { private void purgeMemberLevelMap(List<ProgramElementDoc> list, String level) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
Object key = getMemberKey((ProgramElementDoc)list.get(i)); Object key = getMemberKey(list.get(i));
Map memberLevelMap = (Map) memberNameMap.get(key); Map<ProgramElementDoc, String> memberLevelMap = memberNameMap.get(key);
if (level.equals(memberLevelMap.get(list.get(i)))) if (level.equals(memberLevelMap.get(list.get(i))))
memberLevelMap.remove(list.get(i)); memberLevelMap.remove(list.get(i));
} }
@ -230,7 +230,7 @@ public class VisibleMemberMap {
} }
public boolean isEqual(MethodDoc member) { public boolean isEqual(MethodDoc member) {
for (Iterator iter = members.iterator(); iter.hasNext(); ) { for (Iterator<ProgramElementDoc> iter = members.iterator(); iter.hasNext(); ) {
MethodDoc member2 = (MethodDoc) iter.next(); MethodDoc member2 = (MethodDoc) iter.next();
if (Util.executableMembersEqual(member, member2)) { if (Util.executableMembersEqual(member, member2)) {
members.add(member); members.add(member);
@ -438,9 +438,9 @@ public class VisibleMemberMap {
return targetMembers.toArray(new AnnotationTypeElementDoc[]{}); return targetMembers.toArray(new AnnotationTypeElementDoc[]{});
} }
private boolean found(List list, ProgramElementDoc elem) { private boolean found(List<ProgramElementDoc> list, ProgramElementDoc elem) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
ProgramElementDoc pgmelem = (ProgramElementDoc)list.get(i); ProgramElementDoc pgmelem = list.get(i);
if (Util.matches(pgmelem, elem)) { if (Util.matches(pgmelem, elem)) {
return true; return true;
} }
@ -455,13 +455,13 @@ public class VisibleMemberMap {
* level "111". * level "111".
*/ */
private boolean isOverridden(ProgramElementDoc pgmdoc, String level) { private boolean isOverridden(ProgramElementDoc pgmdoc, String level) {
Map memberLevelMap = (Map) memberNameMap.get(getMemberKey(pgmdoc)); Map<?,String> memberLevelMap = (Map<?,String>) memberNameMap.get(getMemberKey(pgmdoc));
if (memberLevelMap == null) if (memberLevelMap == null)
return false; return false;
String mappedlevel = null; String mappedlevel = null;
Iterator iterator = memberLevelMap.values().iterator(); Iterator<String> iterator = memberLevelMap.values().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
mappedlevel = (String)(iterator.next()); mappedlevel = iterator.next();
if (mappedlevel.equals(STARTLEVEL) || if (mappedlevel.equals(STARTLEVEL) ||
(level.startsWith(mappedlevel) && (level.startsWith(mappedlevel) &&
!level.equals(mappedlevel))) { !level.equals(mappedlevel))) {
@ -482,7 +482,7 @@ public class VisibleMemberMap {
} }
private ClassMember getClassMember(MethodDoc member) { private ClassMember getClassMember(MethodDoc member) {
for (Iterator iter = memberNameMap.keySet().iterator(); iter.hasNext();) { for (Iterator<?> iter = memberNameMap.keySet().iterator(); iter.hasNext();) {
Object key = iter.next(); Object key = iter.next();
if (key instanceof String) { if (key instanceof String) {
continue; continue;

View File

@ -56,7 +56,7 @@ public class Main {
if (args.length > 0 && args[0].equals("-Xjdb")) { if (args.length > 0 && args[0].equals("-Xjdb")) {
String[] newargs = new String[args.length + 2]; String[] newargs = new String[args.length + 2];
Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY"); Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY");
Method method = c.getDeclaredMethod ("main", new Class[] {args.getClass()}); Method method = c.getDeclaredMethod ("main", new Class<?>[] {args.getClass()});
method.setAccessible(true); method.setAccessible(true);
System.arraycopy(args, 1, newargs, 3, args.length - 1); System.arraycopy(args, 1, newargs, 3, args.length - 1);
newargs[0] = "-connect"; newargs[0] = "-connect";

View File

@ -949,8 +949,8 @@ public class JavacFileManager implements StandardJavaFileManager {
Iterable<? extends File> files) Iterable<? extends File> files)
{ {
ArrayList<RegularFileObject> result; ArrayList<RegularFileObject> result;
if (files instanceof Collection) if (files instanceof Collection<?>)
result = new ArrayList<RegularFileObject>(((Collection)files).size()); result = new ArrayList<RegularFileObject>(((Collection<?>)files).size());
else else
result = new ArrayList<RegularFileObject>(); result = new ArrayList<RegularFileObject>();
for (File f: files) for (File f: files)

View File

@ -1114,7 +1114,7 @@ public class ZipFileIndex {
writtenSoFar += dirNameBytesLen; writtenSoFar += dirNameBytesLen;
// Write the number of files in the dir // Write the number of files in the dir
List dirEntries = dirEntry.getEntriesAsCollection(); List<Entry> dirEntries = dirEntry.getEntriesAsCollection();
raf.writeInt(dirEntries.size()); raf.writeInt(dirEntries.size());
writtenSoFar += 4; writtenSoFar += 4;

View File

@ -215,15 +215,15 @@ public class AnnotationProxyMaker {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
public void visitEnum(Attribute.Enum e) { public void visitEnum(Attribute.Enum e) {
if (returnClass.isEnum()) { if (returnClass.isEnum()) {
String constName = e.value.toString(); String constName = e.value.toString();
try { try {
value = Enum.valueOf((Class) returnClass, constName); value = Enum.valueOf((Class)returnClass, constName);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
value = new EnumConstantNotPresentExceptionProxy( value = new EnumConstantNotPresentExceptionProxy(
(Class) returnClass, constName); (Class<Enum<?>>) returnClass, constName);
} }
} else { } else {
value = null; // indicates a type mismatch value = null; // indicates a type mismatch

View File

@ -1060,7 +1060,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
next.put(Names.namesKey, names); next.put(Names.namesKey, names);
} }
DiagnosticListener dl = context.get(DiagnosticListener.class); DiagnosticListener<?> dl = context.get(DiagnosticListener.class);
if (dl != null) if (dl != null)
next.put(DiagnosticListener.class, dl); next.put(DiagnosticListener.class, dl);

View File

@ -55,12 +55,12 @@ class ServiceProxy {
private static final String prefix = "META-INF/services/"; private static final String prefix = "META-INF/services/";
private static void fail(Class service, String msg) private static void fail(Class<?> service, String msg)
throws ServiceConfigurationError { throws ServiceConfigurationError {
throw new ServiceConfigurationError(service.getName() + ": " + msg); throw new ServiceConfigurationError(service.getName() + ": " + msg);
} }
private static void fail(Class service, URL u, int line, String msg) private static void fail(Class<?> service, URL u, int line, String msg)
throws ServiceConfigurationError { throws ServiceConfigurationError {
fail(service, u + ":" + line + ": " + msg); fail(service, u + ":" + line + ": " + msg);
} }
@ -81,7 +81,7 @@ class ServiceProxy {
* If an I/O error occurs while reading from the given URL, or * If an I/O error occurs while reading from the given URL, or
* if a configuration-file format error is detected * if a configuration-file format error is detected
*/ */
private static boolean parse(Class service, URL u) throws ServiceConfigurationError { private static boolean parse(Class<?> service, URL u) throws ServiceConfigurationError {
InputStream in = null; InputStream in = null;
BufferedReader r = null; BufferedReader r = null;
try { try {

View File

@ -116,7 +116,7 @@ public class Context {
* We maintain the invariant that this table contains only * We maintain the invariant that this table contains only
* mappings of the form * mappings of the form
* Key<T> -> T or Key<T> -> Factory<T> */ * Key<T> -> T or Key<T> -> Factory<T> */
private Map<Key,Object> ht = new HashMap<Key,Object>(); private Map<Key<?>,Object> ht = new HashMap<Key<?>,Object>();
/** Set the factory for the key in this context. */ /** Set the factory for the key in this context. */
public <T> void put(Key<T> key, Factory<T> fac) { public <T> void put(Key<T> key, Factory<T> fac) {
@ -128,11 +128,11 @@ public class Context {
/** Set the value for the key in this context. */ /** Set the value for the key in this context. */
public <T> void put(Key<T> key, T data) { public <T> void put(Key<T> key, T data) {
if (data instanceof Factory) if (data instanceof Factory<?>)
throw new AssertionError("T extends Context.Factory"); throw new AssertionError("T extends Context.Factory");
checkState(ht); checkState(ht);
Object old = ht.put(key, data); Object old = ht.put(key, data);
if (old != null && !(old instanceof Factory) && old != data && data != null) if (old != null && !(old instanceof Factory<?>) && old != data && data != null)
throw new AssertionError("duplicate context value"); throw new AssertionError("duplicate context value");
} }
@ -140,10 +140,10 @@ public class Context {
public <T> T get(Key<T> key) { public <T> T get(Key<T> key) {
checkState(ht); checkState(ht);
Object o = ht.get(key); Object o = ht.get(key);
if (o instanceof Factory) { if (o instanceof Factory<?>) {
Factory fac = (Factory)o; Factory<?> fac = (Factory<?>)o;
o = fac.make(); o = fac.make();
if (o instanceof Factory) if (o instanceof Factory<?>)
throw new AssertionError("T extends Context.Factory"); throw new AssertionError("T extends Context.Factory");
assert ht.get(key) == o; assert ht.get(key) == o;
} }

View File

@ -71,9 +71,10 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <A> List<A> nil() { public static <A> List<A> nil() {
return EMPTY_LIST; return (List<A>)EMPTY_LIST;
} }
private static List EMPTY_LIST = new List<Object>(null,null) {
private static List<?> EMPTY_LIST = new List<Object>(null,null) {
public List<Object> setTail(List<Object> tail) { public List<Object> setTail(List<Object> tail) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -318,7 +319,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
/** Are the two lists the same? /** Are the two lists the same?
*/ */
public static boolean equals(List xs, List ys) { public static boolean equals(List<?> xs, List<?> ys) {
while (xs.tail != null && ys.tail != null) { while (xs.tail != null && ys.tail != null) {
if (xs.head == null) { if (xs.head == null) {
if (ys.head != null) return false; if (ys.head != null) return false;
@ -368,7 +369,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
return (List<T>)list; return (List<T>)list;
} }
private static Iterator EMPTYITERATOR = new Iterator() { private static Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
public boolean hasNext() { public boolean hasNext() {
return false; return false;
} }
@ -382,7 +383,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private static <A> Iterator<A> emptyIterator() { private static <A> Iterator<A> emptyIterator() {
return EMPTYITERATOR; return (Iterator<A>)EMPTYITERATOR;
} }
@Override @Override

View File

@ -52,9 +52,9 @@ public class Pair<A, B> {
public boolean equals(Object other) { public boolean equals(Object other) {
return return
other instanceof Pair && other instanceof Pair<?,?> &&
equals(fst, ((Pair)other).fst) && equals(fst, ((Pair<?,?>)other).fst) &&
equals(snd, ((Pair)other).snd); equals(snd, ((Pair<?,?>)other).snd);
} }
public int hashCode() { public int hashCode() {

View File

@ -88,7 +88,7 @@ public class DocletInvoker {
appClassLoader = new URLClassLoader(urls, docletParentClassLoader); appClassLoader = new URLClassLoader(urls, docletParentClassLoader);
// attempt to find doclet // attempt to find doclet
Class dc = null; Class<?> dc = null;
try { try {
dc = appClassLoader.loadClass(docletClassName); dc = appClassLoader.loadClass(docletClassName);
} catch (ClassNotFoundException exc) { } catch (ClassNotFoundException exc) {
@ -104,7 +104,7 @@ public class DocletInvoker {
public boolean start(RootDoc root) { public boolean start(RootDoc root) {
Object retVal; Object retVal;
String methodName = "start"; String methodName = "start";
Class[] paramTypes = new Class[1]; Class<?>[] paramTypes = new Class<?>[1];
Object[] params = new Object[1]; Object[] params = new Object[1];
paramTypes[0] = RootDoc.class; paramTypes[0] = RootDoc.class;
params[0] = root; params[0] = root;
@ -130,7 +130,7 @@ public class DocletInvoker {
public int optionLength(String option) { public int optionLength(String option) {
Object retVal; Object retVal;
String methodName = "optionLength"; String methodName = "optionLength";
Class[] paramTypes = new Class[1]; Class<?>[] paramTypes = new Class<?>[1];
Object[] params = new Object[1]; Object[] params = new Object[1];
paramTypes[0] = option.getClass(); paramTypes[0] = option.getClass();
params[0] = option; params[0] = option;
@ -157,7 +157,7 @@ public class DocletInvoker {
String options[][] = optlist.toArray(new String[optlist.length()][]); String options[][] = optlist.toArray(new String[optlist.length()][]);
String methodName = "validOptions"; String methodName = "validOptions";
DocErrorReporter reporter = messager; DocErrorReporter reporter = messager;
Class[] paramTypes = new Class[2]; Class<?>[] paramTypes = new Class<?>[2];
Object[] params = new Object[2]; Object[] params = new Object[2];
paramTypes[0] = options.getClass(); paramTypes[0] = options.getClass();
paramTypes[1] = DocErrorReporter.class; paramTypes[1] = DocErrorReporter.class;
@ -185,7 +185,7 @@ public class DocletInvoker {
try { try {
Object retVal; Object retVal;
String methodName = "languageVersion"; String methodName = "languageVersion";
Class[] paramTypes = new Class[0]; Class<?>[] paramTypes = new Class<?>[0];
Object[] params = new Object[0]; Object[] params = new Object[0];
try { try {
retVal = invoke(methodName, JAVA_1_1, paramTypes, params); retVal = invoke(methodName, JAVA_1_1, paramTypes, params);
@ -208,7 +208,7 @@ public class DocletInvoker {
* Utility method for calling doclet functionality * Utility method for calling doclet functionality
*/ */
private Object invoke(String methodName, Object returnValueIfNonExistent, private Object invoke(String methodName, Object returnValueIfNonExistent,
Class[] paramTypes, Object[] params) Class<?>[] paramTypes, Object[] params)
throws DocletInvokeException { throws DocletInvokeException {
Method meth; Method meth;
try { try {

View File

@ -326,7 +326,7 @@ public abstract class Gen {
throws ClassNotFoundException { throws ClassNotFoundException {
Vector<FieldDoc> fields = new Vector<FieldDoc>(); Vector<FieldDoc> fields = new Vector<FieldDoc>();
ClassDoc cd = null; ClassDoc cd = null;
Stack s = new Stack(); Stack<Object> s = new Stack<Object>();
cd = subclazz; cd = subclazz;
while (true) { while (true) {

View File

@ -39,7 +39,7 @@ public class LLNI extends Gen {
protected final char pathChar = File.separatorChar; protected final char pathChar = File.separatorChar;
protected final char innerDelim = '$'; /* For inner classes */ protected final char innerDelim = '$'; /* For inner classes */
protected Hashtable doneHandleTypes; protected Hashtable<Object, Object> doneHandleTypes;
MemberDoc []fields; MemberDoc []fields;
MemberDoc [] methods; MemberDoc [] methods;
private boolean doubleAlign; private boolean doubleAlign;
@ -68,7 +68,7 @@ public class LLNI extends Gen {
protected void generateDeclsForClass(PrintWriter pw, protected void generateDeclsForClass(PrintWriter pw,
ClassDoc clazz, String cname) ClassDoc clazz, String cname)
throws ClassNotFoundException { throws ClassNotFoundException {
doneHandleTypes = new Hashtable(); doneHandleTypes = new Hashtable<Object, Object>();
/* The following handle types are predefined in "typedefs.h". Suppress /* The following handle types are predefined in "typedefs.h". Suppress
inclusion in the output by generating them "into the blue" here. */ inclusion in the output by generating them "into the blue" here. */
genHandleType(null, "java.lang.Class"); genHandleType(null, "java.lang.Class");

View File

@ -74,7 +74,7 @@ public class TypeSignature{
String signature = null; //Java type signature. String signature = null; //Java type signature.
String typeSignature = null; //Internal type signature. String typeSignature = null; //Internal type signature.
Vector params = new Vector(); //List of parameters. Vector<Object> params = new Vector<Object>(); //List of parameters.
String paramsig = null; //Java parameter signature. String paramsig = null; //Java parameter signature.
String paramJVMSig = null; //Internal parameter signature. String paramJVMSig = null; //Internal parameter signature.
String returnSig = null; //Java return type signature. String returnSig = null; //Java return type signature.

View File

@ -157,7 +157,7 @@ public class FieldData implements RuntimeConstants {
/** /**
* Returns list of attributes of field. * Returns list of attributes of field.
*/ */
public Vector getAttributes(){ public Vector<?> getAttributes(){
return attrs; return attrs;
} }
} }

View File

@ -175,7 +175,7 @@ public class JavapPrinter {
/* print field attribute information. */ /* print field attribute information. */
public void printFieldAttributes(FieldData field){ public void printFieldAttributes(FieldData field){
Vector fieldattrs = field.getAttributes(); Vector<?> fieldattrs = field.getAttributes();
for(int j = 0; j < fieldattrs.size(); j++){ for(int j = 0; j < fieldattrs.size(); j++){
String fieldattrname = ((AttrData)fieldattrs.elementAt(j)).getAttrName(); String fieldattrname = ((AttrData)fieldattrs.elementAt(j)).getAttrName();
if(fieldattrname.equals("ConstantValue")){ if(fieldattrname.equals("ConstantValue")){
@ -256,8 +256,8 @@ public class JavapPrinter {
* print method attribute information. * print method attribute information.
*/ */
public void printMethodAttributes(MethodData method){ public void printMethodAttributes(MethodData method){
Vector methodattrs = method.getAttributes(); Vector<?> methodattrs = method.getAttributes();
Vector codeattrs = method.getCodeAttributes(); Vector<?> codeattrs = method.getCodeAttributes();
for(int k = 0; k < methodattrs.size(); k++){ for(int k = 0; k < methodattrs.size(); k++){
String methodattrname = ((AttrData)methodattrs.elementAt(k)).getAttrName(); String methodattrname = ((AttrData)methodattrs.elementAt(k)).getAttrName();
if(methodattrname.equals("Code")){ if(methodattrname.equals("Code")){
@ -519,7 +519,7 @@ public class JavapPrinter {
* Print the exception table for this method code * Print the exception table for this method code
*/ */
void printExceptionTable(MethodData method){//throws IOException void printExceptionTable(MethodData method){//throws IOException
Vector exception_table = method.getexception_table(); Vector<?> exception_table = method.getexception_table();
if (exception_table.size() > 0) { if (exception_table.size() > 0) {
out.println(" Exception table:"); out.println(" Exception table:");
out.println(" from to target type"); out.println(" from to target type");
@ -546,7 +546,7 @@ public class JavapPrinter {
*/ */
public void printLineNumTable(MethodData method) { public void printLineNumTable(MethodData method) {
int numlines = method.getnumlines(); int numlines = method.getnumlines();
Vector lin_num_tb = method.getlin_num_tb(); Vector<?> lin_num_tb = method.getlin_num_tb();
if( lin_num_tb.size() > 0){ if( lin_num_tb.size() > 0){
out.println(" LineNumberTable: "); out.println(" LineNumberTable: ");
for (int i=0; i<numlines; i++) { for (int i=0; i<numlines; i++) {
@ -568,7 +568,7 @@ public class JavapPrinter {
out.print(" "); out.print(" ");
out.println("Start Length Slot Name Signature"); out.println("Start Length Slot Name Signature");
} }
Vector loc_var_tb = method.getloc_var_tb(); Vector<?> loc_var_tb = method.getloc_var_tb();
for (int i=0; i<siz; i++) { for (int i=0; i<siz; i++) {
LocVarData entry=(LocVarData)loc_var_tb.elementAt(i); LocVarData entry=(LocVarData)loc_var_tb.elementAt(i);

View File

@ -302,7 +302,7 @@ public class MethodData {
/** /**
* Return LineNumberTable * Return LineNumberTable
*/ */
public Vector getlin_num_tb(){ public Vector<?> getlin_num_tb(){
return lin_num_tb; return lin_num_tb;
} }
@ -317,7 +317,7 @@ public class MethodData {
/** /**
* Return LocalVariableTable. * Return LocalVariableTable.
*/ */
public Vector getloc_var_tb(){ public Vector<?> getloc_var_tb(){
return loc_var_tb; return loc_var_tb;
} }
@ -378,7 +378,7 @@ public class MethodData {
/** /**
* Return exception table in code attributre. * Return exception table in code attributre.
*/ */
public Vector getexception_table(){ public Vector<?> getexception_table(){
return exception_table; return exception_table;
} }
@ -386,7 +386,7 @@ public class MethodData {
/** /**
* Return method attributes. * Return method attributes.
*/ */
public Vector getAttributes(){ public Vector<?> getAttributes(){
return attrs; return attrs;
} }
@ -394,7 +394,7 @@ public class MethodData {
/** /**
* Return code attributes. * Return code attributes.
*/ */
public Vector getCodeAttributes(){ public Vector<?> getCodeAttributes(){
return code_attrs; return code_attrs;
} }