add other printStackTrace methods to forbidden-apis-check

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1723960 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2016-01-10 19:52:16 +00:00
parent 8d033e235c
commit b3b4ed6564
4 changed files with 6 additions and 43 deletions

View File

@ -100,47 +100,4 @@ public class HPSFRuntimeException extends RuntimeException
{
return reason;
}
// /**
// * @see Throwable#printStackTrace()
// */
// public void printStackTrace()
// {
// printStackTrace(System.err);
// }
// /**
// * @see Throwable#printStackTrace(java.io.PrintStream)
// */
// public void printStackTrace(final PrintStream p)
// {
// final Throwable reason = getReason();
// super.printStackTrace(p);
// if (reason != null)
// {
// p.println("Caused by:");
// reason.printStackTrace(p);
// }
// }
// /**
// * @see Throwable#printStackTrace(java.io.PrintWriter)
// */
// public void printStackTrace(final PrintWriter p)
// {
// final Throwable reason = getReason();
// super.printStackTrace(p);
// if (reason != null)
// {
// p.println("Caused by:");
// reason.printStackTrace(p);
// }
// }
}

View File

@ -23,6 +23,8 @@ import java.io.StringWriter;
import java.util.Collection;
import java.util.Date;
import org.apache.poi.util.SuppressForbidden;
/**
* <p>Provides various static utility methods.</p>
*
@ -332,6 +334,7 @@ public class Util
* @return a string containing the output of a call to
* <code>t.printStacktrace()</code>.
*/
@SuppressForbidden("uses printStackTrace")
public static String toString(final Throwable t)
{
final StringWriter sw = new StringWriter();

View File

@ -57,6 +57,7 @@ public class SystemOutLogger extends POILogger
* @param obj1 The object to log. This is converted to a string.
* @param exception An exception to be logged
*/
@SuppressForbidden("uses printStackTrace")
public void log(final int level, final Object obj1,
final Throwable exception) {
if (check(level)) {

View File

@ -28,3 +28,5 @@
java.lang.System#gc() @ Please do not try to stop the world
java.lang.Throwable#printStackTrace() @ Please use POILogger for exceptions
java.lang.Throwable#printStackTrace(java.io.PrintStream) @ Please use POILogger for exceptions
java.lang.Throwable#printStackTrace(java.io.PrintWriter) @ Please use POILogger for exceptions