8023550: -d option was broken for any dir but '.'. Fixed Java warnings.
authorlagergren
Fri, 23 Aug 2013 14:16:16 +0200
changeset 19630 99f53f31008e
parent 19627 90d910ec15a3
child 19631 5a165897932b
8023550: -d option was broken for any dir but '.'. Fixed Java warnings. Reviewed-by: jlaskey, sundar
nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
nashorn/src/jdk/internal/dynalink/ChainedCallSite.java
nashorn/src/jdk/internal/dynalink/DefaultBootstrapper.java
nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java
nashorn/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java
nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java
nashorn/src/jdk/nashorn/internal/objects/NativeArray.java
nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java
nashorn/src/jdk/nashorn/internal/runtime/Context.java
nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java
nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java
nashorn/tools/fxshell/jdk/nashorn/tools/FXShell.java
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java	Fri Aug 23 14:16:16 2013 +0200
@@ -27,7 +27,6 @@
 
 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;
 import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
-import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
 import static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESTATIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
 import static jdk.nashorn.internal.tools.nasgen.StringConstants.CONSTRUCTOR_SUFFIX;
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java	Fri Aug 23 14:16:16 2013 +0200
@@ -27,7 +27,6 @@
 
 import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
 import static jdk.internal.org.objectweb.asm.Opcodes.DUP;
-import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
 import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC;
 import static jdk.internal.org.objectweb.asm.Opcodes.NEW;
--- a/nashorn/src/jdk/internal/dynalink/ChainedCallSite.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/ChainedCallSite.java	Fri Aug 23 14:16:16 2013 +0200
@@ -121,7 +121,6 @@
      * to change the value. If your override returns a value less than 1, the code will break.
      * @return the maximum number of method handles in the chain.
      */
-    @SuppressWarnings("static-method")
     protected int getMaxChainLength() {
         return 8;
     }
--- a/nashorn/src/jdk/internal/dynalink/DefaultBootstrapper.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/DefaultBootstrapper.java	Fri Aug 23 14:16:16 2013 +0200
@@ -133,7 +133,7 @@
      * @param type the method signature at the call site
      * @return a new {@link MonomorphicCallSite} linked with the default dynamic linker.
      */
-    public static CallSite publicBootstrap(@SuppressWarnings("unused") MethodHandles.Lookup caller, String name, MethodType type) {
+    public static CallSite publicBootstrap(MethodHandles.Lookup caller, String name, MethodType type) {
         return bootstrapInternal(MethodHandles.publicLookup(), name, type);
     }
 
--- a/nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java	Fri Aug 23 14:16:16 2013 +0200
@@ -97,6 +97,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.beans.GuardedInvocationComponent.ValidationType;
 import jdk.internal.dynalink.linker.GuardedInvocation;
--- a/nashorn/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java	Fri Aug 23 14:16:16 2013 +0200
@@ -148,6 +148,7 @@
         }
     }
 
+    @SuppressWarnings("fallthrough")
     @Override
     public MethodHandle getInvocation(final CallSiteDescriptor callSiteDescriptor, final LinkerServices linkerServices) {
         final MethodType callSiteType = callSiteDescriptor.getMethodType();
--- a/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/api/scripting/NashornScriptEngine.java	Fri Aug 23 14:16:16 2013 +0200
@@ -124,6 +124,7 @@
     }
 
     // load engine.js and return content as a char[]
+    @SuppressWarnings("resource")
     private static char[] loadEngineJSSource() {
         final String script = "resources/engine.js";
         try {
@@ -212,9 +213,8 @@
             // just create normal SimpleBindings.
             // We use same 'global' for all Bindings.
             return new SimpleBindings();
-        } else {
-            return createGlobalMirror(null);
         }
+        return createGlobalMirror(null);
     }
 
     // Compilable methods
--- a/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CompilationPhase.java	Fri Aug 23 14:16:16 2013 +0200
@@ -414,30 +414,34 @@
                     compiler.getCodeInstaller().verify(bytecode);
                 }
 
