Lines 69-74
Link Here
|
69 |
import java.util.Set; |
69 |
import java.util.Set; |
70 |
import java.util.SortedMap; |
70 |
import java.util.SortedMap; |
71 |
import java.util.TreeMap; |
71 |
import java.util.TreeMap; |
|
|
72 |
import java.util.WeakHashMap; |
72 |
import java.util.logging.Level; |
73 |
import java.util.logging.Level; |
73 |
import java.util.logging.Logger; |
74 |
import java.util.logging.Logger; |
74 |
import javax.swing.JEditorPane; |
75 |
import javax.swing.JEditorPane; |
Lines 117-122
Link Here
|
117 |
import org.openide.util.NbBundle; |
118 |
import org.openide.util.NbBundle; |
118 |
import org.openide.util.Pair; |
119 |
import org.openide.util.Pair; |
119 |
import org.openide.util.RequestProcessor.Task; |
120 |
import org.openide.util.RequestProcessor.Task; |
|
|
121 |
import org.openide.util.WeakSet; |
120 |
|
122 |
|
121 |
/** |
123 |
/** |
122 |
* |
124 |
* |
Lines 153-159
Link Here
|
153 |
private DataObject od; |
155 |
private DataObject od; |
154 |
private final BaseDocument doc; |
156 |
private final BaseDocument doc; |
155 |
|
157 |
|
156 |
private static Map<DataObject, AnnotationHolder> file2Holder = new HashMap<DataObject, AnnotationHolder>(); |
158 |
private static final Map<DataObject, AnnotationHolder> file2Holder = new WeakHashMap<DataObject, AnnotationHolder>(); |
157 |
|
159 |
|
158 |
static { |
160 |
static { |
159 |
EditorRegistry.addPropertyChangeListener(new PropertyChangeListener() { |
161 |
EditorRegistry.addPropertyChangeListener(new PropertyChangeListener() { |
Lines 243-249
Link Here
|
243 |
|
245 |
|
244 |
@SuppressWarnings("LeakingThisInConstructor") |
246 |
@SuppressWarnings("LeakingThisInConstructor") |
245 |
private AnnotationHolder(FileObject file, DataObject od, BaseDocument doc) { |
247 |
private AnnotationHolder(FileObject file, DataObject od, BaseDocument doc) { |
246 |
openedComponents = new HashSet<>(); |
248 |
openedComponents = new WeakSet<>(); |
247 |
|
249 |
|
248 |
this.doc = doc; |
250 |
this.doc = doc; |
249 |
|
251 |
|