Skip to content

Commit 7363b79

Browse files
author
mgricken
committed
In this commit, the changes in revisions 4540 and 4541 that were accidentally
made to the trunk were reverted. The trunk is now back to the state it was in after revision 4538. The following files were accidentally changed in revisions 4540 or 4541 and have been reverted to revision 4538: M src/edu/rice/cs/drjava/DrJavaTestCase.java M src/edu/rice/cs/drjava/IndentFiles.java M src/edu/rice/cs/drjava/DrJava.java M src/edu/rice/cs/drjava/DrJavaRoot.java M src/edu/rice/cs/drjava/model/DummyGlobalModelListener.java M src/edu/rice/cs/drjava/model/debug/jpda/JPDADebugger.java M src/edu/rice/cs/drjava/model/GlobalModelIOTest.java M src/edu/rice/cs/drjava/model/GlobalModelTestCase.java M src/edu/rice/cs/drjava/model/GlobalModel.java M src/edu/rice/cs/drjava/model/GlobalModelCompileSuccessTest.java M src/edu/rice/cs/drjava/model/DefaultGlobalModel.java M src/edu/rice/cs/drjava/model/GlobalModelCompileErrorsTest.java M src/edu/rice/cs/drjava/model/definitions/indent/IndentRuleWithTraceTest.java M src/edu/rice/cs/drjava/model/definitions/indent/IndentRuleWithTrace.java M src/edu/rice/cs/drjava/model/definitions/indent/IndentRuleQuestion.java M src/edu/rice/cs/drjava/model/definitions/indent/IndentRulesTestCase.java M src/edu/rice/cs/drjava/model/definitions/ColoringView.java M src/edu/rice/cs/drjava/model/definitions/DefinitionsDocumentTest.java M src/edu/rice/cs/drjava/model/definitions/DefinitionsDocument.java M src/edu/rice/cs/drjava/model/definitions/reducedmodel/BraceInfoTest.java M src/edu/rice/cs/drjava/model/definitions/IndentTest.java M src/edu/rice/cs/drjava/model/definitions/IndentHelperTest.java M src/edu/rice/cs/drjava/model/GlobalModelCompileSuccessOptionsTest.java M src/edu/rice/cs/drjava/model/GlobalEventNotifier.java M src/edu/rice/cs/drjava/model/junit/DefaultJUnitModel.java M src/edu/rice/cs/drjava/model/junit/JUnitErrorModelTest.java M src/edu/rice/cs/drjava/model/junit/JUnitModel.java M src/edu/rice/cs/drjava/model/repl/InteractionsModelCallback.java M src/edu/rice/cs/drjava/model/repl/InteractionsDocument.java M src/edu/rice/cs/drjava/model/repl/HistoryTest.java M src/edu/rice/cs/drjava/model/repl/History.java M src/edu/rice/cs/drjava/model/repl/InteractionsScriptModel.java M src/edu/rice/cs/drjava/model/repl/InteractionsDJDocumentTest.java M src/edu/rice/cs/drjava/model/repl/InteractionsDJDocument.java M src/edu/rice/cs/drjava/model/repl/InteractionsModelTest.java M src/edu/rice/cs/drjava/model/repl/InteractionsModel.java M src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java M src/edu/rice/cs/drjava/model/repl/newjvm/MainJVMRemoteI.java M src/edu/rice/cs/drjava/model/repl/newjvm/NewJVMTest.java M src/edu/rice/cs/drjava/model/repl/DefaultInteractionsModel.java M src/edu/rice/cs/drjava/model/repl/RMIInteractionsModel.java M src/edu/rice/cs/drjava/model/repl/SimpleInteractionsModel.java M src/edu/rice/cs/drjava/model/GlobalModelJUnitTest.java M src/edu/rice/cs/drjava/model/AbstractDJDocument.java M src/edu/rice/cs/drjava/model/GlobalModelCompileIOTest.java M src/edu/rice/cs/drjava/model/DummyOpenDefDoc.java M src/edu/rice/cs/drjava/model/MultiThreadedTestCase.java M src/edu/rice/cs/drjava/model/compiler/CompilerListener.java M src/edu/rice/cs/drjava/model/compiler/DefaultCompilerModel.java M src/edu/rice/cs/drjava/model/compiler/CompilerEventNotifier.java M src/edu/rice/cs/drjava/model/compiler/DummyCompilerListener.java M src/edu/rice/cs/drjava/model/GlobalModelCompileTest.java M src/edu/rice/cs/drjava/model/FindReplaceMachine.java M src/edu/rice/cs/drjava/model/AbstractGlobalModel.java M src/edu/rice/cs/drjava/model/GlobalModelOtherTest.java M src/edu/rice/cs/drjava/model/OpenDefinitionsDocument.java M src/edu/rice/cs/drjava/model/DJDocument.java M src/edu/rice/cs/drjava/config/Configuration.java M src/edu/rice/cs/drjava/config/OptionParser.java M src/edu/rice/cs/drjava/config/Option.java M src/edu/rice/cs/drjava/config/IntegerOption.java M src/edu/rice/cs/drjava/ui/MainFrame.java M src/edu/rice/cs/drjava/ui/DrJavaErrorPopup.java M src/edu/rice/cs/drjava/ui/DefinitionsPane.java M src/edu/rice/cs/drjava/ui/ErrorPanel.java M src/edu/rice/cs/drjava/ui/predictive/PredictiveInputFrame.java M src/edu/rice/cs/drjava/ui/ErrorCaretListener.java M src/edu/rice/cs/drjava/ui/config/IntegerOptionComponent.java M src/edu/rice/cs/drjava/ui/config/ToolbarOptionComponent.java M src/edu/rice/cs/drjava/ui/config/StringOptionComponent.java M src/edu/rice/cs/drjava/ui/config/FontOptionComponent.java M src/edu/rice/cs/drjava/ui/config/ConfigPanel.java M src/edu/rice/cs/drjava/ui/config/ForcedChoiceOptionComponent.java M src/edu/rice/cs/drjava/ui/config/OptionComponent.java M src/edu/rice/cs/drjava/ui/config/KeyStrokeOptionComponent.java M src/edu/rice/cs/drjava/ui/AbstractDJPane.java M src/edu/rice/cs/drjava/ui/BrowserHistoryPanel.java M src/edu/rice/cs/drjava/ui/MainFrameTest.java M src/edu/rice/cs/drjava/ui/BreakpointsPanel.java M src/edu/rice/cs/drjava/ui/RegionsTreePanel.java M src/edu/rice/cs/drjava/ui/InteractionsPaneTest.java M src/edu/rice/cs/drjava/ui/DefinitionsPaneTest.java M src/edu/rice/cs/drjava/ui/RegionsListPanel.java M src/edu/rice/cs/drjava/ui/FindReplacePanel.java M src/edu/rice/cs/drjava/ui/InteractionsController.java M src/edu/rice/cs/drjava/ui/JUnitPanel.java M src/edu/rice/cs/drjava/ui/DrJavaErrorHandler.java M src/edu/rice/cs/drjava/ui/AbstractConsoleController.java M src/edu/rice/cs/util/FileOps.java M src/edu/rice/cs/util/text/ConsoleDocument.java M src/edu/rice/cs/util/text/ConsoleDocumentTest.java M src/edu/rice/cs/util/text/AbstractDocumentInterface.java M src/edu/rice/cs/util/text/EditDocumentInterface.java M src/edu/rice/cs/util/text/SwingDocument.java M src/edu/rice/cs/util/text/ReadersWritersLocking.java M src/edu/rice/cs/util/StringOps.java git-svn-id: file:///tmp/test-svn/trunk@4543 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 0106f3c commit 7363b79

