Merge jdk7-b121

Mon, 06 Dec 2010 20:35:49 -0800

author
lana
date
Mon, 06 Dec 2010 20:35:49 -0800
changeset 759
1bf969e9792f
parent 750
d53cf2e9ad6c
parent 758
bcbc86cc5b31
child 760
11e7b4c0476e

Merge

test/tools/javac/diags/examples/EmptyBytecodeIdent.java file | annotate | diff | comparison | revisions
test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java file | annotate | diff | comparison | revisions
test/tools/javac/diags/examples/UnclosedBytecodeIdent.java file | annotate | diff | comparison | revisions
test/tools/javac/diags/examples/UnsupportedExoticID.java file | annotate | diff | comparison | revisions
test/tools/javac/quid/QuotedIdent.java file | annotate | diff | comparison | revisions
test/tools/javac/quid/QuotedIdent2.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Lint.java	Fri Dec 03 19:45:34 2010 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Lint.java	Mon Dec 06 20:35:49 2010 -0800
     1.3 @@ -165,6 +165,11 @@
     1.4          FINALLY("finally"),
     1.5  
     1.6          /**
     1.7 +         * Warn about issues relating to use of command line options
     1.8 +         */
     1.9 +        OPTIONS("options"),
    1.10 +
    1.11 +        /**
    1.12           * Warn about issues regarding method overrides.
    1.13           */
    1.14          OVERRIDES("overrides"),
    1.15 @@ -182,39 +187,39 @@
    1.16          PROCESSING("processing"),
    1.17  
    1.18          /**
    1.19 +         * Warn about unchecked operations on raw types.
    1.20 +         */
    1.21 +        RAW("rawtypes"),
    1.22 +
    1.23 +        /**
    1.24           * Warn about Serializable classes that do not provide a serial version ID.
    1.25           */
    1.26          SERIAL("serial"),
    1.27  
    1.28          /**
    1.29 +         * Warn about issues relating to use of statics
    1.30 +         */
    1.31 +        STATIC("static"),
    1.32 +
    1.33 +        /**
    1.34 +         * Warn about proprietary API that may be removed in a future release.
    1.35 +         */
    1.36 +        SUNAPI("sunapi", true),
    1.37 +
    1.38 +        /**
    1.39 +         * Warn about issues relating to use of try blocks (i.e. try-with-resources)
    1.40 +         */
    1.41 +        TRY("try"),
    1.42 +
    1.43 +        /**
    1.44           * Warn about unchecked operations on raw types.
    1.45           */
    1.46          UNCHECKED("unchecked"),
    1.47  
    1.48          /**
    1.49 -         * Warn about unchecked operations on raw types.
    1.50 -         */
    1.51 -        RAW("rawtypes"),
    1.52 -
    1.53 -        /**
    1.54 -         * Warn about proprietary API that may be removed in a future release.
    1.55 -         */
    1.56 -        SUNAPI("sunapi", true),
    1.57 -
    1.58 -        /**
    1.59 -         * Warn about issues relating to use of statics
    1.60 -         */
    1.61 -        STATIC("static"),
    1.62 -
    1.63 -        /**
    1.64           * Warn about potentially unsafe vararg methods
    1.65           */
    1.66 -        VARARGS("varargs"),
    1.67 -
    1.68 -        /**
    1.69 -         * Warn about issues relating to use of try blocks (i.e. try-with-resources)
    1.70 -         */
    1.71 -        TRY("try");
    1.72 +        VARARGS("varargs");
    1.73  
    1.74          LintCategory(String option) {
    1.75              this(option, false);
     2.1 --- a/src/share/classes/com/sun/tools/javac/code/Scope.java	Fri Dec 03 19:45:34 2010 -0800
     2.2 +++ b/src/share/classes/com/sun/tools/javac/code/Scope.java	Mon Dec 06 20:35:49 2010 -0800
     2.3 @@ -528,7 +528,7 @@
     2.4              }
     2.5              public Entry next() {
     2.6                  Entry e = super.shadowed;
     2.7 -                while (isBogus())
     2.8 +                while (e.isBogus())
     2.9                      e = e.shadowed;
    2.10                  return e;
    2.11              }
     3.1 --- a/src/share/classes/com/sun/tools/javac/code/Source.java	Fri Dec 03 19:45:34 2010 -0800
     3.2 +++ b/src/share/classes/com/sun/tools/javac/code/Source.java	Mon Dec 06 20:35:49 2010 -0800
     3.3 @@ -174,9 +174,6 @@
     3.4      public boolean allowUnderscoresInLiterals() {
     3.5          return compareTo(JDK1_7) >= 0;
     3.6      }
     3.7 -    public boolean allowExoticIdentifiers() {
     3.8 -        return compareTo(JDK1_7) >= 0;
     3.9 -    }
    3.10      public boolean allowStringsInSwitch() {
    3.11          return compareTo(JDK1_7) >= 0;
    3.12      }
     4.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Dec 03 19:45:34 2010 -0800
     4.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Dec 06 20:35:49 2010 -0800
     4.3 @@ -2772,6 +2772,8 @@
     4.4      public Type glb(Type t, Type s) {
     4.5          if (s == null)
     4.6              return t;
     4.7 +        else if (t.isPrimitive() || s.isPrimitive())
     4.8 +            return syms.errType;
     4.9          else if (isSubtypeNoCapture(t, s))
    4.10              return t;
    4.11          else if (isSubtypeNoCapture(s, t))
    4.12 @@ -2928,6 +2930,15 @@
    4.13      }
    4.14  
    4.15      /**
    4.16 +     * Return the boxed type if 't' is primitive, otherwise return 't' itself.
    4.17 +     */
    4.18 +    public Type boxedTypeOrType(Type t) {
    4.19 +        return t.isPrimitive() ?
    4.20 +            boxedClass(t).type :
    4.21 +            t;
    4.22 +    }
    4.23 +
    4.24 +    /**
    4.25       * Return the primitive type corresponding to a boxed type.
    4.26       */
    4.27      public Type unboxedType(Type t) {
     5.1 --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Dec 03 19:45:34 2010 -0800
     5.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Mon Dec 06 20:35:49 2010 -0800
     5.3 @@ -305,7 +305,8 @@
     5.4              uv.hibounds = hibounds.toList();
     5.5          }
     5.6          Type qtype1 = types.subst(that.qtype, that.tvars, undetvars);
     5.7 -        if (!types.isSubtype(qtype1, to)) {
     5.8 +        if (!types.isSubtype(qtype1,
     5.9 +                qtype1.tag == UNDETVAR ? types.boxedTypeOrType(to) : to)) {
    5.10              throw unambiguousNoInstanceException
    5.11                  .setMessage("infer.no.conforming.instance.exists",
    5.12                              that.tvars, that.qtype, to);
     6.1 --- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Fri Dec 03 19:45:34 2010 -0800
     6.2 +++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Mon Dec 06 20:35:49 2010 -0800
     6.3 @@ -25,6 +25,7 @@
     6.4  
     6.5  package com.sun.tools.javac.file;
     6.6  
     6.7 +import java.util.Comparator;
     6.8  import java.io.ByteArrayOutputStream;
     6.9  import java.io.File;
    6.10  import java.io.FileNotFoundException;
    6.11 @@ -110,6 +111,20 @@
    6.12      protected boolean mmappedIO;
    6.13      protected boolean ignoreSymbolFile;
    6.14  
    6.15 +    protected enum SortFiles implements Comparator<File> {
    6.16 +        FORWARD {
    6.17 +            public int compare(File f1, File f2) {
    6.18 +                return f1.getName().compareTo(f2.getName());
    6.19 +            }
    6.20 +        },
    6.21 +        REVERSE {
    6.22 +            public int compare(File f1, File f2) {
    6.23 +                return -f1.getName().compareTo(f2.getName());
    6.24 +            }
    6.25 +        };
    6.26 +    };
    6.27 +    protected SortFiles sortFiles;
    6.28 +
    6.29      /**
    6.30       * Register a Context.Factory to create a JavacFileManager.
    6.31       */
    6.32 @@ -152,6 +167,16 @@
    6.33  
    6.34          mmappedIO = options.isSet("mmappedIO");
    6.35          ignoreSymbolFile = options.isSet("ignore.symbol.file");
    6.36 +
    6.37 +        String sf = options.get("sortFiles");
    6.38 +        if (sf != null) {
    6.39 +            sortFiles = (sf.equals("reverse") ? SortFiles.REVERSE : SortFiles.FORWARD);
    6.40 +        }
    6.41 +    }
    6.42 +
    6.43 +    @Override
    6.44 +    public boolean isDefaultBootClassPath() {
    6.45 +        return paths.isDefaultBootClassPath();
    6.46      }
    6.47  
    6.48      public JavaFileObject getFileForInput(String name) {
    6.49 @@ -293,6 +318,9 @@
    6.50              if (files == null)
    6.51                  return;
    6.52  
    6.53 +            if (sortFiles != null)
    6.54 +                Arrays.sort(files, sortFiles);
    6.55 +
    6.56              for (File f: files) {
    6.57                  String fname = f.getName();
    6.58                  if (f.isDirectory()) {
     7.1 --- a/src/share/classes/com/sun/tools/javac/file/Paths.java	Fri Dec 03 19:45:34 2010 -0800
     7.2 +++ b/src/share/classes/com/sun/tools/javac/file/Paths.java	Mon Dec 06 20:35:49 2010 -0800
     7.3 @@ -114,6 +114,11 @@
     7.4       */
     7.5      private File bootClassPathRtJar = null;
     7.6  
     7.7 +    /**
     7.8 +     *  Is bootclasspath the default?
     7.9 +     */
    7.10 +    private boolean isDefaultBootClassPath;
    7.11 +
    7.12      Path getPathForLocation(Location location) {
    7.13          Path path = pathsForLocation.get(location);
    7.14          if (path == null)
    7.15 @@ -129,7 +134,7 @@
    7.16              if (location == CLASS_PATH)
    7.17                  p = computeUserClassPath();
    7.18              else if (location == PLATFORM_CLASS_PATH)
    7.19 -                p = computeBootClassPath();
    7.20 +                p = computeBootClassPath(); // sets isDefaultBootClassPath
    7.21              else if (location == ANNOTATION_PROCESSOR_PATH)
    7.22                  p = computeAnnotationProcessorPath();
    7.23              else if (location == SOURCE_PATH)
    7.24 @@ -138,6 +143,8 @@
    7.25                  // no defaults for other paths
    7.26                  p = null;
    7.27          } else {
    7.28 +            if (location == PLATFORM_CLASS_PATH)
    7.29 +                isDefaultBootClassPath = false;
    7.30              p = new Path();
    7.31              for (File f: path)
    7.32                  p.addFile(f, warn); // TODO: is use of warn appropriate?
    7.33 @@ -145,6 +152,11 @@
    7.34          pathsForLocation.put(location, p);
    7.35      }
    7.36  
    7.37 +    public boolean isDefaultBootClassPath() {
    7.38 +        lazy();
    7.39 +        return isDefaultBootClassPath;
    7.40 +    }
    7.41 +
    7.42      protected void lazy() {
    7.43          if (!inited) {
    7.44              warn = lint.isEnabled(Lint.LintCategory.PATH);
    7.45 @@ -262,9 +274,10 @@
    7.46          }
    7.47  
    7.48          public Path addFiles(String files, boolean warn) {
    7.49 -            if (files != null)
    7.50 +            if (files != null) {
    7.51                  for (File file : getPathEntries(files, emptyPathDefault))
    7.52                      addFile(file, warn);
    7.53 +            }
    7.54              return this;
    7.55          }
    7.56  
    7.57 @@ -334,18 +347,23 @@
    7.58  
    7.59      private Path computeBootClassPath() {
    7.60          bootClassPathRtJar = null;
    7.61 -        String optionValue;
    7.62          Path path = new Path();
    7.63  
    7.64 -        path.addFiles(options.get(XBOOTCLASSPATH_PREPEND));
    7.65 +        String bootclasspathOpt = options.get(BOOTCLASSPATH);
    7.66 +        String endorseddirsOpt = options.get(ENDORSEDDIRS);
    7.67 +        String extdirsOpt = options.get(EXTDIRS);
    7.68 +        String xbootclasspathPrependOpt = options.get(XBOOTCLASSPATH_PREPEND);
    7.69 +        String xbootclasspathAppendOpt = options.get(XBOOTCLASSPATH_APPEND);
    7.70  
    7.71 -        if ((optionValue = options.get(ENDORSEDDIRS)) != null)
    7.72 -            path.addDirectories(optionValue);
    7.73 +        path.addFiles(xbootclasspathPrependOpt);
    7.74 +
    7.75 +        if (endorseddirsOpt != null)
    7.76 +            path.addDirectories(endorseddirsOpt);
    7.77          else
    7.78              path.addDirectories(System.getProperty("java.endorsed.dirs"), false);
    7.79  
    7.80 -        if ((optionValue = options.get(BOOTCLASSPATH)) != null) {
    7.81 -            path.addFiles(optionValue);
    7.82 +        if (bootclasspathOpt != null) {
    7.83 +            path.addFiles(bootclasspathOpt);
    7.84          } else {
    7.85              // Standard system classes for this compiler's release.
    7.86              String files = System.getProperty("sun.boot.class.path");
    7.87 @@ -357,16 +375,21 @@
    7.88              }
    7.89          }
    7.90  
    7.91 -        path.addFiles(options.get(XBOOTCLASSPATH_APPEND));
    7.92 +        path.addFiles(xbootclasspathAppendOpt);
    7.93  
    7.94          // Strictly speaking, standard extensions are not bootstrap
    7.95          // classes, but we treat them identically, so we'll pretend
    7.96          // that they are.
    7.97 -        if ((optionValue = options.get(EXTDIRS)) != null)
    7.98 -            path.addDirectories(optionValue);
    7.99 +        if (extdirsOpt != null)
   7.100 +            path.addDirectories(extdirsOpt);
   7.101          else
   7.102              path.addDirectories(System.getProperty("java.ext.dirs"), false);
   7.103  
   7.104 +        isDefaultBootClassPath =
   7.105 +                (xbootclasspathPrependOpt == null) &&
   7.106 +                (bootclasspathOpt == null) &&
   7.107 +                (xbootclasspathAppendOpt == null);
   7.108 +
   7.109          return path;
   7.110      }
   7.111  
     8.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Fri Dec 03 19:45:34 2010 -0800
     8.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Dec 06 20:35:49 2010 -0800
     8.3 @@ -2615,7 +2615,6 @@
     8.4                      String binaryName = fileManager.inferBinaryName(currentLoc, fo);
     8.5                      String simpleName = binaryName.substring(binaryName.lastIndexOf(".") + 1);
     8.6                      if (SourceVersion.isIdentifier(simpleName) ||
     8.7 -                        fo.getKind() == JavaFileObject.Kind.CLASS ||
     8.8                          simpleName.equals("package-info"))
     8.9                          includeClassFile(p, fo);
    8.10                      break;
     9.1 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Fri Dec 03 19:45:34 2010 -0800
     9.2 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Dec 06 20:35:49 2010 -0800
     9.3 @@ -51,6 +51,7 @@
     9.4  import com.sun.tools.javac.file.JavacFileManager;
     9.5  import com.sun.tools.javac.util.*;
     9.6  import com.sun.tools.javac.code.*;
     9.7 +import com.sun.tools.javac.code.Lint.LintCategory;
     9.8  import com.sun.tools.javac.code.Symbol.*;
     9.9  import com.sun.tools.javac.tree.*;
    9.10  import com.sun.tools.javac.tree.JCTree.*;
    9.11 @@ -370,6 +371,15 @@
    9.12          processPcks   = options.isSet("process.packages");
    9.13          werror        = options.isSet(WERROR);
    9.14  
    9.15 +        if (source.compareTo(Source.DEFAULT) < 0) {
    9.16 +            if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) {
    9.17 +                if (fileManager instanceof BaseFileManager) {
    9.18 +                    if (((BaseFileManager) fileManager).isDefaultBootClassPath())
    9.19 +                        log.warning(LintCategory.OPTIONS, "source.no.bootclasspath", source.name);
    9.20 +                }
    9.21 +            }
    9.22 +        }
    9.23 +
    9.24          verboseCompilePolicy = options.isSet("verboseCompilePolicy");
    9.25  
    9.26          if (attrParseOnly)
    9.27 @@ -783,6 +793,7 @@
    9.28          hasBeenUsed = true;
    9.29  
    9.30          start_msec = now();
    9.31 +
    9.32          try {
    9.33              initProcessAnnotations(processors);
    9.34  
    9.35 @@ -797,7 +808,7 @@
    9.36              elapsed_msec = delegateCompiler.elapsed_msec;
    9.37          } catch (Abort ex) {
    9.38              if (devVerbose)
    9.39 -                ex.printStackTrace();
    9.40 +                ex.printStackTrace(System.err);
    9.41          } finally {
    9.42              if (procEnvImpl != null)
    9.43                  procEnvImpl.close();
    9.44 @@ -841,7 +852,7 @@
    9.45              }
    9.46          } catch (Abort ex) {
    9.47              if (devVerbose)
    9.48 -                ex.printStackTrace();
    9.49 +                ex.printStackTrace(System.err);
    9.50          }
    9.51  
    9.52          if (verbose) {
    10.1 --- a/src/share/classes/com/sun/tools/javac/main/Main.java	Fri Dec 03 19:45:34 2010 -0800
    10.2 +++ b/src/share/classes/com/sun/tools/javac/main/Main.java	Mon Dec 06 20:35:49 2010 -0800
    10.3 @@ -420,7 +420,7 @@
    10.4                           processors);
    10.5  
    10.6              if (log.expectDiagKeys != null) {
    10.7 -                if (log.expectDiagKeys.size() == 0) {
    10.8 +                if (log.expectDiagKeys.isEmpty()) {
    10.9                      Log.printLines(log.noticeWriter, "all expected diagnostics found");
   10.10                      return EXIT_OK;
   10.11                  } else {
   10.12 @@ -506,7 +506,7 @@
   10.13      void apMessage(AnnotationProcessingError ex) {
   10.14          Log.printLines(out,
   10.15                         getLocalizedString("msg.proc.annotation.uncaught.exception"));
   10.16 -        ex.getCause().printStackTrace();
   10.17 +        ex.getCause().printStackTrace(out);
   10.18      }
   10.19  
   10.20      /** Display the location and checksum of a class. */
   10.21 @@ -563,6 +563,7 @@
   10.22      public static void useRawMessages(boolean enable) {
   10.23          if (enable) {
   10.24              messages = new JavacMessages(javacBundleName) {
   10.25 +                    @Override
   10.26                      public String getLocalizedString(String key, Object... args) {
   10.27                          return key;
   10.28                      }
    11.1 --- a/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java	Fri Dec 03 19:45:34 2010 -0800
    11.2 +++ b/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java	Mon Dec 06 20:35:49 2010 -0800
    11.3 @@ -172,6 +172,11 @@
    11.4          return getClassLoader(lb.toArray(new URL[lb.size()]));
    11.5      }
    11.6  
    11.7 +    @Override
    11.8 +    public boolean isDefaultBootClassPath() {
    11.9 +        return searchPaths.isDefaultBootClassPath();
   11.10 +    }
   11.11 +
   11.12      // <editor-fold defaultstate="collapsed" desc="Location handling">
   11.13  
   11.14      public boolean hasLocation(Location location) {
    12.1 --- a/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Fri Dec 03 19:45:34 2010 -0800
    12.2 +++ b/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Mon Dec 06 20:35:49 2010 -0800
    12.3 @@ -66,10 +66,6 @@
    12.4       */
    12.5      private boolean allowUnderscoresInLiterals;
    12.6  
    12.7 -    /** Allow exotic identifiers.
    12.8 -     */
    12.9 -    private boolean allowExoticIdentifiers;
   12.10 -
   12.11      /** The source language setting.
   12.12       */
   12.13      private Source source;
   12.14 @@ -143,7 +139,6 @@
   12.15          allowBinaryLiterals = source.allowBinaryLiterals();
   12.16          allowHexFloats = source.allowHexFloats();
   12.17          allowUnderscoresInLiterals = source.allowBinaryLiterals();
   12.18 -        allowExoticIdentifiers = source.allowExoticIdentifiers();  // for invokedynamic
   12.19      }
   12.20  
   12.21      private static final boolean hexFloatsWork = hexFloatsWork();
   12.22 @@ -295,7 +290,7 @@
   12.23  
   12.24      /** Read next character in character or string literal and copy into sbuf.
   12.25       */
   12.26 -    private void scanLitChar(boolean forBytecodeName) {
   12.27 +    private void scanLitChar() {
   12.28          if (ch == '\\') {
   12.29              if (buf[bp+1] == '\\' && unicodeConversionBp != bp) {
   12.30                  bp++;
   12.31 @@ -335,18 +330,6 @@
   12.32                      putChar('\"'); scanChar(); break;
   12.33                  case '\\':
   12.34                      putChar('\\'); scanChar(); break;
   12.35 -                case '|': case ',': case '?': case '%':
   12.36 -                case '^': case '_': case '{': case '}':
   12.37 -                case '!': case '-': case '=':
   12.38 -                    if (forBytecodeName) {
   12.39 -                        // Accept escape sequences for dangerous bytecode chars.
   12.40 -                        // This is illegal in normal Java string or character literals.
   12.41 -                        // Note that the escape sequence itself is passed through.
   12.42 -                        putChar('\\'); putChar(ch); scanChar();
   12.43 -                    } else {
   12.44 -                        lexError(bp, "illegal.esc.char");
   12.45 -                    }
   12.46 -                    break;
   12.47                  default:
   12.48                      lexError(bp, "illegal.esc.char");
   12.49                  }
   12.50 @@ -355,24 +338,6 @@
   12.51              putChar(ch); scanChar();
   12.52          }
   12.53      }
   12.54 -    private void scanLitChar() {
   12.55 -        scanLitChar(false);
   12.56 -    }
   12.57 -
   12.58 -    /** Read next character in an exotic name #"foo"
   12.59 -     */
   12.60 -    private void scanBytecodeNameChar() {
   12.61 -        switch (ch) {
   12.62 -        // reject any "dangerous" char which is illegal somewhere in the JVM spec
   12.63 -        // cf. http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm
   12.64 -        case '/': case '.': case ';':  // illegal everywhere
   12.65 -        case '<': case '>':  // illegal in methods, dangerous in classes
   12.66 -        case '[':  // illegal in classes
   12.67 -            lexError(bp, "illegal.bytecode.ident.char", String.valueOf((int)ch));
   12.68 -            break;
   12.69 -        }
   12.70 -        scanLitChar(true);
   12.71 -    }
   12.72  
   12.73      private void scanDigits(int digitRadix) {
   12.74          char saveCh;
   12.75 @@ -970,30 +935,6 @@
   12.76                          lexError(pos, "unclosed.str.lit");
   12.77                      }
   12.78                      return;
   12.79 -                case '#':
   12.80 -                    scanChar();
   12.81 -                    if (ch == '\"') {
   12.82 -                        if (!allowExoticIdentifiers) {
   12.83 -                            lexError("unsupported.exotic.id", source.name);
   12.84 -                            allowExoticIdentifiers = true;
   12.85 -                        }
   12.86 -                        scanChar();
   12.87 -                        if (ch == '\"')
   12.88 -                            lexError(pos, "empty.bytecode.ident");
   12.89 -                        while (ch != '\"' && ch != CR && ch != LF && bp < buflen) {
   12.90 -                            scanBytecodeNameChar();
   12.91 -                        }
   12.92 -                        if (ch == '\"') {
   12.93 -                            name = names.fromChars(sbuf, 0, sp);
   12.94 -                            token = IDENTIFIER;  // even if #"int" or #"do"
   12.95 -                            scanChar();
   12.96 -                        } else {
   12.97 -                            lexError(pos, "unclosed.bytecode.ident");
   12.98 -                        }
   12.99 -                    } else {
  12.100 -                        lexError("illegal.char", String.valueOf((int)'#'));
  12.101 -                    }
  12.102 -                    return;
  12.103                  default:
  12.104                      if (isSpecial(ch)) {
  12.105                          scanOperator();
    13.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Dec 03 19:45:34 2010 -0800
    13.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Dec 06 20:35:49 2010 -0800
    13.3 @@ -153,8 +153,6 @@
    13.4  
    13.5  compiler.err.else.without.if=\
    13.6      ''else'' without ''if''
    13.7 -compiler.err.empty.bytecode.ident=\
    13.8 -    empty bytecode identifier
    13.9  compiler.err.empty.char.lit=\
   13.10      empty character literal
   13.11  compiler.err.encl.class.required=\
   13.12 @@ -201,8 +199,6 @@
   13.13  
   13.14  compiler.err.icls.cant.have.static.decl=\
   13.15      inner classes cannot have static declarations
   13.16 -compiler.err.illegal.bytecode.ident.char=\
   13.17 -    illegal bytecode identifier character: \\{0}
   13.18  compiler.err.illegal.char=\
   13.19      illegal character: \\{0}
   13.20  compiler.err.illegal.char.for.encoding=\
   13.21 @@ -472,8 +468,6 @@
   13.22  compiler.err.types.incompatible.diff.ret=\
   13.23      types {0} and {1} are incompatible; both define {2}, but with unrelated return types
   13.24  
   13.25 -compiler.err.unclosed.bytecode.ident=\
   13.26 -    unclosed bytecode identifier
   13.27  compiler.err.unclosed.char.lit=\
   13.28      unclosed character literal
   13.29  compiler.err.unclosed.comment=\
   13.30 @@ -770,6 +764,9 @@
   13.31  compiler.warn.static.not.qualified.by.type=\
   13.32      static {0} should be qualified by type name, {1}, instead of by an expression
   13.33  
   13.34 +compiler.warn.source.no.bootclasspath=\
   13.35 +    bootstrap class path not set in conjunction with -source {0}
   13.36 +
   13.37  # Warnings related to annotation processing
   13.38  compiler.warn.proc.package.does.not.exist=\
   13.39      package {0} does not exist
   13.40 @@ -1269,10 +1266,6 @@
   13.41      underscores in literals are not supported in -source {0}\n\
   13.42  (use -source 7 or higher to enable underscores in literals)
   13.43  
   13.44 -compiler.err.unsupported.exotic.id=\
   13.45 -    exotic identifiers #"___" are not supported in -source {0}\n\
   13.46 -(use -source 7 or higher to enable exotic identifiers)
   13.47 -
   13.48  compiler.err.try.with.resources.not.supported.in.source=\
   13.49      try-with-resources is not supported in -source {0}\n\
   13.50  (use -source 7 or higher to enable try-with-resources)
    14.1 --- a/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java	Fri Dec 03 19:45:34 2010 -0800
    14.2 +++ b/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java	Mon Dec 06 20:35:49 2010 -0800
    14.3 @@ -59,7 +59,7 @@
    14.4   * There are no references here to file-system specific objects such as
    14.5   * java.io.File or java.nio.file.Path.
    14.6   */
    14.7 -public class BaseFileManager {
    14.8 +public abstract class BaseFileManager {
    14.9      protected BaseFileManager(Charset charset) {
   14.10          this.charset = charset;
   14.11          byteBufferCache = new ByteBufferCache();
   14.12 @@ -163,6 +163,9 @@
   14.13          }
   14.14          return -1;
   14.15      }
   14.16 +
   14.17 +    public abstract boolean isDefaultBootClassPath();
   14.18 +
   14.19      // </editor-fold>
   14.20  
   14.21      // <editor-fold defaultstate="collapsed" desc="Encoding">
    15.1 --- a/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java	Fri Dec 03 19:45:34 2010 -0800
    15.2 +++ b/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java	Mon Dec 06 20:35:49 2010 -0800
    15.3 @@ -62,6 +62,7 @@
    15.4      private JavadocClassReader(Context context) {
    15.5          super(context, true);
    15.6          docenv = DocEnv.instance(context);
    15.7 +        preferSource = true;
    15.8      }
    15.9  
   15.10      /**
    16.1 --- a/test/tools/javac/6341866/T6341866.java	Fri Dec 03 19:45:34 2010 -0800
    16.2 +++ b/test/tools/javac/6341866/T6341866.java	Mon Dec 06 20:35:49 2010 -0800
    16.3 @@ -97,7 +97,7 @@
    16.4          processorServices.delete();
    16.5  
    16.6          List<String> opts = new ArrayList<String>();
    16.7 -        opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6"));
    16.8 +        opts.addAll(Arrays.asList("-d", ".", "-sourcepath", testSrc, "-classpath", testClasses, "-source", "1.6", "-Xlint:-options"));
    16.9          if (implicitType.opt != null)
   16.10              opts.add(implicitType.opt);
   16.11  
    17.1 --- a/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Fri Dec 03 19:45:34 2010 -0800
    17.2 +++ b/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Mon Dec 06 20:35:49 2010 -0800
    17.3 @@ -26,7 +26,7 @@
    17.4   * @bug 4249112 4785453
    17.5   * @summary Verify that implicit member modifiers are set correctly.
    17.6   *
    17.7 - * @compile/ref=MemberModifiers.out  -source 1.4 -target 1.4.2 -XDdumpmodifiers=cfm MemberModifiers.java
    17.8 + * @compile/ref=MemberModifiers.out  -source 1.4 -target 1.4.2 -Xlint:-options -XDdumpmodifiers=cfm MemberModifiers.java
    17.9   */
   17.10  
   17.11  // Currently, we check only that members of final classes are not final.
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/test/tools/javac/T6900037.java	Mon Dec 06 20:35:49 2010 -0800
    18.3 @@ -0,0 +1,34 @@
    18.4 +/*
    18.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    18.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.7 + *
    18.8 + * This code is free software; you can redistribute it and/or modify it
    18.9 + * under the terms of the GNU General Public License version 2 only, as
   18.10 + * published by the Free Software Foundation.
   18.11 + *
   18.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   18.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   18.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   18.15 + * version 2 for more details (a copy is included in the LICENSE file that
   18.16 + * accompanied this code).
   18.17 + *
   18.18 + * You should have received a copy of the GNU General Public License version
   18.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   18.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18.21 + *
   18.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   18.23 + * or visit www.oracle.com if you need additional information or have any
   18.24 + * questions.
   18.25 + */
   18.26 +
   18.27 +/*
   18.28 + * @test
   18.29 + * @bug 6900037
   18.30 + * @summary javac should warn if earlier -source is used and bootclasspath not set
   18.31 + * @compile T6900037.java
   18.32 + * @compile -source 1.6 T6900037.java
   18.33 + * @compile/fail/ref=T6900037.out -XDrawDiagnostics -Werror -source 1.6 T6900037.java
   18.34 + * @compile -Werror -source 1.6 -Xlint:-options T6900037.java
   18.35 + */
   18.36 +
   18.37 +class T6900037 { }
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/test/tools/javac/T6900037.out	Mon Dec 06 20:35:49 2010 -0800
    19.3 @@ -0,0 +1,4 @@
    19.4 +- compiler.warn.source.no.bootclasspath: 1.6
    19.5 +- compiler.err.warnings.and.werror
    19.6 +1 error
    19.7 +1 warning
    20.1 --- a/test/tools/javac/TryWithResources/PlainTry.java	Fri Dec 03 19:45:34 2010 -0800
    20.2 +++ b/test/tools/javac/TryWithResources/PlainTry.java	Mon Dec 06 20:35:49 2010 -0800
    20.3 @@ -3,8 +3,8 @@
    20.4   * @bug 6911256 6964740
    20.5   * @author Joseph D. Darcy
    20.6   * @summary Test error messages for an unadorned try
    20.7 - * @compile/fail/ref=PlainTry6.out -XDrawDiagnostics -source 6 PlainTry.java
    20.8 - * @compile/fail/ref=PlainTry.out  -XDrawDiagnostics           PlainTry.java
    20.9 + * @compile/fail/ref=PlainTry6.out -XDrawDiagnostics -source 6 -Xlint:-options PlainTry.java
   20.10 + * @compile/fail/ref=PlainTry.out  -XDrawDiagnostics                           PlainTry.java
   20.11   */
   20.12  public class PlainTry {
   20.13      public static void main(String... args) {
    21.1 --- a/test/tools/javac/annotations/neg/Dep.java	Fri Dec 03 19:45:34 2010 -0800
    21.2 +++ b/test/tools/javac/annotations/neg/Dep.java	Mon Dec 06 20:35:49 2010 -0800
    21.3 @@ -27,9 +27,9 @@
    21.4   * @summary Please add annotation <at>Deprecated to supplant the javadoc tag
    21.5   * @author gafter
    21.6   *
    21.7 - * @compile      -source 1.4 -Xlint:dep-ann -Werror Dep.java
    21.8 - * @compile/fail             -Xlint:dep-ann -Werror Dep.java
    21.9 - * @compile                  -Xlint:dep-ann         Dep.java
   21.10 + * @compile      -source 1.4 -Xlint:-options -Xlint:dep-ann -Werror Dep.java
   21.11 + * @compile/fail                             -Xlint:dep-ann -Werror Dep.java
   21.12 + * @compile                                  -Xlint:dep-ann         Dep.java
   21.13   */
   21.14  
   21.15  /** @deprecated */
    22.1 --- a/test/tools/javac/diags/examples/AnnotationsNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    22.2 +++ b/test/tools/javac/diags/examples/AnnotationsNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    22.3 @@ -22,7 +22,7 @@
    22.4   */
    22.5  
    22.6  // key: compiler.err.annotations.not.supported.in.source
    22.7 -// options: -source 1.4
    22.8 +// options: -source 1.4 -Xlint:-options
    22.9  
   22.10  @Deprecated
   22.11  class AnnotationsNotSupported { }
    23.1 --- a/test/tools/javac/diags/examples/AssertAsIdentifier.java	Fri Dec 03 19:45:34 2010 -0800
    23.2 +++ b/test/tools/javac/diags/examples/AssertAsIdentifier.java	Mon Dec 06 20:35:49 2010 -0800
    23.3 @@ -22,7 +22,7 @@
    23.4   */
    23.5  
    23.6  // key: compiler.warn.assert.as.identifier
    23.7 -// options: -source 1.3
    23.8 +// options: -source 1.3 -Xlint:-options
    23.9  
   23.10  class AssertAsIdentifier {
   23.11      int assert;
    24.1 --- a/test/tools/javac/diags/examples/DiamondNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    24.2 +++ b/test/tools/javac/diags/examples/DiamondNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    24.3 @@ -22,7 +22,7 @@
    24.4   */
    24.5  
    24.6  // key: compiler.err.diamond.not.supported.in.source
    24.7 -// options: -source 6
    24.8 +// options: -source 6 -Xlint:-options
    24.9  
   24.10  import java.util.*;
   24.11  
    25.1 --- a/test/tools/javac/diags/examples/EmptyBytecodeIdent.java	Fri Dec 03 19:45:34 2010 -0800
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,28 +0,0 @@
    25.4 -/*
    25.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    25.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    25.7 - *
    25.8 - * This code is free software; you can redistribute it and/or modify it
    25.9 - * under the terms of the GNU General Public License version 2 only, as
   25.10 - * published by the Free Software Foundation.
   25.11 - *
   25.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   25.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   25.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   25.15 - * version 2 for more details (a copy is included in the LICENSE file that
   25.16 - * accompanied this code).
   25.17 - *
   25.18 - * You should have received a copy of the GNU General Public License version
   25.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   25.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   25.21 - *
   25.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   25.23 - * or visit www.oracle.com if you need additional information or have any
   25.24 - * questions.
   25.25 - */
   25.26 -
   25.27 -// key: compiler.err.empty.bytecode.ident
   25.28 -
   25.29 -class EmptyBytecodeIdent {
   25.30 -    int #"" = 3;
   25.31 -}
    26.1 --- a/test/tools/javac/diags/examples/EnumAsIdentifier.java	Fri Dec 03 19:45:34 2010 -0800
    26.2 +++ b/test/tools/javac/diags/examples/EnumAsIdentifier.java	Mon Dec 06 20:35:49 2010 -0800
    26.3 @@ -22,7 +22,7 @@
    26.4   */
    26.5  
    26.6  // key: compiler.warn.enum.as.identifier
    26.7 -// options: -source 1.3
    26.8 +// options: -source 1.3 -Xlint:-options
    26.9  
   26.10  class EnumAsIdentifier {
   26.11      int enum;
    27.1 --- a/test/tools/javac/diags/examples/EnumsNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    27.2 +++ b/test/tools/javac/diags/examples/EnumsNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    27.3 @@ -22,6 +22,6 @@
    27.4   */
    27.5  
    27.6  // key: compiler.err.enums.not.supported.in.source
    27.7 -// options: -source 1.4
    27.8 +// options: -source 1.4 -Xlint:-options
    27.9  
   27.10  enum EnumsNotSupported { A, B, C }
    28.1 --- a/test/tools/javac/diags/examples/Expected2.java	Fri Dec 03 19:45:34 2010 -0800
    28.2 +++ b/test/tools/javac/diags/examples/Expected2.java	Mon Dec 06 20:35:49 2010 -0800
    28.3 @@ -22,6 +22,6 @@
    28.4   */
    28.5  
    28.6  // key: compiler.err.expected2
    28.7 -// options: -source 1.4
    28.8 +// options: -source 1.4 -Xlint:-options
    28.9  
   28.10  int Expected2;
    29.1 --- a/test/tools/javac/diags/examples/ForeachNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    29.2 +++ b/test/tools/javac/diags/examples/ForeachNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    29.3 @@ -22,7 +22,7 @@
    29.4   */
    29.5  
    29.6  // key: compiler.err.foreach.not.supported.in.source
    29.7 -// options: -source 1.4
    29.8 +// options: -source 1.4 -Xlint:-options
    29.9  
   29.10  class ForeachNotSupported {
   29.11      void m(String[] args) {
    30.1 --- a/test/tools/javac/diags/examples/GenericsNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    30.2 +++ b/test/tools/javac/diags/examples/GenericsNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    30.3 @@ -22,6 +22,6 @@
    30.4   */
    30.5  
    30.6  // key: compiler.err.generics.not.supported.in.source
    30.7 -// options: -source 1.4
    30.8 +// options: -source 1.4 -Xlint:-options
    30.9  
   30.10  class GenericsNotSupported<T> { }
    31.1 --- a/test/tools/javac/diags/examples/IllegalBytecodeIdentChar.java	Fri Dec 03 19:45:34 2010 -0800
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,28 +0,0 @@
    31.4 -/*
    31.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    31.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    31.7 - *
    31.8 - * This code is free software; you can redistribute it and/or modify it
    31.9 - * under the terms of the GNU General Public License version 2 only, as
   31.10 - * published by the Free Software Foundation.
   31.11 - *
   31.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   31.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   31.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   31.15 - * version 2 for more details (a copy is included in the LICENSE file that
   31.16 - * accompanied this code).
   31.17 - *
   31.18 - * You should have received a copy of the GNU General Public License version
   31.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   31.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   31.21 - *
   31.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   31.23 - * or visit www.oracle.com if you need additional information or have any
   31.24 - * questions.
   31.25 - */
   31.26 -
   31.27 -// key: compiler.err.illegal.bytecode.ident.char
   31.28 -
   31.29 -class IllegalBytecodeIdentChar {
   31.30 -    int #"abc/def" = 3;
   31.31 -}
    32.1 --- a/test/tools/javac/diags/examples/MulticatchNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    32.2 +++ b/test/tools/javac/diags/examples/MulticatchNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    32.3 @@ -22,7 +22,7 @@
    32.4   */
    32.5  
    32.6  // key: compiler.err.multicatch.not.supported.in.source
    32.7 -// options: -source 1.6
    32.8 +// options: -source 1.6 -Xlint:-options
    32.9  
   32.10  class MulticatchNotSupported {
   32.11      class E1 extends Exception { }
    33.1 --- a/test/tools/javac/diags/examples/NeitherConditionalSubtype.java	Fri Dec 03 19:45:34 2010 -0800
    33.2 +++ b/test/tools/javac/diags/examples/NeitherConditionalSubtype.java	Mon Dec 06 20:35:49 2010 -0800
    33.3 @@ -22,7 +22,7 @@
    33.4   */
    33.5  
    33.6  // key: compiler.err.neither.conditional.subtype
    33.7 -// options: -source 1.4
    33.8 +// options: -source 1.4 -Xlint:-options
    33.9  
   33.10  class X {
   33.11      Object m(boolean b) {
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/test/tools/javac/diags/examples/SourceNoBootclasspath.java	Mon Dec 06 20:35:49 2010 -0800
    34.3 @@ -0,0 +1,27 @@
    34.4 +/*
    34.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    34.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    34.7 + *
    34.8 + * This code is free software; you can redistribute it and/or modify it
    34.9 + * under the terms of the GNU General Public License version 2 only, as
   34.10 + * published by the Free Software Foundation.
   34.11 + *
   34.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   34.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   34.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   34.15 + * version 2 for more details (a copy is included in the LICENSE file that
   34.16 + * accompanied this code).
   34.17 + *
   34.18 + * You should have received a copy of the GNU General Public License version
   34.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   34.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   34.21 + *
   34.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   34.23 + * or visit www.oracle.com if you need additional information or have any
   34.24 + * questions.
   34.25 + */
   34.26 +
   34.27 +// key: compiler.warn.source.no.bootclasspath
   34.28 +// options: -source 6
   34.29 +
   34.30 +class SourceNoBootclasspath { }
    35.1 --- a/test/tools/javac/diags/examples/StaticImportNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    35.2 +++ b/test/tools/javac/diags/examples/StaticImportNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    35.3 @@ -22,7 +22,7 @@
    35.4   */
    35.5  
    35.6  // key: compiler.err.static.import.not.supported.in.source
    35.7 -// options: -source 1.4
    35.8 +// options: -source 1.4 -Xlint:-options
    35.9  
   35.10  import static java.util.regex.Pattern.*;
   35.11  
    36.1 --- a/test/tools/javac/diags/examples/StringSwitchNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    36.2 +++ b/test/tools/javac/diags/examples/StringSwitchNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    36.3 @@ -22,7 +22,7 @@
    36.4   */
    36.5  
    36.6  // key: compiler.err.string.switch.not.supported.in.source
    36.7 -// options: -source 6
    36.8 +// options: -source 6 -Xlint:-options
    36.9  
   36.10  class StringSwitchNotSupported {
   36.11      int m(String s) {
    37.1 --- a/test/tools/javac/diags/examples/TryResourceNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    37.2 +++ b/test/tools/javac/diags/examples/TryResourceNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    37.3 @@ -22,7 +22,7 @@
    37.4   */
    37.5  
    37.6  // key: compiler.err.try.with.resources.not.supported.in.source
    37.7 -// options: -source 1.6
    37.8 +// options: -source 1.6 -Xlint:-options
    37.9  
   37.10  import java.io.*;
   37.11  
    38.1 --- a/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java	Fri Dec 03 19:45:34 2010 -0800
    38.2 +++ b/test/tools/javac/diags/examples/TryWithoutCatchOrFinally.java	Mon Dec 06 20:35:49 2010 -0800
    38.3 @@ -22,7 +22,7 @@
    38.4   */
    38.5  
    38.6  // key: compiler.err.try.without.catch.or.finally
    38.7 -// options: -source 1.6
    38.8 +// options: -source 1.6 -Xlint:-options
    38.9  
   38.10  class TryWithoutCatchOrFinally {
   38.11      void m() {
    39.1 --- a/test/tools/javac/diags/examples/UnclosedBytecodeIdent.java	Fri Dec 03 19:45:34 2010 -0800
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,28 +0,0 @@
    39.4 -/*
    39.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    39.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    39.7 - *
    39.8 - * This code is free software; you can redistribute it and/or modify it
    39.9 - * under the terms of the GNU General Public License version 2 only, as
   39.10 - * published by the Free Software Foundation.
   39.11 - *
   39.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   39.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   39.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   39.15 - * version 2 for more details (a copy is included in the LICENSE file that
   39.16 - * accompanied this code).
   39.17 - *
   39.18 - * You should have received a copy of the GNU General Public License version
   39.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   39.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   39.21 - *
   39.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   39.23 - * or visit www.oracle.com if you need additional information or have any
   39.24 - * questions.
   39.25 - */
   39.26 -
   39.27 -// key: compiler.err.unclosed.bytecode.ident
   39.28 -
   39.29 -class UnclosedBytecodeIdent {
   39.30 -    int #"abc
   39.31 -}
    40.1 --- a/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java	Fri Dec 03 19:45:34 2010 -0800
    40.2 +++ b/test/tools/javac/diags/examples/UnsupportedBinaryLiteral.java	Mon Dec 06 20:35:49 2010 -0800
    40.3 @@ -22,7 +22,7 @@
    40.4   */
    40.5  
    40.6  // key: compiler.err.unsupported.binary.lit
    40.7 -// options: -source 6
    40.8 +// options: -source 6 -Xlint:-options
    40.9  
   40.10  class UnsupportedBinaryLiteral {
   40.11      int i = 0b01000010;
    41.1 --- a/test/tools/javac/diags/examples/UnsupportedExoticID.java	Fri Dec 03 19:45:34 2010 -0800
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,31 +0,0 @@
    41.4 -/*
    41.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    41.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    41.7 - *
    41.8 - * This code is free software; you can redistribute it and/or modify it
    41.9 - * under the terms of the GNU General Public License version 2 only, as
   41.10 - * published by the Free Software Foundation.
   41.11 - *
   41.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   41.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   41.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   41.15 - * version 2 for more details (a copy is included in the LICENSE file that
   41.16 - * accompanied this code).
   41.17 - *
   41.18 - * You should have received a copy of the GNU General Public License version
   41.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   41.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   41.21 - *
   41.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   41.23 - * or visit www.oracle.com if you need additional information or have any
   41.24 - * questions.
   41.25 - */
   41.26 -
   41.27 -// key: compiler.err.unsupported.exotic.id
   41.28 -// options: -source 6
   41.29 -
   41.30 -class UnsupportedExoticID {
   41.31 -    void m() {
   41.32 -        Object #"Hello!" = null;
   41.33 -    }
   41.34 -}
    42.1 --- a/test/tools/javac/diags/examples/UnsupportedFpLit.java	Fri Dec 03 19:45:34 2010 -0800
    42.2 +++ b/test/tools/javac/diags/examples/UnsupportedFpLit.java	Mon Dec 06 20:35:49 2010 -0800
    42.3 @@ -22,7 +22,7 @@
    42.4   */
    42.5  
    42.6  // key: compiler.err.unsupported.fp.lit
    42.7 -// options: -source 1.4
    42.8 +// options: -source 1.4 -Xlint:-options
    42.9  
   42.10  class UnsupportedFpLit {
   42.11      float f = 0xCafe.BabeP1;
    43.1 --- a/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java	Fri Dec 03 19:45:34 2010 -0800
    43.2 +++ b/test/tools/javac/diags/examples/UnsupportedUnderscoreLiteral.java	Mon Dec 06 20:35:49 2010 -0800
    43.3 @@ -22,7 +22,7 @@
    43.4   */
    43.5  
    43.6  // key: compiler.err.unsupported.underscore.lit
    43.7 -// options: -source 6
    43.8 +// options: -source 6 -Xlint:-options
    43.9  
   43.10  class UnsupportedUnderscoreLiteral {
   43.11      int i = 123_456_789;
    44.1 --- a/test/tools/javac/diags/examples/VarargsNotSupported.java	Fri Dec 03 19:45:34 2010 -0800
    44.2 +++ b/test/tools/javac/diags/examples/VarargsNotSupported.java	Mon Dec 06 20:35:49 2010 -0800
    44.3 @@ -22,7 +22,7 @@
    44.4   */
    44.5  
    44.6  // key: compiler.err.varargs.not.supported.in.source
    44.7 -// options: -source 1.4
    44.8 +// options: -source 1.4 -Xlint:-options
    44.9  
   44.10  class VarargsNotSupported {
   44.11      void m(String... args) { }
    45.1 --- a/test/tools/javac/enum/6384542/T6384542.java	Fri Dec 03 19:45:34 2010 -0800
    45.2 +++ b/test/tools/javac/enum/6384542/T6384542.java	Mon Dec 06 20:35:49 2010 -0800
    45.3 @@ -3,8 +3,8 @@
    45.4   * @bug     6384542
    45.5   * @summary crash: test/tools/javac/versions/check.sh
    45.6   * @author  Peter von der Ah\u00e9
    45.7 - * @compile/fail -source 1.4 T6384542.java
    45.8 - * @compile/fail/ref=T6384542.out -source 1.4 -XDrawDiagnostics T6384542.java
    45.9 + * @compile/fail -source 1.4 -Xlint:-options T6384542.java
   45.10 + * @compile/fail/ref=T6384542.out -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542.java
   45.11   */
   45.12  
   45.13  import static java.lang.Math.sin;
    46.1 --- a/test/tools/javac/enum/6384542/T6384542a.java	Fri Dec 03 19:45:34 2010 -0800
    46.2 +++ b/test/tools/javac/enum/6384542/T6384542a.java	Mon Dec 06 20:35:49 2010 -0800
    46.3 @@ -5,8 +5,8 @@
    46.4   * @author  Peter von der Ah\u00e9
    46.5   * @compile/fail -source 5   T6384542a.java
    46.6   * @compile      -source 1.4 T6384542a.java
    46.7 - * @compile/fail/ref=T6384542a_5.out -source 5   -XDrawDiagnostics T6384542a.java
    46.8 - * @compile/ref=T6384542a_1_4.out    -source 1.4 -XDrawDiagnostics T6384542a.java
    46.9 + * @compile/fail/ref=T6384542a_5.out -source 5   -Xlint:-options -XDrawDiagnostics T6384542a.java
   46.10 + * @compile/ref=T6384542a_1_4.out    -source 1.4 -Xlint:-options -XDrawDiagnostics T6384542a.java
   46.11   */
   46.12  
   46.13  public class T6384542a {
    47.1 --- a/test/tools/javac/generics/inference/6638712/T6638712a.java	Fri Dec 03 19:45:34 2010 -0800
    47.2 +++ b/test/tools/javac/generics/inference/6638712/T6638712a.java	Mon Dec 06 20:35:49 2010 -0800
    47.3 @@ -10,7 +10,7 @@
    47.4  
    47.5  class T6638712a {
    47.6  
    47.7 -    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) {}
    47.8 +    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) { return null; }
    47.9  
   47.10      public void test(List<Comparator<?>> x) {
   47.11          Comparator<String> c3 = compound(x);
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/test/tools/javac/generics/inference/6995200/T6995200.java	Mon Dec 06 20:35:49 2010 -0800
    48.3 @@ -0,0 +1,67 @@
    48.4 +/*
    48.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    48.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    48.7 + *
    48.8 + * This code is free software; you can redistribute it and/or modify it
    48.9 + * under the terms of the GNU General Public License version 2 only, as
   48.10 + * published by the Free Software Foundation.
   48.11 + *
   48.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   48.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   48.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   48.15 + * version 2 for more details (a copy is included in the LICENSE file that
   48.16 + * accompanied this code).
   48.17 + *
   48.18 + * You should have received a copy of the GNU General Public License version
   48.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   48.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   48.21 + *
   48.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   48.23 + * or visit www.oracle.com if you need additional information or have any
   48.24 + * questions.
   48.25 + */
   48.26 +
   48.27 +/*
   48.28 + * @test
   48.29 + * @bug 6995200
   48.30 + *
   48.31 + * @summary JDK 7 compiler crashes when type-variable is inferred from expected primitive type
   48.32 + * @author mcimadamore
   48.33 + * @compile T6995200.java
   48.34 + *
   48.35 + */
   48.36 +
   48.37 +import java.util.List;
   48.38 +
   48.39 +class T6995200 {
   48.40 +    static <T> T getValue() {
   48.41 +        return null;
   48.42 +    }
   48.43 +
   48.44 +    <X> void test() {
   48.45 +        byte v1 = getValue();
   48.46 +        short v2 = getValue();
   48.47 +        int v3 = getValue();
   48.48 +        long v4 = getValue();
   48.49 +        float v5 = getValue();
   48.50 +        double v6 = getValue();
   48.51 +        String v7 = getValue();
   48.52 +        String[] v8 = getValue();
   48.53 +        List<String> v9 = getValue();
   48.54 +        List<String>[] v10 = getValue();
   48.55 +        List<? extends String> v11 = getValue();
   48.56 +        List<? extends String>[] v12 = getValue();
   48.57 +        List<? super String> v13 = getValue();
   48.58 +        List<? super String>[] v14 = getValue();
   48.59 +        List<?> v15 = getValue();
   48.60 +        List<?>[] v16 = getValue();
   48.61 +        X v17 = getValue();
   48.62 +        X[] v18 = getValue();
   48.63 +        List<X> v19 = getValue();
   48.64 +        List<X>[] v20 = getValue();
   48.65 +        List<? extends X> v21 = getValue();
   48.66 +        List<? extends X>[] v22 = getValue();
   48.67 +        List<? super X> v23 = getValue();
   48.68 +        List<? super X>[] v24 = getValue();
   48.69 +    }
   48.70 +}
    49.1 --- a/test/tools/javac/literals/BadBinaryLiterals.java	Fri Dec 03 19:45:34 2010 -0800
    49.2 +++ b/test/tools/javac/literals/BadBinaryLiterals.java	Mon Dec 06 20:35:49 2010 -0800
    49.3 @@ -2,7 +2,7 @@
    49.4   * @test /nodynamiccopyright/
    49.5   * @bug 6860965
    49.6   * @summary Project Coin: binary literals
    49.7 - * @compile/fail/ref=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 BadBinaryLiterals.java
    49.8 + * @compile/fail/ref=BadBinaryLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options BadBinaryLiterals.java
    49.9   * @compile/fail/ref=BadBinaryLiterals.7.out -XDrawDiagnostics BadBinaryLiterals.java
   49.10   */
   49.11  
    50.1 --- a/test/tools/javac/literals/BadUnderscoreLiterals.java	Fri Dec 03 19:45:34 2010 -0800
    50.2 +++ b/test/tools/javac/literals/BadUnderscoreLiterals.java	Mon Dec 06 20:35:49 2010 -0800
    50.3 @@ -7,7 +7,7 @@
    50.4   * @compile/fail/ref=BadUnderscoreLiterals.7.out -XDrawDiagnostics BadUnderscoreLiterals.java
    50.5   *
    50.6   * @compile/fail -source 6 BadUnderscoreLiterals.java
    50.7 - * @compile/fail/ref=BadUnderscoreLiterals.6.out -XDrawDiagnostics -source 6 BadUnderscoreLiterals.java
    50.8 + * @compile/fail/ref=BadUnderscoreLiterals.6.out -XDrawDiagnostics -source 6 -Xlint:-options BadUnderscoreLiterals.java
    50.9   */
   50.10  
   50.11  public class BadUnderscoreLiterals {
    51.1 --- a/test/tools/javac/meth/InvokeDyn.java	Fri Dec 03 19:45:34 2010 -0800
    51.2 +++ b/test/tools/javac/meth/InvokeDyn.java	Mon Dec 06 20:35:49 2010 -0800
    51.3 @@ -58,7 +58,7 @@
    51.4          ojunk = InvokeDynamic.greet(x, "mundus", 456);
    51.5          ojunk = InvokeDynamic.greet(x, "kosmos", 789);
    51.6          ojunk = (String) InvokeDynamic.cogitate(10.11121, 3.14);
    51.7 -        InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null);
    51.8 +        //InvokeDynamic.#"yow: what I mean to say is, please treat this one specially"(null);
    51.9          ijunk = (int) InvokeDynamic.invoke("goodbye");
   51.10      }
   51.11  }
    52.1 --- a/test/tools/javac/meth/InvokeDynTrans.java	Fri Dec 03 19:45:34 2010 -0800
    52.2 +++ b/test/tools/javac/meth/InvokeDynTrans.java	Mon Dec 06 20:35:49 2010 -0800
    52.3 @@ -1,5 +1,5 @@
    52.4  /*
    52.5 - * Copyright (c) 2008-2010, Oracle and/or its affiliates. All rights reserved.
    52.6 + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
    52.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    52.8   *
    52.9   * This code is free software; you can redistribute it and/or modify it
   52.10 @@ -53,7 +53,7 @@
   52.11          InvokeDynamic.greet(x, "mundus", 456);
   52.12          InvokeDynamic.greet(x, "kosmos", 789);
   52.13          InvokeDynamic.<String>cogitate(10.11121, 3.14);
   52.14 -        InvokeDynamic.<void>#"yow: what I mean to say is, please treat this one specially"(null);
   52.15 +        //InvokeDynamic.<void>#"yow: what I mean to say is, please treat this one specially"(null);
   52.16          InvokeDynamic.<int>invoke("goodbye");
   52.17      }
   52.18  }
    53.1 --- a/test/tools/javac/meth/InvokeDynTrans.out	Fri Dec 03 19:45:34 2010 -0800
    53.2 +++ b/test/tools/javac/meth/InvokeDynTrans.out	Mon Dec 06 20:35:49 2010 -0800
    53.3 @@ -1,6 +1,5 @@
    53.4  InvokeDynTrans.java:55:39: compiler.warn.type.parameter.on.polymorphic.signature
    53.5 -InvokeDynTrans.java:56:91: compiler.warn.type.parameter.on.polymorphic.signature
    53.6  InvokeDynTrans.java:57:34: compiler.warn.type.parameter.on.polymorphic.signature
    53.7  - compiler.err.warnings.and.werror
    53.8  1 error
    53.9 -3 warnings
   53.10 +2 warnings
    54.1 --- a/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java	Fri Dec 03 19:45:34 2010 -0800
    54.2 +++ b/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java	Mon Dec 06 20:35:49 2010 -0800
    54.3 @@ -27,15 +27,15 @@
    54.4   * @summary Test that warnings about source versions are output as expected.
    54.5   * @author  Joseph D. Darcy
    54.6   * @compile TestSourceVersionWarnings.java
    54.7 - * @compile/ref=gold_0.out             -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only                           -source 1.5 HelloWorld.java
    54.8 - * @compile/ref=gold_sv_warn_0_2.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 HelloWorld.java
    54.9 - * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.2 HelloWorld.java
   54.10 - * @compile/ref=gold_sv_warn_2_3.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 HelloWorld.java
   54.11 - * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 HelloWorld.java
   54.12 - * @compile/ref=gold_sv_warn_5_6.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 HelloWorld.java
   54.13 - * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 HelloWorld.java
   54.14 - * @compile/ref=gold_unsp_warn.out     -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Aunsupported HelloWorld.java
   54.15 - * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 HelloWorld.java
   54.16 + * @compile/ref=gold_0.out             -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only                           -source 1.5 -Xlint:-options HelloWorld.java
   54.17 + * @compile/ref=gold_sv_warn_0_2.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 -Xlint:-options HelloWorld.java
   54.18 + * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.2 -Xlint:-options HelloWorld.java
   54.19 + * @compile/ref=gold_sv_warn_2_3.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 -Xlint:-options HelloWorld.java
   54.20 + * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 -Xlint:-options HelloWorld.java
   54.21 + * @compile/ref=gold_sv_warn_5_6.out   -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 -Xlint:-options HelloWorld.java
   54.22 + * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java
   54.23 + * @compile/ref=gold_unsp_warn.out     -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java
   54.24 + * @compile/ref=gold_sv_none.out       -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7                 HelloWorld.java
   54.25   */
   54.26  
   54.27  import java.util.Set;
    55.1 --- a/test/tools/javac/quid/QuotedIdent.java	Fri Dec 03 19:45:34 2010 -0800
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,136 +0,0 @@
    55.4 -/*
    55.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
    55.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    55.7 - *
    55.8 - * This code is free software; you can redistribute it and/or modify it
    55.9 - * under the terms of the GNU General Public License version 2 only, as
   55.10 - * published by the Free Software Foundation.
   55.11 - *
   55.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   55.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   55.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   55.15 - * version 2 for more details (a copy is included in the LICENSE file that
   55.16 - * accompanied this code).
   55.17 - *
   55.18 - * You should have received a copy of the GNU General Public License version
   55.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   55.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   55.21 - *
   55.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   55.23 - * or visit www.oracle.com if you need additional information or have any
   55.24 - * questions.
   55.25 - */
   55.26 -
   55.27 -/*
   55.28 - * @test
   55.29 - * @bug 6746458
   55.30 - * @summary Verify correct lexing of quoted identifiers.
   55.31 - * @author jrose
   55.32 - * @ignore 6877225 test fails on Windows:
   55.33 - *      QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class
   55.34 - *      (The filename, directory name, or volume label syntax is incorrect)
   55.35 - *
   55.36 - * @library ..
   55.37 - * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java
   55.38 - * @run main quid.QuotedIdent
   55.39 - */
   55.40 -
   55.41 -/*
   55.42 - * Standalone testing:
   55.43 - * <code>
   55.44 - * $ cd $MY_REPO_DIR/langtools
   55.45 - * $ (cd make; make)
   55.46 - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java
   55.47 - * $ java -version  # should print 1.6 or later
   55.48 - * $ java -cp dist quid.QuotedIdent
   55.49 - * </code>
   55.50 - */
   55.51 -
   55.52 -package quid;
   55.53 -
   55.54 -public class QuotedIdent {
   55.55 -    static void check(int testid, String have, String expect)
   55.56 -                throws RuntimeException {
   55.57 -        if ((have == null && have != expect) ||
   55.58 -                (have != null && !have.equals(expect))) {
   55.59 -            String msg =
   55.60 -                "TEST " + testid + ": HAVE \"" +
   55.61 -                have + "\" EXPECT \"" + expect + "\"";
   55.62 -            System.out.println("StringConversion: " + msg);
   55.63 -            throw new RuntimeException(msg);
   55.64 -        }
   55.65 -    }
   55.66 -
   55.67 -    // negative tests:
   55.68 -    //static class #"" { } //BAD empty ident name
   55.69 -    //static class #"<foo>" { } //BAD bad char in ident name
   55.70 -    /*static class /*(//BAD ident name interrupted by newline) #"jump:
   55.71 -    " { } /* uncomment previous line to attempt class w/ bad name */
   55.72 -
   55.73 -    static class #"int" extends Number {
   55.74 -        final int #"int";
   55.75 -        #"int"(int #"int") {
   55.76 -            this.#"int" = #"int";
   55.77 -        }
   55.78 -        static #"int" valueOf(int #"int") {
   55.79 -            return new #"int"(#"int");
   55.80 -        }
   55.81 -        public int intValue() { return #"int"; }
   55.82 -        public long longValue() { return #"int"; }
   55.83 -        public float floatValue() { return #"int"; }
   55.84 -        public double doubleValue() { return #"int"; }
   55.85 -        public String toString() { return String.valueOf(#"int"); }
   55.86 -    }
   55.87 -
   55.88 -    class #"*86" {
   55.89 -        String #"555-1212"() { return "[*86.555-1212]"; }
   55.90 -    }
   55.91 -    static#"*86"#"MAKE-*86"() {   // note close spacing
   55.92 -        return new QuotedIdent().new#"*86"();
   55.93 -    }
   55.94 -
   55.95 -    static String bar() { return "[bar]"; }
   55.96 -
   55.97 -    public static void main(String[] args) throws Exception {
   55.98 -        String s;
   55.99 -
  55.100 -        String #"sticky \' wicket" = "wicked ' stick";
  55.101 -        s = #"sticky ' wicket";
  55.102 -        check(11, s, "wicked \' stick");
  55.103 -        check(12, #"s", s);
  55.104 -        check(13, #"\163", s);
  55.105 -
  55.106 -        s = #"QuotedIdent".bar();
  55.107 -        check(21, s, "[bar]");
  55.108 -
  55.109 -        s = #"int".valueOf(123).toString();
  55.110 -        check(22, s, "123");
  55.111 -
  55.112 -        s = #"MAKE-*86"().#"555-1212"();
  55.113 -        check(23, s, "[*86.555-1212]");
  55.114 -
  55.115 -        class#"{{{inmost}}}" { }
  55.116 -        s = new#"{{{inmost}}}"().getClass().getName();
  55.117 -        if (!s.endsWith("{{{inmost}}}"))
  55.118 -            check(24, s, "should end with \"{{{inmost}}}\"");
  55.119 -
  55.120 -        s = #"Yog-Shoggoth".#"(nameless ululation)";
  55.121 -        check(25, s, "Tekeli-li!");
  55.122 -
  55.123 -        s = #"int".class.getName();
  55.124 -        check(31, s, QuotedIdent.class.getName()+"$int");
  55.125 -
  55.126 -        Class<?> x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
  55.127 -        if (x86 != #"*86".class)
  55.128 -            check(32, "reflected "+x86, "static "+#"*86".class);
  55.129 -
  55.130 -        s = (String) x86.getDeclaredMethod("555-1212").invoke(#"MAKE-*86"());
  55.131 -        check(31, s, "[*86.555-1212]");
  55.132 -
  55.133 -        System.out.println("OK");
  55.134 -    }
  55.135 -}
  55.136 -
  55.137 -interface #"Yog-Shoggoth" {
  55.138 -    final String #"(nameless ululation)" = "Tekeli-li!";
  55.139 -}
    56.1 --- a/test/tools/javac/quid/QuotedIdent2.java	Fri Dec 03 19:45:34 2010 -0800
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,85 +0,0 @@
    56.4 -/*
    56.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
    56.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    56.7 - *
    56.8 - * This code is free software; you can redistribute it and/or modify it
    56.9 - * under the terms of the GNU General Public License version 2 only, as
   56.10 - * published by the Free Software Foundation.
   56.11 - *
   56.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   56.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   56.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   56.15 - * version 2 for more details (a copy is included in the LICENSE file that
   56.16 - * accompanied this code).
   56.17 - *
   56.18 - * You should have received a copy of the GNU General Public License version
   56.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   56.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   56.21 - *
   56.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   56.23 - * or visit www.oracle.com if you need additional information or have any
   56.24 - * questions.
   56.25 - */
   56.26 -
   56.27 -/*
   56.28 - * @test
   56.29 - * @bug 6746458
   56.30 - * @summary Verify correct separate compilation of classes with extended identifiers.
   56.31 - * @author jrose
   56.32 - * @ignore 6877225 test fails on Windows:
   56.33 - *      QuotedIdent.java:81: error while writing QuotedIdent.*86: PATH\QuotedIdent$*86.class
   56.34 - *      (The filename, directory name, or volume label syntax is incorrect)
   56.35 - *
   56.36 - * @library ..
   56.37 - * @compile -source 7 -target 7 -XDinvokedynamic QuotedIdent.java
   56.38 - * @run main quid.QuotedIdent2
   56.39 - */
   56.40 -/*
   56.41 - * Standalone testing:
   56.42 - * <code>
   56.43 - * $ cd $MY_REPO_DIR/langtools
   56.44 - * $ (cd make; make)
   56.45 - * $ ./dist/bootstrap/bin/javac -d dist test/tools/javac/quid/QuotedIdent.java
   56.46 - * $ ./dist/bootstrap/bin/javac -d dist -cp dist test/tools/javac/quid/QuotedIdent2.java
   56.47 - * $ java -version  # should print 1.6 or later
   56.48 - * $ java -cp dist QuotedIdent2
   56.49 - * </code>
   56.50 - */
   56.51 -
   56.52 -package quid;
   56.53 -
   56.54 -import quid.QuotedIdent.*;
   56.55 -import quid.QuotedIdent.#"*86";
   56.56 -import static quid.QuotedIdent.#"MAKE-*86";
   56.57 -
   56.58 -public class QuotedIdent2 {
   56.59 -    static void check(int testid, String have, String expect)
   56.60 -                throws RuntimeException {
   56.61 -        QuotedIdent.check(testid, have, expect);
   56.62 -    }
   56.63 -
   56.64 -    public static void main(String[] args) throws Exception {
   56.65 -        String s;
   56.66 -
   56.67 -        s = #"int".valueOf(123).toString();
   56.68 -        check(22, s, "123");
   56.69 -
   56.70 -        s = #"MAKE-*86"().#"555-1212"();
   56.71 -        check(23, s, "[*86.555-1212]");
   56.72 -
   56.73 -        s = #"Yog-Shoggoth".#"(nameless ululation)";
   56.74 -        check(25, s, "Tekeli-li!");
   56.75 -
   56.76 -        s = QuotedIdent.#"int".class.getName();
   56.77 -        check(31, s, QuotedIdent.class.getName()+"$int");
   56.78 -
   56.79 -        Class<?> x86 = Class.forName(QuotedIdent.class.getName()+"$*86");
   56.80 -        if (x86 != #"*86".class)
   56.81 -            check(32, "reflected "+x86, "static "+#"*86".class);
   56.82 -
   56.83 -        s = (String) x86.getDeclaredMethod("555-1212").invoke(QuotedIdent.#"MAKE-*86"());
   56.84 -        check(31, s, "[*86.555-1212]");
   56.85 -
   56.86 -        System.out.println("OK");
   56.87 -    }
   56.88 -}
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/test/tools/javac/quid/T6999438.java	Mon Dec 06 20:35:49 2010 -0800
    57.3 @@ -0,0 +1,9 @@
    57.4 +/* @test /nodynamiccopyright/
    57.5 + * @bug 6999438
    57.6 + * @summary remove support for exotic identifiers from JDK 7
    57.7 + * @compile/fail/ref=T6999438.out -XDrawDiagnostics -source 7 T6999438.java
    57.8 + */
    57.9 +
   57.10 +class Test {
   57.11 +    int #"not supported";
   57.12 +}
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/test/tools/javac/quid/T6999438.out	Mon Dec 06 20:35:49 2010 -0800
    58.3 @@ -0,0 +1,6 @@
    58.4 +T6999438.java:8:9: compiler.err.illegal.char: 35
    58.5 +T6999438.java:8:10: compiler.err.illegal.start.of.type
    58.6 +T6999438.java:8:25: compiler.err.expected: token.identifier
    58.7 +T6999438.java:8:26: compiler.err.expected: ';'
    58.8 +T6999438.java:9:2: compiler.err.premature.eof
    58.9 +5 errors
    59.1 --- a/test/tools/javac/varargs/warning/Warn1.java	Fri Dec 03 19:45:34 2010 -0800
    59.2 +++ b/test/tools/javac/varargs/warning/Warn1.java	Mon Dec 06 20:35:49 2010 -0800
    59.3 @@ -27,7 +27,7 @@
    59.4   * @summary fixed-arity warning given too often
    59.5   * @author gafter
    59.6   *
    59.7 - * @compile -Werror -source 1.4 Warn1.java
    59.8 + * @compile -Werror -source 1.4 -Xlint:-options Warn1.java
    59.9   */
   59.10  
   59.11  package varargs.warning.warn1;
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/test/tools/javadoc/6942366/T6942366.java	Mon Dec 06 20:35:49 2010 -0800
    60.3 @@ -0,0 +1,134 @@
    60.4 +/*
    60.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    60.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    60.7 + *
    60.8 + * This code is free software; you can redistribute it and/or modify it
    60.9 + * under the terms of the GNU General Public License version 2 only, as
   60.10 + * published by the Free Software Foundation.
   60.11 + *
   60.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   60.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   60.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   60.15 + * version 2 for more details (a copy is included in the LICENSE file that
   60.16 + * accompanied this code).
   60.17 + *
   60.18 + * You should have received a copy of the GNU General Public License version
   60.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   60.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   60.21 + *
   60.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   60.23 + * or visit www.oracle.com if you need additional information or have any
   60.24 + * questions.
   60.25 + */
   60.26 +
   60.27 +/*
   60.28 + * @test
   60.29 + * @bug 6942366
   60.30 + * @summary javadoc no longer inherits doc from sourcepath
   60.31 + * @build p.Base Test
   60.32 + * @run main T6942366
   60.33 + */
   60.34 +
   60.35 +import java.io.*;
   60.36 +import java.util.*;
   60.37 +
   60.38 +public class T6942366 {
   60.39 +    public static void main(String... args) throws Exception {
   60.40 +        new T6942366().run();
   60.41 +    }
   60.42 +
   60.43 +    File testSrc;
   60.44 +    File testClasses;
   60.45 +    int count;
   60.46 +    int errors;
   60.47 +
   60.48 +    void run() throws Exception {
   60.49 +        testSrc = new File(System.getProperty("test.src"));
   60.50 +        testClasses = new File(System.getProperty("test.classes"));
   60.51 +
   60.52 +        test(true,  false);
   60.53 +        test(false, true);
   60.54 +        test(true,  true);
   60.55 +
   60.56 +        if (errors > 0)
   60.57 +            throw new Exception(errors + " errors found");
   60.58 +    }
   60.59 +
   60.60 +    void test(boolean useSourcePath, boolean useClassPath) throws Exception {
   60.61 +        System.out.println("test " + (++count) + " sp:" + useSourcePath + " cp:" + useClassPath);
   60.62 +        File testDir = new File("test" + count);
   60.63 +        testDir.mkdirs();
   60.64 +
   60.65 +        List<String> args = new ArrayList<String>();
   60.66 +        //args.add("-verbose");
   60.67 +        args.add("-d");
   60.68 +        args.add(testDir.getPath());
   60.69 +        if (useSourcePath) {
   60.70 +            args.add("-sourcepath");
   60.71 +            args.add(testSrc.getPath());
   60.72 +        }
   60.73 +        if (useClassPath) {
   60.74 +            args.add("-classpath");
   60.75 +            args.add(testClasses.getPath());
   60.76 +        } else {
   60.77 +            // override classpath to avoid stuff jtreg might have put on papth
   60.78 +            args.add("-classpath");
   60.79 +            args.add(".");
   60.80 +        }
   60.81 +
   60.82 +        // use a very simple bootclasspath to avoid stuff jtreg might have put on path
   60.83 +        File javaHome = new File(System.getProperty("java.home"));
   60.84 +        File rt_jar = new File(javaHome, "lib/rt.jar");
   60.85 +        if (!rt_jar.exists())
   60.86 +            throw new Exception("rt.jar not found");
   60.87 +        args.add("-bootclasspath");
   60.88 +        args.add(rt_jar.getPath());
   60.89 +
   60.90 +        args.add(new File(testSrc, "Test.java").getPath());
   60.91 +        System.out.println("javadoc: " + args);
   60.92 +
   60.93 +        int rc = com.sun.tools.javadoc.Main.execute(args.toArray(new String[args.size()]));
   60.94 +        if (rc != 0)
   60.95 +            throw new Exception("unexpected exit from javadoc, rc=" + rc);
   60.96 +
   60.97 +        if (useSourcePath && useClassPath) {
   60.98 +            long srcLastMod = new File(testSrc, "Test.java").lastModified();
   60.99 +            long classLastMod = new File(testClasses, "Test.class").lastModified();
  60.100 +            System.out.println("Test.java last modified:  " + new Date(srcLastMod));
  60.101 +            System.out.println("Test.class last modified: " + new Date(classLastMod));
  60.102 +            System.out.println((srcLastMod > classLastMod ? "source" : "class") + " is newer");
  60.103 +        }
  60.104 +
  60.105 +        String s = "javadoc-for-Base.m";
  60.106 +        boolean expect = useSourcePath;
  60.107 +        boolean found = contains(new File(testDir, "Test.html"), s);
  60.108 +        if (found) {
  60.109 +            if (expect)
  60.110 +                System.out.println("javadoc content \"" + s + "\" found, as expected");
  60.111 +            else
  60.112 +                error("javadoc content \"" + s + "\" found unexpectedly");
  60.113 +        } else {
  60.114 +            if (expect)
  60.115 +                error("javadoc content \"" + s + "\" not found");
  60.116 +            else
  60.117 +                System.out.println("javadoc content \"" + s + "\" not found, as expected");
  60.118 +        }
  60.119 +
  60.120 +        System.out.println();
  60.121 +    }
  60.122 +
  60.123 +    boolean contains(File f, String s) throws Exception {
  60.124 +        byte[] buf = new byte[(int) f.length()];
  60.125 +        try (DataInputStream in = new DataInputStream(new FileInputStream(f))) {
  60.126 +            in.readFully(buf);
  60.127 +        }
  60.128 +        return new String(buf).contains(s);
  60.129 +    }
  60.130 +
  60.131 +    void error(String msg) {
  60.132 +        System.out.println("Error: " + msg);
  60.133 +        errors++;
  60.134 +    }
  60.135 +
  60.136 +}
  60.137 +
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/test/tools/javadoc/6942366/Test.java	Mon Dec 06 20:35:49 2010 -0800
    61.3 @@ -0,0 +1,28 @@
    61.4 +/*
    61.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    61.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    61.7 + *
    61.8 + * This code is free software; you can redistribute it and/or modify it
    61.9 + * under the terms of the GNU General Public License version 2 only, as
   61.10 + * published by the Free Software Foundation.
   61.11 + *
   61.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   61.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   61.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   61.15 + * version 2 for more details (a copy is included in the LICENSE file that
   61.16 + * accompanied this code).
   61.17 + *
   61.18 + * You should have received a copy of the GNU General Public License version
   61.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   61.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   61.21 + *
   61.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   61.23 + * or visit www.oracle.com if you need additional information or have any
   61.24 + * questions.
   61.25 + */
   61.26 +
   61.27 +public class Test extends p.Base {
   61.28 +    // overrides Base.m
   61.29 +    public void m() { }
   61.30 +}
   61.31 +
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/test/tools/javadoc/6942366/p/Base.java	Mon Dec 06 20:35:49 2010 -0800
    62.3 @@ -0,0 +1,30 @@
    62.4 +/*
    62.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    62.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    62.7 + *
    62.8 + * This code is free software; you can redistribute it and/or modify it
    62.9 + * under the terms of the GNU General Public License version 2 only, as
   62.10 + * published by the Free Software Foundation.
   62.11 + *
   62.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   62.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   62.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   62.15 + * version 2 for more details (a copy is included in the LICENSE file that
   62.16 + * accompanied this code).
   62.17 + *
   62.18 + * You should have received a copy of the GNU General Public License version
   62.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   62.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   62.21 + *
   62.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   62.23 + * or visit www.oracle.com if you need additional information or have any
   62.24 + * questions.
   62.25 + */
   62.26 +
   62.27 +package p;
   62.28 +
   62.29 +public class Base {
   62.30 +    /** javadoc-for-Base.m. */
   62.31 +    public void m() { }
   62.32 +}
   62.33 +
    63.1 --- a/test/tools/javap/T6729471.java	Fri Dec 03 19:45:34 2010 -0800
    63.2 +++ b/test/tools/javap/T6729471.java	Mon Dec 06 20:35:49 2010 -0800
    63.3 @@ -39,6 +39,8 @@
    63.4      }
    63.5  
    63.6      void run() {
    63.7 +        File testClasses = new File(System.getProperty("test.classes"));
    63.8 +
    63.9          // simple class
   63.10          verify("java.util.Map",
   63.11                  "public abstract boolean containsKey(java.lang.Object)");
   63.12 @@ -48,11 +50,11 @@
   63.13                  "public abstract K getKey()");
   63.14  
   63.15          // file name
   63.16 -        verify("../classes/tools/javap/T6729471.class",
   63.17 +        verify(new File(testClasses, "T6729471.class").getPath(),
   63.18                  "public static void main(java.lang.String...)");
   63.19  
   63.20          // file url
   63.21 -        verify("file:../classes/tools/javap/T6729471.class",
   63.22 +        verify(new File(testClasses, "T6729471.class").toURI().toString(),
   63.23                  "public static void main(java.lang.String...)");
   63.24  
   63.25          // jar url: rt.jar

mercurial