jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1340991 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Mon, 21 May 2012 12:32:24 GMT
Author: reschke
Date: Mon May 21 12:32:23 2012
New Revision: 1340991

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

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java?rev=1340991&r1=1340990&r2=1340991&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
Mon May 21 12:32:23 2012
@@ -22,6 +22,8 @@ import org.slf4j.LoggerFactory;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.annotation.Nonnull;
+
 /**
  * NamePathMapperImpl...
  */
@@ -155,6 +157,7 @@ public class NamePathMapperImpl implemen
     }
 
     @Override
+    @Nonnull
     public String getJcrPath(String oakPath) {
         final List<String> elements = new ArrayList<String>();
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java?rev=1340991&r1=1340990&r2=1340991&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
Mon May 21 12:32:23 2012
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.oak.namepath;
 
 import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
 
 /**
  * TODO
@@ -45,7 +46,7 @@ public interface PathMapper {
      * @param oakPath Oak path
      * @return JCR path
      */
-    @CheckForNull
+    @Nonnull
     String getJcrPath(String oakPath);
 
 }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1340991&r1=1340990&r2=1340991&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Mon May 21 12:32:23 2012
@@ -20,6 +20,8 @@ import org.apache.jackrabbit.commons.Abs
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
 import javax.jcr.InvalidItemStateException;
 import javax.jcr.Item;
 import javax.jcr.Node;
@@ -51,6 +53,7 @@ abstract class ItemImpl extends Abstract
      * @see javax.jcr.Item#getName()
      */
     @Override
+    @Nonnull
     public String getName() throws RepositoryException {
         String oakName = dlg.getName();
         // special case name of root node
@@ -61,11 +64,13 @@ abstract class ItemImpl extends Abstract
      * @see javax.jcr.Property#getPath()
      */
     @Override
+    @Nonnull
     public String getPath() throws RepositoryException {
         return toJcrPath(dlg.getPath());
     }
 
     @Override
+    @Nonnull
     public Session getSession() throws RepositoryException {
         return sessionDelegate.getSession();
     }
@@ -172,10 +177,12 @@ abstract class ItemImpl extends Abstract
      *
      * @return the value factory
      */
+    @Nonnull
     ValueFactory getValueFactory() {
         return sessionDelegate.getValueFactory();
     }
 
+    @Nonnull
     String toJcrPath(String oakPath) {
         return sessionDelegate.getNamePathMapper().getJcrPath(oakPath);
     }



Mime
View raw message