Lines 7-13
Link Here
|
7 |
* http://www.sun.com/ |
7 |
* http://www.sun.com/ |
8 |
* |
8 |
* |
9 |
* The Original Code is NetBeans. The Initial Developer of the Original |
9 |
* The Original Code is NetBeans. The Initial Developer of the Original |
10 |
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun |
10 |
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun |
11 |
* Microsystems, Inc. All Rights Reserved. |
11 |
* Microsystems, Inc. All Rights Reserved. |
12 |
*/ |
12 |
*/ |
13 |
|
13 |
|
Lines 34-39
Link Here
|
34 |
public class BreakpointsReader implements Properties.Reader { |
34 |
public class BreakpointsReader implements Properties.Reader { |
35 |
|
35 |
|
36 |
private Map cachedClassNames = new WeakHashMap(); |
36 |
private Map cachedClassNames = new WeakHashMap(); |
|
|
37 |
private Map cachedSourceRoots = new WeakHashMap(); |
37 |
|
38 |
|
38 |
|
39 |
|
39 |
public String [] getSupportedClassNames () { |
40 |
public String [] getSupportedClassNames () { |
Lines 46-51
Link Here
|
46 |
return (String) cachedClassNames.get(b); |
47 |
return (String) cachedClassNames.get(b); |
47 |
} |
48 |
} |
48 |
|
49 |
|
|
|
50 |
synchronized String findCachedSourceRoot(JPDABreakpoint b) { |
51 |
return (String) cachedSourceRoots.get(b); |
52 |
} |
53 |
|
49 |
void storeCachedClassName(JPDABreakpoint b, String className) { |
54 |
void storeCachedClassName(JPDABreakpoint b, String className) { |
50 |
synchronized (this) { |
55 |
synchronized (this) { |
51 |
cachedClassNames.put(b, className); |
56 |
cachedClassNames.put(b, className); |
Lines 53-58
Link Here
|
53 |
PersistenceManager.storeBreakpoints(); |
58 |
PersistenceManager.storeBreakpoints(); |
54 |
} |
59 |
} |
55 |
|
60 |
|
|
|
61 |
void storeCachedSourceRoot(JPDABreakpoint b, String sourceRoot) { |
62 |
synchronized (this) { |
63 |
cachedSourceRoots.put(b, sourceRoot); |
64 |
} |
65 |
PersistenceManager.storeBreakpoints(); |
66 |
} |
67 |
|
56 |
public Object read (String typeID, Properties properties) { |
68 |
public Object read (String typeID, Properties properties) { |
57 |
JPDABreakpoint b = null; |
69 |
JPDABreakpoint b = null; |
58 |
// Read both LineBreakpoint and LineBreakpoint$LineBreakpointImpl |
70 |
// Read both LineBreakpoint and LineBreakpoint$LineBreakpointImpl |
Lines 67-72
Link Here
|
67 |
); |
79 |
); |
68 |
synchronized (this) { |
80 |
synchronized (this) { |
69 |
cachedClassNames.put(lb, properties.getString("className", null)); |
81 |
cachedClassNames.put(lb, properties.getString("className", null)); |
|
|
82 |
cachedSourceRoots.put(lb, properties.getString("sourceRoot", null)); |
70 |
} |
83 |
} |
71 |
b = lb; |
84 |
b = lb; |
72 |
} |
85 |
} |
Lines 96-101
Link Here
|
96 |
MethodBreakpoint.TYPE_METHOD_ENTRY |
109 |
MethodBreakpoint.TYPE_METHOD_ENTRY |
97 |
) |
110 |
) |
98 |
); |
111 |
); |
|
|
112 |
synchronized (this) { |
113 |
cachedSourceRoots.put(mb, properties.getString("sourceRoot", null)); |
114 |
} |
99 |
b = mb; |
115 |
b = mb; |
100 |
} |
116 |
} |
101 |
if (typeID.equals (ClassLoadUnloadBreakpoint.class.getName ())) { |
117 |
if (typeID.equals (ClassLoadUnloadBreakpoint.class.getName ())) { |
Lines 117-122
Link Here
|
117 |
new String [0] |
133 |
new String [0] |
118 |
) |
134 |
) |
119 |
); |
135 |
); |
|
|
136 |
synchronized (this) { |
137 |
cachedSourceRoots.put(cb, properties.getString("sourceRoot", null)); |
138 |
} |
120 |
b = cb; |
139 |
b = cb; |
121 |
} |
140 |
} |
122 |
if (typeID.equals (ExceptionBreakpoint.class.getName ())) { |
141 |
if (typeID.equals (ExceptionBreakpoint.class.getName ())) { |
Lines 133-138
Link Here
|
133 |
eb.setCondition ( |
152 |
eb.setCondition ( |
134 |
properties.getString (ExceptionBreakpoint.PROP_CONDITION, "") |
153 |
properties.getString (ExceptionBreakpoint.PROP_CONDITION, "") |
135 |
); |
154 |
); |
|
|
155 |
synchronized (this) { |
156 |
cachedSourceRoots.put(eb, properties.getString("sourceRoot", null)); |
157 |
} |
136 |
b = eb; |
158 |
b = eb; |
137 |
} |
159 |
} |
138 |
if (typeID.equals (FieldBreakpoint.class.getName ())) { |
160 |
if (typeID.equals (FieldBreakpoint.class.getName ())) { |
Lines 147-152
Link Here
|
147 |
fb.setCondition ( |
169 |
fb.setCondition ( |
148 |
properties.getString (FieldBreakpoint.PROP_CONDITION, "") |
170 |
properties.getString (FieldBreakpoint.PROP_CONDITION, "") |
149 |
); |
171 |
); |
|
|
172 |
synchronized (this) { |
173 |
cachedSourceRoots.put(fb, properties.getString("sourceRoot", null)); |
174 |
} |
150 |
b = fb; |
175 |
b = fb; |
151 |
} |
176 |
} |
152 |
if (typeID.equals (ThreadBreakpoint.class.getName ())) { |
177 |
if (typeID.equals (ThreadBreakpoint.class.getName ())) { |
Lines 204-211
Link Here
|
204 |
LineBreakpoint.PROP_CONDITION, |
229 |
LineBreakpoint.PROP_CONDITION, |
205 |
lb.getCondition () |
230 |
lb.getCondition () |
206 |
); |
231 |
); |
207 |
String className = findCachedClassName(lb); |
232 |
properties.setString("className", findCachedClassName(lb)); |
208 |
properties.setString("className", className); |
233 |
properties.setString("sourceRoot", findCachedSourceRoot(lb)); |
209 |
return; |
234 |
return; |
210 |
} else |
235 |
} else |
211 |
if (object instanceof MethodBreakpoint) { |
236 |
if (object instanceof MethodBreakpoint) { |
Lines 230-235
Link Here
|
230 |
MethodBreakpoint.PROP_BREAKPOINT_TYPE, |
255 |
MethodBreakpoint.PROP_BREAKPOINT_TYPE, |
231 |
mb.getBreakpointType () |
256 |
mb.getBreakpointType () |
232 |
); |
257 |
); |
|
|
258 |
properties.setString("sourceRoot", findCachedSourceRoot(mb)); |
233 |
return; |
259 |
return; |
234 |
} else |
260 |
} else |
235 |
if (object instanceof ClassLoadUnloadBreakpoint) { |
261 |
if (object instanceof ClassLoadUnloadBreakpoint) { |
Lines 246-251
Link Here
|
246 |
ClassLoadUnloadBreakpoint.PROP_BREAKPOINT_TYPE, |
272 |
ClassLoadUnloadBreakpoint.PROP_BREAKPOINT_TYPE, |
247 |
cb.getBreakpointType () |
273 |
cb.getBreakpointType () |
248 |
); |
274 |
); |
|
|
275 |
properties.setString("sourceRoot", findCachedSourceRoot(cb)); |
249 |
return; |
276 |
return; |
250 |
} else |
277 |
} else |
251 |
if (object instanceof ExceptionBreakpoint) { |
278 |
if (object instanceof ExceptionBreakpoint) { |
Lines 262-267
Link Here
|
262 |
ExceptionBreakpoint.PROP_CONDITION, |
289 |
ExceptionBreakpoint.PROP_CONDITION, |
263 |
eb.getCondition () |
290 |
eb.getCondition () |
264 |
); |
291 |
); |
|
|
292 |
properties.setString("sourceRoot", findCachedSourceRoot(eb)); |
265 |
return; |
293 |
return; |
266 |
} else |
294 |
} else |
267 |
if (object instanceof FieldBreakpoint) { |
295 |
if (object instanceof FieldBreakpoint) { |
Lines 282-287
Link Here
|
282 |
FieldBreakpoint.PROP_BREAKPOINT_TYPE, |
310 |
FieldBreakpoint.PROP_BREAKPOINT_TYPE, |
283 |
fb.getBreakpointType () |
311 |
fb.getBreakpointType () |
284 |
); |
312 |
); |
|
|
313 |
properties.setString("sourceRoot", findCachedSourceRoot(fb)); |
285 |
return; |
314 |
return; |
286 |
} else |
315 |
} else |
287 |
if (object instanceof ThreadBreakpoint) { |
316 |
if (object instanceof ThreadBreakpoint) { |