private static String getCompressedStackTrace( Throwable t, int frames_to_skip) { return getCompressedStackTrace(t, frames_to_skip, 200); }
@Override public void failed( Subscription subs, SubscriptionException error ) { Debug.out( error ); result.put( "error", "read failed: " + Debug.getNestedExceptionMessage(error)); sendBrowserMessage( "metasearch", "readSubscriptionResultsFailed", result ); } });
public static String getStackTrace(boolean bCompressed, boolean bIncludeSelf) { return getStackTrace(bCompressed, bIncludeSelf, bIncludeSelf ? 0 : 1, 200); }
public static String getNestedExceptionMessageAndStack( Throwable e ) { return( getNestedExceptionMessage(e) + ", " + getCompressedStackTrace( e, 0 )); }
public static String getStackTrace(boolean bCompressed, boolean bIncludeSelf, int iNumLinesToSkip, int iMaxLines) { if (bCompressed) return getCompressedStackTrace(bIncludeSelf ? 2 + iNumLinesToSkip : 3 + iNumLinesToSkip, iMaxLines); // bIncludeSelf not supported gor non Compressed yet return getStackTrace(1); }
public static void outStackTrace() { // skip the last, since they'll most likely be main diagLoggerLogAndOut(getStackTrace(1),false); }
@Override public void log( Throwable e ) { Debug.printStackTrace(e); }
public static void main(String[] args) { System.out.println(secretFileName("c:\\temp\\hello there.txt")); System.out.println(secretFileName("hello there.txt")); } }
@Override public boolean useFile( String root_dir, String relative_url ) throws IOException { Debug.out( "Not supported" ); return( false ); }
private static void checkErrorType(Throwable e) { if (e instanceof RPException) { Debug.outNoStack("RPExceptions chained together - stack trace, followed by other RPException stack trace."); Debug.outStackTrace(); Debug.printStackTrace(e); throw new RuntimeException("cannot chain RPException instances together"); } }
protected Rectangle swt_getBounds() { if (swtItem == null || swtItem.isDisposed()) { return null; } try { Tree tree = swtItem.getParent(); Rectangle bounds = swtItem.getBounds(); Rectangle treeBounds = tree.getClientArea(); return new Rectangle(0, bounds.y, treeBounds.width, bounds.height); } catch (NullPointerException e) { // On OSX, we get erroneous NPE here: //at org.eclipse.swt.widgets.Tree.sendMeasureItem(Tree.java:2443) //at org.eclipse.swt.widgets.Tree.cellSize(Tree.java:274) //at org.eclipse.swt.widgets.Display.windowProc(Display.java:4750) //at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_stret(Native Method) //at org.eclipse.swt.internal.cocoa.NSCell.cellSize(NSCell.java:34) //at org.eclipse.swt.widgets.TreeItem.getBounds(TreeItem.java:467) Debug.outNoStack("NPE @ " + Debug.getCompressedStackTrace(), true); } catch (Exception e) { Debug.out(e); } return null; }
String msg = Debug.getNestedExceptionMessage( e ); Debug.out( "RSS parsing failed for '" + stuff + "': " + Debug.getExceptionMessage( error ));
public static void outNoStack( String str ) { outNoStack( str, false ); }
@Override public void decodeFailed( ProtocolDecoder decoder, Throwable cause ) { System.out.println( "incoming decode failed: " + Debug.getNestedExceptionMessage(cause)); }
protected void installSecurityManager() { if ( Constants.isAndroid ){ // can't do this }else{ String prop = System.getProperty(SystemProperties.SYSPROP_SECURITY_MANAGER_INSTALL, "1" ); if ( prop.equals( "0" )){ Debug.outNoStack( "Not installing security manager - disabled by system property" ); return; } try{ final SecurityManager old_sec_man = System.getSecurityManager(); my_sec_man = new ClientSecurityManager( old_sec_man ); System.setSecurityManager( my_sec_man ); }catch( Throwable e ){ Debug.printStackTrace(e); } } }
diagLoggerLog(_exception.toString()); return; diagLoggerLog(_exception.toString()); return; lineNumber = first_line.getLineNumber(); trace_trace_tail = getCompressedStackTrace(e, 3, 200, false); diagLoggerLogAndOut(header+className+(methodName)+lineNumber+":", true); if (_debug_msg.length() > 0) { diagLoggerLogAndOut(" " + _debug_msg, true); diagLoggerLogAndOut( " " + trace_trace_tail, true); diagLoggerLogAndOut(_exception);
protected void failed( Throwable cause ) { buffer.returnToPool(); disk_manager.setFailed( "Disk read error - " + Debug.getNestedExceptionMessage(cause)); Debug.printStackTrace( cause ); listener.readFailed( dm_request, cause ); } }
protected static void initialise() { try{ Security.addProvider(new org.gudy.bouncycastle.jce.provider.BouncyCastleProvider()); KeyFactory kf = KeyFactory.getInstance( "ECDSA", BouncyCastleProvider.PROVIDER_NAME ); if ( Constants.IS_CVS_VERSION ){ String where = ""; try{ where = BouncyCastleProvider.class.getClassLoader().getResource( "org/gudy/bouncycastle/jce/provider/BouncyCastleProvider.class" ).toExternalForm(); }catch( Throwable e ){ ClassLoader cl = BouncyCastleProvider.class.getClassLoader(); if ( cl == null ){ where = "<bootstrap>"; }else{ where = cl.toString(); } } if ( !where.contains( Constants.DEFAULT_JAR_NAME )){ Debug.outNoStack( "BC Provider '" + BouncyCastleProvider.PROVIDER_NAME + "' initialised successfully (loaded from " + where + ")" ); } } }catch( Throwable e ){ Debug.out( "BC Provider initialisation failed", e ); } }
StackTraceElement elt = new Exception().getStackTrace()[2]; existing_name_entry.line_number != line_number ){ Debug.out( new Exception("Duplicate AEMonSem name '" + name + "'"));
if ( !Debug.containsException( e, UnknownHostException.class )){ Debug.printStackTrace(e);