aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java1
-rw-r--r--buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java1
-rw-r--r--src/jdk/internal/dynalink/ChainedCallSite.java1
-rw-r--r--src/jdk/internal/dynalink/DefaultBootstrapper.java2
-rw-r--r--src/jdk/internal/dynalink/beans/AbstractJavaLinker.java1
-rw-r--r--src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java1
-rw-r--r--src/jdk/nashorn/api/scripting/NashornScriptEngine.java4
-rw-r--r--src/jdk/nashorn/internal/codegen/CompilationPhase.java42
-rw-r--r--src/jdk/nashorn/internal/objects/NativeArray.java2
-rw-r--r--src/jdk/nashorn/internal/objects/NativeRegExp.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/Context.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/DebuggerSupport.java9
-rw-r--r--src/jdk/nashorn/internal/runtime/ScriptObject.java10
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java4
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java8
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java2
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/Region.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java17
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java2
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java3
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java1
-rw-r--r--src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java2
-rw-r--r--tools/fxshell/jdk/nashorn/tools/FXShell.java5
29 files changed, 71 insertions, 60 deletions
diff --git a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
index 7f45eab4..d46f78c4 100644
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
@@ -27,7 +27,6 @@ package jdk.nashorn.internal.tools.nasgen;
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;
diff --git a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
index 1622e02b..72250de7 100644
--- a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
+++ b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
@@ -27,7 +27,6 @@ package jdk.nashorn.internal.tools.nasgen;
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;
diff --git a/src/jdk/internal/dynalink/ChainedCallSite.java b/src/jdk/internal/dynalink/ChainedCallSite.java
index cdadd163..c2ad4eb2 100644
--- a/src/jdk/internal/dynalink/ChainedCallSite.java
+++ b/src/jdk/internal/dynalink/ChainedCallSite.java
@@ -121,7 +121,6 @@ public class ChainedCallSite extends AbstractRelinkableCallSite {
* 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;
}
diff --git a/src/jdk/internal/dynalink/DefaultBootstrapper.java b/src/jdk/internal/dynalink/DefaultBootstrapper.java
index c62afe60..b7edb9d8 100644
--- a/src/jdk/internal/dynalink/DefaultBootstrapper.java
+++ b/src/jdk/internal/dynalink/DefaultBootstrapper.java
@@ -133,7 +133,7 @@ public class DefaultBootstrapper {
* @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);
}
diff --git a/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java b/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java
index d2d1cd5a..a6ef8c11 100644
--- a/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java
+++ b/src/jdk/internal/dynalink/beans/AbstractJavaLinker.java
@@ -97,6 +97,7 @@ import java.util.Collections;
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;
diff --git a/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java b/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java
index 407d2b83..8ce41bc6 100644
--- a/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java
+++ b/src/jdk/internal/dynalink/beans/OverloadedDynamicMethod.java
@@ -148,6 +148,7 @@ class OverloadedDynamicMethod extends DynamicMethod {
}
}
+ @SuppressWarnings("fallthrough")
@Override
public MethodHandle getInvocation(final CallSiteDescriptor callSiteDescriptor, final LinkerServices linkerServices) {
final MethodType callSiteType = callSiteDescriptor.getMethodType();
diff --git a/src/jdk/nashorn/api/scripting/NashornScriptEngine.java b/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
index 54015b6a..9745d432 100644
--- a/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
+++ b/src/jdk/nashorn/api/scripting/NashornScriptEngine.java
@@ -124,6 +124,7 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
}
// 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 @@ public final class NashornScriptEngine extends AbstractScriptEngine implements C
// just create normal SimpleBindings.
// We use same 'global' for all Bindings.
return new SimpleBindings();
- } else {
- return createGlobalMirror(null);
}
+ return createGlobalMirror(null);
}
// Compilable methods
diff --git a/src/jdk/nashorn/internal/codegen/CompilationPhase.java b/src/jdk/nashorn/internal/codegen/CompilationPhase.java
index 5d48fb73..be8faab9 100644
--- a/src/jdk/nashorn/internal/codegen/CompilationPhase.java
+++ b/src/jdk/nashorn/internal/codegen/CompilationPhase.java
@@ -414,30 +414,34 @@ enum CompilationPhase {
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()));
}
}
}
diff --git a/src/jdk/nashorn/internal/objects/NativeArray.java b/src/jdk/nashorn/internal/objects/NativeArray.java
index 34691194..54f29387 100644
--- a/src/jdk/nashorn/internal/objects/NativeArray.java
+++ b/src/jdk/nashorn/internal/objects/NativeArray.java
@@ -40,6 +40,7 @@ import java.util.Comparator;
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 @@ public final class NativeArray extends ScriptObject {
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;
diff --git a/src/jdk/nashorn/internal/objects/NativeRegExp.java b/src/jdk/nashorn/internal/objects/NativeRegExp.java
index e6aa4be4..5a219635 100644
--- a/src/jdk/nashorn/internal/objects/NativeRegExp.java
+++ b/src/jdk/nashorn/internal/objects/NativeRegExp.java
@@ -65,10 +65,9 @@ public final class NativeRegExp extends ScriptObject {
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() {
diff --git a/src/jdk/nashorn/internal/runtime/Context.java b/src/jdk/nashorn/internal/runtime/Context.java
index 217080d0..2f0c95d8 100644
--- a/src/jdk/nashorn/internal/runtime/Context.java
+++ b/src/jdk/nashorn/internal/runtime/Context.java
@@ -894,7 +894,6 @@ public final class Context {
return script;
}
- @SuppressWarnings("static-method")
private ScriptLoader createNewLoader() {
return AccessController.doPrivileged(
new PrivilegedAction<ScriptLoader>() {
diff --git a/src/jdk/nashorn/internal/runtime/DebuggerSupport.java b/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
index e5017d7b..9febcf6b 100644
--- a/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
+++ b/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
@@ -44,6 +44,7 @@ final class DebuggerSupport {
* 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 @@ final class DebuggerSupport {
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 class DebuggerSupport {
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 @@ final class DebuggerSupport {
case FUNCTION:
if (value instanceof ScriptFunction) {
return ((ScriptFunction)value).toSource();
- } else {
- return value.toString();
}
+ return value.toString();
default:
return value.toString();
diff --git a/src/jdk/nashorn/internal/runtime/ScriptObject.java b/src/jdk/nashorn/internal/runtime/ScriptObject.java
index 363891d9..9d7a7a6b 100644
--- a/src/jdk/nashorn/internal/runtime/ScriptObject.java
+++ b/src/jdk/nashorn/internal/runtime/ScriptObject.java
@@ -52,6 +52,7 @@ import java.util.LinkedHashSet;
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 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
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 @@ public abstract class ScriptObject extends PropertyListenerManager implements Pr
* @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);
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java b/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
index aefa9d83..33d56c17 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/ArrayCompiler.java
@@ -39,7 +39,6 @@ import jdk.nashorn.internal.runtime.regexp.joni.constants.NodeType;
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 @@ final class ArrayCompiler extends Compiler {
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 @@ final class ArrayCompiler extends Compiler {
}
}
+ @SuppressWarnings("unused")
private void addStateCheckNum(int num) {
addInt(num);
}
@@ -887,6 +888,7 @@ final class ArrayCompiler extends Compiler {
addInt(addr);
}
+ @SuppressWarnings("unused")
private void addAbsAddr(int addr) {
addInt(addr);
}
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java b/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java
index 5f98fe64..58ec56d6 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/BitSet.java
@@ -29,6 +29,7 @@ public final class BitSet {
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");
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java b/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
index bd997535..032c7470 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/ByteCodeMachine.java
@@ -96,6 +96,7 @@ class ByteCodeMachine extends StackMachine {
}
}
+ @Override
protected final int matchAt(int range, int sstart, int sprev) {
this.range = range;
this.sstart = sstart;
@@ -731,8 +732,6 @@ class ByteCodeMachine extends StackMachine {
// 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 @@ class ByteCodeMachine extends StackMachine {
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 @@ class ByteCodeMachine extends StackMachine {
s = swork;
- int len;
-
// beyond string check
if (sprev < range) {
while (sprev + 1 < s) sprev++;
@@ -829,7 +825,6 @@ class ByteCodeMachine extends StackMachine {
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 @@ class ByteCodeMachine extends StackMachine {
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 {
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java b/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java
index d61a03a5..260be2ab 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/CodeRangeBuffer.java
@@ -58,6 +58,7 @@ public final class CodeRangeBuffer implements Cloneable {
used = orig.used;
}
+ @Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("CodeRange");
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java b/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java
index 24dea8cb..dcef4e2e 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/Lexer.java
@@ -139,6 +139,7 @@ class Lexer extends ScannerSupport {
}
}
+ @SuppressWarnings("fallthrough")
/* \M-, \C-, \c, or \... */
private int fetchEscapedValue() {
if (!left()) {
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java b/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
index 09d4dcd6..2cbd0fce 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/Parser.java
@@ -297,8 +297,6 @@ class Parser extends Lexer {
throw new SyntaxException(ERR_END_PATTERN_IN_GROUP);
}
- boolean listCapture = false;
-
fetch();
switch(c) {
case ':': /* (?:...) grouping only */
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java b/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java
index ee9eb168..9281954c 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/Region.java
@@ -32,6 +32,7 @@ public final class Region {
this.end = new int[num];
}
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Region: \n");
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java b/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java
index 1135f766..ad4aaaf6 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/ScannerSupport.java
@@ -21,9 +21,6 @@ package jdk.nashorn.internal.runtime.regexp.joni;
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 {
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java b/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java
index 3b5a5474..758679a2 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/SearchAlgorithm.java
@@ -28,14 +28,17 @@ public abstract class SearchAlgorithm {
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 abstract class SearchAlgorithm {
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 @@ public abstract class SearchAlgorithm {
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 @@ public abstract class SearchAlgorithm {
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 @@ public abstract class SearchAlgorithm {
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 @@ public abstract class SearchAlgorithm {
}
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 @@ public abstract class SearchAlgorithm {
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 abstract class SearchAlgorithm {
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 @@ public abstract class SearchAlgorithm {
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;
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java b/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
index eb6fb7d4..cacf3182 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/StackMachine.java
@@ -458,7 +458,7 @@ abstract class StackMachine extends Matcher implements StackType {
isNull = 0;
break;
} else if (endp != s) {
- isNull = -1;; /* empty, but position changed */
+ isNull = -1; /* empty, but position changed */
}
}
k++;
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java b/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java
index f2a03535..91f7f7ae 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/WarnCallback.java
@@ -24,6 +24,7 @@ package jdk.nashorn.internal.runtime.regexp.joni;
*/
public interface WarnCallback {
WarnCallback DEFAULT = new WarnCallback() {
+ @Override
public void warn(String message) {
System.err.println(message);
}
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java b/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java
index 1c5bfe7d..e494c1cc 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/ast/EncloseNode.java
@@ -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;
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java b/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java
index 5bdf3487..fdf9687d 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/ast/Node.java
@@ -35,7 +35,7 @@ public abstract class Node implements NodeType {
}
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 @@ public abstract class Node implements NodeType {
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()) + ")>");
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java b/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java
index c87de29d..7d84accc 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/ast/QuantifierNode.java
@@ -223,6 +223,7 @@ public final class QuantifierNode extends StateNode {
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;
diff --git a/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java b/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java
index 917af7f6..66ec0cfe 100644
--- a/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java
+++ b/src/jdk/nashorn/internal/runtime/regexp/joni/exception/ErrorMessages.java
@@ -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 */
diff --git a/tools/fxshell/jdk/nashorn/tools/FXShell.java b/tools/fxshell/jdk/nashorn/tools/FXShell.java
index df473189..fe16ca20 100644
--- a/tools/fxshell/jdk/nashorn/tools/FXShell.java
+++ b/tools/fxshell/jdk/nashorn/tools/FXShell.java
@@ -32,13 +32,9 @@ import java.io.UnsupportedEncodingException;
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 @@ public class FXShell extends Application {
*
* @return Last evaluation result (discarded.)
*/
+ @SuppressWarnings("resource")
private Object load(String path) {
try {
FileInputStream file = new FileInputStream(path);