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 2006/03/29 13:47:50 UTC
svn commit: r389766 - in
/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value:
BLOBFileValue.java InternalValue.java
Author: stefan
Date: Wed Mar 29 03:47:46 2006
New Revision: 389766
URL: http://svn.apache.org/viewcvs?rev=389766&view=rev
Log:
- some minor javadoc cleanups
- InternalValue.hashCode() returns hash code of internal value object
Modified:
jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java?rev=389766&r1=389765&r2=389766&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java Wed Mar 29 03:47:46 2006
@@ -238,7 +238,7 @@
return -1;
}
} else {
- // this instance is backed by a in-memory buffer
+ // this instance is backed by an in-memory buffer
return buffer.length;
}
}
@@ -261,7 +261,7 @@
// this instance is backed by a temp file
file.delete();
} else if (buffer != null) {
- // this instance is backed by a in-memory buffer
+ // this instance is backed by an in-memory buffer
buffer = EMPTY_BYTE_ARRAY;
}
}
@@ -307,7 +307,7 @@
log.warn("Error while deleting BLOBFileValue: " + fse.getMessage());
}
} else {
- // this instance is backed by a in-memory buffer
+ // this instance is backed by an in-memory buffer
buffer = EMPTY_BYTE_ARRAY;
}
}
@@ -340,7 +340,7 @@
+ ": the specified resource does not exist", fse);
}
} else {
- // this instance is backed by a in-memory buffer
+ // this instance is backed by an in-memory buffer
in = new ByteArrayInputStream(buffer);
}
try {
@@ -359,9 +359,13 @@
//-------------------------------------------< java.lang.Object overrides >
/**
- * Returns the path string of the backing file.
+ * Returns a string representation of this <code>BLOBFileValue</code>
+ * instance. The string representation of a resource backed value is
+ * the path of the underlying resource. If this instance is backed by an
+ * in-memory buffer the generic object string representation of the byte
+ * array will be used instead.
*
- * @return The path string of the backing file.
+ * @return A string representation of this <code>BLOBFileValue</code> instance.
*/
public String toString() {
if (file != null) {
@@ -371,7 +375,7 @@
// this instance is backed by a resource in the virtual file system
return fsResource.toString();
} else {
- // this instance is backed by a in-memory buffer
+ // this instance is backed by an in-memory buffer
return buffer.toString();
}
}
Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=389766&r1=389765&r2=389766&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java Wed Mar 29 03:47:46 2006
@@ -410,42 +410,6 @@
}
/**
- * Returns the string representation of this internal value. If this is a
- * <i>binary</i> value then the path of its backing file will be returned.
- *
- * @return string representation of this internal value
- */
- public String toString() {
- if (type == PropertyType.DATE) {
- return ISO8601.format((Calendar) val);
- } else {
- return val.toString();
- }
- }
-
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof InternalValue) {
- InternalValue other = (InternalValue) obj;
- return val.equals(other.val);
- }
- return false;
- }
-
- /**
- * Returns zero to satisfy the Object equals/hashCode contract.
- * This class is mutable and not meant to be used as a hash key.
- *
- * @return always zero
- * @see Object#hashCode()
- */
- public int hashCode() {
- return 0;
- }
-
- /**
* @param s
* @param type
* @return
@@ -474,6 +438,41 @@
default:
throw new IllegalArgumentException("illegal type");
}
+ }
+
+ //-------------------------------------------< java.lang.Object overrides >
+ /**
+ * Returns the string representation of this internal value.
+ *
+ * @return string representation of this internal value
+ */
+ public String toString() {
+ if (type == PropertyType.DATE) {
+ return ISO8601.format((Calendar) val);
+ } else {
+ return val.toString();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof InternalValue) {
+ InternalValue other = (InternalValue) obj;
+ return val.equals(other.val);
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode() {
+ return val.hashCode();
}
//-------------------------------------------------------< implementation >