374550: remove printStackTrace calls

This commit is contained in:
Greg Wilkins 2012-04-12 16:51:59 +10:00
parent c9ce3eb108
commit a565c72adb
11 changed files with 31 additions and 43 deletions

View File

@ -475,10 +475,12 @@ public class HttpDestination implements Dumpable
HttpEventListener elistener = (HttpEventListener)constructor.newInstance(this, ex);
ex.setEventListener(elistener);
}
catch (Exception e)
catch (final Exception e)
{
e.printStackTrace();
throw new IOException("Unable to instantiate registered listener for destination: " + listenerClass);
throw new IOException("Unable to instantiate registered listener for destination: " + listenerClass)
{
{initCause(e);}
};
}
}
}

View File

@ -104,8 +104,7 @@ public class DigestAuthentication implements Authentication
}
catch(Exception e)
{
e.printStackTrace();
return null;
throw new RuntimeException(e);
}
}
@ -119,8 +118,7 @@ public class DigestAuthentication implements Authentication
}
catch(Exception e)
{
e.printStackTrace();
return null;
throw new RuntimeException(e);
}
}

View File

@ -70,10 +70,12 @@ public class StringEndPoint extends StreamEndPoint
_bout.reset();
return s;
}
catch(Exception e)
catch(final Exception e)
{
e.printStackTrace();
throw new IllegalStateException(_encoding+": "+e.toString());
throw new IllegalStateException(_encoding)
{
{initCause(e);}
};
}
}

View File

@ -503,7 +503,7 @@ public class MultiPartFilter implements Filter
}
catch(Exception e)
{
e.printStackTrace();
throw new RuntimeException(e);
}
}
else if (o instanceof String)

View File

@ -27,20 +27,11 @@ import java.io.OutputStream;
public class MultiPartOutputStream extends FilterOutputStream
{
/* ------------------------------------------------------------ */
private static byte[] __CRLF;
private static byte[] __DASHDASH;
private static final byte[] __CRLF={'\r','\n'};
private static final byte[] __DASHDASH={'-','-'};
public static String MULTIPART_MIXED="multipart/mixed";
public static String MULTIPART_X_MIXED_REPLACE="multipart/x-mixed-replace";
static
{
try
{
__CRLF="\015\012".getBytes(StringUtil.__ISO_8859_1);
__DASHDASH="--".getBytes(StringUtil.__ISO_8859_1);
}
catch (Exception e) {e.printStackTrace(); System.exit(1);}
}
/* ------------------------------------------------------------ */
private String boundary;

View File

@ -326,6 +326,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
}
catch(IOException e)
{
// Cannot log this exception to a LOG, as RolloverFOS can be used by logging
e.printStackTrace();
}
}

View File

@ -44,7 +44,7 @@ public class TypeUtil
public static int LF = '\012';
/* ------------------------------------------------------------ */
private static final HashMap<String, Class> name2Class=new HashMap<String, Class>();
private static final HashMap<String, Class<?>> name2Class=new HashMap<String, Class<?>>();
static
{
name2Class.put("boolean",java.lang.Boolean.TYPE);
@ -92,7 +92,7 @@ public class TypeUtil
}
/* ------------------------------------------------------------ */
private static final HashMap<Class, String> class2Name=new HashMap<Class, String>();
private static final HashMap<Class<?>, String> class2Name=new HashMap<Class<?>, String>();
static
{
class2Name.put(java.lang.Boolean.TYPE,"boolean");
@ -119,12 +119,12 @@ public class TypeUtil
}
/* ------------------------------------------------------------ */
private static final HashMap<Class, Method> class2Value=new HashMap<Class, Method>();
private static final HashMap<Class<?>, Method> class2Value=new HashMap<Class<?>, Method>();
static
{
try
{
Class[] s ={java.lang.String.class};
Class<?>[] s ={java.lang.String.class};
class2Value.put(java.lang.Boolean.TYPE,
java.lang.Boolean.class.getMethod("valueOf",s));
@ -158,7 +158,7 @@ public class TypeUtil
}
catch(Exception e)
{
e.printStackTrace();
throw new Error(e);
}
}
@ -180,7 +180,7 @@ public class TypeUtil
* @param name A class or type name.
* @return A class , which may be a primitive TYPE field..
*/
public static Class fromName(String name)
public static Class<?> fromName(String name)
{
return name2Class.get(name);
}
@ -190,7 +190,7 @@ public class TypeUtil
* @param type A class , which may be a primitive TYPE field.
* @return Canonical name.
*/
public static String toName(Class type)
public static String toName(Class<?> type)
{
return class2Name.get(type);
}
@ -201,7 +201,7 @@ public class TypeUtil
* @param value The value as a string.
* @return The value as an Object.
*/
public static Object valueOf(Class type, String value)
public static Object valueOf(Class<?> type, String value)
{
try
{
@ -216,7 +216,7 @@ public class TypeUtil
type.equals(java.lang.Character.class))
return new Character(value.charAt(0));
Constructor c = type.getConstructor(java.lang.String.class);
Constructor<?> c = type.getConstructor(java.lang.String.class);
return c.newInstance(value);
}
catch(NoSuchMethodException e)
@ -431,7 +431,7 @@ public class TypeUtil
}
public static void dump(Class c)
public static void dump(Class<?> c)
{
System.err.println("Dump: "+c);
dump(c.getClassLoader());

View File

@ -86,7 +86,7 @@ import org.eclipse.jetty.util.log.Logger;
*/
public class JSON
{
private static final Logger LOG = Log.getLogger(JSON.class);
static final Logger LOG = Log.getLogger(JSON.class);
public final static JSON DEFAULT = new JSON();
private Map<String, Convertor> _convertors = new ConcurrentHashMap<String, Convertor>();
@ -950,7 +950,7 @@ public class JSON
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
LOG.warn(e);
}
}
return map;

View File

@ -97,7 +97,6 @@ public class JSONObjectConvertor implements JSON.Convertor
}
catch (Throwable e)
{
// e.printStackTrace();
throw new IllegalArgumentException(e);
}
}

View File

@ -66,7 +66,7 @@ public class JSONPojoConvertorFactory implements JSON.Convertor
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
JSON.LOG.warn(e);
}
}
if (convertor!=null)
@ -92,7 +92,7 @@ public class JSONPojoConvertorFactory implements JSON.Convertor
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
JSON.LOG.warn(e);
}
}
if (convertor!=null)

View File

@ -1135,7 +1135,7 @@ public class XmlConfiguration
final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
AccessController.doPrivileged(new PrivilegedAction()
AccessController.doPrivileged(new PrivilegedAction<Object>()
{
public Object run()
{
@ -1216,11 +1216,6 @@ public class XmlConfiguration
}
}
}
catch (AccessControlException ace)
{
ace.printStackTrace(System.err);
exception.set(ace);
}
catch (Exception e)
{
LOG.debug(Log.EXCEPTION,e);