1
1
package dataTool ;
2
-
3
2
import java .util .ArrayList ;
4
3
import java .util .HashSet ;
5
4
import java .util .Set ;
6
5
import java .util .TreeSet ;
7
-
8
6
import org .eclipse .jdt .core .IMethod ;
9
7
import org .eclipse .jdt .core .JavaModelException ;
10
8
import org .eclipse .jdt .core .dom .AST ;
28
26
import org .eclipse .ui .PlatformUI ;
29
27
import org .eclipse .ui .texteditor .AbstractDecoratedTextEditor ;
30
28
import org .eclipse .ui .texteditor .AbstractTextEditor ;
31
-
32
29
import dataTool .annotations .LinkAnnotation ;
33
30
import dataTool .annotations .ProgramNavigationPainter ;
34
31
import dataTool .annotations .SuggestedSelectionAnnotation ;
35
- import dataTool .ui .ShowDataInBreadcrumbAction ;
36
32
import edu .pdx .cs .multiview .jdt .util .JDTUtils ;
37
33
import edu .pdx .cs .multiview .jface .annotation .AnnTransaction ;
38
34
import edu .pdx .cs .multiview .jface .annotation .AnnotationPainter ;
@@ -49,10 +45,8 @@ public class AnnotationManager implements ISelectionChangedListener {
49
45
private boolean isEnabled ;
50
46
private IBreadcrumb upBreadcrumb ;
51
47
private IBreadcrumb downBreadcrumb ;
48
+ private Visitor visitor ; // the visitor for the editor
52
49
53
- // the visitor for the editor
54
- private Visitor visitor ;
55
-
56
50
public static String currentSearch = null ;
57
51
58
52
/**
@@ -205,7 +199,7 @@ private DataNode getNode(int position) {
205
199
private void parseCU (AbstractTextEditor editor ) {
206
200
try {
207
201
visitor = parse (JDTUtils .getCUSource (editor ));
208
- } catch (JavaModelException e ) {
202
+ } catch (JavaModelException | ClassCastException e ) {
209
203
Activator .logError (e );
210
204
}
211
205
}
@@ -240,10 +234,9 @@ public void removeAnnotations() {
240
234
try {
241
235
if (highlightAnnotation != null ) {
242
236
painter .removeAllAnnotations ();
243
- painter .dispose ();
237
+ // painter.dispose();
244
238
}
245
239
} catch (Exception ignore ) {
246
- System .out .println ("ignore" );
247
240
}
248
241
}
249
242
0 commit comments