This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 67046
Collapse All | Expand All

(-)api/src/org/netbeans/api/debugger/jpda/JPDADebugger.java (+9 lines)
Lines 322-327 Link Here
322
     * @return <code>true</code> if this debugger supports Pop action
322
     * @return <code>true</code> if this debugger supports Pop action
323
     */
323
     */
324
    public abstract boolean canPopFrames ();
324
    public abstract boolean canPopFrames ();
325
    
326
    /**
327
     * Determines if the target debuggee can be modified.
328
     *
329
     * @return <code>true</code> if the target debuggee can be modified.
330
     */
331
    public boolean canBeModified() {
332
        return true;
333
    }
325
334
326
    /**
335
    /**
327
     * Implements fix & continue (HotSwap). Map should contain class names
336
     * Implements fix & continue (HotSwap). Map should contain class names
(-)src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java (+30 lines)
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
        

Return to bug 67046