You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2005/04/21 08:04:23 UTC
svn commit: r164007 [1/2] - in
/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: ./ config/
fs/local/ lock/ nodetype/ observation/ query/ query/lucene/ security/
state/ state/mem/ state/xml/ util/ version/ version/persistence/ virtual/
xml/
Author: jukka
Date: Wed Apr 20 23:04:21 2005
New Revision: 164007
URL: http://svn.apache.org/viewcvs?rev=164007&view=rev
Log:
JCR-97: Improved Checkstyle conformance in various ways.
- removed inline conditionals
- removed tab characters
- removed spaces at line ends
- fixed malformed headers (not the few nonstandard copyright statements)
- fixed expression formatting
- etc.
Modified:
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/ConfigurationParser.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/LoginModuleConfig.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/RAFOutputStream.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockToken.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/PathMap.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/AndQueryNode.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryConstants.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AMContext.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AuthContext.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/SimpleAccessManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PersistenceManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ChildrenCollectorFilter.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ISO9075.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Text.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/GenericVersionSelector.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersion.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/PersistentVersionManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryNodeState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFreezeImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionItemImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SessionImporter.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManager.java Wed Apr 20 23:04:21 2005
@@ -51,7 +51,7 @@
/**
* Returns the depth of the specified item which is equivalent to
- * <code>getPath(id).getAncestorCount()</code>.
+ * <code>getPath(id).getAncestorCount()</code>.
* @param id
* @return
* @throws ItemNotFoundException
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java Wed Apr 20 23:04:21 2005
@@ -109,7 +109,7 @@
// sv:
prefixToURI.put(NS_SV_PREFIX, NS_SV_URI);
uriToPrefix.put(NS_SV_URI, NS_SV_PREFIX);
- // xml:
+ // xml:
prefixToURI.put(NS_XML_PREFIX, NS_XML_URI);
uriToPrefix.put(NS_XML_URI, NS_XML_PREFIX);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Wed Apr 20 23:04:21 2005
@@ -1086,14 +1086,15 @@
* it can only be removed if there no more references to this node
*/
NodeTypeImpl mixin = ntMgr.getNodeType(mixinName);
- if ((MIX_REFERENCEABLE.equals(mixinName) ||
- mixin.isDerivedFrom(MIX_REFERENCEABLE)) &&
- !entRemaining.includesNodeType(MIX_REFERENCEABLE)) {
+ if ((MIX_REFERENCEABLE.equals(mixinName)
+ || mixin.isDerivedFrom(MIX_REFERENCEABLE))
+ && !entRemaining.includesNodeType(MIX_REFERENCEABLE)) {
// removing this mixin would effectively remove mix:referenceable:
// make sure no references exist
PropertyIterator iter = getReferences();
if (iter.hasNext()) {
- throw new ConstraintViolationException(mixinName + " can not be removed: the node is being referenced through at least one property of type REFERENCE");
+ throw new ConstraintViolationException(
+ mixinName + " can not be removed: the node is being referenced through at least one property of type REFERENCE");
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Path.java Wed Apr 20 23:04:21 2005
@@ -527,7 +527,8 @@
last = (PathElement) queue.getLast();
}
} else {
- queue.add(last = elem);
+ last = elem;
+ queue.add(elem);
}
}
if (queue.isEmpty()) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java Wed Apr 20 23:04:21 2005
@@ -398,9 +398,9 @@
SearchManager searchMgr = getSearchManager(wspName);
if (searchMgr != null) {
wsp.getObservationManager().addEventListener(searchMgr,
- Event.NODE_ADDED | Event.NODE_REMOVED |
- Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED |
- Event.PROPERTY_CHANGED,
+ Event.NODE_ADDED | Event.NODE_REMOVED
+ | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED
+ | Event.PROPERTY_CHANGED,
"/", true, null, null, false);
}
@@ -633,7 +633,7 @@
}
activeSessions.clear();
- // shut down workspaces
+ // shut down workspaces
for (Iterator it = wspInfos.values().iterator(); it.hasNext();) {
WorkspaceInfo wspInfo = (WorkspaceInfo) it.next();
wspInfo.dispose();
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java Wed Apr 20 23:04:21 2005
@@ -413,7 +413,7 @@
protected String[] getWorkspaceNames() throws RepositoryException {
// filter workspaces according to access rights
ArrayList list = new ArrayList();
- String names[] = rep.getWorkspaceNames();
+ String[] names = rep.getWorkspaceNames();
for (int i = 0; i < names.length; i++) {
try {
if (getAccessManager().canAccess(names[i])) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java Wed Apr 20 23:04:21 2005
@@ -20,7 +20,6 @@
import org.apache.jackrabbit.core.lock.LockManager;
import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
import org.apache.jackrabbit.core.nodetype.NodeDef;
-import org.apache.jackrabbit.core.nodetype.NodeDefId;
import org.apache.jackrabbit.core.nodetype.NodeTypeConflictException;
import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
import org.apache.jackrabbit.core.nodetype.PropDef;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/ConfigurationParser.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/ConfigurationParser.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/ConfigurationParser.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/ConfigurationParser.java Wed Apr 20 23:04:21 2005
@@ -201,12 +201,12 @@
// Optional login module
Element loginModule = getElement(security, LOGIN_MODULE_ELEMENT, false);
-
+
LoginModuleConfig lmc = null;
if (loginModule != null) {
lmc = new LoginModuleConfig(parseBeanConfig(security, LOGIN_MODULE_ELEMENT));
}
-
+
// General workspace configuration
Element workspaces = getElement(root, WORKSPACES_ELEMENT);
String workspaceDirectory = replaceVariables(
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/LoginModuleConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/LoginModuleConfig.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/LoginModuleConfig.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/LoginModuleConfig.java Wed Apr 20 23:04:21 2005
@@ -43,7 +43,7 @@
public LoginModule getLoginModule() throws ConfigurationException {
Object result = newInstance();
if (result instanceof LoginModule) {
- return (LoginModule)result;
+ return (LoginModule) result;
} else {
throw new ConfigurationException("Invalid login module implementation class "
+ getClassName() + ".");
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/RAFOutputStream.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/RAFOutputStream.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/RAFOutputStream.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/RAFOutputStream.java Wed Apr 20 23:04:21 2005
@@ -108,14 +108,14 @@
/**
* {@inheritDoc}
*/
- public void write(byte b[]) throws IOException {
+ public void write(byte[] b) throws IOException {
write(b, 0, b.length);
}
/**
* {@inheritDoc}
*/
- public void write(byte b[], int off, int len) throws IOException {
+ public void write(byte[] b, int off, int len) throws IOException {
if (len > buffer.length - bufferEnd) {
flush();
raf.write(b, off, len);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java Wed Apr 20 23:04:21 2005
@@ -98,7 +98,7 @@
this.locksFile = locksFile;
((WorkspaceImpl) session.getWorkspace()).getObservationManager().
- addEventListener(this, Event.NODE_ADDED|Event.NODE_REMOVED,
+ addEventListener(this, Event.NODE_ADDED | Event.NODE_REMOVED,
"/", true, null, null, true);
if (locksFile.exists()) {
@@ -106,8 +106,8 @@
load();
} catch (IOException e) {
throw new RepositoryException(
- "I/O error while reading locks from '" +
- locksFile.getPath() + "'", e);
+ "I/O error while reading locks from '"
+ + locksFile.getPath() + "'", e);
}
}
}
@@ -119,8 +119,8 @@
try {
save();
} catch (IOException e) {
- log.warn("I/O error while saving locks to '" +
- locksFile.getPath() + "': " + e.getMessage());
+ log.warn("I/O error while saving locks to '"
+ + locksFile.getPath() + "': " + e.getMessage());
log.debug("Root cause: ", e);
}
}
@@ -166,8 +166,8 @@
info.setLive(true);
lockMap.put(path, info);
} catch (RepositoryException e) {
- log.warn("Unable to recreate lock '" + lockToken +
- "': " + e.getMessage());
+ log.warn("Unable to recreate lock '" + lockToken
+ + "': " + e.getMessage());
log.debug("Root cause: ", e);
}
}
@@ -287,8 +287,8 @@
node.save();
} catch (RepositoryException e) {
- log.warn("Unable to unlock session-scoped lock on node '" +
- info.lockToken + "': " + e.getMessage());
+ log.warn("Unable to unlock session-scoped lock on node '"
+ + info.lockToken + "': " + e.getMessage());
log.debug("Root cause: ", e);
}
@@ -435,8 +435,8 @@
if (info.getLockHolder() == null) {
info.setLockHolder(session);
} else {
- log.warn("Adding lock token has no effect: " +
- "lock already held by other session.");
+ log.warn("Adding lock token has no effect: "
+ + "lock already held by other session.");
}
}
}
@@ -464,8 +464,8 @@
if (session.equals(info.getLockHolder())) {
info.setLockHolder(null);
} else {
- log.warn("Removing lock token has no effect: " +
- "lock held by other session.");
+ log.warn("Removing lock token has no effect: "
+ + "lock held by other session.");
}
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockToken.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockToken.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockToken.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockToken.java Wed Apr 20 23:04:21 2005
@@ -16,15 +16,6 @@
*/
package org.apache.jackrabbit.core.lock;
-import org.apache.jackrabbit.core.SessionListener;
-import org.apache.jackrabbit.core.SessionImpl;
-
-import javax.jcr.lock.Lock;
-import javax.jcr.lock.LockException;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
/**
* Lock token
*/
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/PathMap.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/PathMap.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/PathMap.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/PathMap.java Wed Apr 20 23:04:21 2005
@@ -16,10 +16,14 @@
*/
package org.apache.jackrabbit.core.lock;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
import org.apache.jackrabbit.core.Path;
import org.apache.jackrabbit.core.QName;
-import java.util.*;
/**
* Generic path map that associates information with the individual path elements
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java Wed Apr 20 23:04:21 2005
@@ -341,11 +341,7 @@
log.warn("invalid node type name: " + nodeTypeName, upe);
return false;
}
- if (getQName().equals(ntName) || isDerivedFrom(ntName)) {
- return true;
- } else {
- return false;
- }
+ return (getQName().equals(ntName) || isDerivedFrom(ntName));
}
/**
@@ -452,8 +448,8 @@
return false;
}
int targetType;
- if (def.getRequiredType() != PropertyType.UNDEFINED &&
- def.getRequiredType() != value.getType()) {
+ if (def.getRequiredType() != PropertyType.UNDEFINED
+ && def.getRequiredType() != value.getType()) {
// type conversion required
targetType = def.getRequiredType();
} else {
@@ -515,8 +511,8 @@
}
// determine target type
int targetType;
- if (def.getRequiredType() != PropertyType.UNDEFINED &&
- def.getRequiredType() != type) {
+ if (def.getRequiredType() != PropertyType.UNDEFINED
+ && def.getRequiredType() != type) {
// type conversion required
targetType = def.getRequiredType();
} else {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java Wed Apr 20 23:04:21 2005
@@ -35,7 +35,6 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
-import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -488,8 +487,8 @@
try {
EffectiveNodeType est = getEffectiveNodeType(supertypes);
// make sure that all primary types except nt:base extend from nt:base
- if (!ntd.isMixin() && !NT_BASE.equals(ntd.getName()) &&
- !est.includesNodeType(NT_BASE)) {
+ if (!ntd.isMixin() && !NT_BASE.equals(ntd.getName())
+ && !est.includesNodeType(NT_BASE)) {
String msg = "[" + name
+ "] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base";
log.debug(msg);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefImpl.java Wed Apr 20 23:04:21 2005
@@ -70,7 +70,7 @@
*
* @param valueConstraints
*/
- public void setValueConstraints(ValueConstraint valueConstraints[]) {
+ public void setValueConstraints(ValueConstraint[] valueConstraints) {
if (id != null) {
throw new IllegalStateException("Unable to set attribute. Property definition already compiled.");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventStateCollection.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventStateCollection.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventStateCollection.java Wed Apr 20 23:04:21 2005
@@ -320,7 +320,7 @@
NodeState n = (NodeState) changes.get(new NodeId(state.getParentUUID()));
// node state exists -> only property removed
NodeTypeImpl nodeType = getNodeType(n, session);
- Path paths[] = getAllPaths(state.getId(), hmgr);
+ Path[] paths = getAllPaths(state.getId(), hmgr);
for (int i = 0; i < paths.length; i++) {
events.add(EventState.propertyRemoved(state.getParentUUID(),
getParent(paths[i]),
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/AndQueryNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/AndQueryNode.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/AndQueryNode.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/AndQueryNode.java Wed Apr 20 23:04:21 2005
@@ -16,8 +16,6 @@
*/
package org.apache.jackrabbit.core.query;
-import java.util.Iterator;
-
/**
* Implements a query node that defines an AND operation between arbitrary
* other {@link QueryNode}s.
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java Wed Apr 20 23:04:21 2005
@@ -79,7 +79,11 @@
public TypeMapping[] getPropertyTypes(QName propName) {
synchronized (typeMapping) {
TypeMapping[] types = (TypeMapping[]) typeMapping.get(propName);
- return (types != null) ? types : EMPTY;
+ if (types != null) {
+ return types;
+ } else {
+ return EMPTY;
+ }
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryConstants.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryConstants.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryConstants.java Wed Apr 20 23:04:21 2005
@@ -28,143 +28,143 @@
/**
* QName for jcr:score
*/
- static final QName JCR_SCORE = new QName(NamespaceRegistryImpl.NS_JCR_URI, "score");
+ QName JCR_SCORE = new QName(NamespaceRegistryImpl.NS_JCR_URI, "score");
/**
* QName for jcr:path
*/
- static final QName JCR_PATH = new QName(NamespaceRegistryImpl.NS_JCR_URI, "path");
+ QName JCR_PATH = new QName(NamespaceRegistryImpl.NS_JCR_URI, "path");
/**
* QName for jcr:statement
*/
- static final QName JCR_STATEMENT = new QName(NamespaceRegistryImpl.NS_JCR_URI, "statement");
+ QName JCR_STATEMENT = new QName(NamespaceRegistryImpl.NS_JCR_URI, "statement");
/**
* QName for jcr:language
*/
- static final QName JCR_LANGUAGE = new QName(NamespaceRegistryImpl.NS_JCR_URI, "language");
+ QName JCR_LANGUAGE = new QName(NamespaceRegistryImpl.NS_JCR_URI, "language");
/**
* long data type
*/
- static int TYPE_LONG = 1;
+ int TYPE_LONG = 1;
/**
* double data type
*/
- static int TYPE_DOUBLE = 2;
+ int TYPE_DOUBLE = 2;
/**
* string data type
*/
- static int TYPE_STRING = 3;
+ int TYPE_STRING = 3;
/**
* date data type
*/
- static int TYPE_DATE = 4;
+ int TYPE_DATE = 4;
/**
* timestamp data type
*/
- static int TYPE_TIMESTAMP = 5;
+ int TYPE_TIMESTAMP = 5;
/**
* position index type
*/
- static int TYPE_POSITION = 6;
+ int TYPE_POSITION = 6;
- static int OPERATIONS = 10;
+ int OPERATIONS = 10;
/**
* equal operation: =
*/
- static int OPERATION_EQ_VALUE = OPERATIONS + 1;
+ int OPERATION_EQ_VALUE = OPERATIONS + 1;
/**
* equal operation: =
* general comparison
*/
- static int OPERATION_EQ_GENERAL = OPERATION_EQ_VALUE + 1;
+ int OPERATION_EQ_GENERAL = OPERATION_EQ_VALUE + 1;
/**
* not equal operation: <>
*/
- static int OPERATION_NE_VALUE = OPERATION_EQ_GENERAL + 1;
+ int OPERATION_NE_VALUE = OPERATION_EQ_GENERAL + 1;
/**
* not equal operation: <>
* general comparision
*/
- static int OPERATION_NE_GENERAL = OPERATION_NE_VALUE + 1;
+ int OPERATION_NE_GENERAL = OPERATION_NE_VALUE + 1;
/**
* less than operation: <
*/
- static int OPERATION_LT_VALUE = OPERATION_NE_GENERAL + 1;
+ int OPERATION_LT_VALUE = OPERATION_NE_GENERAL + 1;
/**
* less than operation: <
* general comparison
*/
- static int OPERATION_LT_GENERAL = OPERATION_LT_VALUE + 1;
+ int OPERATION_LT_GENERAL = OPERATION_LT_VALUE + 1;
/**
* greater than operation: >
*/
- static int OPERATION_GT_VALUE = OPERATION_LT_GENERAL + 1;
+ int OPERATION_GT_VALUE = OPERATION_LT_GENERAL + 1;
/**
* greater than operation: >
* general comparision
*/
- static int OPERATION_GT_GENERAL = OPERATION_GT_VALUE + 1;
+ int OPERATION_GT_GENERAL = OPERATION_GT_VALUE + 1;
/**
* greater or equal operation: >=
*/
- static int OPERATION_GE_VALUE = OPERATION_GT_GENERAL + 1;
+ int OPERATION_GE_VALUE = OPERATION_GT_GENERAL + 1;
/**
* greater or equal operation: >=
* general comparison
*/
- static int OPERATION_GE_GENERAL = OPERATION_GE_VALUE + 1;
+ int OPERATION_GE_GENERAL = OPERATION_GE_VALUE + 1;
/**
* less than or equal operation: <=
*/
- static int OPERATION_LE_VALUE = OPERATION_GE_GENERAL + 1;
+ int OPERATION_LE_VALUE = OPERATION_GE_GENERAL + 1;
/**
* less than or equal operation: <=
* general comparison
*/
- static int OPERATION_LE_GENERAL = OPERATION_LE_VALUE + 1;
+ int OPERATION_LE_GENERAL = OPERATION_LE_VALUE + 1;
/**
* like operation: identifier LIKE string_literal
*/
- static int OPERATION_LIKE = OPERATION_LE_GENERAL + 1;
+ int OPERATION_LIKE = OPERATION_LE_GENERAL + 1;
/**
* between operation: identifier [ NOT ] BETWEEN literal AND literal
*/
- static int OPERATION_BETWEEN = OPERATION_LIKE + 1;
+ int OPERATION_BETWEEN = OPERATION_LIKE + 1;
/**
* on operation: identifier [ NOT ] IN ( literal {, literal}* )
*/
- static int OPERATION_IN = OPERATION_BETWEEN + 1;
+ int OPERATION_IN = OPERATION_BETWEEN + 1;
/**
* is null operation: identifier IS NULL
*/
- static int OPERATION_NULL = OPERATION_IN + 1;
+ int OPERATION_NULL = OPERATION_IN + 1;
/**
* is not null operation: identifier IS NOT NULL
*/
- static int OPERATION_NOT_NULL = OPERATION_NULL + 1;
+ int OPERATION_NOT_NULL = OPERATION_NULL + 1;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryHandlerContext.java Wed Apr 20 23:04:21 2005
@@ -26,7 +26,7 @@
* handler is running in.
*/
public class QueryHandlerContext {
-
+
/**
* A <code>FileSystem</code> to store the search index
*/
@@ -39,7 +39,7 @@
/**
* The node type registry of the repository
- */
+ */
private final NodeTypeRegistry ntRegistry;
/**
@@ -49,7 +49,7 @@
/**
* PropertyType registry to look up the type of a property with a given name.
- */
+ */
private final PropertyTypeRegistry propRegistry;
/**
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java Wed Apr 20 23:04:21 2005
@@ -503,7 +503,7 @@
public Object visit(RelationQueryNode node, Object data) {
Query query;
- String stringValues[] = new String[1];
+ String[] stringValues = new String[1];
switch (node.getValueType()) {
case 0:
// not set: either IS NULL or IS NOT NULL
@@ -547,7 +547,8 @@
case QueryConstants.OPERATION_EQ_GENERAL:
BooleanQuery or = new BooleanQuery();
for (int i = 0; i < stringValues.length; i++) {
- or.add(new TermQuery(new Term(FieldNames.PROPERTIES, FieldNames.createNamedValue(field, stringValues[i]))), false, false);
+ or.add(new TermQuery(new Term(FieldNames.PROPERTIES,
+ FieldNames.createNamedValue(field, stringValues[i]))), false, false);
}
query = or;
if (node.getOperation() == QueryConstants.OPERATION_EQ_VALUE) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java Wed Apr 20 23:04:21 2005
@@ -247,7 +247,7 @@
* and if that is the case, tries to extract text from the data atom using
* {@link TextFilterService}add a {@link FieldNames#FULLTEXT} field
* .
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -263,8 +263,10 @@
if (node.hasPropertyEntry(JCR_ENCODING)
&& node.hasPropertyEntry(JCR_MIMETYPE)) {
PropertyState dataProp = (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_DATA));
- PropertyState mimeTypeProp = (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_MIMETYPE));
- PropertyState encodingProp = (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_ENCODING));
+ PropertyState mimeTypeProp =
+ (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_MIMETYPE));
+ PropertyState encodingProp =
+ (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_ENCODING));
Map fields = TextFilterService.extractText(dataProp,
mimeTypeProp.getValues()[0].internalValue().toString(),
@@ -283,11 +285,11 @@
log.debug("Dump: ", e);
}
}
-
+
/**
* Adds the string representation of the boolean value to the document as
* the named field.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -304,7 +306,7 @@
* Adds the calendar value to the document as the named field. The calendar
* value is converted to an indexable string value using the {@link DateField}
* class.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -317,12 +319,12 @@
true,
false));
}
-
+
/**
* Adds the double value to the document as the named field. The double
* value is converted to an indexable string value using the
* {@link DoubleField} class.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -335,12 +337,12 @@
true,
false));
}
-
+
/**
* Adds the long value to the document as the named field. The long
* value is converted to an indexable string value using the {@link LongField}
* class.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -353,12 +355,12 @@
true,
false));
}
-
+
/**
* Adds the reference value to the document as the named field. The value's
* string representation is added as the reference data. Additionally the
* reference data is stored in the index.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -371,12 +373,12 @@
true,
false));
}
-
+
/**
* Adds the path value to the document as the named field. The path
* value is converted to an indexable string value using the name space
* mappings with which this class has been created.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -399,7 +401,7 @@
/**
* Adds the string value to the document both as the named field and for
* full text indexing.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
@@ -421,21 +423,20 @@
true));
// create fulltext index on property
int idx = fieldName.indexOf(':');
- fieldName = fieldName.substring(0, idx + 1) +
- FieldNames.FULLTEXT_PREFIX +
- fieldName.substring(idx + 1);
+ fieldName = fieldName.substring(0, idx + 1)
+ + FieldNames.FULLTEXT_PREFIX + fieldName.substring(idx + 1);
doc.add(new Field(fieldName, stringValue,
false,
true,
true));
}
-
+
/**
* Adds the name value to the document as the named field. The name
* value is converted to an indexable string treating the internal value
* as a qualified name and mapping the name space using the name space
* mappings with which this class has been created.
- *
+ *
* @param doc The document to which to add the field
* @param fieldName The name of the field to add
* @param internalValue The value for the field to add to the document.
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java Wed Apr 20 23:04:21 2005
@@ -198,7 +198,7 @@
selectProps.add(QueryConstants.JCR_PATH);
// add jcr:score if necessary
- if(hasTextsearchNode(root.getLocationNode())) {
+ if (hasTextsearchNode(root.getLocationNode())) {
selectProps.add(QueryConstants.JCR_SCORE);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java Wed Apr 20 23:04:21 2005
@@ -239,7 +239,7 @@
* @param nsMappings the namespace mappings of the search index.
* @return a lucene <code>Document</code> that contains all properties
* of <code>node</code>.
- * @throws RepositoryException if an error occurs while indexing the
+ * @throws RepositoryException if an error occurs while indexing the
* <code>node</code>.
*/
protected Document createDocument(NodeState node, NamespaceMappings nsMappings)
@@ -247,7 +247,7 @@
return NodeIndexer.createDocument(node, getContext().getItemStateManager(),
nsMappings);
}
-
+
//--------------------------< properties >----------------------------------
public void setUseCompoundFile(boolean b) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SharedFieldSortComparator.java Wed Apr 20 23:04:21 2005
@@ -54,9 +54,13 @@
public final int compare (final ScoreDoc i, final ScoreDoc j) {
final int fi = index.order[i.doc];
final int fj = index.order[j.doc];
- if (fi < fj) return -1;
- if (fi > fj) return 1;
- return 0;
+ if (fi < fj) {
+ return -1;
+ } else if (fi > fj) {
+ return 1;
+ } else {
+ return 0;
+ }
}
public Comparable sortValue (final ScoreDoc i) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AMContext.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AMContext.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AMContext.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AMContext.java Wed Apr 20 23:04:21 2005
@@ -49,7 +49,7 @@
* hierarchy manager for resolving ItemId-to-Path mapping
*/
private final HierarchyManager hierMgr;
-
+
/**
* name of the workspace
*/
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AuthContext.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AuthContext.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AuthContext.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/AuthContext.java Wed Apr 20 23:04:21 2005
@@ -42,16 +42,16 @@
* @version $Id$
*/
public abstract class AuthContext {
-
+
/**
* Perform the authentication and, if successful, associate Principals and Credentials
* with the authenticated<code>Subject</code>.
- *
+ *
* @see LoginContext#login()
* @throws LoginException if the authentication fails.
*/
public abstract void login() throws LoginException;
-
+
/**
* Return the authenticated Subject.
*
@@ -67,17 +67,17 @@
* @exception LoginException if the logout fails.
*/
public abstract void logout() throws LoginException;
-
+
/**
* An {@link AuthContext} implemented using a regular JAAS <code>LoginContext</code>.
*/
public static class JAAS extends AuthContext {
-
+
private final LoginContext ctx;
-
+
/**
* Creates an authentication context given a JAAS configuration name and some credentials.
- *
+ *
* @param name the JAAS configuration index
* @param creds the credentials
* @throws LoginException if the JAAS context couldn't be created
@@ -106,9 +106,9 @@
public void logout() throws LoginException {
ctx.logout();
}
-
+
}
-
+
/**
* An {@link AuthContext} implemented using a particular <code>LoginModule</code>.
*/
@@ -117,10 +117,10 @@
private final Map options;
private Subject subject;
private Credentials creds;
-
+
/**
* Creates an authentication context given a login module configuration and some credentials.
- *
+ *
* @param config the login module configuration
* @param creds the credentials
* @throws ConfigurationException if the login module couldn't be created
@@ -141,16 +141,16 @@
new CredentialsCallbackHandler(this.creds),
Collections.EMPTY_MAP,
this.options);
-
+
try {
if (this.module.login()) {
this.module.commit();
}
}
- catch(LoginException le) {
+ catch (LoginException le) {
try {
this.module.abort();
- } catch(Exception e) {
+ } catch (Exception e) {
// Ignore
}
throw le;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/SimpleAccessManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/SimpleAccessManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/SimpleAccessManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/SimpleAccessManager.java Wed Apr 20 23:04:21 2005
@@ -102,8 +102,8 @@
return;
} else if (anonymous) {
// anonymous is always denied WRITE & REMOVE premissions
- if ((permissions & WRITE) == WRITE ||
- (permissions & REMOVE) == REMOVE) {
+ if ((permissions & WRITE) == WRITE
+ || (permissions & REMOVE) == REMOVE) {
throw new AccessDeniedException();
}
}
@@ -124,8 +124,8 @@
return true;
} else if (anonymous) {
// anonymous is always denied WRITE & REMOVE premissions
- if ((permissions & WRITE) == WRITE ||
- (permissions & REMOVE) == REMOVE) {
+ if ((permissions & WRITE) == WRITE
+ || (permissions & REMOVE) == REMOVE) {
return false;
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java Wed Apr 20 23:04:21 2005
@@ -488,7 +488,7 @@
public synchronized void setNodeTypeName(QName nodeTypeName) {
this.nodeTypeName = nodeTypeName;
}
-
+
//---------------------------------------------------------< diff methods >
/**
* Returns a list of parent UUID's, that do not exist in the overlayed node
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PersistenceManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/PersistenceManager.java Wed Apr 20 23:04:21 2005
@@ -41,7 +41,7 @@
* <li>Instantiation, where the instance is created and possible
* configuration properties are set using the JavaBean conventions.
* During this phase the persistence manager should not attempt to
- * reference any external resources.
+ * reference any external resources.
* <li>Initialization, where the {@link #init(PMContext) init} method
* is invoked to bind the persistence manager with a given
* {@link PMContext context}.
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java Wed Apr 20 23:04:21 2005
@@ -453,8 +453,8 @@
throw new NoSuchItemStateException();
}
} catch (NoSuchItemStateException e) {
- String msg = "Target node " + id +
- " of REFERENCE property does not exist";
+ String msg = "Target node " + id
+ + " of REFERENCE property does not exist";
throw new ItemStateException(msg);
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java Wed Apr 20 23:04:21 2005
@@ -338,7 +338,7 @@
refsStore = new HashMap(initialCapacity, loadFactor);
wspFS = context.getFileSystem();
-
+
/**
* store blob's in local file system in a sub directory
* of the workspace home directory
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java Wed Apr 20 23:04:21 2005
@@ -54,7 +54,6 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
import java.util.Set;
/**
@@ -601,12 +600,12 @@
}
writer.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");
- writer.write("<" + PROPERTY_ELEMENT + " " +
- NAME_ATTRIBUTE + "=\"" + state.getName() + "\" " +
- PARENTUUID_ATTRIBUTE + "=\"" + state.getParentUUID() + "\" " +
- MULTIVALUED_ATTRIBUTE + "=\"" + Boolean.toString(state.isMultiValued()) + "\" " +
- DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString() + "\" " +
- TYPE_ATTRIBUTE + "=\"" + typeName + "\">\n");
+ writer.write("<" + PROPERTY_ELEMENT + " "
+ + NAME_ATTRIBUTE + "=\"" + state.getName() + "\" "
+ + PARENTUUID_ATTRIBUTE + "=\"" + state.getParentUUID() + "\" "
+ + MULTIVALUED_ATTRIBUTE + "=\"" + Boolean.toString(state.isMultiValued()) + "\" "
+ + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString() + "\" "
+ + TYPE_ATTRIBUTE + "=\"" + typeName + "\">\n");
// values
writer.write("\t<" + VALUES_ELEMENT + ">\n");
InternalValue[] values = state.getValues();
@@ -646,7 +645,7 @@
}
} else {
// escape '<' and '&'
- char chars[] = val.toString().toCharArray();
+ char[] chars = val.toString().toCharArray();
int j = 0, last = 0;
while (j < chars.length) {
char c = chars[j];
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ChildrenCollectorFilter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ChildrenCollectorFilter.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ChildrenCollectorFilter.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ChildrenCollectorFilter.java Wed Apr 20 23:04:21 2005
@@ -49,7 +49,9 @@
* @param maxLevel umber of hierarchy levels to traverse
* (e.g. 1 for direct children only, 2 for children and their children, and so on)
*/
- public ChildrenCollectorFilter(String namePattern, Collection children, boolean collectNodes, boolean collectProperties, int maxLevel) {
+ public ChildrenCollectorFilter(
+ String namePattern, Collection children,
+ boolean collectNodes, boolean collectProperties, int maxLevel) {
super(false, maxLevel);
this.namePattern = namePattern;
this.children = children;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ISO9075.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ISO9075.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ISO9075.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ISO9075.java Wed Apr 20 23:04:21 2005
@@ -168,15 +168,11 @@
*/
private static boolean needsEscaping(String name, int location) {
if (name.charAt(location) == '_' && name.length() >= location + 6) {
- if (name.charAt(location + 1) == 'x'
- && HEX_DIGITS.indexOf(name.charAt(location + 2)) != -1
- && HEX_DIGITS.indexOf(name.charAt(location + 3)) != -1
- && HEX_DIGITS.indexOf(name.charAt(location + 4)) != -1
- && HEX_DIGITS.indexOf(name.charAt(location + 5)) != -1) {
- return true;
- } else {
- return false;
- }
+ return name.charAt(location + 1) == 'x'
+ && HEX_DIGITS.indexOf(name.charAt(location + 2)) != -1
+ && HEX_DIGITS.indexOf(name.charAt(location + 3)) != -1
+ && HEX_DIGITS.indexOf(name.charAt(location + 4)) != -1
+ && HEX_DIGITS.indexOf(name.charAt(location + 5)) != -1;
} else {
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Text.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Text.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Text.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/Text.java Wed Apr 20 23:04:21 2005
@@ -29,7 +29,7 @@
/**
* used for the md5
*/
- public final static char[] hexTable = "0123456789abcdef".toCharArray();
+ public static final char[] hexTable = "0123456789abcdef".toCharArray();
/**
* Calculate an MD5 hash of the string given.
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/ValueHelper.java Wed Apr 20 23:04:21 2005
@@ -180,7 +180,7 @@
case PropertyType.BINARY:
case PropertyType.STRING:
- case PropertyType.NAME: // a name is always also a relative path
+ case PropertyType.NAME: // a name is always also a relative path
// try conversion via string
String path;
try {
@@ -225,7 +225,7 @@
case PropertyType.BINARY:
case PropertyType.STRING:
- case PropertyType.PATH: // path might be a name (relative path of length 1)
+ case PropertyType.PATH: // path might be a name (relative path of length 1)
// try conversion via string
String name;
try {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/GenericVersionSelector.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/GenericVersionSelector.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/GenericVersionSelector.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/GenericVersionSelector.java Wed Apr 20 23:04:21 2005
@@ -186,7 +186,11 @@
*/
public static Version selectByName(VersionHistory history, String name)
throws RepositoryException {
- return history.hasNode(name) ? history.getVersion(name) : null;
+ if (history.hasNode(name)) {
+ return history.getVersion(name);
+ } else {
+ return null;
+ }
}
/**
@@ -212,7 +216,10 @@
*/
public static Version selectByDate(VersionHistory history, Calendar date)
throws RepositoryException {
- long time = date == null ? Long.MAX_VALUE : date.getTimeInMillis();
+ long time = Long.MAX_VALUE;
+ if (date != null) {
+ time = date.getTimeInMillis();
+ }
long latestDate = Long.MIN_VALUE;
Version latestVersion = null;
VersionIterator iter = history.getAllVersions();
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/HistoryRootNodeState.java Wed Apr 20 23:04:21 2005
@@ -73,7 +73,11 @@
* {@inheritDoc}
*/
public synchronized boolean hasChildNodeEntry(QName name, int index) {
- return index <= 1 ? vm.hasVersionHistory(name.getLocalName()) : false;
+ if (index <= 1) {
+ return vm.hasVersionHistory(name.getLocalName());
+ } else {
+ return false;
+ }
}
/**
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersion.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersion.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersion.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersion.java Wed Apr 20 23:04:21 2005
@@ -18,7 +18,6 @@
import org.apache.jackrabbit.core.QName;
-import javax.jcr.version.Version;
import java.util.Calendar;
/**
@@ -44,21 +43,21 @@
/**
* Equivalent to {@link Version#getCreated()}
*
- * @see Version#getCreated()
+ * @see javax.jcr.version.Version#getCreated()
*/
Calendar getCreated();
/**
* Equivalent to {@link Version#getSuccessors()}}
*
- * @see Version#getSuccessors()
+ * @see javax.jcr.version.Version#getSuccessors()
*/
InternalVersion[] getSuccessors();
/**
* Equivalent to {@link Version#getPredecessors()}}
*
- * @see Version#getPredecessors()
+ * @see javax.jcr.version.Version#getPredecessors()
*/
InternalVersion[] getPredecessors();
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java Wed Apr 20 23:04:21 2005
@@ -19,7 +19,6 @@
import org.apache.jackrabbit.core.QName;
import javax.jcr.version.VersionException;
-import javax.jcr.version.VersionHistory;
import javax.jcr.RepositoryException;
import java.util.Iterator;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/PersistentVersionManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/PersistentVersionManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/PersistentVersionManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/PersistentVersionManager.java Wed Apr 20 23:04:21 2005
@@ -19,7 +19,6 @@
import org.apache.jackrabbit.core.NodeImpl;
import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
-import javax.jcr.Node;
import javax.jcr.RepositoryException;
import java.util.Iterator;
import java.util.List;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryNodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryNodeState.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryNodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryNodeState.java Wed Apr 20 23:04:21 2005
@@ -19,7 +19,6 @@
import org.apache.jackrabbit.core.Constants;
import org.apache.jackrabbit.core.InternalValue;
import org.apache.jackrabbit.core.QName;
-import org.apache.jackrabbit.core.util.uuid.UUID;
import org.apache.jackrabbit.core.virtual.VirtualNodeState;
import javax.jcr.RepositoryException;
@@ -62,7 +61,11 @@
* {@inheritDoc}
*/
public synchronized boolean hasChildNodeEntry(QName name) {
- return vh.hasVersion(name) ? true : super.hasChildNodeEntry(name);
+ if (vh.hasVersion(name)) {
+ return true;
+ } else {
+ return super.hasChildNodeEntry(name);
+ }
}
/**
@@ -70,7 +73,13 @@
*/
public synchronized boolean hasChildNodeEntry(QName name, int index) {
// no same name siblings
- return index <= 1 ? (vh.hasVersion(name) ? true : super.hasChildNodeEntry(name, index)) : false;
+ if (index > 1) {
+ return false;
+ } else if (vh.hasVersion(name)) {
+ return true;
+ } else {
+ return super.hasChildNodeEntry(name, index);
+ }
}
/**
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManager.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManager.java Wed Apr 20 23:04:21 2005
@@ -78,7 +78,7 @@
* is <code>null</code>, the label is removed from the respective version.
* In either case, the version the label was previously assigned is returned,
* or <code>null</code> of the label was not moved.
- *
+ *
* @param history
* @param version
* @param label
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Wed Apr 20 23:04:21 2005
@@ -111,7 +111,8 @@
if (virtProvider == null) {
try {
// init the definition id mgr
- virtProvider = new VersionItemStateProvider(this, ntReg, VERSION_STORAGE_NODE_UUID, VERSION_STORAGE_PARENT_NODE_UUID);
+ virtProvider = new VersionItemStateProvider(
+ this, ntReg, VERSION_STORAGE_NODE_UUID, VERSION_STORAGE_PARENT_NODE_UUID);
} catch (Exception e) {
// todo: better error handling
log.error("Error while initializing virtual items.", e);
@@ -330,7 +331,11 @@
}
virtProvider.invalidateItem(new NodeId(vh.getId()));
obsMgr.dispatch(events, session);
- return v == null ? null : (VersionImpl) session.getNodeByUUID(v.getId());
+ if (v == null) {
+ return null;
+ } else {
+ return (VersionImpl) session.getNodeByUUID(v.getId());
+ }
}
/**
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFreezeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFreezeImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFreezeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFreezeImpl.java Wed Apr 20 23:04:21 2005
@@ -21,7 +21,7 @@
import org.apache.jackrabbit.core.version.PersistentVersionManager;
/**
- *
+ *
*/
abstract class InternalFreezeImpl extends InternalVersionItemImpl implements InternalFreeze {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java Wed Apr 20 23:04:21 2005
@@ -186,7 +186,7 @@
public boolean hasFrozenHistory(String uuid) {
try {
List entries = node.getState().getChildNodeEntries(uuid);
- if (entries.size()>0) {
+ if (entries.size() > 0) {
return getVersionManager().getItem(uuid) instanceof InternalFrozenVersionHistory;
}
} catch (RepositoryException e) {
@@ -276,7 +276,12 @@
PropertyIterator piter = src.getProperties();
while (piter.hasNext()) {
PropertyImpl prop = (PropertyImpl) piter.nextProperty();
- int opv = forceCopy ? OnParentVersionAction.COPY : prop.getDefinition().getOnParentVersion();
+ int opv;
+ if (forceCopy) {
+ opv = OnParentVersionAction.COPY;
+ } else {
+ opv = prop.getDefinition().getOnParentVersion();
+ }
switch (opv) {
case OnParentVersionAction.ABORT:
parent.reload();
@@ -297,7 +302,12 @@
NodeIterator niter = src.getNodes();
while (niter.hasNext()) {
NodeImpl child = (NodeImpl) niter.nextNode();
- int opv = forceCopy ? OnParentVersionAction.COPY : child.getDefinition().getOnParentVersion();
+ int opv;
+ if (forceCopy) {
+ opv = OnParentVersionAction.COPY;
+ } else {
+ opv = child.getDefinition().getOnParentVersion();
+ }
switch (opv) {
case OnParentVersionAction.ABORT:
throw new VersionException("Checkin aborted due to OPV in " + child.safeGetJCRPath());
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java Wed Apr 20 23:04:21 2005
@@ -135,7 +135,7 @@
}
// init label cache
- PersistentNode labels[] = labelNode.getChildNodes();
+ PersistentNode[] labels = labelNode.getChildNodes();
for (int i = 0; i < labels.length; i++) {
PersistentNode lNode = labels[i];
QName name = (QName) lNode.getPropertyValue(NativePVM.PROPNAME_NAME).internalValue();
@@ -295,8 +295,11 @@
public InternalVersion setVersionLabel(QName versionName, QName label, boolean move)
throws VersionException {
- InternalVersion version = versionName == null ? null : getVersion(versionName);
- if (versionName !=null && version == null) {
+ InternalVersion version = null;
+ if (versionName != null) {
+ version = getVersion(versionName);
+ }
+ if (versionName != null && version == null) {
throw new VersionException("Version " + versionName + " does not exist in this version history.");
}
InternalVersionImpl prev = (InternalVersionImpl) labelCache.get(label);
@@ -451,7 +454,9 @@
* @return
* @throws RepositoryException
*/
- protected static InternalVersionHistoryImpl create(PersistentVersionManager vMgr, PersistentNode parent, String historyId, QName name, NodeImpl src)
+ protected static InternalVersionHistoryImpl create(
+ PersistentVersionManager vMgr, PersistentNode parent,
+ String historyId, QName name, NodeImpl src)
throws RepositoryException {
// create history node
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionImpl.java Wed Apr 20 23:04:21 2005
@@ -325,7 +325,11 @@
* @return
*/
protected boolean internalHasLabel(QName label) {
- return labelCache == null ? false : labelCache.contains(label);
+ if (labelCache == null) {
+ return false;
+ } else {
+ return labelCache.contains(label);
+ }
}
/**
@@ -341,7 +345,11 @@
* @return
*/
protected QName[] internalGetLabels() {
- return labelCache == null ? new QName[0] : (QName[]) labelCache.toArray(new QName[labelCache.size()]);
+ if (labelCache == null) {
+ return new QName[0];
+ } else {
+ return (QName[]) labelCache.toArray(new QName[labelCache.size()]);
+ }
}
/**
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionItemImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionItemImpl.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionItemImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionItemImpl.java Wed Apr 20 23:04:21 2005
@@ -18,12 +18,6 @@
import org.apache.jackrabbit.core.version.InternalVersionItem;
import org.apache.jackrabbit.core.version.PersistentVersionManager;
-import org.apache.jackrabbit.core.version.InternalVersionHistory;
-import org.apache.jackrabbit.core.version.InternalVersion;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Iterator;
/**
*
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/NativePVM.java Wed Apr 20 23:04:21 2005
@@ -213,7 +213,11 @@
private InternalVersionHistoryImpl getHistoryByVersionableUUID(String uuid)
throws RepositoryException {
String id = (String) versionedUUIDs.get(uuid);
- return id == null ? null : (InternalVersionHistoryImpl) getVersionHistory(id);
+ if (id == null) {
+ return null;
+ } else {
+ return (InternalVersionHistoryImpl) getVersionHistory(id);
+ }
}
/**
@@ -267,7 +271,9 @@
versionedUUIDs.put(hist.getVersionableUUID(), hist.getId());
- log.info("Created new version history " + hist.getId() + " for " + node.safeGetJCRPath() + ". NumHistories=" + versionedUUIDs.size());
+ log.info("Created new version history " + hist.getId()
+ + " for " + node.safeGetJCRPath()
+ + ". NumHistories=" + versionedUUIDs.size());
return hist;
}
@@ -378,7 +384,10 @@
try {
NodeState state = (NodeState) stateMgr.getItemState(id);
PersistentNode pNode = new PersistentNode(stateMgr, state);
- InternalVersionItem parent = pNode.getParentUUID() == null ? null : getItem(pNode.getParentUUID());
+ InternalVersionItem parent = null;
+ if (pNode.getParentUUID() != null) {
+ parent = getItem(pNode.getParentUUID());
+ }
QName ntName = state.getNodeTypeName();
if (ntName.equals(NT_REP_FROZEN)) {
item = new InternalFrozenNodeImpl(this, pNode, parent);
@@ -441,7 +450,12 @@
}
if (numDots < maxDots) {
maxDots = numDots;
- versionName = pos < 0 ? "1.0" : versionName.substring(0, pos + 1) + (Integer.parseInt(versionName.substring(pos + 1)) + 1);
+ if (pos < 0) {
+ versionName = "1.0";
+ } else {
+ versionName = versionName.substring(0, pos + 1)
+ + (Integer.parseInt(versionName.substring(pos + 1)) + 1);
+ }
}
break;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java Wed Apr 20 23:04:21 2005
@@ -357,7 +357,7 @@
String parentUUID = nodeState.getUUID();
// create a new node state
if (uuid == null) {
- uuid = UUID.randomUUID().toString(); // version 4 uuid
+ uuid = UUID.randomUUID().toString(); // version 4 uuid
}
NodeState state = stateMgr.createNew(uuid, nodeTypeName, parentUUID);
state.setDefinitionId(NodeDefId.valueOf("0"));
@@ -490,7 +490,12 @@
protected void copyFrom(PropertyImpl prop) throws RepositoryException {
if (prop.getDefinition().isMultiple()) {
InternalValue[] values = prop.internalGetValues();
- int type = values.length > 0 ? values[0].getType() : prop.getDefinition().getRequiredType();
+ int type;
+ if (values.length > 0) {
+ type = values[0].getType();
+ } else {
+ type = prop.getDefinition().getRequiredType();
+ }
setPropertyValues(prop.getQName(), type, values);
} else {
setPropertyValue(prop.getQName(), prop.internalGetValue());
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java Wed Apr 20 23:04:21 2005
@@ -46,7 +46,7 @@
* This Class implements a virtual item state provider, in order to expose the
* versions to the version storage.
*/
-abstract public class AbstractVISProvider implements VirtualItemStateProvider, Constants {
+public abstract class AbstractVISProvider implements VirtualItemStateProvider, Constants {
/**
* the default logger
*/
@@ -89,7 +89,7 @@
* @return
* @throws RepositoryException
*/
- abstract protected VirtualNodeState createRootNodeState() throws RepositoryException;
+ protected abstract VirtualNodeState createRootNodeState() throws RepositoryException;
//-----------------------------------------------------< ItemStateManager >
@@ -177,7 +177,7 @@
* @param id
* @return
*/
- abstract protected boolean internalHasNodeState(NodeId id);
+ protected abstract boolean internalHasNodeState(NodeId id);
/**
* Retrieves the node state with the given node id
@@ -187,7 +187,7 @@
* @throws NoSuchItemStateException
* @throws ItemStateException
*/
- abstract protected VirtualNodeState internalGetNodeState(NodeId id)
+ protected abstract VirtualNodeState internalGetNodeState(NodeId id)
throws NoSuchItemStateException, ItemStateException;
/**
@@ -270,7 +270,7 @@
// create a new node state
VirtualNodeState state;
if (uuid == null) {
- uuid = UUID.randomUUID().toString(); // version 4 uuid
+ uuid = UUID.randomUUID().toString(); // version 4 uuid
}
state = new VirtualNodeState(this, parent.getUUID(), uuid, nodeTypeName, new QName[0]);
state.setDefinitionId(def);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java?rev=164007&r1=164006&r2=164007&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java Wed Apr 20 23:04:21 2005
@@ -89,7 +89,11 @@
*/
public InternalValue[] getPropertyValues(QName name) throws NoSuchItemStateException {
VirtualPropertyState ps = getProperty(name);
- return ps == null ? null : ps.getValues();
+ if (ps == null) {
+ return null;
+ } else {
+ return ps.getValues();
+ }
}
/**
@@ -100,7 +104,11 @@
*/
public InternalValue getPropertyValue(QName name) throws NoSuchItemStateException {
VirtualPropertyState ps = getProperty(name);
- return ps == null || ps.getValues().length == 0 ? null : ps.getValues()[0];
+ if (ps == null || ps.getValues().length == 0) {
+ return null;
+ } else {
+ return ps.getValues()[0];
+ }
}
/**