Skip to content

Commit 93db0ca

Browse files
committed
Added comments in JUnitEventNotifier and MainJVM.java
Changes to be committed: modified: junit/JUnitEventNotifier.java modified: repl/newjvm/MainJVM.java
1 parent 2331c79 commit 93db0ca

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

drjava/src/edu/rice/cs/drjava/model/junit/JUnitEventNotifier.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@
5858
* or removing listeners (writing) at a time, and no reads can occur
5959
* during a write.
6060
* <p>
61-
*
61+
* Addendum [Corky March, 2025] In hindsight, the event notification framework is unnecessarily complex and buggy. Essentially
62+
* all event notification code runs in the "dispatch (event-handling) thread". The design should have forced ALL event
63+
* notication code to run in the dispatch thread. Then the read-write locking protocol would be unnecessary. I suspect
64+
* that "adminstrative methods" like addListener and removeListener are accessed from outside of the dispatch thread. In addition,
65+
* some events are signalled by RMI calls from JUnitTestRunner (and elsewhere?) in the slave JVM. The RMI "proxy" thead in
66+
* the main JVM apparently does not route event notifications through the dispatch thread. Ugh.
67+
* <p>
6268
* <i>No</i> methods on this class should be synchronized using traditionalJava synchronization!
6369
* <p>
6470
*

drjava/src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ protected void handleSlaveWontStart(Exception e) {
193193
debug.log("Slave won't start", e);
194194
_state.value().startFailed(e);
195195
}
196-
197-
198196

199197
/*
200198
* === MainJVMRemoteI methods ===
199+
* [Corky March 2025] Should the notifications passed to the InteractionsModel and JUnitModel be delegated to the
200+
* dispatch thread?
201201
*/
202202

203203
// TODO: export other objects, such as the interactionsModel, thus avoiding the need to delegate here?

0 commit comments

Comments
 (0)