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/25 12:08:38 UTC
svn commit: r164552 - in
/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: ./ config/
lock/ nodetype/ nodetype/virtual/ observation/ query/ query/lucene/
security/ state/ util/ util/uuid/ version/
Author: jukka
Date: Mon Apr 25 03:08:35 2005
New Revision: 164552
URL: http://svn.apache.org/viewcvs?rev=164552&view=rev
Log:
JCR-97: Improved Checkstyle conformance in various ways.
Modified:
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.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/PropertyImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.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/config/RepositoryConfig.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/DelegatingObservationDispatcher.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventConsumer.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventFilter.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventListenerIteratorImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NAryQueryNode.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/OrderQueryNode.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/TextFilterService.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingMultiReader.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MatchAllQuery.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIteratorImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/UserPrincipal.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/ItemState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/TransientItemStateManager.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/util/uuid/Bytes.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java Mon Apr 25 03:08:35 2005
@@ -162,13 +162,7 @@
session.sanityCheck();
// check status of this item for read operation
- switch (status) {
- case STATUS_NORMAL:
- case STATUS_MODIFIED:
- return;
-
- case STATUS_DESTROYED:
- case STATUS_INVALIDATED:
+ if (status == STATUS_DESTROYED || status == STATUS_INVALIDATED) {
throw new InvalidItemStateException(id + ": the item does not exist anymore");
}
}
@@ -383,14 +377,16 @@
case ItemState.STATUS_STALE_MODIFIED:
{
- String msg = transientState.getId() + ": the item cannot be saved because it has been modified externally.";
+ String msg = transientState.getId()
+ + ": the item cannot be saved because it has been modified externally.";
log.debug(msg);
throw new InvalidItemStateException(msg);
}
case ItemState.STATUS_STALE_DESTROYED:
{
- String msg = transientState.getId() + ": the item cannot be saved because it has been deleted externally.";
+ String msg = transientState.getId()
+ + ": the item cannot be saved because it has been deleted externally.";
log.debug(msg);
throw new InvalidItemStateException(msg);
}
@@ -430,7 +426,8 @@
throw new InvalidItemStateException(msg);
}
if (transientState.getStatus() == ItemState.STATUS_STALE_DESTROYED) {
- String msg = transientState.getId() + ": the item cannot be removed because it has already been deleted externally.";
+ String msg = transientState.getId()
+ + ": the item cannot be removed because it has already been deleted externally.";
log.debug(msg);
throw new InvalidItemStateException(msg);
}
@@ -708,7 +705,9 @@
try {
if (!target.getPrimaryPath().isDescendantOf(getPrimaryPath())) {
String msg = itemMgr.safeGetJCRPath(propState.getId())
- + ": target node of REFERENCE property is a new node and must therefore either be saved first or be within the scope of the current save operation.";
+ + ": target node of REFERENCE property is a new node and must"
+ + " therefore either be saved first or be within the scope of"
+ + " the current save operation.";
log.warn(msg);
throw new ReferentialIntegrityException(msg);
}
@@ -870,7 +869,8 @@
node.internalSetProperty(JCR_VERSIONHISTORY, InternalValue.create(new UUID(hist.getUUID())));
node.internalSetProperty(JCR_BASEVERSION, InternalValue.create(new UUID(hist.getRootVersion().getUUID())));
node.internalSetProperty(JCR_ISCHECKEDOUT, InternalValue.create(true));
- node.internalSetProperty(JCR_PREDECESSORS, new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))});
+ node.internalSetProperty(JCR_PREDECESSORS,
+ new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))});
createdTransientState = true;
}
}
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -1,7 +1,7 @@
/*
* Copyright 2004-2005 The Apache Software Foundation or its licensors,
- * as applicable.
- *
+ * as applicable.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -311,23 +311,23 @@
genValues = new InternalValue[]{InternalValue.create(thisState.getUUID())};
}
/*
- todo consolidate version history creation code (currently in ItemImpl.initVersionHistories)
- } else if (nt.getQName().equals(MIX_VERSIONABLE)) {
- // mix:versionable node type
- VersionHistory hist = session.getVersionManager().getOrCreateVersionHistory(this);
- if (name.equals(JCR_VERSIONHISTORY)) {
- // jcr:versionHistory property
- genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getUUID()))};
- } else if (name.equals(JCR_BASEVERSION)) {
- // jcr:baseVersion property
- genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
- } else if (name.equals(JCR_ISCHECKEDOUT)) {
- // jcr:isCheckedOut property
- genValues = new InternalValue[]{InternalValue.create(true)};
- } else if (name.equals(JCR_PREDECESSORS)) {
- // jcr:predecessors property
- genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
- }
+ todo consolidate version history creation code (currently in ItemImpl.initVersionHistories)
+ } else if (nt.getQName().equals(MIX_VERSIONABLE)) {
+ // mix:versionable node type
+ VersionHistory hist = session.getVersionManager().getOrCreateVersionHistory(this);
+ if (name.equals(JCR_VERSIONHISTORY)) {
+ // jcr:versionHistory property
+ genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getUUID()))};
+ } else if (name.equals(JCR_BASEVERSION)) {
+ // jcr:baseVersion property
+ genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
+ } else if (name.equals(JCR_ISCHECKEDOUT)) {
+ // jcr:isCheckedOut property
+ genValues = new InternalValue[]{InternalValue.create(true)};
+ } else if (name.equals(JCR_PREDECESSORS)) {
+ // jcr:predecessors property
+ genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
+ }
*/
} else if (nt.getQName().equals(NT_HIERARCHYNODE)) {
// nt:hierarchyNode node type
@@ -483,7 +483,7 @@
NodeState nodeState;
try {
if (uuid == null) {
- uuid = UUID.randomUUID().toString(); // version 4 uuid
+ uuid = UUID.randomUUID().toString(); // version 4 uuid
}
nodeState =
stateMgr.createTransientNodeState(uuid, nodeType.getQName(),
@@ -1118,7 +1118,8 @@
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");
+ mixinName + " can not be removed: the node is being referenced"
+ + " through at least one property of type REFERENCE");
}
}
@@ -1225,7 +1226,7 @@
* <li>this node must not be locked by somebody else</li>
* </ul>
* Note that certain checks are performed by the respective
- * <code>Property.setValue()</code> methods.
+ * <code>Property.setValue()</code> methods.
*
* @throws VersionException if this node is not checked-out
* @throws LockException if this node is locked by somebody else
@@ -2943,7 +2944,8 @@
* @throws InvalidItemStateException if this nodes session has pending changes
* @throws RepositoryException
*/
- private void checkSessionHasPending() throws RepositoryException {
+ private void checkSessionHasPending()
+ throws InvalidItemStateException, RepositoryException {
// check for pending changes
if (session.hasPendingChanges()) {
String msg = "Unable to perform operation. Session has pending changes.";
@@ -3188,7 +3190,7 @@
*/
protected boolean internalIsCheckedOut() throws RepositoryException {
/**
- * try shortcut first:
+ * try shortcut first:
* if current node is 'new' we can safely consider it checked-out
* since otherwise it would had been impossible to add it in the first
* place
@@ -3357,7 +3359,9 @@
* @throws LockException
* @throws RepositoryException
*/
- private void internalMerge(SessionImpl srcSession, List failedIds, boolean bestEffort, boolean removeExisting, boolean replaceExisting)
+ private void internalMerge(
+ SessionImpl srcSession, List failedIds,
+ boolean bestEffort, boolean removeExisting, boolean replaceExisting)
throws LockException, RepositoryException {
NodeImpl srcNode = doMergeTest(srcSession, failedIds, bestEffort);
@@ -3619,7 +3623,9 @@
} else {
// since we delete the OPV=Copy children beforehand, all
// found nodes must be outside of this tree
- throw new ItemExistsException("Unable to restore node, item already exists outside of restored tree: " + existing.safeGetJCRPath());
+ throw new ItemExistsException(
+ "Unable to restore node, item already exists outside of restored tree: "
+ + existing.safeGetJCRPath());
}
} catch (ItemNotFoundException e) {
// ignore, item with uuid does not exist
@@ -3644,7 +3650,9 @@
} else {
// since we delete the OPV=Copy children beforehand, all
// found nodes must be outside of this tree
- throw new ItemExistsException("Unable to restore node, item already exists outside of restored tree: " + n.safeGetJCRPath());
+ throw new ItemExistsException(
+ "Unable to restore node, item already exists outside of restored tree: "
+ + n.safeGetJCRPath());
}
} else {
// get desired version from version selector
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -109,7 +109,12 @@
* <li>group 7 is index excl. brackets
* </ul>
*/
- private static final Pattern PATH_ELEMENT_PATTERN = Pattern.compile("(\\.)|(\\.\\.)|(([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?):)?([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?)(\\[([1-9]\\d*)\\])?");
+ private static final Pattern PATH_ELEMENT_PATTERN =
+ Pattern.compile("(\\.)|"
+ + "(\\.\\.)|"
+ + "(([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?):)?"
+ + "([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?)"
+ + "(\\[([1-9]\\d*)\\])?");
/**
* the elements of this path
@@ -285,7 +290,8 @@
* @return the relative path created from <code>name</code>.
* @throws IllegalArgumentException if <code>index</code> is negative.
*/
- public static Path create(QName name, int index) {
+ public static Path create(QName name, int index)
+ throws IllegalArgumentException {
if (index < 0) {
throw new IllegalArgumentException("index must not be negative: " + index);
}
@@ -380,7 +386,9 @@
// check if the prefix is a valid XML prefix
if (!XMLChar.isValidNCName(prefix)) {
// illegal syntax for prefix
- throw new MalformedPathException("'" + jcrPath + "' is not a valid path: '" + elem + "' specifies an illegal namespace prefix");
+ throw new MalformedPathException(
+ "'" + jcrPath + "' is not a valid path: '"
+ + elem + "' specifies an illegal namespace prefix");
}
} else {
// no prefix specified
@@ -405,7 +413,9 @@
nsURI = resolver.getURI(prefix);
} catch (NamespaceException nse) {
// unknown prefix
- throw new MalformedPathException("'" + jcrPath + "' is not a valid path: '" + elem + "' specifies an unmapped namespace prefix");
+ throw new MalformedPathException(
+ "'" + jcrPath + "' is not a valid path: '"
+ + elem + "' specifies an unmapped namespace prefix");
}
PathElement element;
@@ -419,7 +429,9 @@
}
} else {
// illegal syntax for path element
- throw new MalformedPathException("'" + jcrPath + "' is not a valid path: '" + elem + "' is not a legal path element");
+ throw new MalformedPathException(
+ "'" + jcrPath + "' is not a valid path: '"
+ + elem + "' is not a legal path element");
}
}
if (resolver != null) {
@@ -639,7 +651,8 @@
* degree
* @throws IllegalArgumentException if <code>degree</code> is negative
*/
- public Path getAncestor(int degree) throws PathNotFoundException {
+ public Path getAncestor(int degree)
+ throws IllegalArgumentException, PathNotFoundException {
if (degree < 0) {
throw new IllegalArgumentException("degree must be >= 0");
} else if (degree == 0) {
@@ -853,7 +866,7 @@
* as a <code>Path</code>.
* @see #toString()
*/
- public static Path valueOf(String s) {
+ public static Path valueOf(String s) throws IllegalArgumentException {
if ("".equals(s) || s == null) {
throw new IllegalArgumentException("invalid Path literal");
}
@@ -1220,7 +1233,7 @@
* @param name qualified name
* @throws IllegalArgumentException if the name is <code>null</code>
*/
- private PathElement(QName name) {
+ private PathElement(QName name) throws IllegalArgumentException {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
@@ -1235,7 +1248,7 @@
* @param index index
* @throws IllegalArgumentException if the name is <code>null</code>
*/
- private PathElement(QName name, int index) {
+ private PathElement(QName name, int index) throws IllegalArgumentException {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
@@ -1370,7 +1383,7 @@
* is <code>null</code> or if its
* format is invalid
*/
- public static PathElement fromString(String s) {
+ public static PathElement fromString(String s) throws IllegalArgumentException {
if (s == null) {
throw new IllegalArgumentException("null PathElement literal");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java Mon Apr 25 03:08:35 2005
@@ -166,9 +166,10 @@
case PropertyType.BINARY:
BLOBFileValue blob = (BLOBFileValue) value.internalValue();
return blob.getLength();
- }
- return -1;
+ default:
+ return -1;
+ }
}
/**
@@ -259,14 +260,10 @@
if (oldValues != null) {
for (int i = 0; i < oldValues.length; i++) {
InternalValue old = oldValues[i];
- if (old != null) {
- switch (old.getType()) {
- case PropertyType.BINARY:
- // BINARY value
- BLOBFileValue blob = (BLOBFileValue) old.internalValue();
- blob.delete();
- break;
- }
+ if (old != null && old.getType() == PropertyType.BINARY) {
+ // BINARY value
+ BLOBFileValue blob = (BLOBFileValue) old.internalValue();
+ blob.delete();
}
}
}
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -170,18 +170,18 @@
// load uuid of the repository's root node
InputStream in = uuidFile.getInputStream();
/*
- // uuid is stored in binary format (16 bytes)
- byte[] bytes = new byte[16];
- try {
- in.read(bytes);
- } finally {
- try {
- in.close();
- } catch (IOException ioe) {
- // ignore
- }
- }
- rootNodeUUID = new UUID(bytes).toString();
+ // uuid is stored in binary format (16 bytes)
+ byte[] bytes = new byte[16];
+ try {
+ in.read(bytes);
+ } finally {
+ try {
+ in.close();
+ } catch (IOException ioe) {
+ // ignore
+ }
+ }
+ rootNodeUUID = new UUID(bytes).toString();
*/
// uuid is stored in text format (36 characters) for better readability
char[] chars = new char[36];
@@ -465,7 +465,7 @@
* @throws NoSuchWorkspaceException If the named workspace does not exist.
*/
protected WorkspaceInfo getWorkspaceInfo(String workspaceName)
- throws NoSuchWorkspaceException {
+ throws IllegalStateException, NoSuchWorkspaceException {
// check sanity of this instance
sanityCheck();
@@ -1084,7 +1084,9 @@
if (itemStateMgr == null) {
// create item state manager
try {
- itemStateMgr = new SharedItemStateManager(getPersistenceManager(config.getPersistenceManagerConfig()), rootNodeUUID, ntReg);
+ itemStateMgr = new SharedItemStateManager(
+ getPersistenceManager(config.getPersistenceManagerConfig()),
+ rootNodeUUID, ntReg);
try {
itemStateMgr.addVirtualItemStateProvider(vMgr.getVirtualItemStateProvider(itemStateMgr));
itemStateMgr.addVirtualItemStateProvider(virtNTMgr.getVirtualItemStateProvider());
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -24,6 +24,7 @@
import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
import org.apache.jackrabbit.core.nodetype.PropDef;
import org.apache.jackrabbit.core.nodetype.PropDefId;
+import org.apache.jackrabbit.core.observation.ObservationManagerFactory;
import org.apache.jackrabbit.core.observation.ObservationManagerImpl;
import org.apache.jackrabbit.core.query.QueryManagerImpl;
import org.apache.jackrabbit.core.security.AccessManager;
@@ -629,8 +630,8 @@
NodeReferences refs = stateMgr.getNodeReferences(refsId);
if (refs.hasReferences()) {
throw new ReferentialIntegrityException(
- hierMgr.safeGetJCRPath(targetId) +
- ": cannot remove node with references");
+ hierMgr.safeGetJCRPath(targetId)
+ + ": cannot remove node with references");
}
} catch (ItemStateException ise) {
String msg = "internal error: failed to check references on "
@@ -1099,7 +1100,8 @@
QName propName)
throws RepositoryException {
- // @todo special handling required for properties with special semantics (e.g. those defined by mix:versionable, mix:lockable, et.al.)
+ // @todo special handling required for properties with special semantics
+ // (e.g. those defined by mix:versionable, mix:lockable, et.al.)
PropertyState newState = stateMgr.createNew(propName, parentUUID);
PropDefId defId = srcState.getDefinitionId();
newState.setDefinitionId(defId);
@@ -1577,7 +1579,9 @@
if (obsMgr == null) {
try {
- obsMgr = rep.getObservationManagerFactory(wspConfig.getName()).createObservationManager(session, session.getItemManager());
+ ObservationManagerFactory factory =
+ rep.getObservationManagerFactory(wspConfig.getName());
+ obsMgr = factory.createObservationManager(session, session.getItemManager());
} catch (NoSuchWorkspaceException nswe) {
// should never get here
String msg = "internal error: failed to instantiate observation manager";
@@ -1684,9 +1688,13 @@
}
if (restored == null) {
if (numRestored == 0) {
- throw new VersionException("Unable to restore. At least one version needs existing versionable node in workspace.");
+ throw new VersionException(
+ "Unable to restore. At least one version needs"
+ + " existing versionable node in workspace.");
} else {
- throw new VersionException("Unable to restore. All versions with non existing versionable nodes need parent.");
+ throw new VersionException(
+ "Unable to restore. All versions with non"
+ + " existing versionable nodes need parent.");
}
}
}
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -538,7 +538,7 @@
* @param parent parent element
* @param name name of the child element
* @return named child element
- * @throws ConfigurationException
+ * @throws ConfigurationException
* @throws ConfigurationException if the child element is not found
*/
private Element getElement(Element parent, String name) throws ConfigurationException {
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -24,7 +24,7 @@
* <p>
* Login module is an optional configuration that allows to use JackRabbit
* in a non-JAAS environment.
- *
+ *
* @see RepositoryConfig#getLoginModuleConfig()
* @version $Id$
*/
@@ -39,7 +39,7 @@
LoginModuleConfig(BeanConfig config) {
super(config);
}
-
+
public LoginModule getLoginModule() throws ConfigurationException {
Object result = newInstance();
if (result instanceof LoginModule) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/RepositoryConfig.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/RepositoryConfig.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/RepositoryConfig.java Mon Apr 25 03:08:35 2005
@@ -372,7 +372,7 @@
/**
* Returns the repository login module configuration.
- *
+ *
* @return login module configuration, or <code>null</code> if standard
* JAAS mechanism should be used.
*/
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -285,7 +285,7 @@
node.internalSetProperty(Constants.JCR_LOCKOWNER, null);
node.internalSetProperty(Constants.JCR_LOCKISDEEP, null);
node.save();
-
+
} catch (RepositoryException e) {
log.warn("Unable to unlock session-scoped lock on node '"
+ info.lockToken + "': " + e.getMessage());
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeType.java Mon Apr 25 03:08:35 2005
@@ -126,7 +126,8 @@
ItemDef def = (ItemDef) defs.get(j);
if (cnda[i].isAutoCreated() || def.isAutoCreated()) {
// conflict
- String msg = "There are more than one 'auto-create' item definitions for '" + name + "' in node type '" + ntName + "'";
+ String msg = "There are more than one 'auto-create' item definitions for '"
+ + name + "' in node type '" + ntName + "'";
log.debug(msg);
throw new NodeTypeConflictException(msg);
}
@@ -157,7 +158,8 @@
ItemDef def = (ItemDef) defs.get(j);
if (pda[i].isAutoCreated() || def.isAutoCreated()) {
// conflict
- String msg = "There are more than one 'auto-create' item definitions for '" + name + "' in node type '" + ntName + "'";
+ String msg = "There are more than one 'auto-create' item definitions for '"
+ + name + "' in node type '" + ntName + "'";
log.debug(msg);
throw new NodeTypeConflictException(msg);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java Mon Apr 25 03:08:35 2005
@@ -22,7 +22,7 @@
/**
* <code>ItemDef</code> is the internal representation of
* an item definition. It refers to <code>QName</code>s only
- * and is thus isolated from session-specific namespace mappings.
+ * and is thus isolated from session-specific namespace mappings.
*
* @see javax.jcr.nodetype.ItemDefinition
*/
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java Mon Apr 25 03:08:35 2005
@@ -93,7 +93,7 @@
* as a <code>NodeDefId</code>.
* @see #toString()
*/
- public static NodeDefId valueOf(String s) {
+ public static NodeDefId valueOf(String s) throws IllegalArgumentException {
if (s == null) {
throw new IllegalArgumentException("invalid NodeDefId literal");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeDef.java Mon Apr 25 03:08:35 2005
@@ -83,7 +83,7 @@
* value constraints in property definitions).
* <p/>
* Note that self-references (e.g. a child node definition that specifies
- * the declaring node type as the default primary type) are not considered
+ * the declaring node type as the default primary type) are not considered
* dependencies.
*
* @return a collection of node type <code>QName</code>s
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java Mon Apr 25 03:08:35 2005
@@ -185,7 +185,7 @@
public void nodeTypeReRegistered(QName ntName) {
// flush all affected cache entries
ntCache.remove(ntName);
- synchronized(pdCache) {
+ synchronized (pdCache) {
Iterator iter = pdCache.values().iterator();
while (iter.hasNext()) {
PropDefImpl pd = (PropDefImpl) iter.next();
@@ -194,7 +194,7 @@
}
}
}
- synchronized(ndCache) {
+ synchronized (ndCache) {
Iterator iter = ndCache.values().iterator();
while (iter.hasNext()) {
NodeDefImpl nd = (NodeDefImpl) iter.next();
@@ -211,7 +211,7 @@
public void nodeTypeUnregistered(QName ntName) {
// flush all affected cache entries
ntCache.remove(ntName);
- synchronized(pdCache) {
+ synchronized (pdCache) {
Iterator iter = pdCache.values().iterator();
while (iter.hasNext()) {
PropDefImpl pd = (PropDefImpl) iter.next();
@@ -220,7 +220,7 @@
}
}
}
- synchronized(ndCache) {
+ synchronized (ndCache) {
Iterator iter = ndCache.values().iterator();
while (iter.hasNext()) {
NodeDefImpl nd = (NodeDefImpl) iter.next();
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -166,7 +166,7 @@
try {
// load built-in node type definitions
loadBuiltInNodeTypeDefs(builtInNTDefs);
-
+
// validate & register built-in node types
internalRegister(builtInNTDefs.all());
} catch (InvalidNodeTypeDefException intde) {
@@ -489,8 +489,8 @@
// 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)) {
- String msg = "[" + name
- + "] all primary node types except nt:base itself must be (directly or indirectly) derived from 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);
throw new InvalidNodeTypeDefException(msg);
}
@@ -1778,8 +1778,11 @@
// ignore weight
Iterator i = set.iterator();
while (i.hasNext()) {
+ h *= 37;
Object obj = i.next();
- h = 37 * h + (obj != null ? obj.hashCode() : 0);
+ if (obj != null) {
+ h += obj.hashCode();
+ }
}
return h;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropDefId.java Mon Apr 25 03:08:35 2005
@@ -89,7 +89,7 @@
* as a <code>PropDefId</code>.
* @see #toString()
*/
- public static PropDefId valueOf(String s) {
+ public static PropDefId valueOf(String s) throws IllegalArgumentException {
if (s == null) {
throw new IllegalArgumentException("invalid PropDefId literal");
}
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -49,7 +49,7 @@
private boolean multiple = false;
/**
- * The identifier of this property definition. The identifier is lazily
+ * The identifier of this property definition. The identifier is lazily
* computed based on the characteristics of this property definition and
* reset on every attribute change.
*/
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/PropertyDefinitionImpl.java Mon Apr 25 03:08:35 2005
@@ -52,7 +52,7 @@
/**
* Returns the wrapped property definition.
- *
+ *
* @return the wrapped property definition.
*/
public PropDef unwrap() {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java Mon Apr 25 03:08:35 2005
@@ -273,8 +273,8 @@
s = matcher.group(4);
upperInclusive = s.equals("]");
if (lowerLimit == null && upperLimit == null) {
- String msg = "'" + definition
- + "' is not a valid value constraint format for numeric types: neither lower- nor upper-limit specified";
+ String msg = "'" + definition + "' is not a valid value constraint"
+ + " format for numeric types: neither lower- nor upper-limit specified";
log.debug(msg);
throw new InvalidConstraintException(msg);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateManager.java Mon Apr 25 03:08:35 2005
@@ -87,7 +87,9 @@
* @param rootNodeId
* @param parentId
*/
- public VirtualNodeTypeStateManager(NodeTypeRegistry ntReg, DelegatingObservationDispatcher obs, String rootNodeId, String parentId) {
+ public VirtualNodeTypeStateManager(
+ NodeTypeRegistry ntReg, DelegatingObservationDispatcher obs,
+ String rootNodeId, String parentId) {
this.ntReg = ntReg;
this.obsDispatcher = obs;
this.rootNodeId = rootNodeId;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java Mon Apr 25 03:08:35 2005
@@ -195,7 +195,8 @@
}
pState.setPropertyValue(JCR_AUTOCREATED, InternalValue.create(propDef.isAutoCreated()));
pState.setPropertyValue(JCR_MANDATORY, InternalValue.create(propDef.isMandatory()));
- pState.setPropertyValue(JCR_ONPARENTVERSION, InternalValue.create(OnParentVersionAction.nameFromValue(propDef.getOnParentVersion())));
+ pState.setPropertyValue(JCR_ONPARENTVERSION,
+ InternalValue.create(OnParentVersionAction.nameFromValue(propDef.getOnParentVersion())));
pState.setPropertyValue(JCR_PROTECTED, InternalValue.create(propDef.isProtected()));
pState.setPropertyValue(JCR_MULTIPLE, InternalValue.create(propDef.isMultiple()));
pState.setPropertyValue(JCR_REQUIREDTYPE, InternalValue.create(PropertyType.nameFromValue(propDef.getRequiredType())));
@@ -229,9 +230,11 @@
}
pState.setPropertyValue(JCR_AUTOCREATED, InternalValue.create(cnDef.isAutoCreated()));
pState.setPropertyValue(JCR_MANDATORY, InternalValue.create(cnDef.isMandatory()));
- pState.setPropertyValue(JCR_ONPARENTVERSION, InternalValue.create(OnParentVersionAction.nameFromValue(cnDef.getOnParentVersion())));
+ pState.setPropertyValue(JCR_ONPARENTVERSION,
+ InternalValue.create(OnParentVersionAction.nameFromValue(cnDef.getOnParentVersion())));
pState.setPropertyValue(JCR_PROTECTED, InternalValue.create(cnDef.isProtected()));
- pState.setPropertyValues(JCR_REQUIREDPRIMARYTYPES, PropertyType.NAME, InternalValue.create(cnDef.getRequiredPrimaryTypes()));
+ pState.setPropertyValues(JCR_REQUIREDPRIMARYTYPES,
+ PropertyType.NAME, InternalValue.create(cnDef.getRequiredPrimaryTypes()));
if (cnDef.getDefaultPrimaryType() != null) {
pState.setPropertyValue(JCR_DEFAULTPRIMARYTYPE, InternalValue.create(cnDef.getDefaultPrimaryType()));
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/DelegatingObservationDispatcher.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/DelegatingObservationDispatcher.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/DelegatingObservationDispatcher.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/DelegatingObservationDispatcher.java Mon Apr 25 03:08:35 2005
@@ -56,7 +56,7 @@
* Dispatchers a list of events to all registered dispatchers. A new
* {@link EventStateCollection} is created for every dispatcher, fille with
* the given event list and then dispatched.
- *
+ *
* @param eventList
* @param session
* @throws RepositoryException
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventConsumer.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventConsumer.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventConsumer.java Mon Apr 25 03:08:35 2005
@@ -89,7 +89,8 @@
* @throws NullPointerException if <code>session</code>, <code>listener</code>
* or <code>filter</code> is<code>null</code>.
*/
- EventConsumer(SessionImpl session, EventListener listener, EventFilter filter) {
+ EventConsumer(SessionImpl session, EventListener listener, EventFilter filter)
+ throws NullPointerException {
if (session == null) {
throw new NullPointerException("session");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventFilter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventFilter.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventFilter.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventFilter.java Mon Apr 25 03:08:35 2005
@@ -184,7 +184,8 @@
if (nodeTypes != null) {
boolean match = false;
for (int i = 0; i < nodeTypes.length && !match; i++) {
- match |= eventState.getNodeType().getQName().equals(nodeTypes[i].getQName()) || eventState.getNodeType().isDerivedFrom(nodeTypes[i].getQName());
+ match |= eventState.getNodeType().getQName().equals(nodeTypes[i].getQName())
+ || eventState.getNodeType().isDerivedFrom(nodeTypes[i].getQName());
}
if (!match) {
return true;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventImpl.java Mon Apr 25 03:08:35 2005
@@ -83,7 +83,8 @@
try {
Path p;
if (eventState.getChildRelPath().getIndex() > 0) {
- p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(), eventState.getChildRelPath().getIndex(), false);
+ p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(),
+ eventState.getChildRelPath().getIndex(), false);
} else {
p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(), false);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventListenerIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventListenerIteratorImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventListenerIteratorImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/EventListenerIteratorImpl.java Mon Apr 25 03:08:35 2005
@@ -59,7 +59,8 @@
* @throws NullPointerException if <code>ticket</code> or <code>consumer</code>
* is <code>null</code>.
*/
- EventListenerIteratorImpl(Session session, Collection sConsumers, Collection aConsumers) {
+ EventListenerIteratorImpl(Session session, Collection sConsumers, Collection aConsumers)
+ throws NullPointerException {
if (session == null) {
throw new NullPointerException("session");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/observation/ObservationManagerImpl.java Mon Apr 25 03:08:35 2005
@@ -66,7 +66,7 @@
*/
ObservationManagerImpl(ObservationManagerFactory obsMgrFactory,
SessionImpl session,
- ItemManager itemMgr) {
+ ItemManager itemMgr) throws NullPointerException {
if (session == null) {
throw new NullPointerException("session");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NAryQueryNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NAryQueryNode.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NAryQueryNode.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NAryQueryNode.java Mon Apr 25 03:08:35 2005
@@ -125,7 +125,7 @@
if (operands == null) {
return EMPTY;
}
-
+
List result = new ArrayList(operands.size());
for (int i = 0; i < operands.size(); i++) {
Object r = ((QueryNode) operands.get(i)).accept(visitor, data);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/OrderQueryNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/OrderQueryNode.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/OrderQueryNode.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/OrderQueryNode.java Mon Apr 25 03:08:35 2005
@@ -87,7 +87,7 @@
* @throws IndexOutOfBoundsException if there is no property with
* index <code>i</code>.
*/
- public boolean isAscending(int i) {
+ public boolean isAscending(int i) throws IndexOutOfBoundsException {
return ((OrderSpec) specs.get(i)).ascending;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/TextFilterService.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/TextFilterService.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/TextFilterService.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/TextFilterService.java Mon Apr 25 03:08:35 2005
@@ -50,6 +50,9 @@
*/
public class TextFilterService {
+ /** Hidden constructor. */
+ private TextFilterService() { }
+
/**
* Logger instance for this class.
*/
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java Mon Apr 25 03:08:35 2005
@@ -127,7 +127,7 @@
* @throws IllegalArgumentException if the document with number
* <code>n</code> is deleted.
*/
- public Document document(int n) throws IOException {
+ public Document document(int n) throws IOException, IllegalArgumentException {
if (isDeleted(n)) {
throw new IllegalArgumentException("attempt to access a deleted document");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingMultiReader.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingMultiReader.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingMultiReader.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/CachingMultiReader.java Mon Apr 25 03:08:35 2005
@@ -55,7 +55,8 @@
* @exception IllegalArgumentException if <code>subReaders</code> does
* not comply to the above type requirements.
*/
- public CachingMultiReader(IndexReader[] subReaders) throws IOException {
+ public CachingMultiReader(IndexReader[] subReaders)
+ throws IOException, IllegalArgumentException {
super(subReaders);
// check readers, all but last must be a CachingIndexReader
for (int i = 0; i < subReaders.length - 1; i++) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java Mon Apr 25 03:08:35 2005
@@ -344,7 +344,8 @@
// only select last
List childNodes = state.getChildNodeEntries();
if (childNodes.size() == 0
- || !((NodeState.ChildNodeEntry) childNodes.get(childNodes.size() - 1)).getUUID().equals(uuid)) {
+ || !((NodeState.ChildNodeEntry) childNodes.get(childNodes.size() - 1))
+ .getUUID().equals(uuid)) {
hits.flip(i);
}
} else {
@@ -369,7 +370,8 @@
QName name = ((NodeState.ChildNodeEntry) childNodes.get(0)).getName();
childNodes = state.getChildNodeEntries(name);
if (childNodes.size() == 0
- || !((NodeState.ChildNodeEntry) childNodes.get(childNodes.size() - 1)).getUUID().equals(uuid)) {
+ || !((NodeState.ChildNodeEntry) childNodes.get(childNodes.size() - 1))
+ .getUUID().equals(uuid)) {
hits.flip(i);
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MatchAllQuery.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MatchAllQuery.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MatchAllQuery.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MatchAllQuery.java Mon Apr 25 03:08:35 2005
@@ -35,7 +35,7 @@
* @param field the field name.
* @throws NullPointerException if <code>field</code> is null.
*/
- MatchAllQuery(String field) {
+ MatchAllQuery(String field) throws NullPointerException {
if (field == null) {
throw new NullPointerException("field");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java Mon Apr 25 03:08:35 2005
@@ -28,7 +28,6 @@
import org.apache.lucene.document.Document;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.MultiReader;
import org.apache.log4j.Logger;
import javax.jcr.RepositoryException;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIteratorImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIteratorImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIteratorImpl.java Mon Apr 25 03:08:35 2005
@@ -65,30 +65,30 @@
/**
* Returns the next <code>Node</code> in the result set.
* @return the next <code>Node</code> in the result set.
- * @throws java.util.NoSuchElementException if iteration has no more
+ * @throws NoSuchElementException if iteration has no more
* <code>Node</code>s.
*/
- public Node nextNode() {
+ public Node nextNode() throws NoSuchElementException {
return nextNodeImpl();
}
/**
* Returns the next <code>Node</code> in the result set.
* @return the next <code>Node</code> in the result set.
- * @throws java.util.NoSuchElementException if iteration has no more
+ * @throws NoSuchElementException if iteration has no more
* <code>Node</code>s.
*/
- public Object next() {
+ public Object next() throws NoSuchElementException {
return nextNode();
}
/**
* Skip a number of <code>Node</code>s in this iterator.
* @param skipNum the non-negative number of <code>Node</code>s to skip
- * @throws java.util.NoSuchElementException
+ * @throws NoSuchElementException
* if skipped past the last <code>Node</code> in this iterator.
*/
- public void skip(long skipNum) {
+ public void skip(long skipNum) throws NoSuchElementException {
if (skipNum < 0) {
throw new IllegalArgumentException("skipNum must not be negative");
}
@@ -139,7 +139,7 @@
* @return the score of the node returned by {@link #nextNode()}.
* @throws NoSuchElementException if there is no next node.
*/
- float getScore() {
+ float getScore() throws NoSuchElementException {
if (!hasNext()) {
throw new NoSuchElementException();
}
@@ -152,7 +152,7 @@
* @throws NoSuchElementException if iteration has no more
* <code>Node</code>s.
*/
- NodeImpl nextNodeImpl() {
+ NodeImpl nextNodeImpl() throws NoSuchElementException {
if (pos >= uuids.length) {
throw new NoSuchElementException();
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java Mon Apr 25 03:08:35 2005
@@ -35,6 +35,7 @@
import javax.jcr.StringValue;
import javax.jcr.Property;
import java.util.Arrays;
+import java.util.NoSuchElementException;
import java.util.Set;
import java.util.HashSet;
@@ -72,10 +73,10 @@
* Returns the next <code>Row</code> in the iteration.
*
* @return the next <code>Row</code> in the iteration.
- * @throws java.util.NoSuchElementException if iteration has no more
- * <code>Row</code>s.
+ * @throws NoSuchElementException if iteration has no more
+ * <code>Row</code>s.
*/
- public Row nextRow() {
+ public Row nextRow() throws NoSuchElementException {
return new RowImpl(nodes.getScore(), nodes.nextNodeImpl());
}
@@ -83,10 +84,10 @@
* Skip a number of <code>Row</code>s in this iterator.
*
* @param skipNum the non-negative number of <code>Row</code>s to skip
- * @throws java.util.NoSuchElementException
- * if skipped past the last <code>Row</code> in this iterator.
+ * @throws NoSuchElementException if skipped past the last
+ * <code>Row</code> in this iterator.
*/
- public void skip(long skipNum) {
+ public void skip(long skipNum) throws NoSuchElementException {
nodes.skip(skipNum);
}
@@ -134,10 +135,9 @@
* Returns the next <code>Row</code> in the iteration.
*
* @return the next <code>Row</code> in the iteration.
- * @throws java.util.NoSuchElementException if iteration has no more
- * <code>Row</code>s.
+ * @throws NoSuchElementException if iteration has no more <code>Row</code>s.
*/
- public Object next() {
+ public Object next() throws NoSuchElementException {
return nextRow();
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java Mon Apr 25 03:08:35 2005
@@ -36,7 +36,7 @@
/**
* Default value for {@link #bufferSize}.
*/
- private final int DEFAULT_BUFFER_SIZE = 10;
+ private static final int DEFAULT_BUFFER_SIZE = 10;
/** The redo log */
private final RedoLog redoLog;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/UserPrincipal.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/UserPrincipal.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/UserPrincipal.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/security/UserPrincipal.java Mon Apr 25 03:08:35 2005
@@ -32,7 +32,7 @@
* @param name the name of this principal
* @throws IllegalArgumentException if <code>name</code> is <code>null</code>.
*/
- public UserPrincipal(String name) {
+ public UserPrincipal(String name) throws IllegalArgumentException {
if (name == null) {
throw new IllegalArgumentException("name can not be null");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/ItemState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/ItemState.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/ItemState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/ItemState.java Mon Apr 25 03:08:35 2005
@@ -362,10 +362,11 @@
case STATUS_UNDEFINED:
status = newStatus;
return;
+ default:
+ String msg = "illegal status: " + newStatus;
+ log.debug(msg);
+ throw new IllegalArgumentException(msg);
}
- String msg = "illegal status: " + newStatus;
- log.debug(msg);
- throw new IllegalArgumentException(msg);
}
/**
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeReferencesId.java Mon Apr 25 03:08:35 2005
@@ -44,7 +44,7 @@
* as a <code>NodeReferencesId</code>.
* @see #toString()
*/
- public static NodeId valueOf(String s) {
+ public static NodeId valueOf(String s) throws IllegalArgumentException {
if (s == null) {
throw new IllegalArgumentException("invalid NodeReferencesId literal");
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java Mon Apr 25 03:08:35 2005
@@ -447,9 +447,8 @@
* appending a random integer in order to
* avoid potential conflicts
*/
- Path dummy = Path.create(p0,
- Path.create(new QName(Constants.NS_DEFAULT_URI, Integer.toString(new Random().nextInt())), 0),
- true);
+ QName dummyName = new QName(Constants.NS_DEFAULT_URI, Integer.toString(new Random().nextInt()));
+ Path dummy = Path.create(p0, Path.create(dummyName, 0), true);
descendants.put(dummy, state);
isDescendant = true;
break;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/TransientItemStateManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/TransientItemStateManager.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/TransientItemStateManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/TransientItemStateManager.java Mon Apr 25 03:08:35 2005
@@ -97,7 +97,7 @@
public boolean hasNodeReferences(NodeReferencesId id) {
return false;
}
-
+
//------------------< methods for listing & querying state of cache/attic >
/**
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -126,7 +126,7 @@
int pLen = pattern.length();
int sLen = s.length();
- for (; ;) {
+ while (true) {
if (pOff >= pLen) {
if (sOff >= sLen) {
return true;
@@ -152,7 +152,7 @@
return true;
}
- for (; ;) {
+ while (true) {
if (internalMatches(s, pattern, sOff, pOff)) {
return true;
}
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -34,6 +34,9 @@
*/
public class ISO9075 {
+ /** Hidden constructor. */
+ private ISO9075() { }
+
/** Pattern on an encoded character */
private static final Pattern ENCODE_PATTERN = Pattern.compile("_x\\p{XDigit}{4}_");
@@ -166,7 +169,8 @@
* @param location the location to look at.
* @throws ArrayIndexOutOfBoundsException if location > name.length()
*/
- private static boolean needsEscaping(String name, int location) {
+ private static boolean needsEscaping(String name, int location)
+ throws ArrayIndexOutOfBoundsException {
if (name.charAt(location) == '_' && name.length() >= location + 6) {
return name.charAt(location + 1) == 'x'
&& HEX_DIGITS.indexOf(name.charAt(location + 2)) != -1
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -26,6 +26,9 @@
*/
public class Text {
+ /** Hidden constructor. */
+ private Text() { }
+
/**
* used for the md5
*/
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -506,7 +506,7 @@
*/
public static Value deserialize(String value, int type,
boolean decodeBlanks)
- throws RepositoryException {
+ throws ValueFormatException, RepositoryException {
if (type == PropertyType.BINARY) {
// base64 encoded binary value;
// the encodeBlanks flag can be ignored since base64-encoded
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/uuid/Bytes.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/uuid/Bytes.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/uuid/Bytes.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/util/uuid/Bytes.java Mon Apr 25 03:08:35 2005
@@ -141,8 +141,11 @@
if (rhs == null) {
return +1;
}
- if (lhs.length != rhs.length) {
- return ((lhs.length < rhs.length) ? -1 : +1);
+ if (lhs.length < rhs.length) {
+ return -1;
+ }
+ if (lhs.length > rhs.length) {
+ return +1;
}
for (int i = 0; i < lhs.length; i++) {
if (lhs[i] < rhs[i]) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?rev=164552&r1=164551&r2=164552&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java Mon Apr 25 03:08:35 2005
@@ -89,9 +89,12 @@
this.vMgr = vMgr;
this.parentId = parentId;
NDEF_VERSION = ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_ROOTVERSION, NT_VERSION).getId();
- NDEF_VERSION_HISTORY = ntReg.getEffectiveNodeType(REP_VERSIONSTORAGE).getApplicableChildNodeDef(JCR_ROOTVERSION, NT_VERSIONHISTORY).getId();
- NDEF_VERSION_HISTORY_ROOT = ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_VERSIONSTORAGE, REP_VERSIONSTORAGE).getId();
- NDEF_VERSION_LABELS = ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_VERSIONLABELS, NT_VERSIONLABELS).getId();
+ NDEF_VERSION_HISTORY =
+ ntReg.getEffectiveNodeType(REP_VERSIONSTORAGE).getApplicableChildNodeDef(JCR_ROOTVERSION, NT_VERSIONHISTORY).getId();
+ NDEF_VERSION_HISTORY_ROOT =
+ ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_VERSIONSTORAGE, REP_VERSIONSTORAGE).getId();
+ NDEF_VERSION_LABELS =
+ ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_VERSIONLABELS, NT_VERSIONLABELS).getId();
}
/**
@@ -210,8 +213,7 @@
state = createNodeState(parent,
JCR_FROZENNODE,
id.getUUID(),
- mimicFrozen ? fn.getFrozenPrimaryType() :
- NT_FROZENNODE);
+ mimicFrozen ? fn.getFrozenPrimaryType() : NT_FROZENNODE);
mapFrozenNode(state, fn, mimicFrozen);
} else if (vi instanceof InternalFrozenVersionHistory) {
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=164552&r1=164551&r2=164552&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 Mon Apr 25 03:08:35 2005
@@ -269,7 +269,7 @@
* @throws RepositoryException if any other error occurs.
*/
public void removeVersion(VersionHistory history, QName name)
- throws RepositoryException {
+ throws VersionException, RepositoryException {
if (!((VersionHistoryImpl) history).hasNode(name)) {
throw new VersionException("Version with name " + name.toString()
+ " does not exist in this VersionHistory");