vgritsenko 2003/08/14 20:06:02
Modified: java/src/org/apache/xindice/core Collection.java
Log:
Remove unnecessary toString() calls
Revision Changes Path
1.36 +23 -15
xml-xindice/java/src/org/apache/xindice/core/Collection.java
Index: Collection.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Collection.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Collection.java 13 Aug 2003 18:52:53 -0000 1.35
+++ Collection.java 15 Aug 2003 03:06:02 -0000 1.36
@@ -479,11 +479,14 @@
*/
public final byte[] getBinary(Object docKey) throws DBException {
- log.debug(debugHeader() + "getBinary: docKey=<" + docKey.toString()
+ ">");
+ if (log.isDebugEnabled()) {
+ log.debug(debugHeader() + "getBinary: docKey=<" + docKey + ">");
+ }
if (inlineMetaService != null) {
throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND,
- "There are no binary resources in
collection" + name + ": inline-metadata is not enabled.");
+ "There are no binary resources in
collection " + name +
+ ": inline-metadata is not enabled.");
}
Object entry = getEntry(docKey);
@@ -493,7 +496,8 @@
if (!(entry instanceof byte[])) {
throw new DBException(FaultCodes.COL_INVALID_RESULT,
- "The resource associated with key '" +
docKey.toString() + "' in collection '" + name + "'is not binary");
+ "The resource associated with key '" +
docKey +
+ "' in collection '" + name + "'is not
binary");
}
return (byte[]) entry;
@@ -600,7 +604,7 @@
public final Document getDocument(Object docKey) throws DBException {
if (log.isTraceEnabled()) {
- log.trace(debugHeader() + "getDocument: docKey=<" +
docKey.toString() + ">");
+ log.trace(debugHeader() + "getDocument: docKey=<" + docKey +
">");
}
Object entry = getEntry(docKey);
@@ -610,7 +614,8 @@
if (!(entry instanceof Document)) {
throw new DBException(FaultCodes.COL_INVALID_RESULT,
- "The resource associated with key '" +
docKey.toString() + "' in collection '" + name + "'is not XML");
+ "The resource associated with key '" +
docKey +
+ "' in collection '" + name + "' is not
XML");
}
return (Document) entry;
@@ -712,7 +717,7 @@
return null;
}
- final String localDebugHeader = debugHeader() + "getEntry: docKey=<"
+ docKey.toString() + ">: ";
+ final String localDebugHeader = debugHeader() + "getEntry: docKey=<"
+ docKey + ">: ";
log.trace(localDebugHeader);
checkFiler(FaultCodes.COL_NO_FILER);
@@ -788,7 +793,7 @@
}
} else {
if (log.isTraceEnabled()) {
- log.trace(localDebugHeader + "Pre parseDocument():
value=<" + value.toString() + ">");
+ log.trace(localDebugHeader + "Pre parseDocument():
value=<" + value + ">");
}
document = parseDocument(key, value.toString());
@@ -941,7 +946,8 @@
if (inlineMetaService == null) {
throw new DBException(FaultCodes.COL_CANNOT_STORE,
- "Cannot insert a binary resource in
collection " + name + ": inline-metadata is not enabled.");
+ "Cannot insert a binary resource in
collection " + name +
+ ": inline-metadata is not enabled.");
}
Key key = createNewOID();
@@ -965,7 +971,8 @@
if (inlineMetaService == null) {
throw new DBException(FaultCodes.COL_CANNOT_STORE,
- "Cannot insert a binary resource in
collection " + name + ": inline-metadata is not enabled.");
+ "Cannot insert a binary resource in
collection " + name +
+ ": inline-metadata is not enabled.");
}
putBinary(createNewKey(docKey), bytes, true);
@@ -1118,7 +1125,8 @@
if (inlineMetaService == null) {
throw new DBException(FaultCodes.COL_CANNOT_STORE,
- "Cannot store a binary resource in
collection " + getCanonicalName() + ": inline-metadata is not enabled");
+ "Cannot store a binary resource in
collection " + getCanonicalName() +
+ ": inline-metadata is not enabled");
}
if (!create) {
@@ -1145,7 +1153,7 @@
*/
private void putDocument(Key key, Document document) throws DBException {
- String localDebugHeader = debugHeader() + "putDocument: docKey=<" +
key.toString() + ">: ";
+ final String localDebugHeader = debugHeader() + "putDocument:
docKey=<" + key + ">: ";
if (log.isDebugEnabled()) {
log.debug(localDebugHeader + "document=<" +
TextWriter.toString(document) + ">");
}
@@ -1247,7 +1255,7 @@
private void putObject(Key key, XMLSerializable obj) throws DBException {
- String localDebugHeader = debugHeader() + "putObject: key=<" +
key.toString() + ">: ";
+ final String localDebugHeader = debugHeader() + "putObject: key=<" +
key + ">: ";
Document doc = new DocumentImpl();
ProcessingInstruction pi =
doc.createProcessingInstruction(CLASSNAME, obj.getClass().getName());
@@ -1401,7 +1409,7 @@
setCanonicalName(parent.getCanonicalName() + '/' + name);
log.debug(localDebugHeader + "Canonical name=<" +
getCanonicalName() + ">");
setCollectionRoot(new File(parent.getCollectionRoot(), name));
- log.debug(localDebugHeader + "Root=<" +
getCollectionRoot().toString() + ">");
+ log.debug(localDebugHeader + "Root=<" + getCollectionRoot() +
">");
}
if (log.isDebugEnabled()) {