--- a/langtools/src/share/classes/com/sun/javadoc/AnnotationValue.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/AnnotationValue.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,11 +38,11 @@
* Returns the value.
* The type of the returned object is one of the following:
* <ul><li> a wrapper class for a primitive type
- * <li> <code>String</code>
- * <li> <code>Type</code> (representing a class literal)
- * <li> <code>FieldDoc</code> (representing an enum constant)
- * <li> <code>AnnotationDesc</code>
- * <li> <code>AnnotationValue[]</code>
+ * <li> {@code String}
+ * <li> {@code Type} (representing a class literal)
+ * <li> {@code FieldDoc} (representing an enum constant)
+ * <li> {@code AnnotationDesc}
+ * <li> {@code AnnotationValue[]}
* </ul>
*
* @return the value.
--- a/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,28 +46,40 @@
/**
* Return true if this class is abstract. Return true
* for all interfaces.
+ *
+ * @return true if this class is abstract. Return true
+ * for all interfaces.
*/
boolean isAbstract();
/**
* Return true if this class implements or interface extends
- * <code>java.io.Serializable</code>.
+ * {@code java.io.Serializable}.
*
- * Since <code>java.io.Externalizable</code> extends
- * <code>java.io.Serializable</code>,
+ * Since {@code java.io.Externalizable} extends
+ * {@code java.io.Serializable},
* Externalizable objects are also Serializable.
+ *
+ * @return true if this class implements or interface extends
+ * {@code java.io.Serializable}.
*/
boolean isSerializable();
/**
* Return true if this class implements or interface extends
- * <code>java.io.Externalizable</code>.
+ * {@code java.io.Externalizable}.
+ *
+ * @return true if this class implements or interface extends
+ * {@code java.io.Externalizable}.
*/
boolean isExternalizable();
/**
* Return true if this class can be used as a target type of a lambda expression
* or method reference.
+ *
+ * @return true if this class can be used as a target type of a lambda expression
+ * or method reference.
*/
boolean isFunctionalInterface();
@@ -84,14 +96,14 @@
* Return the Serializable fields of this class or interface.
* <p>
* Return either a list of default fields documented by
- * <code>serial</code> tag<br>
- * or return a single <code>FieldDoc</code> for
- * <code>serialPersistentField</code> member.
- * There should be a <code>serialField</code> tag for
- * each Serializable field defined by an <code>ObjectStreamField</code>
- * array component of <code>serialPersistentField</code>.
+ * {@code serial} tag<br>
+ * or return a single {@code FieldDoc} for
+ * {@code serialPersistentField} member.
+ * There should be a {@code serialField} tag for
+ * each Serializable field defined by an {@code ObjectStreamField}
+ * array component of {@code serialPersistentField}.
*
- * @return an array of <code>FieldDoc</code> objects for the Serializable
+ * @return an array of {@code FieldDoc} objects for the Serializable
* fields of this class or interface.
*
* @see #definesSerializableFields()
@@ -101,7 +113,10 @@
/**
* Return true if Serializable fields are explicitly defined with
- * the special class member <code>serialPersistentFields</code>.
+ * the special class member {@code serialPersistentFields}.
+ *
+ * @return true if Serializable fields are explicitly defined with
+ * the special class member {@code serialPersistentFields}.
*
* @see #serializableFields()
* @see SerialFieldTag
@@ -113,7 +128,7 @@
* interface.
*
* <p> <i>This method cannot accommodate certain generic type constructs.
- * The <code>superclassType</code> method should be used instead.</i>
+ * The {@code superclassType} method should be used instead.</i>
*
* @return the ClassDoc for the superclass of this class, null if
* there is no superclass.
@@ -124,7 +139,7 @@
/**
* Return the superclass of this class. Return null if this is an
* interface. A superclass is represented by either a
- * <code>ClassDoc</code> or a <code>ParametrizedType</code>.
+ * {@code ClassDoc} or a {@code ParametrizedType}.
*
* @return the superclass of this class, or null if there is no superclass.
* @since 1.5
@@ -134,7 +149,7 @@
/**
* Test whether this class is a subclass of the specified class.
* If this is an interface, return false for all classes except
- * <code>java.lang.Object</code> (we must keep this unexpected
+ * {@code java.lang.Object} (we must keep this unexpected
* behavior for compatibility reasons).
*
* @param cd the candidate superclass.
@@ -149,7 +164,7 @@
* Return an empty array if there are no interfaces.
*
* <p> <i>This method cannot accommodate certain generic type constructs.
- * The <code>interfaceTypes</code> method should be used instead.</i>
+ * The {@code interfaceTypes} method should be used instead.</i>
*
* @return an array of ClassDoc objects representing the interfaces.
* @see #interfaceTypes
@@ -163,7 +178,7 @@
* Return an empty array if there are no interfaces.
*
* @return an array of interfaces, each represented by a
- * <code>ClassDoc</code> or a <code>ParametrizedType</code>.
+ * {@code ClassDoc} or a {@code ParametrizedType}.
* @since 1.5
*/
Type[] interfaceTypes();
@@ -225,7 +240,7 @@
* Return
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* methods in this class or interface.
- * Same as <code>methods(true)</code>.
+ * Same as {@code methods(true)}.
*
* @return an array of MethodDoc objects representing the included
* methods in this class or interface. Does not include
@@ -243,6 +258,7 @@
* modifier option.
* Specify false to include all methods regardless of
* access modifier option.
+ *
* @return an array of MethodDoc objects representing the included
* methods in this class or interface.
*/
@@ -281,7 +297,7 @@
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* nested classes and interfaces within this class or interface.
* This includes both static and non-static nested classes.
- * (This method should have been named <code>nestedClasses()</code>,
+ * (This method should have been named {@code nestedClasses()},
* as inner classes are technically non-static.) Anonymous and local classes
* or interfaces are not included.
*
@@ -312,6 +328,8 @@
* Search order: 1) qualified name, 2) nested in this class or interface,
* 3) in this package, 4) in the class imports, 5) in the package imports.
* Return the ClassDoc if found, null if not found.
+ * @param className Specify the class name to find as a String.
+ * @return the ClassDoc if found, null if not found.
*/
ClassDoc findClass(String className);
--- a/langtools/src/share/classes/com/sun/javadoc/Doc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/Doc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,8 @@
/**
* Return the text of the comment for this doc item.
* Tags have been removed.
+ *
+ * @return the text of the comment for this doc item.
*/
String commentText();
@@ -119,6 +121,8 @@
* Return the full unprocessed text of the comment. Tags
* are included as text. Used mainly for store and retrieve
* operations like internalization.
+ *
+ * @return the full unprocessed text of the comment.
*/
String getRawCommentText();
@@ -126,6 +130,8 @@
* Set the full unprocessed text of the comment. Tags
* are included as text. Used mainly for store and retrieve
* operations like internalization.
+ *
+ * @param rawDocumentation A String containing the full unprocessed text of the comment.
*/
void setRawCommentText(String rawDocumentation);
@@ -143,7 +149,7 @@
* <p>
* This method satisfies the {@link java.lang.Comparable} interface.
*
- * @param obj the <code>Object</code> to be compared.
+ * @param obj the {@code Object} to be compared.
* @return a negative integer, zero, or a positive integer as this Object
* is less than, equal to, or greater than the given Object.
* @exception ClassCastException the specified Object's type prevents it
@@ -250,6 +256,10 @@
* Return true if this Doc item is
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* in the result set.
+ *
+ * @return true if this Doc item is
+ * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
+ * in the result set.
*/
boolean isIncluded();
@@ -260,6 +270,10 @@
* null because it has no location in the source file.
*
* @since 1.4
+ * @return the source positino of the first line of the
+ * corresponding declaration, or null if
+ * no position is available. A default constructor returns
+ * null because it has no location in the source file.
*/
SourcePosition position();
}
--- a/langtools/src/share/classes/com/sun/javadoc/Doclet.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/Doclet.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -29,15 +29,15 @@
* This is an example of a starting class for a doclet,
* showing the entry-point methods. A starting class must
* import com.sun.javadoc.* and implement the
- * <code>start(RootDoc)</code> method, as described in the
+ * {@code start(RootDoc)} method, as described in the
* <a href="package-summary.html#package_description">package
* description</a>. If the doclet takes command line options,
- * it must also implement <code>optionLength</code> and
- * <code>validOptions</code>.
+ * it must also implement {@code optionLength} and
+ * {@code validOptions}.
*
* <p> A doclet supporting the language features added since 1.1
* (such as generics and annotations) should indicate this
- * by implementing <code>languageVersion</code>. In the absence of
+ * by implementing {@code languageVersion}. In the absence of
* this the doclet should not invoke any of the Doclet API methods
* added since 1.5, and
* the results of several other methods are modified so as
@@ -45,7 +45,7 @@
* the doclet.
*
* <p> To start the doclet, pass
- * <code>-doclet</code> followed by the fully-qualified
+ * {@code -doclet} followed by the fully-qualified
* name of the starting class on the javadoc tool command line.
*/
public abstract class Doclet {
@@ -54,6 +54,7 @@
* Generate documentation here.
* This method is required for all doclets.
*
+ * @param root Supply the RootDoc to the method.
* @return true on success.
*/
public static boolean start(RootDoc root) {
@@ -69,6 +70,7 @@
* If this method is missing, Javadoc will print an invalid flag
* error for every option.
*
+ * @param option the option for which the number of arguements is returned.
* @return number of arguments on the command line for an option
* including the option name itself. Zero return means
* option not known. Negative value means error occurred.
@@ -88,6 +90,8 @@
* Printing option related error messages (using the provided
* DocErrorReporter) is the responsibility of this method.
*
+ * @param options Supply valid options as an array of Strings.
+ * @param reporter The DocErrorReporter responsible for these options.
* @return true if the options are valid.
*/
public static boolean validOptions(String options[][],
--- a/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -36,11 +36,11 @@
/**
* Return exceptions this method or constructor throws.
* If the type of the exception is a type variable, return the
- * <code>ClassDoc</code> of its erasure.
+ * {@code ClassDoc} of its erasure.
*
- * <p> <i>The <code>thrownExceptions</code> method cannot
+ * <p> <i>The {@code thrownExceptions} method cannot
* accommodate certain generic type constructs. The
- * <code>thrownExceptionTypes</code> method should be used
+ * {@code thrownExceptionTypes} method should be used
* instead.</i>
*
* @return an array of ClassDoc[] representing the exceptions
@@ -53,19 +53,23 @@
* Return exceptions this method or constructor throws.
*
* @return an array representing the exceptions thrown by this method.
- * Each array element is either a <code>ClassDoc</code> or a
- * <code>TypeVariable</code>.
+ * Each array element is either a {@code ClassDoc} or a
+ * {@code TypeVariable}.
* @since 1.5
*/
Type[] thrownExceptionTypes();
/**
* Return true if this method is native
+ *
+ * @return true if this method is native
*/
boolean isNative();
/**
* Return true if this method is synchronized
+ *
+ * @return true if this method is synchronized
*/
boolean isSynchronized();
@@ -74,6 +78,7 @@
* of arguments.
*
* @since 1.5
+ * @return true if this method was declared to take a variable number of arguments.
*/
public boolean isVarArgs();
@@ -98,8 +103,8 @@
/**
* Return the throws tags in this method.
*
- * @return an array of ThrowTag containing all <code>@exception</code>
- * and <code>@throws</code> tags.
+ * @return an array of ThrowTag containing all {@code @exception}
+ * and {@code @throws} tags.
*/
ThrowsTag[] throwsTags();
@@ -107,7 +112,7 @@
* Return the param tags in this method, excluding the type
* parameter tags.
*
- * @return an array of ParamTag containing all <code>@param</code> tags
+ * @return an array of ParamTag containing all {@code @param} tags
* corresponding to the parameters of this method.
*/
ParamTag[] paramTags();
@@ -115,7 +120,7 @@
/**
* Return the type parameter tags in this method.
*
- * @return an array of ParamTag containing all <code>@param</code> tags
+ * @return an array of ParamTag containing all {@code @param} tags
* corresponding to the type parameters of this method.
* @since 1.5
*/
@@ -123,8 +128,10 @@
/**
* Get the signature. It is the parameter list, type is qualified.
- * For instance, for a method <code>mymethod(String x, int y)</code>,
- * it will return <code>(java.lang.String,int)</code>.
+ * For instance, for a method {@code mymethod(String x, int y)},
+ * it will return {@code (java.lang.String,int)}.
+ *
+ * @return the parameter list where type is qualified.
*/
String signature();
@@ -132,8 +139,10 @@
* get flat signature. all types are not qualified.
* return a String, which is the flat signiture of this member.
* It is the parameter list, type is not qualified.
- * For instance, for a method <code>mymethod(String x, int y)</code>,
- * it will return <code>(String, int)</code>.
+ * For instance, for a method {@code mymethod(String x, int y)},
+ * it will return {@code (String, int)}.
+ *
+ * @return a String, which is the flat signiture of this member.
*/
String flatSignature();
--- a/langtools/src/share/classes/com/sun/javadoc/FieldDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/FieldDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -37,16 +37,22 @@
/**
* Get type of this field.
+ *
+ * @return the type of this field.
*/
Type type();
/**
* Return true if this field is transient
+ *
+ * @return true if this field is transient
*/
boolean isTransient();
/**
* Return true if this field is volatile
+ *
+ * @return true if this field is volatile
*/
boolean isVolatile();
@@ -54,7 +60,7 @@
* Return the serialField tags in this FieldDoc item.
*
* @return an array of <tt>SerialFieldTag</tt> objects containing
- * all <code>@serialField</code> tags.
+ * all {@code @serialField} tags.
*/
SerialFieldTag[] serialFieldTags();
--- a/langtools/src/share/classes/com/sun/javadoc/MemberDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/MemberDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -42,6 +42,8 @@
/**
* Returns true if this member was synthesized by the compiler.
+ *
+ * @return true if this member was synthesized by the compiler.
*/
boolean isSynthetic();
}
--- a/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -35,11 +35,15 @@
/**
* Return true if this method is abstract
+ *
+ * @return true if this method is abstract
*/
boolean isAbstract();
/**
* Return true if this method is default
+ *
+ * @return true if this method is default
*/
boolean isDefault();
@@ -54,9 +58,9 @@
/**
* Return the class containing the method that this method overrides.
*
- * <p> <i>The <code>overriddenClass</code> method cannot
+ * <p> <i>The {@code overriddenClass} method cannot
* accommodate certain generic type constructs. The
- * <code>overriddenType</code> method should be used instead.</i>
+ * {@code overriddenType} method should be used instead.</i>
*
* @return a ClassDoc representing the superclass
* defining a method that this method overrides, or null if
@@ -66,7 +70,7 @@
/**
* Return the type containing the method that this method overrides.
- * It may be a <code>ClassDoc</code> or a <code>ParameterizedType</code>.
+ * It may be a {@code ClassDoc} or a {@code ParameterizedType}.
*
* @return the supertype whose method is overridden, or null if this
* method does not override another in a superclass
--- a/langtools/src/share/classes/com/sun/javadoc/PackageDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/PackageDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -122,6 +122,7 @@
/**
* Lookup a class or interface within this package.
*
+ * @param className A String containing the name of the class to look up.
* @return ClassDoc of found class or interface,
* or null if not found.
*/
--- a/langtools/src/share/classes/com/sun/javadoc/ParamTag.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/ParamTag.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
/**
* Return the name of the parameter or type parameter
- * associated with this <code>ParamTag</code>.
+ * associated with this {@code ParamTag}.
* The angle brackets delimiting a type parameter are not part of
* its name.
*
@@ -48,18 +48,18 @@
/**
* Return the parameter comment
- * associated with this <code>ParamTag</code>.
+ * associated with this {@code ParamTag}.
*
* @return the parameter comment.
*/
String parameterComment();
/**
- * Return true if this <code>ParamTag</code> corresponds to a type
+ * Return true if this {@code ParamTag} corresponds to a type
* parameter. Return false if it corresponds to an ordinary parameter
* of a method or constructor.
*
- * @return true if this <code>ParamTag</code> corresponds to a type
+ * @return true if this {@code ParamTag} corresponds to a type
* parameter.
* @since 1.5
*/
--- a/langtools/src/share/classes/com/sun/javadoc/Parameter.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/Parameter.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -35,12 +35,16 @@
/**
* Get the type of this parameter.
+ *
+ * @return the type of this parameter.
*/
Type type();
/**
* Get local name of this parameter.
* For example if parameter is the short 'index', returns "index".
+ *
+ * @return the name of this parameter as a string.
*/
String name();
@@ -51,6 +55,8 @@
* This method returns a complete string
* representation of the type, including the dimensions of arrays and
* the type arguments of parameterized types. Names are qualified.
+ *
+ * @return a complete string representation of the type.
*/
String typeName();
--- a/langtools/src/share/classes/com/sun/javadoc/ParameterizedType.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/ParameterizedType.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -97,10 +97,10 @@
* Return null is this is a top-level type.
*
* <p> For example, the containing type of
- * {@code AnInterface.Nested<Number>} is the <code>ClassDoc</code>
+ * {@code AnInterface.Nested<Number>} is the {@code ClassDoc}
* representing {@code AnInterface}, and the containing type of
* {@code Outer<String>.Inner<Number>} is the
- * <code>ParameterizedType</code> representing {@code Outer<String>}.
+ * {@code ParameterizedType} representing {@code Outer<String>}.
*
* @return the type that contains this type as a member.
*/
--- a/langtools/src/share/classes/com/sun/javadoc/ProgramElementDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/ProgramElementDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -57,10 +57,10 @@
/**
* Get the fully qualified name of this program element.
- * For example, for the class <code>java.util.Hashtable</code>,
+ * For example, for the class {@code java.util.Hashtable},
* return "java.util.Hashtable".
* <p>
- * For the method <code>bar()</code> in class <code>Foo</code>
+ * For the method {@code bar()} in class {@code Foo}
* in the unnamed package, return "Foo.bar".
*
* @return the qualified name of the program element as a String.
@@ -71,6 +71,8 @@
* Get the modifier specifier integer.
*
* @see java.lang.reflect.Modifier
+ *
+ * @return Get the modifier specifier integer.
*/
int modifierSpecifier();
@@ -82,6 +84,8 @@
* </pre>
* return "public abstract".
* Annotations are not included.
+ *
+ * @return "public abstract".
*/
String modifiers();
@@ -96,30 +100,42 @@
/**
* Return true if this program element is public.
+ *
+ * @return true if this program element is public.
*/
boolean isPublic();
/**
* Return true if this program element is protected.
+ *
+ * @return true if this program element is protected.
*/
boolean isProtected();
/**
* Return true if this program element is private.
+ *
+ * @return true if this program element is private.
*/
boolean isPrivate();
/**
* Return true if this program element is package private.
+ *
+ * @return true if this program element is package private.
*/
boolean isPackagePrivate();
/**
* Return true if this program element is static.
+ *
+ * @return true if this program element is static.
*/
boolean isStatic();
/**
* Return true if this program element is final.
+ *
+ * @return true if this program element is final.
*/
boolean isFinal();
}
--- a/langtools/src/share/classes/com/sun/javadoc/RootDoc.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/RootDoc.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
* Return the packages
* <a href="package-summary.html#included">specified</a>
* on the command line.
- * If <code>-subpackages</code> and <code>-exclude</code> options
+ * If {@code -subpackages} and {@code -exclude} options
* are used, return all the non-excluded packages.
*
* @return packages specified on the command line.
--- a/langtools/src/share/classes/com/sun/javadoc/SeeTag.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/SeeTag.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -31,11 +31,11 @@
* plain text. (The plain text might be a reference
* to something not online, such as a printed book, or be a hard-coded
* HTML link.) The reference can either be inline with the comment,
- * using <code>{@link}</code>, or a separate block comment,
- * using <code>@see</code>.
- * Method <code>name()</code> returns "@link" (no curly braces) or
+ * using {@code {@link}}, or a separate block comment,
+ * using {@code @see}.
+ * Method {@code name()} returns "@link" (no curly braces) or
* "@see", depending on the tag.
- * Method <code>kind()</code> returns "@see" for both tags.
+ * Method {@code kind()} returns "@see" for both tags.
*
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
@@ -45,44 +45,51 @@
public interface SeeTag extends Tag {
/**
- * Get the label of the <code>@see</code> tag.
+ * Get the label of the {@code @see} tag.
* Return null if no label is present.
* For example, for:
* <p>
- * <code>@see String#trim() the trim method</code>
+ * {@code @see String#trim() the trim method}
* </p>
* return "the trim method".
+ *
+ * @return "the trim method".
*/
String label();
/**
- * Get the package doc when <code>@see</code> references only a package.
+ * Get the package doc when {@code @see} references only a package.
* Return null if the package cannot be found, or if
- * <code>@see</code> references any other element (class,
+ * {@code @see} references any other element (class,
* interface, field, constructor, method) or non-element.
* For example, for:
* <p>
- * <code>@see java.lang</code>
+ * {@code @see java.lang}
* </p>
- * return the <code>PackageDoc</code> for <code>java.lang</code>.
+ * return the {@code PackageDoc} for {@code java.lang}.
+ *
+ * @return the {@code PackageDoc} for {@code java.lang}.
*/
public PackageDoc referencedPackage();
/**
- * Get the class or interface name of the <code>@see</code> reference.
+ * Get the class or interface name of the {@code @see} reference.
* The name is fully qualified if the name specified in the
- * original <code>@see</code> tag was fully qualified, or if the class
+ * original {@code @see} tag was fully qualified, or if the class
* or interface can be found; otherwise it is unqualified.
- * If <code>@see</code> references only a package name, then return
+ * If {@code @see} references only a package name, then return
* the package name instead.
* For example, for:
* <p>
- * <code>@see String#valueOf(java.lang.Object)</code>
+ * {@code @see String#valueOf(java.lang.Object)}
* </p>
* return "java.lang.String".
- * For "<code>@see java.lang</code>", return "java.lang".
- * Return null if <code>@see</code> references a non-element, such as
- * <code>@see <a href="java.sun.com"></code>.
+ * For "{@code @see java.lang}", return "java.lang".
+ * Return null if {@code @see} references a non-element, such as
+ * {@code @see <a href="java.sun.com">}.
+ *
+ * @return null if {@code @see} references a non-element, such as
+ * {@code @see <a href="java.sun.com">}.
*/
String referencedClassName();
@@ -91,36 +98,42 @@
* Return null if the class cannot be found.
* For example, for:
* <p>
- * <code>@see String#valueOf(java.lang.Object)</code>
+ * {@code @see String#valueOf(java.lang.Object)}
* </p>
- * return the <code>ClassDoc</code> for <code>java.lang.String</code>.
+ * return the {@code ClassDoc} for {@code java.lang.String}.
+ *
+ * @return the {@code ClassDoc} for {@code java.lang.String}.
*/
ClassDoc referencedClass();
/**
- * Get the field, constructor or method substring of the <code>@see</code>
+ * Get the field, constructor or method substring of the {@code @see}
* reference. Return null if the reference is to any other
* element or to any non-element.
* References to member classes (nested classes) return null.
* For example, for:
* <p>
- * <code>@see String#startsWith(String)</code>
+ * {@code @see String#startsWith(String)}
* </p>
* return "startsWith(String)".
+ *
+ * @return "startsWith(String)".
*/
String referencedMemberName();
/**
* Get the member doc for the field, constructor or method
- * referenced by <code>@see</code>. Return null if the member cannot
+ * referenced by {@code @see}. Return null if the member cannot
* be found or if the reference is to any other element or to any
* non-element.
* References to member classes (nested classes) return null.
* For example, for:
* <p>
- * <code>@see String#startsWith(java.lang.String)</code>
+ * {@code @see String#startsWith(java.lang.String)}
* </p>
- * return the <code>MethodDoc</code> for <code>startsWith</code>.
+ * return the {@code MethodDoc} for {@code startsWith}.
+ *
+ * @return the {@code MethodDoc} for {@code startsWith}.
*/
MemberDoc referencedMember();
}
--- a/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -47,11 +47,15 @@
/**
* Return the serializable field name.
+ *
+ * @return the serializable field name.
*/
public String fieldName();
/**
* Return the field type string.
+ *
+ * @return the field type string.
*/
public String fieldType();
@@ -66,6 +70,9 @@
/**
* Return the field comment. If there is no serialField comment, return
* javadoc comment of corresponding FieldDoc.
+ *
+ * @return the field comment. If there is no serialField comment, return
+ * javadoc comment of corresponding FieldDoc.
*/
public String description();
@@ -76,7 +83,7 @@
* <p>
* Included to make SerialFieldTag items java.lang.Comparable.
*
- * @param obj the <code>Object</code> to be compared.
+ * @param obj the {@code Object} to be compared.
* @return a negative integer, zero, or a positive integer as this Object
* is less than, equal to, or greater than the given Object.
* @exception ClassCastException the specified Object's type prevents it
--- a/langtools/src/share/classes/com/sun/javadoc/SourcePosition.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/SourcePosition.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -36,17 +36,25 @@
*/
public interface SourcePosition {
/** The source file. Returns null if no file information is
- * available. */
+ * available.
+ *
+ * @return the source file as a File.
+ */
File file();
/** The line in the source file. The first line is numbered 1;
- * 0 means no line number information is available. */
+ * 0 means no line number information is available.
+ *
+ * @return the line number in the source file as an integer.
+ */
int line();
/** The column in the source file. The first column is
* numbered 1; 0 means no column information is available.
* Columns count characters in the input stream; a tab
* advances the column number to the next 8-column tab stop.
+ *
+ * @return the column on the source line as an integer.
*/
int column();
--- a/langtools/src/share/classes/com/sun/javadoc/Tag.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/Tag.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -33,7 +33,7 @@
* Given a tag (e.g. "@since 1.2"), holds tag name (e.g. "@since")
* and tag text (e.g. "1.2"). Tags with structure or which require
* special processing are handled by subclasses such as ParamTag
- * (for @param), SeeTag (for @see and {@link}), and ThrowsTag
+ * (for @param), SeeTag (for @see and {@link}), and ThrowsTag
* (for @throws).
*
* @author Robert Field
@@ -50,10 +50,10 @@
/**
* Return the name of this tag. The name is the string
* starting with "@" that is used in a doc comment, such as
- * <code>@return</code>. For inline tags, such as
- * <code>{@link}</code>, the curly brackets
+ * {@code @return}. For inline tags, such as
+ * {@code {@link}}, the curly brackets
* are not part of the name, so in this example the name
- * would be simply <code>@link</code>.
+ * would be simply {@code @link}.
*
* @return the name of this tag
*/
@@ -69,7 +69,7 @@
/**
* Return the kind of this tag.
* For most tags,
- * <code>kind() == name()</code>;
+ * {@code kind() == name()};
* the following table lists those cases where there is more
* than one tag of a given kind:
*
@@ -101,27 +101,27 @@
String toString();
/**
- * For a documentation comment with embedded <code>{@link}</code>
- * tags, return an array of <code>Tag</code> objects. The entire
+ * For a documentation comment with embedded {@code {@link}}
+ * tags, return an array of {@code Tag} objects. The entire
* doc comment is broken down into strings separated by
- * <code>{@link}</code> tags, where each successive element
+ * {@code {@link}} tags, where each successive element
* of the array represents either a string or
- * <code>{@link}</code> tag, in order, from start to end.
- * Each string is represented by a <code>Tag</code> object of
+ * {@code {@link}} tag, in order, from start to end.
+ * Each string is represented by a {@code Tag} object of
* name "Text", where {@link #text()} returns the string. Each
- * <code>{@link}</code> tag is represented by a
+ * {@code {@link}} tag is represented by a
* {@link SeeTag} of name "@link" and kind "@see".
* For example, given the following comment
* tag:
* <p>
- * <code>This is a {@link Doc commentlabel} example.</code>
+ * {@code This is a {@link Doc commentlabel} example.}
* <p>
* return an array of Tag objects:
* <ul>
* <li> tags[0] is a {@link Tag} with name "Text" and text consisting
* of "This is a "
* <li> tags[1] is a {@link SeeTag} with name "@link", referenced
- * class <code>Doc</code> and label "commentlabel"
+ * class {@code Doc} and label "commentlabel"
* <li> tags[2] is a {@link Tag} with name "Text" and text consisting
* of " example."
* </ul>
--- a/langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -39,7 +39,7 @@
/**
* Return the name of the exception
- * associated with this <code>ThrowsTag</code>.
+ * associated with this {@code ThrowsTag}.
*
* @return name of the exception.
*/
@@ -47,30 +47,30 @@
/**
* Return the exception comment
- * associated with this <code>ThrowsTag</code>.
+ * associated with this {@code ThrowsTag}.
*
* @return exception comment.
*/
String exceptionComment();
/**
- * Return a <code>ClassDoc</code> that represents the exception.
+ * Return a {@code ClassDoc} that represents the exception.
* If the type of the exception is a type variable, return the
- * <code>ClassDoc</code> of its erasure.
+ * {@code ClassDoc} of its erasure.
*
* <p> <i>This method cannot accommodate certain generic type
- * constructs. The <code>exceptionType</code> method
+ * constructs. The {@code exceptionType} method
* should be used instead.</i>
*
- * @return <code>ClassDoc</code> that represents the exception.
+ * @return {@code ClassDoc} that represents the exception.
* @see #exceptionType
*/
ClassDoc exception();
/**
* Return the type of the exception
- * associated with this <code>ThrowsTag</code>.
- * This may be a <code>ClassDoc</code> or a <code>TypeVariable</code>.
+ * associated with this {@code ThrowsTag}.
+ * This may be a {@code ClassDoc} or a {@code TypeVariable}.
*
* @return the type of the exception.
* @since 1.5
--- a/langtools/src/share/classes/com/sun/javadoc/Type.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/Type.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -28,8 +28,8 @@
/**
* Represents a type. A type can be a class or interface, an
* invocation (like {@code List<String>}) of a generic class or interface,
- * a type variable, a wildcard type ("<code>?</code>"),
- * or a primitive data type (like <code>char</code>).
+ * a type variable, a wildcard type ("{@code ?}"),
+ * or a primitive data type (like {@code char}).
*
* @since 1.2
* @author Kaiyang Liu (original)
@@ -42,7 +42,8 @@
* Return unqualified name of type excluding any dimension information.
* <p>
* For example, a two dimensional array of String returns
- * "<code>String</code>".
+ * "{@code String}".
+ * @return unqualified name of type excluding any dimension information.
*/
String typeName();
@@ -50,7 +51,8 @@
* Return qualified name of type excluding any dimension information.
*<p>
* For example, a two dimensional array of String
- * returns "<code>java.lang.String</code>".
+ * returns "{@code java.lang.String}".
+ * @return qualified name of this type excluding any dimension information.
*/
String qualifiedTypeName();
@@ -60,9 +62,10 @@
* only the identifier of the innermost type is included.
* <p>
* For example, the class {@code Outer.Inner} returns
- * "<code>Inner</code>".
+ * "{@code Inner}".
*
* @since 1.5
+ * @return the simple name of this type excluding any dimension information.
*/
String simpleTypeName();
@@ -70,7 +73,8 @@
* Return the type's dimension information, as a string.
* <p>
* For example, a two dimensional array of String returns
- * "<code>[][]</code>".
+ * "{@code [][]}".
+ * @return the type's dimension information as a string.
*/
String dimension();
@@ -79,7 +83,7 @@
* This includes any dimension information and type arguments.
* <p>
* For example, a two dimensional array of String may return
- * "<code>java.lang.String[][]</code>",
+ * "{@code java.lang.String[][]}",
* and the parameterized type {@code List<Integer>} may return
* "{@code java.util.List<java.lang.Integer>}".
*
@@ -96,66 +100,66 @@
boolean isPrimitive();
/**
- * Return this type as a <code>ClassDoc</code> if it represents a class
+ * Return this type as a {@code ClassDoc} if it represents a class
* or interface. Array dimensions are ignored.
- * If this type is a <code>ParameterizedType</code>,
- * <code>TypeVariable</code>, or <code>WildcardType</code>, return
- * the <code>ClassDoc</code> of the type's erasure. If this is an
- * <code>AnnotationTypeDoc</code>, return this as a <code>ClassDoc</code>
+ * If this type is a {@code ParameterizedType},
+ * {@code TypeVariable}, or {@code WildcardType}, return
+ * the {@code ClassDoc} of the type's erasure. If this is an
+ * {@code AnnotationTypeDoc}, return this as a {@code ClassDoc}
* (but see {@link #asAnnotationTypeDoc()}).
* If this is a primitive type, return null.
*
- * @return the <code>ClassDoc</code> of this type,
+ * @return the {@code ClassDoc} of this type,
* or null if it is a primitive type.
*/
ClassDoc asClassDoc();
/**
- * Return this type as a <code>ParameterizedType</code> if it represents
+ * Return this type as a {@code ParameterizedType} if it represents
* an invocation of a generic class or interface. Array dimensions
* are ignored.
*
- * @return a <code>ParameterizedType</code> if the type is an
+ * @return a {@code ParameterizedType} if the type is an
* invocation of a generic type, or null if it is not.
* @since 1.5
*/
ParameterizedType asParameterizedType();
/**
- * Return this type as a <code>TypeVariable</code> if it represents
+ * Return this type as a {@code TypeVariable} if it represents
* a type variable. Array dimensions are ignored.
*
- * @return a <code>TypeVariable</code> if the type is a type variable,
+ * @return a {@code TypeVariable} if the type is a type variable,
* or null if it is not.
* @since 1.5
*/
TypeVariable asTypeVariable();
/**
- * Return this type as a <code>WildcardType</code> if it represents
+ * Return this type as a {@code WildcardType} if it represents
* a wildcard type.
*
- * @return a <code>WildcardType</code> if the type is a wildcard type,
+ * @return a {@code WildcardType} if the type is a wildcard type,
* or null if it is not.
* @since 1.5
*/
WildcardType asWildcardType();
/**
- * Returns this type as a <code>AnnotatedType</code> if it represents
+ * Returns this type as a {@code AnnotatedType} if it represents
* an annotated type.
*
- * @return a <code>AnnotatedType</code> if the type if an annotated type,
+ * @return a {@code AnnotatedType} if the type if an annotated type,
* or null if it is not
* @since 1.8
*/
AnnotatedType asAnnotatedType();
/**
- * Return this type as an <code>AnnotationTypeDoc</code> if it represents
+ * Return this type as an {@code AnnotationTypeDoc} if it represents
* an annotation type. Array dimensions are ignored.
*
- * @return an <code>AnnotationTypeDoc</code> if the type is an annotation
+ * @return an {@code AnnotationTypeDoc} if the type is an annotation
* type, or null if it is not.
* @since 1.5
*/
@@ -165,7 +169,7 @@
* If this type is an array type, return the element type of the
* array. Otherwise, return null.
*
- * @return a <code>Type</code> representing the element type or null.
+ * @return a {@code Type} representing the element type or null.
* @since 1.8
*/
Type getElementType();
--- a/langtools/src/share/classes/com/sun/javadoc/TypeVariable.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/TypeVariable.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,6 +59,9 @@
/**
* Get the annotations of this program element.
* Return an empty array if there are none.
+ *
+ * @return the annotations of this program element or
+ * an empty array if there are none.
*/
public AnnotationDesc[] annotations();
--- a/langtools/src/share/classes/com/sun/javadoc/package-info.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/package-info.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -53,8 +53,8 @@
When calling javadoc, you pass in package names and source file names --
these are called the <em>specified</em> packages and classes.
You also pass in Javadoc options; the <em>access control</em> Javadoc options
-(<code>-public</code>, <code>-protected</code>, <code>-package</code>,
-and <code>-private</code>) filter program elements, producing a
+({@code -public}, {@code -protected}, {@code -package},
+and {@code -private}) filter program elements, producing a
result set, called the <em>included</em> set, or "documented" set.
(The unfiltered set is also available through
{@link com.sun.javadoc.PackageDoc#allClasses(boolean) allClasses(false)}.)
@@ -78,45 +78,45 @@
<a name="qualified"></a>
A <em>qualified</em> class or interface name is one that has its package
-name prepended to it, such as <code>java.lang.String</code>. A non-qualified
-name has no package name, such as <code>String</code>.
+name prepended to it, such as {@code java.lang.String}. A non-qualified
+name has no package name, such as {@code String}.
<p>
<a name="example"></a>
<h3>Example</h3>
The following is an example doclet that
-displays information in the <code>@param</code> tags of the processed
+displays information in the {@code @param} tags of the processed
classes:
<pre>
import com.sun.javadoc.*;
-public class ListParams extends <font style="color:red;">Doclet</font> {
+public class ListParams extends <span style="color:red" >Doclet</span> {
- public static boolean start(<font style="color:red;">RootDoc</font> root) {
- <font style="color:red;">ClassDoc</font>[] classes = root.<font style="color:red;">classes</font>();
+ public static boolean start(<span style="color:red" >RootDoc</span> root) {
+ <span style="color:red" >ClassDoc</span>[] classes = root.<span style="color:red" >classes</span>();
for (int i = 0; i < classes.length; ++i) {
- <font style="color:red;">ClassDoc</font> cd = classes[i];
- printMembers(cd.<font style="color:red;">constructors</font>());
- printMembers(cd.<font style="color:red;">methods</font>());
+ <span style="color:red" >ClassDoc</span> cd = classes[i];
+ printMembers(cd.<span style="color:red" >constructors</span>());
+ printMembers(cd.<span style="color:red" >methods</span>());
}
return true;
}
- static void printMembers(<font style="color:red;">ExecutableMemberDoc</font>[] mems) {
+ static void printMembers(<span style="color:red" >ExecutableMemberDoc</span>[] mems) {
for (int i = 0; i < mems.length; ++i) {
- <font style="color:red;">ParamTag</font>[] params = mems[i].<font style="color:red;">paramTags</font>();
- System.out.println(mems[i].<font style="color:red;">qualifiedName</font>());
+ <span style="color:red" >ParamTag</span>[] params = mems[i].<span style="color:red" >paramTags</span>();
+ System.out.println(mems[i].<span style="color:red" >qualifiedName</span>());
for (int j = 0; j < params.length; ++j) {
- System.out.println(" " + params[j].<font style="color:red;">parameterName</font>()
- + " - " + params[j].<font style="color:red;">parameterComment</font>());
+ System.out.println(" " + params[j].<span style="color:red" >parameterName</span>()
+ + " - " + params[j].<span style="color:red" >parameterComment</span>());
}
}
}
}
</pre>
Interfaces and methods from the Javadoc API are marked in
-<font style="color:red;">red</font>.
+<span style="color:red" >red</span>.
{@link com.sun.javadoc.Doclet Doclet} is an abstract class that specifies
the invocation interface for doclets,
{@link com.sun.javadoc.Doclet Doclet} holds class or interface information,
@@ -124,7 +124,7 @@
superinterface of {@link com.sun.javadoc.MethodDoc} and
{@link com.sun.javadoc.ConstructorDoc},
and {@link com.sun.javadoc.ParamTag} holds information
-from "<code>@param</code>" tags.
+from "{@code @param}" tags.
<p>
This doclet when invoked with a command line like:
<pre>
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Mar 06 10:41:56 2014 -0800
@@ -25,8 +25,12 @@
package com.sun.tools.javac.comp;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
+import javax.tools.JavaFileObject;
+
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.code.*;
@@ -34,6 +38,7 @@
import com.sun.tools.javac.tree.*;
import com.sun.tools.javac.tree.JCTree.*;
+import static com.sun.tools.javac.code.Kinds.*;
import static com.sun.tools.javac.code.TypeTag.ARRAY;
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -57,15 +62,21 @@
return instance;
}
- final Attr attr;
- final TreeMaker make;
- final Log log;
- final Symtab syms;
- final Names names;
- final Resolve rs;
- final Types types;
- final ConstFold cfolder;
- final Check chk;
+ private final Attr attr;
+ private final TreeMaker make;
+ private final Log log;
+ private final Symtab syms;
+ private final Names names;
+ private final Resolve rs;
+ private final Types types;
+ private final ConstFold cfolder;
+ private final Check chk;
+ private final Lint lint;
+ private final DeferredLintHandler deferredLintHandler;
+ private final Source source;
+
+ private boolean allowTypeAnnos;
+ private boolean allowRepeatedAnnos;
protected Annotate(Context context) {
context.put(annotateKey, this);
@@ -78,6 +89,11 @@
types = Types.instance(context);
cfolder = ConstFold.instance(context);
chk = Check.instance(context);
+ source = Source.instance(context);
+ lint = Lint.instance(context);
+ deferredLintHandler = DeferredLintHandler.instance(context);
+ allowRepeatedAnnos = source.allowRepeatedAnnotations();
+ allowTypeAnnos = source.allowTypeAnnotations();
}
/* ********************************************************************
@@ -669,4 +685,258 @@
return fatalError ? null : containerValueSymbol;
}
+
+/* ********************************************************************
+ * Annotation processing
+ *********************************************************************/
+
+ /** Queue annotations for later processing. */
+ void annotateLater(final List<JCAnnotation> annotations,
+ final Env<AttrContext> localEnv,
+ final Symbol s,
+ final DiagnosticPosition deferPos) {
+ if (annotations.isEmpty()) {
+ return;
+ }
+ if (s.kind != PCK) {
+ s.resetAnnotations(); // mark Annotations as incomplete for now
+ }
+ normal(new Annotate.Worker() {
+ @Override
+ public String toString() {
+ return "annotate " + annotations + " onto " + s + " in " + s.owner;
+ }
+
+ @Override
+ public void run() {
+ Assert.check(s.kind == PCK || s.annotationsPendingCompletion());
+ JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
+ DiagnosticPosition prevLintPos =
+ deferPos != null
+ ? deferredLintHandler.setPos(deferPos)
+ : deferredLintHandler.immediate();
+ Lint prevLint = deferPos != null ? null : chk.setLint(lint);
+ try {
+ if (s.hasAnnotations() &&
+ annotations.nonEmpty())
+ log.error(annotations.head.pos,
+ "already.annotated",
+ kindName(s), s);
+ actualEnterAnnotations(annotations, localEnv, s);
+ } finally {
+ if (prevLint != null)
+ chk.setLint(prevLint);
+ deferredLintHandler.setPos(prevLintPos);
+ log.useSource(prev);
+ }
+ }
+ });
+
+ validate(new Annotate.Worker() { //validate annotations
+ @Override
+ public void run() {
+ JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
+ try {
+ chk.validateAnnotations(annotations, s);
+ } finally {
+ log.useSource(prev);
+ }
+ }
+ });
+ }
+
+ /** Enter a set of annotations. */
+ private void actualEnterAnnotations(List<JCAnnotation> annotations,
+ Env<AttrContext> env,
+ Symbol s) {
+ Map<TypeSymbol, ListBuffer<Attribute.Compound>> annotated = new LinkedHashMap<>();
+ Map<Attribute.Compound, DiagnosticPosition> pos = new HashMap<>();
+
+ for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
+ JCAnnotation a = al.head;
+ Attribute.Compound c = enterAnnotation(a, syms.annotationType, env);
+ if (c == null) {
+ continue;
+ }
+
+ if (annotated.containsKey(a.type.tsym)) {
+ if (!allowRepeatedAnnos) {
+ log.error(a.pos(), "repeatable.annotations.not.supported.in.source");
+ allowRepeatedAnnos = true;
+ }
+ ListBuffer<Attribute.Compound> l = annotated.get(a.type.tsym);
+ l = l.append(c);
+ annotated.put(a.type.tsym, l);
+ pos.put(c, a.pos());
+ } else {
+ annotated.put(a.type.tsym, ListBuffer.of(c));
+ pos.put(c, a.pos());
+ }
+
+ // Note: @Deprecated has no effect on local variables and parameters
+ if (!c.type.isErroneous()
+ && s.owner.kind != MTH
+ && types.isSameType(c.type, syms.deprecatedType)) {
+ s.flags_field |= Flags.DEPRECATED;
+ }
+ }
+
+ s.setDeclarationAttributesWithCompletion(
+ new AnnotateRepeatedContext<>(env, annotated, pos, log, false));
+ }
+
+ /*
+ * If the symbol is non-null, attach the type annotation to it.
+ */
+ private void actualEnterTypeAnnotations(final List<JCAnnotation> annotations,
+ final Env<AttrContext> env,
+ final Symbol s,
+ final DiagnosticPosition deferPos) {
+ Map<TypeSymbol, ListBuffer<Attribute.TypeCompound>> annotated = new LinkedHashMap<>();
+ Map<Attribute.TypeCompound, DiagnosticPosition> pos = new HashMap<>();
+
+ JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
+ DiagnosticPosition prevLintPos = null;
+
+ if (deferPos != null) {
+ prevLintPos = deferredLintHandler.setPos(deferPos);
+ }
+ try {
+
+ for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
+ JCAnnotation a = al.head;
+ Attribute.TypeCompound tc =
+ enterTypeAnnotation(a, syms.annotationType, env);
+
+ if (tc == null) {
+ continue;
+ }
+
+ if (annotated.containsKey(a.type.tsym)) {
+ if (!allowRepeatedAnnos) {
+ log.error(a.pos(), "repeatable.annotations.not.supported.in.source");
+ allowRepeatedAnnos = true;
+ }
+ ListBuffer<Attribute.TypeCompound> l = annotated.get(a.type.tsym);
+ l = l.append(tc);
+ annotated.put(a.type.tsym, l);
+ pos.put(tc, a.pos());
+ } else {
+ annotated.put(a.type.tsym, ListBuffer.of(tc));
+ pos.put(tc, a.pos());
+ }
+ }
+
+ if (s != null) {
+ s.appendTypeAttributesWithCompletion(
+ new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
+ }
+ } finally {
+ if (prevLintPos != null)
+ deferredLintHandler.setPos(prevLintPos);
+ log.useSource(prev);
+ }
+ }
+
+ public void annotateTypeLater(final JCTree tree,
+ final Env<AttrContext> env,
+ final Symbol sym,
+ final DiagnosticPosition deferPos) {
+ Assert.checkNonNull(sym);
+ normal(new Annotate.Worker() {
+ @Override
+ public String toString() {
+ return "type annotate " + tree + " onto " + sym + " in " + sym.owner;
+ }
+ @Override
+ public void run() {
+ tree.accept(new TypeAnnotate(env, sym, deferPos));
+ }
+ });
+ }
+
+ /**
+ * We need to use a TreeScanner, because it is not enough to visit the top-level
+ * annotations. We also need to visit type arguments, etc.
+ */
+ private class TypeAnnotate extends TreeScanner {
+ private final Env<AttrContext> env;
+ private final Symbol sym;
+ private DiagnosticPosition deferPos;
+
+ public TypeAnnotate(final Env<AttrContext> env,
+ final Symbol sym,
+ final DiagnosticPosition deferPos) {
+
+ this.env = env;
+ this.sym = sym;
+ this.deferPos = deferPos;
+ }
+
+ @Override
+ public void visitAnnotatedType(final JCAnnotatedType tree) {
+ actualEnterTypeAnnotations(tree.annotations, env, sym, deferPos);
+ super.visitAnnotatedType(tree);
+ }
+
+ @Override
+ public void visitTypeParameter(final JCTypeParameter tree) {
+ actualEnterTypeAnnotations(tree.annotations, env, sym, deferPos);
+ super.visitTypeParameter(tree);
+ }
+
+ @Override
+ public void visitNewArray(final JCNewArray tree) {
+ actualEnterTypeAnnotations(tree.annotations, env, sym, deferPos);
+ for (List<JCAnnotation> dimAnnos : tree.dimAnnotations)
+ actualEnterTypeAnnotations(dimAnnos, env, sym, deferPos);
+ super.visitNewArray(tree);
+ }
+
+ @Override
+ public void visitMethodDef(final JCMethodDecl tree) {
+ scan(tree.mods);
+ scan(tree.restype);
+ scan(tree.typarams);
+ scan(tree.recvparam);
+ scan(tree.params);
+ scan(tree.thrown);
+ scan(tree.defaultValue);
+ // Do not annotate the body, just the signature.
+ // scan(tree.body);
+ }
+
+ @Override
+ public void visitVarDef(final JCVariableDecl tree) {
+ DiagnosticPosition prevPos = deferPos;
+ deferPos = tree.pos();
+ try {
+ if (sym != null && sym.kind == Kinds.VAR) {
+ // Don't visit a parameter once when the sym is the method
+ // and once when the sym is the parameter.
+ scan(tree.mods);
+ scan(tree.vartype);
+ }
+ scan(tree.init);
+ } finally {
+ deferPos = prevPos;
+ }
+ }
+
+ @Override
+ public void visitClassDef(JCClassDecl tree) {
+ // We can only hit a classdef if it is declared within
+ // a method. Ignore it - the class will be visited
+ // separately later.
+ }
+
+ @Override
+ public void visitNewClass(JCNewClass tree) {
+ if (tree.def == null) {
+ // For an anonymous class instantiation the class
+ // will be visited separately.
+ super.visitNewClass(tree);
+ }
+ }
+ }
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Mar 06 10:41:56 2014 -0800
@@ -248,7 +248,7 @@
if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
if (allowPoly && inferenceContext.free(found)) {
if ((ownkind & ~resultInfo.pkind) == 0) {
- owntype = resultInfo.check(tree, inferenceContext.asFree(owntype));
+ owntype = resultInfo.check(tree, inferenceContext.asUndetVar(owntype));
} else {
log.error(tree.pos(), "unexpected.type",
kindNames(resultInfo.pkind),
@@ -769,13 +769,6 @@
= deferredLintHandler.setPos(variable.pos());
try {
- // Use null as symbol to not attach the type annotation to any symbol.
- // The initializer will later also be visited and then we'll attach
- // to the symbol.
- // This prevents having multiple type annotations, just because of
- // lazy constant value evaluation.
- memberEnter.typeAnnotate(variable.init, env, null, variable.pos());
- annotate.flush();
Type itype = attribExpr(variable.init, env, type);
if (itype.constValue() != null) {
return coerce(itype, type).constValue();
@@ -1021,7 +1014,7 @@
}
// Attribute all type annotations in the body
- memberEnter.typeAnnotate(tree.body, localEnv, m, null);
+ annotate.annotateTypeLater(tree.body, localEnv, m, null);
annotate.flush();
// Attribute method body.
@@ -1050,7 +1043,7 @@
} else {
if (tree.init != null) {
// Field initializer expression need to be entered.
- memberEnter.typeAnnotate(tree.init, env, tree.sym, tree.pos());
+ annotate.annotateTypeLater(tree.init, env, tree.sym, tree.pos());
annotate.flush();
}
}
@@ -1111,7 +1104,7 @@
if ((tree.flags & STATIC) != 0) localEnv.info.staticLevel++;
// Attribute all type annotations in the block
- memberEnter.typeAnnotate(tree, localEnv, localEnv.info.scope.owner, null);
+ annotate.annotateTypeLater(tree, localEnv, localEnv.info.scope.owner, null);
annotate.flush();
{
@@ -2406,7 +2399,7 @@
//add thrown types as bounds to the thrown types free variables if needed:
if (resultInfo.checkContext.inferenceContext().free(lambdaType.getThrownTypes())) {
List<Type> inferredThrownTypes = flow.analyzeLambdaThrownTypes(env, that, make);
- List<Type> thrownTypes = resultInfo.checkContext.inferenceContext().asFree(lambdaType.getThrownTypes());
+ List<Type> thrownTypes = resultInfo.checkContext.inferenceContext().asUndetVars(lambdaType.getThrownTypes());
chk.unhandled(inferredThrownTypes, thrownTypes);
}
@@ -2547,7 +2540,7 @@
@Override
public boolean compatible(Type found, Type req, Warner warn) {
//return type must be compatible in both current context and assignment context
- return chk.basicHandler.compatible(found, inferenceContext().asFree(req), warn);
+ return chk.basicHandler.compatible(found, inferenceContext().asUndetVar(req), warn);
}
@Override
@@ -2580,7 +2573,7 @@
* types must be compatible with the return type of the expected descriptor.
*/
private void checkLambdaCompatible(JCLambda tree, Type descriptor, CheckContext checkContext) {
- Type returnType = checkContext.inferenceContext().asFree(descriptor.getReturnType());
+ Type returnType = checkContext.inferenceContext().asUndetVar(descriptor.getReturnType());
//return values have already been checked - but if lambda has no return
//values, we must ensure that void/value compatibility is correct;
@@ -2592,7 +2585,7 @@
diags.fragment("missing.ret.val", returnType)));
}
- List<Type> argTypes = checkContext.inferenceContext().asFree(descriptor.getParameterTypes());
+ List<Type> argTypes = checkContext.inferenceContext().asUndetVars(descriptor.getParameterTypes());
if (!types.isSameTypes(argTypes, TreeInfo.types(tree.params))) {
checkContext.report(tree, diags.fragment("incompatible.arg.types.in.lambda"));
}
@@ -2836,7 +2829,7 @@
if (that.kind.isUnbound() &&
resultInfo.checkContext.inferenceContext().free(argtypes.head)) {
//re-generate inference constraints for unbound receiver
- if (!types.isSubtype(resultInfo.checkContext.inferenceContext().asFree(argtypes.head), exprType)) {
+ if (!types.isSubtype(resultInfo.checkContext.inferenceContext().asUndetVar(argtypes.head), exprType)) {
//cannot happen as this has already been checked - we just need
//to regenerate the inference constraints, as that has been lost
//as a result of the call to inferenceContext.save()
@@ -2874,7 +2867,7 @@
@SuppressWarnings("fallthrough")
void checkReferenceCompatible(JCMemberReference tree, Type descriptor, Type refType, CheckContext checkContext, boolean speculativeAttr) {
- Type returnType = checkContext.inferenceContext().asFree(descriptor.getReturnType());
+ Type returnType = checkContext.inferenceContext().asUndetVar(descriptor.getReturnType());
Type resType;
switch (tree.getMode()) {
@@ -2906,7 +2899,7 @@
}
if (!speculativeAttr) {
- List<Type> thrownTypes = checkContext.inferenceContext().asFree(descriptor.getThrownTypes());
+ List<Type> thrownTypes = checkContext.inferenceContext().asUndetVars(descriptor.getThrownTypes());
if (chk.unhandled(refType.getThrownTypes(), thrownTypes).nonEmpty()) {
log.error(tree, "incompatible.thrown.types.in.mref", refType.getThrownTypes());
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Thu Mar 06 10:41:56 2014 -0800
@@ -219,9 +219,10 @@
*/
Type generateReturnConstraints(Attr.ResultInfo resultInfo,
MethodType mt, InferenceContext inferenceContext) {
+ InferenceContext rsInfoInfContext = resultInfo.checkContext.inferenceContext();
Type from = mt.getReturnType();
if (mt.getReturnType().containsAny(inferenceContext.inferencevars) &&
- resultInfo.checkContext.inferenceContext() != emptyContext) {
+ rsInfoInfContext != emptyContext) {
from = types.capture(from);
//add synthetic captured ivars
for (Type t : from.getTypeArguments()) {
@@ -230,13 +231,13 @@
}
}
}
- Type qtype1 = inferenceContext.asFree(from);
+ Type qtype1 = inferenceContext.asUndetVar(from);
Type to = returnConstraintTarget(qtype1, resultInfo.pt);
- Assert.check(allowGraphInference || !resultInfo.checkContext.inferenceContext().free(to),
+ Assert.check(allowGraphInference || !rsInfoInfContext.free(to),
"legacy inference engine cannot handle constraints on both sides of a subtyping assertion");
//we need to skip capture?
Warner retWarn = new Warner();
- if (!resultInfo.checkContext.compatible(qtype1, resultInfo.checkContext.inferenceContext().asFree(to), retWarn) ||
+ if (!resultInfo.checkContext.compatible(qtype1, rsInfoInfContext.asUndetVar(to), retWarn) ||
//unchecked conversion is not allowed in source 7 mode
(!allowGraphInference && retWarn.hasLint(Lint.LintCategory.UNCHECKED))) {
throw inferenceException
@@ -279,7 +280,7 @@
ListBuffer<Type> todo = new ListBuffer<>();
//step 1 - create fresh tvars
for (Type t : vars) {
- UndetVar uv = (UndetVar)inferenceContext.asFree(t);
+ UndetVar uv = (UndetVar)inferenceContext.asUndetVar(t);
List<Type> upperBounds = uv.getBounds(InferenceBound.UPPER);
if (Type.containsAny(upperBounds, vars)) {
TypeSymbol fresh_tvar = new TypeVariableSymbol(Flags.SYNTHETIC, uv.qtype.tsym.name, null, uv.qtype.tsym.owner);
@@ -398,7 +399,7 @@
return types.createErrorType(funcInterface);
}
for (Type p : descParameterTypes) {
- if (!types.isSameType(funcInterfaceContext.asFree(p), paramTypes.head)) {
+ if (!types.isSameType(funcInterfaceContext.asUndetVar(p), paramTypes.head)) {
checkContext.report(pos, diags.fragment("no.suitable.functional.intf.inst", funcInterface));
return types.createErrorType(funcInterface);
}
@@ -532,22 +533,23 @@
if (uv.inst != null) {
Type inst = uv.inst;
for (Type u : uv.getBounds(InferenceBound.UPPER)) {
- if (!isSubtype(inst, inferenceContext.asFree(u), warn, infer)) {
+ if (!isSubtype(inst, inferenceContext.asUndetVar(u), warn, infer)) {
infer.reportBoundError(uv, BoundErrorKind.UPPER);
}
}
for (Type l : uv.getBounds(InferenceBound.LOWER)) {
- if (!isSubtype(inferenceContext.asFree(l), inst, warn, infer)) {
+ if (!isSubtype(inferenceContext.asUndetVar(l), inst, warn, infer)) {
infer.reportBoundError(uv, BoundErrorKind.LOWER);
}
}
for (Type e : uv.getBounds(InferenceBound.EQ)) {
- if (!isSameType(inst, inferenceContext.asFree(e), infer)) {
+ if (!isSameType(inst, inferenceContext.asUndetVar(e), infer)) {
infer.reportBoundError(uv, BoundErrorKind.EQ);
}
}
}
}
+
@Override
boolean accepts(UndetVar uv, InferenceContext inferenceContext) {
//applies to all undetvars
@@ -599,12 +601,12 @@
for (Type e : uv.getBounds(InferenceBound.EQ)) {
if (e.containsAny(inferenceContext.inferenceVars())) continue;
for (Type u : uv.getBounds(InferenceBound.UPPER)) {
- if (!isSubtype(e, inferenceContext.asFree(u), warn, infer)) {
+ if (!isSubtype(e, inferenceContext.asUndetVar(u), warn, infer)) {
infer.reportBoundError(uv, BoundErrorKind.BAD_EQ_UPPER);
}
}
for (Type l : uv.getBounds(InferenceBound.LOWER)) {
- if (!isSubtype(inferenceContext.asFree(l), e, warn, infer)) {
+ if (!isSubtype(inferenceContext.asUndetVar(l), e, warn, infer)) {
infer.reportBoundError(uv, BoundErrorKind.BAD_EQ_LOWER);
}
}
@@ -625,7 +627,7 @@
Infer infer = inferenceContext.infer();
for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
- isSubtype(inferenceContext.asFree(b2), inferenceContext.asFree(b1), warn , infer);
+ isSubtype(inferenceContext.asUndetVar(b2), inferenceContext.asUndetVar(b1), warn , infer);
}
}
}
@@ -646,7 +648,7 @@
Infer infer = inferenceContext.infer();
for (Type b1 : uv.getBounds(InferenceBound.UPPER)) {
for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
- isSubtype(inferenceContext.asFree(b2), inferenceContext.asFree(b1), warn, infer);
+ isSubtype(inferenceContext.asUndetVar(b2), inferenceContext.asUndetVar(b1), warn, infer);
}
}
}
@@ -667,7 +669,7 @@
Infer infer = inferenceContext.infer();
for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
for (Type b2 : uv.getBounds(InferenceBound.LOWER)) {
- isSubtype(inferenceContext.asFree(b2), inferenceContext.asFree(b1), warn, infer);
+ isSubtype(inferenceContext.asUndetVar(b2), inferenceContext.asUndetVar(b1), warn, infer);
}
}
}
@@ -689,7 +691,7 @@
for (Type b1 : uv.getBounds(InferenceBound.EQ)) {
for (Type b2 : uv.getBounds(InferenceBound.EQ)) {
if (b1 != b2) {
- isSameType(inferenceContext.asFree(b2), inferenceContext.asFree(b1), infer);
+ isSameType(inferenceContext.asUndetVar(b2), inferenceContext.asUndetVar(b1), infer);
}
}
}
@@ -710,7 +712,7 @@
Infer infer = inferenceContext.infer();
for (Type b : uv.getBounds(InferenceBound.UPPER)) {
if (inferenceContext.inferenceVars().contains(b)) {
- UndetVar uv2 = (UndetVar)inferenceContext.asFree(b);
+ UndetVar uv2 = (UndetVar)inferenceContext.asUndetVar(b);
if (uv2.isCaptured()) continue;
//alpha <: beta
//0. set beta :> alpha
@@ -742,7 +744,7 @@
Infer infer = inferenceContext.infer();
for (Type b : uv.getBounds(InferenceBound.LOWER)) {
if (inferenceContext.inferenceVars().contains(b)) {
- UndetVar uv2 = (UndetVar)inferenceContext.asFree(b);
+ UndetVar uv2 = (UndetVar)inferenceContext.asUndetVar(b);
if (uv2.isCaptured()) continue;
//alpha :> beta
//0. set beta <: alpha
@@ -774,7 +776,7 @@
Infer infer = inferenceContext.infer();
for (Type b : uv.getBounds(InferenceBound.EQ)) {
if (inferenceContext.inferenceVars().contains(b)) {
- UndetVar uv2 = (UndetVar)inferenceContext.asFree(b);
+ UndetVar uv2 = (UndetVar)inferenceContext.asUndetVar(b);
if (uv2.isCaptured()) continue;
//alpha == beta
//0. set beta == alpha
@@ -1526,7 +1528,7 @@
StringBuilder buf = new StringBuilder();
String sep = "";
for (Type from : data) {
- UndetVar uv = (UndetVar)inferenceContext.asFree(from);
+ UndetVar uv = (UndetVar)inferenceContext.asUndetVar(from);
for (Type bound : uv.getBounds(InferenceBound.values())) {
if (bound.containsAny(List.from(to.data))) {
buf.append(sep);
@@ -1735,7 +1737,7 @@
Set<Type> optDepsByNode = stuckDeps.get(i);
for (Node n_j : nodes) {
Type j = n_j.data.first();
- UndetVar uv_i = (UndetVar)inferenceContext.asFree(i);
+ UndetVar uv_i = (UndetVar)inferenceContext.asUndetVar(i);
if (Type.containsAny(uv_i.getBounds(InferenceBound.values()), List.of(j))) {
//update i's bound dependencies
n_i.addDependency(DependencyKind.BOUND, n_j);
@@ -1883,6 +1885,8 @@
});
}
+ /* Returns the corresponding inference variables.
+ */
private List<Type> filterVars(Filter<UndetVar> fu) {
ListBuffer<Type> res = new ListBuffer<>();
for (Type t : undetvars) {
@@ -1940,14 +1944,14 @@
* undet vars (used ahead of subtyping/compatibility checks to allow propagation
* of inference constraints).
*/
- final Type asFree(Type t) {
+ final Type asUndetVar(Type t) {
return types.subst(t, inferencevars, undetvars);
}
- final List<Type> asFree(List<Type> ts) {
+ final List<Type> asUndetVars(List<Type> ts) {
ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : ts) {
- buf.append(asFree(t));
+ buf.append(asUndetVar(t));
}
return buf.toList();
}
@@ -2123,7 +2127,7 @@
private boolean solveBasic(List<Type> varsToSolve, EnumSet<InferenceStep> steps) {
boolean changed = false;
for (Type t : varsToSolve.intersect(restvars())) {
- UndetVar uv = (UndetVar)asFree(t);
+ UndetVar uv = (UndetVar)asUndetVar(t);
for (InferenceStep step : steps) {
if (step.accepts(uv, this)) {
uv.inst = step.solve(uv, this);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Mar 06 10:41:56 2014 -0800
@@ -113,15 +113,12 @@
deferredLintHandler = DeferredLintHandler.instance(context);
lint = Lint.instance(context);
allowTypeAnnos = source.allowTypeAnnotations();
- allowRepeatedAnnos = source.allowRepeatedAnnotations();
}
/** Switch: support type annotations.
*/
boolean allowTypeAnnos;
- boolean allowRepeatedAnnos;
-
/** A queue for classes whose members still need to be entered into the
* symbol table.
*/
@@ -512,7 +509,7 @@
}
// process package annotations
- annotateLater(tree.packageAnnotations, env, tree.packge, null);
+ annotate.annotateLater(tree.packageAnnotations, env, tree.packge, null);
DiagnosticPosition prevLintPos = deferredLintHandler.immediate();
Lint prevLint = chk.setLint(lint);
@@ -607,10 +604,10 @@
enclScope.enter(m);
}
- annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
+ annotate.annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
// Visit the signature of the method. Note that
// TypeAnnotate doesn't descend into the body.
- typeAnnotate(tree, localEnv, m, tree.pos());
+ annotate.annotateTypeLater(tree, localEnv, m, tree.pos());
if (tree.defaultValue != null)
annotateDefaultValueLater(tree.defaultValue, localEnv, m);
@@ -700,8 +697,8 @@
chk.checkTransparentVar(tree.pos(), v, enclScope);
enclScope.enter(v);
}
- annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
- typeAnnotate(tree.vartype, env, v, tree.pos());
+ annotate.annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
+ annotate.annotateTypeLater(tree.vartype, env, v, tree.pos());
v.pos = tree.pos;
} finally {
annotate.enterDone();
@@ -838,65 +835,6 @@
}
}
-/* ********************************************************************
- * Annotation processing
- *********************************************************************/
-
- /** Queue annotations for later processing. */
- void annotateLater(final List<JCAnnotation> annotations,
- final Env<AttrContext> localEnv,
- final Symbol s,
- final DiagnosticPosition deferPos) {
- if (annotations.isEmpty()) {
- return;
- }
- if (s.kind != PCK) {
- s.resetAnnotations(); // mark Annotations as incomplete for now
- }
- annotate.normal(new Annotate.Worker() {
- @Override
- public String toString() {
- return "annotate " + annotations + " onto " + s + " in " + s.owner;
- }
-
- @Override
- public void run() {
- Assert.check(s.kind == PCK || s.annotationsPendingCompletion());
- JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
- DiagnosticPosition prevLintPos =
- deferPos != null
- ? deferredLintHandler.setPos(deferPos)
- : deferredLintHandler.immediate();
- Lint prevLint = deferPos != null ? null : chk.setLint(lint);
- try {
- if (s.hasAnnotations() &&
- annotations.nonEmpty())
- log.error(annotations.head.pos,
- "already.annotated",
- kindName(s), s);
- actualEnterAnnotations(annotations, localEnv, s);
- } finally {
- if (prevLint != null)
- chk.setLint(prevLint);
- deferredLintHandler.setPos(prevLintPos);
- log.useSource(prev);
- }
- }
- });
-
- annotate.validate(new Annotate.Worker() { //validate annotations
- @Override
- public void run() {
- JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
- try {
- chk.validateAnnotations(annotations, s);
- } finally {
- log.useSource(prev);
- }
- }
- });
- }
-
/**
* Check if a list of annotations contains a reference to
* java.lang.Deprecated.
@@ -910,48 +848,6 @@
return false;
}
- /** Enter a set of annotations. */
- private void actualEnterAnnotations(List<JCAnnotation> annotations,
- Env<AttrContext> env,
- Symbol s) {
- Map<TypeSymbol, ListBuffer<Attribute.Compound>> annotated = new LinkedHashMap<>();
- Map<Attribute.Compound, DiagnosticPosition> pos = new HashMap<>();
-
- for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
- JCAnnotation a = al.head;
- Attribute.Compound c = annotate.enterAnnotation(a,
- syms.annotationType,
- env);
- if (c == null) {
- continue;
- }
-
- if (annotated.containsKey(a.type.tsym)) {
- if (!allowRepeatedAnnos) {
- log.error(a.pos(), "repeatable.annotations.not.supported.in.source");
- allowRepeatedAnnos = true;
- }
- ListBuffer<Attribute.Compound> l = annotated.get(a.type.tsym);
- l = l.append(c);
- annotated.put(a.type.tsym, l);
- pos.put(c, a.pos());
- } else {
- annotated.put(a.type.tsym, ListBuffer.of(c));
- pos.put(c, a.pos());
- }
-
- // Note: @Deprecated has no effect on local variables and parameters
- if (!c.type.isErroneous()
- && s.owner.kind != MTH
- && types.isSameType(c.type, syms.deprecatedType)) {
- s.flags_field |= Flags.DEPRECATED;
- }
- }
-
- s.setDeclarationAttributesWithCompletion(
- annotate.new AnnotateRepeatedContext<>(env, annotated, pos, log, false));
- }
-
/** Queue processing of an attribute default value. */
void annotateDefaultValueLater(final JCExpression defaultValue,
final Env<AttrContext> localEnv,
@@ -1043,9 +939,9 @@
Env<AttrContext> baseEnv = baseEnv(tree, env);
if (tree.extending != null)
- typeAnnotate(tree.extending, baseEnv, sym, tree.pos());
+ annotate.annotateTypeLater(tree.extending, baseEnv, sym, tree.pos());
for (JCExpression impl : tree.implementing)
- typeAnnotate(impl, baseEnv, sym, tree.pos());
+ annotate.annotateTypeLater(impl, baseEnv, sym, tree.pos());
annotate.flush();
// Determine supertype.
@@ -1106,7 +1002,7 @@
attr.attribAnnotationTypes(tree.mods.annotations, baseEnv);
if (hasDeprecatedAnnotation(tree.mods.annotations))
c.flags_field |= DEPRECATED;
- annotateLater(tree.mods.annotations, baseEnv, c, tree.pos());
+ annotate.annotateLater(tree.mods.annotations, baseEnv, c, tree.pos());
// class type parameters use baseEnv but everything uses env
chk.checkNonCyclicDecl(tree);
@@ -1114,7 +1010,7 @@
attr.attribTypeVariables(tree.typarams, baseEnv);
// Do this here, where we have the symbol.
for (JCTypeParameter tp : tree.typarams)
- typeAnnotate(tp, baseEnv, sym, tree.pos());
+ annotate.annotateTypeLater(tp, baseEnv, sym, tree.pos());
// Add default constructor if needed.
if ((c.flags() & INTERFACE) == 0 &&
@@ -1205,165 +1101,6 @@
}
}
- /*
- * If the symbol is non-null, attach the type annotation to it.
- */
- private void actualEnterTypeAnnotations(final List<JCAnnotation> annotations,
- final Env<AttrContext> env,
- final Symbol s) {
- Map<TypeSymbol, ListBuffer<Attribute.TypeCompound>> annotated = new LinkedHashMap<>();
- Map<Attribute.TypeCompound, DiagnosticPosition> pos = new HashMap<>();
-
- for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
- JCAnnotation a = al.head;
- Attribute.TypeCompound tc = annotate.enterTypeAnnotation(a,
- syms.annotationType,
- env);
- if (tc == null) {
- continue;
- }
-
- if (annotated.containsKey(a.type.tsym)) {
- if (source.allowRepeatedAnnotations()) {
- ListBuffer<Attribute.TypeCompound> l = annotated.get(a.type.tsym);
- l = l.append(tc);
- annotated.put(a.type.tsym, l);
- pos.put(tc, a.pos());
- } else {
- log.error(a.pos(), "repeatable.annotations.not.supported.in.source");
- }
- } else {
- annotated.put(a.type.tsym, ListBuffer.of(tc));
- pos.put(tc, a.pos());
- }
- }
-
- if (s != null) {
- s.appendTypeAttributesWithCompletion(
- annotate.new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
- }
- }
-
- public void typeAnnotate(final JCTree tree, final Env<AttrContext> env, final Symbol sym, DiagnosticPosition deferPos) {
- if (allowTypeAnnos) {
- tree.accept(new TypeAnnotate(env, sym, deferPos));
- }
- }
-
- /**
- * We need to use a TreeScanner, because it is not enough to visit the top-level
- * annotations. We also need to visit type arguments, etc.
- */
- private class TypeAnnotate extends TreeScanner {
- private Env<AttrContext> env;
- private Symbol sym;
- private DiagnosticPosition deferPos;
-
- public TypeAnnotate(final Env<AttrContext> env, final Symbol sym, DiagnosticPosition deferPos) {
- this.env = env;
- this.sym = sym;
- this.deferPos = deferPos;
- }
-
- void annotateTypeLater(final List<JCAnnotation> annotations) {
- if (annotations.isEmpty()) {
- return;
- }
-
- final DiagnosticPosition deferPos = this.deferPos;
-
- annotate.normal(new Annotate.Worker() {
- @Override
- public String toString() {
- return "type annotate " + annotations + " onto " + sym + " in " + sym.owner;
- }
- @Override
- public void run() {
- JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
- DiagnosticPosition prevLintPos = null;
-
- if (deferPos != null) {
- prevLintPos = deferredLintHandler.setPos(deferPos);
- }
- try {
- actualEnterTypeAnnotations(annotations, env, sym);
- } finally {
- if (prevLintPos != null)
- deferredLintHandler.setPos(prevLintPos);
- log.useSource(prev);
- }
- }
- });
- }
-
- @Override
- public void visitAnnotatedType(final JCAnnotatedType tree) {
- annotateTypeLater(tree.annotations);
- super.visitAnnotatedType(tree);
- }
-
- @Override
- public void visitTypeParameter(final JCTypeParameter tree) {
- annotateTypeLater(tree.annotations);
- super.visitTypeParameter(tree);
- }
-
- @Override
- public void visitNewArray(final JCNewArray tree) {
- annotateTypeLater(tree.annotations);
- for (List<JCAnnotation> dimAnnos : tree.dimAnnotations)
- annotateTypeLater(dimAnnos);
- super.visitNewArray(tree);
- }
-
- @Override
- public void visitMethodDef(final JCMethodDecl tree) {
- scan(tree.mods);
- scan(tree.restype);
- scan(tree.typarams);
- scan(tree.recvparam);
- scan(tree.params);
- scan(tree.thrown);
- scan(tree.defaultValue);
- // Do not annotate the body, just the signature.
- // scan(tree.body);
- }
-
- @Override
- public void visitVarDef(final JCVariableDecl tree) {
- DiagnosticPosition prevPos = deferPos;
- deferPos = tree.pos();
- try {
- if (sym != null && sym.kind == Kinds.VAR) {
- // Don't visit a parameter once when the sym is the method
- // and once when the sym is the parameter.
- scan(tree.mods);
- scan(tree.vartype);
- }
- scan(tree.init);
- } finally {
- deferPos = prevPos;
- }
- }
-
- @Override
- public void visitClassDef(JCClassDecl tree) {
- // We can only hit a classdef if it is declared within
- // a method. Ignore it - the class will be visited
- // separately later.
- }
-
- @Override
- public void visitNewClass(JCNewClass tree) {
- if (tree.def == null) {
- // For an anonymous class instantiation the class
- // will be visited separately.
- super.visitNewClass(tree);
- }
- }
- }
-
-
private Env<AttrContext> baseEnv(JCClassDecl tree, Env<AttrContext> env) {
Scope baseScope = new Scope(tree.sym);
//import already entered local classes into base scope
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Mar 06 10:41:56 2014 -0800
@@ -898,7 +898,7 @@
@Override
public boolean compatible(Type found, Type req, Warner warn) {
- found = pendingInferenceContext.asFree(found);
+ found = pendingInferenceContext.asUndetVar(found);
req = infer.returnConstraintTarget(found, req);
return super.compatible(found, req, warn);
}
@@ -935,8 +935,8 @@
public boolean compatible(Type found, Type req, Warner warn) {
return strict ?
- types.isSubtypeUnchecked(found, deferredAttrContext.inferenceContext.asFree(req), warn) :
- types.isConvertible(found, deferredAttrContext.inferenceContext.asFree(req), warn);
+ types.isSubtypeUnchecked(found, deferredAttrContext.inferenceContext.asUndetVar(req), warn) :
+ types.isConvertible(found, deferredAttrContext.inferenceContext.asUndetVar(req), warn);
}
public void report(DiagnosticPosition pos, JCDiagnostic details) {
@@ -1141,7 +1141,7 @@
Type desc_t = types.findDescriptorType(t);
Type desc_s = types.findDescriptorType(s);
if (types.isSameTypes(desc_t.getParameterTypes(),
- inferenceContext().asFree(desc_s.getParameterTypes()))) {
+ inferenceContext().asUndetVars(desc_s.getParameterTypes()))) {
if (types.asSuper(t, s.tsym) != null ||
types.asSuper(s, t.tsym) != null) {
result &= MostSpecificCheckContext.super.compatible(t, s, warn);
@@ -1168,7 +1168,7 @@
Type desc_t = types.findDescriptorType(t);
Type desc_s = types.findDescriptorType(s);
if (types.isSameTypes(desc_t.getParameterTypes(),
- inferenceContext().asFree(desc_s.getParameterTypes()))) {
+ inferenceContext().asUndetVars(desc_s.getParameterTypes()))) {
if (types.asSuper(t, s.tsym) != null ||
types.asSuper(s, t.tsym) != null) {
result &= MostSpecificCheckContext.super.compatible(t, s, warn);
@@ -3151,7 +3151,7 @@
if (TreeInfo.isStaticSelector(referenceTree.expr, names) &&
argtypes.nonEmpty() &&
(argtypes.head.hasTag(NONE) ||
- types.isSubtypeUnchecked(inferenceContext.asFree(argtypes.head), site))) {
+ types.isSubtypeUnchecked(inferenceContext.asUndetVar(argtypes.head), site))) {
return new UnboundMethodReferenceLookupHelper(referenceTree, name,
site, argtypes, typeargtypes, maxPhase);
} else {
@@ -4263,7 +4263,11 @@
}
DeferredAttrContext deferredAttrContext(Symbol sym, InferenceContext inferenceContext, ResultInfo pendingResult, Warner warn) {
- return deferredAttr.new DeferredAttrContext(attrMode, sym, step, inferenceContext, pendingResult != null ? pendingResult.checkContext.deferredAttrContext() : deferredAttr.emptyDeferredAttrContext, warn);
+ DeferredAttrContext parent = (pendingResult == null)
+ ? deferredAttr.emptyDeferredAttrContext
+ : pendingResult.checkContext.deferredAttrContext();
+ return deferredAttr.new DeferredAttrContext(attrMode, sym, step,
+ inferenceContext, parent, warn);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -834,6 +834,8 @@
public void visitReference(JCMemberReference tree) {
tree.expr = translate(tree.expr, erasure(tree.expr.type));
tree.type = erasure(tree.type);
+ if (tree.varargsElement != null)
+ tree.varargsElement = erasure(tree.varargsElement);
result = tree;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Thu Mar 06 10:41:56 2014 -0800
@@ -71,6 +71,8 @@
}
this.name = name;
this.file = f;
+ if (f.lastModified() > System.currentTimeMillis())
+ fileManager.log.warning("file.from.future", f);
}
@Override
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Thu Mar 06 10:41:56 2014 -0800
@@ -431,7 +431,9 @@
return toP(err);
}
+ private static final int RECOVERY_THRESHOLD = 50;
private int errorPos = Position.NOPOS;
+ private int count = 0;
/**
* Report a syntax using the given the position parameter and arguments,
@@ -456,9 +458,13 @@
}
}
S.errPos(pos);
- if (token.pos == errorPos)
- nextToken(); // guarantee progress
- errorPos = token.pos;
+ if (token.pos == errorPos) {
+ //check for a possible infinite loop in parsing:
+ Assert.check(count++ < RECOVERY_THRESHOLD);
+ } else {
+ count = 0;
+ errorPos = token.pos;
+ }
}
@@ -2288,14 +2294,19 @@
@SuppressWarnings("fallthrough")
List<JCStatement> blockStatements() {
//todo: skip to anchor on error(?)
+ int lastErrPos = -1;
ListBuffer<JCStatement> stats = new ListBuffer<>();
while (true) {
List<JCStatement> stat = blockStatement();
if (stat.isEmpty()) {
return stats.toList();
} else {
+ // error recovery
+ if (token.pos == lastErrPos)
+ return stats.toList();
if (token.pos <= endPosTable.errorEndPos) {
skip(false, true, true, true);
+ lastErrPos = token.pos;
}
stats.addAll(stat);
}
@@ -3424,9 +3435,12 @@
token.kind == INTERFACE ||
allowEnums && token.kind == ENUM) {
return List.<JCTree>of(classOrInterfaceOrEnumDeclaration(mods, dc));
- } else if (token.kind == LBRACE && !isInterface &&
+ } else if (token.kind == LBRACE &&
(mods.flags & Flags.StandardFlags & ~Flags.STATIC) == 0 &&
mods.annotations.isEmpty()) {
+ if (isInterface) {
+ error(token.pos, "initializer.not.allowed");
+ }
return List.<JCTree>of(block(pos, mods.flags));
} else {
pos = token.pos;
@@ -4055,15 +4069,16 @@
*/
protected static class SimpleEndPosTable extends AbstractEndPosTable {
- private final Map<JCTree, Integer> endPosMap;
+ private final IntHashTable endPosMap;
SimpleEndPosTable(JavacParser parser) {
super(parser);
- endPosMap = new HashMap<>();
+ endPosMap = new IntHashTable();
}
public void storeEnd(JCTree tree, int endpos) {
- endPosMap.put(tree, errorEndPos > endpos ? errorEndPos : endpos);
+ endPosMap.putAtIndex(tree, errorEndPos > endpos ? errorEndPos : endpos,
+ endPosMap.lookup(tree));
}
protected <T extends JCTree> T to(T t) {
@@ -4077,14 +4092,15 @@
}
public int getEndPos(JCTree tree) {
- Integer value = endPosMap.get(tree);
- return (value == null) ? Position.NOPOS : value;
+ int value = endPosMap.getFromIndex(endPosMap.lookup(tree));
+ // As long as Position.NOPOS==-1, this just returns value.
+ return (value == -1) ? Position.NOPOS : value;
}
public int replaceTree(JCTree oldTree, JCTree newTree) {
- Integer pos = endPosMap.remove(oldTree);
- if (pos != null) {
- endPosMap.put(newTree, pos);
+ int pos = endPosMap.remove(oldTree);
+ if (pos != -1) {
+ storeEnd(newTree, pos);
return pos;
}
return Position.NOPOS;
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Mar 06 10:41:56 2014 -0800
@@ -1039,6 +1039,9 @@
compiler.err.initializer.must.be.able.to.complete.normally=\
initializer must be able to complete normally
+compiler.err.initializer.not.allowed=\
+ initializers not allowed in interfaces
+
# 0: type
compiler.err.unreported.exception.need.to.catch.or.throw=\
unreported exception {0}; must be caught or declared to be thrown
@@ -1158,6 +1161,10 @@
compiler.misc.x.print.rounds=\
Round {0}:\n\tinput files: {1}\n\tannotations: {2}\n\tlast round: {3}
+# 0: file name
+compiler.warn.file.from.future=\
+ Modification date is in the future for file {0}
+
#####
## The following string will appear before all messages keyed as:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/IntHashTable.java Thu Mar 06 10:41:56 2014 -0800
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2014, 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 com.sun.tools.javac.util;
+
+/**
+ * A hash table that maps Object to int.
+ *
+ * This is a custom hash table optimised for the Object -> int
+ * maps. This is done to avoid unnecessary object allocation in the image set.
+ *
+ * @author Charles Turner
+ * @author Per Bothner
+ */
+public class IntHashTable {
+ private static final int DEFAULT_INITIAL_SIZE = 64;
+ protected Object[] objs; // the domain set
+ protected int[] ints; // the image set
+ protected int mask; // used to clip int's into the domain
+ protected int num_bindings; // the number of mappings (including DELETED)
+ private final static Object DELETED = new Object();
+
+ /**
+ * Construct an Object -> int hash table.
+ *
+ * The default size of the hash table is 64 mappings.
+ */
+ public IntHashTable() {
+ objs = new Object[DEFAULT_INITIAL_SIZE];
+ ints = new int[DEFAULT_INITIAL_SIZE];
+ mask = DEFAULT_INITIAL_SIZE - 1;
+ }
+
+ /**
+ * Construct an Object -> int hash table with a specified amount of mappings.
+ * @param capacity The number of default mappings in this hash table.
+ */
+ public IntHashTable(int capacity) {
+ int log2Size = 4;
+ while (capacity > (1 << log2Size)) {
+ log2Size++;
+ }
+ capacity = 1 << log2Size;
+ objs = new Object[capacity];
+ ints = new int[capacity];
+ mask = capacity - 1;
+ }
+
+ /**
+ * Compute the hash code of a given object.
+ *
+ * @param key The object whose hash code is to be computed.
+ * @return zero if the object is null, otherwise the identityHashCode
+ */
+ public int hash(Object key) {
+ return System.identityHashCode(key);
+ }
+
+ /**
+ * Find either the index of a key's value, or the index of an available space.
+ *
+ * @param key The key to whose value you want to find.
+ * @param hash The hash code of this key.
+ * @return Either the index of the key's value, or an index pointing to
+ * unoccupied space.
+ */
+ public int lookup(Object key, int hash) {
+ Object node;
+ int hash1 = hash ^ (hash >>> 15);
+ int hash2 = (hash ^ (hash << 6)) | 1; //ensure coprimeness
+ int deleted = -1;
+ for (int i = hash1 & mask;; i = (i + hash2) & mask) {
+ node = objs[i];
+ if (node == key)
+ return i;
+ if (node == null)
+ return deleted >= 0 ? deleted : i;
+ if (node == DELETED && deleted < 0)
+ deleted = i;
+ }
+ }
+
+ /**
+ * Lookup a given key's value in the hash table.
+ *
+ * @param key The key whose value you want to find.
+ * @return Either the index of the key's value, or an index pointing to
+ * unoccupied space.
+ */
+ public int lookup(Object key) {
+ return lookup(key, hash(key));
+ }
+
+ /**
+ * Return the value stored at the specified index in the table.
+ *
+ * @param index The index to inspect, as returned from {@link #lookup}
+ * @return A non-negative integer if the index contains a non-null
+ * value, or -1 if it does.
+ */
+ public int getFromIndex(int index) {
+ Object node = objs[index];
+ return node == null || node == DELETED ? -1 : ints[index];
+ }
+
+ /**
+ * Associates the specified key with the specified value in this map.
+ *
+ * @param key key with which the specified value is to be associated.
+ * @param value value to be associated with the specified key.
+ * @param index the index at which to place this binding, as returned
+ * from {@link #lookup}.
+ * @return previous value associated with specified key, or -1 if there was
+ * no mapping for key.
+ */
+ public int putAtIndex(Object key, int value, int index) {
+ Object old = objs[index];
+ if (old == null || old == DELETED) {
+ objs[index] = key;
+ ints[index] = value;
+ if (old != DELETED)
+ num_bindings++;
+ if (3 * num_bindings >= 2 * objs.length)
+ rehash();
+ return -1;
+ } else { // update existing mapping
+ int oldValue = ints[index];
+ ints[index] = value;
+ return oldValue;
+ }
+ }
+
+ public int remove(Object key) {
+ int index = lookup(key);
+ Object old = objs[index];
+ if (old == null || old == DELETED)
+ return -1;
+ objs[index] = DELETED;
+ return ints[index];
+ }
+
+ /**
+ * Expand the hash table when it exceeds the load factor.
+ *
+ * Rehash the existing objects.
+ */
+ protected void rehash() {
+ Object[] oldObjsTable = objs;
+ int[] oldIntsTable = ints;
+ int oldCapacity = oldObjsTable.length;
+ int newCapacity = oldCapacity << 1;
+ Object[] newObjTable = new Object[newCapacity];
+ int[] newIntTable = new int[newCapacity];
+ int newMask = newCapacity - 1;
+ objs = newObjTable;
+ ints = newIntTable;
+ mask = newMask;
+ num_bindings = 0; // this is recomputed below
+ Object key;
+ for (int i = oldIntsTable.length; --i >= 0;) {
+ key = oldObjsTable[i];
+ if (key != null && key != DELETED)
+ putAtIndex(key, oldIntsTable[i], lookup(key, hash(key)));
+ }
+ }
+
+ /**
+ * Removes all mappings from this map.
+ */
+ public void clear() {
+ for (int i = objs.length; --i >= 0;) {
+ objs[i] = null;
+ }
+ num_bindings = 0;
+ }
+}
--- a/langtools/test/tools/javac/TryWithResources/BadTwrSyntax.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/TryWithResources/BadTwrSyntax.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,7 +1,2 @@
BadTwrSyntax.java:14:43: compiler.err.illegal.start.of.type
-BadTwrSyntax.java:14:44: compiler.err.expected: =
-BadTwrSyntax.java:14:45: compiler.err.expected: ')'
-BadTwrSyntax.java:14:47: compiler.err.expected: '{'
-BadTwrSyntax.java:15:19: compiler.err.illegal.start.of.expr
-BadTwrSyntax.java:15:23: compiler.err.expected: ';'
-6 errors
+1 error
--- a/langtools/test/tools/javac/annotations/typeAnnotations/6967002/T6967002.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/6967002/T6967002.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,8 +1,2 @@
T6967002.java:33:22: compiler.err.expected: ')'
-T6967002.java:33:25: compiler.err.illegal.start.of.expr
-T6967002.java:33:28: compiler.err.illegal.start.of.expr
-T6967002.java:33:29: compiler.err.illegal.start.of.expr
-T6967002.java:33:27: compiler.err.not.stmt
-T6967002.java:33:30: compiler.err.expected: ';'
-T6967002.java:35:2: compiler.err.premature.eof
-7 errors
+1 error
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage2.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,3 +1,3 @@
AnnotatedPackage2.java:9:8: compiler.err.expected: token.identifier
-AnnotatedPackage2.java:9:10: compiler.err.expected3: class, interface, enum
+AnnotatedPackage2.java:9:12: compiler.err.expected3: class, interface, enum
2 errors
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/OldArray.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/OldArray.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,10 +1,4 @@
OldArray.java:12:11: compiler.err.expected: ']'
OldArray.java:12:13: compiler.err.expected: token.identifier
-OldArray.java:12:14: compiler.err.expected: ';'
-OldArray.java:12:17: compiler.err.illegal.start.of.type
-OldArray.java:12:18: compiler.err.expected: token.identifier
-OldArray.java:12:19: compiler.err.expected: ';'
-OldArray.java:12:22: compiler.err.illegal.start.of.type
-OldArray.java:12:28: compiler.err.expected: token.identifier
-OldArray.java:13:1: compiler.err.expected3: class, interface, enum
-9 errors
+OldArray.java:12:16: compiler.err.invalid.meth.decl.ret.type.req
+3 errors
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt Thu Mar 06 10:41:56 2014 -0800
@@ -110,4 +110,4 @@
compiler.warn.unknown.enum.constant # in bad class file
compiler.warn.unknown.enum.constant.reason # in bad class file
compiler.warn.override.equals.but.not.hashcode # when a class overrides equals but not hashCode method from Object
-
+compiler.warn.file.from.future # warning for future modification times on files
--- a/langtools/test/tools/javac/diags/examples/ArrayAndReceiver.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples/ArrayAndReceiver.java Thu Mar 06 10:41:56 2014 -0800
@@ -22,9 +22,6 @@
*/
// key: compiler.err.array.and.receiver
-// key: compiler.err.expected
-// key: compiler.err.expected3
-// key: compiler.err.illegal.start.of.type
class ArrayAndReceiver {
void m(ArrayAndReceiver this[]) { }
--- a/langtools/test/tools/javac/diags/examples/EmptyCharLiteral.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples/EmptyCharLiteral.java Thu Mar 06 10:41:56 2014 -0800
@@ -23,7 +23,6 @@
// key: compiler.err.empty.char.lit
// key: compiler.err.unclosed.char.lit
-// key: compiler.err.premature.eof
class X {
char c = '';
--- a/langtools/test/tools/javac/diags/examples/IllegalDot.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples/IllegalDot.java Thu Mar 06 10:41:56 2014 -0800
@@ -22,8 +22,6 @@
*/
// key: compiler.err.illegal.dot
-// key: compiler.err.expected
-// key: compiler.err.illegal.start.of.type
class X {
void m(Object.. args) { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/IllegalStartOfType.java Thu Mar 06 10:41:56 2014 -0800
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+// key: compiler.err.illegal.start.of.type
+
+class IllegalStartOfType {
+ public void test(int i,) { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/InitializerNotAllowed.java Thu Mar 06 10:41:56 2014 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+// key: compiler.err.initializer.not.allowed
+
+interface InitializerNotAllowed {
+ {
+ System.out.println();
+ }
+}
--- a/langtools/test/tools/javac/diags/examples/InvalidBinaryNumber.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples/InvalidBinaryNumber.java Thu Mar 06 10:41:56 2014 -0800
@@ -22,9 +22,6 @@
*/
// key: compiler.err.invalid.binary.number
-// key: compiler.err.illegal.start.of.type
-// key: compiler.err.expected
-// key: compiler.err.premature.eof
class InvalidBinaryNumber {
int i = 0b201000010;
--- a/langtools/test/tools/javac/diags/examples/VarargsMustBeLast.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/diags/examples/VarargsMustBeLast.java Thu Mar 06 10:41:56 2014 -0800
@@ -23,6 +23,6 @@
// key: compiler.err.varargs.must.be.last
-class VarargMustBeFinal {
+class VarargMustBeLast {
public void invalidVarArg(String... invalidVarArg, String extra) { }
}
--- a/langtools/test/tools/javac/enum/EnumMembersOrder.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/enum/EnumMembersOrder.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,6 +1,6 @@
EnumMembersOrder.java:11:16: compiler.err.expected: ')'
EnumMembersOrder.java:11:17: compiler.err.expected3: ',', '}', ';'
-EnumMembersOrder.java:11:19: compiler.err.expected: '}'
+EnumMembersOrder.java:11:18: compiler.err.expected: '}'
EnumMembersOrder.java:11:31: compiler.err.expected3: class, interface, enum
EnumMembersOrder.java:17:13: compiler.err.expected3: class, interface, enum
EnumMembersOrder.java:19:1: compiler.err.expected3: class, interface, enum
--- a/langtools/test/tools/javac/parser/7157165/T7157165.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/parser/7157165/T7157165.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,4 +1,4 @@
T7157165.java:11:20: compiler.err.expected: >
-T7157165.java:11:21: compiler.err.expected: ';'
-T7157165.java:11:22: compiler.err.illegal.start.of.type
+T7157165.java:11:22: compiler.err.expected: token.identifier
+T7157165.java:11:28: compiler.err.expected: token.identifier
3 errors
--- a/langtools/test/tools/javac/parser/ErroneousParameters.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/parser/ErroneousParameters.java Thu Mar 06 10:41:56 2014 -0800
@@ -1,6 +1,6 @@
/*
* @test /nodynamiccopyright/
- * @bug 8030091
+ * @bug 8030091 8031383
* @summary Producing reasonable errors for unexpected tokens in method parameters
* @compile/fail/ref=ErroneousParameters.out -XDrawDiagnostics ErroneousParameters.java
*/
--- a/langtools/test/tools/javac/parser/ErroneousParameters.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/parser/ErroneousParameters.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,14 +1,6 @@
ErroneousParameters.java:10:36: compiler.err.varargs.must.be.last
ErroneousParameters.java:11:39: compiler.err.expected3: ',', ')', '['
-ErroneousParameters.java:11:42: compiler.err.illegal.start.of.type
-ErroneousParameters.java:11:43: compiler.err.expected: token.identifier
-ErroneousParameters.java:11:45: compiler.err.expected: ';'
ErroneousParameters.java:12:40: compiler.err.illegal.start.of.type
-ErroneousParameters.java:12:41: compiler.err.expected3: ',', ')', '['
-ErroneousParameters.java:12:43: compiler.err.expected: ';'
ErroneousParameters.java:13:41: compiler.err.expected: ']'
ErroneousParameters.java:14:38: compiler.err.expected3: ',', ')', '['
-ErroneousParameters.java:14:39: compiler.err.illegal.start.of.type
-ErroneousParameters.java:14:40: compiler.err.expected: token.identifier
-ErroneousParameters.java:14:42: compiler.err.expected: ';'
-13 errors
+5 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/parser/MissingClosingBrace.java Thu Mar 06 10:41:56 2014 -0800
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8031383
+ * @summary Verify that the parser handles a missing closing brace of a block gracefully.
+ * @compile/fail/ref=MissingClosingBrace.out -XDrawDiagnostics MissingClosingBrace.java
+ */
+
+public class MissingClosingBrace {
+ private void test(int i) {
+ if (i > 0) {
+
+ private int i;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/parser/MissingClosingBrace.out Thu Mar 06 10:41:56 2014 -0800
@@ -0,0 +1,2 @@
+MissingClosingBrace.java:12:5: compiler.err.illegal.start.of.expr
+1 error
--- a/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/parser/SingleCommaAnnotationValueFail.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,6 +1,3 @@
SingleCommaAnnotationValueFail.java:34:12: compiler.err.expected: '}'
-SingleCommaAnnotationValueFail.java:34:13: compiler.err.illegal.start.of.type
-SingleCommaAnnotationValueFail.java:34:14: compiler.err.expected: token.identifier
-SingleCommaAnnotationValueFail.java:34:15: compiler.err.expected: ';'
-SingleCommaAnnotationValueFail.java:34:21: compiler.err.invalid.meth.decl.ret.type.req
-5 errors
+SingleCommaAnnotationValueFail.java:34:14: compiler.err.expected3: class, interface, enum
+2 errors
--- a/langtools/test/tools/javac/parser/T4881269.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/parser/T4881269.out Thu Mar 06 10:41:56 2014 -0800
@@ -2,8 +2,4 @@
T4881269.java:33:27: compiler.err.illegal.dot
T4881269.java:33:22: compiler.err.not.stmt
T4881269.java:34:19: compiler.err.illegal.dot
-T4881269.java:34:20: compiler.err.expected: ';'
-T4881269.java:34:22: compiler.err.illegal.start.of.type
-T4881269.java:34:23: compiler.err.expected: token.identifier
-T4881269.java:34:25: compiler.err.expected: ';'
-8 errors
+4 errors
--- a/langtools/test/tools/javac/processing/TestWarnErrorCount.java Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/processing/TestWarnErrorCount.java Thu Mar 06 10:41:56 2014 -0800
@@ -214,7 +214,7 @@
javaWarnsExpected = 0;
break;
case JAVA:
- errsExpected = 2;
+ errsExpected = 1;
msgrWarnsExpected = mwk.count(1, ERROR_ROUND + 1);
javaWarnsExpected = 0;
break;
--- a/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,8 +1,3 @@
ParseErrors.java:37:37: compiler.err.expected: token.identifier
ParseErrors.java:38:1: compiler.err.illegal.start.of.type
-ParseErrors.java:38:2: compiler.err.expected3: ',', ')', '['
-ParseErrors.java:40:6: compiler.err.expected: ';'
-ParseErrors.java:40:20: compiler.err.illegal.start.of.type
-ParseErrors.java:41:5: compiler.err.expected: '('
-ParseErrors.java:41:8: compiler.err.expected: token.identifier
-7 errors
+2 errors
--- a/langtools/test/tools/javac/quid/T6999438.out Mon Feb 24 13:06:07 2014 -0800
+++ b/langtools/test/tools/javac/quid/T6999438.out Thu Mar 06 10:41:56 2014 -0800
@@ -1,6 +1,2 @@
T6999438.java:8:9: compiler.err.illegal.char: #
-T6999438.java:8:10: compiler.err.illegal.start.of.type
-T6999438.java:8:25: compiler.err.expected: token.identifier
-T6999438.java:8:26: compiler.err.expected: ';'
-T6999438.java:9:2: compiler.err.premature.eof
-5 errors
+1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/MethodHandleCrash.java Thu Mar 06 10:41:56 2014 -0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2014, 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 8034048
+ * @summary javac crash with method references plus lambda plus var args
+ * @author govereau
+ *
+ * @compile MethodHandleCrash.java
+ */
+public interface MethodHandleCrash {
+ static<T> void functional(T... input) {
+ java.util.function.Consumer<T> c = MethodHandleCrash::functional;
+ }
+}