static Object[] filterChildren(Object[] children) { List<Object> newChildren = new ArrayList<>(children.length); newChildren.addAll(Arrays.asList(children)); for (int i = 0; i < newChildren.size(); i++) { Object ch = newChildren.get(i); if (ch instanceof CallStackFrame) { String className = ((CallStackFrame) ch).getClassName(); if (className.startsWith(FILTER1) || className.startsWith(FILTER2)) { newChildren.remove(i); i--; } } } return newChildren.toArray(); }
static Object[] filterChildren(Object[] children) { List<Object> newChildren = new ArrayList<>(children.length); newChildren.addAll(Arrays.asList(children)); for (int i = 0; i < newChildren.size(); i++) { Object ch = newChildren.get(i); if (ch instanceof CallStackFrame) { String className = ((CallStackFrame) ch).getClassName(); if (className.startsWith(FILTER1) || className.startsWith(FILTER2)) { newChildren.remove(i); i--; } } } return newChildren.toArray(); }
static Object[] createChildrenWithJSStack(Object[] children) { boolean isJSStack = false; for (int i = 0; i < children.length; i++) { Object ch = children[i]; if (ch instanceof CallStackFrame) { CallStackFrame csf = (CallStackFrame) ch; if (csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) { if (!isJSStack) { Object[] children2 = new Object[children.length]; System.arraycopy(children, 0, children2, 0, children.length); children = children2; } children[i] = JSStackFrame.get(csf); isJSStack = true; } } } if (isJSStack) { return children; } else { return null; } }
static Object[] createChildrenWithJSStack(Object[] children) { boolean isJSStack = false; for (int i = 0; i < children.length; i++) { Object ch = children[i]; if (ch instanceof CallStackFrame) { CallStackFrame csf = (CallStackFrame) ch; if (csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) { if (!isJSStack) { Object[] children2 = new Object[children.length]; System.arraycopy(children, 0, children2, 0, children.length); children = children2; } children[i] = JSStackFrame.get(csf); isJSStack = true; } } } if (isJSStack) { return children; } else { return null; } }
private void currentStackFrameChanged(CallStackFrame csf) { if (csf != null && csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) { JPDAThread thread = csf.getThread(); suspendedNashornThread = new WeakReference<>(thread); try { Object node = dvSupport.getClass().getMethod("get", JPDAThread.class).invoke(dvSupport, thread); boolean explicitCollaps; synchronized (this) { explicitCollaps = collapsedExplicitly.contains(node); } if (!explicitCollaps) { fireNodeExpanded(node); } } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) { Exceptions.printStackTrace(ex); } } else { suspendedNashornThread = NO_THREAD; } }
public static String getRelativePath ( CallStackFrame csf, String stratumn ) { try { return convertSlash (csf.getSourcePath (stratumn)); } catch (AbsentInformationException e) { return getRelativePath (csf.getClassName ()); } }
if (ch instanceof CallStackFrame) { frame = (CallStackFrame) ch; frameStr.append(frame.getClassName()); frameStr.append("."); frameStr.append(frame.getMethodName()); JSStackFrame jsframe = (JSStackFrame) ch; frame = jsframe.getJavaFrame(); String cName = frame.getClassName(); if (cName.startsWith(JSUtils.NASHORN_SCRIPT)) { cName = cName.substring(JSUtils.NASHORN_SCRIPT.length());
frame = (CallStackFrame) ch; frameStr.append("\tat "); frameStr.append(frame.getClassName()); frameStr.append("."); frameStr.append(frame.getMethodName()); JSStackFrame jsframe = (JSStackFrame) ch; frame = jsframe.getJavaFrame(); String cName = frame.getClassName(); if (cName.startsWith(JSUtils.NASHORN_SCRIPT)) { cName = cName.substring(JSUtils.NASHORN_SCRIPT.length());
public String getURL ( CallStackFrame csf, String stratumn ) { try { return getURL (convertSlash (csf.getSourcePath (stratumn)), true); } catch (AbsentInformationException e) { return getURL ( convertClassNameToRelativePath (csf.getClassName ()), true ); } }
public boolean sourceAvailable ( CallStackFrame csf, String stratumn ) { try { return sourceAvailable ( convertSlash (csf.getSourcePath (stratumn)), true ); } catch (AbsentInformationException e) { return sourceAvailable ( convertClassNameToRelativePath (csf.getClassName ()), true ); } }
addClassNames(currentFrame.getClassName(), superTypeNames);
addClassNames(currentFrame.getClassName(), superTypeNames);
} catch (AbsentInformationException e) { String url = getURL ( convertClassNameToRelativePath (csf.getClassName ()), true ); if (url == null) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Show Source: No source URL for class "+csf.getClassName()+ "\nThe reason is likely no opened project for the source file."); return false;
return EditorContextBridge.getContext().annotate ( getURL ( convertClassNameToRelativePath (csf.getClassName ()), true ), lineNumber,