jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1341014 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/namespace/NamespaceRegistryImpl.java
Date Mon, 21 May 2012 13:36:43 GMT
Author: reschke
Date: Mon May 21 13:36:43 2012
New Revision: 1341014

URL: http://svn.apache.org/viewvc?rev=1341014&view=rev
Log:
OAK-37: Use nullability annotation to enforce/document API contract (WIP), also fix exception
message

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/namespace/NamespaceRegistryImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/namespace/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/namespace/NamespaceRegistryImpl.java?rev=1341014&r1=1341013&r2=1341014&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/namespace/NamespaceRegistryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/namespace/NamespaceRegistryImpl.java
Mon May 21 13:36:43 2012
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.jcr.na
 
 import java.util.Locale;
 
+import javax.annotation.Nonnull;
 import javax.jcr.NamespaceException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
@@ -68,6 +69,7 @@ public class NamespaceRegistryImpl imple
     }
 
     @Override
+    @Nonnull
     public String[] getPrefixes() throws RepositoryException {
         try {
             return nsMappings.getPrefixes();
@@ -78,6 +80,7 @@ public class NamespaceRegistryImpl imple
     }
 
     @Override
+    @Nonnull
     public String[] getURIs() throws RepositoryException {
         try {
             return nsMappings.getURIs();
@@ -88,6 +91,7 @@ public class NamespaceRegistryImpl imple
     }
 
     @Override
+    @Nonnull
     public String getURI(String prefix) throws RepositoryException {
         try {
             String uri = nsMappings.getURI(prefix);
@@ -104,12 +108,13 @@ public class NamespaceRegistryImpl imple
     }
 
     @Override
+    @Nonnull
     public String getPrefix(String uri) throws RepositoryException {
         try {
             String prefix = nsMappings.getPrefix(uri);
             if (prefix == null) {
                 throw new NamespaceException(
-                        "No namespace registered for prefix " + prefix);
+                        "No namespace registered for uri: " + uri);
             }
             return prefix;
         } catch (RuntimeException e) {



Mime
View raw message