Skip to content

Commit 0077771

Browse files
committed
This commit finishes the short term cleanup of DrScala, ignoring the
incompatiblity with Windows (other than the Windows 10 Linux subsystem). The following files were modifed, added, or deleted modified: drjava/lib/plt.jar modified: drjava/src/edu/rice/cs/drjava/model/AbstractGlobalModel.java modified: drjava/src/edu/rice/cs/drjava/model/DefaultGlobalModel.java modified: drjava/src/edu/rice/cs/drjava/model/GlobalModelCompileIOTest.java modified: drjava/src/edu/rice/cs/drjava/model/GlobalModelCompileSuccessOptionsTest.java modified: drjava/src/edu/rice/cs/drjava/model/GlobalModelIOTest.java modified: drjava/src/edu/rice/cs/drjava/model/GlobalModelJUnitTest.java modified: drjava/src/edu/rice/cs/drjava/model/GlobalModelOtherTest.java modified: drjava/src/edu/rice/cs/drjava/model/compiler/DefaultCompilerModel.java modified: drjava/src/edu/rice/cs/drjava/model/repl/RMIInteractionsModel.java modified: drjava/src/edu/rice/cs/drjava/model/repl/newjvm/ClassPathManager.java modified: drjava/src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java modified: plt/plt.jar modified: plt/src/edu/rice/cs/plt/io/IOUtil.java modified: plt/src/edu/rice/cs/plt/reflect/ReflectUtil.java
1 parent fc7c51e commit 0077771

15 files changed

+54
-61
lines changed

drjava/lib/plt.jar

28 Bytes
Binary file not shown.

drjava/src/edu/rice/cs/drjava/model/AbstractGlobalModel.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,7 +2451,7 @@ public List<File> getSourceRootSet() {
24512451
}
24522452
}
24532453
List<File> result = new ArrayList<File>(roots);
2454-
Utilities.show("getSourceRootSet() returning " + result);
2454+
_log.log("getSourceRootSet() returning " + result);
24552455
return result;
24562456
}
24572457

