Mercurial > hg > release > icedtea7-forest-2.2 > langtools
changeset 197:b4b1f7732289
6795903: fix latent build warnings in langtools repository
Reviewed-by: darcy
line wrap: on
line diff
--- a/make/build.properties Tue Jan 20 15:17:45 2009 -0800 +++ b/make/build.properties Tue Jan 20 18:23:13 2009 -0800 @@ -66,7 +66,7 @@ # set the following to -version to verify the versions of javac being used javac.version.opt = # in time, there should be no exceptions to -Xlint:all -javac.lint.opts = -Xlint:all,-deprecation,-fallthrough,-serial,-unchecked,-cast +javac.lint.opts = -Xlint:all -Werror # options for the <javadoc> task for javac javadoc.jls3.url=http://java.sun.com/docs/books/jls/
--- a/src/share/classes/com/sun/tools/apt/comp/AnnotationProcessingError.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/comp/AnnotationProcessingError.java Tue Jan 20 18:23:13 2009 -0800 @@ -26,6 +26,7 @@ package com.sun.tools.apt.comp; public class AnnotationProcessingError extends Error { + private static final long serialVersionUID = 3279196183341719287L; AnnotationProcessingError(Throwable cause) { super(cause); }
--- a/src/share/classes/com/sun/tools/apt/comp/Apt.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/comp/Apt.java Tue Jan 20 18:23:13 2009 -0800 @@ -316,8 +316,13 @@ } providers = list.iterator(); - } else - providers = sun.misc.Service.providers(AnnotationProcessorFactory.class, aptCL); + } else { + @SuppressWarnings("unchecked") + Iterator<AnnotationProcessorFactory> iter = + sun.misc.Service.providers(AnnotationProcessorFactory.class, aptCL); + providers = iter; + + } } java.util.Map<AnnotationProcessorFactory, Set<AnnotationTypeDeclaration>> factoryToAnnotation =
--- a/src/share/classes/com/sun/tools/apt/comp/UsageMessageNeededException.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/comp/UsageMessageNeededException.java Tue Jan 20 18:23:13 2009 -0800 @@ -26,4 +26,6 @@ package com.sun.tools.apt.comp; -public class UsageMessageNeededException extends RuntimeException {} +public class UsageMessageNeededException extends RuntimeException { + private static final long serialVersionUID = -3265159608992825840L; +}
--- a/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java Tue Jan 20 18:23:13 2009 -0800 @@ -233,6 +233,7 @@ ListBuffer<ClassSymbol> classes = new ListBuffer<ClassSymbol>(); try { + JavacFileManager fm = (JavacFileManager)fileManager; //parse all files ListBuffer<JCCompilationUnit> trees = new ListBuffer<JCCompilationUnit>(); for (List<String> l = filenames; l.nonEmpty(); l = l.tail) { @@ -250,7 +251,8 @@ continue; } } - trees.append(parse(l.head)); + JavaFileObject fo = fm.getJavaFileObjectsFromStrings(List.of(l.head)).iterator().next(); + trees.append(parse(fo)); } //enter symbols for all files
--- a/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java Tue Jan 20 18:23:13 2009 -0800 @@ -30,6 +30,8 @@ import com.sun.mirror.apt.RoundState; public class RoundCompleteEventImpl extends RoundCompleteEvent { + private static final long serialVersionUID = 7067621446720784300L; + public RoundCompleteEventImpl(AnnotationProcessorEnvironment source, RoundState rs) { super(source, rs);
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java Tue Jan 20 18:23:13 2009 -0800 @@ -252,6 +252,7 @@ */ private void typeMismatch(final Method method, final Attribute attr) { value = new ExceptionProxy() { + private static final long serialVersionUID = 8473323277815075163L; public String toString() { return "<error>"; // eg: @Anno(value=<error>) } @@ -270,6 +271,7 @@ * type. */ private static class MirroredTypeExceptionProxy extends ExceptionProxy { + private static final long serialVersionUID = 6662035281599933545L; private MirroredTypeException ex; @@ -311,6 +313,7 @@ * types. */ private static class MirroredTypesExceptionProxy extends ExceptionProxy { + private static final long serialVersionUID = -6670822532616693951L; private MirroredTypesException ex;
--- a/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java Tue Jan 20 18:23:13 2009 -0800 @@ -64,7 +64,7 @@ * {@inheritDoc} */ public TypeParameterDeclaration getDeclaration() { - TypeSymbol sym = (TypeSymbol) type.tsym; + TypeSymbol sym = type.tsym; return env.declMaker.getTypeParameterDeclaration(sym); }
--- a/src/share/classes/com/sun/tools/classfile/Annotation.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/Annotation.java Tue Jan 20 18:23:13 2009 -0800 @@ -37,6 +37,7 @@ */ public class Annotation { static class InvalidAnnotation extends AttributeException { + private static final long serialVersionUID = -4620480740735772708L; InvalidAnnotation(String msg) { super(msg); }
--- a/src/share/classes/com/sun/tools/classfile/AttributeException.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/AttributeException.java Tue Jan 20 18:23:13 2009 -0800 @@ -32,6 +32,7 @@ * deletion without notice.</b> */ public class AttributeException extends Exception { + private static final long serialVersionUID = -4231486387714867770L; AttributeException() { } AttributeException(String msg) {
--- a/src/share/classes/com/sun/tools/classfile/Code_attribute.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/Code_attribute.java Tue Jan 20 18:23:13 2009 -0800 @@ -37,6 +37,7 @@ */ public class Code_attribute extends Attribute { public class InvalidIndex extends AttributeException { + private static final long serialVersionUID = -8904527774589382802L; InvalidIndex(int index) { this.index = index; }
--- a/src/share/classes/com/sun/tools/classfile/ConstantPool.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/ConstantPool.java Tue Jan 20 18:23:13 2009 -0800 @@ -38,6 +38,7 @@ public class ConstantPool { public class InvalidIndex extends ConstantPoolException { + private static final long serialVersionUID = -4350294289300939730L; InvalidIndex(int index) { super(index); } @@ -50,6 +51,7 @@ } public class UnexpectedEntry extends ConstantPoolException { + private static final long serialVersionUID = 6986335935377933211L; UnexpectedEntry(int index, int expected_tag, int found_tag) { super(index); this.expected_tag = expected_tag; @@ -67,6 +69,7 @@ } public class InvalidEntry extends ConstantPoolException { + private static final long serialVersionUID = 1000087545585204447L; InvalidEntry(int index, int tag) { super(index); this.tag = tag; @@ -82,6 +85,7 @@ } public class EntryNotFound extends ConstantPoolException { + private static final long serialVersionUID = 2885537606468581850L; EntryNotFound(Object value) { super(-1); this.value = value;
--- a/src/share/classes/com/sun/tools/classfile/ConstantPoolException.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/ConstantPoolException.java Tue Jan 20 18:23:13 2009 -0800 @@ -33,6 +33,7 @@ * deletion without notice.</b> */ public class ConstantPoolException extends Exception { + private static final long serialVersionUID = -2324397349644754565L; ConstantPoolException(int index) { this.index = index; }
--- a/src/share/classes/com/sun/tools/classfile/Descriptor.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/Descriptor.java Tue Jan 20 18:23:13 2009 -0800 @@ -38,6 +38,7 @@ */ public class Descriptor { public class InvalidDescriptor extends DescriptorException { + private static final long serialVersionUID = 1L; InvalidDescriptor(String desc) { this.desc = desc; this.index = -1;
--- a/src/share/classes/com/sun/tools/classfile/DescriptorException.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/DescriptorException.java Tue Jan 20 18:23:13 2009 -0800 @@ -33,4 +33,5 @@ * deletion without notice.</b> */ public class DescriptorException extends Exception { + private static final long serialVersionUID = 2411890273788901032L; }
--- a/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java Tue Jan 20 18:23:13 2009 -0800 @@ -37,6 +37,7 @@ */ public class StackMapTable_attribute extends Attribute { static class InvalidStackMap extends AttributeException { + private static final long serialVersionUID = -5659038410855089780L; InvalidStackMap(String msg) { super(msg); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Tue Jan 20 18:23:13 2009 -0800 @@ -119,7 +119,7 @@ */ protected void generateIndex() { for (int i = 0; i < groupList.size(); i++) { - String groupname = (String)groupList.get(i); + String groupname = groupList.get(i); List<PackageDoc> list = groupPackageMap.get(groupname); if (list != null && list.size() > 0) { printIndexContents(list.toArray(new PackageDoc[list.size()]),
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Tue Jan 20 18:23:13 2009 -0800 @@ -402,7 +402,7 @@ public void buildFieldSerializationOverview(ClassDoc classDoc) { if (classDoc.definesSerializableFields()) { FieldDoc serialPersistentField = - (FieldDoc)((Util.asList(classDoc.serializableFields()).get(0))); + Util.asList(classDoc.serializableFields()).get(0); String comment = serialPersistentField.commentText(); if (comment.length() > 0) { fieldWriter.writeHeader(
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletAbortException.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletAbortException.java Tue Jan 20 18:23:13 2009 -0800 @@ -26,6 +26,7 @@ package com.sun.tools.doclets.internal.toolkit.util; public class DocletAbortException extends RuntimeException { + private static final long serialVersionUID = -9131058909576418984L; public DocletAbortException() { }
--- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Tue Jan 20 18:23:13 2009 -0800 @@ -471,6 +471,7 @@ private int value; }; protected class CompileStates extends HashMap<Env<AttrContext>,CompileState> { + private static final long serialVersionUID = 1812267524140424433L; boolean isDone(Env<AttrContext> env, CompileState cs) { CompileState ecs = get(env); return ecs != null && ecs.isDone(cs);
--- a/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java Tue Jan 20 18:23:13 2009 -0800 @@ -61,6 +61,7 @@ * @param opts list of command-line options * @param msgs JavacMessages object used for i18n */ + @SuppressWarnings("fallthrough") BasicDiagnosticFormatter(Options opts, JavacMessages msgs) { super(msgs, opts, true); initAvailableFormats();
--- a/src/share/classes/com/sun/tools/javadoc/Comment.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javadoc/Comment.java Tue Jan 20 18:23:13 2009 -0800 @@ -74,6 +74,7 @@ * the tag text. * </pre> */ + @SuppressWarnings("fallthrough") class CommentStringParser { /** * The entry point to the comment string parser
--- a/src/share/classes/com/sun/tools/javadoc/Messager.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javadoc/Messager.java Tue Jan 20 18:23:13 2009 -0800 @@ -111,6 +111,7 @@ * @param warnWriter Stream for warnings * @param noticeWriter Stream for other messages */ + @SuppressWarnings("deprecation") protected Messager(Context context, String programName, PrintWriter errWriter,
--- a/src/share/classes/com/sun/tools/javadoc/TypeMaker.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javadoc/TypeMaker.java Tue Jan 20 18:23:13 2009 -0800 @@ -51,6 +51,7 @@ * @param errToClassDoc if true, ERROR type results in a ClassDoc; * false preserves legacy behavior */ + @SuppressWarnings("fallthrough") public static com.sun.javadoc.Type getType(DocEnv env, Type t, boolean errToClassDoc) { if (env.legacyDoclet) {
--- a/src/share/classes/com/sun/tools/javah/Gen.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javah/Gen.java Tue Jan 20 18:23:13 2009 -0800 @@ -342,6 +342,6 @@ fields.addAll(Arrays.asList(cd.fields())); } - return (FieldDoc[]) fields.toArray(new FieldDoc[fields.size()]); + return fields.toArray(new FieldDoc[fields.size()]); } }
--- a/src/share/classes/com/sun/tools/javap/InternalError.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/com/sun/tools/javap/InternalError.java Tue Jan 20 18:23:13 2009 -0800 @@ -32,6 +32,7 @@ * deletion without notice.</b> */ public class InternalError extends Error { + private static final long serialVersionUID = 8114054446416187030L; InternalError(Throwable t, Object... args) { super("Internal error", t); this.args = args;
--- a/src/share/classes/sun/tools/javap/JavapPrinter.java Tue Jan 20 15:17:45 2009 -0800 +++ b/src/share/classes/sun/tools/javap/JavapPrinter.java Tue Jan 20 18:23:13 2009 -0800 @@ -719,6 +719,7 @@ /** * Print constant pool entry information. */ + @SuppressWarnings("fallthrough") public int PrintlnConstantEntry(int cpx) { int size=1; byte tag=0; @@ -757,6 +758,7 @@ case CONSTANT_LONG: case CONSTANT_DOUBLE: size=2; + // fall through default: out.println(str+";"); }