-                // should code be dumped to disk - only valid in compile_only
-                // mode?
+                // should code be dumped to disk - only valid in compile_only mode?
                 if (env._dest_dir != null && env._compile_only) {
                     final String fileName = className.replace('.', File.separatorChar) + ".class";
-                    final int index = fileName.lastIndexOf(File.separatorChar);
+                    final int    index    = fileName.lastIndexOf(File.separatorChar);
 
+                    final File dir;
                     if (index != -1) {
-                        final File dir = new File(fileName.substring(0, index));
-                        try {
-                            if (!dir.exists() && !dir.mkdirs()) {
-                                throw new IOException(dir.toString());
-                            }
-                            final File file = new File(env._dest_dir, fileName);
-                            try (final FileOutputStream fos = new FileOutputStream(file)) {
-                                fos.write(bytecode);
-                            }
-                        } catch (final IOException e) {
-                            Compiler.LOG.warning("Skipping class dump for ",
-                                    className,
-                                    ": ",
-                                    ECMAErrors.getMessage(
-                                        "io.error.cant.write",
-                                        dir.toString()));
+                        dir = new File(env._dest_dir, fileName.substring(0, index));
+                    } else {
+                        dir = new File(env._dest_dir);
+                    }
+
+                    try {
+                        if (!dir.exists() && !dir.mkdirs()) {
+                            throw new IOException(dir.toString());
                         }
+                        final File file = new File(env._dest_dir, fileName);
+                        try (final FileOutputStream fos = new FileOutputStream(file)) {
+                            fos.write(bytecode);
+                        }
+                        Compiler.LOG.info("Wrote class to '" + file.getAbsolutePath() + '\'');
+                    } catch (final IOException e) {
+                        Compiler.LOG.warning("Skipping class dump for ",
+                                className,
+                                ": ",
+                                ECMAErrors.getMessage(
+                                    "io.error.cant.write",
+                                    dir.toString()));
                     }
                 }
             }
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Aug 23 14:16:16 2013 +0200
@@ -40,6 +40,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.Callable;
+
 import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import jdk.nashorn.internal.objects.annotations.Attribute;
 import jdk.nashorn.internal.objects.annotations.Constructor;
@@ -632,6 +633,7 @@
         return new NativeArray(list.toArray());
     }
 
