commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1425150 - in /commons/proper/digester/trunk: core/src/main/java/org/apache/commons/digester3/Digester.java src/changes/changes.xml
Date Fri, 21 Dec 2012 21:27:00 GMT
Author: simonetripodi
Date: Fri Dec 21 21:27:00 2012
New Revision: 1425150

URL: http://svn.apache.org/viewvc?rev=1425150&view=rev
Log:
[DIGESTER-175] Regression: DigesterTestCase#testPopNamedStackNotPushed expects EmptyStackException

Modified:
    commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/Digester.java
    commons/proper/digester/trunk/src/changes/changes.xml

Modified: commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/Digester.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/Digester.java?rev=1425150&r1=1425149&r2=1425150&view=diff
==============================================================================
--- commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/Digester.java
(original)
+++ commons/proper/digester/trunk/core/src/main/java/org/apache/commons/digester3/Digester.java
Fri Dec 21 21:27:00 2012
@@ -2741,6 +2741,7 @@ public class Digester
      */
     public <T> T pop( String stackName )
     {
+        T result = null;
         Stack<Object> namedStack = stacksByName.get( stackName );
         if ( namedStack == null )
         {
@@ -2748,23 +2749,17 @@ public class Digester
             {
                 log.debug( "Stack '" + stackName + "' is empty" );
             }
-            return null;
+            throw new EmptyStackException();
         }
 
-        try
-        {
-            T popped = this.<T> npeSafeCast( namedStack.pop() );
-            if ( stackAction != null )
-            {
-                popped = stackAction.onPop( this, stackName, popped );
-            }
-            return popped;
-        }
-        catch ( EmptyStackException e )
+        result = this.<T> npeSafeCast( namedStack.pop() );
+
+        if ( stackAction != null )
         {
-            log.warn( "Empty stack (returning null)" );
-            return ( null );
+            result = stackAction.onPop( this, stackName, result );
         }
+
+        return result;
     }
 
     /**

Modified: commons/proper/digester/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/changes/changes.xml?rev=1425150&r1=1425149&r2=1425150&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/changes/changes.xml (original)
+++ commons/proper/digester/trunk/src/changes/changes.xml Fri Dec 21 21:27:00 2012
@@ -23,6 +23,9 @@
   </properties>
   <body>
   <release version="3.3" date="201?-??-??" description="Maintenance release.">
+    <action dev="simonetripodi" type="fix" issue="DIGESTER-175">
+      Regression: DigesterTestCase#testPopNamedStackNotPushed expects EmptyStackException
+    </action>
     <action dev="simonetripodi" type="fix" issue="DIGESTER-174" due-to="Andreas Sahlbach">
       Inner List Annotation has wrong @Target for most of the predefined annotation rules
     </action>



Mime
View raw message