@@ -3336,7 +3336,6 @@ public boolean checkIfClassFileInSync() {
33363336
if ((classFile == FileOps.NULL_FILE) || (! classFile.exists())) {
33373337
// couldn't find the class file
33383338
_log.log(this + ": Could not find class file");
3339-
System.err.println(this + ": Could not find class file");
33403339
setClassFileInSync(false);
33413340
return false;
33423341
}

drjava/src/edu/rice/cs/drjava/model/DefaultGlobalModel.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ private Iterable<JDKToolsLibrary> findLibraries() {
342342

343343
/** Sets the build directory for a project. */
344344
public void setBuildDirectory(File f) {
345-
Utilities.show("setBuildDirectory(" + f + ") called");
346345
_state.setBuildDirectory(f);
347346
if (f != FileOps.NULL_FILE) {
348347
// This transaction appears redundant since the information is passed to the slave JVM after each compilation. */
@@ -709,7 +708,7 @@ protected ConcreteOpenDefDoc _createOpenDefinitionsDocument(File f) throws IOExc
709708
protected void addDocToClassPath(OpenDefinitionsDocument doc) {
710709
try {
711710
File sourceRoot = doc.getSourceRoot();
712-
Utilities.show("In DefaultGlobalModel.addDocToClassPath, adding '" + sourceRoot + "'to interactions class path");
711+
_log.log("In DefaultGlobalModel.addDocToClassPath, adding '" + sourceRoot + "'to interactions class path");
713712
_interactionsModel.addInteractionsClassPath(sourceRoot);
714713
// setClassPathChanged(true);
715714
}
@@ -727,7 +726,6 @@ public List<File> getClassPath() {
727726
if (isProjectActive()) {
728727
File buildDir = getBuildDirectory();
729728
if (buildDir != null && buildDir != FileOps.NULL_FILE) {
730-
Utilities.show("Build Directory is " + buildDir);
731729
result.add(buildDir);
732730
}
733731

@@ -740,21 +738,21 @@ public List<File> getClassPath() {
740738
File projRoot = getProjectRoot();
741739
if (projRoot != null && projRoot != FileOps.NULL_FILE) {
742740
result.add(projRoot);
743-
Utilities.show("Project root is " + projRoot);
741+
_log.log("Project root is " + projRoot);
744742
}
745743

746744
List<AbsRelFile> projectExtras = getExtraProjectClassPath();
747745
if (projectExtras != null && projectExtras != FileOps.NULL_FILE) {
748746
result.addAll(projectExtras);
749-
Utilities.show("Project Extras " + projectExtras + " added to accumlated result in getClassPath()");
747+
_log.log("Project Extras " + projectExtras + " added to accumlated result in getClassPath()");
750748
}
751749
}
752750
else { result.addAll(getSourceRootSet()); }
753751

754752
ArrayList<File> globalExtras = DrScala.getConfig().getSetting(EXTRA_CLASSPATH);
755753
if (globalExtras != null) {
756754
result.addAll(globalExtras);
757-
Utilities.show("Global Extras " + globalExtras + " added to class path");
755+
_log.log("Global Extras " + globalExtras + " added to class path");
758756
}
759757

760758
/* We must add JUnit to the class path. We do so by including the current JVM's class path (fixed on startup).
@@ -763,9 +761,9 @@ public List<File> getClassPath() {
763761
* want to continue bundling JUnit with DrJava.
764762
*/
765763
result.addAll(ReflectUtil.SYSTEM_CLASS_PATH);
766-
Utilities.show("SYSTEM_CLASS_PATH = " + ReflectUtil.SYSTEM_CLASS_PATH);
764+
_log.log("SYSTEM_CLASS_PATH = " + ReflectUtil.SYSTEM_CLASS_PATH);
767765

768-
Utilities.show("getClassPath() is returning '" + result + "'");
766+
_log.log("getClassPath() is returning '" + result + "'");
769767

770768
return result;
771769
}
@@ -780,7 +778,7 @@ public List<File> getInteractionsClassPath() {
780778
* outside the event handling thread. */
781779
public void updateInteractionsClassPath() {
782780
List<File> icp = getClassPath();
783-
Utilities.show("In DefaultGlobalModel, updating interactions class path '" + icp + "'");
781+
_log.log("In DefaultGlobalModel, updating interactions class path '" + icp + "'");
784782
_interactionsModel.addInteractionsClassPath(icp);
785783
}
786784
}

drjava/src/edu/rice/cs/drjava/model/GlobalModelCompileIOTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testClassFileSynchronization() throws BadLocationException, IOExcept
8484
listener.checkCompileOccurred();
8585

8686
assertTrue("should be in sync after compile", doc.checkIfClassFileInSync());
87-
System.err.println(_model.getOpenDefinitionsDocuments());
87+
// System.err.println(_model.getOpenDefinitionsDocuments());
8888
assertTrue("The state of all open documents should be in sync", ! _model.hasOutOfSyncDocuments());
8989

9090
// Make sure .class exists

drjava/src/edu/rice/cs/drjava/model/GlobalModelCompileSuccessOptionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void testCompileAllDifferentSourceRoots() throws BadLocationException, IO
157157

158158
// Make sure .class files exist for the first file in expected place
159159
File compiled = classForScala(file2, "DrScalaTestBar");
160-
System.err.println("Class file for DrScalaTestBar = " + compiled);
160+
// System.err.println("Class file for DrScalaTestBar = " + compiled);
161161
assertTrue(_name() + "Bar Class file exists after compile", compiled.exists());
162162
// Scalac does not respond to null destination by placing each class file in corresponding source file's folder
163163
// File compiled2 = classForScala(file2, "DrSclaTestFoo");

drjava/src/edu/rice/cs/drjava/model/GlobalModelIOTest.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,11 @@ public void testSaveAlreadySaved() throws BadLocationException, IOException {
747747
// No listeners here -- othervoid tests ensure the first save works
748748
saveFile(doc, new FileSelector(file));
749749
assertModified(false, doc);
750-
System.err.println("original file saved");
750+
// System.err.println("original file saved");
751751
assertContents(FOO_TEXT, doc);
752752
assertEquals("contents of saved file", FOO_TEXT, IOUtil.toString(file));
753753

754-
System.err.println("Creating listener");
754+
// System.err.println("Creating listener");
755755

756756
TestListener listener = new TestListener() {
757757
public void fileSaved(OpenDefinitionsDocument doc) {
@@ -760,7 +760,7 @@ public void fileSaved(OpenDefinitionsDocument doc) {
760760
catch (FileMovedException fme) { fail("file does not exist"); /* We know file should exist */ }
761761
try {
762762
assertEquals("saved file", file.getCanonicalFile(), f.getCanonicalFile());
763-
System.err.println("Saved file is same as original");
763+
// System.err.println("Saved file is same as original");
764764
synchronized(this) { saveCount++; }
765765
}
766766
catch (IOException ioe) { fail("could not get canonical file"); }
@@ -769,16 +769,16 @@ public void fileSaved(OpenDefinitionsDocument doc) {
769769

770770
_model.addListener(listener);
771771

772-
System.err.println("Listener created");
772+
// System.err.println("Listener created");
773773

774774
// Muck up the document
775775
changeDocumentText(BAR_TEXT, doc);
776776

777-
System.err.println("Document changed");
777+
// System.err.println("Document changed");
778778

779779
saveFile(doc, new CancelingSelector());
780780

781-
System.err.println("saveFile(...) is executed");
781+
// System.err.println("saveFile(...) is executed");
782782

783783
// The file should have saved on top of the old text anyhow.
784784
// The canceling selector should never have been called.
@@ -788,7 +788,7 @@ public void fileSaved(OpenDefinitionsDocument doc) {
788788

789789
assertEquals("contents of saved file", BAR_TEXT, IOUtil.toString(file));
790790

791-
System.err.println("testCancelSaveAlreadySaved completed");
791+
// System.err.println("testCancelSaveAlreadySaved completed");
792792

793793
_log.log("testCancelSaveAlreadySaved completed");
794794
}
@@ -806,25 +806,25 @@ public void testCancelSaveAsAlreadySaved() throws BadLocationException, IOExcept
806806

807807
// No listeners here -- othervoid tests ensure the first save works
808808
saveFile(fooDoc, new FileSelector(fooFile));
809-
System.err.println("saveFile(...) executed");
809+
// System.err.println("saveFile(...) executed");
810810
assertModified(false, fooDoc);
811811
assertContents(FOO_TEXT, fooDoc);
812812
assertEquals("contents of saved file", FOO_TEXT, IOUtil.toString(fooFile));
813813

814814
// No events better be fired!
815815
_model.addListener(new TestListener());
816-
System.err.println("Listener added");
816+
// System.err.println("Listener added");
817817

818818
// Muck up the document
819819
Utilities.invokeAndWait(new Runnable() {
820820
public void run() { changeDocumentText(BAR_TEXT, fooDoc); }
821821
});
822822

823-
System.err.println("Document text changed");
823+
// System.err.println("Document text changed");
824824

825825
saveFileAs(fooDoc, new CancelingSelector());
826826

827-
System.err.println("saveFileAs(...) executed");
827+
// System.err.println("saveFileAs(...) executed");
828828

829829
assertEquals("contents of saved file", FOO_TEXT, IOUtil.toString(fooFile));
830830

@@ -1199,17 +1199,17 @@ public void run() {
11991199
listener.assertInteractionStartCount(0);
12001200
listener.logInteractionStart();
12011201
safeLoadHistory(fs1);
1202-
System.err.println("fs1[" + fs1 + "]");
1202+
// System.err.println("fs1[" + fs1 + "]");
12031203
listener.waitInteractionDone();
12041204

12051205
listener.logInteractionStart();
12061206
safeLoadHistory(fs2);
1207-
System.err.println("fs2[" + fs2 + "]");
1207+
// System.err.println("fs2[" + fs2 + "]");
12081208
listener.waitInteractionDone();
12091209

12101210
// check that output of loaded history is correct
12111211
ConsoleDocument con = _model.getConsoleDocument();
1212-
System.err.println("con = \n" + con.getDocText(0, con.getLength()) + "\n***End of Console***");
1212+
// System.err.println("con = \n" + con.getDocText(0, con.getLength()) + "\n***End of Console***");
12131213

12141214
assertEquals("Output of loaded history is not correct: " + con.getDocText(0, con.getLength()).trim(),
12151215
"x = 5" + StringOps.EOL + "x = 5",
@@ -1262,10 +1262,10 @@ public String getConsoleInput() {
12621262
return "input\n"; // '\n' is used because this input is generated by Swing processing of keystrokes
12631263
}
12641264
});
1265-
System.err.println("ClassPath = '" + IterUtil.multilineToString(_model.getClassPath()) + "'");
1265+
// System.err.println("ClassPath = '" + IterUtil.multilineToString(_model.getClassPath()) + "'");
12661266
String result = interpret("val z = System.in.read()");
1267-
System.err.println("result = " + result);
1268-
System.err.println("ClassPath = '" + IterUtil.multilineToString(_model.getClassPath()) + "'");
1267+
// System.err.println("result = " + result);
1268+
// System.err.println("ClassPath = '" + IterUtil.multilineToString(_model.getClassPath()) + "'");
12691269
String expected = "z: Int = " + String.valueOf((int)'i');
12701270
assertEquals("read() should prompt for input and return the first byte of \"input\"", expected, result);
12711271

drjava/src/edu/rice/cs/drjava/model/GlobalModelJUnitTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ public void testNoJUnitErrors_NOJOIN() throws Exception {
316316

317317
/** Tests that a JUnit file with an error is reported to have an error. */
318318
public void xtestOneJUnitError_NOJOIN() throws Exception {
319-
if (printMessages) System.err.println("----testOneJUnitError-----");
320319
_log.log("Starting testOneJUnitError_NOJOIN");
321320

322321
final OpenDefinitionsDocument doc = setupDocument(MONKEYTEST_FAIL_TEXT);
@@ -340,7 +339,6 @@ public void xtestOneJUnitError_NOJOIN() throws Exception {
340339

341340
/** Tests that a JUnit file with an error is reported to have an error. */
342341
public void xtestElspethOneJUnitError_NOJOIN() throws Exception {
343-
if (printMessages) System.err.println("----testElspethOneJUnitError-----");
344342
_log.log("Starting testElspethOneJunitError_NOJOIN");
345343

346344
OpenDefinitionsDocument doc = setupDocument(ELSPETH_ERROR_TEXT);
@@ -365,7 +363,6 @@ public void xtestElspethOneJUnitError_NOJOIN() throws Exception {
365363

366364
/** Tests that a test class which throws a *real* Error (not an Exception) is handled correctly. */
367365
public void xtestRealError_NOJOIN() throws Exception {
368-
if (printMessages) System.err.println("----testRealError-----");
369366
_log.log("Startinging testRealError_NOJOIN");
370367

371368
OpenDefinitionsDocument doc = setupDocument(MONKEYTEST_ERROR_TEXT);

drjava/src/edu/rice/cs/drjava/model/GlobalModelOtherTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public void testInteractionsCanSeeCompiledClasses() throws BadLocationException,
167167
// example format of REPL result: res0: java.lang.String = DrScalaTestFoo
168168
String pattern = "\\s*res[0-9]+: String = DrScalaTestFoo\\s*";
169169
String result = interpret("new DrScalaTestFoo().getClass().getName()");
170-
System.err.println("result = '" + result + "'");
170+
// System.err.println("result = '" + result + "'");
171171
assertTrue("interactions result matches pattern", result.matches(pattern));
172172

173173
// Add directory 1 to extra classpath and close doc1
@@ -492,7 +492,7 @@ public void testInteractionsLiveUpdateClassPath() throws BadLocationException, E
492492
File tempDir = makeCanonical(new File(tempPath));
493493
tempDir.renameTo(makeCanonical(new File(tempPath + "a")));
494494
tempDir.deleteOnExit();
495-
System.err.println("Renamed directory = '" + tempDir + "'");
495+
// System.err.println("Renamed directory = '" + tempDir + "'");
496496

497497
String result = interpret("new DrScalaTestFoo().getClass().getName()");
498498

@@ -501,7 +501,7 @@ public void testInteractionsLiveUpdateClassPath() throws BadLocationException, E
501501
assertFalse("interactions should have an error, not the correct answer", "\"DrScalaTestFoo\"".equals(result));
502502
// System.err.println("Result1 is: " + result);
503503

504-
System.err.println("Classpath before extension = '" + _model.getClassPath() + "'");
504+
// System.err.println("Classpath before extension = '" + _model.getClassPath() + "'");
505505

506506
// Add new directory to classpath through Config
507507
ArrayList<File> cp = new ArrayList<File>();
@@ -511,25 +511,25 @@ public void testInteractionsLiveUpdateClassPath() throws BadLocationException, E
511511
/* renamedDir is NOT the same as tempDir which was NOT mutated by renameTo method */
512512
// assertEquals("File.renameTo modifies its receiver", tempDir, renamedDir);
513513
cp.add(renamedDir);
514-
System.err.println("Extra Classpath = '" + cp + "'");
514+
// System.err.println("Extra Classpath = '" + cp + "'");
515515
DrScala.getConfig().setSetting(EXTRA_CLASSPATH, cp);
516516

517517
Utilities.clearEventQueue();
518518
_model.updateInteractionsClassPath();
519519

520520
Iterable<File> newCp = _model.getClassPath();
521-
System.err.println("New class path is:\n" + IterUtil.multilineToString(newCp));
522-
System.err.println("Classpath after extension = '" + _model.getClassPath() + "'");
521+
// System.err.println("New class path is:\n" + IterUtil.multilineToString(newCp));
522+
// System.err.println("Classpath after extension = '" + _model.getClassPath() + "'");
523523
// Utilities.show("Pause to inspect class path including " + cp);
524524

525525
// example format of REPL result: res0: String = DrScalaTestFoo
526526
String pattern = "\\s*res[0-9]+: String = DrScalaTestFoo\\s*";
527527
result = interpret("new DrScalaTestFoo().getClass().getName()");
528-
System.err.println("result = '" + result + "'; pattern = '" + pattern + "'");
528+
// System.err.println("result = '" + result + "'; pattern = '" + pattern + "'");
529529

530530
// Now it should be on the classpath
531531
assertTrue("interactions result matches pattern", result.matches(pattern));
532-
System.err.println("result = '" + result + "'");
532+
// System.err.println("result = '" + result + "'");
533533
// Rename directory back to clean up
534534
tempDir = makeCanonical(new File(tempPath + "a"));
535535
tempDir.renameTo(makeCanonical(new File(tempPath)));
@@ -541,7 +541,6 @@ public void testInteractionsLiveUpdateClassPath() throws BadLocationException, E
541541
/** Tests that the appropriate event is fired when the model's interpreter changes.*/
542542
// Need to patch code to replace interpreter
543543
public void xtestReplaceInterpreter() {
544-
// debug.logStart();
545544

546545
_log.log("Starting testReplaceInterpreters");
547546
TestListener listener = new TestListener() {

drjava/src/edu/rice/cs/drjava/model/compiler/DefaultCompilerModel.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ private boolean _prepareForCompile() {
242242
/** Compile the given documents. All compile commands invoke this private method! */
243243
private void _doCompile(List<OpenDefinitionsDocument> docs) throws IOException {
244244
// _LLSTM.clearCache();
245-
Utilities.show("doCompile(" + docs + ") called");
246245
_log.log("_doCompile(" + docs + ") called");
247246
final ArrayList<File> filesToCompile = new ArrayList<File>();
248247
// final ArrayList<OpenDefinitionsDocument> validDocs = new ArrayList<OpenDefinitionsDocument>();
@@ -362,10 +361,9 @@ private void _compileFiles(List<File> files, File buildDir) throws IOException {
362361

363362
// Temporary hack to allow a boot class path to be specified
364363
List<File> bootClassPath = null;
365-
// String bootProp = System.getProperty("drscala.bootclasspath");
366-
// if (bootProp != null) { bootClassPath = CollectUtil.makeList(IOUtil.parsePath(bootProp)); }
367364

368365
final LinkedList<DJError> errors = new LinkedList<DJError>();
366+
369367
// Mutual exclusion with JUnit code that finds all test classes (in DefaultJUnitModel)
370368
synchronized(_compilerLock) {
371369
_log.log("Calling the compiler adapter on: \n files = " + files + "\n classPath = '" + classPath +

drjava/src/edu/rice/cs/drjava/model/repl/RMIInteractionsModel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ public void setUpNewInterpreter() {
131131
EventQueue.invokeLater(new Runnable() {
132132
public void run() {
133133
_log.log("RMIInteractionsModel.setUpNewInterpreter called");
134-
System.err.println("RMIInteractionsModel.setUpNewInterpreter called");
135134
_jvm.restartInterpreterJVM();
136135
_notifyInterpreterReplaced();
137136
EventQueue.invokeLater(new Runnable() { public void run() { documentReset(); } });

0 commit comments

Comments
 (0)