commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang StringUtils.java
Date Sat, 31 Aug 2002 19:05:33 GMT
bayard      2002/08/31 12:05:32

  Modified:    lang/src/java/org/apache/commons/lang StringUtils.java
  Log:
  Removed stackTrace and getStackTrace. ExceptionUtils has getStackTrace and
  stackTrace is only slightly different in that it uses a ByteArrayOutputStream
  and not a StringWriter. A change since the beta, but not allowing obvious ones
  to happen will be silly.
  
  Revision  Changes    Path
  1.10      +1 -45     jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StringUtils.java	31 Aug 2002 11:07:08 -0000	1.9
  +++ StringUtils.java	31 Aug 2002 19:05:32 -0000	1.10
  @@ -1480,29 +1480,6 @@
   
       // Misc
       //--------------------------------------------------------------------------
  -    
  -    /**
  -     * Get the stack trace from a Throwable as a String.
  -     * <p>
  -     * This method uses printStackTrace() internally to obtain the stack trace.
  -     *
  -     * @see java.lang.Throwable#printStackTrace()
  -     * @param throwable  the throwable to extract a stack trace from
  -     * @return the extracted stack trace, or null if an error occurs
  -     */
  -    public static String stackTrace(Throwable throwable) {
  -        String trace = null;
  -        try {
  -            // And show the Error Screen.
  -            ByteArrayOutputStream buf = new ByteArrayOutputStream();
  -            throwable.printStackTrace(new PrintWriter(buf, true));
  -            trace = buf.toString();
  -            
  -        } catch (Exception ex) {
  -            // ignore
  -        }
  -        return trace;
  -    }
   
       /**
        * Find the Levenshtein distance between two strings.
  @@ -1569,27 +1546,6 @@
           // Step 7
           return d[n][m];
       }
  -
  -    /**
  -     * Convenient method to retrieve the full stacktrace from a given exception.
  -     * 
  -     * @param t the exception to get the stacktrace from.
  -     * @return the stacktrace from the given exception.
  -     */
  -    public static String getStackTrace(Throwable t) {
  -        StringWriter sw = new StringWriter();
  -        PrintWriter pw = new PrintWriter(sw, true);
  -        t.printStackTrace(pw);
  -        pw.flush();
  -        pw.close();
  -        return sw.toString();
  -    }   
  -
  -// these are not really of use in the Java world. Only if you're a C afficionado
  -//    public static String sprintf(String format, Object[] list);
  -//    public static Object[] sscanf(String str, String format);
  -//    public static String pack(String[] strs, String format);
  -//    public static String[] unpack(String str, String format);
   
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message