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 (+11 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 or when
330
     *         this information is not available (on JDK 1.4).
331
     * @since 2.3
332
     */
333
    public boolean canBeModified() {
334
        return true;
335
    }
325
336
326
    /**
337
    /**
327
     * Implements fix & continue (HotSwap). Map should contain class names
338
     * Implements fix & continue (HotSwap). Map should contain class names
(-)api/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.api.debugger.jpda/2
2
OpenIDE-Module: org.netbeans.api.debugger.jpda/2
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.2
4
OpenIDE-Module-Specification-Version: 2.3
5
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
5
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
6
6
(-)api/apichanges.xml (+17 lines)
Lines 348-353 Link Here
348
        <class package="org.netbeans.api.debugger.jpda" name="JPDAThread" />
348
        <class package="org.netbeans.api.debugger.jpda" name="JPDAThread" />
349
        <issue number="59072"/>
349
        <issue number="59072"/>
350
    </change>
350
    </change>
351
    <change>
352
        <api name="JPDADebuggerAPI"/>
353
        <summary>Added canBeModified() method to JPDADebugger class</summary>
354
        <version major="2" minor="3"/>
355
        <date day="21" month="10" year="2005"/>
356
        <author login="mentlicher"/>
357
        <compatibility addition="yes" source="compatible" binary="compatible"/>
358
        <description>
359
            <p>
360
                A possibility to detect whether the debuggee is read-only is added.
361
                This check works fine on JDK 1.5 and higher, on JDK 1.4 it returns
362
                <code>true</code> by default.
363
            </p>
364
        </description>
365
        <class package="org.netbeans.api.debugger.jpda" name="JPDADebugger" />
366
        <issue number="67046"/>
367
    </change>
351
368
352
</changes>
369
</changes>
353
370
(-)arch.xml (-3 / +5 lines)
Lines 126-132 Link Here
126
        </question>
126
        </question>
127
-->
127
-->
128
<answer id="dep-jre">
128
<answer id="dep-jre">
129
    Needs at least JRE 1.3.
129
    Needs at least JRE 1.4.
130
</answer>
130
</answer>
131
131
132
132
Lines 138-144 Link Here
138
        </question>
138
        </question>
139
-->
139
-->
140
<answer id="dep-jrejdk">
140
<answer id="dep-jrejdk">
141
    Need JDK (dt.jar).
141
    Need JDK (dt.jar, tools.jar).
142
</answer>
142
</answer>
143
143
144
144
Lines 578-584 Link Here
578
        </question>
578
        </question>
579
-->
579
-->
580
<answer id="exec-reflection">
580
<answer id="exec-reflection">
581
    No.
581
    VirtualMachine.canBeModified(), TypeComponent.genericSignature() and
582
    LocalVariable.genericSignature() are called by reflection, because it's
583
    available on JDK 1.5 and higher only.
582
</answer>
584
</answer>
583
585
584
586
(-)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