+    @SuppressWarnings("null")
     private static void concatToList(final ArrayList<Object> list, final Object obj) {
         final boolean isScriptArray = isArray(obj);
         final boolean isScriptObject = isScriptArray || obj instanceof ScriptObject;
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeRegExp.java	Fri Aug 23 14:16:16 2013 +0200
@@ -65,10 +65,9 @@
     private RegExp regexp;
 
     // Reference to global object needed to support static RegExp properties
-    private Global globalObject;
+    private final Global globalObject;
 
     // initialized by nasgen
-    @SuppressWarnings("unused")
     private static PropertyMap $nasgenmap$;
 
     static PropertyMap getInitialMap() {
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Aug 23 14:16:16 2013 +0200
@@ -894,7 +894,6 @@
         return script;
     }
 
-    @SuppressWarnings("static-method")
     private ScriptLoader createNewLoader() {
         return AccessController.doPrivileged(
              new PrivilegedAction<ScriptLoader>() {
--- a/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java	Fri Aug 23 14:16:16 2013 +0200
@@ -44,6 +44,7 @@
          * Hook to force the loading of the DebuggerValueDesc class so that it is
          * available to external debuggers.
          */
+        @SuppressWarnings("unused")
         DebuggerValueDesc forceLoad = new DebuggerValueDesc(null, false, null, null);
     }
 
@@ -111,9 +112,8 @@
         if (value instanceof ScriptObject && !(value instanceof ScriptFunction)) {
             final ScriptObject object = (ScriptObject)value;
             return new DebuggerValueDesc(name, !object.isEmpty(), value, objectAsString(object, all, duplicates));
-        } else {
-            return new DebuggerValueDesc(name, false, value, valueAsString(value));
         }
+        return new DebuggerValueDesc(name, false, value, valueAsString(value));
     }
 
     /**
@@ -199,7 +199,7 @@
                     final String valueAsString = descs[i].valueAsString;
                     sb.append(descs[i].key);
                     sb.append(": ");
-                    sb.append(descs[i].valueAsString);
+                    sb.append(valueAsString);
                 }
             }
 
@@ -239,9 +239,8 @@
         case FUNCTION:
             if (value instanceof ScriptFunction) {
                 return ((ScriptFunction)value).toSource();
-            } else {
-                return value.toString();
             }
+            return value.toString();
 
         default:
             return value.toString();
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Aug 23 14:16:16 2013 +0200
@@ -52,6 +52,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import jdk.internal.dynalink.CallSiteDescriptor;
 import jdk.internal.dynalink.linker.GuardedInvocation;
 import jdk.internal.dynalink.linker.LinkRequest;
@@ -1149,12 +1150,12 @@
 
         if (newProto == null || newProto instanceof ScriptObject) {
             // check for circularity
-            ScriptObject proto = (ScriptObject)newProto;
-            while (proto != null) {
-                if (proto == this) {
+            ScriptObject p = (ScriptObject)newProto;
+            while (p != null) {
+                if (p == this) {
                     throw typeError("circular.__proto__.set", ScriptRuntime.safeToString(this));
                 }
-                proto = proto.getProto();
+                p = p.getProto();
             }
             setProto((ScriptObject)newProto);
         } else {
@@ -2017,6 +2018,7 @@
      * @param request the link request
      * @return GuardedInvocation to be invoked at call site.
      */
+    @SuppressWarnings("null")
     public GuardedInvocation noSuchProperty(final CallSiteDescriptor desc, final LinkRequest request) {
         final String name = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
         final FindProperty find = findProperty(NO_SUCH_PROPERTY_NAME, true);
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java	Fri Aug 23 14:16:16 2013 +0200
@@ -39,7 +39,6 @@
 import jdk.nashorn.internal.runtime.regexp.joni.constants.OPCode;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.OPSize;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.TargetInfo;
-import jdk.nashorn.internal.runtime.regexp.joni.encoding.CharacterType;
 
 final class ArrayCompiler extends Compiler {
     private int[] code;
@@ -345,6 +344,7 @@
 
     private static final int QUANTIFIER_EXPAND_LIMIT_SIZE   = 50; // was 50
 
+    @SuppressWarnings("unused")
     private static boolean cknOn(int ckn) {
         return ckn > 0;
     }
@@ -879,6 +879,7 @@
         }
     }
 
+    @SuppressWarnings("unused")
     private void addStateCheckNum(int num) {
         addInt(num);
     }
@@ -887,6 +888,7 @@
         addInt(addr);
     }
 
+    @SuppressWarnings("unused")
     private void addAbsAddr(int addr) {
         addInt(addr);
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java	Fri Aug 23 14:16:16 2013 +0200
@@ -29,6 +29,7 @@
     final int[] bits = new int[BITSET_SIZE];
 
     private static final int BITS_TO_STRING_WRAP = 4;
+    @Override
     public String toString() {
         StringBuilder buffer = new StringBuilder();
         buffer.append("BitSet");
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java	Fri Aug 23 14:16:16 2013 +0200
@@ -96,6 +96,7 @@
         }
     }
 
+    @Override
     protected final int matchAt(int range, int sstart, int sprev) {
         this.range = range;
         this.sstart = sstart;
@@ -731,8 +732,6 @@
         // STRING_CMP
         while(n-- > 0) if (chars[pstart++] != chars[s++]) {opFail(); return;}
 
-        int len;
-
         // beyond string check
         if (sprev < range) {
             while (sprev + 1 < s) sprev++;
@@ -768,7 +767,6 @@
         if (!stringCmpIC(regex.caseFoldFlag, pstart, this, n, end)) {opFail(); return;}
         s = value;
 
-        int len;
         // if (sprev < chars.length)
         while (sprev + 1 < s) sprev++;
     }
@@ -796,8 +794,6 @@
 
             s = swork;
 
-            int len;
-
             // beyond string check
             if (sprev < range) {
                 while (sprev + 1 < s) sprev++;
@@ -829,7 +825,6 @@
             if (!stringCmpIC(regex.caseFoldFlag, pstart, this, n, end)) continue loop; // STRING_CMP_VALUE_IC
             s = value;
 
-            int len;
             // if (sprev < chars.length)
             while (sprev + 1 < s) sprev++;
 
@@ -902,7 +897,6 @@
 
         sprev = s;
         if (backrefMatchAtNestedLevel(ic != 0, regex.caseFoldFlag, level, tlen, ip)) { // (s) and (end) implicit
-            int len;
             while (sprev + 1 < s) sprev++;
             ip += tlen; // * SIZE_MEMNUM
         } else {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java	Fri Aug 23 14:16:16 2013 +0200
@@ -58,6 +58,7 @@
         used = orig.used;
     }
 
+    @Override
     public String toString() {
         StringBuilder buf = new StringBuilder();
         buf.append("CodeRange");
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java	Fri Aug 23 14:16:16 2013 +0200
@@ -139,6 +139,7 @@
         }
     }
 
+    @SuppressWarnings("fallthrough")
     /* \M-, \C-, \c, or \... */
     private int fetchEscapedValue() {
         if (!left()) {
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java	Fri Aug 23 14:16:16 2013 +0200
@@ -297,8 +297,6 @@
                 throw new SyntaxException(ERR_END_PATTERN_IN_GROUP);
             }
 
-            boolean listCapture = false;
-
             fetch();
             switch(c) {
             case ':':  /* (?:...) grouping only */
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java	Fri Aug 23 14:16:16 2013 +0200
@@ -32,6 +32,7 @@
         this.end = new int[num];
     }
 
+    @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("Region: \n");
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java	Fri Aug 23 14:16:16 2013 +0200
@@ -21,9 +21,6 @@
 
 import jdk.nashorn.internal.runtime.regexp.joni.encoding.IntHolder;
 import jdk.nashorn.internal.runtime.regexp.joni.exception.ErrorMessages;
-import jdk.nashorn.internal.runtime.regexp.joni.exception.InternalException;
-import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException;
-import jdk.nashorn.internal.runtime.regexp.joni.exception.ValueException;
 
 abstract class ScannerSupport extends IntHolder implements ErrorMessages {
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java	Fri Aug 23 14:16:16 2013 +0200
@@ -28,14 +28,17 @@
 
     public static final SearchAlgorithm NONE = new SearchAlgorithm() {
 
+        @Override
         public final String getName() {
             return "NONE";
         }
 
+        @Override
         public final int search(Regex regex, char[] text, int textP, int textEnd, int textRange) {
             return textP;
         }
 
+        @Override
         public final int searchBackward(Regex regex, char[] text, int textP, int adjustText, int textEnd, int textStart, int s_, int range_) {
             return textP;
         }
@@ -44,10 +47,12 @@
 
     public static final SearchAlgorithm SLOW = new SearchAlgorithm() {
 
+        @Override
         public final String getName() {
             return "EXACT";
         }
 
+        @Override
         public final int search(Regex regex, char[] text, int textP, int textEnd, int textRange) {
             char[] target = regex.exact;
             int targetP = regex.exactP;
@@ -78,6 +83,7 @@
             return -1;
         }
 
+        @Override
         public final int searchBackward(Regex regex, char[] text, int textP, int adjustText, int textEnd, int textStart, int s_, int range_) {
             char[] target = regex.exact;
             int targetP = regex.exactP;
@@ -114,10 +120,12 @@
             this.caseFoldFlag = regex.caseFoldFlag;
         }
 
+        @Override
         public final String getName() {
             return "EXACT_IC";
         }
 
+        @Override
         public final int search(Regex regex, char[] text, int textP, int textEnd, int textRange) {
             char[] target = regex.exact;
             int targetP = regex.exactP;
@@ -136,6 +144,7 @@
             return -1;
         }
 
+        @Override
         public final int searchBackward(Regex regex, char[] text, int textP, int adjustText, int textEnd, int textStart, int s_, int range_) {
             char[] target = regex.exact;
             int targetP = regex.exactP;
@@ -163,14 +172,16 @@
             }
             return true;
         }
-    };
+    }
 
     public static final SearchAlgorithm BM = new SearchAlgorithm() {
 
+        @Override
         public final String getName() {
             return "EXACT_BM";
         }
 
+        @Override
         public final int search(Regex regex, char[] text, int textP, int textEnd, int textRange) {
             char[] target = regex.exact;
             int targetP = regex.exactP;
@@ -212,6 +223,7 @@
 
         private static final int BM_BACKWARD_SEARCH_LENGTH_THRESHOLD = 100;
 
+        @Override
         public final int searchBackward(Regex regex, char[] text, int textP, int adjustText, int textEnd, int textStart, int s_, int range_) {
             char[] target = regex.exact;
             int targetP = regex.exactP;
@@ -263,10 +275,12 @@
 
     public static final SearchAlgorithm MAP = new SearchAlgorithm() {
 
+        @Override
         public final String getName() {
             return "MAP";
         }
 
+        @Override
         public final int search(Regex regex, char[] text, int textP, int textEnd, int textRange) {
             byte[] map = regex.map;
             int s = textP;
@@ -278,6 +292,7 @@
             return -1;
         }
 
+        @Override
         public final int searchBackward(Regex regex, char[] text, int textP, int adjustText, int textEnd, int textStart, int s_, int range_) {
             byte[] map = regex.map;
             int s = textStart;
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java	Fri Aug 23 14:16:16 2013 +0200
@@ -458,7 +458,7 @@
                                         isNull = 0;
                                         break;
                                     } else if (endp != s) {
-                                        isNull = -1;; /* empty, but position changed */
+                                        isNull = -1; /* empty, but position changed */
                                     }
                                 }
                                 k++;
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java	Fri Aug 23 14:16:16 2013 +0200
@@ -24,6 +24,7 @@
  */
 public interface WarnCallback {
     WarnCallback DEFAULT = new WarnCallback() {
+        @Override
         public void warn(String message) {
             System.err.println(message);
         }
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java	Fri Aug 23 14:16:16 2013 +0200
@@ -19,7 +19,6 @@
  */
 package jdk.nashorn.internal.runtime.regexp.joni.ast;
 
-import jdk.nashorn.internal.runtime.regexp.joni.Config;
 import jdk.nashorn.internal.runtime.regexp.joni.Option;
 import jdk.nashorn.internal.runtime.regexp.joni.constants.EncloseType;
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java	Fri Aug 23 14:16:16 2013 +0200
@@ -35,7 +35,7 @@
     }
 
     protected void setChild(Node tgt){}         // default definition
-    protected Node getChild(){return null;};    // default definition
+    protected Node getChild(){return null;}     // default definition
 
     public void swap(Node with) {
         Node tmp;
@@ -74,6 +74,7 @@
         return getName() + ":0x" + Integer.toHexString(System.identityHashCode(this));
     }
 
+    @Override
     public final String toString() {
         StringBuilder s = new StringBuilder();
         s.append("<" + getAddressName() + " (" + (parent == null ? "NULL" : parent.getAddressName())  + ")>");
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java	Fri Aug 23 14:16:16 2013 +0200
@@ -223,6 +223,7 @@
         other.target = null; // remove target from reduced quantifier
     }
 
+    @SuppressWarnings("fallthrough")
     public int setQuantifier(Node tgt, boolean group, ScanEnvironment env, char[] chars, int p, int end) {
         if (lower == 1 && upper == 1) return 1;
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java	Fri Aug 23 14:16:16 2013 +0200
@@ -19,8 +19,6 @@
  */
 package jdk.nashorn.internal.runtime.regexp.joni.exception;
 
-import jdk.nashorn.internal.runtime.regexp.joni.Config;
-
 public interface ErrorMessages {
 
     /* from jcodings */
--- a/nashorn/tools/fxshell/jdk/nashorn/tools/FXShell.java	Fri Aug 23 13:10:45 2013 +0200
+++ b/nashorn/tools/fxshell/jdk/nashorn/tools/FXShell.java	Fri Aug 23 14:16:16 2013 +0200
@@ -32,13 +32,9 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import javafx.application.Application;
 import javafx.stage.Stage;
 import javax.script.Invocable;
-import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
@@ -180,6 +176,7 @@
      *
      * @return Last evaluation result (discarded.)
      */
+    @SuppressWarnings("resource")
     private Object load(String path) {
         try {
             FileInputStream file = new FileInputStream(path);