diff --git a/mozilla/js/rhino/examples/DynamicScopes.java b/mozilla/js/rhino/examples/DynamicScopes.java index 22b9a3a43a9..10d53ac59ee 100644 --- a/mozilla/js/rhino/examples/DynamicScopes.java +++ b/mozilla/js/rhino/examples/DynamicScopes.java @@ -107,7 +107,7 @@ public class DynamicScopes { useDynamicScope = true; runScripts(cx, script); } finally { - cx.exit(); + Context.exit(); } } diff --git a/mozilla/js/rhino/examples/RunScript.java b/mozilla/js/rhino/examples/RunScript.java index 4b21eaa91c8..758ac6436bf 100644 --- a/mozilla/js/rhino/examples/RunScript.java +++ b/mozilla/js/rhino/examples/RunScript.java @@ -67,7 +67,7 @@ public class RunScript { Object result = cx.evaluateString(scope, s, "", 1, null); // Convert the result to a string and print it. - System.err.println(cx.toString(result)); + System.err.println(Context.toString(result)); } finally { // Exit from the context. diff --git a/mozilla/js/rhino/examples/RunScript2.java b/mozilla/js/rhino/examples/RunScript2.java index 630f11075da..cb028965075 100644 --- a/mozilla/js/rhino/examples/RunScript2.java +++ b/mozilla/js/rhino/examples/RunScript2.java @@ -59,7 +59,7 @@ public class RunScript2 { s += args[i]; } Object result = cx.evaluateString(scope, s, "", 1, null); - System.err.println(cx.toString(result)); + System.err.println(Context.toString(result)); } finally { Context.exit(); } diff --git a/mozilla/js/rhino/examples/RunScript4.java b/mozilla/js/rhino/examples/RunScript4.java index 670862fb2dd..bd3d6f4181e 100644 --- a/mozilla/js/rhino/examples/RunScript4.java +++ b/mozilla/js/rhino/examples/RunScript4.java @@ -68,7 +68,7 @@ public class RunScript4 { s += args[i]; } Object result = cx.evaluateString(scope, s, "", 1, null); - System.err.println(cx.toString(result)); + System.err.println(Context.toString(result)); } finally { Context.exit(); } diff --git a/mozilla/js/rhino/examples/Shell.java b/mozilla/js/rhino/examples/Shell.java index 8be9a3c9f3f..dd21ba77e71 100644 --- a/mozilla/js/rhino/examples/Shell.java +++ b/mozilla/js/rhino/examples/Shell.java @@ -111,7 +111,7 @@ public class Shell extends ScriptableObject if (arg.equals("-version")) { if (++i == args.length) usage(arg); - double d = cx.toNumber(args[i]); + double d = Context.toNumber(args[i]); if (d != d) usage(arg); cx.setLanguageVersion((int) d); @@ -202,7 +202,7 @@ public class Shell extends ScriptableObject { double result = (double) cx.getLanguageVersion(); if (args.length > 0) { - double d = cx.toNumber(args[0]); + double d = Context.toNumber(args[0]); cx.setLanguageVersion((int) d); } return result; @@ -219,7 +219,7 @@ public class Shell extends ScriptableObject { Shell shell = (Shell)getTopLevelScope(thisObj); for (int i = 0; i < args.length; i++) { - shell.processSource(cx, cx.toString(args[i])); + shell.processSource(cx, Context.toString(args[i])); } } @@ -267,8 +267,8 @@ public class Shell extends ScriptableObject Object result = cx.evaluateString(this, source, sourceName, startline, null); - if (result != cx.getUndefinedValue()) { - System.err.println(cx.toString(result)); + if (result != Context.getUndefinedValue()) { + System.err.println(Context.toString(result)); } } catch (WrappedException we) { diff --git a/mozilla/js/rhino/src/org/mozilla/classfile/ClassFileWriter.java b/mozilla/js/rhino/src/org/mozilla/classfile/ClassFileWriter.java index 216c2e11adb..907479e4c45 100644 --- a/mozilla/js/rhino/src/org/mozilla/classfile/ClassFileWriter.java +++ b/mozilla/js/rhino/src/org/mozilla/classfile/ClassFileWriter.java @@ -285,8 +285,6 @@ public class ClassFileWriter { * * @param maxLocals the maximum number of local variable slots * (a.k.a. Java registers) used by the method - * @param vars the array of the variables for the method, - * or null if none */ public void stopMethod(short maxLocals) { if (itsCurrentMethod == null) diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java b/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java index b33e47c2064..ccdfe854edc 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/ScriptableObject.java @@ -125,7 +125,6 @@ public abstract class ScriptableObject implements Scriptable, Serializable, */ private Scriptable parentScopeObject; - private static final Object HAS_STATIC_ACCESSORS = Void.TYPE; private static final Slot REMOVED = new Slot(null, 0, READONLY); static { @@ -2312,7 +2311,6 @@ public abstract class ScriptableObject implements Scriptable, Serializable, { if (count == 0) throw Kit.codeBug(); - int tableSize = newSlots.length; int i = slots.length; for (;;) { --i; diff --git a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java index 1071b305211..e2c03eb65d5 100644 --- a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java +++ b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java @@ -435,7 +435,6 @@ public class Dim { } String replace = null; int i = searchStart + 1; - boolean hasDigits = false; while (i != urlLength) { int c = url.charAt(i); if (!('0' <= c && c <= '9')) { @@ -728,8 +727,6 @@ public class Dim { private void interrupted(Context cx, final StackFrame frame, Throwable scriptException) { ContextData contextData = frame.contextData(); - int line = frame.getLineNumber(); - String url = frame.getUrl(); boolean eventThreadFlag = callback.isGuiEventThread(); contextData.eventThreadFlag = eventThreadFlag; @@ -1366,11 +1363,6 @@ interruptedCheck: */ private String url; - /** - * The line at which the script starts. - */ - private int minLine; - /** * Array indicating which lines can have breakpoints set. */ @@ -1434,7 +1426,6 @@ interruptedCheck: if (minAll > maxAll) { // No line information - this.minLine = -1; this.breakableLines = EMPTY_BOOLEAN_ARRAY; this.breakpoints = EMPTY_BOOLEAN_ARRAY; } else { @@ -1442,7 +1433,6 @@ interruptedCheck: // Line numbers can not be negative throw new IllegalStateException(String.valueOf(minAll)); } - this.minLine = minAll; int linesTop = maxAll + 1; this.breakableLines = new boolean[linesTop]; this.breakpoints = new boolean[linesTop]; diff --git a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java index 5cbaba93637..d940166c439 100644 --- a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java +++ b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java @@ -109,11 +109,6 @@ public class SwingGui extends JFrame implements GuiCallback { */ private JSInternalConsole console; - /** - * The script evaluation internal frame. - */ - private EvalWindow evalWindow; - /** * The {@link JSplitPane} that separates {@link #desk} from {@link context}. */ @@ -227,7 +222,6 @@ public class SwingGui extends JFrame implements GuiCallback { "Step Out (F8)"}; int count = 0; button = breakButton = new JButton("Break"); - JButton focusButton = button; button.setToolTipText("Break"); button.setActionCommand("Break"); button.addActionListener(menubar); @@ -963,7 +957,6 @@ class MessageDialogWrapper { char c = msg.charAt(i); buf.append(c); if (Character.isWhitespace(c)) { - int remainder = len - i; int k; for (k = i + 1; k < len; k++) { if (Character.isWhitespace(msg.charAt(k))) { @@ -1352,11 +1345,6 @@ class FilePopupMenu extends JPopupMenu { */ private static final long serialVersionUID = 3589525009546013565L; - /** - * The {@link FileTextArea} this popup menu is attached to. - */ - private FileTextArea w; - /** * The popup x position. */ @@ -1371,7 +1359,6 @@ class FilePopupMenu extends JPopupMenu { * Creates a new FilePopupMenu. */ public FilePopupMenu(FileTextArea w) { - this.w = w; JMenuItem item; add(item = new JMenuItem("Set Breakpoint")); item.addActionListener(w); @@ -1703,14 +1690,6 @@ class MoreWindows extends JDialog implements ActionListener { return value; } - /** - * Sets the selected value. - */ - private void setValue(String newValue) { - value = newValue; - list.setSelectedValue(value, true); - } - // ActionListener /** @@ -1770,11 +1749,6 @@ class FindFunction extends JDialog implements ActionListener { */ private JButton setButton; - /** - * The "Refresh" button. - */ - private JButton refreshButton; - /** * The "Cancel" button. */ @@ -1861,14 +1835,6 @@ class FindFunction extends JDialog implements ActionListener { return value; } - /** - * Sets the last function selected. - */ - private void setValue(String newValue) { - value = newValue; - list.setSelectedValue(value, true); - } - // ActionListener /** @@ -1973,7 +1939,6 @@ class FileHeader extends JPanel implements MouseListener { Rectangle clip = g.getClipBounds(); g.setColor(getBackground()); g.fillRect(clip.x, clip.y, clip.width, clip.height); - int left = getX(); int ascent = metrics.getMaxAscent(); int h = metrics.getHeight(); int lineCount = textArea.getLineCount() + 1; @@ -1981,7 +1946,6 @@ class FileHeader extends JPanel implements MouseListener { if (dummy.length() < 2) { dummy = "99"; } - int maxWidth = metrics.stringWidth(dummy); int startLine = clip.y / h; int endLine = (clip.y + clip.height) / h + 1; int width = getWidth(); @@ -1995,7 +1959,6 @@ class FileHeader extends JPanel implements MouseListener { } boolean isBreakPoint = fileWindow.isBreakPoint(i + 1); text = Integer.toString(i + 1) + " "; - int w = metrics.stringWidth(text); int y = i * h; g.setColor(Color.blue); g.drawString(text, 0, y + ascent); @@ -2066,7 +2029,6 @@ class FileHeader extends JPanel implements MouseListener { public void mouseReleased(MouseEvent e) { if (e.getComponent() == this && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) { - int x = e.getX(); int y = e.getY(); Font font = fileWindow.textArea.getFont(); FontMetrics metrics = getFontMetrics(font); @@ -2121,11 +2083,6 @@ class FileWindow extends JInternalFrame implements ActionListener { */ int currentPos; - /** - * The status bar. - */ - private JLabel statusBar; - /** * Loads the file. */ @@ -2988,7 +2945,6 @@ class ContextWindow extends JPanel implements ActionListener { final JPanel finalThis = this; ComponentListener clistener = new ComponentListener() { - boolean t1Docked = true; boolean t2Docked = true; void check(Component comp) { Component thisParent = finalThis.getParent(); @@ -3057,7 +3013,6 @@ class ContextWindow extends JPanel implements ActionListener { // no change return; } - t1Docked = leftDocked; t2Docked = rightDocked; JSplitPane split = (JSplitPane)thisParent; if (leftDocked) { diff --git a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java index a045346a536..42b0d72398c 100644 --- a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java +++ b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/Main.java @@ -46,8 +46,6 @@ import org.mozilla.javascript.tools.ToolErrorReporter; public class Main { - private static final String PROGRAM_NAME = "Main"; - private static final String SWITCH_TAG_STR = "string_id_map"; private static final String GENERATED_TAG_STR = "generated"; private static final String STRING_TAG_STR = "string"; @@ -131,14 +129,14 @@ public class Main { int time_stamp_begin = -1, time_stamp_end = -1; body.startLineLoop(); - L:while (body.nextLine()) { + while (body.nextLine()) { int begin = body.getLineBegin(); int end = body.getLineEnd(); int tag_id = extract_line_tag_id(buffer, begin, end); boolean bad_tag = false; switch (cur_state) { - case 0: + case NORMAL_LINE: if (tag_id == SWITCH_TAG) { cur_state = SWITCH_TAG; all_pairs.removeAllElements(); @@ -216,7 +214,6 @@ public class Main { private String get_time_stamp() { SimpleDateFormat f = new SimpleDateFormat (" 'Last update:' yyyy-MM-dd HH:mm:ss z"); - String dateString = f.format(new Date()); return f.format(new Date()); } @@ -611,8 +608,5 @@ public class Main { } return destination; } - - - } diff --git a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java index 7da345cd3ed..40336754377 100644 --- a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java +++ b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/idswitch/SwitchGenerator.java @@ -382,7 +382,6 @@ public class SwitchGenerator { } private EvaluatorException on_same_pair_fail(IdValuePair a, IdValuePair b) { - StringBuffer sb = new StringBuffer(); int line1 = a.getLineNumber(), line2 = b.getLineNumber(); if (line2 > line1) { int tmp = line1; line1 = line2; line2 = tmp; } String error_text = ToolErrorReporter.getMessage( @@ -485,4 +484,3 @@ public class SwitchGenerator { } } } - diff --git a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/shell/Main.java b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/shell/Main.java index ba821e14419..d2d06a0b65d 100644 --- a/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/shell/Main.java +++ b/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/shell/Main.java @@ -340,7 +340,6 @@ public class Main int lineno = 1; boolean hitEOF = false; while (!hitEOF) { - int startline = lineno; if (filename == null) ps.print("js> "); ps.flush();