--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -158,10 +158,10 @@
} else {
initContext();
compilerMain.setOptions(Options.instance(context));
- compilerMain.filenames = new ListBuffer<File>();
- List<File> filenames = compilerMain.processArgs(CommandLine.parse(args));
+ compilerMain.filenames = new LinkedHashSet<File>();
+ Collection<File> filenames = compilerMain.processArgs(CommandLine.parse(args));
if (!filenames.isEmpty())
- throw new IllegalArgumentException("Malformed arguments " + filenames.toString(" "));
+ throw new IllegalArgumentException("Malformed arguments " + toString(filenames, " "));
compiler = JavaCompiler.instance(context);
compiler.keepComments = true;
compiler.genEndPos = true;
@@ -177,6 +177,17 @@
}
}
+ <T> String toString(Iterable<T> items, String sep) {
+ String currSep = "";
+ StringBuilder sb = new StringBuilder();
+ for (T item: items) {
+ sb.append(currSep);
+ sb.append(item.toString());
+ currSep = sep;
+ }
+ return sb.toString();
+ }
+
private void initContext() {
context.put(JavacTaskImpl.class, this);
if (context.get(TaskListener.class) != null)
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java Fri Jul 22 21:31:14 2011 -0700
@@ -31,7 +31,10 @@
import java.net.URL;
import java.security.DigestInputStream;
import java.security.MessageDigest;
+import java.util.Collection;
+import java.util.LinkedHashSet;
import java.util.MissingResourceException;
+import java.util.Set;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import javax.annotation.processing.Processor;
@@ -107,8 +110,7 @@
}
public void addFile(File f) {
- if (!filenames.contains(f))
- filenames.append(f);
+ filenames.add(f);
}
public void addClassName(String s) {
@@ -136,7 +138,7 @@
/** The list of source files to process
*/
- public ListBuffer<File> filenames = null; // XXX sb protected
+ public Set<File> filenames = null; // XXX sb protected
/** List of class files names passed on the command line
*/
@@ -202,7 +204,7 @@
* in `options' table and return all source filenames.
* @param flags The array of command line arguments.
*/
- public List<File> processArgs(String[] flags) { // XXX sb protected
+ public Collection<File> processArgs(String[] flags) { // XXX sb protected
int ac = 0;
while (ac < flags.length) {
String flag = flags[ac];
@@ -294,7 +296,7 @@
showClass(showClass);
}
- return filenames.toList();
+ return filenames;
}
// where
private boolean checkDirectory(OptionName optName) {
@@ -342,7 +344,7 @@
if (options == null)
options = Options.instance(context); // creates a new one
- filenames = new ListBuffer<File>();
+ filenames = new LinkedHashSet<File>();
classnames = new ListBuffer<String>();
JavaCompiler comp = null;
/*
@@ -356,7 +358,7 @@
return EXIT_CMDERR;
}
- List<File> files;
+ Collection<File> files;
try {
files = processArgs(CommandLine.parse(args));
if (files == null) {
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Fri Jul 22 21:31:14 2011 -0700
@@ -720,7 +720,7 @@
* Leave class public for external testing purposes.
*/
public static class ComputeAnnotationSet extends
- ElementScanner7<Set<TypeElement>, Set<TypeElement>> {
+ ElementScanner8<Set<TypeElement>, Set<TypeElement>> {
final Elements elements;
public ComputeAnnotationSet(Elements elements) {
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -125,7 +125,7 @@
else
throw new AssertionError("Bad implementation type for " + tm);
- ElementScanner7<Set<Element>, DeclaredType> scanner =
+ ElementScanner8<Set<Element>, DeclaredType> scanner =
new AnnotationSetScanner(result, typeUtil);
for (Element element : rootElements)
@@ -136,7 +136,7 @@
// Could be written as a local class inside getElementsAnnotatedWith
private class AnnotationSetScanner extends
- ElementScanner7<Set<Element>, DeclaredType> {
+ ElementScanner8<Set<Element>, DeclaredType> {
// Insertion-order preserving set
Set<Element> annotatedElements = new LinkedHashSet<Element>();
Types typeUtil;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java Fri Jul 22 21:31:14 2011 -0700
@@ -82,7 +82,7 @@
* Used for the -Xprint option and called by Elements.printElements
*/
public static class PrintingElementVisitor
- extends SimpleElementVisitor7<PrintingElementVisitor, Boolean> {
+ extends SimpleElementVisitor8<PrintingElementVisitor, Boolean> {
int indentation; // Indentation level;
final PrintWriter writer;
final Elements elementUtils;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,11 +46,11 @@
public class AnnotationTypeDocImpl
extends ClassDocImpl implements AnnotationTypeDoc {
- AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym) {
+ public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym) {
this(env, sym, null, null, null);
}
- AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym,
+ public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym,
String doc, JCClassDecl tree, Position.LineMap lineMap) {
super(env, sym, doc, tree, lineMap);
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,11 +45,11 @@
public class AnnotationTypeElementDocImpl
extends MethodDocImpl implements AnnotationTypeElementDoc {
- AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym) {
+ public AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym) {
super(env, sym);
}
- AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym,
+ public AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym,
String doc, JCMethodDecl tree, Position.LineMap lineMap) {
super(env, sym, doc, tree, lineMap);
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@
final Symbol externalizableSym;
/** Access filter (public, protected, ...). */
- ModifierFilter showAccess;
+ protected ModifierFilter showAccess;
/** True if we are using a sentence BreakIterator. */
boolean breakiterator;
@@ -102,7 +102,7 @@
boolean docClasses = false;
/** Does the doclet only expect pre-1.5 doclet API? */
- boolean legacyDoclet = true;
+ protected boolean legacyDoclet = true;
/**
* Set this to true if you would like to not emit any errors, warnings and
@@ -115,7 +115,7 @@
*
* @param context Context for this javadoc instance.
*/
- private DocEnv(Context context) {
+ protected DocEnv(Context context) {
context.put(docEnvKey, this);
messager = Messager.instance0(context);
@@ -517,7 +517,7 @@
messager.exit();
}
- private Map<PackageSymbol, PackageDocImpl> packageMap =
+ protected Map<PackageSymbol, PackageDocImpl> packageMap =
new HashMap<PackageSymbol, PackageDocImpl>();
/**
* Return the PackageDoc of this package symbol.
@@ -545,12 +545,12 @@
}
- private Map<ClassSymbol, ClassDocImpl> classMap =
+ protected Map<ClassSymbol, ClassDocImpl> classMap =
new HashMap<ClassSymbol, ClassDocImpl>();
/**
* Return the ClassDoc (or a subtype) of this class symbol.
*/
- ClassDocImpl getClassDoc(ClassSymbol clazz) {
+ public ClassDocImpl getClassDoc(ClassSymbol clazz) {
ClassDocImpl result = classMap.get(clazz);
if (result != null) return result;
if (isAnnotationType(clazz)) {
@@ -565,7 +565,7 @@
/**
* Create the ClassDoc (or a subtype) for a class symbol.
*/
- void makeClassDoc(ClassSymbol clazz, String docComment, JCClassDecl tree, Position.LineMap lineMap) {
+ protected void makeClassDoc(ClassSymbol clazz, String docComment, JCClassDecl tree, Position.LineMap lineMap) {
ClassDocImpl result = classMap.get(clazz);
if (result != null) {
if (docComment != null) result.setRawCommentText(docComment);
@@ -580,20 +580,20 @@
classMap.put(clazz, result);
}
- private static boolean isAnnotationType(ClassSymbol clazz) {
+ protected static boolean isAnnotationType(ClassSymbol clazz) {
return ClassDocImpl.isAnnotationType(clazz);
}
- private static boolean isAnnotationType(JCClassDecl tree) {
+ protected static boolean isAnnotationType(JCClassDecl tree) {
return (tree.mods.flags & Flags.ANNOTATION) != 0;
}
- private Map<VarSymbol, FieldDocImpl> fieldMap =
+ protected Map<VarSymbol, FieldDocImpl> fieldMap =
new HashMap<VarSymbol, FieldDocImpl>();
/**
* Return the FieldDoc of this var symbol.
*/
- FieldDocImpl getFieldDoc(VarSymbol var) {
+ public FieldDocImpl getFieldDoc(VarSymbol var) {
FieldDocImpl result = fieldMap.get(var);
if (result != null) return result;
result = new FieldDocImpl(this, var);
@@ -603,7 +603,7 @@
/**
* Create a FieldDoc for a var symbol.
*/
- void makeFieldDoc(VarSymbol var, String docComment, JCVariableDecl tree, Position.LineMap lineMap) {
+ protected void makeFieldDoc(VarSymbol var, String docComment, JCVariableDecl tree, Position.LineMap lineMap) {
FieldDocImpl result = fieldMap.get(var);
if (result != null) {
if (docComment != null) result.setRawCommentText(docComment);
@@ -614,13 +614,13 @@
}
}
- private Map<MethodSymbol, ExecutableMemberDocImpl> methodMap =
+ protected Map<MethodSymbol, ExecutableMemberDocImpl> methodMap =
new HashMap<MethodSymbol, ExecutableMemberDocImpl>();
/**
* Create a MethodDoc for this MethodSymbol.
* Should be called only on symbols representing methods.
*/
- void makeMethodDoc(MethodSymbol meth, String docComment,
+ protected void makeMethodDoc(MethodSymbol meth, String docComment,
JCMethodDecl tree, Position.LineMap lineMap) {
MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
if (result != null) {
@@ -649,7 +649,7 @@
* Create the ConstructorDoc for a MethodSymbol.
* Should be called only on symbols representing constructors.
*/
- void makeConstructorDoc(MethodSymbol meth, String docComment,
+ protected void makeConstructorDoc(MethodSymbol meth, String docComment,
JCMethodDecl tree, Position.LineMap lineMap) {
ConstructorDocImpl result = (ConstructorDocImpl)methodMap.get(meth);
if (result != null) {
@@ -678,7 +678,7 @@
* Create the AnnotationTypeElementDoc for a MethodSymbol.
* Should be called only on symbols representing annotation type elements.
*/
- void makeAnnotationTypeElementDoc(MethodSymbol meth,
+ protected void makeAnnotationTypeElementDoc(MethodSymbol meth,
String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
AnnotationTypeElementDocImpl result =
(AnnotationTypeElementDocImpl)methodMap.get(meth);
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -92,7 +92,7 @@
* So subclasses have the option to do lazy initialization of
* "documentation" string.
*/
- String documentation() {
+ protected String documentation() {
if (documentation == null) documentation = "";
return documentation;
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java Fri Jul 22 21:31:14 2011 -0700
@@ -35,7 +35,7 @@
/** Javadoc uses an extended class reader that records package.html entries
* @author Neal Gafter
*/
-class JavadocClassReader extends ClassReader {
+public class JavadocClassReader extends ClassReader {
public static JavadocClassReader instance0(Context context) {
ClassReader instance = context.get(classReaderKey);
@@ -59,7 +59,7 @@
private EnumSet<JavaFileObject.Kind> noSource = EnumSet.of(JavaFileObject.Kind.CLASS,
JavaFileObject.Kind.HTML);
- private JavadocClassReader(Context context) {
+ public JavadocClassReader(Context context) {
super(context, true);
docenv = DocEnv.instance(context);
preferSource = true;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java Fri Jul 22 21:31:14 2011 -0700
@@ -38,7 +38,7 @@
* done by javac.
* @author Neal Gafter
*/
-class JavadocMemberEnter extends MemberEnter {
+public class JavadocMemberEnter extends MemberEnter {
public static JavadocMemberEnter instance0(Context context) {
MemberEnter instance = context.get(memberEnterKey);
if (instance == null)
--- a/langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
/**
* Do lazy initialization of "documentation" string.
*/
- String documentation() {
+ protected String documentation() {
if (documentation != null)
return documentation;
if (docPath != null) {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ParamTagImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ParamTagImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,11 @@
private final String parameterComment;
private final boolean isTypeParameter;
+ /**
+ * Cached inline tags.
+ */
+ private Tag[] inlineTags;
+
ParamTagImpl(DocImpl holder, String name, String text) {
super(holder, name, text);
String[] sa = divideAtWhite();
@@ -71,6 +76,7 @@
/**
* Return the kind of this tag.
*/
+ @Override
public String kind() {
return "@param";
}
@@ -85,6 +91,7 @@
/**
* convert this object to a string.
*/
+ @Override
public String toString() {
return name + ":" + text;
}
@@ -97,7 +104,11 @@
* @see TagImpl#inlineTagImpls()
* @see ThrowsTagImpl#inlineTagImpls()
*/
+ @Override
public Tag[] inlineTags() {
- return Comment.getInlineTags(holder, parameterComment);
+ if (inlineTags == null) {
+ inlineTags = Comment.getInlineTags(holder, parameterComment);
+ }
+ return inlineTags;
}
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/SerialFieldTagImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/SerialFieldTagImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,9 @@
*/
private void parseSerialFieldString() {
int len = text.length();
+ if (len == 0) {
+ return;
+ }
// if no white space found
/* Skip white space. */
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ThrowsTagImpl.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ThrowsTagImpl.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,11 @@
private final String exceptionName;
private final String exceptionComment;
+ /**
+ * Cached inline tags.
+ */
+ private Tag[] inlineTags;
+
ThrowsTagImpl(DocImpl holder, String name, String text) {
super(holder, name, text);
String[] sa = divideAtWhite();
@@ -93,6 +98,7 @@
* Return the kind of this tag. Always "@throws" for instances
* of ThrowsTagImpl.
*/
+ @Override
public String kind() {
return "@throws";
}
@@ -105,7 +111,11 @@
* @see TagImpl#inlineTagImpls()
* @see ParamTagImpl#inlineTagImpls()
*/
+ @Override
public Tag[] inlineTags() {
- return Comment.getInlineTags(holder, exceptionComment());
+ if (inlineTags == null) {
+ inlineTags = Comment.getInlineTags(holder, exceptionComment());
+ }
+ return inlineTags;
}
}
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;
import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleTypeVisitor7;
+import javax.lang.model.util.SimpleTypeVisitor8;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;
@@ -753,7 +753,7 @@
}
private TypeVisitor<Void,Types> checkMethodParametersVisitor =
- new SimpleTypeVisitor7<Void,Types>() {
+ new SimpleTypeVisitor8<Void,Types>() {
@Override
public Void visitArray(ArrayType t, Types types) {
visit(t.getComponentType(), types);
--- a/langtools/src/share/classes/com/sun/tools/javah/LLNI.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/LLNI.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;
import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleTypeVisitor7;
+import javax.lang.model.util.SimpleTypeVisitor8;
/*
* <p><b>This is NOT part of any supported API.
@@ -628,7 +628,7 @@
}
protected final boolean isLongOrDouble(TypeMirror t) {
- TypeVisitor<Boolean,Void> v = new SimpleTypeVisitor7<Boolean,Void>() {
+ TypeVisitor<Boolean,Void> v = new SimpleTypeVisitor8<Boolean,Void>() {
public Boolean defaultAction(TypeMirror t, Void p){
return false;
}
--- a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
import javax.lang.model.type.TypeVariable;
import javax.lang.model.type.TypeVisitor;
import javax.lang.model.util.Elements;
-import javax.lang.model.util.SimpleTypeVisitor7;
+import javax.lang.model.util.SimpleTypeVisitor8;
/**
* Returns internal type signature.
@@ -245,7 +245,7 @@
String qualifiedTypeName(TypeMirror type) {
- TypeVisitor<Name, Void> v = new SimpleTypeVisitor7<Name, Void>() {
+ TypeVisitor<Name, Void> v = new SimpleTypeVisitor8<Name, Void>() {
@Override
public Name visitArray(ArrayType t, Void p) {
return t.getComponentType().accept(this, p);
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,6 +64,7 @@
* @author Peter von der Ahé
*
* @see AbstractAnnotationValueVisitor7
+ * @see AbstractAnnotationValueVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,7 @@
* @param <P> the type of the additional parameter to this visitor's methods.
*
* @see AbstractAnnotationValueVisitor6
+ * @see AbstractAnnotationValueVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import java.util.List;
+import javax.lang.model.element.*;
+
+import javax.lang.model.type.TypeMirror;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+import javax.annotation.processing.SupportedSourceVersion;
+
+/**
+ * A skeletal visitor for annotation values with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8}
+ * source version.
+ *
+ * <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new abstract annotation
+ * value visitor class will also be introduced to correspond to the
+ * new language level; this visitor will have different default
+ * behavior for the visit method in question. When the new visitor is
+ * introduced, all or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods
+ * @param <P> the type of the additional parameter to this visitor's methods.
+ *
+ * @see AbstractAnnotationValueVisitor6
+ * @see AbstractAnnotationValueVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public abstract class AbstractAnnotationValueVisitor8<R, P> extends AbstractAnnotationValueVisitor7<R, P> {
+
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractAnnotationValueVisitor8() {
+ super();
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -67,6 +67,7 @@
* @author Peter von der Ahé
*
* @see AbstractElementVisitor7
+ * @see AbstractElementVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,7 @@
* additional parameter.
*
* @see AbstractElementVisitor6
+ * @see AbstractElementVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.element.*;
+import static javax.lang.model.element.ElementKind.*;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+
+
+/**
+ * A skeletal visitor of program elements with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8}
+ * source version.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new abstract element visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question. When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @see AbstractElementVisitor6
+ * @see AbstractElementVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public abstract class AbstractElementVisitor8<R, P> extends AbstractElementVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractElementVisitor8(){
+ super();
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -60,6 +60,7 @@
* @author Peter von der Ahé
*
* @see AbstractTypeVisitor7
+ * @see AbstractTypeVisitor8
* @since 1.6
*/
public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -56,6 +56,7 @@
* additional parameter.
*
* @see AbstractTypeVisitor6
+ * @see AbstractTypeVisitor8
* @since 1.7
*/
public abstract class AbstractTypeVisitor7<R, P> extends AbstractTypeVisitor6<R, P> {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.type.*;
+
+/**
+ * A skeletal visitor of types with default behavior appropriate for
+ * the {@link javax.lang.model.SourceVersion#RELEASE_8 RELEASE_8}
+ * source version.
+ *
+ * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
+ * by this class may have methods added to it in the future to
+ * accommodate new, currently unknown, language structures added to
+ * future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new abstract type visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question. When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @see AbstractTypeVisitor6
+ * @see AbstractTypeVisitor7
+ * @since 1.8
+ */
+public abstract class AbstractTypeVisitor8<R, P> extends AbstractTypeVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractTypeVisitor8() {
+ super();
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -78,6 +78,7 @@
* @author Peter von der Ahé
*
* @see ElementKindVisitor7
+ * @see ElementKindVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -73,6 +73,7 @@
* additional parameter.
*
* @see ElementKindVisitor6
+ * @see ElementKindVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import static javax.lang.model.element.ElementKind.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+
+/**
+ * A visitor of program elements based on their {@linkplain
+ * ElementKind kind} with default behavior appropriate for the {@link
+ * SourceVersion#RELEASE_8 RELEASE_8} source version. For {@linkplain
+ * Element elements} <tt><i>XYZ</i></tt> that may have more than one
+ * kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate
+ * to the <tt>visit<i>XYZKind</i></tt> method corresponding to the
+ * first argument's kind. The <tt>visit<i>XYZKind</i></tt> methods
+ * call {@link #defaultAction defaultAction}, passing their arguments
+ * to {@code defaultAction}'s corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it or the
+ * {@code ElementKind} {@code enum} used in this case may have
+ * constants added to it in the future to accommodate new, currently
+ * unknown, language structures added to future versions of the
+ * Java™ programming language. Therefore, methods whose names
+ * begin with {@code "visit"} may be added to this class in the
+ * future; to avoid incompatibilities, classes which extend this class
+ * should not declare any instance methods with names beginning with
+ * {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new abstract element kind
+ * visitor class will also be introduced to correspond to the new
+ * language level; this visitor will have different default behavior
+ * for the visit method in question. When the new visitor is
+ * introduced, all or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @see ElementKindVisitor6
+ * @see ElementKindVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public class ElementKindVisitor8<R, P> extends ElementKindVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected ElementKindVisitor8() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected ElementKindVisitor8(R defaultValue) {
+ super(defaultValue);
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java Fri Jul 22 21:31:14 2011 -0700
@@ -90,6 +90,7 @@
* @author Peter von der Ahé
*
* @see ElementScanner7
+ * @see ElementScanner8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java Fri Jul 22 21:31:14 2011 -0700
@@ -86,6 +86,7 @@
* additional parameter.
*
* @see ElementScanner6
+ * @see ElementScanner8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.element.ElementKind.*;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
+
+/**
+ * A scanning visitor of program elements with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8}
+ * source version. The <tt>visit<i>XYZ</i></tt> methods in this
+ * class scan their component elements by calling {@code scan} on
+ * their {@linkplain Element#getEnclosedElements enclosed elements},
+ * {@linkplain ExecutableElement#getParameters parameters}, etc., as
+ * indicated in the individual method specifications. A subclass can
+ * control the order elements are visited by overriding the
+ * <tt>visit<i>XYZ</i></tt> methods. Note that clients of a scanner
+ * may get the desired behavior be invoking {@code v.scan(e, p)} rather
+ * than {@code v.visit(e, p)} on the root objects of interest.
+ *
+ * <p>When a subclass overrides a <tt>visit<i>XYZ</i></tt> method, the
+ * new method can cause the enclosed elements to be scanned in the
+ * default way by calling <tt>super.visit<i>XYZ</i></tt>. In this
+ * fashion, the concrete visitor can control the ordering of traversal
+ * over the component elements with respect to the additional
+ * processing; for example, consistently calling
+ * <tt>super.visit<i>XYZ</i></tt> at the start of the overridden
+ * methods will yield a preorder traversal, etc. If the component
+ * elements should be traversed in some other order, instead of
+ * calling <tt>super.visit<i>XYZ</i></tt>, an overriding visit method
+ * should call {@code scan} with the elements in the desired order.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new element scanner visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question. When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @see ElementScanner6
+ * @see ElementScanner7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public class ElementScanner8<R, P> extends ElementScanner7<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected ElementScanner8(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ */
+ protected ElementScanner8(R defaultValue){
+ super(defaultValue);
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -71,6 +71,7 @@
* @author Peter von der Ahé
*
* @see SimpleAnnotationValueVisitor7
+ * @see SimpleAnnotationValueVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -66,6 +66,7 @@
* @param <P> the type of the additional parameter to this visitor's methods.
*
* @see SimpleAnnotationValueVisitor6
+ * @see SimpleAnnotationValueVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import java.util.List;
+import javax.lang.model.element.*;
+
+import javax.lang.model.type.TypeMirror;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+import javax.annotation.processing.SupportedSourceVersion;
+
+/**
+ * A simple visitor for annotation values with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8}
+ * source version. Visit methods call {@link #defaultAction
+ * defaultAction} passing their arguments to {@code defaultAction}'s
+ * corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new simple annotation
+ * value visitor class will also be introduced to correspond to the
+ * new language level; this visitor will have different default
+ * behavior for the visit method in question. When the new visitor is
+ * introduced, all or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods
+ * @param <P> the type of the additional parameter to this visitor's methods.
+ *
+ * @see SimpleAnnotationValueVisitor6
+ * @see SimpleAnnotationValueVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public class SimpleAnnotationValueVisitor8<R, P> extends SimpleAnnotationValueVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleAnnotationValueVisitor8() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleAnnotationValueVisitor8(R defaultValue) {
+ super(defaultValue);
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -76,6 +76,7 @@
* @author Peter von der Ahé
*
* @see SimpleElementVisitor7
+ * @see SimpleElementVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -69,6 +69,7 @@
* for visitors that do not need an additional parameter.
*
* @see SimpleElementVisitor6
+ * @see SimpleElementVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.element.ElementKind.*;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
+/**
+ * A simple visitor of program elements with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8}
+ * source version.
+ *
+ * Visit methods corresponding to {@code RELEASE_7} and earlier
+ * language constructs call {@link #defaultAction defaultAction},
+ * passing their arguments to {@code defaultAction}'s corresponding
+ * parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new simple element visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question. When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@code Void}
+ * for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's methods. Use {@code Void}
+ * for visitors that do not need an additional parameter.
+ *
+ * @see SimpleElementVisitor6
+ * @see SimpleElementVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public class SimpleElementVisitor8<R, P> extends SimpleElementVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleElementVisitor8(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleElementVisitor8(R defaultValue){
+ super(defaultValue);
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -75,6 +75,7 @@
* @author Peter von der Ahé
*
* @see SimpleTypeVisitor7
+ * @see SimpleTypeVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -68,6 +68,7 @@
* additional parameter.
*
* @see SimpleTypeVisitor6
+ * @see SimpleTypeVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.type.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
+/**
+ * A simple visitor of types with default behavior appropriate for the
+ * {@link SourceVersion#RELEASE_7 RELEASE_7} source version.
+ *
+ * Visit methods corresponding to {@code RELEASE_8} and earlier
+ * language constructs call {@link #defaultAction defaultAction},
+ * passing their arguments to {@code defaultAction}'s corresponding
+ * parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
+ * by this class may have methods added to it in the future to
+ * accommodate new, currently unknown, language structures added to
+ * future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new simple type visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question. When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @see SimpleTypeVisitor6
+ * @see SimpleTypeVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public class SimpleTypeVisitor8<R, P> extends SimpleTypeVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleTypeVisitor8(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleTypeVisitor8(R defaultValue){
+ super(defaultValue);
+ }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -76,6 +76,7 @@
* @author Peter von der Ahé
*
* @see TypeKindVisitor7
+ * @see TypeKindVisitor8
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
--- a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java Fri Jul 22 21:31:14 2011 -0700
@@ -71,6 +71,7 @@
* additional parameter.
*
* @see TypeKindVisitor6
+ * @see TypeKindVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor8.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.type.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.element.ElementKind.*;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+
+/**
+ * A visitor of types based on their {@linkplain TypeKind kind} with
+ * default behavior appropriate for the {@link SourceVersion#RELEASE_8
+ * RELEASE_8} source version. For {@linkplain
+ * TypeMirror types} <tt><i>XYZ</i></tt> that may have more than one
+ * kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate
+ * to the <tt>visit<i>XYZKind</i></tt> method corresponding to the
+ * first argument's kind. The <tt>visit<i>XYZKind</i></tt> methods
+ * call {@link #defaultAction defaultAction}, passing their arguments
+ * to {@code defaultAction}'s corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract. Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
+ * by this class may have methods added to it in the future to
+ * accommodate new, currently unknown, language structures added to
+ * future versions of the Java™ programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method. A new type kind visitor class
+ * will also be introduced to correspond to the new language level;
+ * this visitor will have different default behavior for the visit
+ * method in question. When the new visitor is introduced, all or
+ * portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ * methods. Use {@code Void} for visitors that do not need an
+ * additional parameter.
+ *
+ * @see TypeKindVisitor6
+ * @see TypeKindVisitor7
+ * @since 1.8
+ */
+@SupportedSourceVersion(RELEASE_8)
+public class TypeKindVisitor8<R, P> extends TypeKindVisitor7<R, P> {
+ /**
+ * Constructor for concrete subclasses to call; uses {@code null}
+ * for the default value.
+ */
+ protected TypeKindVisitor8() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses to call; uses the argument
+ * for the default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected TypeKindVisitor8(R defaultValue) {
+ super(defaultValue);
+ }
+}
--- a/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -138,7 +138,7 @@
public SourceVersion getSupportedSourceVersion() {
/*
* Return latest source version instead of a fixed version
- * like RELEASE_7. To return a fixed version, this class
+ * like RELEASE_8. To return a fixed version, this class
* could be annotated with a SupportedSourceVersion
* annotation.
*
@@ -192,7 +192,7 @@
/**
* Visitor to implement name checks.
*/
- private class NameCheckScanner extends ElementScanner7<Void, Void> {
+ private class NameCheckScanner extends ElementScanner8<Void, Void> {
// The visitor could be enhanced to return true/false if
// there were warnings reported or a count of the number
// of warnings. This could be facilitated by using
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/T6735320/SerialFieldTest.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.ObjectStreamField;
+import java.io.Serializable;
+
+public class SerialFieldTest implements Serializable {
+ /**
+ * @serialField
+ */
+ private static final ObjectStreamField[] serialPersistentFields = {
+ new ObjectStreamField("i", int.class),
+ };
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/T6735320/T6735320.java Fri Jul 22 21:31:14 2011 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6735320
+ * @summary javadoc throws exception if serialField value is missing
+ * @library ../lib/
+ * @build JavadocTester T6735320
+ * @run main T6735320
+ */
+public class T6735320 extends JavadocTester {
+
+ private static final String BUG_ID = "6735320";
+ private static final String[] ARGS = new String[]{
+ "-d", BUG_ID + ".out",
+ SRC_DIR + FS + "SerialFieldTest.java"
+ };
+
+ public String getBugId() {
+ return BUG_ID;
+ }
+
+ public String getBugName() {
+ return getClass().getName();
+ }
+
+ public static void main(String... args) {
+ T6735320 tester = new T6735320();
+ if (tester.runJavadoc(ARGS) != 0) {
+ throw new AssertionError("non-zero return code from javadoc");
+ }
+ if (tester.getErrorOutput().contains("StringIndexOutOfBoundsException")) {
+ throw new AssertionError("javadoc threw StringIndexOutOfBoundsException");
+ }
+ }
+}
--- a/langtools/test/com/sun/javadoc/lib/JavadocTester.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/com/sun/javadoc/lib/JavadocTester.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -197,8 +197,13 @@
initOutputBuffers();
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
- PrintStream prev = System.out;
+ PrintStream prevOut = System.out;
System.setOut(new PrintStream(stdout));
+
+ ByteArrayOutputStream stderr = new ByteArrayOutputStream();
+ PrintStream prevErr = System.err;
+ System.setErr(new PrintStream(stderr));
+
int returnCode = com.sun.tools.javadoc.Main.execute(
getBugName(),
new PrintWriter(errors, true),
@@ -207,8 +212,11 @@
docletClass,
getClass().getClassLoader(),
args);
- System.setOut(prev);
+ System.setOut(prevOut);
standardOut = new StringBuffer(stdout.toString());
+ System.setErr(prevErr);
+ errors.write(NL + stderr.toString());
+
printJavadocOutput();
return returnCode;
}
--- a/langtools/test/tools/javac/6402516/CheckLocalElements.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/6402516/CheckLocalElements.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
return encl == null ? "" : encl.accept(qualNameVisitor, null);
}
- private ElementVisitor<String,Void> qualNameVisitor = new SimpleElementVisitor7<String,Void>() {
+ private ElementVisitor<String,Void> qualNameVisitor = new SimpleElementVisitor8<String,Void>() {
protected String defaultAction(Element e, Void ignore) {
return "";
}
--- a/langtools/test/tools/javac/T6358166.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/T6358166.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@
Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
compilerMain.setOptions(Options.instance(context));
- compilerMain.filenames = new ListBuffer<File>();
+ compilerMain.filenames = new LinkedHashSet<File>();
compilerMain.processArgs(args);
JavaCompiler c = JavaCompiler.instance(context);
--- a/langtools/test/tools/javac/T6358168.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/T6358168.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,7 @@
Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
compilerMain.setOptions(Options.instance(context));
- compilerMain.filenames = new ListBuffer<File>();
+ compilerMain.filenames = new LinkedHashSet<File>();
compilerMain.processArgs(new String[] { "-d", "." });
JavaCompiler compiler = JavaCompiler.instance(context);
@@ -91,7 +91,7 @@
Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
compilerMain.setOptions(Options.instance(context));
- compilerMain.filenames = new ListBuffer<File>();
+ compilerMain.filenames = new LinkedHashSet<File>();
compilerMain.processArgs(new String[] {
"-XprintRounds",
"-processorpath", testClasses,
--- a/langtools/test/tools/javac/api/TestOperators.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/api/TestOperators.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
* @bug 6338064 6346249 6340951 6392177
* @summary Tree API: can't determine kind of operator
* @author Peter von der Ah\u00e9
- * @compile TestOperators.java
+ * @library ../lib
+ * @build JavacTestingAbstractProcessor TestOperators
* @compile -processor TestOperators -proc:only TestOperators.java
*/
@@ -46,7 +47,7 @@
}
@SupportedAnnotationTypes("TestMe")
-public class TestOperators extends AbstractProcessor {
+public class TestOperators extends JavacTestingAbstractProcessor {
@TestMe(POSTFIX_INCREMENT)
public int test_POSTFIX_INCREMENT(int i) {
@@ -299,7 +300,7 @@
final Trees trees = Trees.instance(processingEnv);
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
- class Scan extends ElementScanner7<Void,Void> {
+ class Scan extends ElementScanner<Void,Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
Object debug = e; // info for exception handler
@@ -343,5 +344,4 @@
}
return true;
}
-
}
--- a/langtools/test/tools/javac/enum/6350057/T6350057.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/enum/6350057/T6350057.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,11 @@
/*
* @test
- * @bug 6350057
+ * @bug 6350057 7025809
* @summary Test that parameters on implicit enum methods have the right kind
* @author Joseph D. Darcy
- * @compile T6350057.java
+ * @library ../../lib
+ * @build JavacTestingAbstractProcessor T6350057
* @compile -processor T6350057 -proc:only TestEnum.java
*/
@@ -38,9 +39,8 @@
import javax.lang.model.util.*;
import static javax.tools.Diagnostic.Kind.*;
-@SupportedAnnotationTypes("*")
-public class T6350057 extends AbstractProcessor {
- static class LocalVarAllergy extends ElementKindVisitor6<Boolean, Void> {
+public class T6350057 extends JavacTestingAbstractProcessor {
+ static class LocalVarAllergy extends ElementKindVisitor<Boolean, Void> {
@Override
public Boolean visitTypeAsEnum(TypeElement e, Void v) {
System.out.println("visitTypeAsEnum: " + e.getSimpleName().toString());
--- a/langtools/test/tools/javac/enum/6424358/T6424358.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/enum/6424358/T6424358.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,10 +23,11 @@
/*
* @test
- * @bug 6424358
+ * @bug 6424358 7025809
* @summary Synthesized static enum method values() is final
* @author Peter von der Ah\u00e9
- * @compile T6424358.java
+ * @library ../../lib
+ * @build JavacTestingAbstractProcessor T6424358
* @compile -processor T6424358 -proc:only T6424358.java
*/
@@ -39,8 +40,7 @@
@interface TestMe {}
-@SupportedAnnotationTypes("*")
-public class T6424358 extends AbstractProcessor {
+public class T6424358 extends JavacTestingAbstractProcessor {
@TestMe enum Test { FOO; }
public boolean process(Set<? extends TypeElement> annotations,
@@ -48,7 +48,7 @@
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
final TypeElement testMe = elements.getTypeElement("TestMe");
- class Scan extends ElementScanner7<Void,Void> {
+ class Scan extends ElementScanner<Void,Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
System.err.println("Looking at " + e);
@@ -65,9 +65,4 @@
scan.scan(e);
return true;
}
-
- @Override
- public SourceVersion getSupportedSourceVersion() {
- return SourceVersion.latest();
- }
}
--- a/langtools/test/tools/javac/failover/FailOver15.out Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/failover/FailOver15.out Fri Jul 22 21:31:14 2011 -0700
@@ -1,4 +1,3 @@
FailOver15.java:17:10: compiler.err.expected: ';'
FailOver15.java:11:13: compiler.err.cant.resolve.location: kindname.class, UnknownClass, , , (compiler.misc.location: kindname.class, Test, null)
2 errors
-
--- a/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/lib/JavacTestingAbstractProcessor.java Fri Jul 22 21:31:14 2011 -0700
@@ -25,6 +25,7 @@
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.util.*;
+import static javax.lang.model.SourceVersion.*;
/**
* An abstract annotation processor tailored to javac regression testing.
@@ -95,4 +96,164 @@
messager = processingEnv.getMessager();
options = processingEnv.getOptions();
}
+
+ /*
+ * The set of visitors below will directly extend the most recent
+ * corresponding platform visitor type.
+ */
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor8<R, P> {
+
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractAnnotationValueVisitor() {
+ super();
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static abstract class AbstractElementVisitor<R, P> extends AbstractElementVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractElementVisitor(){
+ super();
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static abstract class AbstractTypeVisitor<R, P> extends AbstractTypeVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractTypeVisitor() {
+ super();
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static class ElementKindVisitor<R, P> extends ElementKindVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected ElementKindVisitor() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected ElementKindVisitor(R defaultValue) {
+ super(defaultValue);
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static class ElementScanner<R, P> extends ElementScanner8<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected ElementScanner(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ */
+ protected ElementScanner(R defaultValue){
+ super(defaultValue);
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static class SimpleAnnotationValueVisitor<R, P> extends SimpleAnnotationValueVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleAnnotationValueVisitor() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleAnnotationValueVisitor(R defaultValue) {
+ super(defaultValue);
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static class SimpleElementVisitor<R, P> extends SimpleElementVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleElementVisitor(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleElementVisitor(R defaultValue){
+ super(defaultValue);
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static class SimpleTypeVisitor<R, P> extends SimpleTypeVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleTypeVisitor(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleTypeVisitor(R defaultValue){
+ super(defaultValue);
+ }
+ }
+
+ @SupportedSourceVersion(RELEASE_8)
+ public static class TypeKindVisitor<R, P> extends TypeKindVisitor8<R, P> {
+ /**
+ * Constructor for concrete subclasses to call; uses {@code null}
+ * for the default value.
+ */
+ protected TypeKindVisitor() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses to call; uses the argument
+ * for the default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected TypeKindVisitor(R defaultValue) {
+ super(defaultValue);
+ }
+ }
}
--- a/langtools/test/tools/javac/multicatch/model/ModelChecker.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/multicatch/model/ModelChecker.java Fri Jul 22 21:31:14 2011 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6993963
+ * @bug 6993963 7025809
* @summary Project Coin: Use precise exception analysis for effectively final catch parameters
* @library ../../lib
* @build JavacTestingAbstractProcessor ModelChecker
@@ -107,7 +107,7 @@
; // Expected
}
- UnionType unionType = new SimpleTypeVisitor7<UnionType, Void>(){
+ UnionType unionType = new SimpleTypeVisitor<UnionType, Void>(){
@Override
protected UnionType defaultAction(TypeMirror e, Void p) {return null;}
--- a/langtools/test/tools/javac/processing/model/6194785/T6194785.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/6194785/T6194785.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -21,7 +21,7 @@
* questions.
*/
-/**
+/*
* @test
* @bug 6194785
* @summary ParameterDeclaration.getSimpleName does not return actual name from class files
@@ -40,9 +40,8 @@
public class T6194785 extends JavacTestingAbstractProcessor {
public boolean process(Set<? extends TypeElement> annotations,
- RoundEnvironment roundEnvironment)
- {
- class Scan extends ElementScanner7<Void,Void> {
+ RoundEnvironment roundEnvironment) {
+ class Scan extends ElementScanner<Void,Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void ignored) {
for (VariableElement p : e.getParameters())
--- a/langtools/test/tools/javac/processing/model/TestSymtabItems.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/TestSymtabItems.java Fri Jul 22 21:31:14 2011 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7021183
+ * @bug 7021183 7025809
* @summary 269: assertion failure getting enclosing element of an undefined name
*/
@@ -37,9 +37,7 @@
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.UnknownTypeException;
-import javax.lang.model.util.ElementScanner7;
-import javax.lang.model.util.SimpleTypeVisitor7;
-import javax.lang.model.util.Types;
+import javax.lang.model.util.*;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
import com.sun.tools.javac.code.Symtab;
@@ -112,7 +110,7 @@
int errors;
- class ElemPrinter extends ElementScanner7<Void, Void> {
+ class ElemPrinter extends ElementScanner8<Void, Void> {
@Override
public Void visitPackage(PackageElement e, Void p) {
show("package", e);
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java Fri Jul 22 21:31:14 2011 -0700
@@ -24,7 +24,7 @@
/*
* @test
- * @bug 6639645 7026414
+ * @bug 6639645 7026414 7025809
* @summary Modeling type implementing missing interfaces
* @library ../../../../lib
* @build JavacTestingAbstractProcessor TestMissingElement
@@ -104,7 +104,7 @@
private String asString(TypeMirror t) {
if (t == null)
return "[typ:null]";
- return t.accept(new SimpleTypeVisitor7<String, Void>() {
+ return t.accept(new SimpleTypeVisitor<String, Void>() {
@Override
public String defaultAction(TypeMirror t, Void ignore) {
return "[typ:" + t.toString() + "]";
@@ -135,7 +135,7 @@
private String asString(Element e) {
if (e == null)
return "[elt:null]";
- return e.accept(new SimpleElementVisitor7<String, Void>() {
+ return e.accept(new SimpleElementVisitor<String, Void>() {
@Override
public String defaultAction(Element e, Void ignore) {
return "[elt:" + e.getKind() + " " + e.toString() + "]";
--- a/langtools/test/tools/javac/processing/model/element/TestResourceVariable.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/element/TestResourceVariable.java Fri Jul 22 21:31:14 2011 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6911256 6964740 6967842 6961571
+ * @bug 6911256 6964740 6967842 6961571 7025809
* @summary Test that the resource variable kind is appropriately set
* @author Joseph D. Darcy
* @library ../../../lib
@@ -44,8 +44,8 @@
/**
* Using the tree API, retrieve element representations of the
- * resource of an ARM block and verify their kind tags are set
- * appropriately.
+ * resource of a try-with-resources statement and verify their kind
+ * tags are set appropriately.
*/
public class TestResourceVariable extends JavacTestingAbstractProcessor implements AutoCloseable {
int resourceVariableCount = 0;
@@ -82,7 +82,7 @@
/**
* Verify that a resource variable modeled as an element behaves
- * as expected under 6 and 7 specific visitors.
+ * as expected under 6 and latest specific visitors.
*/
private static void testResourceVariable(Element element) {
ElementVisitor visitor6 = new ElementKindVisitor6<Void, Void>() {};
@@ -94,7 +94,8 @@
; // Expected.
}
- ElementKindVisitor7 visitor7 = new ElementKindVisitor7<Object, Void>() {
+ ElementKindVisitor visitorLatest =
+ new ElementKindVisitor<Object, Void>() {
@Override
public Object visitVariableAsResourceVariable(VariableElement e,
Void p) {
@@ -102,7 +103,7 @@
}
};
- if (visitor7.visit(element) == null) {
+ if (visitorLatest.visit(element) == null) {
throw new RuntimeException("Null result of resource variable visitation.");
}
}
--- a/langtools/test/tools/javac/processing/model/type/NoTypes.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/type/NoTypes.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6418666 6423973 6453386
+ * @bug 6418666 6423973 6453386 7025809
* @summary Test the NoTypes: VOID, PACKAGE, NONE
* @author Scott Seligman
* @library ../../../lib
@@ -75,7 +75,7 @@
verifyKind(NONE, types.getNoType(NONE));
// The return type of a constructor or void method is VOID.
- class Scanner extends ElementScanner7<Void, Void> {
+ class Scanner extends ElementScanner<Void, Void> {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
verifyKind(VOID, e.getReturnType());
@@ -89,11 +89,11 @@
}
/**
- * Verify that a NoType instance is of a particular kind,
- * and that TypeKindVisitor7 properly dispatches on it.
+ * Verify that a NoType instance is of a particular kind, and that
+ * the latest TypeKindVisitor properly dispatches on it.
*/
private void verifyKind(TypeKind kind, TypeMirror type) {
- class Vis extends TypeKindVisitor7<TypeKind, Void> {
+ class Vis extends TypeKindVisitor<TypeKind, Void> {
@Override
public TypeKind visitNoTypeAsVoid(NoType t, Void p) {
return VOID;
@@ -111,9 +111,7 @@
throw new AssertionError();
}
-
// Fodder for the tests
-
interface I {
}
--- a/langtools/test/tools/javac/processing/model/type/TestUnionType.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/type/TestUnionType.java Fri Jul 22 21:31:14 2011 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7029150
+ * @bug 7029150 7025809
* @summary Test support for union types
* @library ../../../lib
*/
@@ -39,7 +39,6 @@
import com.sun.source.tree.*;
import com.sun.source.util.*;
-
public class TestUnionType extends JavacTestingAbstractProcessor {
enum TestKind {
SingleType("E1", "E1",
@@ -194,7 +193,7 @@
}
}
- class TypePrinter extends SimpleTypeVisitor7<String, Void> {
+ class TypePrinter extends SimpleTypeVisitor<String, Void> {
@Override
protected String defaultAction(TypeMirror tm, Void ignore) {
return String.valueOf(tm.getKind());
--- a/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java Fri Jul 22 17:35:20 2011 -0700
+++ b/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java Fri Jul 22 21:31:14 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@
return true;
}
- private class DeprecationChecker extends ElementScanner7<Boolean,Void> {
+ private class DeprecationChecker extends ElementScanner<Boolean,Void> {
private Elements elementUtils;
private boolean failure;
DeprecationChecker() {