Lines 313-318
Link Here
|
313 |
|
313 |
|
314 |
} |
314 |
} |
315 |
} |
315 |
} |
|
|
316 |
|
317 |
private Boolean canBeModified; |
318 |
private Object canBeModifiedLock = new Object(); |
319 |
|
320 |
public boolean canBeModified() { |
321 |
VirtualMachine vm = getVirtualMachine (); |
322 |
if (vm == null) return false; |
323 |
synchronized (canBeModifiedLock) { |
324 |
if (canBeModified == null) { |
325 |
try { |
326 |
java.lang.reflect.Method canBeModifiedMethod = |
327 |
com.sun.jdi.VirtualMachine.class.getMethod("canBeModified", new Class[] {}); |
328 |
Object modifiable = canBeModifiedMethod.invoke(vm, new Object[] {}); |
329 |
canBeModified = (Boolean) modifiable; |
330 |
} catch (NoSuchMethodException nsmex) { |
331 |
// On JDK 1.4 we do not know... we suppose that can |
332 |
canBeModified = Boolean.TRUE; |
333 |
} catch (IllegalAccessException iaex) { |
334 |
canBeModified = Boolean.TRUE; |
335 |
} catch (InvocationTargetException itex) { |
336 |
canBeModified = Boolean.TRUE; |
337 |
} |
338 |
} |
339 |
return canBeModified.booleanValue(); |
340 |
} |
341 |
// return vm.canBeModified(); -- After we'll build on JDK 1.5 |
342 |
} |
316 |
|
343 |
|
317 |
private SmartSteppingFilter smartSteppingFilter; |
344 |
private SmartSteppingFilter smartSteppingFilter; |
318 |
|
345 |
|
Lines 640-645
Link Here
|
640 |
JPDAUtils.printFeatures (vm); |
667 |
JPDAUtils.printFeatures (vm); |
641 |
} |
668 |
} |
642 |
virtualMachine = vm; |
669 |
virtualMachine = vm; |
|
|
670 |
synchronized (canBeModifiedLock) { |
671 |
canBeModified = null; // Reset the can be modified flag |
672 |
} |
643 |
|
673 |
|
644 |
initGenericsSupport (); |
674 |
initGenericsSupport (); |
645 |
|
675 |
|