Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] narrowing conversion from IJavaDebugTarget to JDIDebugTarget

Hi Darin,
 
Done, the bug 156320  is submitted.
 
thanks,
Vitaly
 
On 9/5/06, Darin Wright <Darin_Wright@xxxxxxxxxx> wrote:

Hi Vitaly,

Looking at the code, there are many places that we use JDIDebugTarget as internal API in the Java breakpoint implementation. However, if "recreate()" is the only method causing trouble for you, then I am willing to make a type check in that method so you can make progress. It could be that the other methods using JDIDebugTarget never get called when using your implementation.

Please open a bug against JDT Debug requesting this change.

Thanks,

Darin Wright



08/31/2006 02:53 AM

Please respond to
"Eclipse JDT Debug developers list." < jdt-debug-dev@xxxxxxxxxxx>

To
"Eclipse JDT Debug developers list." <jdt-debug-dev@xxxxxxxxxxx >
cc
Subject
Re: [jdt-debug-dev] narrowing conversion from IJavaDebugTarget to        JDIDebugTarget





Hi Darin,

Thanks for the reply.
Sure the fact that these interfaces are not intended to be implemented
by clients is known. It was an exploratory attempt to replace JDI. And
it was almost successful except for this problem.
I will be waiting for your decision.

Thanks,
Vitaly

On 8/30/06, Darin Wright < Darin_Wright@xxxxxxxxxx> wrote:
> Hi Vitaly,
>
> My quick response to this issue is "yes, that's true". As you may be aware
> the IJavaDebugTarget interface (as well as all the other java debug
> element interfaces/breakpoints) are specified as "not to be implemented by
> clients". That is, they were designed with the intention of having only
> one internal implementation, and are intended for "read only" use by
> clients. Thus the internal implementation casts to internal classes where
> neccessary.
>
> So, this is the first time someone has gone this far down the path of
> providing their own implementation of these interfaces, and run into such
> a problem. I will have to have a more detailed look to see if the
> cast/restriction can be removed.
>
> Darin Wright
>
>
>
>
> "Vitaly Provodin" < vitaly.a.provodin@xxxxxxxxx>
> Sent by: jdt-debug-dev-bounces@xxxxxxxxxxx
> 08/30/2006 07:39 AM
> Please respond to
> "Eclipse JDT Debug developers list." <jdt-debug-dev@xxxxxxxxxxx >
>
>
> To
> jdt-debug-dev@xxxxxxxxxxx
> cc
>
> Subject
> [jdt-debug-dev] narrowing conversion from IJavaDebugTarget to
> JDIDebugTarget
>
>
>
>
>
>
> Hi,
>
> I am working on a class implementing the IJavaDebugTarget interface
> which is not
> JDIDebugTarget, it works via some debugging interface - MyDI (not JDI).
> Also I
> have own implementations of other debug elements but it does not matter.
> Listening notifications from the breakpoint manager I am able to reuse
> existing
> JDT's breakpoints and create MyDI requests. On this way JDT does not react
> on breakpoints and JDI requests are not created. This approach
> successfully
> works if do not change breakpoints (that cause ClassCastException).
>
> In the _recreate_ method of the JavaBreakpoint class (the package
> org.eclipse.jdt.internal.debug.core.breakpoints) there is a narrowing
> reference
> conversion from IJavaDebugTarget to JDIDebugTarget:
>    IJavaDebugTarget jdiTarget =
> (IJavaDebugTarget)target.getAdapter(IJavaDebugTarget.class);
>    if (jdiTarget != null) {
>        try {
>            recreate((JDIDebugTarget)jdiTarget);
>        } catch (CoreException e) {
>            multiStatus.add(e.getStatus());
>        }
>    }
> This conversion is not tested whether the actual reference value is
> legitimate value
> of the JDIDebugTarget type. It is a cause of ClassCastException. Any
> breakpoint
> changes would happen smoothly if the conversion would be tested as it
> is done for
> example in the _removeThreadFilter_ method.
> So, is it possible to resolve this problem?
>
> I scanned sources for narrowing conversion to JDIDebugTarget and found
> that the
> same problem may arise in the following methods:
>     JavaBreakpoint.setThreadFilter
>    JavaBreakpoint.cleanupForThreadTermination
>    JavaLineBreakpoint.getEvaluationEngine
>    JavaTargetPatternBreakpoint.setPattern
>
> Thanks in advance
>
> --
> Vitaly Provodin,
> Intel Middleware Products Division
> _______________________________________________
> jdt-debug-dev mailing list
> jdt-debug-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jdt-debug-dev
>
>
> _______________________________________________
> jdt-debug-dev mailing list
> jdt-debug-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jdt-debug-dev
>


--
Vitaly Provodin,
Intel Middleware Products Division
_______________________________________________
jdt-debug-dev mailing list
jdt-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-debug-dev


_______________________________________________
jdt-debug-dev mailing list
jdt-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-debug-dev





--
Vitaly Provodin,
Intel Middleware Products Division

Back to the top