You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2018/11/07 14:10:07 UTC
svn commit: r1846023 [2/3] - in /jackrabbit/oak/branches/1.8: ./ oak-jcr/
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/ oak-j...
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionHistoryDelegate.java Wed Nov 7 14:10:06 2018
@@ -24,7 +24,6 @@ import java.util.Deque;
import java.util.Iterator;
import java.util.List;
-import javax.annotation.Nonnull;
import javax.jcr.InvalidItemStateException;
import javax.jcr.RepositoryException;
import javax.jcr.version.LabelExistsVersionException;
@@ -38,6 +37,7 @@ import org.apache.jackrabbit.oak.api.Pro
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.spi.version.VersionConstants;
+import org.jetbrains.annotations.NotNull;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.jackrabbit.JcrConstants.JCR_BASEVERSION;
@@ -47,8 +47,8 @@ import static org.apache.jackrabbit.JcrC
*/
public class VersionHistoryDelegate extends NodeDelegate {
- VersionHistoryDelegate(@Nonnull SessionDelegate sessionDelegate,
- @Nonnull Tree vhTree) {
+ VersionHistoryDelegate(@NotNull SessionDelegate sessionDelegate,
+ @NotNull Tree vhTree) {
super(sessionDelegate, checkNotNull(vhTree));
}
@@ -56,7 +56,7 @@ public class VersionHistoryDelegate exte
return getTree().getProperty(JcrConstants.JCR_VERSIONABLEUUID).getValue(Type.STRING);
}
- @Nonnull
+ @NotNull
public VersionDelegate getRootVersion() throws RepositoryException {
Tree rootVersion = getTree().getChild(VersionConstants.JCR_ROOTVERSION);
if (!rootVersion.exists()) {
@@ -74,8 +74,8 @@ public class VersionHistoryDelegate exte
* @throws VersionException if there is no version with the given name.
* @throws RepositoryException if another error occurs.
*/
- @Nonnull
- public VersionDelegate getVersion(@Nonnull String versionName)
+ @NotNull
+ public VersionDelegate getVersion(@NotNull String versionName)
throws VersionException, RepositoryException {
checkNotNull(versionName);
Tree version = getTree().getChild(versionName);
@@ -85,8 +85,8 @@ public class VersionHistoryDelegate exte
return VersionDelegate.create(sessionDelegate, version);
}
- @Nonnull
- public VersionDelegate getVersionByLabel(@Nonnull String label)
+ @NotNull
+ public VersionDelegate getVersionByLabel(@NotNull String label)
throws VersionException, RepositoryException {
checkNotNull(label);
Tree versionLabels = getVersionLabelsTree();
@@ -102,7 +102,7 @@ public class VersionHistoryDelegate exte
return VersionDelegate.create(sessionDelegate, version);
}
- @Nonnull
+ @NotNull
public Iterable<String> getVersionLabels() throws RepositoryException {
Tree versionLabels = getVersionLabelsTree();
List<String> labels = new ArrayList<String>();
@@ -114,8 +114,8 @@ public class VersionHistoryDelegate exte
return labels;
}
- @Nonnull
- public Iterable<String> getVersionLabels(@Nonnull String identifier)
+ @NotNull
+ public Iterable<String> getVersionLabels(@NotNull String identifier)
throws RepositoryException {
checkNotNull(identifier);
Tree versionLabels = getVersionLabelsTree();
@@ -129,7 +129,7 @@ public class VersionHistoryDelegate exte
return labels;
}
- @Nonnull
+ @NotNull
public Iterator<VersionDelegate> getAllVersions() throws RepositoryException {
List<NodeDelegate> versions = new ArrayList<NodeDelegate>();
for (Iterator<NodeDelegate> it = getChildren(); it.hasNext();) {
@@ -170,7 +170,7 @@ public class VersionHistoryDelegate exte
});
}
- @Nonnull
+ @NotNull
public Iterator<VersionDelegate> getAllLinearVersions()
throws RepositoryException {
String id = getVersionableIdentifier();
@@ -190,21 +190,21 @@ public class VersionHistoryDelegate exte
return linearVersions.descendingIterator();
}
- public void addVersionLabel(@Nonnull VersionDelegate version,
- @Nonnull String oakVersionLabel,
+ public void addVersionLabel(@NotNull VersionDelegate version,
+ @NotNull String oakVersionLabel,
boolean moveLabel)
throws LabelExistsVersionException, VersionException, RepositoryException {
VersionManagerDelegate vMgr = VersionManagerDelegate.create(sessionDelegate);
vMgr.addVersionLabel(this, version, oakVersionLabel, moveLabel);
}
- public void removeVersionLabel(@Nonnull String oakVersionLabel)
+ public void removeVersionLabel(@NotNull String oakVersionLabel)
throws VersionException, RepositoryException {
VersionManagerDelegate vMgr = VersionManagerDelegate.create(sessionDelegate);
vMgr.removeVersionLabel(this, oakVersionLabel);
}
- public void removeVersion(@Nonnull String oakVersionName) throws RepositoryException {
+ public void removeVersion(@NotNull String oakVersionName) throws RepositoryException {
VersionManagerDelegate vMgr = VersionManagerDelegate.create(sessionDelegate);
vMgr.removeVersion(this, oakVersionName);
}
@@ -217,7 +217,7 @@ public class VersionHistoryDelegate exte
* @throws RepositoryException if the jcr:versionLabels child does not
* exist.
*/
- @Nonnull
+ @NotNull
private Tree getVersionLabelsTree() throws RepositoryException {
Tree versionLabels = getTree().getChild(VersionConstants.JCR_VERSIONLABELS);
if (!versionLabels.exists()) {
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionManagerDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionManagerDelegate.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionManagerDelegate.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/VersionManagerDelegate.java Wed Nov 7 14:10:06 2018
@@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.jcr.delegate;
-import javax.annotation.Nonnull;
import javax.jcr.InvalidItemStateException;
import javax.jcr.RepositoryException;
import javax.jcr.UnsupportedRepositoryOperationException;
@@ -30,6 +29,7 @@ import org.apache.jackrabbit.oak.api.Typ
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.jcr.version.ReadWriteVersionManager;
import org.apache.jackrabbit.oak.jcr.version.VersionStorage;
+import org.jetbrains.annotations.NotNull;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.jackrabbit.JcrConstants.JCR_BASEVERSION;
@@ -60,14 +60,14 @@ public class VersionManagerDelegate {
this.versionManager = new ReadWriteVersionManager(sessionDelegate);
}
- @Nonnull
- public VersionDelegate checkin(@Nonnull NodeDelegate nodeDelegate)
+ @NotNull
+ public VersionDelegate checkin(@NotNull NodeDelegate nodeDelegate)
throws RepositoryException {
return VersionDelegate.create(sessionDelegate,
versionManager.checkin(getTree(nodeDelegate)));
}
- public void checkout(@Nonnull NodeDelegate nodeDelegate)
+ public void checkout(@NotNull NodeDelegate nodeDelegate)
throws RepositoryException {
// perform the operation on a fresh root because
// it must not save pending changes in the workspace
@@ -75,25 +75,25 @@ public class VersionManagerDelegate {
versionManager.checkout(fresh, nodeDelegate.getPath());
}
- public boolean isCheckedOut(@Nonnull NodeDelegate nodeDelegate)
+ public boolean isCheckedOut(@NotNull NodeDelegate nodeDelegate)
throws RepositoryException {
return versionManager.isCheckedOut(getTree(nodeDelegate));
}
- @Nonnull
- public VersionHistoryDelegate createVersionHistory(@Nonnull NodeDelegate versionHistory)
+ @NotNull
+ public VersionHistoryDelegate createVersionHistory(@NotNull NodeDelegate versionHistory)
throws RepositoryException {
return new VersionHistoryDelegate(sessionDelegate, getTree(versionHistory));
}
- @Nonnull
- public VersionDelegate createVersion(@Nonnull NodeDelegate version)
+ @NotNull
+ public VersionDelegate createVersion(@NotNull NodeDelegate version)
throws RepositoryException {
return VersionDelegate.create(sessionDelegate, getTree(version));
}
- @Nonnull
- public VersionHistoryDelegate getVersionHistory(@Nonnull NodeDelegate versionable)
+ @NotNull
+ public VersionHistoryDelegate getVersionHistory(@NotNull NodeDelegate versionable)
throws RepositoryException {
Tree vh = versionManager.getVersionHistory(getTree(versionable));
if (vh == null) {
@@ -103,8 +103,8 @@ public class VersionManagerDelegate {
return new VersionHistoryDelegate(sessionDelegate, vh);
}
- @Nonnull
- public VersionDelegate getBaseVersion(@Nonnull NodeDelegate versionable)
+ @NotNull
+ public VersionDelegate getBaseVersion(@NotNull NodeDelegate versionable)
throws RepositoryException {
Tree v = versionManager.getBaseVersion(getTree(versionable));
if (v == null) {
@@ -114,8 +114,8 @@ public class VersionManagerDelegate {
return VersionDelegate.create(sessionDelegate, v);
}
- @Nonnull
- public VersionDelegate getVersionByIdentifier(@Nonnull String identifier)
+ @NotNull
+ public VersionDelegate getVersionByIdentifier(@NotNull String identifier)
throws RepositoryException {
Tree t = sessionDelegate.getIdManager().getTree(identifier);
if (t == null || !t.exists()) {
@@ -125,9 +125,9 @@ public class VersionManagerDelegate {
return VersionDelegate.create(sessionDelegate, t);
}
- public void restore(@Nonnull NodeDelegate parent,
- @Nonnull String oakName,
- @Nonnull VersionDelegate vd)
+ public void restore(@NotNull NodeDelegate parent,
+ @NotNull String oakName,
+ @NotNull VersionDelegate vd)
throws RepositoryException {
NodeDelegate frozen = vd.getFrozenNode();
PropertyState primaryType = frozen.getProperty(
@@ -168,9 +168,9 @@ public class VersionManagerDelegate {
* version history or if the specified version is the root version (jcr:rootVersion).
* @throws RepositoryException if another error occurs.
*/
- public void addVersionLabel(@Nonnull VersionHistoryDelegate versionHistory,
- @Nonnull VersionDelegate version,
- @Nonnull String oakVersionLabel,
+ public void addVersionLabel(@NotNull VersionHistoryDelegate versionHistory,
+ @NotNull VersionDelegate version,
+ @NotNull String oakVersionLabel,
boolean moveLabel)
throws InvalidItemStateException, LabelExistsVersionException,
VersionException, RepositoryException {
@@ -195,8 +195,8 @@ public class VersionManagerDelegate {
* @throws VersionException if the name label does not exist in this version history.
* @throws RepositoryException if another error occurs.
*/
- public void removeVersionLabel(@Nonnull VersionHistoryDelegate versionHistory,
- @Nonnull String oakVersionLabel)
+ public void removeVersionLabel(@NotNull VersionHistoryDelegate versionHistory,
+ @NotNull String oakVersionLabel)
throws InvalidItemStateException, VersionException, RepositoryException {
// perform operation on fresh storage to not interfere
// with pending changes in the workspace.
@@ -215,8 +215,8 @@ public class VersionManagerDelegate {
* @param oakVersionName the version name
* @throws RepositoryException if an error occurs.
*/
- public void removeVersion(@Nonnull VersionHistoryDelegate versionHistory,
- @Nonnull String oakVersionName) throws RepositoryException {
+ public void removeVersion(@NotNull VersionHistoryDelegate versionHistory,
+ @NotNull String oakVersionName) throws RepositoryException {
// perform operation on fresh storage to not interfere
// with pending changes in the workspace.
Root fresh = sessionDelegate.getContentSession().getLatestRoot();
@@ -235,8 +235,8 @@ public class VersionManagerDelegate {
* @return the underlying tree.
* @throws InvalidItemStateException if the location points to a stale item.
*/
- @Nonnull
- private static Tree getTree(@Nonnull NodeDelegate nodeDelegate)
+ @NotNull
+ private static Tree getTree(@NotNull NodeDelegate nodeDelegate)
throws InvalidItemStateException {
return checkNotNull(nodeDelegate).getTree();
}
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/WorkspaceDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/WorkspaceDelegate.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/WorkspaceDelegate.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/WorkspaceDelegate.java Wed Nov 7 14:10:06 2018
@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.annotation.Nonnull;
import javax.jcr.ItemExistsException;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
@@ -43,6 +42,7 @@ import org.apache.jackrabbit.oak.spi.ver
import org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions;
import org.apache.jackrabbit.oak.plugins.tree.TreeUtil;
import org.apache.jackrabbit.util.Text;
+import org.jetbrains.annotations.NotNull;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.jackrabbit.JcrConstants.JCR_MIXINTYPES;
@@ -108,13 +108,13 @@ public class WorkspaceDelegate {
private final Tree destParent;
private final String destName;
- public WorkspaceCopy(@Nonnull Tree source, @Nonnull Tree destParent, @Nonnull String destName) {
+ public WorkspaceCopy(@NotNull Tree source, @NotNull Tree destParent, @NotNull String destName) {
this.source = source;
this.destParent = destParent;
this.destName = destName;
}
- public void perform(@Nonnull Root root, @Nonnull String userId) throws RepositoryException {
+ public void perform(@NotNull Root root, @NotNull String userId) throws RepositoryException {
try {
Tree typeRoot = root.getTree(NODE_TYPES_PATH);
copy(source, destParent, destName, typeRoot, userId);
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockImpl.java Wed Nov 7 14:10:06 2018
@@ -18,8 +18,6 @@ package org.apache.jackrabbit.oak.jcr.lo
import static com.google.common.base.Preconditions.checkNotNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.lock.Lock;
@@ -31,6 +29,8 @@ import org.apache.jackrabbit.oak.jcr.ses
import org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate;
import org.apache.jackrabbit.oak.jcr.session.operation.NodeOperation;
import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
public final class LockImpl implements Lock {
@@ -38,7 +38,7 @@ public final class LockImpl implements L
private final NodeDelegate delegate;
- public LockImpl(@Nonnull SessionContext context, @Nonnull NodeDelegate delegate) {
+ public LockImpl(@NotNull SessionContext context, @NotNull NodeDelegate delegate) {
this.context = checkNotNull(context);
this.delegate = checkNotNull(delegate);
}
@@ -65,7 +65,7 @@ public final class LockImpl implements L
@Override
public boolean isDeep() {
return getSessionDelegate().safePerform(new NodeOperation<Boolean>(delegate, "isDeep") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return node.holdsLock(true);
@@ -77,7 +77,7 @@ public final class LockImpl implements L
public boolean isLive() {
return context.getSession().isLive() && getSessionDelegate().safePerform(
new NodeOperation<Boolean>(delegate, "isLive") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return node.holdsLock(false);
@@ -126,7 +126,7 @@ public final class LockImpl implements L
@Override
public boolean isSessionScoped() {
return getSessionDelegate().safePerform(new NodeOperation<Boolean>(delegate, "isSessionScoped") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
String path = node.getPath();
@@ -138,7 +138,7 @@ public final class LockImpl implements L
@Override
public boolean isLockOwningSession() {
return getSessionDelegate().safePerform(new NodeOperation<Boolean>(delegate, "isLockOwningSessions") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
String path = node.getPath();
@@ -162,7 +162,7 @@ public final class LockImpl implements L
}
@Nullable
- private <U> U savePerformNullable(@Nonnull SessionOperation<U> op) {
+ private <U> U savePerformNullable(@NotNull SessionOperation<U> op) {
try {
return context.getSessionDelegate().performNullable(op);
} catch (RepositoryException e) {
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockManagerImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockManagerImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockManagerImpl.java Wed Nov 7 14:10:06 2018
@@ -21,7 +21,6 @@ import static org.apache.jackrabbit.oak.
import java.util.Set;
-import javax.annotation.Nonnull;
import javax.jcr.InvalidItemStateException;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
@@ -37,6 +36,7 @@ import org.apache.jackrabbit.oak.jcr.ses
import org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate;
import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation;
+import org.jetbrains.annotations.NotNull;
/**
* Simple lock manager implementation that just keeps track of a set of lock
@@ -54,11 +54,11 @@ public class LockManagerImpl implements
this.delegate = sessionContext.getSessionDelegate();
}
- @Nonnull
+ @NotNull
@Override
public String[] getLockTokens() throws RepositoryException {
return delegate.perform(new SessionOperation<String[]>("getLockTokens") {
- @Nonnull
+ @NotNull
@Override
public String[] perform() {
Set<String> tokens = sessionContext.getOpenScopedLocks();
@@ -73,7 +73,7 @@ public class LockManagerImpl implements
try {
delegate.performVoid(new LockOperation<Void>(sessionContext, lockToken, "addLockToken") {
@Override
- protected void performVoid(@Nonnull NodeDelegate node) throws LockException {
+ protected void performVoid(@NotNull NodeDelegate node) throws LockException {
if (node.holdsLock(false)) { // TODO: check ownership?
String token = node.getPath();
sessionContext.getOpenScopedLocks().add(token);
@@ -90,7 +90,7 @@ public class LockManagerImpl implements
@Override
public void removeLockToken(final String lockToken) throws RepositoryException {
if (!delegate.perform(new SessionOperation<Boolean>("removeLockToken") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
// TODO: name mapping?
@@ -104,9 +104,9 @@ public class LockManagerImpl implements
@Override
public boolean isLocked(String absPath) throws RepositoryException {
return delegate.perform(new LockOperation<Boolean>(sessionContext, absPath, "isLocked") {
- @Nonnull
+ @NotNull
@Override
- protected Boolean perform(@Nonnull NodeDelegate node) {
+ protected Boolean perform(@NotNull NodeDelegate node) {
return node.isLocked();
}
});
@@ -115,21 +115,21 @@ public class LockManagerImpl implements
@Override
public boolean holdsLock(String absPath) throws RepositoryException {
return delegate.perform(new LockOperation<Boolean>(sessionContext, absPath, "holdsLock") {
- @Nonnull
+ @NotNull
@Override
- protected Boolean perform(@Nonnull NodeDelegate node) {
+ protected Boolean perform(@NotNull NodeDelegate node) {
return node.holdsLock(false);
}
});
}
- @Nonnull
+ @NotNull
@Override
public Lock getLock(final String absPath) throws RepositoryException {
NodeDelegate lock = delegate.perform(new LockOperation<NodeDelegate>(sessionContext, absPath, "getLock") {
- @Nonnull
+ @NotNull
@Override
- protected NodeDelegate perform(@Nonnull NodeDelegate node) throws LockException {
+ protected NodeDelegate perform(@NotNull NodeDelegate node) throws LockException {
NodeDelegate lock = node.getLock();
if (lock == null) {
throw new LockException("Node " + absPath + " is not locked");
@@ -142,14 +142,14 @@ public class LockManagerImpl implements
return new LockImpl(sessionContext, lock);
}
- @Nonnull
+ @NotNull
@Override
public Lock lock(String absPath, final boolean isDeep, final boolean isSessionScoped,
long timeoutHint, String ownerInfo) throws RepositoryException {
return new LockImpl(sessionContext, delegate.perform(new LockOperation<NodeDelegate>(sessionContext, absPath, "lock") {
- @Nonnull
+ @NotNull
@Override
- protected NodeDelegate perform(@Nonnull NodeDelegate node) throws RepositoryException {
+ protected NodeDelegate perform(@NotNull NodeDelegate node) throws RepositoryException {
if (node.getStatus() != Status.UNCHANGED) {
throw new InvalidItemStateException(
"Unable to lock a node with pending changes");
@@ -171,7 +171,7 @@ public class LockManagerImpl implements
public void unlock(String absPath) throws RepositoryException {
delegate.performVoid(new LockOperation<Void>(sessionContext, absPath, "unlock") {
@Override
- protected void performVoid(@Nonnull NodeDelegate node)
+ protected void performVoid(@NotNull NodeDelegate node)
throws RepositoryException {
String path = node.getPath();
if (canUnlock(node)) {
@@ -218,4 +218,4 @@ public class LockManagerImpl implements
}
return false;
}
-}
\ No newline at end of file
+}
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockOperation.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockOperation.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/lock/LockOperation.java Wed Nov 7 14:10:06 2018
@@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.jcr.lock;
-import javax.annotation.Nonnull;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
@@ -24,6 +23,7 @@ import org.apache.jackrabbit.oak.jcr.ses
import org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate;
import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation;
+import org.jetbrains.annotations.NotNull;
/**
* Abstract base class for locking operations.
@@ -47,7 +47,7 @@ public abstract class LockOperation<T> e
return true;
}
- @Nonnull
+ @NotNull
@Override
public T perform() throws RepositoryException {
session.refresh(true);
@@ -72,13 +72,13 @@ public abstract class LockOperation<T> e
}
}
- @Nonnull
- protected T perform(@Nonnull NodeDelegate node) throws RepositoryException {
+ @NotNull
+ protected T perform(@NotNull NodeDelegate node) throws RepositoryException {
throw new UnsupportedOperationException();
}
- protected void performVoid(@Nonnull NodeDelegate node) throws RepositoryException {
+ protected void performVoid(@NotNull NodeDelegate node) throws RepositoryException {
throw new UnsupportedOperationException();
}
-}
\ No newline at end of file
+}
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java Wed Nov 7 14:10:06 2018
@@ -33,7 +33,6 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.Nonnull;
import javax.jcr.observation.Event;
import javax.jcr.observation.EventIterator;
import javax.jcr.observation.EventListener;
@@ -69,6 +68,7 @@ import org.apache.jackrabbit.oak.stats.M
import org.apache.jackrabbit.oak.stats.StatisticManager;
import org.apache.jackrabbit.oak.stats.TimerStats;
import org.apache.jackrabbit.stats.TimeSeriesMax;
+import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -232,7 +232,7 @@ class ChangeProcessor implements Filteri
return filterProvider.get();
}
- @Nonnull
+ @NotNull
public ChangeProcessorMBean getMBean() {
return new ChangeProcessorMBean() {
@@ -480,9 +480,9 @@ class ChangeProcessor implements Filteri
}
@Override
- public void contentChanged(@Nonnull NodeState before,
- @Nonnull NodeState after,
- @Nonnull CommitInfo info) {
+ public void contentChanged(@NotNull NodeState before,
+ @NotNull NodeState after,
+ @NotNull CommitInfo info) {
checkNotNull(before); // OAK-5160 before is now guaranteed to be non-null
checkNotNull(after);
checkNotNull(info);
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java Wed Nov 7 14:10:06 2018
@@ -23,8 +23,6 @@ import static com.google.common.collect.
import java.util.LinkedList;
import java.util.NoSuchElementException;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.observation.Event;
import javax.jcr.observation.EventIterator;
@@ -37,6 +35,8 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.plugins.observation.filter.EventFilter;
import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Queue of JCR Events generated from a given content change
@@ -50,9 +50,9 @@ class EventQueue implements EventIterato
private long position = 0;
public EventQueue(
- @Nonnull NamePathMapper mapper, CommitInfo info,
- @Nonnull NodeState before, @Nonnull NodeState after,
- @Nonnull Iterable<String> basePaths, @Nonnull EventFilter filter,
+ @NotNull NamePathMapper mapper, CommitInfo info,
+ @NotNull NodeState before, @NotNull NodeState after,
+ @NotNull Iterable<String> basePaths, @NotNull EventFilter filter,
@Nullable EventAggregator aggregator) {
this.generator = new EventGenerator();
EventFactory factory = new EventFactory(mapper, info);
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilterImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilterImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilterImpl.java Wed Nov 7 14:10:06 2018
@@ -32,8 +32,6 @@ import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
-import javax.annotation.Nonnull;
-
import org.apache.jackrabbit.api.observation.JackrabbitEventFilter;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.commons.PathUtils;
@@ -50,6 +48,7 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.plugins.observation.filter.PermissionProviderFactory;
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.jetbrains.annotations.NotNull;
/**
* Implements OakEventFilter which is an extension to the JackrabbitEventFilter
@@ -248,7 +247,7 @@ public class OakEventFilterImpl extends
private Set<String> relativeGlobPaths;
- public OakEventFilterImpl(@Nonnull JackrabbitEventFilter delegate) {
+ public OakEventFilterImpl(@NotNull JackrabbitEventFilter delegate) {
checkNotNull(delegate);
this.delegate = delegate;
}
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java Wed Nov 7 14:10:06 2018
@@ -35,9 +35,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.RepositoryException;
import javax.jcr.UnsupportedRepositoryOperationException;
import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -71,6 +68,8 @@ import org.apache.jackrabbit.oak.spi.sec
import org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider;
import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
import org.apache.jackrabbit.oak.stats.StatisticManager;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
@@ -123,7 +122,7 @@ public class ObservationManagerImpl impl
this.commitRateLimiter = commitRateLimiter;
this.permissionProviderFactory = new PermissionProviderFactory() {
Set<Principal> principals = sessionDelegate.getAuthInfo().getPrincipals();
- @Nonnull
+ @NotNull
@Override
public PermissionProvider create(Root root) {
return authorizationConfig.getPermissionProvider(root,
@@ -438,7 +437,7 @@ public class ObservationManagerImpl impl
* @throws javax.jcr.RepositoryException if an error occurs while reading from the
* node type manager.
*/
- @CheckForNull
+ @Nullable
private String[] validateNodeTypeNames(@Nullable String[] nodeTypeNames)
throws NoSuchNodeTypeException, RepositoryException {
if (nodeTypeNames == null) {
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryImpl.java Wed Nov 7 14:10:06 2018
@@ -21,7 +21,6 @@ package org.apache.jackrabbit.oak.jcr.qu
import java.util.HashMap;
import java.util.List;
-import javax.annotation.Nonnull;
import javax.jcr.ItemNotFoundException;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
@@ -39,6 +38,7 @@ import org.apache.jackrabbit.oak.jcr.del
import org.apache.jackrabbit.oak.jcr.session.NodeImpl;
import org.apache.jackrabbit.oak.jcr.session.SessionContext;
import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation;
+import org.jetbrains.annotations.NotNull;
/**
* The implementation of the corresponding JCR interface.
@@ -81,7 +81,7 @@ public class QueryImpl implements Query
}
List<String> names = sessionContext.getSessionDelegate().perform(
new SessionOperation<List<String>>("parse") {
- @Nonnull
+ @NotNull
@Override
public List<String> perform() throws RepositoryException {
return manager.parse(statement, language);
@@ -98,7 +98,7 @@ public class QueryImpl implements Query
public QueryResult execute() throws RepositoryException {
return sessionContext.getSessionDelegate().perform(
new SessionOperation<QueryResult>("execute") {
- @Nonnull
+ @NotNull
@Override
public QueryResult perform() throws RepositoryException {
return manager.executeQuery(statement, language, limit,
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java Wed Nov 7 14:10:06 2018
@@ -22,7 +22,6 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;
-import javax.annotation.CheckForNull;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.Value;
@@ -41,6 +40,7 @@ import org.apache.jackrabbit.oak.jcr.ses
import org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate;
import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
import org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -145,7 +145,7 @@ public class QueryResultImpl implements
};
}
- @CheckForNull
+ @Nullable
NodeImpl<? extends NodeDelegate> getNode(Tree tree) throws RepositoryException {
if (tree != null && tree.exists()) {
NodeDelegate node = new NodeDelegate(sessionDelegate, tree);
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java Wed Nov 7 14:10:06 2018
@@ -32,9 +32,6 @@ import java.util.concurrent.ThreadFactor
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.Credentials;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
@@ -71,6 +68,8 @@ import org.apache.jackrabbit.oak.spi.whi
import org.apache.jackrabbit.oak.stats.Clock;
import org.apache.jackrabbit.oak.stats.StatisticManager;
import org.apache.jackrabbit.oak.spi.descriptors.GenericDescriptors;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -132,18 +131,18 @@ public class RepositoryImpl implements J
/**
* Constructor used for backward compatibility.
*/
- public RepositoryImpl(@Nonnull ContentRepository contentRepository,
- @Nonnull Whiteboard whiteboard,
- @Nonnull SecurityProvider securityProvider,
+ public RepositoryImpl(@NotNull ContentRepository contentRepository,
+ @NotNull Whiteboard whiteboard,
+ @NotNull SecurityProvider securityProvider,
int observationQueueLength,
CommitRateLimiter commitRateLimiter) {
this(contentRepository, whiteboard, securityProvider,
observationQueueLength, commitRateLimiter, false);
}
- public RepositoryImpl(@Nonnull ContentRepository contentRepository,
- @Nonnull Whiteboard whiteboard,
- @Nonnull SecurityProvider securityProvider,
+ public RepositoryImpl(@NotNull ContentRepository contentRepository,
+ @NotNull Whiteboard whiteboard,
+ @NotNull SecurityProvider securityProvider,
int observationQueueLength,
CommitRateLimiter commitRateLimiter,
boolean fastQueryResultSize) {
@@ -267,8 +266,8 @@ public class RepositoryImpl implements J
//------------------------------------------------------------< JackrabbitRepository >---
@Override
- public Session login(@CheckForNull Credentials credentials, @CheckForNull String workspaceName,
- @CheckForNull Map<String, Object> attributes) throws RepositoryException {
+ public Session login(@Nullable Credentials credentials, @Nullable String workspaceName,
+ @Nullable Map<String, Object> attributes) throws RepositoryException {
try {
if (attributes == null) {
attributes = emptyMap();
@@ -375,7 +374,7 @@ public class RepositoryImpl implements J
ThreadFactory tf = new ThreadFactory() {
private final AtomicLong counter = new AtomicLong();
@Override
- public Thread newThread(@Nonnull Runnable r) {
+ public Thread newThread(@NotNull Runnable r) {
Thread t = new Thread(r, newName());
t.setDaemon(true);
return t;
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/AccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/AccessManager.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/AccessManager.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/AccessManager.java Wed Nov 7 14:10:06 2018
@@ -16,8 +16,6 @@
*/
package org.apache.jackrabbit.oak.jcr.security;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.jcr.AccessDeniedException;
import javax.jcr.RepositoryException;
@@ -26,6 +24,8 @@ import org.apache.jackrabbit.oak.api.Tre
import org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate;
import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation;
import org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* AccessManager
@@ -40,9 +40,9 @@ public class AccessManager {
this.permissionProvider = permissionProvider;
}
- public boolean hasPermissions(@Nonnull final String oakPath, @Nonnull final String actions) {
+ public boolean hasPermissions(@NotNull final String oakPath, @NotNull final String actions) {
return delegate.safePerform(new SessionOperation<Boolean>("hasPermissions") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return permissionProvider.isGranted(oakPath, actions);
@@ -50,9 +50,9 @@ public class AccessManager {
});
}
- public boolean hasPermissions(@Nonnull final Tree tree, @Nullable final PropertyState property, final long permissions) throws RepositoryException {
+ public boolean hasPermissions(@NotNull final Tree tree, @Nullable final PropertyState property, final long permissions) throws RepositoryException {
return delegate.safePerform(new SessionOperation<Boolean>("hasPermissions") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return permissionProvider.isGranted(tree, property, permissions);
@@ -60,13 +60,13 @@ public class AccessManager {
});
}
- public void checkPermissions(@Nonnull String oakPath, @Nonnull String actions) throws RepositoryException {
+ public void checkPermissions(@NotNull String oakPath, @NotNull String actions) throws RepositoryException {
if (!hasPermissions(oakPath, actions)) {
throw new AccessDeniedException("Access denied.");
}
}
- public void checkPermissions(@Nonnull Tree tree, @Nullable PropertyState property, long permissions) throws RepositoryException {
+ public void checkPermissions(@NotNull Tree tree, @Nullable PropertyState property, long permissions) throws RepositoryException {
if (!hasPermissions(tree, property, permissions)) {
throw new AccessDeniedException("Access denied.");
}
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/ItemImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/ItemImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/ItemImpl.java Wed Nov 7 14:10:06 2018
@@ -28,7 +28,6 @@ import static org.apache.jackrabbit.oak.
import java.util.List;
-import javax.annotation.Nonnull;
import javax.jcr.AccessDeniedException;
import javax.jcr.InvalidItemStateException;
import javax.jcr.Item;
@@ -53,6 +52,7 @@ import org.apache.jackrabbit.oak.jcr.ses
import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation;
import org.apache.jackrabbit.oak.plugins.memory.PropertyBuilder;
import org.apache.jackrabbit.oak.plugins.nodetype.write.ReadWriteNodeTypeManager;
+import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -107,8 +107,8 @@ abstract class ItemImpl<T extends ItemDe
* @return the result of {@code op.perform()}
* @throws RepositoryException as thrown by {@code op.perform()}.
*/
- @Nonnull
- protected final <U> U perform(@Nonnull SessionOperation<U> op) throws RepositoryException {
+ @NotNull
+ protected final <U> U perform(@NotNull SessionOperation<U> op) throws RepositoryException {
return sessionDelegate.perform(op);
}
@@ -118,10 +118,10 @@ abstract class ItemImpl<T extends ItemDe
* @see javax.jcr.Item#getName()
*/
@Override
- @Nonnull
+ @NotNull
public String getName() throws RepositoryException {
String oakName = perform(new ItemOperation<String>(dlg, "getName") {
- @Nonnull
+ @NotNull
@Override
public String perform() {
return item.getName();
@@ -135,10 +135,10 @@ abstract class ItemImpl<T extends ItemDe
* @see javax.jcr.Property#getPath()
*/
@Override
- @Nonnull
+ @NotNull
public String getPath() throws RepositoryException {
return toJcrPath(perform(new ItemOperation<String>(dlg, "getPath") {
- @Nonnull
+ @NotNull
@Override
public String perform() {
return item.getPath();
@@ -146,7 +146,7 @@ abstract class ItemImpl<T extends ItemDe
}));
}
- @Override @Nonnull
+ @Override @NotNull
public Session getSession() {
return sessionContext.getSession();
}
@@ -161,7 +161,7 @@ abstract class ItemImpl<T extends ItemDe
}
ItemDelegate ancestor = perform(new ItemOperation<ItemDelegate>(dlg, "getAncestor") {
- @Nonnull
+ @NotNull
@Override
public ItemDelegate perform() throws RepositoryException {
String path = item.getPath();
@@ -313,22 +313,22 @@ abstract class ItemImpl<T extends ItemDe
}
//-----------------------------------------------------------< internal >---
- @Nonnull
+ @NotNull
String getOakName(String name) throws RepositoryException {
return sessionContext.getOakName(name);
}
- @Nonnull
+ @NotNull
String getOakPathOrThrow(String jcrPath) throws RepositoryException {
return sessionContext.getOakPathOrThrow(jcrPath);
}
- @Nonnull
+ @NotNull
String getOakPathOrThrowNotFound(String relPath) throws PathNotFoundException {
return sessionContext.getOakPathOrThrowNotFound(relPath);
}
- @Nonnull
+ @NotNull
String toJcrPath(String oakPath) {
return sessionContext.getJcrPath(oakPath);
}
@@ -338,22 +338,22 @@ abstract class ItemImpl<T extends ItemDe
*
* @return the value factory
*/
- @Nonnull
+ @NotNull
ValueFactory getValueFactory() {
return sessionContext.getValueFactory();
}
- @Nonnull
+ @NotNull
ReadWriteNodeTypeManager getNodeTypeManager() {
return sessionContext.getWorkspace().getNodeTypeManager();
}
- @Nonnull
+ @NotNull
VersionManager getVersionManager() throws RepositoryException {
return sessionContext.getWorkspace().getVersionManager();
}
- @Nonnull
+ @NotNull
protected PropertyState createSingleState(
String oakName, Value value, Type<?> type)
throws RepositoryException {
@@ -367,7 +367,7 @@ abstract class ItemImpl<T extends ItemDe
}
}
- @Nonnull
+ @NotNull
protected PropertyState createMultiState(
String oakName, List<Value> values, Type<?> type)
throws RepositoryException {
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java Wed Nov 7 14:10:06 2018
@@ -37,8 +37,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
import javax.jcr.AccessDeniedException;
import javax.jcr.Binary;
import javax.jcr.InvalidItemStateException;
@@ -96,6 +94,8 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions;
import org.apache.jackrabbit.oak.plugins.tree.TreeUtil;
import org.apache.jackrabbit.value.ValueHelper;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -117,9 +117,9 @@ public class NodeImpl<T extends NodeDele
*/
private static final Logger LOG = LoggerFactory.getLogger(NodeImpl.class);
- @CheckForNull
+ @Nullable
public static NodeImpl<? extends NodeDelegate> createNodeOrNull(
- @CheckForNull NodeDelegate delegate, @Nonnull SessionContext context)
+ @Nullable NodeDelegate delegate, @NotNull SessionContext context)
throws RepositoryException {
if (delegate != null) {
return createNode(delegate, context);
@@ -128,9 +128,9 @@ public class NodeImpl<T extends NodeDele
}
}
- @Nonnull
+ @NotNull
public static NodeImpl<? extends NodeDelegate> createNode(
- @Nonnull NodeDelegate delegate, @Nonnull SessionContext context)
+ @NotNull NodeDelegate delegate, @NotNull SessionContext context)
throws RepositoryException {
PropertyDelegate pd = delegate.getPropertyOrNull(JCR_PRIMARYTYPE);
String type = pd != null ? pd.getString() : null;
@@ -165,10 +165,10 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Item#getParent()
*/
@Override
- @Nonnull
+ @NotNull
public Node getParent() throws RepositoryException {
return perform(new NodeOperation<Node>(dlg, "getParent") {
- @Nonnull
+ @NotNull
@Override
public Node perform() throws RepositoryException {
if (node.isRoot()) {
@@ -190,7 +190,7 @@ public class NodeImpl<T extends NodeDele
@Override
public boolean isNew() {
return sessionDelegate.safePerform(new NodeOperation<Boolean>(dlg, "isNew") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return node.exists() && node.getStatus() == Status.NEW;
@@ -204,7 +204,7 @@ public class NodeImpl<T extends NodeDele
@Override
public boolean isModified() {
return sessionDelegate.safePerform(new NodeOperation<Boolean>(dlg, "isModified") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return node.exists() && node.getStatus() == Status.MODIFIED;
@@ -245,12 +245,12 @@ public class NodeImpl<T extends NodeDele
* @see Node#addNode(String)
*/
@Override
- @Nonnull
+ @NotNull
public Node addNode(String relPath) throws RepositoryException {
return addNode(relPath, null);
}
- @Override @Nonnull
+ @Override @NotNull
public Node addNode(final String relPath, String primaryNodeTypeName)
throws RepositoryException {
final String oakPath = getOakPathOrThrowNotFound(relPath);
@@ -263,7 +263,7 @@ public class NodeImpl<T extends NodeDele
checkIndexOnName(relPath);
return perform(new ItemWriteOperation<Node>("addNode") {
- @Nonnull
+ @NotNull
@Override
public Node perform() throws RepositoryException {
String oakName = PathUtils.getName(oakPath);
@@ -346,7 +346,7 @@ public class NodeImpl<T extends NodeDele
// of the methods will ever return null, even if asked to remove
// a non-existing property! See internalRemoveProperty() for details.
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, Value value)
throws RepositoryException {
if (value != null) {
@@ -356,7 +356,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, Value value, int type)
throws RepositoryException {
if (value != null) {
@@ -372,7 +372,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, Value[] values)
throws RepositoryException {
if (values != null) {
@@ -383,7 +383,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String jcrName, Value[] values, int type)
throws RepositoryException {
if (values != null) {
@@ -399,7 +399,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, String[] values)
throws RepositoryException {
if (values != null) {
@@ -411,7 +411,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, String[] values, int type)
throws RepositoryException {
if (values != null) {
@@ -427,7 +427,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, String value)
throws RepositoryException {
if (value != null) {
@@ -438,7 +438,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, String value, int type)
throws RepositoryException {
if (value != null) {
@@ -454,7 +454,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull @SuppressWarnings("deprecation")
+ @Override @NotNull @SuppressWarnings("deprecation")
public Property setProperty(String name, InputStream value)
throws RepositoryException {
if (value != null) {
@@ -465,7 +465,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, Binary value)
throws RepositoryException {
if (value != null) {
@@ -476,21 +476,21 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, boolean value)
throws RepositoryException {
Value v = getValueFactory().createValue(value);
return internalSetProperty(name, v, false);
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, double value)
throws RepositoryException {
Value v = getValueFactory().createValue(value);
return internalSetProperty(name, v, false);
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, BigDecimal value)
throws RepositoryException {
if (value != null) {
@@ -501,14 +501,14 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, long value)
throws RepositoryException {
Value v = getValueFactory().createValue(value);
return internalSetProperty(name, v, false);
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, Calendar value)
throws RepositoryException {
if (value != null) {
@@ -519,7 +519,7 @@ public class NodeImpl<T extends NodeDele
}
}
- @Override @Nonnull
+ @Override @NotNull
public Property setProperty(String name, Node value)
throws RepositoryException {
if (value != null) {
@@ -531,11 +531,11 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public Node getNode(String relPath) throws RepositoryException {
final String oakPath = getOakPathOrThrowNotFound(relPath);
return perform(new NodeOperation<Node>(dlg, "getNode") {
- @Nonnull
+ @NotNull
@Override
public Node perform() throws RepositoryException {
NodeDelegate nd = node.getChild(oakPath);
@@ -549,10 +549,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public NodeIterator getNodes() throws RepositoryException {
return perform(new NodeOperation<NodeIterator>(dlg, "getNodes") {
- @Nonnull
+ @NotNull
@Override
public NodeIterator perform() throws RepositoryException {
Iterator<NodeDelegate> children = node.getChildren();
@@ -579,11 +579,11 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public NodeIterator getNodes(final String namePattern)
throws RepositoryException {
return perform(new NodeOperation<NodeIterator>(dlg, "getNodes") {
- @Nonnull
+ @NotNull
@Override
public NodeIterator perform() throws RepositoryException {
Iterator<NodeDelegate> children = Iterators.filter(
@@ -601,10 +601,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public NodeIterator getNodes(final String[] nameGlobs) throws RepositoryException {
return perform(new NodeOperation<NodeIterator>(dlg, "getNodes") {
- @Nonnull
+ @NotNull
@Override
public NodeIterator perform() throws RepositoryException {
Iterator<NodeDelegate> children = Iterators.filter(
@@ -622,11 +622,11 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public Property getProperty(String relPath) throws RepositoryException {
final String oakPath = getOakPathOrThrowNotFound(relPath);
return perform(new NodeOperation<PropertyImpl>(dlg, "getProperty") {
- @Nonnull
+ @NotNull
@Override
public PropertyImpl perform() throws RepositoryException {
PropertyDelegate pd = node.getPropertyOrNull(oakPath);
@@ -641,10 +641,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getProperties() throws RepositoryException {
return perform(new NodeOperation<PropertyIterator>(dlg, "getProperties") {
- @Nonnull
+ @NotNull
@Override
public PropertyIterator perform() throws RepositoryException {
Iterator<PropertyDelegate> properties = node.getProperties();
@@ -656,10 +656,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getProperties(final String namePattern) throws RepositoryException {
return perform(new NodeOperation<PropertyIterator>(dlg, "getProperties") {
- @Nonnull
+ @NotNull
@Override
public PropertyIterator perform() throws RepositoryException {
final PropertyIteratorDelegate delegate = new PropertyIteratorDelegate(node, new Predicate<PropertyDelegate>() {
@@ -680,10 +680,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getProperties(final String[] nameGlobs) throws RepositoryException {
return perform(new NodeOperation<PropertyIterator>(dlg, "getProperties") {
- @Nonnull
+ @NotNull
@Override
public PropertyIterator perform() throws RepositoryException {
final PropertyIteratorDelegate delegate = new PropertyIteratorDelegate(node, new Predicate<PropertyDelegate>() {
@@ -707,10 +707,10 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getPrimaryItem()
*/
@Override
- @Nonnull
+ @NotNull
public Item getPrimaryItem() throws RepositoryException {
return perform(new NodeOperation<Item>(dlg, "getPrimaryItem") {
- @Nonnull
+ @NotNull
@Override
public Item perform() throws RepositoryException {
// TODO: avoid nested calls
@@ -736,10 +736,10 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getUUID()
*/
@Override
- @Nonnull
+ @NotNull
public String getUUID() throws RepositoryException {
return perform(new NodeOperation<String>(dlg, "getUUID") {
- @Nonnull
+ @NotNull
@Override
public String perform() throws RepositoryException {
// TODO: avoid nested calls
@@ -752,11 +752,11 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public String getIdentifier() throws RepositoryException {
// TODO: name mapping for path identifiers
return perform(new NodeOperation<String>(dlg, "getIdentifier") {
- @Nonnull
+ @NotNull
@Override
public String perform() throws RepositoryException {
return node.getIdentifier();
@@ -772,7 +772,7 @@ public class NodeImpl<T extends NodeDele
private PropertyIterator internalGetReferences(final String name, final boolean weak) throws RepositoryException {
return perform(new NodeOperation<PropertyIterator>(dlg, "internalGetReferences") {
- @Nonnull
+ @NotNull
@Override
public PropertyIterator perform() throws InvalidItemStateException {
IdentifierManager idManager = sessionDelegate.getIdManager();
@@ -798,13 +798,13 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getReferences()
*/
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getReferences() throws RepositoryException {
return internalGetReferences(null, false);
}
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getReferences(final String name) throws RepositoryException {
return internalGetReferences(name, false);
}
@@ -813,13 +813,13 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getWeakReferences()
*/
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getWeakReferences() throws RepositoryException {
return internalGetReferences(null, true);
}
@Override
- @Nonnull
+ @NotNull
public PropertyIterator getWeakReferences(String name) throws RepositoryException {
return internalGetReferences(name, true);
}
@@ -829,7 +829,7 @@ public class NodeImpl<T extends NodeDele
try {
final String oakPath = getOakPathOrThrow(relPath);
return perform(new NodeOperation<Boolean>(dlg, "hasNode") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() throws RepositoryException {
return node.getChild(oakPath) != null;
@@ -845,7 +845,7 @@ public class NodeImpl<T extends NodeDele
try {
final String oakPath = getOakPathOrThrow(relPath);
return perform(new NodeOperation<Boolean>(dlg, "hasProperty") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() throws RepositoryException {
return node.getPropertyOrNull(oakPath) != null;
@@ -864,7 +864,7 @@ public class NodeImpl<T extends NodeDele
@Override
public boolean hasProperties() throws RepositoryException {
return perform(new NodeOperation<Boolean>(dlg, "hasProperties") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() throws RepositoryException {
return node.getPropertyCount() != 0;
@@ -876,10 +876,10 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getPrimaryNodeType()
*/
@Override
- @Nonnull
+ @NotNull
public NodeType getPrimaryNodeType() throws RepositoryException {
return perform(new NodeOperation<NodeType>(dlg, "getPrimaryNodeType") {
- @Nonnull
+ @NotNull
@Override
public NodeType perform() throws RepositoryException {
Tree tree = node.getTree();
@@ -897,10 +897,10 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getMixinNodeTypes()
*/
@Override
- @Nonnull
+ @NotNull
public NodeType[] getMixinNodeTypes() throws RepositoryException {
return perform(new NodeOperation<NodeType[]>(dlg, "getMixinNodeTypes") {
- @Nonnull
+ @NotNull
@Override
public NodeType[] perform() throws RepositoryException {
Tree tree = node.getTree();
@@ -924,7 +924,7 @@ public class NodeImpl<T extends NodeDele
public boolean isNodeType(String nodeTypeName) throws RepositoryException {
final String oakName = getOakName(nodeTypeName);
return perform(new NodeOperation<Boolean>(dlg, "isNodeType") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() throws RepositoryException {
Tree tree = node.getTree();
@@ -1003,7 +1003,7 @@ public class NodeImpl<T extends NodeDele
public boolean canAddMixin(String mixinName) throws RepositoryException {
final String oakTypeName = getOakName(mixinName);
return perform(new NodeOperation<Boolean>(dlg, "canAddMixin") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() throws RepositoryException {
PropertyState prop = PropertyStates.createProperty(JCR_MIXINTYPES, singleton(oakTypeName), NAMES);
@@ -1017,10 +1017,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public NodeDefinition getDefinition() throws RepositoryException {
return perform(new NodeOperation<NodeDefinition>(dlg, "getDefinition") {
- @Nonnull
+ @NotNull
@Override
public NodeDefinition perform() throws RepositoryException {
NodeDelegate parent = node.getParent();
@@ -1035,10 +1035,10 @@ public class NodeImpl<T extends NodeDele
}
@Override
- @Nonnull
+ @NotNull
public String getCorrespondingNodePath(final String workspaceName) throws RepositoryException {
return toJcrPath(perform(new ItemOperation<String>(dlg, "getCorrespondingNodePath") {
- @Nonnull
+ @NotNull
@Override
public String perform() throws RepositoryException {
checkValidWorkspace(workspaceName);
@@ -1077,7 +1077,7 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#checkin()
*/
@Override
- @Nonnull
+ @NotNull
public Version checkin() throws RepositoryException {
return getVersionManager().checkin(getPath());
}
@@ -1110,7 +1110,7 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#merge(String, boolean)
*/
@Override
- @Nonnull
+ @NotNull
public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws RepositoryException {
return getVersionManager().merge(getPath(), srcWorkspace, bestEffort);
}
@@ -1184,7 +1184,7 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getVersionHistory()
*/
@Override
- @Nonnull
+ @NotNull
public VersionHistory getVersionHistory() throws RepositoryException {
return getVersionManager().getVersionHistory(getPath());
}
@@ -1193,7 +1193,7 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getBaseVersion()
*/
@Override
- @Nonnull
+ @NotNull
public Version getBaseVersion() throws RepositoryException {
return getVersionManager().getBaseVersion(getPath());
}
@@ -1212,12 +1212,12 @@ public class NodeImpl<T extends NodeDele
return getLockManager().holdsLock(getPath());
}
- @Override @Nonnull
+ @Override @NotNull
public Lock getLock() throws RepositoryException {
return getLockManager().getLock(getPath());
}
- @Override @Nonnull
+ @Override @NotNull
public Lock lock(boolean isDeep, boolean isSessionScoped)
throws RepositoryException {
return getLockManager().lock(
@@ -1229,7 +1229,7 @@ public class NodeImpl<T extends NodeDele
getLockManager().unlock(getPath());
}
- @Override @Nonnull
+ @Override @NotNull
public NodeIterator getSharedSet() {
return new NodeIteratorAdapter(singleton(this));
}
@@ -1265,15 +1265,15 @@ public class NodeImpl<T extends NodeDele
* @see javax.jcr.Node#getAllowedLifecycleTransistions()
*/
@Override
- @Nonnull
+ @NotNull
public String[] getAllowedLifecycleTransistions() throws RepositoryException {
throw new UnsupportedRepositoryOperationException("Lifecycle Management is not supported");
}
//------------------------------------------------------------< internal >---
- @CheckForNull
- private String getPrimaryTypeName(@Nonnull Tree tree) {
+ @Nullable
+ private String getPrimaryTypeName(@NotNull Tree tree) {
String primaryTypeName = null;
if (tree.hasProperty(JcrConstants.JCR_PRIMARYTYPE)) {
primaryTypeName = TreeUtil.getPrimaryTypeName(tree);
@@ -1285,8 +1285,8 @@ public class NodeImpl<T extends NodeDele
return primaryTypeName;
}
- @Nonnull
- private Iterator<String> getMixinTypeNames(@Nonnull Tree tree) throws RepositoryException {
+ @NotNull
+ private Iterator<String> getMixinTypeNames(@NotNull Tree tree) throws RepositoryException {
Iterator<String> mixinNames = Collections.emptyIterator();
if (tree.hasProperty(JcrConstants.JCR_MIXINTYPES) || canReadProperty(tree, JcrConstants.JCR_MIXINTYPES)) {
mixinNames = TreeUtil.getNames(tree, JcrConstants.JCR_MIXINTYPES).iterator();
@@ -1300,7 +1300,7 @@ public class NodeImpl<T extends NodeDele
return mixinNames;
}
- private boolean canReadProperty(@Nonnull Tree tree, @Nonnull String propName) throws RepositoryException {
+ private boolean canReadProperty(@NotNull Tree tree, @NotNull String propName) throws RepositoryException {
String propPath = PathUtils.concat(tree.getPath(), propName);
String permName = Permissions.PERMISSION_NAMES.get(Permissions.READ_PROPERTY);
return sessionContext.getAccessManager().hasPermissions(propPath, permName);
@@ -1371,7 +1371,7 @@ public class NodeImpl<T extends NodeDele
"Cannot set property. Node [%s] is checked in.", getNodePath()));
}
}
- @Nonnull
+ @NotNull
@Override
public Property perform() throws RepositoryException {
return new PropertyImpl(
@@ -1407,7 +1407,7 @@ public class NodeImpl<T extends NodeDele
"Cannot set property. Node [%s] is checked in.", getNodePath()));
}
}
- @Nonnull
+ @NotNull
@Override
public Property perform() throws RepositoryException {
return new PropertyImpl(
@@ -1454,7 +1454,7 @@ public class NodeImpl<T extends NodeDele
"Cannot remove property. Node [%s] is checked in.", getNodePath()));
}
}
- @Nonnull
+ @NotNull
@Override
public Property perform() throws RepositoryException {
PropertyDelegate property = dlg.getPropertyOrNull(oakName);
Modified: jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/PropertyImpl.java?rev=1846023&r1=1846022&r2=1846023&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/PropertyImpl.java (original)
+++ jackrabbit/oak/branches/1.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/PropertyImpl.java Wed Nov 7 14:10:06 2018
@@ -23,7 +23,6 @@ import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List;
-import javax.annotation.Nonnull;
import javax.jcr.AccessDeniedException;
import javax.jcr.Binary;
import javax.jcr.ItemNotFoundException;
@@ -47,6 +46,7 @@ import org.apache.jackrabbit.oak.jcr.del
import org.apache.jackrabbit.oak.jcr.session.operation.PropertyOperation;
import org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl;
import org.apache.jackrabbit.value.ValueHelper;
+import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,10 +70,10 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public Node getParent() throws RepositoryException {
return perform(new PropertyOperation<Node>(dlg, "getParent") {
- @Nonnull
+ @NotNull
@Override
public Node perform() throws RepositoryException {
NodeDelegate parent = property.getParent();
@@ -89,7 +89,7 @@ public class PropertyImpl extends ItemIm
@Override
public boolean isNew() {
return sessionDelegate.safePerform(new PropertyOperation<Boolean>(dlg, "isNew") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return property.getStatus() == Status.NEW;
@@ -100,7 +100,7 @@ public class PropertyImpl extends ItemIm
@Override
public boolean isModified() {
return sessionDelegate.safePerform(new PropertyOperation<Boolean>(dlg, "isModified") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() {
return property.getStatus() == Status.MODIFIED;
@@ -243,10 +243,10 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public Value getValue() throws RepositoryException {
return perform(new PropertyOperation<Value>(dlg, "getValue") {
- @Nonnull
+ @NotNull
@Override
public Value perform() throws RepositoryException {
return ValueFactoryImpl.createValue(
@@ -256,10 +256,10 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public Value[] getValues() throws RepositoryException {
return perform(new PropertyOperation<List<Value>>(dlg, "getValues") {
- @Nonnull
+ @NotNull
@Override
public List<Value> perform() throws RepositoryException {
return ValueFactoryImpl.createValues(
@@ -269,20 +269,20 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public String getString() throws RepositoryException {
return getValue().getString();
}
@SuppressWarnings("deprecation")
@Override
- @Nonnull
+ @NotNull
public InputStream getStream() throws RepositoryException {
return getValue().getStream();
}
@Override
- @Nonnull
+ @NotNull
public Binary getBinary() throws RepositoryException {
return getValue().getBinary();
}
@@ -298,13 +298,13 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public BigDecimal getDecimal() throws RepositoryException {
return getValue().getDecimal();
}
@Override
- @Nonnull
+ @NotNull
public Calendar getDate() throws RepositoryException {
return getValue().getDate();
}
@@ -315,10 +315,10 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public Node getNode() throws RepositoryException {
return perform(new PropertyOperation<Node>(dlg, "getNode") {
- @Nonnull
+ @NotNull
@Override
public Node perform() throws RepositoryException {
// TODO: avoid nested calls
@@ -369,10 +369,10 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public Property getProperty() throws RepositoryException {
return perform(new PropertyOperation<Property>(dlg, "getProperty") {
- @Nonnull
+ @NotNull
@Override
public Property perform() throws RepositoryException {
// TODO: avoid nested calls
@@ -394,7 +394,7 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public long[] getLengths() throws RepositoryException {
Value[] values = getValues();
long[] lengths = new long[values.length];
@@ -406,10 +406,10 @@ public class PropertyImpl extends ItemIm
}
@Override
- @Nonnull
+ @NotNull
public PropertyDefinition getDefinition() throws RepositoryException {
return perform(new PropertyOperation<PropertyDefinition>(dlg, "getDefinition") {
- @Nonnull
+ @NotNull
@Override
public PropertyDefinition perform() throws RepositoryException {
return getNodeTypeManager().getDefinition(
@@ -422,7 +422,7 @@ public class PropertyImpl extends ItemIm
@Override
public int getType() throws RepositoryException {
return perform(new PropertyOperation<Integer>(dlg, "getType") {
- @Nonnull
+ @NotNull
@Override
public Integer perform() throws RepositoryException {
return property.getPropertyState().getType().tag();
@@ -433,7 +433,7 @@ public class PropertyImpl extends ItemIm
@Override
public boolean isMultiple() throws RepositoryException {
return perform(new PropertyOperation<Boolean>(dlg, "isMultiple") {
- @Nonnull
+ @NotNull
@Override
public Boolean perform() throws RepositoryException {
return property.getPropertyState().isArray();
@@ -458,7 +458,7 @@ public class PropertyImpl extends ItemIm
}
}
- private void internalSetValue(@Nonnull final Value value)
+ private void internalSetValue(@NotNull final Value value)
throws RepositoryException {
sessionDelegate.performVoid(new ItemWriteOperation<Void>("internalSetValue") {
@Override
@@ -490,7 +490,7 @@ public class PropertyImpl extends ItemIm
});
}
- private void internalSetValue(@Nonnull final Value[] values)
+ private void internalSetValue(@NotNull final Value[] values)
throws RepositoryException {
if (values.length > MV_PROPERTY_WARN_THRESHOLD) {
LOG.warn("Large multi valued property [{}] detected ({} values).",dlg.getPath(), values.length);