Skip to content

Commit 63981b1

Browse files
committed
This revision adds a few new unit tests and slightly cleans up code
via improved formatting and the deletion of some unreachable code, e.g. cases in switch statements corresponding to language levels that are no longer supported. The following files were modified, added, or deleted: modified: src/edu/rice/cs/drjava/model/AbstractDJDocument.java modified: src/edu/rice/cs/drjava/model/AbstractGlobalModel.java modified: src/edu/rice/cs/drjava/model/DJDocument.java modified: src/edu/rice/cs/drjava/model/DummyOpenDefDoc.java modified: src/edu/rice/cs/drjava/model/DummyOpenDefDocTest.java modified: src/edu/rice/cs/drjava/ui/DefinitionsPane.java modified: src/edu/rice/cs/drjava/ui/JavaSourceFilter.java
1 parent ea25009 commit 63981b1

File tree

7 files changed

+297
-60
lines changed

7 files changed

+297
-60
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ public abstract class AbstractDJDocument extends SwingDocument implements DJDocu
110110

111111
/*-------- FIELDS ----------*/
112112

113-
// /** Whether a block indent operation is in progress on this document. */
114-
// private volatile boolean _indentInProgress = false;
115-
116113
/** The reduced model of the document (stored in field _reduced) handles most of the document logic and keeps
117114
* track of state. This field together with _currentLocation function as a virtual object for purposes of
118115
* synchronization. All operations that access or modify this virtual object should be synchronized on _reduced.
@@ -1058,7 +1055,7 @@ private void _indentBlock(final int start, final int end, Indenter.IndentReason
10581055
final Position endPos = this.createUnwrappedPosition(end);
10591056
// Iterate, line by line, until we get to/past the end
10601057
int walker = start;
1061-
// _indentInProgress = true;
1058+
10621059
while (walker < endPos.getOffset()) {
10631060
setCurrentLocation(walker);
10641061
// Keep pointer to walker position that will stay current regardless of how indentLine changes things
@@ -1078,7 +1075,6 @@ private void _indentBlock(final int start, final int end, Indenter.IndentReason
10781075
// Adding 1 makes us point to the first character AFTER the next newline. We don't actually move the
10791076
// location yet. That happens at the top of the loop, after we check if we're past the end.
10801077
walker += _reduced.getDistToNextNewline() + 1;
1081-
// _indentInProgress = false;
10821078
}
10831079

10841080
// disable the query cache

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,8 +3640,6 @@ public void setCurrentLocation(int location) {
36403640
/** Get the location of the cursor in the definitions according to the definitions document. */
36413641
public int getCurrentLocation() { return getDocument().getCurrentLocation(); }
36423642

3643-
// public boolean indentInProgress() { return getDocument().indentInProgress(); }
3644-
36453643
/** @return the caret position as set by the view. */
36463644
public int getCaretPosition() { return _caretPosition; }
36473645

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ public interface DJDocument extends SwingDocumentInterface {
8585
* @param dist the distance from the current location to the new location.
8686
*/
8787
public void move(int dist);
88-
89-
// /* Returns whether a block indent operation is in progress on this document. */
90-
// public boolean indentInProgress();
91-
88+
9289
/** Finds the match for the closing brace immediately to the left, assuming there is such a brace.
9390
* @return the relative distance backwards to the offset before the matching brace.
9491
*/

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

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,22 @@
6060
import edu.rice.cs.util.docnavigation.*;
6161
import edu.rice.cs.util.text.SwingDocument;
6262

63-
public class DummyOpenDefDoc implements OpenDefinitionsDocument {
64-
65-
// public int id() {
66-
// throw new UnsupportedOperationException("Dummy method");
67-
// }
63+
public class DummyOpenDefDoc implements OpenDefinitionsDocument {
6864

6965
public int compareTo(OpenDefinitionsDocument d) {
7066
throw new UnsupportedOperationException("Dummy method");
7167
}
7268

7369
public boolean modifiedOnDisk() { throw new UnsupportedOperationException("Dummy method"); }
7470

75-
public void addBrowserRegion(BrowserDocumentRegion r) {
76-
throw new UnsupportedOperationException("Dummy method");
77-
}
71+
public void addBrowserRegion(BrowserDocumentRegion r) { throw new UnsupportedOperationException("Dummy method"); }
72+
73+
public void removeBrowserRegion(BrowserDocumentRegion r) { throw new UnsupportedOperationException("Dummy method"); }
7874

79-
public void removeBrowserRegion(BrowserDocumentRegion r) {
80-
throw new UnsupportedOperationException("Dummy method");
81-
}
8275
public boolean saveFile(FileSaveSelector com) throws IOException {
8376
throw new UnsupportedOperationException("Dummy method");
8477
}
8578

86-
// public void uncommentLinesInDefinitions(int selStart, int selEnd) {
87-
// throw new UnsupportedOperationException("Dummy method");
88-
// }
89-
9079
public boolean canAbandonFile() { throw new UnsupportedOperationException("Dummy method"); }
9180

9281
public boolean quitFile() { throw new UnsupportedOperationException("Dummy method"); }
@@ -97,8 +86,6 @@ public boolean saveFile(FileSaveSelector com) throws IOException {
9786

9887
public boolean isModifiedSinceSave() { throw new UnsupportedOperationException("Dummy method"); }
9988

100-
// public boolean indentInProgress() { throw new UnsupportedOperationException("Dummy method"); }
101-
10289
public int balanceForward() { throw new UnsupportedOperationException("Dummy method"); }
10390

10491
public int balanceBackward() { throw new UnsupportedOperationException("Dummy method"); }
@@ -147,18 +134,6 @@ public void print() throws PrinterException, BadLocationException, FileMovedExce
147134
public RegionManager<Breakpoint> getBreakpointManager() { throw new UnsupportedOperationException("Dummy method"); }
148135

149136
public RegionManager<MovingDocumentRegion> getBookmarkManager() { throw new UnsupportedOperationException("Dummy method"); }
150-
151-
// public List<RegionManager<MovingDocumentRegion>> getFindResultsManagers() {
152-
// throw new UnsupportedOperationException("Dummy method");
153-
// }
154-
155-
// public void addFindResultsManager(RegionManager<MovingDocumentRegion> rm) {
156-
// throw new UnsupportedOperationException("Dummy method");
157-
// }
158-
//
159-
// public void removeFindResultsManager(RegionManager<MovingDocumentRegion> rm) {
160-
// throw new UnsupportedOperationException("Dummy method");
161-
// }
162137

163138
public void clearBrowserRegions() { throw new UnsupportedOperationException("Dummy method"); }
164139

0 commit comments

Comments
 (0)