| Summary: | Runtime resolve of packages from other project is not possible in conditional breakpoints | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Max Rydahl Andersen <max> | ||||
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | darin.eclipse | ||||
| Version: | 3.0 | ||||||
| Target Milestone: | 3.0 RC2 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Max Rydahl Andersen
I'm not sure that was working before, but we should be able to improve the evaluation in this case. The specifique problem here, is that the compilation for the evaluation is done in the project of the declaring type instead of the project of the recieving type. deferred to RC2 Implemented. The evaluation for the condition is now done in the context of the project of the receiving type. The classes, static methods and static fields visible in the project of the receiving type can be used in the evaluation. Note that if the instance where the breakpoint is stopped is from project 1, the same error will be displayed when trying to evaluate a condition referencing a type in project 2. JDIReferenceType - added method getSourcePath() to get the source path for the default stratum. JavaSourceLookupParticipant - modified to be able to do source lookup on reference type. JavaLineBreakpoint - modified getJavaProject() to return the project of the recieving type if possible. Created attachment 11819 [details]
patch for JavaSourceLookupParticipant
Looks like I don't have commit right on jdt.launching ... ?
Please verify, Darin W. There's an NPE in JavaLineBreakpoint: java.lang.NullPointerException at org.eclipse.jdt.internal.debug.core.breakpoints.JavaLineBreakpoint.getJavaProje ct(JavaLineBreakpoint.java:482) at org.eclipse.jdt.internal.debug.core.breakpoints.JavaLineBreakpoint.handleCondit ionalBreakpointEvent(JavaLineBreakpoint.java:443) at org.eclipse.jdt.internal.debug.core.breakpoints.JavaLineBreakpoint.handleBreakp ointEvent(JavaLineBreakpoint.java:368) at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.handleEvent (JavaBreakpoint.java:263) at org.eclipse.jdt.internal.debug.core.EventDispatcher.dispatch (EventDispatcher.java:172) at org.eclipse.jdt.internal.debug.core.EventDispatcher.run (EventDispatcher.java:221) at java.lang.Thread.run(Thread.java:534) I think the NPE is in static methods? You should have update rights to launching. I fell back these changes since this breaks the test suite (NPEs). (as well, the API reference from launching to JDIReferenceType is illegal - i.e. plug-in acccessing internal type from another plug-in. Is there anyway we can make it work without adding API?) Luc, we can like get an API addition to IJavaReferenceType if we need it (i.e. getSourceName/getSourcePath for a specified stratum). Would that be helpful? If we add a String[] getSourcePath(String stratum) to IJavaReferenceType, we don't need to reference an internal class. I thought that the API were frozen (it's not a breaking change, but ...). We'd still need PMC approval to add the method. This is a better idea - just pass in the string to the source locator - it handles them as file names. You're already in the java debug model, so you can add the "private API" method and access it from JavaLineBreakpoint, where you need it. Then we don't need the API method. That works too. The NPE was in the context of static methods, getThis() return nulls. Added a test to check for the receiving type only in non-static context. I reworked getSourcePath() to something that looks more like what we need in the API. JavaLineBreakpoint - modified getJavaProject() to return the project of the recieving type if possible. JDIReferenceType - added method getSourcePaths(String stratum) to get the source paths for the given stratum. Please verify, Darin W. Verified: We can only reference types the receiving type's build path includes. We base visibility on the receiving type, and if the receiving type cannot see the upstream type, we cannot compile the expression. |