directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r472685 - /directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java
Date Wed, 08 Nov 2006 23:06:13 GMT
Author: elecharny
Date: Wed Nov  8 15:06:12 2006
New Revision: 472685

URL: http://svn.apache.org/viewvc?view=rev&rev=472685
Log:
Fixed warnings by using generics

Modified:
    directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java

Modified: directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java?view=diff&rev=472685&r1=472684&r2=472685
==============================================================================
--- directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java
(original)
+++ directory/branches/apacheds-schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/MultiException.java
Wed Nov  8 15:06:12 2006
@@ -39,7 +39,7 @@
     static final long serialVersionUID = 2889747406899775761L;
 
     /** Collection of nested exceptions. */
-    private Collection m_nestedExceptions = new ArrayList();
+    private Collection<Throwable> nestedExceptions = new ArrayList<Throwable>();
 
 
     /**
@@ -54,12 +54,12 @@
     /**
      * Constructs an Exception with a detailed message.
      * 
-     * @param a_message
+     * @param message
      *            The message associated with the exception.
      */
-    public MultiException(String a_message)
+    public MultiException( String message)
     {
-        super( a_message );
+        super( message );
     }
 
 
@@ -68,9 +68,9 @@
      * 
      * @return an Iterator over the nested exceptions.
      */
-    public Iterator listNestedExceptions()
+    public Iterator<Throwable> listNestedExceptions()
     {
-        return m_nestedExceptions.iterator();
+        return nestedExceptions.iterator();
     }
 
 
@@ -82,7 +82,7 @@
      */
     public int size()
     {
-        return m_nestedExceptions.size();
+        return nestedExceptions.size();
     }
 
 
@@ -94,7 +94,7 @@
      */
     public boolean isEmpty()
     {
-        return m_nestedExceptions.isEmpty();
+        return nestedExceptions.isEmpty();
     }
 
 
@@ -104,9 +104,9 @@
      * @param a_nested
      *            exception to add to this MultiException.
      */
-    public void addThrowable( Throwable a_nested )
+    public void addThrowable( Throwable nested )
     {
-        this.m_nestedExceptions.add( a_nested );
+        this.nestedExceptions.add( nested );
     }
 
 
@@ -118,29 +118,31 @@
      * Beside printing out the standard stack trace this method prints out the
      * stack traces of all the nested exceptions.
      * 
-     * @param an_out
+     * @param out
      *            PrintWriter to write the nested stack trace to.
      */
-    public void printStackTrace( PrintWriter an_out )
+    public void printStackTrace( PrintWriter out )
     {
-        super.printStackTrace( an_out );
+        super.printStackTrace( out );
 
-        an_out.println( "Nested exceptions to follow:\n" );
-        Iterator l_list = listNestedExceptions();
-        Throwable l_throwable = null;
-        while ( l_list.hasNext() )
+        out.println( "Nested exceptions to follow:\n" );
+        boolean isFirst = true;
+
+        for ( Throwable throwable:nestedExceptions )
         {
-            l_throwable = ( Throwable ) l_list.next();
-            l_throwable.printStackTrace();
-            if ( l_list.hasNext() )
-            {
-                an_out.println( "\n\t<<========= Next Nested Exception" + " ========>>\n"
);
+            if ( isFirst )
+            { 
+                isFirst = false; 
             }
             else
             {
-                an_out.println( "\n\t<<========= Last Nested Exception" + " ========>>\n"
);
+                out.println( "\n\t<<========= Next Nested Exception" + " ========>>\n"
);
             }
+
+            throwable.printStackTrace();
         }
+
+        out.println( "\n\t<<========= Last Nested Exception" + " ========>>\n"
);
     }
 
 
@@ -148,29 +150,31 @@
      * Beside printing out the standard stack trace this method prints out the
      * stack traces of all the nested exceptions.
      * 
-     * @param an_out
+     * @param out
      *            PrintStream to write the nested stack trace to.
      */
-    public void printStackTrace( PrintStream an_out )
+    public void printStackTrace( PrintStream out )
     {
-        super.printStackTrace( an_out );
+        super.printStackTrace( out );
 
-        an_out.println( "Nested exceptions to follow:\n" );
-        Iterator l_list = listNestedExceptions();
-        Throwable l_throwable = null;
-        while ( l_list.hasNext() )
+        out.println( "Nested exceptions to follow:\n" );
+        boolean isFirst = true;
+
+        for ( Throwable throwable:nestedExceptions )
         {
-            l_throwable = ( Throwable ) l_list.next();
-            l_throwable.printStackTrace();
-            if ( l_list.hasNext() )
-            {
-                an_out.println( "\n\t<<========= Next Nested Exception" + " ========>>\n"
);
+            if ( isFirst )
+            { 
+                isFirst = false; 
             }
             else
             {
-                an_out.println( "\n\t<<========= Last Nested Exception" + " ========>>\n"
);
+                out.println( "\n\t<<========= Next Nested Exception" + " ========>>\n"
);
             }
+
+            throwable.printStackTrace();
         }
+
+        out.println( "\n\t<<========= Last Nested Exception" + " ========>>\n"
);
     }
 
 



Mime
View raw message