Community
Participate
Working Groups
The 1.0 Snippet editor does not work with the latest J9 JCLs. The reason for this is that the implementation of "Method.invoke(...)" has changed from being native, to being source. As the snippet editor attempts to position itself to the correct location to perform an evaluation, an assumption it makes about the number of frames on the stack is now invalid.
Source for patch in JavaSnippetEditor#handleDebugEvent public void handleDebugEvent(DebugEvent e) { Object source = e.getSource(); if (source instanceof IDebugElement) { IDebugElement de = (IDebugElement)source; if (de.getElementType() == IDebugElement.DEBUG_TARGET) { if (de.getDebugTarget().equals(fVM)) { if (e.getKind() == DebugEvent.TERMINATE) { Runnable r = new Runnable() { public void run() { vmTerminated(); } }; getShell().getDisplay ().asyncExec(r); } } } else if (de instanceof IJavaThread) { if (e.getKind() == DebugEvent.SUSPEND) { IJavaThread jt = (IJavaThread)de; try { IJavaStackFrame f= (IJavaStackFrame)jt.getTopStackFrame(); if (f != null) { if (e.getDetail() == DebugEvent.STEP_END && f.getLineNumber() == 9 && f.getDeclaringTypeName().equals ("org.eclipse.jdt.internal.ui.snippeteditor.ScrapbookMain1")) { //$NON-NLS-1$ fThread = jt; } else if (e.getDetail () == DebugEvent.BREAKPOINT && jt.getBreakpoint().equals (ScrapbookLauncher.getDefault().getMagicBreakpoint(jt.getDebugTarget()))) { // locate the 'eval' method and step over IDebugElement[] frames = jt.getChildren(); for (int i = 0; i < frames.length; i++) { IJavaStackFrame frame = (IJavaStackFrame)frames[i]; if (frame.getReceivingTypeName().equals ("org.eclipse.jdt.internal.ui.snippeteditor.ScrapbookMain1") && frame.getName ().equals("eval")) { //$NON-NLS-1$ //$NON-NLS-2$ frame.stepOver(); break; } } } } } catch (DebugException ex) { JavaPlugin.log(ex); } } } } }
Included changed with rollup2, version 1.0.
Verified for J9: ive11022001.zip