[dna-commits] DNA SVN: r774 - in trunk/dna-graph/src/main: java/org/jboss/dna/graph/property and 1 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Thu Mar 12 16:14:20 EDT 2009


Author: rhauch
Date: 2009-03-12 16:14:20 -0400 (Thu, 12 Mar 2009)
New Revision: 774

Modified:
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java
   trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/PathNotFoundException.java
   trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties
Log:
DNA-300 The DNA PathNotFoundException message text does not include the lowest existing path that was found

Added the lowest existing path to the message (and localized message) of the PathNotFoundException in the DNA Graph API.  Of course, this is only added when there is a lowest existing path.

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java	2009-03-12 19:19:34 UTC (rev 773)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/GraphI18n.java	2009-03-12 20:14:20 UTC (rev 774)
@@ -62,6 +62,7 @@
     public static I18n pathExpressionHasInvalidMatch;
     public static I18n messageDigestNotFound;
     public static I18n unableToAccessResourceFileFromClassLoader;
+    public static I18n pathNotFoundExceptionLowestExistingLocationFound;
 
     public static I18n executingRequest;
     public static I18n executedRequest;

Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/PathNotFoundException.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/PathNotFoundException.java	2009-03-12 19:19:34 UTC (rev 773)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/property/PathNotFoundException.java	2009-03-12 20:14:20 UTC (rev 774)
@@ -23,6 +23,7 @@
  */
 package org.jboss.dna.graph.property;
 
+import org.jboss.dna.graph.GraphI18n;
 import org.jboss.dna.graph.Location;
 
 /**
@@ -97,6 +98,20 @@
     }
 
     /**
+     * {@inheritDoc}
+     * 
+     * @see java.lang.Throwable#getMessage()
+     */
+    @Override
+    public String getMessage() {
+        if (this.lowestAncestorThatDoesExist != null) {
+            return GraphI18n.pathNotFoundExceptionLowestExistingLocationFound.text(super.getMessage(),
+                                                                                   this.lowestAncestorThatDoesExist);
+        }
+        return super.getMessage();
+    }
+
+    /**
      * Get the path that was not found
      * 
      * @return the path that was not found

Modified: trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties
===================================================================
--- trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties	2009-03-12 19:19:34 UTC (rev 773)
+++ trunk/dna-graph/src/main/resources/org/jboss/dna/graph/GraphI18n.properties	2009-03-12 20:14:20 UTC (rev 774)
@@ -48,7 +48,8 @@
 pathExpressionHasInvalidSelect = Invalid select expression "{0}" in the path expression "{1}"
 pathExpressionHasInvalidMatch = Invalid match expression "{0}" in the path expression "{1}"
 messageDigestNotFound = The "{0}" message digest algorithm could not be found
-unableToAccessResourceFileFromClassLoader = Unable to access "{0}" resource from the class loader 
+unableToAccessResourceFileFromClassLoader = Unable to access "{0}" resource from the class loader
+pathNotFoundExceptionLowestExistingLocationFound = {0}; lowest existing path is {1}
 
 executingRequest = Executing {0}
 executedRequest = Executed {0}




More information about the dna-commits mailing list