File tree

96 files changed

+2102
-2380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2102
-2380
lines changed

drjava/src/edu/rice/cs/drjava/DrJava.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
*/
7676
public class DrJava {
7777

78-
private static volatile Log _log = new Log("DrJava.txt", false);
78+
private static Log _log = new Log("DrJava.txt", false);
7979

8080
private static final String DEFAULT_MAX_HEAP_SIZE_ARG = "-Xmx128M";
8181

@@ -178,7 +178,7 @@ public static void configureAndLoadDrJavaRoot(String[] args) {
178178
// Add the parameters "-debugConsole" to classArgsList if _showDebugConsole is true
179179
if (_showDebugConsole) { classArgsList.addFirst("-debugConsole"); }
180180

181-
if (! _propertiesFile.equals(DEFAULT_PROPERTIES_FILE)) {
181+
if (!_propertiesFile.equals(DEFAULT_PROPERTIES_FILE)) {
182182
// Placed in reversed order to get "-config filename"
183183
classArgsList.addFirst(_propertiesFile.getAbsolutePath());
184184
classArgsList.addFirst("-config");
@@ -388,12 +388,10 @@ static FileConfiguration _initConfig() throws IllegalStateException {
388388

389389
FileConfiguration config;
390390

391-
final File propFile = _propertiesFile; // a static variable shared across configurations in tests
392-
393-
try { propFile.createNewFile(); } // be nice and ensure a config file if there isn't one
391+
try { _propertiesFile.createNewFile(); } // be nice and ensure a config file if there isn't one
394392
catch (IOException e) { /* IOException occurred, continue without a real file */ }
395393

396-
config = new FileConfiguration(propFile);
394+
config = new FileConfiguration(_propertiesFile);
397395
try { config.loadConfiguration(); }
398396
catch (Exception e) {
399397
// Problem parsing the config file. Use defaults and remember what happened (for the UI).
@@ -465,9 +463,10 @@ protected static void _saveConfig() {
465463

466464
/* Erase all non-final bindings created in this class. Only used in testing. */
467465
public static void cleanUp() {
466+
_propertiesFile = null;
468467
_filesToOpen.clear();
469468
_jvmArgs.clear();
470-
// Do not set _config or _propertiesFile to null because THEY ARE static
469+
// _config = null; // appears to cause problems in cleanup
471470
}
472471

473472
}

drjava/src/edu/rice/cs/drjava/DrJavaRoot.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ public static void main(final String[] args) {
137137

138138
// Utilities.showDebug("Creating MainFrame");
139139

140-
try { _mainFrame = new MainFrame(); }
140+
try {
141+
_mainFrame = new MainFrame();
142+
}
141143
catch(RuntimeException e) {
142144
Throwable c = e.getCause();
143145
if ((c instanceof java.rmi.server.ExportException) && (c.getMessage().equals("Listen failed on port: 0"))) {
@@ -333,7 +335,7 @@ public static void drop(DropTargetDropEvent dropTargetDropEvent) {
333335
_mainFrame.drop(dropTargetDropEvent);
334336
}
335337

336-
/** Installs the modal window adapter if available, otherwise installs a non-modal dummy listener.
338+
/** Return the modal window listener if available, otherwise returns a non-modal dummy listener.
337339
* @param w window trying to get the modal window listener
338340
* @param toFrontAction action to be performed after the window has been moved to the front again
339341
* @param closeAction action to be performed when the window is closing
@@ -344,7 +346,7 @@ public static void installModalWindowAdapter(final Window w,
344346
_mainFrame.installModalWindowAdapter(w, toFrontAction, closeAction);
345347
}
346348

347-
/** Removes the modal window adapter.
349+
/** Removethe modal window adapter.
348350
* @param w window releasing the modal window adapter */
349351
public static void removeModalWindowAdapter(Window w) {
350352
_mainFrame.removeModalWindowAdapter(w);

drjava/src/edu/rice/cs/drjava/DrJavaTestCase.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,21 @@ protected void setUp() throws Exception {
6363
Utilities.TEST_MODE = true;
6464
final String newName = System.getProperty(TEST_DRJAVA_CONFIG_PROPERTY);
6565
assert newName != null;
66-
// if (newName != null) {
66+
if (newName != null) {
6767
// Utilities.show("Setting '" + newName + "' as DrJava configuration file");
68-
Utilities.invokeLater(new Runnable() {
69-
public void run() {
70-
DrJava.setPropertiesFile(newName); // spawns change updates which should run in event thread
71-
// Utilities.clearEventQueue();
72-
DrJava._initConfig(); // spawns change updates which should run in event thread
73-
// Utilities.clearEventQueue();
74-
}
75-
});
76-
// }
68+
DrJava.setPropertiesFile(newName);
69+
Utilities.clearEventQueue();
70+
DrJava._initConfig();
71+
Utilities.clearEventQueue();
72+
}
7773
}
7874

7975
/** Clean up for every test case. Only used in unit tests. Added because Windows would intermittently throw
8076
* a java.util.concurrent.RejectedExecutionException during cleanup.
8177
* @throws Exception
8278
*/
8379
protected void tearDown() throws Exception {
84-
DrJava.cleanUp();
80+
DrJava.cleanUp(); // clobbers _config
8581
super.tearDown();
8682
}
8783
}

drjava/src/edu/rice/cs/drjava/IndentFiles.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public static void main(String[] args) {
8181
}
8282
}
8383

84-
/** Displays a message showing how to use this class. */
84+
/** Displays a message showing how to use this class.
85+
*/
8586
private static void _displayUsage() {
8687
System.out.println(
8788
"Usage:" +
@@ -110,14 +111,14 @@ public static void indentFiles(Vector<String> fileNames, int indentLevel, boolea
110111
try {
111112
String fileContents = IOUtil.toString(file);
112113
DefinitionsDocument doc = new DefinitionsDocument(indenter, new GlobalEventNotifier());
113-
// doc.acquireWriteLock();
114-
// try {
115-
doc._insertString(0, fileContents, null); // (no attributes)
116-
int docLen = doc.getLength();
117-
doc.indentLines(0, docLen);
118-
fileContents = doc.getText();
119-
// }
120-
// finally { doc.releaseWriteLock(); }
114+
doc.acquireWriteLock();
115+
try {
116+
doc._insertString(0, fileContents, null); // (no attributes)
117+
int docLen = doc.getLength();
118+
doc.indentLines(0, docLen);
119+
fileContents = doc.getText();
120+
}
121+
finally { doc.releaseWriteLock(); }
121122
IOUtil.writeStringToFile(file, fileContents);
122123
if (!silent) System.out.println("done.");
123124
}

drjava/src/edu/rice/cs/drjava/config/Configuration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public Configuration(OptionMap om) {
6565
*/
6666
public <T> T setSetting(final Option<T> op, final T value) {
6767
T ret = map.setOption(op, value);
68-
// System.err.println("setSetting(" + op + ", " + value + ") called");
6968
Utilities.invokeLater(new Runnable() { public void run() { op.notifyListeners(Configuration.this, value); } });
7069
return ret;
7170
}

drjava/src/edu/rice/cs/drjava/config/IntegerOption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class IntegerOption extends Option<Integer> {
4545
* @param def The default value for this option
4646
*/
4747
public IntegerOption(String key, Integer def) {
48-
super(key, def);
48+
super(key,def);
4949
}
5050

5151
/** @param s The String to be parsed.

drjava/src/edu/rice/cs/drjava/config/Option.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
*/
6262
public abstract class Option<T> extends OptionParser<T> implements FormatStrategy<T> {
6363

64-
/** A hashtable that maps Configuration objects to a list of listeners for this particular option. Part of the magic
64+
/** A hashtable that maps Configuration Objects to a list of listeners for this particular option. Part of the magic
6565
* inner workings of this package.
6666
*/
6767
final Hashtable<Configuration,Vector<OptionListener<T>>> listeners =
@@ -90,12 +90,10 @@ public abstract class Option<T> extends OptionParser<T> implements FormatStrateg
9090
String getString(DefaultOptionMap om) { return format(getOption(om)); }
9191

9292
/** Sends an OptionEvent to all OptionListeners who have registered on this Option. */
93-
synchronized void notifyListeners(Configuration config, T val) {
93+
void notifyListeners(Configuration config, T val) {
9494
final Vector<OptionListener<T>> v = listeners.get(config);
95-
// System.err.println("Notifying " + v + " with value " + val);
9695
if (v == null) return; // no listeners
9796
final OptionEvent<T> e = new OptionEvent<T>(this, val);
98-
// System.err.println("OptionEvent = " + e);
9997
Utilities.invokeLater(new Runnable() {
10098
public void run() {
10199
for (int i = 0; i < v.size(); ++i) v.get(i).optionChanged(e);
@@ -104,7 +102,7 @@ public void run() {
104102
}
105103

106104
/** Magic listener-bag adder */
107-
synchronized void addListener(Configuration c, OptionListener<T> l) {
105+
void addListener(Configuration c, OptionListener<T> l) {
108106
Vector<OptionListener<T>> v = listeners.get(c);
109107
if (v == null) {
110108
v = new Vector<OptionListener<T>>();
@@ -114,7 +112,7 @@ synchronized void addListener(Configuration c, OptionListener<T> l) {
114112
}
115113

116114
/** Magic listener-bag remover */
117-
synchronized void removeListener(Configuration c, OptionListener<T> l) {
115+
void removeListener(Configuration c, OptionListener<T> l) {
118116
Vector<OptionListener<T>> v = listeners.get(c);
119117
if (v != null && v.remove(l) && v.size() == 0) listeners.remove(c); // v.remove(l) has a side effect!
120118
}

drjava/src/edu/rice/cs/drjava/config/OptionParser.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public abstract class OptionParser<T> implements ParseStrategy<T> {
4545
* and a String is immutable.
4646
*/
4747
public final String name;
48-
protected final T defaultValue;
48+
private final T defaultValue;
4949

5050
/** An inner hashtable that maps DefaultOptionMaps to value T's. Part of the magic inner workings of this package. */
5151
final Hashtable<DefaultOptionMap,T> map = new Hashtable<DefaultOptionMap,T>();
@@ -73,9 +73,6 @@ public abstract class OptionParser<T> implements ParseStrategy<T> {
7373
*/
7474
public abstract T parse(String value);
7575

76-
/** Returns a string representation of this OptionParser/Option suitable for debugging. */
77-
public String toString() { return "Option<" + name + ", " + defaultValue + ">"; }
78-
7976
/* PACKAGE PRIVATE MAGIC STUFF
8077
* This package-private magic stuff makes all of the config "magic" types work. Basically, it's achieved via a
8178
* double-dispatch stunt, so that the type information is saved. */

0 commit comments

Comments
 (0)