You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2004/09/23 14:36:09 UTC
svn commit: rev 47099 - in incubator/jackrabbit/trunk: . src/java/org/apache/jackrabbit/jcr/core src/java/org/apache/jackrabbit/jcr/core/nodetype src/java/org/apache/jackrabbit/jcr/core/observation src/java/org/apache/jackrabbit/jcr/core/state src/java/org/apache/jackrabbit/jcr/core/state/xml src/java/org/apache/jackrabbit/jcr/core/version src/java/org/apache/jackrabbit/jcr/core/xml src/java/org/apache/jackrabbit/jcr/fs src/java/org/apache/jackrabbit/jcr/fs/local src/java/org/apache/jackrabbit/jcr/util src/java/org/apache/jackrabbit/jcr/util/uuid target
Author: stefan
Date: Thu Sep 23 05:36:08 2004
New Revision: 47099
Modified:
incubator/jackrabbit/trunk/checkstyle.xml
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AbstractAccessManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AccessManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/BLOBFileValue.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/IllegalNameException.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/ItemImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/NodeImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Path.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/PropertyImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/QName.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryFactory.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/SessionImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Test.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/UnknownPrefixException.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/WorkspaceImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildItemDef.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildNodeDef.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/EffectiveNodeType.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeManagerImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeRegistry.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/PropDef.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventStateCollection.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/ObservationManagerFactory.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemStateProvider.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/NodeState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentNodeState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentPropertyState.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/xml/XMLPersistenceManager.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/GenericVersionSelector.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/VersionImpl.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/AbstractSAXEventGenerator.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/DocViewImportHandler.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/ImportHandler.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewImportHandler.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewSAXEventGenerator.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystem.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemPathUtil.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemResource.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/local/LocalFileSystem.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/Base64.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/ValueHelper.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/Bytes.java
incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/VersionFourGenerator.java
incubator/jackrabbit/trunk/target/ (props changed)
Log:
following some of the recommendations reported by "maven checkstyle"
Modified: incubator/jackrabbit/trunk/checkstyle.xml
==============================================================================
--- incubator/jackrabbit/trunk/checkstyle.xml (original)
+++ incubator/jackrabbit/trunk/checkstyle.xml Thu Sep 23 05:36:08 2004
@@ -44,11 +44,11 @@
<!-- ************************************************************** -->
<!-- Checks that are different from the sun coding conventions ones -->
<!-- ************************************************************** -->
+
<module name="Header">
<property name="headerFile" value="${basedir}/HEADER.txt"/>
- <property name="ignoreLines" value="2"/>
</module>
- <property name="tabWidth" value="4"/>
+ <!-- <property name="tabWidth" value="4"/> -->
<module name="LeftCurly">
<property name="option" value="eol"/>
</module>
@@ -62,7 +62,7 @@
<module name="ConstantName">
<property name="format" value="log|^[a-zA-Z][a-zA-Z0-9_]*$"/>
</module>
-
+
<!-- ************************************************************** -->
<!-- Default Sun coding conventions checks -->
<!-- ************************************************************** -->
@@ -73,7 +73,6 @@
<module name="JavadocType"/>
<module name="JavadocVariable"/>
-
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="LocalFinalVariableName"/>
@@ -105,7 +104,7 @@
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
- <module name="TabCharacter"/>
+ <!-- <module name="TabCharacter"/> -->
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AbstractAccessManager.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AbstractAccessManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AbstractAccessManager.java Thu Sep 23 05:36:08 2004
@@ -43,7 +43,7 @@
/**
* @see AccessManager#getPermissions(String)
*/
- abstract public long getPermissions(String absPath)
+ public abstract long getPermissions(String absPath)
throws PathNotFoundException, RepositoryException;
/**
@@ -62,7 +62,7 @@
}
//--------------------------------------------------------< inner classes >
- final static class PermissionImpl implements Permission {
+ static final class PermissionImpl implements Permission {
private final String name;
private final long value;
@@ -77,8 +77,8 @@
new PermissionImpl("read item", Permission.READ_ITEM);
static final long ALL_VALUES =
- ADD_NODE_PERMISSION.getValue() | SET_PROPERTY_PERMISSION.getValue() |
- READ_ITEM_PERMISSION.getValue() | REMOVE_ITEM_PERMISSION.getValue();
+ ADD_NODE_PERMISSION.getValue() | SET_PROPERTY_PERMISSION.getValue()
+ | READ_ITEM_PERMISSION.getValue() | REMOVE_ITEM_PERMISSION.getValue();
static final Permission[] ALL_PERMISSIONS =
new Permission[]{ADD_NODE_PERMISSION, SET_PROPERTY_PERMISSION,
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AccessManagerImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AccessManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/AccessManagerImpl.java Thu Sep 23 05:36:08 2004
@@ -38,6 +38,10 @@
/**
* Package private constructor
+ *
+ * @param credentials
+ * @param hierMgr
+ * @param nsReg
*/
AccessManagerImpl(Credentials credentials, HierarchyManager hierMgr, NamespaceResolver nsReg) {
this.hierMgr = hierMgr;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/BLOBFileValue.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/BLOBFileValue.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/BLOBFileValue.java Thu Sep 23 05:36:08 2004
@@ -130,8 +130,8 @@
}
if (obj instanceof BLOBFileValue) {
BLOBFileValue other = (BLOBFileValue) obj;
- return ((file == null ? other.file == null : file.equals(other.file)) &&
- (fsResource == null ? other.fsResource == null : fsResource.equals(other.fsResource)));
+ return ((file == null ? other.file == null : file.equals(other.file))
+ && (fsResource == null ? other.fsResource == null : fsResource.equals(other.fsResource)));
}
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/IllegalNameException.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/IllegalNameException.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/IllegalNameException.java Thu Sep 23 05:36:08 2004
@@ -61,4 +61,4 @@
public IllegalNameException(Throwable rootCause) {
super(rootCause);
}
-}
\ No newline at end of file
+}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/ItemImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/ItemImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/ItemImpl.java Thu Sep 23 05:36:08 2004
@@ -64,7 +64,7 @@
// jcr:lastModified
public static final QName PROPNAME_LAST_MODIFIED =
new QName(NamespaceRegistryImpl.NS_JCR_URI, "lastModified");
- // jcr:mergeFailed
+ // jcr:mergeFailed
public static final QName PROPNAME_MERGE_FAILED =
new QName(NamespaceRegistryImpl.NS_JCR_URI, "mergeFailed");
@@ -160,9 +160,9 @@
return state.isTransient();
}
- abstract protected ItemState getOrCreateTransientItemState() throws RepositoryException;
+ protected abstract ItemState getOrCreateTransientItemState() throws RepositoryException;
- abstract protected void makePersistent() throws RepositoryException;
+ protected abstract void makePersistent() throws RepositoryException;
/**
* Marks this instance as 'removed' and notifies its listeners.
@@ -364,8 +364,8 @@
NodeType[] nta = def.getRequiredPrimaryTypes();
for (int i = 0; i < nta.length; i++) {
NodeTypeImpl ntReq = (NodeTypeImpl) nta[i];
- if (nodeState.getStatus() == ItemState.STATUS_NEW &&
- !(nt.getQName().equals(ntReq.getQName())
+ if (nodeState.getStatus() == ItemState.STATUS_NEW
+ && !(nt.getQName().equals(ntReq.getQName())
|| nt.isDerivedFrom(ntReq.getQName()))) {
// the transient node's node type does not satisfy the
// 'required primary types' constraint
@@ -464,7 +464,7 @@
}
}
}
-
+
private void checkReferences(Iterator iterDirty, Iterator iterRemoved,
ReferenceManager refMgr)
throws ConstraintViolationException, RepositoryException {
@@ -506,7 +506,8 @@
NodeId targetId = new NodeId(uuid);
// verify that target exists
if (!itemMgr.itemExists(targetId)) {
- String msg = itemMgr.safeGetJCRPath(propState.getId()) + ": target node of REFERENCE property does not exist";
+ String msg = itemMgr.safeGetJCRPath(propState.getId())
+ + ": target node of REFERENCE property does not exist";
log.warn(msg);
throw new ConstraintViolationException(msg);
}
@@ -517,13 +518,15 @@
if (target.isNew()) {
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.";
+ 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.";
log.warn(msg);
throw new ConstraintViolationException(msg);
}
} catch (MalformedPathException mpe) {
// should never get here...
- String msg = itemMgr.safeGetJCRPath(propState.getId()) + ": failed to verify existence of target node";
+ String msg = itemMgr.safeGetJCRPath(propState.getId())
+ + ": failed to verify existence of target node";
log.error(msg, mpe);
throw new RepositoryException(msg, mpe);
}
@@ -590,7 +593,8 @@
refs = refMgr.get(targetId);
}
if (refs.hasReferences()) {
- String msg = nodeState.getId() + ": the node cannot be removed because it is being referenced.";
+ String msg = nodeState.getId()
+ + ": the node cannot be removed because it is being referenced.";
log.warn(msg);
throw new ConstraintViolationException(msg);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/NodeImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/NodeImpl.java Thu Sep 23 05:36:08 2004
@@ -498,8 +498,8 @@
} else {
// there's already a node with that name
// check same-name sibling setting of both new and existing node
- if (!def.allowSameNameSibs() ||
- !((NodeImpl) item).getDefinition().allowSameNameSibs()) {
+ if (!def.allowSameNameSibs()
+ || !((NodeImpl) item).getDefinition().allowSameNameSibs()) {
throw new ItemExistsException(item.safeGetJCRPath());
}
}
@@ -862,7 +862,7 @@
/**
* @see Node#addNode(String)
*/
- synchronized public NodeImpl addNode(QName nodeName)
+ public synchronized NodeImpl addNode(QName nodeName)
throws ItemExistsException, ConstraintViolationException,
RepositoryException {
// check state of this instance
@@ -874,7 +874,7 @@
/**
* @see Node#addNode(String, String)
*/
- synchronized public NodeImpl addNode(QName nodeName, QName nodeTypeName)
+ public synchronized NodeImpl addNode(QName nodeName, QName nodeTypeName)
throws ItemExistsException, NoSuchNodeTypeException,
ConstraintViolationException, RepositoryException {
// check state of this instance
@@ -1043,7 +1043,7 @@
/**
* @see Node#remove(String)
*/
- synchronized public void remove(String relPath)
+ public synchronized void remove(String relPath)
throws PathNotFoundException, RepositoryException {
// check state of this instance
checkItemState();
@@ -1129,7 +1129,7 @@
/**
* @see Node#addNode(String)
*/
- synchronized public Node addNode(String relPath)
+ public synchronized Node addNode(String relPath)
throws ItemExistsException, PathNotFoundException,
ConstraintViolationException, RepositoryException {
// check state of this instance
@@ -1141,7 +1141,7 @@
/**
* @see Node#addNode(String, String)
*/
- synchronized public Node addNode(String relPath, String nodeTypeName)
+ public synchronized Node addNode(String relPath, String nodeTypeName)
throws ItemExistsException, PathNotFoundException,
NoSuchNodeTypeException, ConstraintViolationException,
RepositoryException {
@@ -1224,16 +1224,16 @@
for (int i = 0; i < list.size(); i++) {
NodeState.ChildNodeEntry entry = (NodeState.ChildNodeEntry) list.get(i);
if (srcInd == -1) {
- if (entry.getName().equals(insertName.getName()) &&
- (entry.getIndex() == insertName.getIndex() ||
- insertName.getIndex() == 0 && entry.getIndex() == 1)) {
+ if (entry.getName().equals(insertName.getName())
+ && (entry.getIndex() == insertName.getIndex()
+ || insertName.getIndex() == 0 && entry.getIndex() == 1)) {
srcInd = i;
}
}
if (destInd == -1 && beforeName != null) {
- if (entry.getName().equals(beforeName.getName()) &&
- (entry.getIndex() == beforeName.getIndex() ||
- beforeName.getIndex() == 0 && entry.getIndex() == 1)) {
+ if (entry.getName().equals(beforeName.getName())
+ && (entry.getIndex() == beforeName.getIndex()
+ || beforeName.getIndex() == 0 && entry.getIndex() == 1)) {
destInd = i;
if (srcInd != -1) {
break;
@@ -1830,8 +1830,8 @@
NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
// shortcut
- if (mixin.getChildNodeDefs().length == 0 &&
- mixin.getPropertyDefs().length == 0) {
+ if (mixin.getChildNodeDefs().length == 0
+ && mixin.getPropertyDefs().length == 0) {
// the node type has neither property nor child node definitions,
// i.e. we're done
return;
@@ -2534,7 +2534,9 @@
* @throws RepositoryException if another error occurs.
*/
private NodeImpl addNode(String relPath, FrozenNode frozen)
- throws RepositoryException {
+ throws ItemExistsException, PathNotFoundException,
+ ConstraintViolationException, NoSuchNodeTypeException,
+ RepositoryException {
// get frozen node type
NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();
@@ -2930,7 +2932,7 @@
int pLen = pattern.length();
int sLen = s.length();
- for (; ;) {
+ for (;;) {
if (pOff >= pLen) {
if (sOff >= sLen) {
return true;
@@ -2956,7 +2958,7 @@
return true;
}
- for (; ;) {
+ for (;;) {
if (internalMatches(s, pattern, sOff, pOff)) {
return true;
}
@@ -2976,4 +2978,4 @@
sOff++;
}
}
-}
\ No newline at end of file
+}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Path.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Path.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Path.java Thu Sep 23 05:36:08 2004
@@ -232,8 +232,8 @@
}
// check path for "." and ".." names
for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(CURRENT_ELEMENT) ||
- elements[i].equals(PARENT_ELEMENT)) {
+ if (elements[i].equals(CURRENT_ELEMENT)
+ || elements[i].equals(PARENT_ELEMENT)) {
return false;
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/PropertyImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/PropertyImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/PropertyImpl.java Thu Sep 23 05:36:08 2004
@@ -859,7 +859,7 @@
/**
* @see Property#setValue(Value)
*/
- synchronized public void setValue(Value value) throws ValueFormatException, RepositoryException {
+ public synchronized void setValue(Value value) throws ValueFormatException, RepositoryException {
// check state of this instance
checkItemState();
@@ -937,8 +937,8 @@
// use the value's type as property type
reqType = value.getType();
}
- if (reqType != PropertyType.UNDEFINED &&
- reqType != value.getType()) {
+ if (reqType != PropertyType.UNDEFINED
+ && reqType != value.getType()) {
// type conversion required
internalValue = InternalValue.create(value, reqType, session.getNamespaceResolver());
} else {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/QName.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/QName.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/QName.java Thu Sep 23 05:36:08 2004
@@ -41,8 +41,8 @@
*/
private static final Pattern NAME_PATTERN = Pattern.compile("(([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?):)?([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?)");
- transient private int hash;
- transient private String string;
+ private transient int hash;
+ private transient String string;
protected final String namespaceURI;
protected final String localName;
@@ -231,8 +231,8 @@
}
if (obj instanceof QName) {
QName other = (QName) obj;
- return namespaceURI.equals(other.namespaceURI) &&
- localName.equals(other.localName);
+ return namespaceURI.equals(other.namespaceURI)
+ && localName.equals(other.localName);
}
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryFactory.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryFactory.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryFactory.java Thu Sep 23 05:36:08 2004
@@ -449,4 +449,4 @@
}
reps.clear();
}
-}
\ No newline at end of file
+}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/RepositoryImpl.java Thu Sep 23 05:36:08 2004
@@ -73,7 +73,7 @@
private static final String REP_VERSION = "0.1";
// system root location
- public static QName SYSTEM_ROOT_NAME = new QName(NamespaceRegistryImpl.NS_JCR_URI, "system");
+ public static final QName SYSTEM_ROOT_NAME = new QName(NamespaceRegistryImpl.NS_JCR_URI, "system");
private String rootNodeUUID;
@@ -289,8 +289,8 @@
while (iter.hasNext()) {
Session s = getSystemSession(((WorkspaceDef) iter.next()).getName());
s.getWorkspace().getObservationManager().addEventListener(this,
- EventType.CHILD_NODE_ADDED | EventType.CHILD_NODE_REMOVED |
- EventType.PROPERTY_ADDED | EventType.PROPERTY_REMOVED,
+ EventType.CHILD_NODE_ADDED | EventType.CHILD_NODE_REMOVED
+ | EventType.PROPERTY_ADDED | EventType.PROPERTY_REMOVED,
"/", true, null, null, false);
}
}
@@ -558,7 +558,7 @@
/**
* @see EventListener#onEvent(EventIterator)
*/
- synchronized public void onEvent(EventIterator events) {
+ public synchronized void onEvent(EventIterator events) {
while (events.hasNext()) {
Event event = events.nextEvent();
long type = event.getType();
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/SessionImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/SessionImpl.java Thu Sep 23 05:36:08 2004
@@ -403,8 +403,8 @@
} else {
// there's already a node with that name
// check same-name sibling setting of both new and existing node
- if (!destParentNode.getDefinition().allowSameNameSibs() ||
- !((NodeImpl) item).getDefinition().allowSameNameSibs()) {
+ if (!destParentNode.getDefinition().allowSameNameSibs()
+ || !((NodeImpl) item).getDefinition().allowSameNameSibs()) {
throw new ItemExistsException(item.safeGetJCRPath());
}
}
@@ -632,8 +632,8 @@
if (prefix == null || uri == null) {
throw new IllegalArgumentException("prefix/uri can not be null");
}
- if (NamespaceRegistryImpl.NS_EMPTY_PREFIX.equals(prefix) ||
- NamespaceRegistryImpl.NS_DEFAULT_URI.equals(uri)) {
+ if (NamespaceRegistryImpl.NS_EMPTY_PREFIX.equals(prefix)
+ || NamespaceRegistryImpl.NS_DEFAULT_URI.equals(uri)) {
throw new NamespaceException("default namespace is reserved and can not be changed");
}
// check if namespace exists (the following call will
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Test.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Test.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/Test.java Thu Sep 23 05:36:08 2004
@@ -101,7 +101,7 @@
root.addMixin("mix:accessControllable");
}
dumpTree(root, System.out);
- boolean accessControlable = root.isNodeType("mix:accessControllable");
+ boolean accessControllable = root.isNodeType("mix:accessControllable");
root.removeMixin("mix:versionable");
dumpTree(root, System.out);
root.save();
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/UnknownPrefixException.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/UnknownPrefixException.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/UnknownPrefixException.java Thu Sep 23 05:36:08 2004
@@ -15,8 +15,6 @@
*/
package org.apache.jackrabbit.jcr.core;
-import javax.jcr.RepositoryException;
-
/**
* The <code>UnknownPrefixException</code> ...
*
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/WorkspaceImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/WorkspaceImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/WorkspaceImpl.java Thu Sep 23 05:36:08 2004
@@ -314,8 +314,8 @@
}
ChildNodeDef conflictingTargetDef = ntReg.getNodeDef(conflictingState.getDefinitionId());
// check same-name sibling setting of both target and existing node
- if (!conflictingTargetDef.allowSameNameSibs() ||
- !newNodeDef.allowSameNameSibs()) {
+ if (!conflictingTargetDef.allowSameNameSibs()
+ || !newNodeDef.allowSameNameSibs()) {
throw new ItemExistsException(hierMgr.safeGetJCRPath(nodePath));
}
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildItemDef.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildItemDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildItemDef.java Thu Sep 23 05:36:08 2004
@@ -48,13 +48,13 @@
}
if (obj instanceof ChildItemDef) {
ChildItemDef other = (ChildItemDef) obj;
- return (declaringNodeType == null ? other.declaringNodeType == null : declaringNodeType.equals(other.declaringNodeType)) &&
- (name == null ? other.name == null : name.equals(other.name)) &&
- autoCreate == other.autoCreate &&
- onParentVersion == other.onParentVersion &&
- writeProtected == other.writeProtected &&
- mandatory == other.mandatory &&
- primaryItem == other.primaryItem;
+ return (declaringNodeType == null ? other.declaringNodeType == null : declaringNodeType.equals(other.declaringNodeType))
+ && (name == null ? other.name == null : name.equals(other.name))
+ && autoCreate == other.autoCreate
+ && onParentVersion == other.onParentVersion
+ && writeProtected == other.writeProtected
+ && mandatory == other.mandatory
+ && primaryItem == other.primaryItem;
}
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildNodeDef.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildNodeDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/ChildNodeDef.java Thu Sep 23 05:36:08 2004
@@ -43,10 +43,10 @@
}
if (obj instanceof ChildNodeDef) {
ChildNodeDef other = (ChildNodeDef) obj;
- return super.equals(obj) &&
- Arrays.equals(requiredPrimaryTypes, requiredPrimaryTypes) &&
- (defaultPrimaryType == null ? other.defaultPrimaryType == null : defaultPrimaryType.equals(other.defaultPrimaryType)) &&
- allowSameNameSibs == other.allowSameNameSibs;
+ return super.equals(obj)
+ && Arrays.equals(requiredPrimaryTypes, requiredPrimaryTypes)
+ && (defaultPrimaryType == null ? other.defaultPrimaryType == null : defaultPrimaryType.equals(other.defaultPrimaryType))
+ && allowSameNameSibs == other.allowSameNameSibs;
}
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/EffectiveNodeType.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/EffectiveNodeType.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/EffectiveNodeType.java Thu Sep 23 05:36:08 2004
@@ -471,9 +471,9 @@
PropDef pd = pda[i];
int reqType = pd.getRequiredType();
// match type
- if (reqType == PropertyType.UNDEFINED ||
- type == PropertyType.UNDEFINED ||
- reqType == type) {
+ if (reqType == PropertyType.UNDEFINED
+ || type == PropertyType.UNDEFINED
+ || reqType == type) {
// match multiValued flag
if (multiValued == pd.isMultiple()) {
// found match
@@ -487,9 +487,9 @@
int reqType = pd.getRequiredType();
// property definition with that name exists
// match type
- if (reqType == PropertyType.UNDEFINED ||
- type == PropertyType.UNDEFINED ||
- reqType == type) {
+ if (reqType == PropertyType.UNDEFINED
+ || type == PropertyType.UNDEFINED
+ || reqType == type) {
// match multiValued flag
if (multiValued == pd.isMultiple()) {
// found match
@@ -576,7 +576,7 @@
* the merge is the result of an explicit aggregation
* @throws NodeTypeConflictException
*/
- synchronized private void internalMerge(EffectiveNodeType other, boolean supertype)
+ private synchronized void internalMerge(EffectiveNodeType other, boolean supertype)
throws NodeTypeConflictException {
QName[] nta = other.getAllNodeTypes();
int includedCount = 0;
@@ -629,8 +629,8 @@
PropDef pd = (PropDef) def;
PropDef epd = (PropDef) existing;
// compare type & multiValued flag
- if (pd.getRequiredType() == epd.getRequiredType() &&
- pd.isMultiple() == epd.isMultiple()) {
+ if (pd.getRequiredType() == epd.getRequiredType()
+ && pd.isMultiple() == epd.isMultiple()) {
// conflict
String msg = "A property definition in node type '" + def.getDeclaringNodeType() + "' conflicts with node type '" + existing.getDeclaringNodeType() + "': ambiguos residual property definition";
log.error(msg);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeImpl.java Thu Sep 23 05:36:08 2004
@@ -408,7 +408,7 @@
/**
* @see NodeType#canSetProperty(String, Value[])
*/
- public boolean canSetProperty(String propertyName, Value values[]) {
+ public boolean canSetProperty(String propertyName, Value[] values) {
if (values == null) {
// setting a property to null is equivalent of removing it
return canRemoveItem(propertyName);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeManagerImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeManagerImpl.java Thu Sep 23 05:36:08 2004
@@ -101,7 +101,7 @@
* @return
* @throws NoSuchNodeTypeException
*/
- synchronized public NodeTypeImpl getNodeType(QName name) throws NoSuchNodeTypeException {
+ public synchronized NodeTypeImpl getNodeType(QName name) throws NoSuchNodeTypeException {
NodeTypeImpl nt = (NodeTypeImpl) ntCache.get(name);
if (nt != null) {
return nt;
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeRegistry.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/NodeTypeRegistry.java Thu Sep 23 05:36:08 2004
@@ -256,7 +256,7 @@
* @throws RepositoryException
* @see #registerNodeType
*/
- synchronized private void internalRegister(Collection ntDefs)
+ private synchronized void internalRegister(Collection ntDefs)
throws InvalidNodeTypeDefException, RepositoryException {
ArrayList list = new ArrayList(ntDefs);
@@ -660,7 +660,7 @@
* @param ntName
* @return
*/
- synchronized public EffectiveNodeType getEffectiveNodeType(QName ntName)
+ public synchronized EffectiveNodeType getEffectiveNodeType(QName ntName)
throws NoSuchNodeTypeException {
WeightedKey key = new WeightedKey(new QName[]{ntName});
if (entCache.contains(key)) {
@@ -674,7 +674,7 @@
* @param ntNames
* @return
*/
- synchronized public EffectiveNodeType buildEffectiveNodeType(QName[] ntNames)
+ public synchronized EffectiveNodeType buildEffectiveNodeType(QName[] ntNames)
throws NodeTypeConflictException, NoSuchNodeTypeException {
// 1. make sure every single node type is registered
for (int i = 0; i < ntNames.length; i++) {
@@ -871,7 +871,7 @@
* @throws InvalidNodeTypeDefException
* @throws RepositoryException
*/
- synchronized public EffectiveNodeType registerNodeType(NodeTypeDef ntd)
+ public synchronized EffectiveNodeType registerNodeType(NodeTypeDef ntd)
throws InvalidNodeTypeDefException, RepositoryException {
// validate and register new node type definition
EffectiveNodeType ent = internalRegister(ntd);
@@ -900,7 +900,7 @@
* @throws NoSuchNodeTypeException
* @throws RepositoryException
*/
- synchronized public void unregisterNodeType(QName name)
+ public synchronized void unregisterNodeType(QName name)
throws NoSuchNodeTypeException, RepositoryException {
if (!registeredNTDefs.containsKey(name)) {
throw new NoSuchNodeTypeException(name.toString());
@@ -967,7 +967,7 @@
* @throws InvalidNodeTypeDefException
* @throws RepositoryException
*/
- synchronized public EffectiveNodeType reregisterNodeType(NodeTypeDef ntd)
+ public synchronized EffectiveNodeType reregisterNodeType(NodeTypeDef ntd)
throws NoSuchNodeTypeException, InvalidNodeTypeDefException,
RepositoryException {
QName name = ntd.getName();
@@ -1002,7 +1002,7 @@
* @return
* @throws NoSuchNodeTypeException
*/
- synchronized public NodeTypeDef getNodeTypeDef(QName nodeTypeName) throws NoSuchNodeTypeException {
+ public synchronized NodeTypeDef getNodeTypeDef(QName nodeTypeName) throws NoSuchNodeTypeException {
if (!registeredNTDefs.containsKey(nodeTypeName)) {
throw new NoSuchNodeTypeException(nodeTypeName.toString());
}
@@ -1021,7 +1021,7 @@
* @param nodeTypeName
* @return
*/
- synchronized public boolean isRegistered(QName nodeTypeName) {
+ public synchronized boolean isRegistered(QName nodeTypeName) {
return registeredNTDefs.containsKey(nodeTypeName);
}
@@ -1086,7 +1086,7 @@
}
ps.println("\tMixin\t" + ntd.isMixin());
ps.println("\tOrderableChildNodes\t" + ntd.hasOrderableChildNodes());
- PropDef pd[] = ntd.getPropertyDefs();
+ PropDef[] pd = ntd.getPropertyDefs();
for (int i = 0; i < pd.length; i++) {
ps.print("\tPropertyDef");
ps.println(" (declared in " + pd[i].getDeclaringNodeType() + ") id=" + new PropDefId(pd[i]));
@@ -1114,7 +1114,7 @@
ps.println("\t\tPrimaryItem\t" + pd[i].isPrimaryItem());
ps.println("\t\tMultiple\t" + pd[i].isMultiple());
}
- ChildNodeDef nd[] = ntd.getChildNodeDefs();
+ ChildNodeDef[] nd = ntd.getChildNodeDefs();
for (int i = 0; i < nd.length; i++) {
ps.print("\tNodeDef");
ps.println(" (declared in " + nd[i].getDeclaringNodeType() + ") id=" + new NodeDefId(nd[i]));
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/PropDef.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/PropDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/nodetype/PropDef.java Thu Sep 23 05:36:08 2004
@@ -45,11 +45,11 @@
}
if (obj instanceof PropDef) {
PropDef other = (PropDef) obj;
- return super.equals(obj) &&
- requiredType == other.requiredType &&
- (valueConstraint == null ? other.valueConstraint == null : valueConstraint.equals(other.valueConstraint)) &&
- Arrays.equals(defaultValues, other.defaultValues) &&
- multiple == other.multiple;
+ return super.equals(obj)
+ && requiredType == other.requiredType
+ && (valueConstraint == null ? other.valueConstraint == null : valueConstraint.equals(other.valueConstraint))
+ && Arrays.equals(defaultValues, other.defaultValues)
+ && multiple == other.multiple;
}
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventState.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventState.java Thu Sep 23 05:36:08 2004
@@ -89,9 +89,9 @@
* @param session the session that added the node.
* @return an <code>EventState</code> instance.
*/
- public static EventState ChildNodeAdded(String parentUUID,
- QName childName,
- Session session) {
+ public static EventState createChildNodeAdded(String parentUUID,
+ QName childName,
+ Session session) {
return new EventState(EventType.CHILD_NODE_ADDED,
parentUUID,
childName,
@@ -108,9 +108,9 @@
* @param session the session that removed the node.
* @return an <code>EventState</code> instance.
*/
- public static EventState ChildNodeRemoved(String parentUUID,
- QName childName,
- Session session) {
+ public static EventState createChildNodeRemoved(String parentUUID,
+ QName childName,
+ Session session) {
return new EventState(EventType.CHILD_NODE_REMOVED,
parentUUID,
childName,
@@ -127,9 +127,9 @@
* @param session the session that added the property.
* @return an <code>EventState</code> instance.
*/
- public static EventState PropertyAdded(String parentUUID,
- QName childName,
- Session session) {
+ public static EventState createPropertyAdded(String parentUUID,
+ QName childName,
+ Session session) {
return new EventState(EventType.PROPERTY_ADDED,
parentUUID,
childName,
@@ -146,9 +146,9 @@
* @param session the session that removed the property.
* @return an <code>EventState</code> instance.
*/
- public static EventState PropertyRemoved(String parentUUID,
- QName childName,
- Session session) {
+ public static EventState createPropertyRemoved(String parentUUID,
+ QName childName,
+ Session session) {
return new EventState(EventType.PROPERTY_REMOVED,
parentUUID,
childName,
@@ -165,9 +165,9 @@
* @param session the session that changed the property.
* @return an <code>EventState</code> instance.
*/
- public static EventState PropertyChanged(String parentUUID,
- QName childName,
- Session session) {
+ public static EventState createPropertyChanged(String parentUUID,
+ QName childName,
+ Session session) {
return new EventState(EventType.PROPERTY_CHANGED,
parentUUID,
childName,
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventStateCollection.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventStateCollection.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/EventStateCollection.java Thu Sep 23 05:36:08 2004
@@ -34,7 +34,7 @@
* @author mreutegg
* @version $Revision: 1.5 $
*/
-final public class EventStateCollection {
+public final class EventStateCollection {
/**
* Logger instance for this class
@@ -72,8 +72,8 @@
throws RepositoryException {
int status = state.getStatus();
- if (status == ItemState.STATUS_EXISTING_MODIFIED ||
- status == ItemState.STATUS_NEW) {
+ if (status == ItemState.STATUS_EXISTING_MODIFIED
+ || status == ItemState.STATUS_NEW) {
if (state.isNode()) {
@@ -82,7 +82,7 @@
List addedProperties = currentNode.getAddedPropertyEntries();
for (Iterator it = addedProperties.iterator(); it.hasNext();) {
NodeState.PropertyEntry prop = (NodeState.PropertyEntry) it.next();
- events.add(EventState.PropertyAdded(currentNode.getUUID(),
+ events.add(EventState.createPropertyAdded(currentNode.getUUID(),
prop.getName(),
session));
}
@@ -91,7 +91,7 @@
List removedProperties = currentNode.getRemovedPropertyEntries();
for (Iterator it = removedProperties.iterator(); it.hasNext();) {
NodeState.PropertyEntry prop = (NodeState.PropertyEntry) it.next();
- events.add(EventState.PropertyRemoved(currentNode.getUUID(),
+ events.add(EventState.createPropertyRemoved(currentNode.getUUID(),
prop.getName(),
session));
}
@@ -100,7 +100,7 @@
List addedNodes = currentNode.getAddedChildNodeEntries();
for (Iterator it = addedNodes.iterator(); it.hasNext();) {
NodeState.ChildNodeEntry child = (NodeState.ChildNodeEntry) it.next();
- events.add(EventState.ChildNodeAdded(currentNode.getUUID(),
+ events.add(EventState.createChildNodeAdded(currentNode.getUUID(),
child.getName(),
session));
}
@@ -109,14 +109,14 @@
List removedNodes = currentNode.getRemovedChildNodeEntries();
for (Iterator it = removedNodes.iterator(); it.hasNext();) {
NodeState.ChildNodeEntry child = (NodeState.ChildNodeEntry) it.next();
- events.add(EventState.ChildNodeRemoved(currentNode.getUUID(),
+ events.add(EventState.createChildNodeRemoved(currentNode.getUUID(),
child.getName(),
session));
}
} else {
// only add property changed event if property is existing
if (state.getStatus() == ItemState.STATUS_EXISTING_MODIFIED) {
- events.add(EventState.PropertyChanged(state.getParentUUID(),
+ events.add(EventState.createPropertyChanged(state.getParentUUID(),
((PropertyState) state).getName(),
session));
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/ObservationManagerFactory.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/ObservationManagerFactory.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/observation/ObservationManagerFactory.java Thu Sep 23 05:36:08 2004
@@ -43,7 +43,7 @@
*
* @author Marcel Reutegger
*/
-final public class ObservationManagerFactory implements EventDispatcher, Runnable {
+public final class ObservationManagerFactory implements EventDispatcher, Runnable {
/**
* Logger instance for this class
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemState.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemState.java Thu Sep 23 05:36:08 2004
@@ -31,7 +31,7 @@
* @author Stefan Guggisberg
* @version $Revision: 1.19 $, $Date: 2004/08/02 16:19:48 $
*/
-abstract public class ItemState implements ItemStateListener, Serializable {
+public abstract class ItemState implements ItemStateListener, Serializable {
static final long serialVersionUID = -6632715936921139872L;
@@ -83,10 +83,10 @@
/**
* Listeners (soft references)
*/
- transient protected final Map listeners = Collections.synchronizedMap(new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT));
+ protected final transient Map listeners = Collections.synchronizedMap(new ReferenceMap(ReferenceMap.SOFT, ReferenceMap.SOFT));
// the backing persistent item state (may be null)
- transient private ItemState overlayedState;
+ private transient ItemState overlayedState;
/**
* Protected constructor
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemStateProvider.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemStateProvider.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/ItemStateProvider.java Thu Sep 23 05:36:08 2004
@@ -17,8 +17,6 @@
import org.apache.jackrabbit.jcr.core.ItemId;
-import java.util.Iterator;
-
/**
* The <code>ItemStateProvider</code> interface...
*
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/NodeState.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/NodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/NodeState.java Thu Sep 23 05:36:08 2004
@@ -725,7 +725,7 @@
/**
* base class for <code>PropertyEntry</code> and <code>ChildNodeEntry</code>
*/
- private static abstract class ChildEntry implements Serializable {
+ private abstract static class ChildEntry implements Serializable {
protected QName name;
protected ChildEntry(QName name) {
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentNodeState.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentNodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentNodeState.java Thu Sep 23 05:36:08 2004
@@ -32,7 +32,7 @@
static final long serialVersionUID = -371249062564922125L;
- transient protected final PersistenceManager persistMgr;
+ protected final transient PersistenceManager persistMgr;
/**
* Package private constructor
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentPropertyState.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentPropertyState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/PersistentPropertyState.java Thu Sep 23 05:36:08 2004
@@ -32,7 +32,7 @@
static final long serialVersionUID = -8919019313955817383L;
- transient protected final PersistenceManager persistMgr;
+ protected final transient PersistenceManager persistMgr;
/**
* Package private constructor
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/xml/XMLPersistenceManager.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/xml/XMLPersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/state/xml/XMLPersistenceManager.java Thu Sep 23 05:36:08 2004
@@ -141,8 +141,8 @@
}
private String buildBlobFilePath(String parentUUID, QName propName, int i) {
- return buildNodeFolderPath(parentUUID) + "/" +
- FileSystemPathUtil.escapeName(propName.toString()) + "." + i + ".bin";
+ return buildNodeFolderPath(parentUUID) + "/"
+ + FileSystemPathUtil.escapeName(propName.toString()) + "." + i + ".bin";
}
private String buildNodeFilePath(String uuid) {
@@ -330,8 +330,8 @@
Enumeration names = props.propertyNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
- if (TYPE_ATTRIBUTE.equals(name) || COUNT_ATTRIBUTE.equals(name) ||
- DEFINITIONID_ATTRIBUTE.equals(name)) {
+ if (TYPE_ATTRIBUTE.equals(name) || COUNT_ATTRIBUTE.equals(name)
+ || DEFINITIONID_ATTRIBUTE.equals(name)) {
continue;
}
int i = Integer.parseInt(name);
@@ -595,17 +595,17 @@
}
writer.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");
- writer.write("<" + NODE_ELEMENT + " " +
- UUID_ATTRIBUTE + "=\"" + state.getUUID() + "\" " +
- PARENTUUID_ATTRIBUTE + "=\"" + (state.getParentUUID() == null ? "" : state.getParentUUID()) + "\" " +
- DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString() + "\" " +
- NODETYPE_ATTRIBUTE + "=\"" + state.getNodeTypeName() + "\">\n");
+ writer.write("<" + NODE_ELEMENT + " "
+ + UUID_ATTRIBUTE + "=\"" + state.getUUID() + "\" "
+ + PARENTUUID_ATTRIBUTE + "=\"" + (state.getParentUUID() == null ? "" : state.getParentUUID()) + "\" "
+ + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString() + "\" "
+ + NODETYPE_ATTRIBUTE + "=\"" + state.getNodeTypeName() + "\">\n");
// parents
writer.write("\t<" + PARENTS_ELEMENT + ">\n");
Iterator iter = state.getParentUUIDs().iterator();
while (iter.hasNext()) {
- writer.write("\t\t<" + PARENT_ELEMENT + " " +
- UUID_ATTRIBUTE + "=\"" + iter.next() + "\"/>\n");
+ writer.write("\t\t<" + PARENT_ELEMENT + " "
+ + UUID_ATTRIBUTE + "=\"" + iter.next() + "\"/>\n");
}
writer.write("\t</" + PARENTS_ELEMENT + ">\n");
@@ -613,8 +613,8 @@
writer.write("\t<" + MIXINTYPES_ELEMENT + ">\n");
iter = state.getMixinTypeNames().iterator();
while (iter.hasNext()) {
- writer.write("\t\t<" + MIXINTYPE_ELEMENT + " " +
- NAME_ATTRIBUTE + "=\"" + iter.next() + "\"/>\n");
+ writer.write("\t\t<" + MIXINTYPE_ELEMENT + " "
+ + NAME_ATTRIBUTE + "=\"" + iter.next() + "\"/>\n");
}
writer.write("\t</" + MIXINTYPES_ELEMENT + ">\n");
@@ -623,8 +623,8 @@
iter = state.getPropertyEntries().iterator();
while (iter.hasNext()) {
NodeState.PropertyEntry entry = (NodeState.PropertyEntry) iter.next();
- writer.write("\t\t<" + PROPERTY_ELEMENT + " " +
- NAME_ATTRIBUTE + "=\"" + entry.getName() + "\">\n");
+ writer.write("\t\t<" + PROPERTY_ELEMENT + " "
+ + NAME_ATTRIBUTE + "=\"" + entry.getName() + "\">\n");
// @todo serialize type, definition id and values
writer.write("\t\t</" + PROPERTY_ELEMENT + ">\n");
}
@@ -635,9 +635,9 @@
iter = state.getChildNodeEntries().iterator();
while (iter.hasNext()) {
NodeState.ChildNodeEntry entry = (NodeState.ChildNodeEntry) iter.next();
- writer.write("\t\t<" + NODE_ELEMENT + " " +
- NAME_ATTRIBUTE + "=\"" + entry.getName() + "\" " +
- UUID_ATTRIBUTE + "=\"" + entry.getUUID() + "\">\n");
+ writer.write("\t\t<" + NODE_ELEMENT + " "
+ + NAME_ATTRIBUTE + "=\"" + entry.getName() + "\" "
+ + UUID_ATTRIBUTE + "=\"" + entry.getUUID() + "\">\n");
writer.write("\t\t</" + NODE_ELEMENT + ">\n");
}
writer.write("\t</" + NODES_ELEMENT + ">\n");
@@ -854,8 +854,8 @@
nodeFile.delete();
// prune empty folders
String parentDir = FileSystemPathUtil.getParentDir(nodeFilePath);
- while (!parentDir.equals(FileSystem.SEPARATOR) &&
- !itemStateStore.hasChildren(parentDir)) {
+ while (!parentDir.equals(FileSystem.SEPARATOR)
+ && !itemStateStore.hasChildren(parentDir)) {
itemStateStore.deleteFolder(parentDir);
parentDir = FileSystemPathUtil.getParentDir(parentDir);
}
@@ -894,8 +894,8 @@
propFile.delete();
// prune empty folders
String parentDir = FileSystemPathUtil.getParentDir(propFilePath);
- while (!parentDir.equals(FileSystem.SEPARATOR) &&
- !itemStateStore.hasChildren(parentDir)) {
+ while (!parentDir.equals(FileSystem.SEPARATOR)
+ && !itemStateStore.hasChildren(parentDir)) {
itemStateStore.deleteFolder(parentDir);
parentDir = FileSystemPathUtil.getParentDir(parentDir);
}
@@ -1115,8 +1115,8 @@
refsFile.delete();
// prune empty folders
String parentDir = FileSystemPathUtil.getParentDir(refsFilePath);
- while (!parentDir.equals(FileSystem.SEPARATOR) &&
- !itemStateStore.hasChildren(parentDir)) {
+ while (!parentDir.equals(FileSystem.SEPARATOR)
+ && !itemStateStore.hasChildren(parentDir)) {
itemStateStore.deleteFolder(parentDir);
parentDir = FileSystemPathUtil.getParentDir(parentDir);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/GenericVersionSelector.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/GenericVersionSelector.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/GenericVersionSelector.java Thu Sep 23 05:36:08 2004
@@ -15,10 +15,10 @@
*/
package org.apache.jackrabbit.jcr.core.version;
+import javax.jcr.RepositoryException;
import javax.jcr.version.Version;
import javax.jcr.version.VersionHistory;
import javax.jcr.version.VersionIterator;
-import javax.jcr.RepositoryException;
import java.util.Calendar;
/**
@@ -32,13 +32,13 @@
*/
public class GenericVersionSelector implements VersionSelector {
- private String name=null;
+ private String name = null;
- private String label=null;
+ private String label = null;
- private Calendar date=null;
+ private Calendar date = null;
- private boolean returnLatest=true;
+ private boolean returnLatest = true;
public GenericVersionSelector() {
}
@@ -84,17 +84,17 @@
}
public Version select(VersionHistory versionHistory) throws RepositoryException {
- Version selected=null;
- if (name!=null) {
+ Version selected = null;
+ if (name != null) {
selected = selectByName(versionHistory, name);
}
- if (selected==null && label!=null) {
+ if (selected == null && label != null) {
selected = selectByLabel(versionHistory, label);
}
- if (selected==null && date!=null) {
+ if (selected == null && date != null) {
selected = selectByDate(versionHistory, date);
}
- if (selected==null && returnLatest) {
+ if (selected == null && returnLatest) {
selected = selectByDate(versionHistory, null);
}
return selected;
@@ -112,14 +112,14 @@
public static Version selectByDate(VersionHistory history, Calendar date)
throws RepositoryException {
- long time = date==null ? Long.MAX_VALUE : date.getTimeInMillis();
- long latestDate=Long.MIN_VALUE;
- Version latestVersion=null;
+ long time = date == null ? Long.MAX_VALUE : date.getTimeInMillis();
+ long latestDate = Long.MIN_VALUE;
+ Version latestVersion = null;
VersionIterator iter = history.getAllVersions();
while (iter.hasNext()) {
Version v = iter.nextVersion();
long c = v.getCreated().getTimeInMillis();
- if (c>latestDate && c<=time) {
+ if (c > latestDate && c <= time) {
latestDate = c;
latestVersion = v;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/VersionImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/VersionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/version/VersionImpl.java Thu Sep 23 05:36:08 2004
@@ -26,9 +26,9 @@
import javax.jcr.nodetype.NodeDef;
import javax.jcr.version.Version;
import java.util.Calendar;
-import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
/**
* This Class implements the Version representation of the node.
@@ -68,7 +68,9 @@
*/
public static final QName PROPNAME_BASE_VERSION = new QName(NamespaceRegistryImpl.NS_JCR_URI, "baseVersion");
- /** cache for version labels */
+ /**
+ * cache for version labels
+ */
private Set cachedVersionLabels;
/**
@@ -275,8 +277,8 @@
* Initializes / Loads the version label cache
*/
private void initLabelCache() throws RepositoryException {
- if (cachedVersionLabels==null) {
- cachedVersionLabels=new HashSet();
+ if (cachedVersionLabels == null) {
+ cachedVersionLabels = new HashSet();
if (hasProperty(PROPNAME_VERSION_LABELS)) {
Value[] values = getProperty(PROPNAME_VERSION_LABELS).getValues();
for (int i = 0; i < values.length; i++) {
@@ -289,12 +291,13 @@
/**
* Saves the current labels in the cache to the 'VersionLabels' property
* of this node.
+ *
* @throws RepositoryException
*/
private void saveLabelCache() throws RepositoryException {
InternalValue[] newValues = new InternalValue[cachedVersionLabels.size()];
Iterator iter = cachedVersionLabels.iterator();
- for (int i=0; i<newValues.length; i++) {
+ for (int i = 0; i < newValues.length; i++) {
newValues[i] = InternalValue.create((String) iter.next());
}
internalSetProperty(PROPNAME_VERSION_LABELS, newValues);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/AbstractSAXEventGenerator.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/AbstractSAXEventGenerator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/AbstractSAXEventGenerator.java Thu Sep 23 05:36:08 2004
@@ -168,9 +168,9 @@
Iterator iter = nodeState.getPropertyEntries().iterator();
while (iter.hasNext()) {
NodeState.PropertyEntry pe = (NodeState.PropertyEntry) iter.next();
- if (PROPNAME_PRIMARYTYPE.equals(pe.getName()) ||
- PROPNAME_MIXINTYPES.equals(pe.getName()) ||
- PROPNAME_UUID.equals(pe.getName())) {
+ if (PROPNAME_PRIMARYTYPE.equals(pe.getName())
+ || PROPNAME_MIXINTYPES.equals(pe.getName())
+ || PROPNAME_UUID.equals(pe.getName())) {
continue;
}
PropertyId propId = new PropertyId(nodeState.getUUID(), pe.getName());
@@ -241,7 +241,7 @@
* @throws RepositoryException
* @throws SAXException
*/
- abstract protected void entering(NodeState state, QName name, int level)
+ protected abstract void entering(NodeState state, QName name, int level)
throws RepositoryException, SAXException;
/**
@@ -252,7 +252,7 @@
* @throws RepositoryException
* @throws SAXException
*/
- abstract protected void enteringProperties(NodeState state, QName name, int level)
+ protected abstract void enteringProperties(NodeState state, QName name, int level)
throws RepositoryException, SAXException;
/**
@@ -263,7 +263,7 @@
* @throws RepositoryException
* @throws SAXException
*/
- abstract protected void leavingProperties(NodeState state, QName name, int level)
+ protected abstract void leavingProperties(NodeState state, QName name, int level)
throws RepositoryException, SAXException;
/**
@@ -274,7 +274,7 @@
* @throws RepositoryException
* @throws SAXException
*/
- abstract protected void leaving(NodeState state, QName name, int level)
+ protected abstract void leaving(NodeState state, QName name, int level)
throws RepositoryException, SAXException;
/**
@@ -284,7 +284,7 @@
* @throws RepositoryException
* @throws SAXException
*/
- abstract protected void entering(PropertyState state, int level)
+ protected abstract void entering(PropertyState state, int level)
throws RepositoryException, SAXException;
/**
@@ -294,6 +294,6 @@
* @throws RepositoryException
* @throws SAXException
*/
- abstract protected void leaving(PropertyState state, int level)
+ protected abstract void leaving(PropertyState state, int level)
throws RepositoryException, SAXException;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/DocViewImportHandler.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/DocViewImportHandler.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/DocViewImportHandler.java Thu Sep 23 05:36:08 2004
@@ -96,7 +96,7 @@
/**
* @see ContentHandler#characters(char[], int, int)
*/
- public void characters(char ch[], int start, int length) throws SAXException {
+ public void characters(char[] ch, int start, int length) throws SAXException {
// character data in document view:
// store as jcr:xmlcharacters property of jcr:xmltext node
// (need to store as node in order to maintain ordering)
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/ImportHandler.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/ImportHandler.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/ImportHandler.java Thu Sep 23 05:36:08 2004
@@ -159,7 +159,7 @@
/**
* @see ContentHandler#characters(char[], int, int)
*/
- public void characters(char ch[], int start, int length) throws SAXException {
+ public void characters(char[] ch, int start, int length) throws SAXException {
// delegate to target handler
targetHandler.characters(ch, start, length);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewImportHandler.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewImportHandler.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewImportHandler.java Thu Sep 23 05:36:08 2004
@@ -173,7 +173,7 @@
/**
* @see ContentHandler#characters(char[], int, int)
*/
- public void characters(char ch[], int start, int length) throws SAXException {
+ public void characters(char[] ch, int start, int length) throws SAXException {
if (currentPropValue != null) {
// property value (character data of sv:value element)
currentPropValue.append(ch, start, length);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewSAXEventGenerator.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewSAXEventGenerator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/core/xml/SysViewSAXEventGenerator.java Thu Sep 23 05:36:08 2004
@@ -204,7 +204,7 @@
public void flush() /*throws IOException*/ {
}
- public void write(char cbuf[], int off, int len) throws IOException {
+ public void write(char[] cbuf, int off, int len) throws IOException {
try {
contentHandler.characters(cbuf, off, len);
} catch (SAXException se) {
@@ -227,7 +227,7 @@
}
}
} else {
- char chars[] = values[i].toJCRValue(nsReg).getString().toCharArray();
+ char[] chars = values[i].toJCRValue(nsReg).getString().toCharArray();
contentHandler.characters(chars, 0, chars.length);
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystem.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystem.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystem.java Thu Sep 23 05:36:08 2004
@@ -35,12 +35,12 @@
/**
* File separator
*/
- public final static String SEPARATOR = "/";
+ public static final String SEPARATOR = "/";
/**
* File separator character
*/
- public final static char SEPARATOR_CHAR = '/';
+ public static final char SEPARATOR_CHAR = '/';
/**
* Initialize the file system
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemPathUtil.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemPathUtil.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemPathUtil.java Thu Sep 23 05:36:08 2004
@@ -26,7 +26,7 @@
*/
public final class FileSystemPathUtil {
- private final static char[] hexTable = "0123456789abcdef".toCharArray();
+ private static final char[] hexTable = "0123456789abcdef".toCharArray();
private static final char ESCAPE_CHAR = '%';
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemResource.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemResource.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/FileSystemResource.java Thu Sep 23 05:36:08 2004
@@ -190,8 +190,8 @@
}
if (obj instanceof FileSystemResource) {
FileSystemResource other = (FileSystemResource) obj;
- return (path == null ? other.path == null : path.equals(other.path)) &&
- (fs == null ? other.fs == null : fs.equals(other.fs));
+ return (path == null ? other.path == null : path.equals(other.path))
+ && (fs == null ? other.fs == null : fs.equals(other.fs));
}
return false;
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/local/LocalFileSystem.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/local/LocalFileSystem.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/fs/local/LocalFileSystem.java Thu Sep 23 05:36:08 2004
@@ -62,8 +62,8 @@
}
if (obj instanceof LocalFileSystem) {
LocalFileSystem other = (LocalFileSystem) obj;
- return (root == null ? other.root == null : root.equals(other.root)) &&
- (rootPath == null ? other.rootPath == null : rootPath.equals(other.rootPath));
+ return (root == null ? other.root == null : root.equals(other.root))
+ && (rootPath == null ? other.rootPath == null : rootPath.equals(other.rootPath));
}
return false;
}
@@ -288,7 +288,7 @@
log.error(msg);
throw new FileSystemException(msg);
}
- String entries[] = new String[files.length];
+ String[] entries = new String[files.length];
for (int i = 0; i < files.length; i++) {
entries[i] = files[i].getName();
}
@@ -310,7 +310,7 @@
log.error(msg);
throw new FileSystemException(msg);
}
- String entries[] = new String[folders.length];
+ String[] entries = new String[folders.length];
for (int i = 0; i < folders.length; i++) {
entries[i] = folders[i].getName();
}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/Base64.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/Base64.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/Base64.java Thu Sep 23 05:36:08 2004
@@ -122,8 +122,8 @@
if (len == 0) {
return;
}
- if (len < 0 || off >= data.length ||
- len + off > data.length) {
+ if (len < 0 || off >= data.length
+ || len + off > data.length) {
throw new IllegalArgumentException();
}
char[] enc = new char[4];
@@ -215,8 +215,8 @@
if (len == 0) {
return;
}
- if (len < 0 || off >= chars.length ||
- len + off > chars.length) {
+ if (len < 0 || off >= chars.length
+ || len + off > chars.length) {
throw new IllegalArgumentException();
}
char[] chunk = new char[4];
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/ValueHelper.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/ValueHelper.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/ValueHelper.java Thu Sep 23 05:36:08 2004
@@ -30,6 +30,13 @@
* @version $Revision: 1.12 $, $Date: 2004/08/26 10:06:40 $
*/
public class ValueHelper {
+
+ /**
+ * empty private constructor
+ */
+ private ValueHelper() {
+ }
+
/**
* @param srcValue
* @param targetType
@@ -67,9 +74,9 @@
try {
val = new StringValue(srcValue.getString());
} catch (RepositoryException re) {
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType), re);
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType), re);
}
break;
@@ -78,9 +85,9 @@
try {
val = new BinaryValue(srcValue.getStream());
} catch (RepositoryException re) {
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType), re);
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType), re);
}
break;
@@ -89,9 +96,9 @@
try {
val = new BooleanValue(srcValue.getBoolean());
} catch (RepositoryException re) {
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType), re);
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType), re);
}
break;
@@ -100,9 +107,9 @@
try {
val = new DateValue(srcValue.getDate());
} catch (RepositoryException re) {
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType), re);
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType), re);
}
break;
@@ -111,9 +118,9 @@
try {
val = new DoubleValue(srcValue.getDouble());
} catch (RepositoryException re) {
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType), re);
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType), re);
}
break;
@@ -122,9 +129,9 @@
try {
val = new LongValue(srcValue.getLong());
} catch (RepositoryException re) {
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType), re);
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType), re);
}
break;
@@ -162,9 +169,9 @@
case PropertyType.DOUBLE:
case PropertyType.LONG:
case PropertyType.REFERENCE:
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType));
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType));
default:
throw new IllegalArgumentException("not a valid type constant: " + srcType);
@@ -178,7 +185,7 @@
// no conversion needed, return original value
// (redundant code, just here for the sake of clarity)
return srcValue;
-
+
case PropertyType.BINARY:
case PropertyType.STRING:
case PropertyType.PATH: // path might be a name (relative, onle element long path)
@@ -205,9 +212,9 @@
case PropertyType.DOUBLE:
case PropertyType.LONG:
case PropertyType.REFERENCE:
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType));
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType));
default:
throw new IllegalArgumentException("not a valid type constant: " + srcType);
@@ -242,9 +249,9 @@
case PropertyType.LONG:
case PropertyType.PATH:
case PropertyType.NAME:
- throw new ValueFormatException("conversion failed: " +
- PropertyType.nameFromValue(srcType) + " to " +
- PropertyType.nameFromValue(targetType));
+ throw new ValueFormatException("conversion failed: "
+ + PropertyType.nameFromValue(srcType) + " to "
+ + PropertyType.nameFromValue(targetType));
default:
throw new IllegalArgumentException("not a valid type constant: " + srcType);
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/Bytes.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/Bytes.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/Bytes.java Thu Sep 23 05:36:08 2004
@@ -22,7 +22,7 @@
* <p>Copied from the Jakarta Commons-Id project</p>
* <p/>
* todo remove and use official commons-id release as soon as it is available
- *
+ *
* @author Commons-Id Team
* @version $Id: Bytes.java,v 1.2 2004/07/26 17:10:46 sguggisb Exp $
* {@link http://jakarta.apache.org/turbine/turbine-2.3/}
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/VersionFourGenerator.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/VersionFourGenerator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/jcr/util/uuid/VersionFourGenerator.java Thu Sep 23 05:36:08 2004
@@ -39,7 +39,7 @@
* <p>Copied from the Jakarta Commons-Id project</p>
* <p/>
* todo remove and use official commons-id release as soon as it is available
- *
+ *
* @author Commons-Id team
* @version $Revision: 1.2 $ $Date: 2004/07/26 17:10:46 $
*