Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2012-11-30 00:06:31 -0500
committerIgor Fedorenko2012-11-30 00:06:31 -0500
commit7580c5cfa9f7427ec1e8ee1a86359edd8fa45a4f (patch)
tree8fb72a025a3898711193af9c6bd0686968d60c71
parent38f6b83cf3bb54e94ceddeea2233be39f910cc2c (diff)
downloadm2e-core-7580c5cf.tar.gz
m2e-core-7580c5cf.tar.xz
m2e-core-7580c5cf.zip
368212 hide ISourceLookupDirector as a workaround
The problem described in 368212 caused by JDT debug ui unnecessary and inappropriately handling ISourceLookupDirector implementations. By wrapping ISourceLookupDirector in a simple ISourceLocator, m2e suppresses this special handling. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
index 4bc0accb..32b81d83 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
@@ -31,6 +31,8 @@ import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
import org.eclipse.debug.ui.RefreshTab;
import org.eclipse.jdt.launching.IVMRunner;
@@ -106,16 +108,24 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
}
if(launch.getSourceLocator() instanceof MavenSourceLocator) {
- MavenSourceLocator sourceLocator = (MavenSourceLocator) launch.getSourceLocator();
+ final MavenSourceLocator sourceLocator = (MavenSourceLocator) launch.getSourceLocator();
for(IMavenLaunchParticipant participant : participants) {
List<ISourceLookupParticipant> sourceLookupParticipants = participant.getSourceLookupParticipants(
configuration, launch, monitor);
- if(sourceLookupParticipants != null) {
+ if(sourceLookupParticipants != null && !sourceLookupParticipants.isEmpty()) {
sourceLocator.addParticipants(sourceLookupParticipants
.toArray(new ISourceLookupParticipant[sourceLookupParticipants.size()]));
}
}
sourceLocator.addParticipants(new ISourceLookupParticipant[] {new JavaSourceLookupParticipant()});
+ // As a workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=368212
+ // wrap sourceLocator in ISourceLocator. This will hide ISourceLookupDirector
+ // implementation from JDT and disable any inappropriate/harmful hacks the have
+ launch.setSourceLocator(new ISourceLocator() {
+ public Object getSourceElement(IStackFrame stackFrame) {
+ return sourceLocator.getSourceElement(stackFrame);
+ }
+ });
} else {
log.warn(NLS.bind(Messages.MavenLaynchDelegate_unsupported_source_locator, launch.getSourceLocator().getClass()
.getCanonicalName()));

Back to the top