(x3, from(rest))));
}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java
index 42b390a689d..9756b3591a5 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java
@@ -33,8 +33,8 @@ import java.util.NoSuchElementException;
/** A class for constructing lists by appending elements. Modelled after
* java.lang.StringBuffer.
*
- * This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Log.java b/langtools/src/share/classes/com/sun/tools/javac/util/Log.java
index 4da7a74aaad..6fcc4b0fbcb 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Log.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Log.java
@@ -41,8 +41,8 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticType;
/** A class for error logs. Reports errors and warnings, and
* keeps track of error numbers and positions.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
@@ -125,8 +125,8 @@ public class Log extends AbstractLog {
this.promptOnError = options.get("-prompt") != null;
this.emitWarnings = options.get("-Xlint:none") == null;
this.suppressNotes = options.get("suppressNotes") != null;
- this.MaxErrors = getIntOption(options, "-Xmaxerrs", 100);
- this.MaxWarnings = getIntOption(options, "-Xmaxwarns", 100);
+ this.MaxErrors = getIntOption(options, "-Xmaxerrs", getDefaultMaxErrors());
+ this.MaxWarnings = getIntOption(options, "-Xmaxwarns", getDefaultMaxWarnings());
boolean rawDiagnostics = options.get("rawDiagnostics") != null;
messages = JavacMessages.instance(context);
@@ -155,6 +155,18 @@ public class Log extends AbstractLog {
return defaultValue;
}
+ /** Default value for -Xmaxerrs.
+ */
+ protected int getDefaultMaxErrors() {
+ return 100;
+ }
+
+ /** Default value for -Xmaxwarns.
+ */
+ protected int getDefaultMaxWarnings() {
+ return 100;
+ }
+
/** The default writer for diagnostics
*/
static final PrintWriter defaultWriter(Context context) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java b/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java
index c315f271062..f53d04e8725 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java
@@ -43,8 +43,8 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
* made on any API to generate a warning at all. In consequence, this handler only
* gets to handle those warnings that JLS says must be generated.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Name.java b/langtools/src/share/classes/com/sun/tools/javac/util/Name.java
index bab79160da3..ddd9340de5b 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Name.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Name.java
@@ -29,8 +29,8 @@ package com.sun.tools.javac.util;
* Utf8 format. Names are stored in a Name.Table, and are unique within
* that table.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java
index 06f3502efd5..3bfa9a35743 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java
@@ -29,8 +29,8 @@ package com.sun.tools.javac.util;
* Access to the compiler's name table. STandard names are defined,
* as well as methods to create new names.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Options.java b/langtools/src/share/classes/com/sun/tools/javac/util/Options.java
index 90632c420e8..23eb56fd37c 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Options.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Options.java
@@ -32,8 +32,8 @@ import java.util.*;
* If an option has an argument, the option name is mapped to the argument.
* If a set option has no argument, it is mapped to itself.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Pair.java b/langtools/src/share/classes/com/sun/tools/javac/util/Pair.java
index e6aa4f018dc..2f5d266df8f 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Pair.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Pair.java
@@ -27,8 +27,8 @@ package com.sun.tools.javac.util;
/** A generic class for pairs.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Position.java b/langtools/src/share/classes/com/sun/tools/javac/util/Position.java
index c58b7146a6b..d11afc11c13 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Position.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Position.java
@@ -36,8 +36,8 @@ import static com.sun.tools.javac.util.LayoutCharacters.*;
* expansion is optional and no Unicode excape translation is considered.
* The first character is at location (1,1).
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java b/langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java
index fb01c6fcfab..1df24181b2a 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java
@@ -28,7 +28,7 @@ package com.sun.tools.javac.util;
/**
* Used to propagate exceptions through to the user.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
index 09e26590158..21ee50472ac 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
@@ -41,7 +41,7 @@ import static com.sun.tools.javac.api.DiagnosticFormatter.PositionKind.*;
* or not the source name and position are set. This formatter provides a standardized, localize-independent
* implementation of a diagnostic formatter; as such, this formatter is best suited for testing purposes.
*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
index a7f950ed94a..44badbf5c64 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
@@ -59,7 +59,7 @@ import static com.sun.tools.javac.util.RichDiagnosticFormatter.RichConfiguration
* to two different type-variables with the same name, their representation is
* disambiguated by appending an index to the type variable name.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/SharedNameTable.java b/langtools/src/share/classes/com/sun/tools/javac/util/SharedNameTable.java
index 705c6ffde1d..0314f8b9497 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/SharedNameTable.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/SharedNameTable.java
@@ -32,8 +32,8 @@ import java.lang.ref.SoftReference;
* byte array, expanding it as needed. This avoids the overhead incurred
* by using an array of bytes for each name.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java b/langtools/src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java
index 78f92f0b6ef..ca765e3eec2 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java
@@ -32,8 +32,8 @@ import java.lang.ref.WeakReference;
* using weak references. It is recommended for use when a single shared
* byte array is unsuitable.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java b/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java
index f5e713cadce..d51ab33f91b 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java
@@ -31,7 +31,7 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
* An interface to support optional warnings, needed for support of
* unchecked conversions and unchecked casts.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java
index a64bb649994..e21d0604991 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java
@@ -155,10 +155,8 @@ public class DocletInvoker {
public boolean start(RootDoc root) {
Object retVal;
String methodName = "start";
- Class>[] paramTypes = new Class>[1];
- Object[] params = new Object[1];
- paramTypes[0] = RootDoc.class;
- params[0] = root;
+ Class>[] paramTypes = { RootDoc.class };
+ Object[] params = { root };
try {
retVal = invoke(methodName, null, paramTypes, params);
} catch (DocletInvokeException exc) {
@@ -181,10 +179,8 @@ public class DocletInvoker {
public int optionLength(String option) {
Object retVal;
String methodName = "optionLength";
- Class>[] paramTypes = new Class>[1];
- Object[] params = new Object[1];
- paramTypes[0] = option.getClass();
- params[0] = option;
+ Class>[] paramTypes = { String.class };
+ Object[] params = { option };
try {
retVal = invoke(methodName, new Integer(0), paramTypes, params);
} catch (DocletInvokeException exc) {
@@ -208,12 +204,8 @@ public class DocletInvoker {
String options[][] = optlist.toArray(new String[optlist.length()][]);
String methodName = "validOptions";
DocErrorReporter reporter = messager;
- Class>[] paramTypes = new Class>[2];
- Object[] params = new Object[2];
- paramTypes[0] = options.getClass();
- paramTypes[1] = DocErrorReporter.class;
- params[0] = options;
- params[1] = reporter;
+ Class>[] paramTypes = { String[][].class, DocErrorReporter.class };
+ Object[] params = { options, reporter };
try {
retVal = invoke(methodName, Boolean.TRUE, paramTypes, params);
} catch (DocletInvokeException exc) {
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/Messager.java b/langtools/src/share/classes/com/sun/tools/javadoc/Messager.java
index de61d7cf870..151c4cc8fa4 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/Messager.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/Messager.java
@@ -86,7 +86,7 @@ public class Messager extends Log implements DocErrorReporter {
private static final long serialVersionUID = 0;
}
- private final String programName;
+ final String programName;
private ResourceBundle messageRB = null;
@@ -121,6 +121,16 @@ public class Messager extends Log implements DocErrorReporter {
this.programName = programName;
}
+ @Override
+ protected int getDefaultMaxErrors() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ protected int getDefaultMaxWarnings() {
+ return Integer.MAX_VALUE;
+ }
+
/**
* Reset resource bundle, eg. locale has changed.
*/
@@ -231,11 +241,13 @@ public class Messager extends Log implements DocErrorReporter {
* @param msg message to print
*/
public void printError(SourcePosition pos, String msg) {
- String prefix = (pos == null) ? programName : pos.toString();
- errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
- errWriter.flush();
- prompt();
- nerrors++;
+ if (nerrors < MaxErrors) {
+ String prefix = (pos == null) ? programName : pos.toString();
+ errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
+ errWriter.flush();
+ prompt();
+ nerrors++;
+ }
}
/**
@@ -256,10 +268,12 @@ public class Messager extends Log implements DocErrorReporter {
* @param msg message to print
*/
public void printWarning(SourcePosition pos, String msg) {
- String prefix = (pos == null) ? programName : pos.toString();
- warnWriter.println(prefix + ": " + getText("javadoc.warning") +" - " + msg);
- warnWriter.flush();
- nwarnings++;
+ if (nwarnings < MaxWarnings) {
+ String prefix = (pos == null) ? programName : pos.toString();
+ warnWriter.println(prefix + ": " + getText("javadoc.warning") +" - " + msg);
+ warnWriter.flush();
+ nwarnings++;
+ }
}
/**
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/Start.java b/langtools/src/share/classes/com/sun/tools/javadoc/Start.java
index e5845499dc0..f32b2355fb0 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/Start.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/Start.java
@@ -51,8 +51,6 @@ import static com.sun.tools.javac.code.Flags.*;
* @author Neal Gafter (rewrite)
*/
class Start {
- /** Context for this invocation. */
- private final Context context;
private final String defaultDocletClassName;
private final ClassLoader docletParentClassLoader;
@@ -98,8 +96,8 @@ class Start {
PrintWriter noticeWriter,
String defaultDocletClassName,
ClassLoader docletParentClassLoader) {
- context = new Context();
- messager = new Messager(context, programName, errWriter, warnWriter, noticeWriter);
+ Context tempContext = new Context(); // interim context until option decoding completed
+ messager = new Messager(tempContext, programName, errWriter, warnWriter, noticeWriter);
this.defaultDocletClassName = defaultDocletClassName;
this.docletParentClassLoader = docletParentClassLoader;
}
@@ -110,8 +108,8 @@ class Start {
Start(String programName, String defaultDocletClassName,
ClassLoader docletParentClassLoader) {
- context = new Context();
- messager = new Messager(context, programName);
+ Context tempContext = new Context(); // interim context until option decoding completed
+ messager = new Messager(tempContext, programName);
this.defaultDocletClassName = defaultDocletClassName;
this.docletParentClassLoader = docletParentClassLoader;
}
@@ -144,6 +142,13 @@ class Start {
}
}
+ /**
+ * Usage
+ */
+ private void Xusage() {
+ messager.notice("main.Xusage");
+ }
+
/**
* Exit
*/
@@ -213,6 +218,15 @@ class Start {
setDocletInvoker(argv);
ListBuffer subPackages = new ListBuffer();
ListBuffer excludedPackages = new ListBuffer();
+
+ Context context = new Context();
+ // Setup a new Messager, using the same initial parameters as the
+ // existing Messager, except that this one will be able to use any
+ // options that may be set up below.
+ Messager.preRegister(context,
+ messager.programName,
+ messager.errWriter, messager.warnWriter, messager.noticeWriter);
+
Options compOpts = Options.instance(context);
boolean docClasses = false;
@@ -310,6 +324,15 @@ class Start {
usageError("main.locale_first");
oneArg(argv, i++);
docLocale = argv[i];
+ } else if (arg.equals("-Xmaxerrs") || arg.equals("-Xmaxwarns")) {
+ oneArg(argv, i++);
+ if (compOpts.get(arg) != null) {
+ usageError("main.option.already.seen", arg);
+ }
+ compOpts.put(arg, argv[i]);
+ } else if (arg.equals("-X")) {
+ Xusage();
+ exit();
} else if (arg.startsWith("-XD")) {
String s = arg.substring("-XD".length());
int eq = s.indexOf('=');
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
index 5c3998e80fe..288489d1527 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
@@ -49,7 +49,13 @@ main.usage=usage: javadoc [options] [packagenames] [sourcefiles] [@files]\n\
-locale Locale to be used, e.g. en_US or en_US_WIN\n\
-encoding Source file encoding name\n\
-quiet Do not display status messages\n\
- -J Pass directly to the runtime system\n
+ -J Pass directly to the runtime system\n\
+ -X Print a synopsis of nonstandard options\n
+main.Xusage=\
+ -Xmaxerrs Set the maximum number of errors to print\n\
+ -Xmaxwarns Set the maximum number of warnings to print\n\
+\n\
+These options are non-standard and subject to change without notice.
main.option.already.seen=The {0} option may be specified no more than once.
main.requires_argument=option {0} requires an argument.
main.locale_first=option -locale must be first on the command line.
@@ -65,7 +71,7 @@ main.no_source_files_for_package=No source files for package {0}
main.fatal.error=fatal error
main.fatal.exception=fatal exception
main.out.of.memory=java.lang.OutOfMemoryError: Please increase memory.\n\
-For example, on the Sun Classic or HotSpot VMs, add the option -J-Xmx\n\
+For example, on the JDK Classic or HotSpot VMs, add the option -J-Xmx\n\
such as -J-Xmx32m.
main.done_in=[done in {0} ms]
main.doclet_method_must_be_static=In doclet class {0}, method {1} must be static.
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
index bfb6fa1f9ba..068ff759167 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties
@@ -65,7 +65,7 @@ main.no_source_files_for_package=\u6ca1\u6709\u8f6f\u4ef6\u5305 {0} \u7684\u6e90
main.fatal.error=\u81f4\u547d\u9519\u8bef
main.fatal.exception=\u81f4\u547d\u5f02\u5e38
main.out.of.memory=java.lang.OutOfMemoryError\uff1a\u8bf7\u589e\u52a0\u5185\u5b58\u3002\n\
-\u4f8b\u5982\uff0c\u5bf9\u4e8e Sun Classic \u6216 HotSpot VM\uff0c\u8bf7\u6dfb\u52a0\u9009\u9879 -J-Xmx\uff0c\n\
+\u4f8b\u5982\uff0c\u5bf9\u4e8e JDK Classic \u6216 HotSpot VM\uff0c\u8bf7\u6dfb\u52a0\u9009\u9879 -J-Xmx\uff0c\n\
\u5982 -J-Xmx32m\u3002
main.done_in=[\u5728{0} \u6beb\u79d2\u5185\u5b8c\u6210]
main.doclet_method_must_be_static=\u5728 doclet \u7c7b {0} \u4e2d\uff0c\u65b9\u6cd5 {1} \u5fc5\u987b\u4e3a\u9759\u6001\u3002
diff --git a/langtools/src/share/classes/com/sun/tools/javah/Gen.java b/langtools/src/share/classes/com/sun/tools/javah/Gen.java
index a32c3e6f97d..56829867387 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/Gen.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/Gen.java
@@ -60,7 +60,7 @@ import javax.tools.StandardLocation;
* original writing, this interface is rich enough to support JNI and the
* old 1.0-style native method interface.
*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javah/InternalError.java b/langtools/src/share/classes/com/sun/tools/javah/InternalError.java
index 448f2e32ce3..d7d5f20daf0 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/InternalError.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/InternalError.java
@@ -26,8 +26,8 @@
package com.sun.tools.javah;
/**
- * This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javah/JNI.java b/langtools/src/share/classes/com/sun/tools/javah/JNI.java
index 5704b84fcd7..f71d4d02830 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/JNI.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/JNI.java
@@ -42,7 +42,7 @@ import javax.lang.model.util.ElementFilter;
/**
* Header file generator for JNI.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java b/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java
index 00c5bee3b77..72160c59992 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java
@@ -36,8 +36,8 @@ import com.sun.tools.javac.util.Context;
/**
* javah's implementation of JavaFileManager.
*
- * This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java
index 680130e9d3c..650460a5c5d 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java
@@ -59,7 +59,7 @@ import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;
import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleTypeVisitor6;
+import javax.lang.model.util.SimpleTypeVisitor7;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;
@@ -76,7 +76,7 @@ import javax.tools.ToolProvider;
* Javah generates support files for native methods.
* Parse commandline options & Invokes javadoc to execute those commands.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
@@ -705,7 +705,7 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask {
}
private TypeVisitor checkMethodParametersVisitor =
- new SimpleTypeVisitor6() {
+ new SimpleTypeVisitor7() {
@Override
public Void visitArray(ArrayType t, Types types) {
visit(t.getComponentType(), types);
diff --git a/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java b/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java
index de901192cee..09cbdb9cc23 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java
@@ -40,7 +40,7 @@ import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
/*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javah/LLNI.java b/langtools/src/share/classes/com/sun/tools/javah/LLNI.java
index fa0262edcac..405eba98532 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/LLNI.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/LLNI.java
@@ -45,10 +45,10 @@ import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVisitor;
import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleTypeVisitor6;
+import javax.lang.model.util.SimpleTypeVisitor7;
/*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
@@ -620,7 +620,7 @@ public class LLNI extends Gen {
}
protected final boolean isLongOrDouble(TypeMirror t) {
- TypeVisitor v = new SimpleTypeVisitor6() {
+ TypeVisitor v = new SimpleTypeVisitor7() {
public Boolean defaultAction(TypeMirror t, Void p){
return false;
}
diff --git a/langtools/src/share/classes/com/sun/tools/javah/Main.java b/langtools/src/share/classes/com/sun/tools/javah/Main.java
index 09b205f38a4..6a247b12268 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/Main.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/Main.java
@@ -30,8 +30,8 @@ import java.io.PrintWriter;
/**
* Main entry point.
*
- * This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javah/Mangle.java b/langtools/src/share/classes/com/sun/tools/javah/Mangle.java
index c6406737224..709b00bc9cc 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/Mangle.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/Mangle.java
@@ -37,7 +37,7 @@ import javax.lang.model.util.Types;
* this more fine grained and distribute the functionality to the
* generators.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java b/langtools/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java
index 1f1377db7c6..5107dd113c9 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java
@@ -44,8 +44,8 @@ import javax.tools.Tool;
* @see JavaFileManager
* @since 1.7
*
- * This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java
index b329b32b74f..c0ef12815f0 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java
@@ -38,12 +38,12 @@ import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVariable;
import javax.lang.model.type.TypeVisitor;
import javax.lang.model.util.Elements;
-import javax.lang.model.util.SimpleTypeVisitor6;
+import javax.lang.model.util.SimpleTypeVisitor7;
/**
* Returns internal type signature.
*
- *
This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
@@ -239,7 +239,7 @@ public class TypeSignature{
String qualifiedTypeName(TypeMirror type) {
- TypeVisitor v = new SimpleTypeVisitor6() {
+ TypeVisitor v = new SimpleTypeVisitor7() {
@Override
public Name visitArray(ArrayType t, Void p) {
return t.getComponentType().accept(this, p);
diff --git a/langtools/src/share/classes/com/sun/tools/javah/Util.java b/langtools/src/share/classes/com/sun/tools/javah/Util.java
index 98457f1f2ea..36dcf22a6c2 100644
--- a/langtools/src/share/classes/com/sun/tools/javah/Util.java
+++ b/langtools/src/share/classes/com/sun/tools/javah/Util.java
@@ -44,7 +44,7 @@ import javax.tools.JavaFileObject;
* bug -- Bug has occurred in javah
* fatal -- We can't even find resources, so bail fast, don't localize
*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java
index 91a41c5aa6a..198cbf8dc49 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java
@@ -40,8 +40,8 @@ import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
/**
* A writer for writing annotations as text.
*
- * This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java
index 41bda2c7b00..3074398ea30 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java
@@ -64,8 +64,8 @@ import static com.sun.tools.classfile.AccessFlags.*;
/*
* A writer for writing Attributes as text.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/BasicWriter.java b/langtools/src/share/classes/com/sun/tools/javap/BasicWriter.java
index efeb6e7fefe..4c2d92065bd 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/BasicWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/BasicWriter.java
@@ -35,8 +35,8 @@ import com.sun.tools.classfile.DescriptorException;
* A writer similar to a PrintWriter but which does not hide exceptions.
* The standard print calls are line-buffered; report calls write messages directly.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/javap/ClassWriter.java
index 7fcf98702f7..88a81c56d26 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/ClassWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/ClassWriter.java
@@ -54,8 +54,8 @@ import static com.sun.tools.classfile.AccessFlags.*;
/*
* The main javap class to write the contents of a class file as text.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java b/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java
index 7abed188159..2276f3f8226 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java
@@ -40,8 +40,8 @@ import com.sun.tools.classfile.Method;
/*
* Write the contents of a Code attribute.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/ConstantWriter.java b/langtools/src/share/classes/com/sun/tools/javap/ConstantWriter.java
index eb40cfaff10..9f86ac8b2b2 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/ConstantWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/ConstantWriter.java
@@ -34,8 +34,8 @@ import static com.sun.tools.classfile.ConstantPool.*;
/*
* Write a constant pool entry.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/Context.java b/langtools/src/share/classes/com/sun/tools/javap/Context.java
index e9f0606fed6..9d630e697aa 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/Context.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/Context.java
@@ -31,8 +31,8 @@ import java.util.Map;
/*
* Class from which to put/get shared resources.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/DisassemblerTool.java b/langtools/src/share/classes/com/sun/tools/javap/DisassemblerTool.java
index e98b8430bec..356fc9a4de6 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/DisassemblerTool.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/DisassemblerTool.java
@@ -44,8 +44,8 @@ import javax.tools.Tool;
* @see JavaFileManager
* @since 1.7
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java b/langtools/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java
index 9395105146a..c863793319c 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java
@@ -31,8 +31,8 @@ import com.sun.tools.classfile.Instruction;
/*
* Write additional details for an instruction.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/InternalError.java b/langtools/src/share/classes/com/sun/tools/javap/InternalError.java
index e0c221176cf..4bc02e881bb 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/InternalError.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/InternalError.java
@@ -26,8 +26,8 @@
package com.sun.tools.javap;
/**
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java
index 6f419c7469c..8fa75792dae 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java
@@ -36,8 +36,8 @@ import com.sun.tools.javac.util.Context;
/**
* javap's implementation of JavaFileManager.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
index 8bf977c250d..6ef621cbb01 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
@@ -69,8 +69,8 @@ import java.net.URLConnection;
* "Main" class for javap, normally accessed from the command line
* via Main, or from JSR199 via DisassemblerTool.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java b/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java
index cc0b6d05cd9..396f2812ecb 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java
@@ -42,8 +42,8 @@ import java.util.Map;
/**
* Annotate instructions with details about local variables.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java b/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java
index 9b0d1f98607..bdc9e07a980 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java
@@ -43,8 +43,8 @@ import java.util.Map;
/**
* Annotate instructions with details about local variables.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/Main.java b/langtools/src/share/classes/com/sun/tools/javap/Main.java
index 089eebf9a29..20f1ab3c1ae 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/Main.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/Main.java
@@ -30,8 +30,8 @@ import java.io.PrintWriter;
/**
* Main entry point.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/Messages.java b/langtools/src/share/classes/com/sun/tools/javap/Messages.java
index de35c42d124..85d88ae3194 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/Messages.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/Messages.java
@@ -30,8 +30,8 @@ import java.util.Locale;
/**
* Access to javap messages.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/Options.java b/langtools/src/share/classes/com/sun/tools/javap/Options.java
index 65309f9adcc..0a05d3b9d34 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/Options.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/Options.java
@@ -34,8 +34,8 @@ import com.sun.tools.classfile.AccessFlags;
/*
* Provides access to javap's options, set via the command line
* or JSR 199 API.
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/SourceWriter.java b/langtools/src/share/classes/com/sun/tools/javap/SourceWriter.java
index a83345f081e..81ef9cb62e0 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/SourceWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/SourceWriter.java
@@ -52,8 +52,8 @@ import com.sun.tools.classfile.SourceFile_attribute;
/**
* Annotate instructions with source code.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java b/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java
index e50e821c1fd..aedcf31c136 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java
@@ -45,8 +45,8 @@ import static com.sun.tools.classfile.StackMapTable_attribute.verification_type_
/**
* Annotate instructions with stack map.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/TryBlockWriter.java b/langtools/src/share/classes/com/sun/tools/javap/TryBlockWriter.java
index 6e03d541b76..0500c2dbf37 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/TryBlockWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/TryBlockWriter.java
@@ -37,8 +37,8 @@ import java.util.Map;
/**
* Annotate instructions with details about try blocks.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java b/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java
index db8cc4fbb41..3a1a86f9633 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java
@@ -41,8 +41,8 @@ import java.util.Map;
/**
* Annotate instructions with details about type annotations.
*
- *
This is NOT part of any API supported by Sun Microsystems. If
- * you write code that depends on this, you do so at your own risk.
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
diff --git a/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java b/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java
index 15f7b1b4b9e..02a8702131f 100644
--- a/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java
+++ b/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java
@@ -62,6 +62,7 @@ import javax.lang.model.util.*;
* @author Scott Seligman
* @author Peter von der Ahé
* @see AbstractElementVisitor6
+ * @see AbstractElementVisitor7
* @since 1.6
*/
public interface ElementVisitor {
diff --git a/langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java b/langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java
index 07011268246..5f72c4a96d9 100644
--- a/langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java
+++ b/langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java
@@ -42,7 +42,7 @@ import javax.lang.model.element.Element;
* @see Element#getAnnotation(Class)
* @since 1.6
*/
-public class MirroredTypeException extends RuntimeException {
+public class MirroredTypeException extends MirroredTypesException {
private static final long serialVersionUID = 269;
@@ -54,7 +54,7 @@ public class MirroredTypeException extends RuntimeException {
* @param type the type being accessed
*/
public MirroredTypeException(TypeMirror type) {
- super("Attempt to access Class object for TypeMirror " + type.toString());
+ super("Attempt to access Class object for TypeMirror " + type.toString(), type);
this.type = type;
}
@@ -76,5 +76,6 @@ public class MirroredTypeException extends RuntimeException {
throws IOException, ClassNotFoundException {
s.defaultReadObject();
type = null;
+ types = null;
}
}
diff --git a/langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java b/langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java
index fc977bbb95b..5d547a91833 100644
--- a/langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java
+++ b/langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java
@@ -49,7 +49,17 @@ public class MirroredTypesException extends RuntimeException {
private static final long serialVersionUID = 269;
- private transient List extends TypeMirror> types; // cannot be serialized
+ transient List extends TypeMirror> types; // cannot be serialized
+
+ /*
+ * Trusted constructor to be called by MirroredTypeException.
+ */
+ MirroredTypesException(String message, TypeMirror type) {
+ super(message);
+ List tmp = (new ArrayList());
+ tmp.add(type);
+ types = Collections.unmodifiableList(tmp);
+ }
/**
* Constructs a new MirroredTypesException for the specified types.
diff --git a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
index 8ff4e0fa0d1..80c947b544b 100644
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
@@ -62,6 +62,8 @@ import javax.annotation.processing.SupportedSourceVersion;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see AbstractAnnotationValueVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java
new file mode 100644
index 00000000000..f728c1a4452
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010, 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_7 RELEASE_7}
+ * source version.
+ *
+ * WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods
+ * @param the type of the additional parameter to this visitor's methods.
+ *
+ * @see AbstractAnnotationValueVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public abstract class AbstractAnnotationValueVisitor7 extends AbstractAnnotationValueVisitor6 {
+
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractAnnotationValueVisitor7() {
+ super();
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
index bf82437cc71..ab8c5ecdd1e 100644
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
@@ -65,6 +65,8 @@ import javax.lang.model.SourceVersion;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see AbstractElementVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java
new file mode 100644
index 00000000000..badcb58de45
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2010, 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_7 RELEASE_7}
+ * source version.
+ *
+ * WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public abstract class AbstractElementVisitor7 extends AbstractElementVisitor6 {
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractElementVisitor7(){
+ super();
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
index bd3ed37ac5e..63fd14dd5b9 100644
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
@@ -57,6 +57,8 @@ import javax.lang.model.type.*;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see AbstractTypeVisitor7
* @since 1.6
*/
public abstract class AbstractTypeVisitor6 implements TypeVisitor {
diff --git a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java
new file mode 100644
index 00000000000..0b14c91f7d5
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2010, 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 version 7 language level.
+ *
+ * WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+public abstract class AbstractTypeVisitor7 extends AbstractTypeVisitor6 {
+ /**
+ * Constructor for concrete subclasses to call.
+ */
+ protected AbstractTypeVisitor7() {
+ super();
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java
index dc3daf99706..e0f4b07b545 100644
--- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java
@@ -76,6 +76,8 @@ import javax.lang.model.SourceVersion;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see ElementKindVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java
new file mode 100644
index 00000000000..9b7c3a43b32
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2010, 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_6 RELEASE_6} source version. For {@linkplain
+ * Element elements} XYZ that may have more than one
+ * kind, the visitXYZ methods in this class delegate
+ * to the visitXYZKind method corresponding to the
+ * first argument's kind. The visitXYZKind methods
+ * call {@link #defaultAction defaultAction}, passing their arguments
+ * to {@code defaultAction}'s corresponding parameters.
+ *
+ * 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.
+ *
+ *
WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class ElementKindVisitor7 extends ElementKindVisitor6 {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected ElementKindVisitor7() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected ElementKindVisitor7(R defaultValue) {
+ super(defaultValue);
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java
index 3ddcd330bf8..29d0aa95bbe 100644
--- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java
@@ -88,6 +88,8 @@ import static javax.lang.model.SourceVersion.*;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see ElementScanner7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java
new file mode 100644
index 00000000000..c2dcf0204d1
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2010, 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_7 RELEASE_7}
+ * source version. The visitXYZ 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
+ * visitXYZ 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.
+ *
+ * When a subclass overrides a visitXYZ method, the
+ * new method can cause the enclosed elements to be scanned in the
+ * default way by calling super.visitXYZ. 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
+ * super.visitXYZ 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 super.visitXYZ, an overriding visit method
+ * should call {@code scan} with the elements in the desired order.
+ *
+ *
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.
+ *
+ *
WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class ElementScanner7 extends ElementScanner6 {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected ElementScanner7(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ */
+ protected ElementScanner7(R defaultValue){
+ super(defaultValue);
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java
index cf278fa844a..5ec3cdea521 100644
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java
@@ -69,6 +69,8 @@ import javax.annotation.processing.SupportedSourceVersion;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see SimpleAnnotationValueVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java
new file mode 100644
index 00000000000..e4ba035533f
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010, 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_7 RELEASE_7}
+ * source version. Visit methods call {@link
+ * #defaultAction} passing their arguments to {@code defaultAction}'s
+ * corresponding parameters.
+ *
+ * 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.
+ *
+ *
WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods
+ * @param the type of the additional parameter to this visitor's methods.
+ *
+ * @see SimpleAnnotationValueVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class SimpleAnnotationValueVisitor7 extends SimpleAnnotationValueVisitor6 {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleAnnotationValueVisitor7() {
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleAnnotationValueVisitor7(R defaultValue) {
+ super(defaultValue);
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java
index cac7232bcf6..9ec4fb7ce2f 100644
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java
@@ -71,6 +71,8 @@ import static javax.lang.model.SourceVersion.*;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see SimpleElementVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java
new file mode 100644
index 00000000000..abdd04e2d0f
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2010, 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_7 RELEASE_7}
+ * source version.
+ *
+ * Visit methods corresponding to {@code RELEASE_7} language
+ * constructs call {@link #defaultAction}, passing their arguments to
+ * {@code defaultAction}'s corresponding parameters.
+ *
+ * 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.
+ *
+ *
WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@code Void}
+ * for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class SimpleElementVisitor7 extends SimpleElementVisitor6 {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleElementVisitor7(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleElementVisitor7(R defaultValue){
+ super(defaultValue);
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java
index c22adb384e0..248c96419b1 100644
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java
@@ -70,6 +70,8 @@ import static javax.lang.model.SourceVersion.*;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see SimpleTypeVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
new file mode 100644
index 00000000000..48c87293ad8
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2010, 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_7} language
+ * constructs call {@link #defaultAction}, passing their arguments to
+ * {@code defaultAction}'s corresponding parameters.
+ *
+ * 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.
+ *
+ *
WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class SimpleTypeVisitor7 extends SimpleTypeVisitor6 {
+ /**
+ * Constructor for concrete subclasses; uses {@code null} for the
+ * default value.
+ */
+ protected SimpleTypeVisitor7(){
+ super(null);
+ }
+
+ /**
+ * Constructor for concrete subclasses; uses the argument for the
+ * default value.
+ *
+ * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+ */
+ protected SimpleTypeVisitor7(R defaultValue){
+ super(defaultValue);
+ }
+}
diff --git a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java
index 66be7552060..5ed7197e316 100644
--- a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java
@@ -74,6 +74,8 @@ import javax.lang.model.SourceVersion;
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
+ *
+ * @see TypeKindVisitor7
* @since 1.6
*/
@SupportedSourceVersion(RELEASE_6)
diff --git a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java
new file mode 100644
index 00000000000..202080099eb
--- /dev/null
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2010, 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_7
+ * RELEASE_7} source version. For {@linkplain
+ * TypeMirror types} XYZ that may have more than one
+ * kind, the visitXYZ methods in this class delegate
+ * to the visitXYZKind method corresponding to the
+ * first argument's kind. The visitXYZKind methods
+ * call {@link #defaultAction defaultAction}, passing their arguments
+ * to {@code defaultAction}'s corresponding parameters.
+ *
+ * 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.
+ *
+ *
WARNING: 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"}.
+ *
+ *
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 the return type of this visitor's methods. Use {@link
+ * Void} for visitors that do not need to return results.
+ * @param 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
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class TypeKindVisitor7 extends TypeKindVisitor6 {
+ /**
+ * Constructor for concrete subclasses to call; uses {@code null}
+ * for the default value.
+ */
+ protected TypeKindVisitor7() {
+ 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 TypeKindVisitor7(R defaultValue) {
+ super(defaultValue);
+ }
+}
diff --git a/langtools/src/share/classes/javax/tools/JavaFileManager.java b/langtools/src/share/classes/javax/tools/JavaFileManager.java
index b82598dd08c..f289d095541 100644
--- a/langtools/src/share/classes/javax/tools/JavaFileManager.java
+++ b/langtools/src/share/classes/javax/tools/JavaFileManager.java
@@ -256,7 +256,7 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker {
*
* Optionally, this file manager might consider the sibling as
* a hint for where to place the output. The exact semantics of
- * this hint is unspecified. Sun's compiler, javac, for
+ * this hint is unspecified. The JDK compiler, javac, for
* example, will place class files in the same directories as
* originating source files unless a class file output directory
* is provided. To facilitate this behavior, javac might provide
@@ -338,7 +338,7 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker {
*
*
Optionally, this file manager might consider the sibling as
* a hint for where to place the output. The exact semantics of
- * this hint is unspecified. Sun's compiler, javac, for
+ * this hint is unspecified. The JDK compiler, javac, for
* example, will place class files in the same directories as
* originating source files unless a class file output directory
* is provided. To facilitate this behavior, javac might provide
diff --git a/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java b/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java
index 1c7ff60d812..fb1d4490d49 100644
--- a/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java
+++ b/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java
@@ -138,7 +138,7 @@ public class CheckNamesProcessor extends AbstractProcessor {
public SourceVersion getSupportedSourceVersion() {
/*
* Return latest source version instead of a fixed version
- * like RELEASE_6. To return a fixed version, this class
+ * like RELEASE_7. To return a fixed version, this class
* could be annotated with a SupportedSourceVersion
* annotation.
*
@@ -190,7 +190,7 @@ public class CheckNamesProcessor extends AbstractProcessor {
/**
* Visitor to implement name checks.
*/
- private class NameCheckScanner extends ElementScanner6 {
+ private class NameCheckScanner extends ElementScanner7 {
// 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
@@ -312,7 +312,7 @@ public class CheckNamesProcessor extends AbstractProcessor {
@Override
public Void visitUnknown(Element e, Void p) {
// This method will be called if a kind of element
- // added after JDK 6 is visited. Since as of this
+ // added after JDK 7 is visited. Since as of this
// writing the conventions for such constructs aren't
// known, issue a warning.
messager.printMessage(WARNING,
diff --git a/langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html b/langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html
index 39bab307b81..f3a82a1f818 100644
--- a/langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html
+++ b/langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html
@@ -24,7 +24,6 @@ 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.
-
-->
diff --git a/langtools/test/tools/javac/6402516/CheckLocalElements.java b/langtools/test/tools/javac/6402516/CheckLocalElements.java
index f5cd63b1b3d..2e4f477c331 100644
--- a/langtools/test/tools/javac/6402516/CheckLocalElements.java
+++ b/langtools/test/tools/javac/6402516/CheckLocalElements.java
@@ -95,7 +95,7 @@ public class CheckLocalElements extends Checker {
return encl == null ? "" : encl.accept(qualNameVisitor, null);
}
- private ElementVisitor qualNameVisitor = new SimpleElementVisitor6() {
+ private ElementVisitor qualNameVisitor = new SimpleElementVisitor7() {
protected String defaultAction(Element e, Void ignore) {
return "";
}
diff --git a/langtools/test/tools/javac/6948381/T6948381.java b/langtools/test/tools/javac/6948381/T6948381.java
index b16505ccf00..ec5c8fe9e81 100644
--- a/langtools/test/tools/javac/6948381/T6948381.java
+++ b/langtools/test/tools/javac/6948381/T6948381.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010, 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*/
/**
diff --git a/langtools/test/tools/javac/6948381/npe/A.java b/langtools/test/tools/javac/6948381/npe/A.java
index 5545ff7568a..d299920571c 100644
--- a/langtools/test/tools/javac/6948381/npe/A.java
+++ b/langtools/test/tools/javac/6948381/npe/A.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010, 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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 npe;
diff --git a/langtools/test/tools/javac/6948381/npe/B.java b/langtools/test/tools/javac/6948381/npe/B.java
index 7f2d5ec8b46..32ffade5cb4 100644
--- a/langtools/test/tools/javac/6948381/npe/B.java
+++ b/langtools/test/tools/javac/6948381/npe/B.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010, 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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 npe;
diff --git a/langtools/test/tools/javac/T6956638.java b/langtools/test/tools/javac/T6956638.java
new file mode 100644
index 00000000000..98ed012dd4d
--- /dev/null
+++ b/langtools/test/tools/javac/T6956638.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2010, 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.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.lang.model.element.Element;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.util.JavacTask;
+
+/**
+ * @test
+ * @bug 6956638
+ * @summary JavacTask.generate does not generate all required files
+ */
+public class T6956638 {
+ public static void main(String[] args) throws Exception {
+ new T6956638().run();
+ }
+
+ void run() throws Exception {
+ File srcDir = new File("src");
+
+ File[] files = {
+ writeFile(new File(srcDir, "T1.java"),
+ "public class T1 extends T2 {}\n"),
+ writeFile(new File(srcDir, "T2.java"),
+ "public class T2 extends T3 {}\n"),
+ writeFile(new File(srcDir, "T3.java"),
+ "public class T3 { public static final int C = 1; }\n"),
+ writeFile(new File(srcDir, "Test.java"),
+ "public class Test { public static final int D = T1.C; }\n")
+ };
+
+ for (File f1: files) {
+ for (File f2: files) {
+ if (f2 == f1) continue;
+ for (File f3: files) {
+ if (f3 == f2 || f3 == f1) continue;
+ for (File f4: files) {
+ if (f4 == f3 || f4 == f2 || f4 == f1) continue;
+ try {
+ test(f1, f2, f3, f4);
+ } catch (Exception e) {
+ error(e);
+ }
+ }
+ }
+ }
+ }
+
+ if (errors > 0)
+ throw new Exception(errors + " tests failed");
+ }
+
+ void test(File... sourceFiles) throws Exception {
+ System.err.println("Test " + (++count) + ": " + Arrays.asList(sourceFiles));
+
+ File classesDir = new File("classes" + count);
+ classesDir.mkdirs();
+
+ StringWriter compilerOutputStream = new StringWriter();
+
+ List compileOptions = Arrays.asList("-d", classesDir.getPath());
+ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+ DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
+ StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnosticCollector, null, null);
+ Iterable extends JavaFileObject> sourceFileObjects = fileManager.getJavaFileObjects(sourceFiles);
+ System.err.println("1- javac given java source JavaFileObjects " + sourceFileObjects);
+ JavaCompiler.CompilationTask task = compiler.getTask(compilerOutputStream, fileManager, null, compileOptions, null, sourceFileObjects);
+ JavacTask javacTask = (JavacTask) task;
+
+ Iterable extends CompilationUnitTree> parsedTrees = javacTask.parse();
+ Iterable extends Element> analyzedTrees = javacTask.analyze();
+ Iterable extends JavaFileObject> generatedFiles = javacTask.generate();
+
+ System.err.println("2- parsed:" + size(parsedTrees) + " analysed:" + size(analyzedTrees) + " generated:" + size(generatedFiles));
+
+ System.err.print("3-");
+ for (JavaFileObject f : generatedFiles)
+ System.err.print(" " + f);
+ System.err.println("");
+
+ System.err.print("5-");
+ for (File f : classesDir.listFiles())
+ System.err.print(" " + f);
+ System.err.println("");
+
+ System.err.println("----");
+ System.err.println(compilerOutputStream.toString());
+
+ if (size(generatedFiles) != size(parsedTrees)) {
+ throw new Exception("wrong number of files generated: " + size(generatedFiles)
+ + " expected: " + size(parsedTrees));
+ }
+ }
+
+ private void error(Throwable t) {
+ t.printStackTrace();
+ errors++;
+ }
+
+ int count;
+ int errors;
+
+ private static int size(Iterable x) {
+ int n = 0;
+ for (Iterator iter = x.iterator(); iter.hasNext(); ++n)
+ iter.next();
+ return n;
+ }
+
+ private static File writeFile(File f, String str) throws IOException {
+ f.getParentFile().mkdirs();
+ BufferedWriter fout = new BufferedWriter(new FileWriter(f));
+ try {
+ fout.write(str);
+ fout.flush();
+ } finally {
+ fout.close();
+ }
+ return f;
+ }
+}
diff --git a/langtools/test/tools/javac/api/TestOperators.java b/langtools/test/tools/javac/api/TestOperators.java
index 3db59e0ced5..fa11740fd57 100644
--- a/langtools/test/tools/javac/api/TestOperators.java
+++ b/langtools/test/tools/javac/api/TestOperators.java
@@ -299,7 +299,7 @@ public class TestOperators extends AbstractProcessor {
final Trees trees = Trees.instance(processingEnv);
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
- class Scan extends ElementScanner6 {
+ class Scan extends ElementScanner7 {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
Object debug = e; // info for exception handler
diff --git a/langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java b/langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java
index e61bbd1c19d..e0bd100b64b 100644
--- a/langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java
+++ b/langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java
@@ -28,7 +28,7 @@ import java.util.Map;
/**
* A class loader which loads classes from byte arrays.
*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/test/tools/javac/api/evalexpr/CompileFromString.java b/langtools/test/tools/javac/api/evalexpr/CompileFromString.java
index c9356e8e0fb..34a724263ae 100644
--- a/langtools/test/tools/javac/api/evalexpr/CompileFromString.java
+++ b/langtools/test/tools/javac/api/evalexpr/CompileFromString.java
@@ -32,7 +32,7 @@ import static javax.tools.StandardLocation.CLASS_OUTPUT;
/**
* JSR 199 Demo application: compile from a String.
*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java b/langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java
index b0803f0548d..f3570c6aab7 100644
--- a/langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java
+++ b/langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java
@@ -43,7 +43,7 @@ import javax.tools.JavaFileObject.Kind;
* This file manager delegates to another file manager
* to lookup classes on boot class path.
*
- * This is NOT part of any API supported by Sun Microsystems.
+ *
This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.
diff --git a/langtools/test/tools/javac/enum/6424358/T6424358.java b/langtools/test/tools/javac/enum/6424358/T6424358.java
index 26cf8a1a61d..681a45c0dbe 100644
--- a/langtools/test/tools/javac/enum/6424358/T6424358.java
+++ b/langtools/test/tools/javac/enum/6424358/T6424358.java
@@ -48,7 +48,7 @@ public class T6424358 extends AbstractProcessor {
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
final TypeElement testMe = elements.getTypeElement("TestMe");
- class Scan extends ElementScanner6 {
+ class Scan extends ElementScanner7 {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
System.err.println("Looking at " + e);
diff --git a/langtools/test/tools/javac/generics/diamond/T6951833.java b/langtools/test/tools/javac/generics/diamond/T6951833.java
index f1bf51a2212..82729d97bcb 100644
--- a/langtools/test/tools/javac/generics/diamond/T6951833.java
+++ b/langtools/test/tools/javac/generics/diamond/T6951833.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010, 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*/
/*
diff --git a/langtools/test/tools/javac/generics/typevars/T6880344.java b/langtools/test/tools/javac/generics/typevars/T6880344.java
index 295721d167d..650ecb947e1 100644
--- a/langtools/test/tools/javac/generics/typevars/T6880344.java
+++ b/langtools/test/tools/javac/generics/typevars/T6880344.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2009, 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*/
/*
diff --git a/langtools/test/tools/javac/processing/model/6194785/T6194785.java b/langtools/test/tools/javac/processing/model/6194785/T6194785.java
index 76464230fae..8b18b48f712 100644
--- a/langtools/test/tools/javac/processing/model/6194785/T6194785.java
+++ b/langtools/test/tools/javac/processing/model/6194785/T6194785.java
@@ -43,7 +43,7 @@ public class T6194785 extends AbstractProcessor {
{
final Messager log = processingEnv.getMessager();
final Elements elements = processingEnv.getElementUtils();
- class Scan extends ElementScanner6 {
+ class Scan extends ElementScanner7 {
@Override
public Void visitExecutable(ExecutableElement e, Void ignored) {
for (VariableElement p : e.getParameters())
diff --git a/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java
new file mode 100644
index 00000000000..f7b6ca6694f
--- /dev/null
+++ b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2010, 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 6519115
+ * @summary Verify MirroredTypeException vs MirroredTypesException is thrown
+ * @compile Plurality.java
+ * @compile -processor Plurality -proc:only Plurality.java
+ * @author Joseph D. Darcy
+ */
+import java.lang.annotation.*;
+import java.math.BigDecimal;
+import java.util.*;
+import javax.annotation.processing.*;
+import javax.lang.model.*;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+import javax.lang.model.util.*;
+
+@SupportedAnnotationTypes("*")
+@P0
+@P1
+@P2
+@S1
+public class Plurality extends AbstractProcessor {
+ private boolean executed = false;
+
+ Elements elements;
+ Types types;
+
+ @Override
+ public void init(ProcessingEnvironment penv) {
+ super.init(penv);
+ elements = penv.getElementUtils();
+ types = penv.getTypeUtils();
+ }
+
+
+ public boolean process(Set extends TypeElement> annotations,
+ RoundEnvironment roundEnv) {
+ if (!roundEnv.processingOver()) {
+ executed = true;
+ // Processing just this type
+ Element e = elements.getTypeElement("Plurality");
+ Class[] classes = null;
+
+ P0 p0 = e.getAnnotation(P0.class);
+ try {
+ classes = p0.value();
+ } catch (MirroredTypesException mtse) {
+ if (mtse instanceof MirroredTypeException) {
+ throw new RuntimeException("Wrong exception type!");
+ }
+
+ List extends TypeMirror> types = mtse.getTypeMirrors();
+ if (types.size() != 0)
+ throw new RuntimeException("List size != 0: " +
+ types);
+ }
+
+ P1 p1 = e.getAnnotation(P1.class);
+ try {
+ classes = p1.value();
+ } catch (MirroredTypesException mtse) {
+ if (mtse instanceof MirroredTypeException) {
+ throw new RuntimeException("Wrong exception type!");
+ }
+
+ List extends TypeMirror> types = mtse.getTypeMirrors();
+ if (types.size() != 1)
+ throw new RuntimeException("List size != 1: " +
+ types);
+ checkTypeListMatchesClasses(types,
+ this.getClass().getAnnotation(P1.class).value());
+ }
+
+
+ P2 p2 = e.getAnnotation(P2.class);
+ try {
+ classes = p2.value();
+ } catch(MirroredTypesException mtse) {
+ if (mtse instanceof MirroredTypeException) {
+ throw new RuntimeException("Wrong exception type!");
+ }
+
+ List extends TypeMirror> types = mtse.getTypeMirrors();
+ if (types.size() != 2)
+ throw new RuntimeException("List size != 2: " +
+ types);
+ checkTypeListMatchesClasses(types,
+ this.getClass().getAnnotation(P2.class).value());
+ }
+
+ Class> clazz = null;
+ S1 s1 = e.getAnnotation(S1.class);
+ try {
+ clazz = s1.value();
+ } catch(MirroredTypesException mtse) {
+ List extends TypeMirror> types = mtse.getTypeMirrors();
+ if (types.size() != 1)
+ throw new RuntimeException("List size != 1: " +
+ types);
+ Class>[] clazzes = new Class>[1];
+ clazzes[0] = this.getClass().getAnnotation(S1.class).value();
+ checkTypeListMatchesClasses(types,
+ clazzes);
+ }
+
+ try {
+ clazz = s1.value();
+ } catch(MirroredTypeException mte) {
+ TypeMirror type = mte.getTypeMirror();
+ if (type == null) {
+ throw new RuntimeException("Expected null");
+ }
+ List types = new ArrayList<>();
+ types.add(type);
+ Class>[] clazzes = new Class>[1];
+ clazzes[0] = this.getClass().getAnnotation(S1.class).value();
+ checkTypeListMatchesClasses(types, clazzes);
+ }
+ } else {
+ if (!executed) {
+ throw new RuntimeException("Didn't seem to do anything!");
+ }
+ }
+ return true;
+ }
+
+ private static void checkTypeListMatchesClasses(List extends TypeMirror> types,
+ Class>[] classes) {
+ if (types.size() != classes.length)
+ throw new RuntimeException("Size mismatch:\n\t" + types +
+ "\n\t" + Arrays.toString(classes));
+ int i = -1;
+ for(Class> clazz : classes) {
+ i++;
+ String canonicalName = clazz.getCanonicalName();
+ String toStringName = types.get(i).toString();
+ if (!canonicalName.equals(toStringName))
+ throw new RuntimeException("Mismatched names: " +
+ canonicalName + "\t" +
+ toStringName);
+ }
+ }
+
+ @Override
+ public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.latest();
+ }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface P0 {
+ Class[] value() default {};
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface P1 {
+ Class[] value() default {Integer.class};
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface P2 {
+ Class[] value() default {String.class, Number.class};
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface S1 {
+ Class value() default BigDecimal.class;
+}
diff --git a/langtools/test/tools/javac/processing/model/type/NoTypes.java b/langtools/test/tools/javac/processing/model/type/NoTypes.java
index ba67fc5b628..3e26d6fd01d 100644
--- a/langtools/test/tools/javac/processing/model/type/NoTypes.java
+++ b/langtools/test/tools/javac/processing/model/type/NoTypes.java
@@ -89,7 +89,7 @@ public class NoTypes extends AbstractProcessor {
verifyKind(NONE, types.getNoType(NONE));
// The return type of a constructor or void method is VOID.
- class Scanner extends ElementScanner6 {
+ class Scanner extends ElementScanner7 {
@Override
public Void visitExecutable(ExecutableElement e, Void p) {
verifyKind(VOID, e.getReturnType());
@@ -104,10 +104,10 @@ public class NoTypes extends AbstractProcessor {
/**
* Verify that a NoType instance is of a particular kind,
- * and that TypeKindVisitor6 properly dispatches on it.
+ * and that TypeKindVisitor7 properly dispatches on it.
*/
private void verifyKind(TypeKind kind, TypeMirror type) {
- class Vis extends TypeKindVisitor6 {
+ class Vis extends TypeKindVisitor7 {
@Override
public TypeKind visitNoTypeAsVoid(NoType t, Void p) {
return VOID;
diff --git a/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java b/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java
index b3b7438310b..a7ff90ba060 100644
--- a/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java
+++ b/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java
@@ -67,7 +67,7 @@ public class TestDeprecation extends AbstractProcessor {
return true;
}
- private class DeprecationChecker extends ElementScanner6 {
+ private class DeprecationChecker extends ElementScanner7 {
private Elements elementUtils;
private boolean failure;
DeprecationChecker() {
diff --git a/langtools/test/tools/javac/varargs/6730476/T6730476a.java b/langtools/test/tools/javac/varargs/6730476/T6730476a.java
index b237f02442f..7eca3cb0bcf 100644
--- a/langtools/test/tools/javac/varargs/6730476/T6730476a.java
+++ b/langtools/test/tools/javac/varargs/6730476/T6730476a.java
@@ -27,7 +27,7 @@
*
* @summary invalid "unchecked generic array" warning
* @author mcimadamore
- * @compile T6730476a.java -Xlint -Werror
+ * @compile T6730476a.java -Xlint:unchecked -Werror
*
*/
diff --git a/langtools/test/tools/javac/varargs/6806876/T6806876.out b/langtools/test/tools/javac/varargs/6806876/T6806876.out
index 4ebb086821a..8d4ad3d4551 100644
--- a/langtools/test/tools/javac/varargs/6806876/T6806876.out
+++ b/langtools/test/tools/javac/varargs/6806876/T6806876.out
@@ -1,4 +1,6 @@
T6806876.java:11:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable extends java.lang.Number&java.lang.Comparable>>[]
- compiler.err.warnings.and.werror
+- compiler.note.varargs.filename: T6806876.java
+- compiler.note.varargs.recompile
1 error
1 warning
diff --git a/langtools/test/tools/javac/varargs/warning/Warn4.java b/langtools/test/tools/javac/varargs/warning/Warn4.java
new file mode 100644
index 00000000000..df63fdc3f4a
--- /dev/null
+++ b/langtools/test/tools/javac/varargs/warning/Warn4.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2010, 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 6945418
+ * @summary Project Coin: Simplified Varargs Method Invocation
+ * @author mcimadamore
+ * @run main Warn4
+ */
+import com.sun.source.util.JavacTask;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.HashSet;
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class Warn4 {
+
+ final static Warning[] error = null;
+ final static Warning[] none = new Warning[] {};
+ final static Warning[] vararg = new Warning[] { Warning.VARARGS };
+ final static Warning[] unchecked = new Warning[] { Warning.UNCHECKED };
+ final static Warning[] both = new Warning[] { Warning.VARARGS, Warning.UNCHECKED };
+
+ enum Warning {
+ UNCHECKED("unchecked"),
+ VARARGS("varargs");
+
+ String category;
+
+ Warning(String category) {
+ this.category = category;
+ }
+
+ boolean isEnabled(XlintOption xlint, SuppressLevel suppressLevel) {
+ return Arrays.asList(xlint.enabledWarnings).contains(this);
+ }
+
+ boolean isSuppressed(SuppressLevel suppressLevel) {
+ return Arrays.asList(suppressLevel.suppressedWarnings).contains(VARARGS);
+ }
+ }
+
+ enum XlintOption {
+ NONE(),
+ UNCHECKED(Warning.UNCHECKED),
+ VARARGS(Warning.VARARGS),
+ ALL(Warning.UNCHECKED, Warning.VARARGS);
+
+ Warning[] enabledWarnings;
+
+ XlintOption(Warning... enabledWarnings) {
+ this.enabledWarnings = enabledWarnings;
+ }
+
+ String getXlintOption() {
+ StringBuilder buf = new StringBuilder();
+ String sep = "";
+ for (Warning w : enabledWarnings) {
+ buf.append(sep);
+ buf.append(w.category);
+ sep=",";
+ }
+ return "-Xlint:" +
+ (this == NONE ? "none" : buf.toString());
+ }
+ }
+
+ enum SuppressLevel {
+ NONE(),
+ UNCHECKED(Warning.UNCHECKED),
+ VARARGS(Warning.VARARGS),
+ ALL(Warning.UNCHECKED, Warning.VARARGS);
+
+ Warning[] suppressedWarnings;
+
+ SuppressLevel(Warning... suppressedWarnings) {
+ this.suppressedWarnings = suppressedWarnings;
+ }
+
+ String getSuppressAnnotation() {
+ StringBuilder buf = new StringBuilder();
+ String sep = "";
+ for (Warning w : suppressedWarnings) {
+ buf.append(sep);
+ buf.append("\"");
+ buf.append(w.category);
+ buf.append("\"");
+ sep=",";
+ }
+ return this == NONE ? "" :
+ "@SuppressWarnings({" + buf.toString() + "})";
+ }
+ }
+
+ enum Signature {
+
+ EXTENDS_TVAR(" void #name(List extends Z>#arity arg) { #body }",
+ new Warning[][] {both, both, both, both, error, both, both, both, error}),
+ SUPER_TVAR(" void #name(List super Z>#arity arg) { #body }",
+ new Warning[][] {error, both, error, both, error, error, both, both, error}),
+ UNBOUND("void #name(List>#arity arg) { #body }",
+ new Warning[][] {none, none, none, none, none, none, none, none, error}),
+ INVARIANT_TVAR(" void #name(List#arity arg) { #body }",
+ new Warning[][] {both, both, both, both, error, both, both, both, error}),
+ TVAR(" void #name(Z#arity arg) { #body }",
+ new Warning[][] {both, both, both, both, both, both, both, both, vararg}),
+ EXTENDS("void #name(List extends String>#arity arg) { #body }",
+ new Warning[][] {error, error, error, error, error, both, error, both, error}),
+ SUPER("void #name(List super String>#arity arg) { #body }",
+ new Warning[][] {error, error, error, error, error, error, both, both, error}),
+ INVARIANT("void #name(List#arity arg) { #body }",
+ new Warning[][] {error, error, error, error, error, error, error, both, error}),
+ UNPARAMETERIZED("void #name(String#arity arg) { #body }",
+ new Warning[][] {error, error, error, error, error, error, error, error, none});
+
+ String template;
+ Warning[][] warnings;
+
+ Signature(String template, Warning[][] warnings) {
+ this.template = template;
+ this.warnings = warnings;
+ }
+
+ boolean isApplicableTo(Signature other) {
+ return warnings[other.ordinal()] != null;
+ }
+
+ boolean giveUnchecked(Signature other) {
+ return warnings[other.ordinal()] == unchecked ||
+ warnings[other.ordinal()] == both;
+ }
+
+ boolean giveVarargs(Signature other) {
+ return warnings[other.ordinal()] == vararg ||
+ warnings[other.ordinal()] == both;
+ }
+ }
+
+ public static void main(String... args) throws Exception {
+ for (XlintOption xlint : XlintOption.values()) {
+ for (SuppressLevel suppressLevel : SuppressLevel.values()) {
+ for (Signature vararg_meth : Signature.values()) {
+ for (Signature client_meth : Signature.values()) {
+ if (vararg_meth.isApplicableTo(client_meth)) {
+ test(xlint,
+ suppressLevel,
+ vararg_meth,
+ client_meth);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ static void test(XlintOption xlint, SuppressLevel suppressLevel,
+ Signature vararg_meth, Signature client_meth) throws Exception {
+ final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+ JavaSource source = new JavaSource(suppressLevel, vararg_meth, client_meth);
+ DiagnosticChecker dc = new DiagnosticChecker();
+ JavacTask ct = (JavacTask)tool.getTask(null, null, dc,
+ Arrays.asList(xlint.getXlintOption()), null, Arrays.asList(source));
+ ct.generate(); //to get mandatory notes
+ check(dc.warnings,
+ dc.notes,
+ new boolean[] {vararg_meth.giveUnchecked(client_meth),
+ vararg_meth.giveVarargs(client_meth)},
+ source, xlint, suppressLevel);
+ }
+
+ static void check(Set warnings, Set notes, boolean[] warnArr, JavaSource source, XlintOption xlint, SuppressLevel suppressLevel) {
+ boolean badOutput = false;
+ for (Warning wkind : Warning.values()) {
+ badOutput |= (warnArr[wkind.ordinal()] && !wkind.isSuppressed(suppressLevel)) !=
+ (wkind.isEnabled(xlint, suppressLevel) ?
+ warnings.contains(wkind) :
+ notes.contains(wkind));
+ }
+ if (badOutput) {
+ throw new Error("invalid diagnostics for source:\n" +
+ source.getCharContent(true) +
+ "\nOptions: " + xlint.getXlintOption() +
+ "\nExpected unchecked warning: " + warnArr[0] +
+ "\nExpected unsafe vararg warning: " + warnArr[1] +
+ "\nWarnings: " + warnings +
+ "\nNotes: " + notes);
+ }
+ }
+
+ static class JavaSource extends SimpleJavaFileObject {
+
+ String source;
+
+ public JavaSource(SuppressLevel suppressLevel, Signature vararg_meth, Signature client_meth) {
+ super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+ String meth1 = vararg_meth.template.replace("#arity", "...");
+ meth1 = meth1.replace("#name", "m");
+ meth1 = meth1.replace("#body", "");
+ meth1 = suppressLevel.getSuppressAnnotation() + meth1;
+ String meth2 = client_meth.template.replace("#arity", "");
+ meth2 = meth2.replace("#name", "test");
+ meth2 = meth2.replace("#body", "m(arg);");
+ source = "import java.util.List;\n" +
+ "class Test {\n" + meth1 +
+ "\n" + meth2 + "\n}\n";
+ }
+
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+ return source;
+ }
+ }
+
+ static class DiagnosticChecker implements javax.tools.DiagnosticListener {
+
+ Set warnings = new HashSet<>();
+ Set notes = new HashSet<>();
+
+ public void report(Diagnostic extends JavaFileObject> diagnostic) {
+ if (diagnostic.getKind() == Diagnostic.Kind.MANDATORY_WARNING ||
+ diagnostic.getKind() == Diagnostic.Kind.WARNING) {
+ warnings.add(diagnostic.getCode().contains("varargs") ?
+ Warning.VARARGS :
+ Warning.UNCHECKED);
+ }
+ else if (diagnostic.getKind() == Diagnostic.Kind.NOTE) {
+ notes.add(diagnostic.getCode().contains("varargs") ?
+ Warning.VARARGS :
+ Warning.UNCHECKED);
+ }
+ }
+ }
+}
diff --git a/langtools/test/tools/javadoc/6958836/Test.java b/langtools/test/tools/javadoc/6958836/Test.java
new file mode 100644
index 00000000000..b14949f392d
--- /dev/null
+++ b/langtools/test/tools/javadoc/6958836/Test.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2010, 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 6958836
+ * @summary javadoc should support -Xmaxerrs and -Xmaxwarns
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class Test {
+ public static void main(String... args) throws Exception {
+ new Test().run();
+ }
+
+ void run() throws Exception {
+ javadoc("errs", list(), 10, 0);
+ javadoc("errs", list("-Xmaxerrs", "0"), 10, 0);
+ javadoc("errs", list("-Xmaxerrs", "2"), 2, 0);
+ javadoc("errs", list("-Xmaxerrs", "4"), 4, 0);
+ javadoc("errs", list("-Xmaxerrs", "20"), 10, 0);
+
+ javadoc("warns", list(), 0, 10);
+ javadoc("warns", list("-Xmaxwarns", "0"), 0, 10);
+ javadoc("warns", list("-Xmaxwarns", "2"), 0, 2);
+ javadoc("warns", list("-Xmaxwarns", "4"), 0, 4);
+ javadoc("warns", list("-Xmaxwarns", "20"), 0, 10);
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred.");
+ }
+
+ void javadoc(String pkg, List testOpts,
+ int expectErrs, int expectWarns) {
+ System.err.println("Test " + (++count) + ": " + pkg + " " + testOpts);
+ File testOutDir = new File("test" + count);
+
+ List opts = new ArrayList();
+ // Force en_US locale in lieu of something like -XDrawDiagnostics.
+ // For some reason, this must be the first option when used.
+ opts.addAll(list("-locale", "en_US"));
+ opts.addAll(list("-classpath", System.getProperty("test.src")));
+ opts.addAll(list("-d", testOutDir.getPath()));
+ opts.addAll(testOpts);
+ opts.add(pkg);
+
+ StringWriter errSW = new StringWriter();
+ PrintWriter errPW = new PrintWriter(errSW);
+ StringWriter warnSW = new StringWriter();
+ PrintWriter warnPW = new PrintWriter(warnSW);
+ StringWriter noteSW = new StringWriter();
+ PrintWriter notePW = new PrintWriter(noteSW);
+
+ int rc = com.sun.tools.javadoc.Main.execute("javadoc",
+ errPW, warnPW, notePW,
+ "com.sun.tools.doclets.standard.Standard",
+ getClass().getClassLoader(),
+ opts.toArray(new String[opts.size()]));
+ System.err.println("rc: " + rc);
+
+ errPW.close();
+ String errOut = errSW.toString();
+ System.err.println("Errors:\n" + errOut);
+ warnPW.close();
+ String warnOut = warnSW.toString();
+ System.err.println("Warnings:\n" + warnOut);
+ notePW.close();
+ String noteOut = noteSW.toString();
+ System.err.println("Notes:\n" + noteOut);
+
+ check(errOut, "Errors.java", expectErrs);
+ check(warnOut, " warning ", expectWarns); // requires -locale en_US
+ }
+
+ void check(String text, String expectText, int expectCount) {
+ int foundCount = 0;
+ for (String line: text.split("[\r\n]+")) {
+ if (line.contains(expectText))
+ foundCount++;
+ }
+ if (foundCount != expectCount) {
+ error("incorrect number of matches found: " + foundCount
+ + ", expected: " + expectCount);
+ }
+ }
+
+ private List list(String... args) {
+ return Arrays.asList(args);
+ }
+
+ void error(String msg) {
+ System.err.println(msg);
+ errors++;
+ }
+
+ int count;
+ int errors;
+}
diff --git a/langtools/test/tools/javadoc/6958836/errs/Errors.java b/langtools/test/tools/javadoc/6958836/errs/Errors.java
new file mode 100644
index 00000000000..e68d01b1a55
--- /dev/null
+++ b/langtools/test/tools/javadoc/6958836/errs/Errors.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+package errs;
+
+// class with 10 errors
+class Errors {
+ X m0() { }
+ X m1() { }
+ X m2() { }
+ X m3() { }
+ X m4() { }
+ X m5() { }
+ X m6() { }
+ X m7() { }
+ X m8() { }
+ X m9() { }
+}
diff --git a/langtools/test/tools/javadoc/6958836/warns/Warnings.java b/langtools/test/tools/javadoc/6958836/warns/Warnings.java
new file mode 100644
index 00000000000..cf94711683b
--- /dev/null
+++ b/langtools/test/tools/javadoc/6958836/warns/Warnings.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2010, 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.
+ */
+
+package warns;
+
+// class with 10 warnings
+public class Warnings {
+ /** @param x */
+ public void m0() { }
+
+ /** @param x */
+ public void m1() { }
+
+ /** @param x */
+ public void m2() { }
+
+ /** @param x */
+ public void m3() { }
+
+ /** @param x */
+ public void m4() { }
+
+ /** @param x */
+ public void m5() { }
+
+ /** @param x */
+ public void m6() { }
+
+ /** @param x */
+ public void m7() { }
+
+ /** @param x */
+ public void m8() { }
+
+ /** @param x */
+ public void m9() { }
+}