Fix a bunch of warnings.
git-svn-id: svn://10.0.0.236/trunk@225019 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f403a18825
commit
bd6958cc25
@ -107,7 +107,7 @@ public class DynamicScopes {
|
||||
useDynamicScope = true;
|
||||
runScripts(cx, script);
|
||||
} finally {
|
||||
cx.exit();
|
||||
Context.exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ public class RunScript {
|
||||
Object result = cx.evaluateString(scope, s, "<cmd>", 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.
|
||||
|
||||
@ -59,7 +59,7 @@ public class RunScript2 {
|
||||
s += args[i];
|
||||
}
|
||||
Object result = cx.evaluateString(scope, s, "<cmd>", 1, null);
|
||||
System.err.println(cx.toString(result));
|
||||
System.err.println(Context.toString(result));
|
||||
} finally {
|
||||
Context.exit();
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ public class RunScript4 {
|
||||
s += args[i];
|
||||
}
|
||||
Object result = cx.evaluateString(scope, s, "<cmd>", 1, null);
|
||||
System.err.println(cx.toString(result));
|
||||
System.err.println(Context.toString(result));
|
||||
} finally {
|
||||
Context.exit();
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user