зеркало из https://github.com/mozilla/pjs.git
Replace when possible usage of API available only since JDK 1.2 by their JDK 1.1 analogous or by classes available in the Rhino core to make port to JDK 1.1 easier.
This commit is contained in:
Родитель
5c6025195c
Коммит
417ef274c7
|
@ -1728,7 +1728,7 @@ class UpdateContext implements Runnable {
|
||||||
db.context.disableUpdate();
|
db.context.disableUpdate();
|
||||||
int frameCount = contextData.getFrameCount();
|
int frameCount = contextData.getFrameCount();
|
||||||
ctx.removeAllItems();
|
ctx.removeAllItems();
|
||||||
toolTips.clear();
|
toolTips.removeAllElements();
|
||||||
for (int i = 0; i < frameCount; i++) {
|
for (int i = 0; i < frameCount; i++) {
|
||||||
FrameHelper frame = contextData.getFrame(i);
|
FrameHelper frame = contextData.getFrame(i);
|
||||||
String sourceName = frame.getSourceName();
|
String sourceName = frame.getSourceName();
|
||||||
|
@ -2201,7 +2201,7 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
|
|
||||||
/* ContextListener interface */
|
/* ContextListener interface */
|
||||||
|
|
||||||
java.util.HashSet contexts = new java.util.HashSet();
|
ObjToIntMap contexts = new ObjToIntMap();
|
||||||
|
|
||||||
static Thread mainThread; // thread used to run the shell
|
static Thread mainThread; // thread used to run the shell
|
||||||
|
|
||||||
|
@ -2228,9 +2228,9 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
// from its thread (we cause that to happen below
|
// from its thread (we cause that to happen below
|
||||||
// in interrupted)
|
// in interrupted)
|
||||||
synchronized (contexts) {
|
synchronized (contexts) {
|
||||||
if (!contexts.contains(cx)) {
|
if (!contexts.has(cx)) {
|
||||||
if (cx.getDebugger() == this) {
|
if (cx.getDebugger() == this) {
|
||||||
contexts.add(cx);
|
contexts.put(cx, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2252,9 +2252,9 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
public void doBreak() {
|
public void doBreak() {
|
||||||
breakFlag = true;
|
breakFlag = true;
|
||||||
synchronized (contexts) {
|
synchronized (contexts) {
|
||||||
Iterator iter = contexts.iterator();
|
ObjToIntMap.Iterator iter = contexts.newIterator();
|
||||||
while (iter.hasNext()) {
|
for (iter.start(); !iter.done(); iter.next()) {
|
||||||
Context cx = (Context)iter.next();
|
Context cx = (Context)iter.getKey();
|
||||||
ContextData.get(cx).breakNextLine = true;
|
ContextData.get(cx).breakNextLine = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2333,7 +2333,7 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
sourceName.substring(0, sourceName.length() - 6);
|
sourceName.substring(0, sourceName.length() - 6);
|
||||||
Vector v = (Vector)sourceNames.get(origSourceName);
|
Vector v = (Vector)sourceNames.get(origSourceName);
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
SourceEntry prev = (SourceEntry)v.get(v.size() - 1);
|
SourceEntry prev = (SourceEntry)v.elementAt(v.size() - 1);
|
||||||
source = prev.source;
|
source = prev.source;
|
||||||
SourceEntry entry = new SourceEntry(source, fnOrScript);
|
SourceEntry entry = new SourceEntry(source, fnOrScript);
|
||||||
v.addElement(entry);
|
v.addElement(entry);
|
||||||
|
@ -2602,7 +2602,7 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void swingInvoke(Runnable f) {
|
static void swingInvoke(Runnable f) {
|
||||||
if (java.awt.EventQueue.isDispatchThread()) {
|
if (SwingUtilities.isEventDispatchThread()) {
|
||||||
f.run();
|
f.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2680,7 +2680,7 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
|
|
||||||
void interrupted(Context cx) {
|
void interrupted(Context cx) {
|
||||||
synchronized (swingMonitor) {
|
synchronized (swingMonitor) {
|
||||||
if (java.awt.EventQueue.isDispatchThread()) {
|
if (SwingUtilities.isEventDispatchThread()) {
|
||||||
dispatcherIsWaiting++;
|
dispatcherIsWaiting++;
|
||||||
if (nonDispatcherWaiting) {
|
if (nonDispatcherWaiting) {
|
||||||
// Another thread is stopped in the debugger
|
// Another thread is stopped in the debugger
|
||||||
|
@ -2791,7 +2791,7 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
line = frame.getLineNumber();
|
line = frame.getLineNumber();
|
||||||
int enterCount = 0;
|
int enterCount = 0;
|
||||||
boolean isDispatchThread =
|
boolean isDispatchThread =
|
||||||
java.awt.EventQueue.isDispatchThread();
|
SwingUtilities.isEventDispatchThread();
|
||||||
|
|
||||||
if (!isDispatchThread) {
|
if (!isDispatchThread) {
|
||||||
// detach cx from its thread so the debugger (in the awt
|
// detach cx from its thread so the debugger (in the awt
|
||||||
|
@ -2922,7 +2922,7 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
} while (false);
|
} while (false);
|
||||||
synchronized (swingMonitor) {
|
synchronized (swingMonitor) {
|
||||||
isInterrupted = false;
|
isInterrupted = false;
|
||||||
if (java.awt.EventQueue.isDispatchThread()) {
|
if (SwingUtilities.isEventDispatchThread()) {
|
||||||
dispatcherIsWaiting--;
|
dispatcherIsWaiting--;
|
||||||
} else {
|
} else {
|
||||||
nonDispatcherWaiting = false;
|
nonDispatcherWaiting = false;
|
||||||
|
@ -2948,9 +2948,12 @@ public class Main extends JFrame implements Debugger, ContextListener {
|
||||||
try {
|
try {
|
||||||
String result = dlg.getSelectedFile().getCanonicalPath();
|
String result = dlg.getSelectedFile().getCanonicalPath();
|
||||||
CWD = dlg.getSelectedFile().getParentFile();
|
CWD = dlg.getSelectedFile().getParentFile();
|
||||||
java.lang.System.setProperty("user.dir", CWD.getPath());
|
Properties props = System.getProperties();
|
||||||
|
props.put("user.dir", CWD.getPath());
|
||||||
|
System.setProperties(props);
|
||||||
return result;
|
return result;
|
||||||
} catch (IOException ignored) {
|
}catch (IOException ignored) {
|
||||||
|
}catch (SecurityException ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче