6597471: unused imports in javax.tools.JavaCompiler
6597531: unused imports and unused private const. in com.sun.tools.javac.Server.java
Reviewed-by: mcimadamore
Contributed-by: davide.angelocola@gmail.com
--- a/langtools/src/share/classes/com/sun/tools/javac/Server.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/Server.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,9 +25,6 @@
package com.sun.tools.javac;
-import com.sun.tools.javac.main.JavacOption.Option;
-import com.sun.tools.javac.main.RecognizedOptions.GrumpyHelper;
-import com.sun.tools.javac.main.RecognizedOptions;
import java.io.*;
import java.net.*;
import java.util.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacScope.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacScope.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,41 +25,14 @@
package com.sun.tools.javac.api;
-import java.io.IOException;
-import java.lang.ref.SoftReference;
-import java.util.Iterator;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-import javax.tools.JavaFileObject;
-import com.sun.source.tree.Tree;
-import com.sun.source.util.SourcePositions;
-import com.sun.source.util.TreePath;
-import com.sun.source.util.Trees;
-import com.sun.tools.javac.code.Scope;
-import com.sun.tools.javac.code.Symbol.ClassSymbol;
-import com.sun.tools.javac.comp.Attr;
import com.sun.tools.javac.comp.AttrContext;
-import com.sun.tools.javac.comp.Enter;
import com.sun.tools.javac.comp.Env;
-import com.sun.tools.javac.comp.MemberEnter;
-import com.sun.tools.javac.comp.Resolve;
-import com.sun.tools.javac.tree.JCTree.JCClassDecl;
-import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
-import com.sun.tools.javac.tree.JCTree.JCExpression;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
-import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.tree.TreeCopier;
-import com.sun.tools.javac.tree.TreeInfo;
-import com.sun.tools.javac.tree.TreeMaker;
-import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.List;
-import com.sun.tools.javac.util.Log;
-import static com.sun.source.tree.Tree.Kind.*;
/**
--- a/langtools/src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java Fri Aug 29 11:10:12 2008 -0700
@@ -29,7 +29,6 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.tools.JavaFileObject.Kind;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java Fri Aug 29 11:10:12 2008 -0700
@@ -30,7 +30,6 @@
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.AnnotationValueVisitor;
-import javax.lang.model.element.ExecutableElement;
import javax.lang.model.type.DeclaredType;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.util.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,11 +25,8 @@
package com.sun.tools.javac.code;
-import javax.lang.model.element.Element;
-import javax.lang.model.type.*;
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.code.Symbol.*;
-import javax.lang.model.element.Element;
import javax.lang.model.type.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Fri Aug 29 11:10:12 2008 -0700
@@ -31,7 +31,6 @@
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.jvm.ClassReader;
-import com.sun.tools.javac.comp.Infer;
import com.sun.tools.javac.comp.Check;
import static com.sun.tools.javac.code.Type.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java Fri Aug 29 11:10:12 2008 -0700
@@ -26,7 +26,6 @@
package com.sun.tools.javac.comp;
import java.util.*;
-import java.util.Set;
import javax.tools.JavaFileObject;
import javax.tools.JavaFileManager;
@@ -43,7 +42,6 @@
import static com.sun.tools.javac.code.Flags.*;
import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
/** This class enters symbols for all encountered definitions into
* the symbol table. The pass consists of two phases, organized as
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,7 +25,6 @@
package com.sun.tools.javac.comp;
-import com.sun.tools.javac.util.*;
import com.sun.tools.javac.tree.*;
import java.util.Iterator;
import java.util.NoSuchElementException;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Fri Aug 29 11:10:12 2008 -0700
@@ -31,8 +31,6 @@
import com.sun.tools.javac.code.Type.*;
import com.sun.tools.javac.util.JCDiagnostic;
-import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.Kinds.*;
import static com.sun.tools.javac.code.TypeTags.*;
/** Helper class for type parameter inference, used by the attribution phase.
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,7 +25,6 @@
package com.sun.tools.javac.jvm;
-import com.sun.tools.javac.util.*;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
@@ -33,7 +32,6 @@
import com.sun.tools.javac.jvm.Code.*;
import com.sun.tools.javac.tree.JCTree;
-import static com.sun.tools.javac.code.TypeTags.*;
import static com.sun.tools.javac.jvm.ByteCodes.*;
/** A helper class for code generation. Items are objects
@@ -449,9 +447,7 @@
Item invoke() {
MethodType mtype = (MethodType)member.erasure(types);
- int argsize = Code.width(mtype.argtypes);
int rescode = Code.typecode(mtype.restype);
- int sdiff = Code.width(rescode) - argsize;
code.emitInvokestatic(pool.put(member), mtype);
return stackItem[rescode];
}
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java Fri Aug 29 11:10:12 2008 -0700
@@ -27,9 +27,7 @@
import java.util.*;
-import com.sun.tools.javac.util.*;
import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.code.Type;
/** An internal structure that corresponds to the constant pool of a classfile.
*
--- a/langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java Fri Aug 29 11:10:12 2008 -0700
@@ -38,12 +38,10 @@
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
-import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.Set;
-import java.util.StringTokenizer;
import javax.lang.model.SourceVersion;
import static com.sun.tools.javac.main.OptionName.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/model/FilteredMemberList.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/FilteredMemberList.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,7 +25,6 @@
package com.sun.tools.javac.model;
-import com.sun.tools.javac.util.*;
import java.util.AbstractList;
import java.util.Iterator;
import java.util.NoSuchElementException;
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentScanner.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentScanner.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,7 +25,6 @@
package com.sun.tools.javac.parser;
-import java.io.*;
import java.nio.*;
import com.sun.tools.javac.util.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/EndPosParser.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/EndPosParser.java Fri Aug 29 11:10:12 2008 -0700
@@ -29,8 +29,6 @@
import java.util.HashMap;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.TreeInfo;
-import com.sun.tools.javac.util.Position;
-import com.sun.tools.javac.util.List;
import static com.sun.tools.javac.tree.JCTree.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacFiler.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacFiler.java Fri Aug 29 11:10:12 2008 -0700
@@ -34,18 +34,14 @@
import java.util.*;
import java.io.Closeable;
-import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
-import java.io.OutputStreamWriter;
import java.io.FilterOutputStream;
import java.io.Reader;
import java.io.Writer;
import java.io.FilterWriter;
import java.io.PrintWriter;
import java.io.IOException;
-import java.net.URI;
-import javax.tools.FileObject;
import javax.tools.*;
import static java.util.Collections.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacMessager.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacMessager.java Fri Aug 29 11:10:12 2008 -0700
@@ -27,15 +27,12 @@
import com.sun.tools.javac.model.JavacElements;
import com.sun.tools.javac.util.*;
-import com.sun.tools.javac.comp.*;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.util.Position;
import javax.lang.model.element.*;
import javax.tools.JavaFileObject;
import javax.tools.Diagnostic;
import javax.annotation.processing.*;
-import java.util.*;
/**
* An implementation of the Messager built on top of log.
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Fri Aug 29 11:10:12 2008 -0700
@@ -26,8 +26,6 @@
package com.sun.tools.javac.processing;
import java.lang.annotation.Annotation;
-import com.sun.tools.javac.util.*;
-import com.sun.tools.javac.comp.*;
import com.sun.tools.javac.tree.JCTree.*;
import javax.annotation.processing.*;
import javax.lang.model.element.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java Fri Aug 29 11:10:12 2008 -0700
@@ -32,7 +32,6 @@
import static javax.lang.model.element.NestingKind.*;
import javax.lang.model.type.*;
import javax.lang.model.util.*;
-import static javax.lang.model.util.ElementFilter.*;
import java.io.PrintWriter;
import java.io.Writer;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/ServiceProxy.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/ServiceProxy.java Fri Aug 29 11:10:12 2008 -0700
@@ -32,10 +32,6 @@
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
/**
* Utility class to determine if a service can be found on the
--- a/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java Fri Aug 29 11:10:12 2008 -0700
@@ -39,7 +39,6 @@
import com.sun.tools.javac.processing.JavacProcessingEnvironment;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Pair;
-import com.sun.tools.javac.util.Name;
import java.io.File;
import java.io.IOException;
@@ -47,7 +46,6 @@
import java.util.EnumSet;
import java.util.Enumeration;
import java.util.HashSet;
-import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set;
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java Fri Aug 29 11:10:12 2008 -0700
@@ -27,9 +27,7 @@
import java.util.*;
-import java.io.File;
import java.io.IOException;
-import java.io.PrintWriter;
import java.io.StringWriter;
import javax.lang.model.element.Modifier;
import javax.lang.model.type.TypeKind;
@@ -41,7 +39,6 @@
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.Symbol.*;
-import com.sun.source.tree.Tree;
import com.sun.source.tree.*;
import static com.sun.tools.javac.code.BoundKind.*;
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,12 +25,10 @@
package com.sun.tools.javac.tree;
-import com.sun.source.tree.Tree;
import com.sun.source.tree.*;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
-import java.util.Map;
/**
* Creates a copy of a tree, using a given TreeMaker.
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Fri Aug 29 11:10:12 2008 -0700
@@ -35,7 +35,6 @@
import com.sun.tools.javac.tree.JCTree.*;
import static com.sun.tools.javac.code.Flags.*;
-import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition;
/** Utility class containing inspector methods for trees.
*
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Context.java Tue Aug 26 14:52:59 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Context.java Fri Aug 29 11:10:12 2008 -0700
@@ -25,7 +25,6 @@
package com.sun.tools.javac.util;
-import com.sun.tools.javac.Main;
import java.util.*;
/**