It appears that ColorGlyphPainter.paint is calling
AbstractDJDocument.getHightlightStatus when the reduced model cursor
is atStart, apparently violating an invariant assumed by
ReducedModel.getHighlightStatus. I don't why such an invariant was
assumed since moving the reduced model cursor can place the cursor
atStart.
I have added a check for this condition in
ReducedModelControl.getHighlightStatus, which causes the method to use
the same default values for curLength and curState as it does when the
cursor is atEnd. I also changed the default value of curLength which
looked wrong; the old value was the absolute location of the cursor +
the length of the highlight segment being queried when it should be
simply the length of the highlight segment. Fortunately, the cursor
is rarely atEnd in this context, so the erroneous code was rarely
executed.
The revisions to other files were cosmetic, except for
DefinitionsPaneTest where I added some additional event-queueing call
in an attempt to prevent the memory leak test from occasionally
failing.
The following files were modified:
M src/edu/rice/cs/drjava/model/definitions/reducedmodel/ReducedModelControl.java
M src/edu/rice/cs/drjava/model/AbstractGlobalModel.java
M src/edu/rice/cs/drjava/ui/config/VectorClassnameOptionComponent.java
M src/edu/rice/cs/drjava/ui/DefinitionsPaneTest.java