incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1069991 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java
Date Fri, 11 Feb 2011 23:54:34 GMT
Author: mbenson
Date: Fri Feb 11 23:54:34 2011
New Revision: 1069991

URL: http://svn.apache.org/viewvc?rev=1069991&view=rev
Log:
merge c1069985 from trunk

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java
  (contents, props changed)

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java?rev=1069991&r1=1069990&r2=1069991&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java
Fri Feb 11 23:54:34 2011
@@ -29,6 +29,7 @@ import java.util.List;
  * Description: object holding the property path as a list of nodes.
  * (Implementation partially based on reference implementation)
  * <br/>
+ * This class is not synchronized.
  * 
  * @version $Rev$ $Date$
  */
@@ -209,11 +210,16 @@ public class PathImpl implements Path, S
      *             if no nodes are found
      */
     public Node removeLeafNode() {
-        // TODO what if isRootNode()?
-        if (nodeList.size() == 0) {
+        if (isRootPath() || nodeList.size() == 0) {
             throw new IllegalStateException("No nodes in path!");
         }
-        return nodeList.remove(nodeList.size() - 1);
+        try {
+            return nodeList.remove(nodeList.size() - 1);
+        } finally {
+            if (nodeList.isEmpty()) {
+                nodeList.add(new NodeImpl((String) null));
+            }
+        }
     }
 
     /**

Propchange: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Feb 11 23:54:34 2011
@@ -0,0 +1 @@
+/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/PathImpl.java:992330-992353,992401,992406,992412,992510,992648,993404-993438,996236,996240,997154,1002445,1031642,1035416-1036603,1069985



Mime
View raw message