11package dataTool ;
2-
32import java .util .ArrayList ;
43import java .util .HashSet ;
54import java .util .Set ;
65import java .util .TreeSet ;
7-
86import org .eclipse .jdt .core .IMethod ;
97import org .eclipse .jdt .core .JavaModelException ;
108import org .eclipse .jdt .core .dom .AST ;
2826import org .eclipse .ui .PlatformUI ;
2927import org .eclipse .ui .texteditor .AbstractDecoratedTextEditor ;
3028import org .eclipse .ui .texteditor .AbstractTextEditor ;
31-
3229import dataTool .annotations .LinkAnnotation ;
3330import dataTool .annotations .ProgramNavigationPainter ;
3431import dataTool .annotations .SuggestedSelectionAnnotation ;
35- import dataTool .ui .ShowDataInBreadcrumbAction ;
3632import edu .pdx .cs .multiview .jdt .util .JDTUtils ;
3733import edu .pdx .cs .multiview .jface .annotation .AnnTransaction ;
3834import edu .pdx .cs .multiview .jface .annotation .AnnotationPainter ;
@@ -49,10 +45,8 @@ public class AnnotationManager implements ISelectionChangedListener {
4945 private boolean isEnabled ;
5046 private IBreadcrumb upBreadcrumb ;
5147 private IBreadcrumb downBreadcrumb ;
48+ private Visitor visitor ; // the visitor for the editor
5249
53- // the visitor for the editor
54- private Visitor visitor ;
55-
5650 public static String currentSearch = null ;
5751
5852 /**
@@ -205,7 +199,7 @@ private DataNode getNode(int position) {
205199 private void parseCU (AbstractTextEditor editor ) {
206200 try {
207201 visitor = parse (JDTUtils .getCUSource (editor ));
208- } catch (JavaModelException e ) {
202+ } catch (JavaModelException | ClassCastException e ) {
209203 Activator .logError (e );
210204 }
211205 }
@@ -240,10 +234,9 @@ public void removeAnnotations() {
240234 try {
241235 if (highlightAnnotation != null ) {
242236 painter .removeAllAnnotations ();
243- painter .dispose ();
237+ // painter.dispose();
244238 }
245239 } catch (Exception ignore ) {
246- System .out .println ("ignore" );
247240 }
248241 }
249242
0 commit comments