exo-jcr SVN: r5537 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype and 35 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 09:09:27 -0500 (Fri, 27 Jan 2012)
New Revision: 5537
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.config;
import org.exoplatform.services.jcr.util.StringNumberParser;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.util.ArrayList;
import java.util.List;
@@ -33,6 +35,9 @@
public abstract class MappedParametrizedObjectEntry
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.config.MappedParametrizedObjectEntry");
+
protected String type;
protected List<SimpleParameterEntry> parameters = new ArrayList<SimpleParameterEntry>();
@@ -129,7 +134,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable Integer. " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -199,7 +207,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable Long. " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -248,7 +259,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable Long. " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -298,7 +312,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable time (as Long). " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.services.jcr.core.nodetype;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import javax.jcr.version.OnParentVersionAction;
/**
@@ -28,6 +31,9 @@
public class OnParentVersionActionConversion
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.core.nodetype.OnParentVersionActionConversion");
+
public static String serializeType(int propertyType)
{
@@ -39,10 +45,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
@@ -58,10 +72,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.core.nodetype;
import org.exoplatform.services.jcr.core.ExtendedPropertyType;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import javax.jcr.PropertyType;
@@ -30,6 +32,9 @@
public class PropertyTypeConversion
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.core.nodetype.PropertyTypeConversion");
+
public static String serializeType(int propertyType)
{
@@ -41,10 +46,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
@@ -60,10 +73,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -23,6 +23,8 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.Externalizable;
import java.io.IOException;
@@ -41,6 +43,8 @@
public class TransactionChangesLog implements CompositeChangesLog, Externalizable
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.dataflow.TransactionChangesLog");
+
private static final long serialVersionUID = 4866736965040228027L;
protected String systemId;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -69,7 +69,7 @@
}
catch (RepositoryException e)
{
- log.error(e);
+ log.error("An exception occured: " + e.getMessage());
}
return getRepositoryStateTitle();
}
@@ -89,7 +89,7 @@
}
catch (RepositoryException e)
{
- log.error(e);
+ log.error("An exception occured: " + e.getMessage());
}
return getRepositoryStateTitle();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -36,6 +36,8 @@
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
import org.exoplatform.services.jcr.observation.ExtendedEvent;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.EOFException;
import java.io.Externalizable;
@@ -70,6 +72,8 @@
public class JCRRestore
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.impl.backup.JCRRestore");
+
private final DataManager dataManager;
private final FileCleaner fileCleaner;
@@ -181,7 +185,10 @@
}
catch (EOFException ioe)
{
- // ok - reading all data from backup file;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -271,7 +271,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -283,7 +283,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -347,7 +347,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -359,7 +359,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -449,7 +449,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
con.close();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -83,7 +83,7 @@
/**
* Logger.
*/
- private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ItemImpl");
/**
* Session object.
@@ -284,7 +284,7 @@
}
catch (Exception e)
{
- log.debug("Item.isSame() failed " + e);
+ LOG.debug("Item.isSame() failed " + e.getMessage());
return false;
}
}
@@ -573,9 +573,9 @@
}
else
{
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Set null value (" + getPath() + ", multivalued: " + multiValue + ")");
+ LOG.debug("Set null value (" + getPath() + ", multivalued: " + multiValue + ")");
}
}
}
@@ -1008,9 +1008,9 @@
strVal = "PropertyType.BINARY";
}
}
- catch (Throwable e)
+ catch (IOException e)
{
- log.error("Error of value read: " + e.getMessage(), e);
+ LOG.error("Error of value read: " + e.getMessage(), e);
}
throw new ConstraintViolationException("Can not set value '" + strVal + "' to " + getPath()
+ " due to value constraints ");
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -43,7 +43,7 @@
public class SessionFactory
{
- private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.SessionFactory");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.SessionFactory");
private final ExoContainer container;
@@ -76,7 +76,10 @@
}
catch (NumberFormatException e)
{
- //
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (maxAgeMillis <= 0)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -39,6 +39,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -334,10 +335,14 @@
strVal = "PropertyType.BINARY";
}
}
- catch (Throwable e)
+ catch (IllegalStateException e)
{
LOG.error("Error of value read: " + e.getMessage(), e);
}
+ catch (IOException e)
+ {
+ LOG.error("Error of value read: " + e.getMessage(), e);
+ }
throw new ConstraintViolationException("Value " + strVal + " for property "
+ propertyData.getQPath().getAsString() + " doesn't match new constraint ");
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -130,7 +130,7 @@
catch (RepositoryException e)
{
log.error("Can not fire ActionLauncher.onSaveItems() for " + item.getQPath().getAsString()
- + " reason: " + e);
+ + " reason: " + e.getMessage());
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -46,7 +46,7 @@
public ExactQueryNode(QueryNode parent, InternalQName property, InternalQName value) {
super(parent);
if (parent == null) {
- throw new NullPointerException("parent");
+ throw new IllegalArgumentException("parameter parent cannot be null");
}
this.property = property;
this.value = value;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -50,7 +50,7 @@
/**
* Logger instance for this class.
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.AbstractExcerpt");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.AbstractExcerpt");
/**
* The search index.
@@ -110,7 +110,7 @@
if (fields == null)
{
- log.debug("Fulltext field not stored, using {}", SimpleExcerptProvider.class.getName());
+ LOG.debug("Fulltext field not stored, using {}", SimpleExcerptProvider.class.getName());
SimpleExcerptProvider exProvider = new SimpleExcerptProvider();
exProvider.init(query, index);
return exProvider.getExcerpt(id, maxFragments, maxFragmentSize);
@@ -157,7 +157,7 @@
}
else
{
- log.debug("No TermPositionVector on Fulltext field.");
+ LOG.debug("No TermPositionVector on Fulltext field.");
return null;
}
}
@@ -286,7 +286,10 @@
}
catch (IOException e)
{
- // should never happen, we are reading from a string
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return new TermPositionVector()
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -16,6 +16,14 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.search.FilteredTermEnum;
+import org.apache.lucene.search.MultiTermQuery;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -23,17 +31,14 @@
import java.util.List;
import java.util.Map;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermEnum;
-import org.apache.lucene.search.FilteredTermEnum;
-import org.apache.lucene.search.MultiTermQuery;
-
/**
* <code>CaseTermQuery</code> implements a term query which convert the term
* from the index either to upper or lower case before it is matched.
*/
-abstract class CaseTermQuery extends MultiTermQuery implements TransformConstants {
+abstract class CaseTermQuery extends MultiTermQuery implements TransformConstants
+{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.CaseTermQuery");
/**
* Indicates whether terms from the index should be lower-cased or
@@ -68,7 +73,8 @@
}
- private final class CaseTermEnum extends FilteredTermEnum {
+ private final class CaseTermEnum extends FilteredTermEnum
+ {
private final int nameLength;
@@ -152,7 +158,10 @@
try {
terms.close();
} catch (IOException e) {
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -60,7 +60,7 @@
/**
* The logger instance for this class.
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.ChildAxisQuery");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.ChildAxisQuery");
/**
* Threshold when children calculation is switched to
@@ -743,7 +743,7 @@
long time = System.currentTimeMillis();
NodeData state = (NodeData)itemMgr.getItemData(uuid);
time = System.currentTimeMillis() - time;
- log.debug("got NodeState with id {} in {} ms.", uuid, new Long(time));
+ LOG.debug("got NodeState with id {} in {} ms.", uuid, new Long(time));
Iterator<NodeData> entries;
if (nameTest != null)
{
@@ -786,7 +786,10 @@
}
catch (RepositoryException e)
{
- // does not exist anymore -> ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return childrenHits;
@@ -833,7 +836,7 @@
public Hits getHits() throws IOException
{
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
@@ -862,10 +865,10 @@
}
}
}
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis() - time;
- log.debug("Filtered hits in {} ms.", new Long(time));
+ LOG.debug("Filtered hits in {} ms.", new Long(time));
}
return childrenHits;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -41,7 +41,7 @@
{
/** Logger instance for this class */
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.DocOrderScoreNodeIterator");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.DocOrderScoreNodeIterator");
/** A node iterator with ordered nodes */
private ScoreNodeIterator orderedNodes;
@@ -173,7 +173,7 @@
return;
}
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
@@ -207,15 +207,18 @@
}
catch (SortFailedException e)
{
- // retry
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
while (invalidIDs.size() > 0);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("" + nodes.length + " node(s) ordered in " + (System.currentTimeMillis() - time) + " ms");
+ LOG.debug("" + nodes.length + " node(s) ordered in " + (System.currentTimeMillis() - time) + " ms");
}
orderedNodes = new ScoreNodeIteratorImpl(nodes);
@@ -329,7 +332,7 @@
}
catch (Exception e)
{
- log.error("Exception while sorting nodes in document order: " + e.toString(), e);
+ LOG.error("Exception while sorting nodes in document order: " + e.toString(), e);
}
// if we get here something went wrong
@@ -337,11 +340,11 @@
if (n1 != null)
invalidIDs.add(n1.getNodeId());
else
- log.warn("Null ScoreNode n1 will not be added into invalid identifiers set");
+ LOG.warn("Null ScoreNode n1 will not be added into invalid identifiers set");
if (n2 != null)
invalidIDs.add(n2.getNodeId());
else
- log.warn("Null ScoreNode n2 will not be added into invalid identifiers set");
+ LOG.warn("Null ScoreNode n2 will not be added into invalid identifiers set");
// terminate sorting
throw new SortFailedException();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -20,9 +20,9 @@
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
-import org.apache.lucene.search.BooleanClause.Occur;
import org.exoplatform.commons.utils.ISO8601;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.dataflow.ItemDataConsumer;
@@ -102,7 +102,7 @@
/**
* Logger for this class
*/
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.LuceneQueryBuilder");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.LuceneQueryBuilder");
/**
* Root node of the abstract query tree
@@ -340,7 +340,10 @@
}
catch (RepositoryException e)
{
- // will never happen, prefixes are created when unknown
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return new JcrTermQuery(new Term(FieldNames.PROPERTIES, FieldNames.createNamedValue(field, value)));
}
@@ -495,7 +498,7 @@
}
catch (RepositoryException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
}
return null;
}
@@ -1173,20 +1176,20 @@
{
InternalQName n = session.getLocationFactory().parseJCRName(literal).getInternalName();
values.add(nsMappings.translateName(n));
- log.debug("Coerced " + literal + " into NAME.");
+ LOG.debug("Coerced " + literal + " into NAME.");
}
catch (RepositoryException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
}
}
catch (IllegalNameException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
}
}
break;
@@ -1196,13 +1199,13 @@
{
QPath p = session.getLocationFactory().parseJCRPath(literal).getInternalPath();
values.add(resolver.createJCRPath(p).getAsString(true));
- log.debug("Coerced " + literal + " into PATH.");
+ LOG.debug("Coerced " + literal + " into PATH.");
}
catch (RepositoryException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
}
}
break;
@@ -1212,13 +1215,13 @@
if (c != null)
{
values.add(DateField.timeToString(c.getTimeInMillis()));
- log.debug("Coerced " + literal + " into DATE.");
+ LOG.debug("Coerced " + literal + " into DATE.");
}
else
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a DATE.");
+ LOG.warn("Unable to coerce '" + literal + "' into a DATE.");
}
}
break;
@@ -1228,13 +1231,13 @@
{
double d = Double.parseDouble(literal);
values.add(DoubleField.doubleToString(d));
- log.debug("Coerced " + literal + " into DOUBLE.");
+ LOG.debug("Coerced " + literal + " into DOUBLE.");
}
catch (NumberFormatException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a DOUBLE: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a DOUBLE: " + e.toString());
}
}
break;
@@ -1244,19 +1247,19 @@
{
long l = Long.parseLong(literal);
values.add(LongField.longToString(l));
- log.debug("Coerced " + literal + " into LONG.");
+ LOG.debug("Coerced " + literal + " into LONG.");
}
catch (NumberFormatException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a LONG: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a LONG: " + e.toString());
}
}
break;
case PropertyType.STRING :
values.add(literal);
- log.debug("Using literal " + literal + " as is.");
+ LOG.debug("Using literal " + literal + " as is.");
break;
}
}
@@ -1274,11 +1277,14 @@
{
QPath p = session.getLocationFactory().parseJCRPath(literal).getInternalPath();
values.add(resolver.createJCRPath(p).getAsString(true));
- log.debug("Coerced " + literal + " into PATH.");
+ LOG.debug("Coerced " + literal + " into PATH.");
}
catch (Exception e)
{
- // not a path
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (XMLChar.isValidName(literal))
@@ -1288,11 +1294,14 @@
{
InternalQName n = session.getLocationFactory().parseJCRName(literal).getInternalName();
values.add(nsMappings.translateName(n));
- log.debug("Coerced " + literal + " into NAME.");
+ LOG.debug("Coerced " + literal + " into NAME.");
}
catch (Exception e)
{
- // not a name
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (literal.indexOf(':') > -1)
@@ -1302,7 +1311,7 @@
if (c != null)
{
values.add(DateField.timeToString(c.getTimeInMillis()));
- log.debug("Coerced " + literal + " into DATE.");
+ LOG.debug("Coerced " + literal + " into DATE.");
}
}
else
@@ -1311,7 +1320,7 @@
try
{
values.add(LongField.longToString(Long.parseLong(literal)));
- log.debug("Coerced " + literal + " into LONG.");
+ LOG.debug("Coerced " + literal + " into LONG.");
}
catch (NumberFormatException e)
{
@@ -1320,11 +1329,14 @@
try
{
values.add(DoubleField.doubleToString(Double.parseDouble(literal)));
- log.debug("Coerced " + literal + " into DOUBLE.");
+ LOG.debug("Coerced " + literal + " into DOUBLE.");
}
catch (NumberFormatException e1)
{
- // not a double
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -1333,7 +1345,7 @@
if (values.size() == 0)
{
values.add(literal);
- log.debug("Using literal " + literal + " as is.");
+ LOG.debug("Using literal " + literal + " as is.");
}
return values.toArray(new String[values.size()]);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -30,16 +30,16 @@
private final String field;
- /**
- * Creates a new <code>MatchAllQuery</code> .
- * <p/>
- *
- * @param field the field name.
- * @throws NullPointerException if <code>field</code> is null.
- */
- MatchAllQuery(String field) throws NullPointerException {
+ /**
+ * Creates a new <code>MatchAllQuery</code> .
+ * <p/>
+ *
+ * @param field the field name.
+ * @throws IllegalArgumentException if <code>field</code> is null.
+ */
+ MatchAllQuery(String field) throws IllegalArgumentException {
if (field == null) {
- throw new NullPointerException("field");
+ throw new IllegalArgumentException("parameter field cannot be null");
}
this.field = field.intern();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -63,7 +63,7 @@
/**
* The logger instance for this class.
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.NodeIndexer");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.NodeIndexer");
/**
* The default boost for a lucene field: 1.0f.
@@ -215,6 +215,10 @@
{
// will never happen, because this.mappings will dynamically add
// unknown uri<->prefix mappings
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (indexFormatVersion.getVersion() >= IndexFormatVersion.V4.getVersion())
@@ -273,6 +277,10 @@
catch (NamespaceException e)
{
// will never happen, prefixes are created dynamically
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
@@ -323,7 +331,7 @@
if (data == null)
{
- log.warn("null value found at property " + prop.getQPath().getAsString());
+ LOG.warn("null value found at property " + prop.getQPath().getAsString());
}
// check the jcr:encoding property
@@ -392,6 +400,10 @@
}
catch (Throwable e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -406,30 +418,30 @@
}
catch (DocumentReadException e)
{
- log.error("Can not indexing the document by path " + propData.getQPath().getAsString()
+ LOG.error("Can not indexing the document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
catch (HandlerNotFoundException e)
{
// no handler - no index
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Can not indexing the document by path " + propData.getQPath().getAsString()
+ LOG.debug("Can not indexing the document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
}
catch (IOException e)
{
// no data - no index
- if (log.isWarnEnabled())
+ if (LOG.isWarnEnabled())
{
- log.warn("Binary value indexer IO error, document by path " + propData.getQPath().getAsString()
+ LOG.warn("Binary value indexer IO error, document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
}
catch (Exception e)
{
- log.error("Binary value indexer error, document by path " + propData.getQPath().getAsString()
+ LOG.error("Binary value indexer error, document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
}
@@ -450,7 +462,7 @@
if (data == null)
{
- log.warn("null value found at property " + prop.getQPath().getAsString());
+ LOG.warn("null value found at property " + prop.getQPath().getAsString());
}
ExtendedValue val = null;
@@ -542,7 +554,7 @@
}
catch (RepositoryException e)
{
- log.error("Index of property value error. " + prop.getQPath().getAsString() + ".", e);
+ LOG.error("Index of property value error. " + prop.getQPath().getAsString() + ".", e);
throw new RepositoryException("Index of property value error. " + prop.getQPath().getAsString() + ". " + e,
e);
}
@@ -566,6 +578,10 @@
catch (NamespaceException e)
{
// will never happen
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
doc.add(new Field(FieldNames.PROPERTIES_SET, fieldName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
}
@@ -630,7 +646,7 @@
}
catch (IllegalArgumentException e)
{
- log.warn("'{}' is outside of supported date value range.", new Date(value.getTimeInMillis()));
+ LOG.warn("'{}' is outside of supported date value range.", new Date(value.getTimeInMillis()));
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -16,6 +16,11 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
+import org.apache.commons.collections.iterators.IteratorChain;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -26,16 +31,17 @@
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
-import org.apache.commons.collections.iterators.IteratorChain;
-import org.exoplatform.services.jcr.impl.core.NodeImpl;
-
/**
* <code>NodeTraversingQueryHits</code> implements query hits that traverse
* a node hierarchy.
*/
-public class NodeTraversingQueryHits extends AbstractQueryHits {
+public class NodeTraversingQueryHits extends AbstractQueryHits
+{
- /**
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.NodeTraversingQueryHits");
+
+ /**
* The nodes to traverse.
*/
private final Iterator nodes;
@@ -144,32 +150,52 @@
/**
* Initializes the iterator chain once.
*/
- private void init() {
- if (selfAndChildren == null) {
- List allIterators = new ArrayList();
- Iterator current = Collections.singletonList(currentNode).iterator();
- allIterators.add(current);
- if (maxDepth == 0) {
- // only current node
- } else if (maxDepth == 1) {
- try {
- allIterators.add(currentNode.getNodes());
- } catch (RepositoryException e) {
- // currentNode is probably stale
- }
- } else {
- // create new TraversingNodeIterator for each child
- try {
- NodeIterator children = currentNode.getNodes();
- while (children.hasNext()) {
- allIterators.add(new TraversingNodeIterator(children.nextNode(), maxDepth - 1));
- }
- } catch (RepositoryException e) {
- // currentNode is probably stale
- }
- }
- selfAndChildren = new IteratorChain(allIterators);
+ private void init()
+ {
+ if (selfAndChildren == null)
+ {
+ List allIterators = new ArrayList();
+ Iterator current = Collections.singletonList(currentNode).iterator();
+ allIterators.add(current);
+ if (maxDepth == 0)
+ {
+ // only current node
}
- }
+ else if (maxDepth == 1)
+ {
+ try
+ {
+ allIterators.add(currentNode.getNodes());
+ }
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ }
+ else
+ {
+ // create new TraversingNodeIterator for each child
+ try
+ {
+ NodeIterator children = currentNode.getNodes();
+ while (children.hasNext())
+ {
+ allIterators.add(new TraversingNodeIterator(children.nextNode(), maxDepth - 1));
+ }
+ }
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ }
+ selfAndChildren = new IteratorChain(allIterators);
+ }
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -48,7 +48,7 @@
/**
* The logger instance for this class
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.QueryResultImpl");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.QueryResultImpl");
/**
* The search index to execute the query.
@@ -209,7 +209,7 @@
catch (NamespaceException npde)
{
String msg = "encountered invalid property name";
- log.debug(msg);
+ LOG.debug(msg);
throw new RepositoryException(msg, npde);
}
}
@@ -292,9 +292,9 @@
*/
protected void getResults(long size) throws RepositoryException
{
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("getResults({}) limit={}", new Long(size), new Long(limit));
+ LOG.debug("getResults({}) limit={}", new Long(size), new Long(limit));
}
long maxResultSize = size;
@@ -316,14 +316,14 @@
try
{
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
result = executeQuery(maxResultSize);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("query executed in {} ms", new Long(System.currentTimeMillis() - time));
+ LOG.debug("query executed in {} ms", new Long(System.currentTimeMillis() - time));
}
// set selector names
selectorNames = result.getSelectorNames();
@@ -339,14 +339,14 @@
result.skip(start);
}
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
collectScoreNodes(result, resultNodes, maxResultSize);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("retrieved ScoreNodes in {} ms", new Long(System.currentTimeMillis() - time));
+ LOG.debug("retrieved ScoreNodes in {} ms", new Long(System.currentTimeMillis() - time));
}
// update numResults
@@ -358,7 +358,7 @@
}
catch (IOException e)
{
- log.error("Exception while executing query: ", e);
+ LOG.error("Exception while executing query: ", e);
// todo throw?
}
finally
@@ -371,7 +371,7 @@
}
catch (IOException e)
{
- log.warn("Unable to close query result: " + e);
+ LOG.warn("Unable to close query result: " + e);
}
}
}
@@ -445,7 +445,10 @@
}
catch (ItemNotFoundException e)
{
- // node deleted while query was executed
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return true;
@@ -656,7 +659,7 @@
}
catch (RepositoryException e)
{
- log.warn("Exception getting more results: " + e);
+ LOG.warn("Exception getting more results: " + e);
}
// check again
if (nextPos >= resultNodes.size())
@@ -673,16 +676,16 @@
next = null;
invalid++;
resultNodes.remove(nextPos);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("The node is invalid since we don't have sufficient rights to access it, "
+ LOG.debug("The node is invalid since we don't have sufficient rights to access it, "
+ "it will be removed from the results set");
}
}
}
catch (RepositoryException e)
{
- log.error("Could not check access permission", e);
+ LOG.error("Could not check access permission", e);
break;
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -16,6 +16,13 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.search.FilteredTermEnum;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -24,18 +31,17 @@
import java.util.Map;
import java.util.regex.Matcher;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermEnum;
-import org.apache.lucene.search.FilteredTermEnum;
-
/**
* Implements a wildcard term enum that optionally supports embedded property
* names in lucene term texts.
*/
-class WildcardTermEnum extends FilteredTermEnum implements TransformConstants {
+class WildcardTermEnum extends FilteredTermEnum implements TransformConstants
+{
- /**
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.WildcardTermEnum");
+
+ /**
* The pattern matcher.
*/
private final Matcher pattern;
@@ -246,10 +252,16 @@
Iterator it = rangeScans.iterator();
while (it.hasNext()) {
RangeScan scan = (RangeScan) it.next();
- try {
+ try
+ {
scan.close();
- } catch (IOException e) {
- // ignore
+ }
+ catch (IOException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -53,7 +53,7 @@
/**
* Logger instance for this class.
*/
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.LuceneSpellChecker");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.LuceneSpellChecker");
public static final class FiveSecondsRefreshInterval extends LuceneSpellChecker
{
@@ -333,7 +333,10 @@
}
catch (IOException e)
{
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// urgh, the lucene spell checker cannot be closed explicitly.
// finalize will close the reader...
@@ -438,7 +441,7 @@
}
if (hasSuggestion)
{
- log.debug("Successful after " + new Integer(retries) + " retries");
+ LOG.debug("Successful after " + new Integer(retries) + " retries");
return suggestion;
}
else
@@ -452,6 +455,10 @@
// spell checker is closed while searching for
// suggestions. this is actually a design flaw in the
// lucene spell checker, but for now we simply retry
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
// unsuccessful after retries
@@ -505,11 +512,11 @@
{
long time = System.currentTimeMillis();
Dictionary dict = new LuceneDictionary(reader, FieldNames.FULLTEXT);
- log.debug("Starting spell checker index refresh");
+ LOG.debug("Starting spell checker index refresh");
spellChecker.indexDictionary(dict);
time = System.currentTimeMillis() - time;
time = time / 1000;
- log.info("Spell checker index refreshed in: " + new Long(time) + " s.");
+ LOG.info("Spell checker index refreshed in: " + new Long(time) + " s.");
}
finally
{
@@ -525,7 +532,10 @@
}
catch (IOException e)
{
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
};
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -16,13 +16,14 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene.synonym;
+import org.apache.lucene.index.memory.SynonymMap;
+import org.exoplatform.services.jcr.impl.core.query.lucene.SynonymProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.io.InputStream;
-import org.apache.lucene.index.memory.SynonymMap;
-
-import org.exoplatform.services.jcr.impl.core.query.lucene.SynonymProvider;
-
/**
* <code>WordNetSynonyms</code> implements a {@link SynonymProvider} that is backed by the WordNet
* prolog file <a href="http://www.cogsci.princeton.edu/2.0/WNprolog-2.0.tar.gz">wn_s.pl</a>.
@@ -30,6 +31,9 @@
public class WordNetSynonyms implements SynonymProvider
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.synonym.WordNetSynonyms");
+
/**
* The synonym map or <code>null</code> if an error occurred while reading the prolog file.
*/
@@ -48,7 +52,10 @@
}
catch (IOException e)
{
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
SYNONYM_MAP = sm;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -130,10 +130,14 @@
{
return getInternalString().length();
}
- catch (Throwable e)
+ catch (ValueFormatException e)
{
return super.getLength();
}
+ catch (RepositoryException e)
+ {
+ return super.getLength();
+ }
}
@Override
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -94,6 +94,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("init error " + e.getMessage())
{
@@ -145,6 +149,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("init error " + e.getMessage())
{
@@ -299,6 +307,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("update error " + e.getMessage())
{
@@ -384,6 +396,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("setLength(" + size + ") error. " + e.getMessage())
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -214,7 +214,7 @@
}
else
{
- throw new NullPointerException("Stream already consumed");
+ throw new IllegalArgumentException("Stream already consumed");
}
}
}
@@ -234,7 +234,7 @@
}
else
{
- throw new NullPointerException("Null Stream data ");
+ throw new IllegalArgumentException("Null Stream data ");
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -20,6 +20,8 @@
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.File;
import java.io.FileNotFoundException;
@@ -35,6 +37,9 @@
public class SerializationSpoolFile extends SpoolFile
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.dataflow.serialization.SerializationSpoolFile");
+
/**
* SpoolFileHolder.
*/
@@ -100,7 +105,10 @@
}
catch (FileNotFoundException e)
{
- // haven't file - haven't problem
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return false;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -238,7 +238,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -305,7 +305,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -378,7 +378,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -446,7 +446,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -540,7 +540,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -743,7 +743,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -844,7 +844,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -943,7 +943,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1188,7 +1188,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1280,7 +1280,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -21,6 +21,8 @@
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.File;
import java.sql.Connection;
@@ -41,6 +43,9 @@
public class DB2ConnectionFactory extends GenericCQConnectionFactory
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.DB2ConnectionFactory");
+
private Boolean isReindexingSupport;
/**
@@ -217,7 +222,10 @@
}
catch (SQLException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -260,7 +260,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -475,7 +475,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -487,7 +487,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -565,7 +565,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -577,7 +577,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -615,7 +615,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -198,6 +198,10 @@
}
catch (IOException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -72,7 +72,7 @@
}
catch (UnknownHostException e)
{
- LOG.warn("Cannot read host address " + e);
+ LOG.warn("Cannot read host address " + e.getMessage());
LOCAL_ADDRESS = "no address, " + e;
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -42,7 +42,7 @@
protected static final long DEFAULT_TIMEOUT = 30000;
- protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.FileCleaner");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.FileCleaner");
protected final ConcurrentLinkedQueue<File> files = new ConcurrentLinkedQueue<File>();
@@ -112,9 +112,9 @@
};
SecurityHelper.doPrivilegedAction(action);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("FileCleaner instantiated name= " + getName() + " timeout= " + timeout);
+ LOG.debug("FileCleaner instantiated name= " + getName() + " timeout= " + timeout);
}
}
@@ -138,6 +138,10 @@
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// Remove the hook for final cleaning up
SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
@@ -150,15 +154,16 @@
}
catch (IllegalStateException e)
{
- // can't register shutdown hook because
- // jvm shutdown sequence has already begun,
- // silently ignore...
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
});
if (files != null && files.size() > 0)
- log.warn("There are uncleared files: " + files.size());
+ LOG.warn("There are uncleared files: " + files.size());
super.halt();
}
@@ -179,13 +184,13 @@
{
notRemovedFiles.add(file);
- if (log.isDebugEnabled())
- log.debug("Could not delete " + (file.isDirectory() ? "directory" : "file")
+ if (LOG.isDebugEnabled())
+ LOG.debug("Could not delete " + (file.isDirectory() ? "directory" : "file")
+ ". Will try next time: " + PrivilegedFileHelper.getAbsolutePath(file));
}
- else if (log.isDebugEnabled())
+ else if (LOG.isDebugEnabled())
{
- log.debug((file.isDirectory() ? "Directory" : "File") + " deleted : "
+ LOG.debug((file.isDirectory() ? "Directory" : "File") + " deleted : "
+ PrivilegedFileHelper.getAbsolutePath(file));
}
}
@@ -207,9 +212,10 @@
}
catch (IllegalStateException e)
{
- // can't register shutdown hook because
- // jvm shutdown sequence has already begun,
- // silently ignore...
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -106,7 +106,7 @@
protected final ValueFactoryImpl valueFactory;
- private final Log log = ExoLogger.getLogger("exo.jcr.component.core.ImporterBase");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ImporterBase");
public BaseXmlImporter(NodeData parent, QPath ancestorToSave, int uuidBehavior, ItemDataConsumer dataConsumer,
NodeTypeDataManager ntManager, LocationFactory locationFactory, ValueFactoryImpl valueFactory,
@@ -153,7 +153,7 @@
Collections.sort(changesLog.getAllStates(), new PathSorter());
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
StringBuilder str = new StringBuilder();
for (int i = 0; i < changesLog.getAllStates().size(); i++)
@@ -165,7 +165,7 @@
str.append(changesLog.getAllStates().get(i).isInternallyCreated()).append("\t");
str.append(changesLog.getAllStates().get(i).getData().getQPath().getAsString()).append("\n");
}
- log.debug(str);
+ LOG.debug(str);
}
if (isNeedReloadAncestorToSave)
{
@@ -523,7 +523,10 @@
}
catch (ItemNotFoundException e)
{
- // node not found, it's ok - willing create one new
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -53,9 +53,13 @@
public SessionProvider getSessionProvider(Object key)
{
if (providers.containsKey(key))
+ {
return providers.get(key);
+ }
else
- throw new NullPointerException("SessionProvider is not initialized");
+ {
+ throw new IllegalArgumentException("SessionProvider is not initialized");
+ }
}
/*
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -46,7 +46,7 @@
/**
* The logger.
*/
- private static Log log = ExoLogger.getLogger("exo.jcr.component.ext.JobExistedWorkspaceRestore");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.JobExistedWorkspaceRestore");
/**
* JobExistingWorkspaceRestore constructor.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -55,7 +55,7 @@
/**
* Logger.
*/
- protected static final Log log = ExoLogger.getLogger("exo.jcr.component.core.RdbmsWorkspaceInitializer");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.RdbmsWorkspaceInitializer");
/**
* The repository service.
@@ -155,7 +155,7 @@
}
catch (BackupException e1)
{
- log.error("Can't rollback restorer", e1);
+ LOG.error("Can't rollback restorer", e1);
}
}
@@ -171,7 +171,7 @@
}
catch (BackupException e)
{
- log.error("Can't close restorer", e);
+ LOG.error("Can't close restorer", e);
}
}
@@ -186,7 +186,7 @@
{
if (throwable == null)
{
- log.error("Con not set ONLYNE state for repository " + repository.getConfiguration().getName(), e);
+ LOG.error("Con not set ONLYNE state for repository " + repository.getConfiguration().getName(), e);
}
else
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -170,7 +170,7 @@
if (workspaceName == null)
{
- throw new NullPointerException("Workspace Name is null");
+ throw new IllegalArgumentException("Workspace Name is null");
}
ExtendedSession session = cache.get(key(repository, workspaceName));
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -21,6 +21,8 @@
import org.exoplatform.services.jcr.core.ExtendedNode;
import org.exoplatform.services.jcr.ext.distribution.DataDistributionType;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.util.List;
import java.util.Map;
@@ -40,6 +42,10 @@
*/
public abstract class AbstractDataDistributionType implements DataDistributionType
{
+
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.ext.distribution.impl.AbstractDataDistributionType");
+
/**
* The default node type to use when we create a new node
*/
@@ -95,7 +101,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
// The node could not be found so we need to create it
Node node = rootNode;
@@ -110,7 +120,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
// The node doesn't exist we need to create it
node = createNode(node, nodeName, nodeType, mixinTypes, permissions, i == length - 1, true);
@@ -134,7 +148,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
finally
{
@@ -186,7 +204,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
boolean useParameters = !useParametersOnLeafOnly() || (useParametersOnLeafOnly() && isLeaf);
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -53,7 +53,7 @@
public class NodeHierarchyCreatorImpl implements NodeHierarchyCreator, Startable
{
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.NodeHierarchyCreatorImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.NodeHierarchyCreatorImpl");
private static final String USERS_PATH = "usersPath";
@@ -102,7 +102,7 @@
if (PropertyManager.isDevelopping() && !oldDistribution)
{
- log.info("The NodeHierarchyCreator is configured to use the new distribution mechanism for the"
+ LOG.info("The NodeHierarchyCreator is configured to use the new distribution mechanism for the"
+ " users directories, if you prefer to use the old mechanism set the value parameter "
+ "'old-user-distribution' to 'true'.");
}
@@ -119,7 +119,7 @@
}
catch (Exception e)
{
- log.error("An error occurs while processing the plugins", e);
+ LOG.error("An error occurs while processing the plugins", e);
}
if (isNeededToMigrate())
@@ -130,7 +130,7 @@
}
catch (RepositoryException e)
{
- log.error("An error occurs while upgrading JCR structure", e);
+ LOG.error("An error occurs while upgrading JCR structure", e);
}
}
}
@@ -210,7 +210,7 @@
}
catch (Exception e)
{
- log.error("An error occurs while processing the JCR path which alias is "
+ LOG.error("An error occurs while processing the JCR path which alias is "
+ (currentjcrPath == null ? null : currentjcrPath.getAlias()) + " with the workspace "
+ workspaceName, e);
}
@@ -270,7 +270,7 @@
}
catch (Exception e)
{
- log.error("An error occurs while processing the JCR path which alias is "
+ LOG.error("An error occurs while processing the JCR path which alias is "
+ (currentjcrPath == null ? null : currentjcrPath.getAlias()) + " with the workspace "
+ workspaceName, e);
}
@@ -339,7 +339,10 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -114,7 +114,9 @@
(DocumentReaderService)((ExoContainer)ctx.get("exocontainer"))
.getComponentInstanceOfType(DocumentReaderService.class);
if (readerService == null)
- throw new NullPointerException("No DocumentReaderService configured for current container");
+ {
+ throw new IllegalArgumentException("No DocumentReaderService configured for current container");
+ }
Properties props = new Properties();
try
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -500,7 +500,10 @@
}
catch (RepositoryException e)
{
- //ok - repository does not exists
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// check does this repository name already reserved, otherwise generate and return token
@@ -717,7 +720,10 @@
}
catch (NameNotFoundException e)
{
- // skip this exception
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (NamingException e)
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -152,17 +152,20 @@
try
{
if (isSystem)
+ {
node.getSession().exportSystemView(node.getPath(), pout, false, false);
+ }
else
+ {
node.getSession().exportDocumentView(node.getPath(), pout, false, false);
+ }
}
catch (Exception e)
{
- /*
- * Nothing to do. Can give exception if nothing read from stream,
- * this exception generated by
- * XMLStreamWriterImpl#writeStartDocument.
- */
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
finally
{
@@ -173,6 +176,10 @@
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.ext.resource;
import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
import java.io.InputStream;
@@ -35,6 +37,8 @@
public class JcrURLConnection extends URLConnection
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.ext.resource.JcrURLConnection");
+
private SessionProvider sessionProvider;
private NodeRepresentationService nodeRepresentationService;
@@ -183,13 +187,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return nodeRepresentation.getMediaType();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -204,13 +213,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return (int)nodeRepresentation.getContentLenght();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return -1;
}
@@ -237,13 +251,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return nodeRepresentation.getContentEncoding();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -258,13 +277,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return nodeRepresentation.getLastModified();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return 0;
}
@@ -335,9 +359,12 @@
sessionProvider.close();
}
}
- catch (Throwable t)
+ catch (Exception t)
{
- ;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + t.getMessage());
+ }
}
finally
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -21,6 +21,8 @@
import org.exoplatform.common.util.HierarchicalProperty;
import org.exoplatform.services.jcr.core.ExtendedSession;
import org.exoplatform.services.jcr.ext.resource.NodeRepresentation;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
import java.io.InputStream;
@@ -42,6 +44,9 @@
public class NtFileNodeRepresentation implements NodeRepresentation
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.ext.resource.representation.NtFileNodeRepresentation");
+
private Node node;
private NodeRepresentation content;
@@ -191,8 +196,10 @@
}
catch (PathNotFoundException e)
{
- //e.printStackTrace();
- //return null;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return props;
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -40,7 +40,7 @@
public class CmdMkd extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdMkd");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdMkd");
public CmdMkd()
{
@@ -103,10 +103,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, srcPath));
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -19,6 +19,8 @@
package org.exoplatform.services.ftp.command;
import org.exoplatform.services.ftp.FtpConst;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
@@ -31,6 +33,8 @@
public class CmdRest extends FtpCommandImpl
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.ftp.command.CmdRest");
+
public CmdRest()
{
commandName = FtpConst.Commands.CMD_REST;
@@ -53,6 +57,10 @@
}
catch (Exception exc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
reply(String.format(FtpConst.Replyes.REPLY_500, FtpConst.Commands.CMD_REST));
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -42,7 +42,7 @@
public class CmdRetr extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRetr");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRetr");
public CmdRetr()
{
@@ -142,7 +142,7 @@
}
catch (Throwable exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
clientSession().closeDataTransiver();
@@ -172,13 +172,21 @@
}
catch (PathNotFoundException exc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Throwable exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return false;
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -37,7 +37,7 @@
public class CmdRnFr extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnFr");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnFr");
public CmdRnFr()
{
@@ -72,10 +72,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, resName));
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -39,7 +39,7 @@
public class CmdRnTo extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnTo");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnTo");
public CmdRnTo()
{
@@ -101,13 +101,21 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exceprion. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exceprion. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, pathName));
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -39,7 +39,7 @@
public class CmdSize extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdSize");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdSize");
public CmdSize()
{
@@ -79,13 +79,21 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550_SIZE, resName));
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -49,7 +49,7 @@
public class CmdStor extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdStor");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdStor");
public CmdStor()
{
@@ -74,7 +74,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
if (params.length < 2)
@@ -219,7 +219,7 @@
}
catch (Exception exc)
{
- log.info("Failurinc closing input stream");
+ LOG.info("Failurinc closing input stream");
}
if (cacheFileName != null)
@@ -238,10 +238,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
clientSession().closeDataTransiver();
@@ -261,10 +265,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return null;
}
@@ -308,10 +316,14 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return null;
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -48,7 +48,7 @@
public abstract class FtpCommandImpl implements FtpCommand
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "FtpCommandImpl");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "FtpCommandImpl");
protected boolean isNeedLogin = true;
@@ -154,7 +154,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
return null;
}
return files;
@@ -178,13 +178,21 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, resName));
}
@@ -235,7 +243,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
FtpSystemCoder systemCoder =
@@ -273,8 +281,8 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage());
- log.info("Data transmit failed.");
+ LOG.info("Unhandled exception. " + exc.getMessage());
+ LOG.info("Data transmit failed.");
}
reply(FtpConst.Replyes.REPLY_226);
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -20,6 +20,8 @@
import org.exoplatform.common.util.HierarchicalProperty;
import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.net.URI;
import java.util.HashSet;
@@ -41,6 +43,8 @@
public abstract class GenericResource implements Resource
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.webdav.resource.GenericResource");
+
/**
* Resource identifier.
*/
@@ -113,6 +117,10 @@
}
catch (Exception exc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
}
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.frameworks.jcr.cli;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;
@@ -32,6 +35,8 @@
public class HelpCommand extends AbstractCliCommand
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.frameworks.jcr.cli.HelpCommand");
+
private TreeMap<String, String> map = new TreeMap<String, String>();
private final int WORD_LENGTH = 15;
@@ -79,7 +84,10 @@
}
catch (Exception e)
{
- // no parameters found
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (findHelpCommand != null)
{
Modified: jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java
===================================================================
--- jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
+++ jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java 2012-01-27 14:09:27 UTC (rev 5537)
@@ -39,7 +39,7 @@
public class FtpDataTransiverImpl implements FtpDataTransiver
{
- private static Log log = ExoLogger.getLogger("exo.jcr.framework.command.FtpDataTransiverImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.framework.command.FtpDataTransiverImpl");
protected Socket dataSocket = null;
@@ -65,7 +65,7 @@
}
catch (Exception exc)
{
- log.info("Can't open active mode. PORT is busy. " + exc.getMessage(), exc);
+ LOG.info("Can't open active mode. PORT is busy. " + exc.getMessage(), exc);
}
return false;
}
@@ -94,7 +94,7 @@
}
catch (Exception exc)
{
- log.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
+ LOG.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
}
}
@@ -123,11 +123,14 @@
}
catch (SocketException exc)
{
- // ..
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
catch (Exception exc)
{
- log.error(exc.getLocalizedMessage(), exc);
+ LOG.error(exc.getLocalizedMessage(), exc);
}
try
@@ -139,7 +142,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return outStream.toByteArray();
@@ -157,7 +160,7 @@
}
catch (Exception exc)
{
- log.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
+ LOG.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
}
}
return false;
12 years, 3 months
exo-jcr SVN: r5536 - in ws/branches/2.3.x/exo.ws.frameworks.json/src: main/java/org/exoplatform/ws/frameworks/json/value/impl and 1 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 06:49:43 -0500 (Fri, 27 Jan 2012)
New Revision: 5536
Modified:
ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java
ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/value/impl/ObjectValue.java
ws/branches/2.3.x/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java
Log:
EXOJCR-1714: fixed REST keep entries order in returned Map instance objects
Modified: ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java
===================================================================
--- ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java 2012-01-27 09:03:12 UTC (rev 5535)
+++ ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java 2012-01-27 11:49:43 UTC (rev 5536)
@@ -39,7 +39,6 @@
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -356,7 +355,8 @@
}
case MAP :
JsonValue jsonObject = new ObjectValue();
- Map<String, Object> map = new HashMap<String, Object>((Map<String, Object>)object);
+
+ Map<String, Object> map = (Map<String, Object>)object;
Set<String> keys = map.keySet();
for (String k : keys)
{
Modified: ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/value/impl/ObjectValue.java
===================================================================
--- ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/value/impl/ObjectValue.java 2012-01-27 09:03:12 UTC (rev 5535)
+++ ws/branches/2.3.x/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/value/impl/ObjectValue.java 2012-01-27 11:49:43 UTC (rev 5536)
@@ -23,8 +23,8 @@
import org.exoplatform.ws.frameworks.json.impl.JsonUtils;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
-import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -37,7 +37,7 @@
/**
* Children.
*/
- private final Map<String, JsonValue> children = new HashMap<String, JsonValue>();
+ private final Map<String, JsonValue> children = new LinkedHashMap<String, JsonValue>();
/**
* {@inheritDoc}
Modified: ws/branches/2.3.x/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java
===================================================================
--- ws/branches/2.3.x/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java 2012-01-27 09:03:12 UTC (rev 5535)
+++ ws/branches/2.3.x/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java 2012-01-27 11:49:43 UTC (rev 5536)
@@ -34,6 +34,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -115,6 +116,28 @@
//System.out.println(jsonValue);
}
+ public void testMapOrder() throws Exception
+ {
+ Map<String, Book> m = new LinkedHashMap<String, Book>();
+ m.put("junit", junitBook);
+ m.put("csharp", csharpBook);
+ m.put("js", javaScriptBook);
+ JsonValue jsonValue = new JsonGeneratorImpl().createJsonObjectFromMap(m);
+ assertTrue(jsonValue.isObject());
+ Iterator<String> iter = jsonValue.getKeys();
+ String[] array = m.keySet().toArray(new String[0]);
+ // Json iterator and source map must have same order, but we see that
+ // Json is ordered by default
+ int i = 0;
+ while (iter.hasNext())
+ {
+ String key = iter.next();
+ System.out.println("Key:" + key + " , map key:" + array[i]);
+ assertEquals(key, array[i]);
+ i++;
+ }
+ }
+
public void testMapNull() throws Exception
{
Map<String, Book> m = null;
12 years, 3 months
exo-jcr SVN: r5535 - in ws/trunk: exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl and 1 other directory.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 04:03:12 -0500 (Fri, 27 Jan 2012)
New Revision: 5535
Modified:
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java
ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java 2012-01-27 08:58:12 UTC (rev 5534)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java 2012-01-27 09:03:12 UTC (rev 5535)
@@ -304,7 +304,7 @@
/** controls whether modules are allowed to interact with user */
private boolean allowUI;
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.HTTPConnection");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.HTTPConnection");
static
{
@@ -321,8 +321,8 @@
throw new Exception(); // try JDK 1.0.x naming
int port = Integer.getInteger("http.proxyPort", -1).intValue();
- if (log.isDebugEnabled())
- log.debug("using proxy " + host + ":" + port);
+ if (LOG.isDebugEnabled())
+ LOG.debug("using proxy " + host + ":" + port);
setProxyServer(host, port);
}
@@ -336,8 +336,8 @@
String host = PrivilegedSystemHelper.getProperty("proxyHost");
int port = Integer.getInteger("proxyPort", -1).intValue();
- if (log.isDebugEnabled())
- log.debug("using proxy " + host + ":" + port);
+ if (LOG.isDebugEnabled())
+ LOG.debug("using proxy " + host + ":" + port);
setProxyServer(host, port);
}
@@ -362,6 +362,10 @@
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
/*
@@ -378,8 +382,8 @@
int port = Integer.getInteger("HTTPClient.socksPort", -1).intValue();
int version = Integer.getInteger("HTTPClient.socksVersion", -1).intValue();
- if (log.isDebugEnabled())
- log.debug("using SOCKS " + host + ":" + port);
+ if (LOG.isDebugEnabled())
+ LOG.debug("using SOCKS " + host + ":" + port);
if (version == -1)
setSocksServer(host, port);
@@ -431,8 +435,8 @@
String mname = list[idx];
DefaultModuleList.addElement(Class.forName(mname));
- if (log.isDebugEnabled())
- log.debug("added module " + list[idx]);
+ if (LOG.isDebugEnabled())
+ LOG.debug("added module " + list[idx]);
}
catch (ClassNotFoundException cnfe)
@@ -457,14 +461,17 @@
neverPipeline = Boolean.getBoolean("HTTPClient.disable_pipelining");
if (neverPipeline)
{
- if (log.isDebugEnabled())
- log.debug("disabling pipelining");
+ if (LOG.isDebugEnabled())
+ LOG.debug("disabling pipelining");
}
}
catch (Exception e)
{
- // nothing to do
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
/*
@@ -475,14 +482,17 @@
noKeepAlives = Boolean.getBoolean("HTTPClient.disableKeepAlives");
if (noKeepAlives)
{
- if (log.isDebugEnabled())
- log.debug("disabling keep-alives");
+ if (LOG.isDebugEnabled())
+ LOG.debug("disabling keep-alives");
}
}
catch (Exception e)
{
- // notning to do
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
/*
@@ -493,13 +503,17 @@
force_1_0 = Boolean.getBoolean("HTTPClient.forceHTTP_1.0");
if (force_1_0)
{
- if (log.isDebugEnabled())
- log.debug("forcing HTTP/1.0 requests");
+ if (LOG.isDebugEnabled())
+ LOG.debug("forcing HTTP/1.0 requests");
}
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
/*
@@ -510,13 +524,17 @@
no_chunked = Boolean.getBoolean("HTTPClient.dontChunkRequests");
if (no_chunked)
{
- if (log.isDebugEnabled())
- log.debug("never chunking requests");
+ if (LOG.isDebugEnabled())
+ LOG.debug("never chunking requests");
}
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
/*
@@ -529,13 +547,17 @@
haveMSLargeWritesBug = true;
if (haveMSLargeWritesBug)
{
- if (log.isDebugEnabled())
- log.debug("splitting large writes into 20K chunks (M$ bug)");
+ if (LOG.isDebugEnabled())
+ LOG.debug("splitting large writes into 20K chunks (M$ bug)");
}
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
/*
@@ -549,13 +571,17 @@
deferStreamed = Boolean.getBoolean("HTTPClient.deferStreamed");
if (deferStreamed)
{
- if (log.isDebugEnabled())
- log.debug("enabling defered handling of responses to streamed requests");
+ if (LOG.isDebugEnabled())
+ LOG.debug("enabling defered handling of responses to streamed requests");
}
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
@@ -1478,7 +1504,7 @@
}
catch (XMLStreamException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
throw new IOException("Can't write XML data to output stream.");
}
return response;
@@ -1600,7 +1626,7 @@
}
catch (XMLStreamException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
throw new IOException("Can't write XML data to output stream.");
}
return response;
@@ -1657,7 +1683,7 @@
}
catch (XMLStreamException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
throw new IOException("Can't write XML request.");
}
finally
@@ -1930,6 +1956,10 @@
}
catch (ClassNotFoundException cnfe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + cnfe.getMessage());
+ }
}
}
}
@@ -2183,9 +2213,9 @@
list.insertElementAt(module, pos);
}
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Added module " + module.getName() + " to " + ((list == DefaultModuleList) ? "default " : "") //NOSONAR
+ LOG.debug("Added module " + module.getName() + " to " + ((list == DefaultModuleList) ? "default " : "") //NOSONAR
+ "list");
}
@@ -2200,9 +2230,9 @@
boolean removed = list.removeElement(module);
if (removed)
{
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Removed module " + module.getName() + " from " + ((list == DefaultModuleList) ? "default " : "") //NOSONAR
+ LOG.debug("Removed module " + module.getName() + " from " + ((list == DefaultModuleList) ? "default " : "") //NOSONAR
+ "list");
}
}
@@ -2518,7 +2548,10 @@
}
catch (ParseException pe)
{
- // ignore it
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pe.getMessage());
+ }
}
}
}
@@ -3007,27 +3040,25 @@
if (early_stall != null)
{
- try
+ if (LOG.isDebugEnabled())
+ LOG.debug("Early-stalling Request: " + req.getMethod() + " " + req.getRequestURI());
+
+ synchronized (early_stall)
{
- if (log.isDebugEnabled())
- log.debug("Early-stalling Request: " + req.getMethod() + " " + req.getRequestURI());
-
- synchronized (early_stall)
+ // wait till the response is received
+ try
{
- // wait till the response is received
- try
+ early_stall.getVersion();
+ }
+ catch (IOException ioe)
+ {
+ if (LOG.isTraceEnabled())
{
- early_stall.getVersion();
+ LOG.trace("An exception occurred: " + ioe.getMessage());
}
- catch (IOException ioe)
- {
- }
- early_stall = null;
}
+ early_stall = null;
}
- catch (NullPointerException npe)
- {
- }
}
String[] con_hdrs = assembleHeaders(req, hdr_buf);
@@ -3058,8 +3089,8 @@
{
if (input_demux != null || keepAliveUnknown)
{
- if (log.isDebugEnabled())
- log.debug("Stalling Request: " + req.getMethod() + " " + req.getRequestURI());
+ if (LOG.isDebugEnabled())
+ LOG.debug("Stalling Request: " + req.getMethod() + " " + req.getRequestURI());
try
// wait till the response is received
@@ -3070,6 +3101,10 @@
}
catch (IOException ioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
}
@@ -3086,8 +3121,8 @@
if ((req.getMethod().equals("POST") || req.dont_pipeline) && prev_resp != null && input_demux != null)
{
- if (log.isDebugEnabled())
- log.debug("Stalling Request: " + req.getMethod() + " " + req.getRequestURI());
+ if (LOG.isDebugEnabled())
+ LOG.debug("Stalling Request: " + req.getMethod() + " " + req.getRequestURI());
try
// wait till the response is received
@@ -3096,6 +3131,10 @@
}
catch (IOException ioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
}
@@ -3164,8 +3203,8 @@
if (req.aborted)
throw new IOException("Request aborted by user");
- if (log.isDebugEnabled())
- log.debug("Sending Request");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Sending Request");
// Send headers
@@ -3194,6 +3233,10 @@
}
catch (InterruptedIOException iioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + iioe.getMessage());
+ }
}
finally
{
@@ -3249,7 +3292,7 @@
catch (IOException ioe)
{
- log.error("Send request error", ioe);
+ LOG.error("Send request error", ioe);
closeDemux(ioe, true);
@@ -3257,7 +3300,7 @@
|| ioe instanceof NoRouteToHostException || ioe instanceof InterruptedIOException || req.aborted)
throw ioe;
- log.info("Retrying request");
+ LOG.info("Retrying request");
continue;
}
@@ -3278,8 +3321,8 @@
if (keepAliveReqMax != -1)
- if (log.isDebugEnabled())
- log.debug("Number of requests left: " + keepAliveReqLeft);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Number of requests left: " + keepAliveReqLeft);
/*
* We don't pipeline the first request, as we need some info about the
@@ -3325,8 +3368,8 @@
}
// Looks like were finally done
- if (log.isDebugEnabled())
- log.debug("Request sent");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Request sent");
}
return resp;
@@ -3357,8 +3400,8 @@
actual_port = Port;
}
- if (log.isDebugEnabled())
- log.debug("Creating Socket: " + actual_host + ":" + actual_port);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Creating Socket: " + actual_host + ":" + actual_port);
if (con_timeout == 0) // normal connection establishment
{
@@ -3455,8 +3498,8 @@
hdr_buf.reset();
assembleHeaders(connect, hdr_buf);
- if (log.isDebugEnabled())
- log.debug("Sending SSL-Tunneling Subrequest");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Sending SSL-Tunneling Subrequest");
// send CONNECT
@@ -3478,6 +3521,10 @@
}
catch (IOException ioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
try
{
@@ -3485,6 +3532,10 @@
}
catch (IOException ioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
// handle response
@@ -3820,8 +3871,8 @@
{
doesKeepAlive = true;
keepAliveUnknown = false;
- if (log.isDebugEnabled())
- log.debug("Keep-Alive enabled");
+ if (LOG.isDebugEnabled())
+ LOG.debug("Keep-Alive enabled");
}
else if (resp.getStatusCode() < 400)
@@ -3837,19 +3888,31 @@
keepAliveReqMax = Integer.parseInt(max.getValue());
keepAliveReqLeft = keepAliveReqMax;
- if (log.isDebugEnabled())
- log.debug("Max Keep-Alive requests: " + keepAliveReqMax);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Max Keep-Alive requests: " + keepAliveReqMax);
}
}
}
catch (ParseException pe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pe.getMessage());
+ }
}
catch (NumberFormatException nfe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + nfe.getMessage());
+ }
}
catch (ClassCastException cce)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + cce.getMessage());
+ }
}
}
@@ -3914,6 +3977,10 @@
}
catch (SecurityException se)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + se.getMessage());
+ }
} // Oh well...
actual_host = host;
@@ -3967,6 +4034,10 @@
}
catch (IOException ioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
sock = null;
}
Modified: ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java
===================================================================
--- ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java 2012-01-27 08:58:12 UTC (rev 5534)
+++ ws/trunk/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HttpURLConnection.java 2012-01-27 09:03:12 UTC (rev 5535)
@@ -144,7 +144,7 @@
/** the output stream used for POST and PUT */
private OutputStream output_stream;
- private static final Log log = ExoLogger.getLogger("exo.ws.commons.HttpURLConnection");
+ private static final Log LOG = ExoLogger.getLogger("exo.ws.commons.HttpURLConnection");
static
{
@@ -157,6 +157,10 @@
}
catch (SecurityException se)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + se.getMessage());
+ }
}
// get the RedirectionModule class
@@ -178,6 +182,10 @@
}
catch (SecurityException se)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + se.getMessage());
+ }
}
}
@@ -219,6 +227,10 @@
}
catch (SecurityException se)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + se.getMessage());
+ }
}
try
@@ -235,6 +247,10 @@
}
catch (SecurityException se)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + se.getMessage());
+ }
}
// now setup stuff
@@ -292,8 +308,8 @@
if (connected)
throw new ProtocolException("Already connected!");
- if (log.isDebugEnabled())
- log.debug(urlString + " Setting request method: " + method);
+ if (LOG.isDebugEnabled())
+ LOG.debug(urlString + " Setting request method: " + method);
this.method = method.trim().toUpperCase();
method_set = true;
@@ -588,8 +604,8 @@
if (output_stream == null)
{
- if (log.isDebugEnabled())
- log.debug(urlString + " creating output stream");
+ if (LOG.isDebugEnabled())
+ LOG.debug(urlString + " creating output stream");
String cl = getRequestProperty("Content-Length");
if (cl != null)
@@ -656,8 +672,8 @@
public void setRequestProperty(String name, String value)
{
- if (log.isDebugEnabled())
- log.debug(urlString + " Setting request property: " + name + " : " + value);
+ if (LOG.isDebugEnabled())
+ LOG.debug(urlString + " Setting request property: " + name + " : " + value);
int idx;
for (idx = 0; idx < headers.length; idx++)
@@ -697,8 +713,8 @@
*/
public static void setDefaultRequestProperty(String name, String value)
{
- if (log.isDebugEnabled())
- log.debug("Setting default request property: " + name + " : " + value);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Setting default request property: " + name + " : " + value);
int idx;
for (idx = 0; idx < default_headers.length; idx++)
@@ -763,8 +779,8 @@
if (connected)
return;
- if (log.isDebugEnabled())
- log.debug(urlString + " Connecting ...");
+ if (LOG.isDebugEnabled())
+ LOG.debug(urlString + " Connecting ...");
// useCaches TBD!!!
@@ -799,8 +815,8 @@
@Override
public void disconnect()
{
- if (log.isDebugEnabled())
- log.debug(urlString + " Disconnecting ...");
+ if (LOG.isDebugEnabled())
+ LOG.debug(urlString + " Disconnecting ...");
con.stop();
}
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java 2012-01-27 08:58:12 UTC (rev 5534)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java 2012-01-27 09:03:12 UTC (rev 5535)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.ws.frameworks.json.impl;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
@@ -43,6 +45,9 @@
*/
public class ObjectBuilder
{
+
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.ws.frameworks.json.impl.ObjectBuilder");
+
static final Collection<String> SKIP_METHODS = new HashSet<String>();
static
{
@@ -173,7 +178,10 @@
}
catch (Exception e2)
{
- // ignore exception here
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e2.getMessage());
+ }
}
}
}
@@ -282,7 +290,10 @@
}
catch (Exception e2)
{
- // ignore exception here
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e2.getMessage());
+ }
}
}
}
12 years, 3 months
exo-jcr SVN: r5534 - ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 03:58:12 -0500 (Fri, 27 Jan 2012)
New Revision: 5534
Modified:
ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java
===================================================================
--- ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java 2012-01-27 08:57:50 UTC (rev 5533)
+++ ws/branches/2.3.x/exo.ws.commons/src/main/java/org/exoplatform/common/http/client/HTTPConnection.java 2012-01-27 08:58:12 UTC (rev 5534)
@@ -3086,6 +3086,10 @@
}
catch (IOException ioe)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
early_stall = null;
}
12 years, 3 months
exo-jcr SVN: r5533 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 03:57:50 -0500 (Fri, 27 Jan 2012)
New Revision: 5533
Modified:
kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java
===================================================================
--- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java 2012-01-27 08:50:35 UTC (rev 5532)
+++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java 2012-01-27 08:57:50 UTC (rev 5533)
@@ -838,14 +838,19 @@
*/
private static String getValueParam(InitParams params, String parameterKey)
{
- try
+ if (params != null)
{
- return params.getValueParam(parameterKey).getValue().trim();
+ ValueParam parameterKeyValue = params.getValueParam(parameterKey);
+ if (parameterKeyValue != null)
+ {
+ String parameterKeyValueString = parameterKeyValue.getValue();
+ if (parameterKeyValueString != null)
+ {
+ return parameterKeyValueString.trim();
+ }
+ }
}
- catch (NullPointerException e)
- {
- return null;
- }
+ return null;
}
/**
12 years, 3 months
exo-jcr SVN: r5532 - kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 03:50:35 -0500 (Fri, 27 Jan 2012)
New Revision: 5532
Modified:
kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java 2012-01-27 08:50:00 UTC (rev 5531)
+++ kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl/AbstractRPCService.java 2012-01-27 08:50:35 UTC (rev 5532)
@@ -844,14 +844,19 @@
*/
private static String getValueParam(InitParams params, String parameterKey)
{
- try
+ if (params != null)
{
- return params.getValueParam(parameterKey).getValue().trim();
+ ValueParam parameterKeyValue = params.getValueParam(parameterKey);
+ if (parameterKeyValue != null)
+ {
+ String parameterKeyValueString = parameterKeyValue.getValue();
+ if (parameterKeyValueString != null)
+ {
+ return parameterKeyValueString.trim();
+ }
+ }
}
- catch (NullPointerException e)
- {
- return null;
- }
+ return null;
}
/**
12 years, 3 months
exo-jcr SVN: r5531 - core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 03:50:00 -0500 (Fri, 27 Jan 2012)
New Revision: 5531
Modified:
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2012-01-27 08:50:00 UTC (rev 5531)
@@ -32,6 +32,7 @@
import org.exoplatform.services.database.ObjectQuery;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
@@ -340,9 +341,11 @@
{
session.close();
if (log_.isDebugEnabled())
+ {
log_.debug("close hibernate session in openSession(Session session)");
+ }
}
- catch (Throwable t)
+ catch (HibernateException t)
{
log_.error("Error closing hibernate session : " + t.getMessage(), t);
}
12 years, 3 months
exo-jcr SVN: r5530 - in jcr/branches/1.15.x: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype and 47 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-27 03:26:44 -0500 (Fri, 27 Jan 2012)
New Revision: 5530
Modified:
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanerTool.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/scripts/DBCleaningScripts.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java
jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java
jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.config;
import org.exoplatform.services.jcr.util.StringNumberParser;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.util.ArrayList;
import java.util.List;
@@ -33,6 +35,9 @@
public abstract class MappedParametrizedObjectEntry
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.config.MappedParametrizedObjectEntry");
+
protected String type;
protected List<SimpleParameterEntry> parameters = new ArrayList<SimpleParameterEntry>();
@@ -129,7 +134,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable Integer. " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -199,7 +207,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable Long. " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -248,7 +259,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable Long. " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -298,7 +312,10 @@
}
catch (NumberFormatException e)
{
- //LOG.warn(name + ": unparseable time (as Long). " + e);
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/OnParentVersionActionConversion.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.services.jcr.core.nodetype;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import javax.jcr.version.OnParentVersionAction;
/**
@@ -28,6 +31,9 @@
public class OnParentVersionActionConversion
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.core.nodetype.OnParentVersionActionConversion");
+
public static String serializeType(int propertyType)
{
@@ -39,10 +45,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
@@ -58,10 +72,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/PropertyTypeConversion.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.core.nodetype;
import org.exoplatform.services.jcr.core.ExtendedPropertyType;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import javax.jcr.PropertyType;
@@ -30,6 +32,9 @@
public class PropertyTypeConversion
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.core.nodetype.PropertyTypeConversion");
+
public static String serializeType(int propertyType)
{
@@ -41,10 +46,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
@@ -60,10 +73,18 @@
catch (IllegalArgumentException e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// r = PropertyType.TYPENAME_UNDEFINED;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return r;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -23,6 +23,8 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.Externalizable;
import java.io.IOException;
@@ -40,6 +42,8 @@
public class TransactionChangesLog implements CompositeChangesLog, Externalizable
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.dataflow.TransactionChangesLog");
+
private static final long serialVersionUID = 4866736965040228027L;
protected String systemId;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -319,7 +319,7 @@
catch (ClassNotFoundException e)
{
log.warn("Workspace cache class not found " + wsConfig.getCache().getType()
- + ", will use default. Error : " + e);
+ + ", will use default. Error : " + e.getMessage());
workspaceContainer.registerComponentImplementation(LinkedWorkspaceStorageCacheImpl.class);
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositorySuspendController.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -69,7 +69,7 @@
}
catch (RepositoryException e)
{
- log.error(e);
+ log.error("An exception occured: " + e.getMessage());
}
return getRepositoryStateTitle();
}
@@ -89,7 +89,7 @@
}
catch (RepositoryException e)
{
- log.error(e);
+ log.error("An exception occured: " + e.getMessage());
}
return getRepositoryStateTitle();
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JCRRestore.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -36,6 +36,8 @@
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
import org.exoplatform.services.jcr.observation.ExtendedEvent;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.EOFException;
import java.io.Externalizable;
@@ -70,6 +72,8 @@
public class JCRRestore
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.impl.backup.JCRRestore");
+
private final DataManager dataManager;
private final FileCleaner fileCleaner;
@@ -181,7 +185,10 @@
}
catch (EOFException ioe)
{
- // ok - reading all data from backup file;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ioe.getMessage());
+ }
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanerTool.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanerTool.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanerTool.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -192,7 +192,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement." + e);
+ LOG.error("Can't close the Statement." + e.getMessage());
}
// restore previous auto commit mode
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/scripts/DBCleaningScripts.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/scripts/DBCleaningScripts.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/scripts/DBCleaningScripts.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -28,6 +28,8 @@
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerHelper;
+import java.io.FileNotFoundException;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -293,10 +295,18 @@
{
script = IOUtil.getStreamContentAsString(PrivilegedFileHelper.getResourceAsStream(scriptPath));
}
- catch (Throwable e)
+ catch (FileNotFoundException e)
{
throw new DBCleanException(e);
}
+ catch (IllegalArgumentException e)
+ {
+ throw new DBCleanException(e);
+ }
+ catch (IOException e)
+ {
+ throw new DBCleanException(e);
+ }
List<String> scripts = new ArrayList<String>();
for (String query : JDBCUtils.splitWithSQLDelimiter(script))
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -271,7 +271,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -283,7 +283,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -347,7 +347,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -359,7 +359,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -449,7 +449,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
con.close();
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -83,7 +83,7 @@
/**
* Logger.
*/
- private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ItemImpl");
/**
* Session object.
@@ -283,7 +283,7 @@
}
catch (Exception e)
{
- log.debug("Item.isSame() failed " + e);
+ LOG.debug("Item.isSame() failed " + e.getMessage());
return false;
}
}
@@ -572,9 +572,9 @@
}
else
{
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Set null value (" + getPath() + ", multivalued: " + multiValue + ")");
+ LOG.debug("Set null value (" + getPath() + ", multivalued: " + multiValue + ")");
}
}
}
@@ -1006,9 +1006,9 @@
strVal = "PropertyType.BINARY";
}
}
- catch (Throwable e)
+ catch (IOException e)
{
- log.error("Error of value read: " + e.getMessage(), e);
+ LOG.error("Error of value read: " + e.getMessage(), e);
}
throw new ConstraintViolationException("Can not set value '" + strVal + "' to " + getPath()
+ " due to value constraints ");
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -3088,6 +3088,10 @@
}
catch (RepositoryException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return false;
}
@@ -3313,7 +3317,7 @@
}
catch (RepositoryException e)
{
- LOG.error(e);
+ LOG.error("An exception occured: " + e.getMessage());
throw new NoSuchElementException(e.toString());
}
}
@@ -3377,7 +3381,7 @@
}
catch (RepositoryException e)
{
- LOG.error(e);
+ LOG.error("An exception occured: " + e.getMessage());
throw new NoSuchElementException(e.toString());
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionFactory.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -43,7 +43,7 @@
public class SessionFactory
{
- private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.SessionFactory");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.SessionFactory");
private final ExoContainer container;
@@ -76,7 +76,10 @@
}
catch (NumberFormatException e)
{
- //
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (maxAgeMillis <= 0)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -110,7 +110,7 @@
/**
* Logger.
*/
- private static Log log = ExoLogger.getLogger("exo.jcr.component.core.SessionImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.SessionImpl");
/**
* Indicates if it must fail in case we use a closed session.
@@ -125,11 +125,11 @@
{
if (!ALLOW_CLOSED_SESSION_USAGE)
{
- log.info("The JCR will throw an exception anytime we will try to use a dead session.");
+ LOG.info("The JCR will throw an exception anytime we will try to use a dead session.");
}
if (FORCE_USE_GET_NODES_LAZILY)
{
- log.warn("EXPERIMENTAL! The JCR will use ExtendedNode.getNodesLazily() for each Node.getNodes() "
+ LOG.warn("EXPERIMENTAL! The JCR will use ExtendedNode.getNodesLazily() for each Node.getNodes() "
+ "invocation. This is an experimental feauture and should be used with care.");
}
}
@@ -947,6 +947,10 @@
}
catch (RepositoryException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return false;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -200,7 +200,10 @@
}
catch (LockException e)
{
- // ignore me will never occur
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return -1;
}
@@ -216,7 +219,10 @@
}
catch (LockException e)
{
- // ignore me will never occur
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return true;
}
@@ -232,7 +238,10 @@
}
catch (LockException e)
{
- // ignore me will never occur
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return false;
}
@@ -256,7 +265,10 @@
}
catch (LockException e)
{
- // ignore me will never occur
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return false;
}
@@ -272,7 +284,10 @@
}
catch (LockException e)
{
- // ignore me will never occur
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -288,7 +303,10 @@
}
catch (LockException e)
{
- // ignore me will never occur
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -39,6 +39,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -334,10 +335,14 @@
strVal = "PropertyType.BINARY";
}
}
- catch (Throwable e)
+ catch (IllegalStateException e)
{
LOG.error("Error of value read: " + e.getMessage(), e);
}
+ catch (IOException e)
+ {
+ LOG.error("Error of value read: " + e.getMessage(), e);
+ }
throw new ConstraintViolationException("Value " + strVal + " for property "
+ propertyData.getQPath().getAsString() + " doesn't match new constraint ");
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -130,7 +130,7 @@
catch (RepositoryException e)
{
log.error("Can not fire ActionLauncher.onSaveItems() for " + item.getQPath().getAsString()
- + " reason: " + e);
+ + " reason: " + e.getMessage());
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ExactQueryNode.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -46,7 +46,7 @@
public ExactQueryNode(QueryNode parent, InternalQName property, InternalQName value) {
super(parent);
if (parent == null) {
- throw new NullPointerException("parent");
+ throw new IllegalArgumentException("parameter parent cannot be null");
}
this.property = property;
this.value = value;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractExcerpt.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -50,7 +50,7 @@
/**
* Logger instance for this class.
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.AbstractExcerpt");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.AbstractExcerpt");
/**
* The search index.
@@ -110,7 +110,7 @@
if (fields == null)
{
- log.debug("Fulltext field not stored, using {}", SimpleExcerptProvider.class.getName());
+ LOG.debug("Fulltext field not stored, using {}", SimpleExcerptProvider.class.getName());
SimpleExcerptProvider exProvider = new SimpleExcerptProvider();
exProvider.init(query, index);
return exProvider.getExcerpt(id, maxFragments, maxFragmentSize);
@@ -157,7 +157,7 @@
}
else
{
- log.debug("No TermPositionVector on Fulltext field.");
+ LOG.debug("No TermPositionVector on Fulltext field.");
return null;
}
}
@@ -286,7 +286,10 @@
}
catch (IOException e)
{
- // should never happen, we are reading from a string
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return new TermPositionVector()
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/CaseTermQuery.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -16,6 +16,14 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.search.FilteredTermEnum;
+import org.apache.lucene.search.MultiTermQuery;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -23,17 +31,14 @@
import java.util.List;
import java.util.Map;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermEnum;
-import org.apache.lucene.search.FilteredTermEnum;
-import org.apache.lucene.search.MultiTermQuery;
-
/**
* <code>CaseTermQuery</code> implements a term query which convert the term
* from the index either to upper or lower case before it is matched.
*/
-abstract class CaseTermQuery extends MultiTermQuery implements TransformConstants {
+abstract class CaseTermQuery extends MultiTermQuery implements TransformConstants
+{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.CaseTermQuery");
/**
* Indicates whether terms from the index should be lower-cased or
@@ -68,7 +73,8 @@
}
- private final class CaseTermEnum extends FilteredTermEnum {
+ private final class CaseTermEnum extends FilteredTermEnum
+ {
private final int nameLength;
@@ -152,7 +158,10 @@
try {
terms.close();
} catch (IOException e) {
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChildAxisQuery.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -60,7 +60,7 @@
/**
* The logger instance for this class.
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.ChildAxisQuery");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.ChildAxisQuery");
/**
* Threshold when children calculation is switched to
@@ -743,7 +743,7 @@
long time = System.currentTimeMillis();
NodeData state = (NodeData)itemMgr.getItemData(uuid);
time = System.currentTimeMillis() - time;
- log.debug("got NodeState with id {} in {} ms.", uuid, new Long(time));
+ LOG.debug("got NodeState with id {} in {} ms.", uuid, new Long(time));
Iterator<NodeData> entries;
if (nameTest != null)
{
@@ -786,7 +786,10 @@
}
catch (RepositoryException e)
{
- // does not exist anymore -> ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return childrenHits;
@@ -833,7 +836,7 @@
public Hits getHits() throws IOException
{
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
@@ -862,10 +865,10 @@
}
}
}
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis() - time;
- log.debug("Filtered hits in {} ms.", new Long(time));
+ LOG.debug("Filtered hits in {} ms.", new Long(time));
}
return childrenHits;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -41,7 +41,7 @@
{
/** Logger instance for this class */
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.DocOrderScoreNodeIterator");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.DocOrderScoreNodeIterator");
/** A node iterator with ordered nodes */
private ScoreNodeIterator orderedNodes;
@@ -173,7 +173,7 @@
return;
}
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
@@ -207,15 +207,18 @@
}
catch (SortFailedException e)
{
- // retry
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
while (invalidIDs.size() > 0);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("" + nodes.length + " node(s) ordered in " + (System.currentTimeMillis() - time) + " ms");
+ LOG.debug("" + nodes.length + " node(s) ordered in " + (System.currentTimeMillis() - time) + " ms");
}
orderedNodes = new ScoreNodeIteratorImpl(nodes);
@@ -329,7 +332,7 @@
}
catch (Exception e)
{
- log.error("Exception while sorting nodes in document order: " + e.toString(), e);
+ LOG.error("Exception while sorting nodes in document order: " + e.toString(), e);
}
// if we get here something went wrong
@@ -337,11 +340,11 @@
if (n1 != null)
invalidIDs.add(n1.getNodeId());
else
- log.warn("Null ScoreNode n1 will not be added into invalid identifiers set");
+ LOG.warn("Null ScoreNode n1 will not be added into invalid identifiers set");
if (n2 != null)
invalidIDs.add(n2.getNodeId());
else
- log.warn("Null ScoreNode n2 will not be added into invalid identifiers set");
+ LOG.warn("Null ScoreNode n2 will not be added into invalid identifiers set");
// terminate sorting
throw new SortFailedException();
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -66,7 +66,7 @@
/**
* The logger instance for this class
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.IndexingConfigurationImpl");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.IndexingConfigurationImpl");
/**
* A namespace resolver for parsing QNames in the configuration.
@@ -120,7 +120,7 @@
{
IndexingRule element = new IndexingRule(configNode);
// register under node type and all its sub types
- log.debug("Found rule '{}' for NodeType '{}'", element, element.getNodeTypeName());
+ LOG.debug("Found rule '{}' for NodeType '{}'", element, element.getNodeTypeName());
Set<InternalQName> subs = ntReg.getSubtypes(element.getNodeTypeName());
subs.add(element.getNodeTypeName());
for (InternalQName subTypeName : subs)
@@ -131,7 +131,7 @@
perNtConfig = new ArrayList<IndexingRule>();
configElements.put(subTypeName, perNtConfig);
}
- log.debug("Registering it for name '{}'", subTypeName);
+ LOG.debug("Registering it for name '{}'", subTypeName);
perNtConfig.add(new IndexingRule(element, subTypeName));
}
@@ -155,7 +155,7 @@
Class<?> clazz = ClassLoading.forName(analyzerClassName, this);
if (clazz == JcrStandartAnalyzer.class)
{
- log.warn("Not allowed to configure " + JcrStandartAnalyzer.class.getName()
+ LOG.warn("Not allowed to configure " + JcrStandartAnalyzer.class.getName()
+ " for a property. " + "Using default analyzer for that property.");
}
else if (Analyzer.class.isAssignableFrom(clazz))
@@ -180,7 +180,7 @@
Object prevAnalyzer = analyzers.put(fieldName, analyzer);
if (prevAnalyzer != null)
{
- log.warn("Property " + propName.getName()
+ LOG.warn("Property " + propName.getName()
+ " has been configured for multiple analyzers. "
+ " Last configured analyzer is used");
}
@@ -189,13 +189,13 @@
}
else
{
- log.warn("org.apache.lucene.analysis.Analyzer is not a superclass of " + analyzerClassName
+ LOG.warn("org.apache.lucene.analysis.Analyzer is not a superclass of " + analyzerClassName
+ ". Ignoring this configure analyzer");
}
}
catch (ClassNotFoundException e)
{
- log.warn("Analyzer class not found: " + analyzerClassName, e);
+ LOG.warn("Analyzer class not found: " + analyzerClassName, e);
}
}
}
@@ -452,7 +452,10 @@
}
catch (NumberFormatException e)
{
- // use default
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
@@ -936,7 +939,10 @@
}
catch (NumberFormatException e)
{
- // return default boost
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return DEFAULT_BOOST;
@@ -1163,13 +1169,13 @@
}
catch (IOException e)
{
- log.error(e.getLocalizedMessage());
+ LOG.error(e.getLocalizedMessage());
}
}
catch (RepositoryException e)
{
- log.error(e.getLocalizedMessage());
+ LOG.error(e.getLocalizedMessage());
}
}
return false;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -20,9 +20,9 @@
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
-import org.apache.lucene.search.BooleanClause.Occur;
import org.exoplatform.commons.utils.ISO8601;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.dataflow.ItemDataConsumer;
@@ -102,7 +102,7 @@
/**
* Logger for this class
*/
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.LuceneQueryBuilder");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.LuceneQueryBuilder");
/**
* Root node of the abstract query tree
@@ -340,7 +340,10 @@
}
catch (RepositoryException e)
{
- // will never happen, prefixes are created when unknown
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return new JcrTermQuery(new Term(FieldNames.PROPERTIES, FieldNames.createNamedValue(field, value)));
}
@@ -495,7 +498,7 @@
}
catch (RepositoryException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
}
return null;
}
@@ -1173,20 +1176,20 @@
{
InternalQName n = session.getLocationFactory().parseJCRName(literal).getInternalName();
values.add(nsMappings.translateName(n));
- log.debug("Coerced " + literal + " into NAME.");
+ LOG.debug("Coerced " + literal + " into NAME.");
}
catch (RepositoryException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
}
}
catch (IllegalNameException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a NAME: " + e.toString());
}
}
break;
@@ -1196,13 +1199,13 @@
{
QPath p = session.getLocationFactory().parseJCRPath(literal).getInternalPath();
values.add(resolver.createJCRPath(p).getAsString(true));
- log.debug("Coerced " + literal + " into PATH.");
+ LOG.debug("Coerced " + literal + " into PATH.");
}
catch (RepositoryException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
}
}
break;
@@ -1212,13 +1215,13 @@
if (c != null)
{
values.add(DateField.timeToString(c.getTimeInMillis()));
- log.debug("Coerced " + literal + " into DATE.");
+ LOG.debug("Coerced " + literal + " into DATE.");
}
else
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a DATE.");
+ LOG.warn("Unable to coerce '" + literal + "' into a DATE.");
}
}
break;
@@ -1228,13 +1231,13 @@
{
double d = Double.parseDouble(literal);
values.add(DoubleField.doubleToString(d));
- log.debug("Coerced " + literal + " into DOUBLE.");
+ LOG.debug("Coerced " + literal + " into DOUBLE.");
}
catch (NumberFormatException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a DOUBLE: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a DOUBLE: " + e.toString());
}
}
break;
@@ -1244,19 +1247,19 @@
{
long l = Long.parseLong(literal);
values.add(LongField.longToString(l));
- log.debug("Coerced " + literal + " into LONG.");
+ LOG.debug("Coerced " + literal + " into LONG.");
}
catch (NumberFormatException e)
{
if (types.length == 1)
{
- log.warn("Unable to coerce '" + literal + "' into a LONG: " + e.toString());
+ LOG.warn("Unable to coerce '" + literal + "' into a LONG: " + e.toString());
}
}
break;
case PropertyType.STRING :
values.add(literal);
- log.debug("Using literal " + literal + " as is.");
+ LOG.debug("Using literal " + literal + " as is.");
break;
}
}
@@ -1274,11 +1277,14 @@
{
QPath p = session.getLocationFactory().parseJCRPath(literal).getInternalPath();
values.add(resolver.createJCRPath(p).getAsString(true));
- log.debug("Coerced " + literal + " into PATH.");
+ LOG.debug("Coerced " + literal + " into PATH.");
}
catch (Exception e)
{
- // not a path
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (XMLChar.isValidName(literal))
@@ -1288,11 +1294,14 @@
{
InternalQName n = session.getLocationFactory().parseJCRName(literal).getInternalName();
values.add(nsMappings.translateName(n));
- log.debug("Coerced " + literal + " into NAME.");
+ LOG.debug("Coerced " + literal + " into NAME.");
}
catch (Exception e)
{
- // not a name
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
if (literal.indexOf(':') > -1)
@@ -1302,7 +1311,7 @@
if (c != null)
{
values.add(DateField.timeToString(c.getTimeInMillis()));
- log.debug("Coerced " + literal + " into DATE.");
+ LOG.debug("Coerced " + literal + " into DATE.");
}
}
else
@@ -1311,7 +1320,7 @@
try
{
values.add(LongField.longToString(Long.parseLong(literal)));
- log.debug("Coerced " + literal + " into LONG.");
+ LOG.debug("Coerced " + literal + " into LONG.");
}
catch (NumberFormatException e)
{
@@ -1320,11 +1329,14 @@
try
{
values.add(DoubleField.doubleToString(Double.parseDouble(literal)));
- log.debug("Coerced " + literal + " into DOUBLE.");
+ LOG.debug("Coerced " + literal + " into DOUBLE.");
}
catch (NumberFormatException e1)
{
- // not a double
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -1333,7 +1345,7 @@
if (values.size() == 0)
{
values.add(literal);
- log.debug("Using literal " + literal + " as is.");
+ LOG.debug("Using literal " + literal + " as is.");
}
return values.toArray(new String[values.size()]);
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllQuery.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -30,16 +30,16 @@
private final String field;
- /**
- * Creates a new <code>MatchAllQuery</code> .
- * <p/>
- *
- * @param field the field name.
- * @throws NullPointerException if <code>field</code> is null.
- */
- MatchAllQuery(String field) throws NullPointerException {
+ /**
+ * Creates a new <code>MatchAllQuery</code> .
+ * <p/>
+ *
+ * @param field the field name.
+ * @throws IllegalArgumentException if <code>field</code> is null.
+ */
+ MatchAllQuery(String field) throws IllegalArgumentException {
if (field == null) {
- throw new NullPointerException("field");
+ throw new IllegalArgumentException("parameter field cannot be null");
}
this.field = field.intern();
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -104,7 +104,7 @@
/**
* The logger instance for this class
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.MultiIndex");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.MultiIndex");
/**
* Names of active persistent index directories.
@@ -322,7 +322,7 @@
// written to disk.
if (!directoryManager.hasDirectory(name))
{
- log.debug("index does not exist anymore: " + name);
+ LOG.debug("index does not exist anymore: " + name);
// move on to next index
continue;
}
@@ -369,6 +369,10 @@
// can't register shutdown hook because
// jvm shutdown sequence has already begun,
// silently ignore...
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -432,7 +436,7 @@
if (doForceReindexing && !indexes.isEmpty())
{
- log.info("Removing stale indexes (" + handler.getContext().getWorkspacePath(true) + ").");
+ LOG.info("Removing stale indexes (" + handler.getContext().getWorkspacePath(true) + ").");
List<PersistentIndex> oldIndexes = new ArrayList<PersistentIndex>(indexes);
for (PersistentIndex persistentIndex : oldIndexes)
@@ -453,7 +457,7 @@
&& handler.getContext().getIndexRecovery() != null && handler.getContext().getRPCService() != null
&& handler.getContext().getRPCService().isCoordinator() == false)
{
- log.info("Retrieving index from coordinator (" + handler.getContext().getWorkspacePath(true) + ")...");
+ LOG.info("Retrieving index from coordinator (" + handler.getContext().getWorkspacePath(true) + ")...");
indexCreated = recoveryIndexFromCoordinator();
if (indexCreated)
@@ -463,7 +467,7 @@
}
else
{
- log.info("Index can'b be retrieved from coordinator now, because it is offline. "
+ LOG.info("Index can'b be retrieved from coordinator now, because it is offline. "
+ "Possibly coordinator node performs reindexing now. Switching to local re-indexing.");
}
}
@@ -474,12 +478,12 @@
{
if (handler.getContext().getRPCService() == null)
{
- log.error("RPC Service is not configured but required for copying the index "
+ LOG.error("RPC Service is not configured but required for copying the index "
+ "from coordinator node. Index will be created by re-indexing.");
}
else if (handler.getContext().getRPCService().isCoordinator() == true)
{
- log.info("Copying the index from coordinator configured, but this node is the "
+ LOG.info("Copying the index from coordinator configured, but this node is the "
+ "only one in a cluster. Index will be created by re-indexing.");
}
}
@@ -507,7 +511,7 @@
}
executeAndLog(new Commit(getTransactionId()));
- log.info("Initial index for {} nodes created ({}).", new Long(count), handler.getContext()
+ LOG.info("Initial index for {} nodes created ({}).", new Long(count), handler.getContext()
.getWorkspacePath(true));
releaseMultiReader();
scheduleFlushTask();
@@ -571,7 +575,7 @@
}
executeAndLog(new Commit(getTransactionId()));
- log.info("Created initial index for {} nodes", new Long(count));
+ LOG.info("Created initial index for {} nodes", new Long(count));
releaseMultiReader();
}
@@ -630,7 +634,7 @@
catch (IOException e)
{
// do not fail if an exception is thrown here
- log.warn("unable to prepare index reader " + "for queries during update", e);
+ LOG.warn("unable to prepare index reader " + "for queries during update", e);
}
}
ReadOnlyIndexReader lastIndexReader = null;
@@ -654,6 +658,10 @@
{
// this is safe index reader retrieval. The last index already closed, possibly merged or
// any other exception that occurs here
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
for (Iterator<Document> it = add.iterator(); it.hasNext();)
@@ -706,7 +714,7 @@
}
catch (Exception e)
{
- log.debug("Some exception occured, during index check");
+ LOG.debug("Some exception occured, during index check");
}
}
}
@@ -760,7 +768,7 @@
catch (IOException e)
{
// do not fail if an exception is thrown here
- log.warn("unable to prepare index reader " + "for queries during update", e);
+ LOG.warn("unable to prepare index reader " + "for queries during update", e);
}
}
@@ -1018,7 +1026,7 @@
}
catch (IOException ex)
{
- log.warn("Exception releasing index reader: " + ex);
+ LOG.warn("Exception releasing index reader: " + ex);
}
(entry.getValue()).resetListener();
}
@@ -1140,15 +1148,15 @@
{
// force initializing of caches
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
index.getReadOnlyIndexReader(true).release();
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis() - time;
- log.debug("hierarchy cache initialized in {} ms", new Long(time));
+ LOG.debug("hierarchy cache initialized in {} ms", new Long(time));
}
}
@@ -1359,7 +1367,7 @@
}
catch (IOException e)
{
- log.error("Exception while closing search index.", e);
+ LOG.error("Exception while closing search index.", e);
}
if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE))
{
@@ -1369,7 +1377,7 @@
}
catch (IOException e)
{
- log.error("Exception while closing search index.", e);
+ LOG.error("Exception while closing search index.", e);
}
}
volatileIndex.close();
@@ -1385,7 +1393,7 @@
}
catch (IOException e)
{
- log.error("Exception while closing directory.", e);
+ LOG.error("Exception while closing directory.", e);
}
modeHandler.removeIndexerIoModeListener(this);
indexUpdateMonitor.removeIndexUpdateMonitorListener(this);
@@ -1404,6 +1412,10 @@
// can't register shutdown hook because
// jvm shutdown sequence has already begun,
// silently ignore...
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -1503,7 +1515,7 @@
indexNames.removeName(index.getName());
synchronized (deletable)
{
- log.debug("Moved " + index.getName() + " to deletable");
+ LOG.debug("Moved " + index.getName() + " to deletable");
deletable.add(index.getName());
}
}
@@ -1601,7 +1613,7 @@
{
if (merger != null)
{
- log.info("IndexMerger initialization called twice.");
+ LOG.info("IndexMerger initialization called twice.");
}
merger = new IndexMerger(this);
merger.setMaxMergeDocs(handler.getMaxMergeDocs());
@@ -1745,7 +1757,7 @@
{
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
@@ -1763,10 +1775,10 @@
// create new volatile index
resetVolatileIndex();
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis() - time;
- log.debug("Committed in-memory index in " + time + "ms.");
+ LOG.debug("Committed in-memory index in " + time + "ms.");
}
}
}
@@ -1814,7 +1826,7 @@
executeAndLog(new AddNode(getTransactionId(), node.getIdentifier(), true));
if (count.incrementAndGet() % 1000 == 0)
{
- log.info("indexing... {} ({})", node.getQPath().getAsString(), new Long(count.get()));
+ LOG.info("indexing... {} ({})", node.getQPath().getAsString(), new Long(count.get()));
}
synchronized (this)
@@ -1940,7 +1952,7 @@
executeAndLog(new AddNode(getTransactionId(), node, true));
if (count.incrementAndGet() % 1000 == 0)
{
- log.info("indexing... {} ({})", node.getQPath().getAsString(), new Long(count.get()));
+ LOG.info("indexing... {} ({})", node.getQPath().getAsString(), new Long(count.get()));
}
synchronized (this)
@@ -2009,7 +2021,7 @@
}
else
{
- log.info("Unable to delete obsolete index: " + indexName);
+ LOG.info("Unable to delete obsolete index: " + indexName);
}
}
}
@@ -2031,7 +2043,7 @@
}
catch (IOException e)
{
- log.warn("Unable to remove file 'deletable'.", e);
+ LOG.warn("Unable to remove file 'deletable'.", e);
}
}
@@ -2054,7 +2066,7 @@
{
if (redoLog.hasEntries())
{
- log.debug("Flushing index after being idle for " + idleTime + " ms.");
+ LOG.debug("Flushing index after being idle for " + idleTime + " ms.");
synchronized (updateMonitor)
{
//updateInProgress = true;
@@ -2078,7 +2090,7 @@
}
catch (IOException e)
{
- log.error("Unable to commit volatile index", e);
+ LOG.error("Unable to commit volatile index", e);
}
}
}
@@ -2570,7 +2582,7 @@
catch (RepositoryException e)
{
// node does not exist anymore
- log.debug(e.getMessage());
+ LOG.debug(e.getMessage());
}
}
@@ -3134,7 +3146,7 @@
}
catch (IOException e)
{
- log.error("An error occurs while changing of mode " + mode, e);
+ LOG.error("An error occurs while changing of mode " + mode, e);
}
}
@@ -3245,7 +3257,7 @@
// written to disk.
if (!directoryManager.hasDirectory(name))
{
- log.debug("index does not exist anymore: " + name);
+ LOG.debug("index does not exist anymore: " + name);
// move on to next index
continue;
}
@@ -3284,7 +3296,7 @@
}
catch (IOException e)
{
- log.error("An error occurred while trying to wake up the sleeping threads", e);
+ LOG.error("An error occurred while trying to wake up the sleeping threads", e);
}
}
}
@@ -3312,7 +3324,7 @@
// switching to ONLINE
if (isOnline)
{
- log.info("Setting index ONLINE ({})", handler.getContext().getWorkspacePath(true));
+ LOG.info("Setting index ONLINE ({})", handler.getContext().getWorkspacePath(true));
if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
{
offlineIndex.commit(true);
@@ -3336,7 +3348,7 @@
// switching to OFFLINE
else
{
- log.info("Setting index OFFLINE ({})", handler.getContext().getWorkspacePath(true));
+ LOG.info("Setting index OFFLINE ({})", handler.getContext().getWorkspacePath(true));
if (merger != null)
{
merger.dispose();
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -63,7 +63,7 @@
/**
* The logger instance for this class.
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.NodeIndexer");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.NodeIndexer");
/**
* The default boost for a lucene field: 1.0f.
@@ -215,6 +215,10 @@
{
// will never happen, because this.mappings will dynamically add
// unknown uri<->prefix mappings
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (indexFormatVersion.getVersion() >= IndexFormatVersion.V4.getVersion())
@@ -273,6 +277,10 @@
catch (NamespaceException e)
{
// will never happen, prefixes are created dynamically
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
@@ -323,7 +331,7 @@
if (data == null)
{
- log.warn("null value found at property " + prop.getQPath().getAsString());
+ LOG.warn("null value found at property " + prop.getQPath().getAsString());
}
// check the jcr:encoding property
@@ -392,6 +400,10 @@
}
catch (Throwable e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -406,30 +418,30 @@
}
catch (DocumentReadException e)
{
- log.error("Can not indexing the document by path " + propData.getQPath().getAsString()
+ LOG.error("Can not indexing the document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
catch (HandlerNotFoundException e)
{
// no handler - no index
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("Can not indexing the document by path " + propData.getQPath().getAsString()
+ LOG.debug("Can not indexing the document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
}
catch (IOException e)
{
// no data - no index
- if (log.isWarnEnabled())
+ if (LOG.isWarnEnabled())
{
- log.warn("Binary value indexer IO error, document by path " + propData.getQPath().getAsString()
+ LOG.warn("Binary value indexer IO error, document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
}
catch (Exception e)
{
- log.error("Binary value indexer error, document by path " + propData.getQPath().getAsString()
+ LOG.error("Binary value indexer error, document by path " + propData.getQPath().getAsString()
+ ", propery id '" + propData.getIdentifier() + "' : " + e, e);
}
}
@@ -450,7 +462,7 @@
if (data == null)
{
- log.warn("null value found at property " + prop.getQPath().getAsString());
+ LOG.warn("null value found at property " + prop.getQPath().getAsString());
}
ExtendedValue val = null;
@@ -542,7 +554,7 @@
}
catch (RepositoryException e)
{
- log.error("Index of property value error. " + prop.getQPath().getAsString() + ".", e);
+ LOG.error("Index of property value error. " + prop.getQPath().getAsString() + ".", e);
throw new RepositoryException("Index of property value error. " + prop.getQPath().getAsString() + ". " + e,
e);
}
@@ -566,6 +578,10 @@
catch (NamespaceException e)
{
// will never happen
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
doc.add(new Field(FieldNames.PROPERTIES_SET, fieldName, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
}
@@ -630,7 +646,7 @@
}
catch (IllegalArgumentException e)
{
- log.warn("'{}' is outside of supported date value range.", new Date(value.getTimeInMillis()));
+ LOG.warn("'{}' is outside of supported date value range.", new Date(value.getTimeInMillis()));
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeTraversingQueryHits.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -16,6 +16,11 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
+import org.apache.commons.collections.iterators.IteratorChain;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -26,16 +31,17 @@
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
-import org.apache.commons.collections.iterators.IteratorChain;
-import org.exoplatform.services.jcr.impl.core.NodeImpl;
-
/**
* <code>NodeTraversingQueryHits</code> implements query hits that traverse
* a node hierarchy.
*/
-public class NodeTraversingQueryHits extends AbstractQueryHits {
+public class NodeTraversingQueryHits extends AbstractQueryHits
+{
- /**
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.NodeTraversingQueryHits");
+
+ /**
* The nodes to traverse.
*/
private final Iterator nodes;
@@ -144,32 +150,52 @@
/**
* Initializes the iterator chain once.
*/
- private void init() {
- if (selfAndChildren == null) {
- List allIterators = new ArrayList();
- Iterator current = Collections.singletonList(currentNode).iterator();
- allIterators.add(current);
- if (maxDepth == 0) {
- // only current node
- } else if (maxDepth == 1) {
- try {
- allIterators.add(currentNode.getNodes());
- } catch (RepositoryException e) {
- // currentNode is probably stale
- }
- } else {
- // create new TraversingNodeIterator for each child
- try {
- NodeIterator children = currentNode.getNodes();
- while (children.hasNext()) {
- allIterators.add(new TraversingNodeIterator(children.nextNode(), maxDepth - 1));
- }
- } catch (RepositoryException e) {
- // currentNode is probably stale
- }
- }
- selfAndChildren = new IteratorChain(allIterators);
+ private void init()
+ {
+ if (selfAndChildren == null)
+ {
+ List allIterators = new ArrayList();
+ Iterator current = Collections.singletonList(currentNode).iterator();
+ allIterators.add(current);
+ if (maxDepth == 0)
+ {
+ // only current node
}
- }
+ else if (maxDepth == 1)
+ {
+ try
+ {
+ allIterators.add(currentNode.getNodes());
+ }
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ }
+ else
+ {
+ // create new TraversingNodeIterator for each child
+ try
+ {
+ NodeIterator children = currentNode.getNodes();
+ while (children.hasNext())
+ {
+ allIterators.add(new TraversingNodeIterator(children.nextNode(), maxDepth - 1));
+ }
+ }
+ catch (RepositoryException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+ }
+ }
+ selfAndChildren = new IteratorChain(allIterators);
+ }
+ }
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -48,7 +48,7 @@
/**
* The logger instance for this class
*/
- private static final Logger log = LoggerFactory.getLogger("exo.jcr.component.core.QueryResultImpl");
+ private static final Logger LOG = LoggerFactory.getLogger("exo.jcr.component.core.QueryResultImpl");
/**
* The search index to execute the query.
@@ -209,7 +209,7 @@
catch (NamespaceException npde)
{
String msg = "encountered invalid property name";
- log.debug(msg);
+ LOG.debug(msg);
throw new RepositoryException(msg, npde);
}
}
@@ -292,9 +292,9 @@
*/
protected void getResults(long size) throws RepositoryException
{
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("getResults({}) limit={}", new Long(size), new Long(limit));
+ LOG.debug("getResults({}) limit={}", new Long(size), new Long(limit));
}
long maxResultSize = size;
@@ -316,14 +316,14 @@
try
{
long time = 0;
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
result = executeQuery(maxResultSize);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("query executed in {} ms", new Long(System.currentTimeMillis() - time));
+ LOG.debug("query executed in {} ms", new Long(System.currentTimeMillis() - time));
}
// set selector names
selectorNames = result.getSelectorNames();
@@ -339,14 +339,14 @@
result.skip(start);
}
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
time = System.currentTimeMillis();
}
collectScoreNodes(result, resultNodes, maxResultSize);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("retrieved ScoreNodes in {} ms", new Long(System.currentTimeMillis() - time));
+ LOG.debug("retrieved ScoreNodes in {} ms", new Long(System.currentTimeMillis() - time));
}
// update numResults
@@ -358,7 +358,7 @@
}
catch (IOException e)
{
- log.error("Exception while executing query: ", e);
+ LOG.error("Exception while executing query: ", e);
// todo throw?
}
finally
@@ -371,7 +371,7 @@
}
catch (IOException e)
{
- log.warn("Unable to close query result: " + e);
+ LOG.warn("Unable to close query result: " + e);
}
}
}
@@ -445,7 +445,10 @@
}
catch (ItemNotFoundException e)
{
- // node deleted while query was executed
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return true;
@@ -656,7 +659,7 @@
}
catch (RepositoryException e)
{
- log.warn("Exception getting more results: " + e);
+ LOG.warn("Exception getting more results: " + e);
}
// check again
if (nextPos >= resultNodes.size())
@@ -673,16 +676,16 @@
next = null;
invalid++;
resultNodes.remove(nextPos);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("The node is invalid since we don't have sufficient rights to access it, "
+ LOG.debug("The node is invalid since we don't have sufficient rights to access it, "
+ "it will be removed from the results set");
}
}
}
catch (RepositoryException e)
{
- log.error("Could not check access permission", e);
+ LOG.error("Could not check access permission", e);
break;
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/WildcardTermEnum.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -16,6 +16,13 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.search.FilteredTermEnum;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -24,18 +31,17 @@
import java.util.Map;
import java.util.regex.Matcher;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermEnum;
-import org.apache.lucene.search.FilteredTermEnum;
-
/**
* Implements a wildcard term enum that optionally supports embedded property
* names in lucene term texts.
*/
-class WildcardTermEnum extends FilteredTermEnum implements TransformConstants {
+class WildcardTermEnum extends FilteredTermEnum implements TransformConstants
+{
- /**
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.WildcardTermEnum");
+
+ /**
* The pattern matcher.
*/
private final Matcher pattern;
@@ -246,10 +252,16 @@
Iterator it = rangeScans.iterator();
while (it.hasNext()) {
RangeScan scan = (RangeScan) it.next();
- try {
+ try
+ {
scan.close();
- } catch (IOException e) {
- // ignore
+ }
+ catch (IOException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -53,7 +53,7 @@
/**
* Logger instance for this class.
*/
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.LuceneSpellChecker");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.LuceneSpellChecker");
public static final class FiveSecondsRefreshInterval extends LuceneSpellChecker
{
@@ -333,7 +333,10 @@
}
catch (IOException e)
{
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// urgh, the lucene spell checker cannot be closed explicitly.
// finalize will close the reader...
@@ -438,7 +441,7 @@
}
if (hasSuggestion)
{
- log.debug("Successful after " + new Integer(retries) + " retries");
+ LOG.debug("Successful after " + new Integer(retries) + " retries");
return suggestion;
}
else
@@ -452,6 +455,10 @@
// spell checker is closed while searching for
// suggestions. this is actually a design flaw in the
// lucene spell checker, but for now we simply retry
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
// unsuccessful after retries
@@ -505,11 +512,11 @@
{
long time = System.currentTimeMillis();
Dictionary dict = new LuceneDictionary(reader, FieldNames.FULLTEXT);
- log.debug("Starting spell checker index refresh");
+ LOG.debug("Starting spell checker index refresh");
spellChecker.indexDictionary(dict);
time = System.currentTimeMillis() - time;
time = time / 1000;
- log.info("Spell checker index refreshed in: " + new Long(time) + " s.");
+ LOG.info("Spell checker index refreshed in: " + new Long(time) + " s.");
}
finally
{
@@ -525,7 +532,10 @@
}
catch (IOException e)
{
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
};
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/synonym/WordNetSynonyms.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -16,13 +16,14 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene.synonym;
+import org.apache.lucene.index.memory.SynonymMap;
+import org.exoplatform.services.jcr.impl.core.query.lucene.SynonymProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.io.IOException;
import java.io.InputStream;
-import org.apache.lucene.index.memory.SynonymMap;
-
-import org.exoplatform.services.jcr.impl.core.query.lucene.SynonymProvider;
-
/**
* <code>WordNetSynonyms</code> implements a {@link SynonymProvider} that is backed by the WordNet
* prolog file <a href="http://www.cogsci.princeton.edu/2.0/WNprolog-2.0.tar.gz">wn_s.pl</a>.
@@ -30,6 +31,9 @@
public class WordNetSynonyms implements SynonymProvider
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.query.lucene.synonym.WordNetSynonyms");
+
/**
* The synonym map or <code>null</code> if an error occurred while reading the prolog file.
*/
@@ -48,7 +52,10 @@
}
catch (IOException e)
{
- // ignore
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
SYNONYM_MAP = sm;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/DateValue.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -130,10 +130,14 @@
{
return getInternalString().length();
}
- catch (Throwable e)
+ catch (ValueFormatException e)
{
return super.getLength();
}
+ catch (RepositoryException e)
+ {
+ return super.getLength();
+ }
}
@Override
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -44,6 +44,8 @@
import org.exoplatform.services.jcr.impl.dataflow.session.SessionChangesLog;
import org.exoplatform.services.jcr.impl.dataflow.version.VersionHistoryDataHelper;
import org.exoplatform.services.jcr.impl.util.EntityCollection;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
import java.util.ArrayList;
@@ -75,6 +77,9 @@
public class VersionHistoryImpl extends VersionStorageDescendantNode implements VersionHistory
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.core.version.VersionHistoryImpl");
+
// new impl
public VersionHistoryImpl(NodeData data, SessionImpl session) throws PathNotFoundException, RepositoryException
{
@@ -744,6 +749,10 @@
}
catch (NumberFormatException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return vn > 0 ? String.valueOf(vn + 1) : "1";
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -94,6 +94,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("init error " + e.getMessage())
{
@@ -145,6 +149,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("init error " + e.getMessage())
{
@@ -299,6 +307,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("update error " + e.getMessage())
{
@@ -384,6 +396,10 @@
}
catch (Exception e1)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e1.getMessage());
+ }
}
throw new IOException("setLength(" + size + ") error. " + e.getMessage())
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -214,7 +214,7 @@
}
else
{
- throw new NullPointerException("Stream already consumed");
+ throw new IllegalArgumentException("Stream already consumed");
}
}
}
@@ -234,7 +234,7 @@
}
else
{
- throw new NullPointerException("Null Stream data ");
+ throw new IllegalArgumentException("Null Stream data ");
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -829,7 +829,7 @@
}
catch (Throwable e)
{
- LOG.warn("Show statistic log.info error " + e);
+ LOG.warn("Show statistic log.info error " + e.getMessage());
}
}
@@ -2156,7 +2156,7 @@
}
catch (Throwable e)
{
- LOG.warn(this.name + " cache, stop error " + e);
+ LOG.warn(this.name + " cache, stop error " + e.getMessage());
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -389,11 +389,17 @@
}
catch (IllegalStateException e)
{
- // Do not nothing.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (IOException e)
{
- // Do not nothing.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -1602,11 +1608,17 @@
}
catch (IllegalStateException e)
{
- // Do nothing. Never happens.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (IOException e)
{
- // Do nothing. Never happens.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
cache.addToList(makeRefFqn(nodeIdentifier), ITEM_LIST, prop.getIdentifier(),
@@ -1809,7 +1821,10 @@
}
catch (IllegalPathException e)
{
- // Do nothing. Never happens.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// make new path - no matter node or property
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/SerializationSpoolFile.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -20,6 +20,8 @@
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.File;
import java.io.FileNotFoundException;
@@ -35,6 +37,9 @@
public class SerializationSpoolFile extends SpoolFile
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.dataflow.serialization.SerializationSpoolFile");
+
/**
* SpoolFileHolder.
*/
@@ -100,7 +105,10 @@
}
catch (FileNotFoundException e)
{
- // haven't file - haven't problem
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return false;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -327,7 +327,7 @@
}
catch (SQLException e)
{
- LOG.error(e);
+ LOG.error("An exception occured: " + e.getMessage());
return false;
}
}
@@ -563,7 +563,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the statement: " + e);
+ LOG.error("Can't close the statement: " + e.getMessage());
}
}
@@ -927,7 +927,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -979,7 +979,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1018,7 +1018,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1055,7 +1055,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1143,7 +1143,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1215,7 +1215,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1289,7 +1289,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1386,7 +1386,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1449,7 +1449,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1514,7 +1514,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1590,7 +1590,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1851,7 +1851,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1899,7 +1899,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1937,7 +1937,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -2093,7 +2093,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -2208,7 +2208,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -2257,7 +2257,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -305,6 +305,10 @@
}
catch (RepositoryConfigurationException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (pDbUrl != null)
@@ -553,6 +557,10 @@
}
catch (RepositoryConfigurationException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (wsSourceName != null && newWsSourceName != null)
@@ -587,6 +595,10 @@
}
catch (RepositoryConfigurationException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (wsUri != null && newWsUri != null)
@@ -878,7 +890,10 @@
}
catch (SQLException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -238,7 +238,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -305,7 +305,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -378,7 +378,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -446,7 +446,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -540,7 +540,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -743,7 +743,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -844,7 +844,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -943,7 +943,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1188,7 +1188,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
@@ -1280,7 +1280,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -21,6 +21,8 @@
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.File;
import java.sql.Connection;
@@ -41,6 +43,9 @@
public class DB2ConnectionFactory extends GenericCQConnectionFactory
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.DB2ConnectionFactory");
+
private Boolean isReindexingSupport;
/**
@@ -217,7 +222,10 @@
}
catch (SQLException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -260,7 +260,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -475,7 +475,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -487,7 +487,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -565,7 +565,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the ResultSet: " + e);
+ LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
@@ -577,7 +577,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
@@ -615,7 +615,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -198,6 +198,10 @@
}
catch (IOException e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -72,7 +72,7 @@
}
catch (UnknownHostException e)
{
- LOG.warn("Cannot read host address " + e);
+ LOG.warn("Cannot read host address " + e.getMessage());
LOCAL_ADDRESS = "no address, " + e;
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -42,7 +42,7 @@
protected static final long DEFAULT_TIMEOUT = 30000;
- protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.FileCleaner");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.FileCleaner");
protected final ConcurrentLinkedQueue<File> files = new ConcurrentLinkedQueue<File>();
@@ -112,9 +112,9 @@
};
SecurityHelper.doPrivilegedAction(action);
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug("FileCleaner instantiated name= " + getName() + " timeout= " + timeout);
+ LOG.debug("FileCleaner instantiated name= " + getName() + " timeout= " + timeout);
}
}
@@ -138,6 +138,10 @@
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// Remove the hook for final cleaning up
SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
@@ -150,15 +154,16 @@
}
catch (IllegalStateException e)
{
- // can't register shutdown hook because
- // jvm shutdown sequence has already begun,
- // silently ignore...
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
});
if (files != null && files.size() > 0)
- log.warn("There are uncleared files: " + files.size());
+ LOG.warn("There are uncleared files: " + files.size());
super.halt();
}
@@ -179,13 +184,13 @@
{
notRemovedFiles.add(file);
- if (log.isDebugEnabled())
- log.debug("Could not delete " + (file.isDirectory() ? "directory" : "file")
+ if (LOG.isDebugEnabled())
+ LOG.debug("Could not delete " + (file.isDirectory() ? "directory" : "file")
+ ". Will try next time: " + PrivilegedFileHelper.getAbsolutePath(file));
}
- else if (log.isDebugEnabled())
+ else if (LOG.isDebugEnabled())
{
- log.debug((file.isDirectory() ? "Directory" : "File") + " deleted : "
+ LOG.debug((file.isDirectory() ? "Directory" : "File") + " deleted : "
+ PrivilegedFileHelper.getAbsolutePath(file));
}
}
@@ -207,9 +212,10 @@
}
catch (IllegalStateException e)
{
- // can't register shutdown hook because
- // jvm shutdown sequence has already begun,
- // silently ignore...
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -330,7 +330,7 @@
}
catch (SQLException e)
{
- LOG.error("Can't close the Statement: " + e);
+ LOG.error("Can't close the Statement: " + e.getMessage());
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -106,7 +106,7 @@
protected final ValueFactoryImpl valueFactory;
- private final Log log = ExoLogger.getLogger("exo.jcr.component.core.ImporterBase");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ImporterBase");
public BaseXmlImporter(NodeData parent, QPath ancestorToSave, int uuidBehavior, ItemDataConsumer dataConsumer,
NodeTypeDataManager ntManager, LocationFactory locationFactory, ValueFactoryImpl valueFactory,
@@ -153,7 +153,7 @@
Collections.sort(changesLog.getAllStates(), new PathSorter());
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
StringBuilder str = new StringBuilder();
for (int i = 0; i < changesLog.getAllStates().size(); i++)
@@ -165,7 +165,7 @@
str.append(changesLog.getAllStates().get(i).isInternallyCreated()).append("\t");
str.append(changesLog.getAllStates().get(i).getData().getQPath().getAsString()).append("\n");
}
- log.debug(str);
+ LOG.debug(str);
}
if (isNeedReloadAncestorToSave)
{
@@ -523,7 +523,10 @@
}
catch (ItemNotFoundException e)
{
- // node not found, it's ok - willing create one new
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -470,7 +470,10 @@
}
catch (RepositoryConfigurationException e)
{
- // do n't nothing
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
this.cache = new BufferedISPNCache(parentCache, allowLocalChanges);
cache.addListener(new CacheEventListener());
@@ -1194,11 +1197,17 @@
}
catch (IllegalStateException e)
{
- // Do nothing. Never happens.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (IOException e)
{
- // Do nothing. Never happens.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
cache.addToList(new CacheRefsId(nodeIdentifier), prop.getIdentifier(),
modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
@@ -1334,7 +1343,10 @@
}
catch (IllegalPathException e)
{
- // Do nothing. Never happens.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// make new path - no matter node or property
Modified: jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -66,7 +66,7 @@
private final TemplateConfigurationHelper configurationHelper;
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");
/**
* A Map that contains all the registered CacheManager order by {@link ExoContainer}
@@ -111,7 +111,7 @@
{
// get Infinispan configuration file path
final String configurationPath = parameterEntry.getParameterValue(INFINISPAN_CONFIG);
- log.info("Infinispan Cache configuration used: " + configurationPath);
+ LOG.info("Infinispan Cache configuration used: " + configurationPath);
// avoid dashes in cache name. Some SQL servers doesn't allow dashes in table names
final String regionIdEscaped = regionId.replace("-", "_");
// prepare configuration
@@ -184,13 +184,16 @@
}
catch (Exception e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (jgroupsConfigInputStream != null)
{
try
{
- log.info("Custom JGroups configuration set: " + jgroupsConfigURL);
+ LOG.info("Custom JGroups configuration set: " + jgroupsConfigURL);
// Read stream content into StringWriter
StringWriter sw = new StringWriter();
@@ -244,17 +247,17 @@
// template to define a new configuration
manager = new DefaultCacheManager(gc);
CACHE_MANAGERS.put(gc, manager);
- if (log.isInfoEnabled())
+ if (LOG.isInfoEnabled())
{
- log.info("A new ISPN Cache Manager instance has been registered for the region " + regionId
+ LOG.info("A new ISPN Cache Manager instance has been registered for the region " + regionId
+ " and the container " + container.getContext().getName());
}
}
// Define the configuration of the cache
manager.defineConfiguration(regionId, conf);
- if (log.isInfoEnabled())
+ if (LOG.isInfoEnabled())
{
- log.info("The region " + regionId + " has been registered for the container "
+ LOG.info("The region " + regionId + " has been registered for the container "
+ container.getContext().getName());
}
return manager;
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/app/MapStoredSessionProviderService.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -53,9 +53,13 @@
public SessionProvider getSessionProvider(Object key)
{
if (providers.containsKey(key))
+ {
return providers.get(key);
+ }
else
- throw new NullPointerException("SessionProvider is not initialized");
+ {
+ throw new IllegalArgumentException("SessionProvider is not initialized");
+ }
}
/*
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -100,7 +100,7 @@
public class BackupManagerImpl implements ExtendedBackupManager, Startable
{
- protected static Log log = ExoLogger.getLogger("exo.jcr.component.ext.BackupManagerImpl");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.BackupManagerImpl");
/**
* Name of default incremental job period parameter in configuration.
@@ -234,15 +234,15 @@
public void onError(BackupJob job, String message, Throwable error)
{
messages.addError(makeJobInfo(job, error) + message, error);
- log.error(makeJobInfo(job, error) + message, error);
+ LOG.error(makeJobInfo(job, error) + message, error);
}
public void onStateChanged(BackupJob job)
{
messages.addMessage(makeJobInfo(job, null));
- if (log.isDebugEnabled())
+ if (LOG.isDebugEnabled())
{
- log.debug(makeJobInfo(job, null));
+ LOG.debug(makeJobInfo(job, null));
}
}
@@ -298,7 +298,10 @@
}
catch (BackupOperationException e)
{
- // skip URL
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
finally
{
@@ -377,11 +380,11 @@
}
catch (InterruptedException e)
{
- log.error("The interapted this thread.", e);
+ LOG.error("The interapted this thread.", e);
}
catch (Throwable e)
{
- log.error("The unknown error", e);
+ LOG.error("The unknown error", e);
}
}
}
@@ -434,11 +437,11 @@
}
catch (InterruptedException e)
{
- log.error("The interapted this thread.", e);
+ LOG.error("The interapted this thread.", e);
}
catch (Throwable e)
{
- log.error("The unknown error", e);
+ LOG.error("The unknown error", e);
}
}
}
@@ -559,7 +562,7 @@
}
catch (BackupOperationException e)
{
- log.warn("Log file " + PrivilegedFileHelper.getAbsolutePath(cf) + " is bussy or corrupted. Skipped. " + e,
+ LOG.warn("Log file " + PrivilegedFileHelper.getAbsolutePath(cf) + " is bussy or corrupted. Skipped. " + e,
e);
}
}
@@ -588,7 +591,7 @@
}
catch (BackupOperationException e)
{
- log.warn("Log file " + PrivilegedFileHelper.getAbsolutePath(cf) + " is bussy or corrupted. Skipped. " + e,
+ LOG.warn("Log file " + PrivilegedFileHelper.getAbsolutePath(cf) + " is bussy or corrupted. Skipped. " + e,
e);
}
}
@@ -851,7 +854,7 @@
}
catch (Exception exc)
{
- log.error("Cannot write init configuration to RegistryService.", exc);
+ LOG.error("Cannot write init configuration to RegistryService.", exc);
}
}
finally
@@ -998,10 +1001,10 @@
fullBackupType = getAttributeSmart(element, FULL_BACKUP_TYPE);
incrementalBackupType = getAttributeSmart(element, INCREMENTAL_BACKUP_TYPE);
- log.info("Backup dir from RegistryService: " + backupDir);
- log.info("Default incremental job period from RegistryService: " + defIncrPeriod);
- log.info("Full backup type from RegistryService: " + fullBackupType);
- log.info("Incremental backup type from RegistryService: " + incrementalBackupType);
+ LOG.info("Backup dir from RegistryService: " + backupDir);
+ LOG.info("Default incremental job period from RegistryService: " + defIncrPeriod);
+ LOG.info("Full backup type from RegistryService: " + fullBackupType);
+ LOG.info("Incremental backup type from RegistryService: " + incrementalBackupType);
checkParams();
}
@@ -1063,10 +1066,10 @@
pps.getProperty(INCREMENTAL_BACKUP_TYPE) == null ? DEFAULT_VALUE_INCREMENTAL_BACKUP_TYPE : pps
.getProperty(INCREMENTAL_BACKUP_TYPE);
- log.info("Backup dir from configuration file: " + backupDir);
- log.info("Full backup type from configuration file: " + fullBackupType);
- log.info("(Experimental) Incremental backup type from configuration file: " + incrementalBackupType);
- log.info("(Experimental) Default incremental job period from configuration file: " + defIncrPeriod);
+ LOG.info("Backup dir from configuration file: " + backupDir);
+ LOG.info("Full backup type from configuration file: " + fullBackupType);
+ LOG.info("(Experimental) Incremental backup type from configuration file: " + incrementalBackupType);
+ LOG.info("(Experimental) Default incremental job period from configuration file: " + defIncrPeriod);
checkParams();
}
@@ -1313,6 +1316,10 @@
catch (RepositoryException e)
{
//OK. Repository with "repositoryEntry.getName" is not exists.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
Map<String, BackupChainLog> workspacesMapping = new HashedMap();
@@ -1572,19 +1579,19 @@
}
catch (JsonException e)
{
- this.log.error("Can't get JSON object from wokrspace configuration", e);
+ this.LOG.error("Can't get JSON object from wokrspace configuration", e);
}
catch (RepositoryException e)
{
- this.log.error(e);
+ this.LOG.error(e);
}
catch (RepositoryConfigurationException e)
{
- this.log.error(e);
+ this.LOG.error(e);
}
catch (ClassNotFoundException e)
{
- this.log.error(e);
+ this.LOG.error(e);
}
JobRepositoryRestore jobExistedRepositoryRestore =
@@ -1684,19 +1691,19 @@
}
catch (JsonException e)
{
- this.log.error("Can't get JSON object from wokrspace configuration", e);
+ this.LOG.error("Can't get JSON object from wokrspace configuration", e);
}
catch (RepositoryException e)
{
- this.log.error(e);
+ this.LOG.error(e);
}
catch (RepositoryConfigurationException e)
{
- this.log.error(e);
+ this.LOG.error(e);
}
catch (ClassNotFoundException e)
{
- this.log.error(e);
+ this.LOG.error(e);
}
JobWorkspaceRestore jobRestore =
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -46,7 +46,7 @@
/**
* The logger.
*/
- private static Log log = ExoLogger.getLogger("exo.jcr.component.ext.JobExistedWorkspaceRestore");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.JobExistedWorkspaceRestore");
/**
* JobExistingWorkspaceRestore constructor.
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -55,7 +55,7 @@
/**
* Logger.
*/
- protected static final Log log = ExoLogger.getLogger("exo.jcr.component.core.RdbmsWorkspaceInitializer");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.RdbmsWorkspaceInitializer");
/**
* The repository service.
@@ -155,7 +155,7 @@
}
catch (BackupException e1)
{
- log.error("Can't rollback restorer", e1);
+ LOG.error("Can't rollback restorer", e1);
}
}
@@ -171,7 +171,7 @@
}
catch (BackupException e)
{
- log.error("Can't close restorer", e);
+ LOG.error("Can't close restorer", e);
}
}
@@ -186,7 +186,7 @@
{
if (throwable == null)
{
- log.error("Con not set ONLYNE state for repository " + repository.getConfiguration().getName(), e);
+ LOG.error("Con not set ONLYNE state for repository " + repository.getConfiguration().getName(), e);
}
else
{
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -170,7 +170,7 @@
if (workspaceName == null)
{
- throw new NullPointerException("Workspace Name is null");
+ throw new IllegalArgumentException("Workspace Name is null");
}
ExtendedSession session = cache.get(key(repository, workspaceName));
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/distribution/impl/AbstractDataDistributionType.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -21,6 +21,8 @@
import org.exoplatform.services.jcr.core.ExtendedNode;
import org.exoplatform.services.jcr.ext.distribution.DataDistributionType;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.util.List;
import java.util.Map;
@@ -40,6 +42,10 @@
*/
public abstract class AbstractDataDistributionType implements DataDistributionType
{
+
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.ext.distribution.impl.AbstractDataDistributionType");
+
/**
* The default node type to use when we create a new node
*/
@@ -95,7 +101,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
// The node could not be found so we need to create it
Node node = rootNode;
@@ -110,7 +120,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
// The node doesn't exist we need to create it
node = createNode(node, nodeName, nodeType, mixinTypes, permissions, i == length - 1, true);
@@ -134,7 +148,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
finally
{
@@ -186,7 +204,11 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
+
}
boolean useParameters = !useParametersOnLeafOnly() || (useParametersOnLeafOnly() && isLeaf);
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/hierarchy/impl/NodeHierarchyCreatorImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -53,7 +53,7 @@
public class NodeHierarchyCreatorImpl implements NodeHierarchyCreator, Startable
{
- private static final Log log = ExoLogger.getLogger("exo.jcr.component.ext.NodeHierarchyCreatorImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.NodeHierarchyCreatorImpl");
private static final String USERS_PATH = "usersPath";
@@ -102,7 +102,7 @@
if (PropertyManager.isDevelopping() && !oldDistribution)
{
- log.info("The NodeHierarchyCreator is configured to use the new distribution mechanism for the"
+ LOG.info("The NodeHierarchyCreator is configured to use the new distribution mechanism for the"
+ " users directories, if you prefer to use the old mechanism set the value parameter "
+ "'old-user-distribution' to 'true'.");
}
@@ -119,7 +119,7 @@
}
catch (Exception e)
{
- log.error("An error occurs while processing the plugins", e);
+ LOG.error("An error occurs while processing the plugins", e);
}
if (isNeededToMigrate())
@@ -130,7 +130,7 @@
}
catch (RepositoryException e)
{
- log.error("An error occurs while upgrading JCR structure", e);
+ LOG.error("An error occurs while upgrading JCR structure", e);
}
}
}
@@ -210,7 +210,7 @@
}
catch (Exception e)
{
- log.error("An error occurs while processing the JCR path which alias is "
+ LOG.error("An error occurs while processing the JCR path which alias is "
+ (currentjcrPath == null ? null : currentjcrPath.getAlias()) + " with the workspace "
+ workspaceName, e);
}
@@ -270,7 +270,7 @@
}
catch (Exception e)
{
- log.error("An error occurs while processing the JCR path which alias is "
+ LOG.error("An error occurs while processing the JCR path which alias is "
+ (currentjcrPath == null ? null : currentjcrPath.getAlias()) + " with the workspace "
+ workspaceName, e);
}
@@ -339,7 +339,10 @@
}
catch (PathNotFoundException e)
{
- // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/metadata/AddMetadataAction.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -114,7 +114,9 @@
(DocumentReaderService)((ExoContainer)ctx.get("exocontainer"))
.getComponentInstanceOfType(DocumentReaderService.class);
if (readerService == null)
- throw new NullPointerException("No DocumentReaderService configured for current container");
+ {
+ throw new IllegalArgumentException("No DocumentReaderService configured for current container");
+ }
Properties props = new Properties();
try
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -80,7 +80,7 @@
public class RegistryService extends Registry implements Startable
{
- private static Log log = ExoLogger.getLogger("exo.jcr.component.ext.RegistryService");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.RegistryService");
protected final static String EXO_REGISTRY_NT = "exo:registry";
@@ -382,7 +382,10 @@
}
catch (Exception e)
{
- //ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
@@ -392,14 +395,14 @@
}
catch (RepositoryConfigurationException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
}
catch (RepositoryException e)
{
- log.error(e.getLocalizedMessage(), e);
+ LOG.error(e.getLocalizedMessage(), e);
}
- else if (log.isDebugEnabled())
- log.warn("Registry service already started");
+ else if (LOG.isDebugEnabled())
+ LOG.warn("Registry service already started");
}
/**
@@ -468,19 +471,19 @@
Throwable cause = pae.getCause();
if (cause instanceof ParserConfigurationException)
{
- log.error(cause.getLocalizedMessage(), cause);
+ LOG.error(cause.getLocalizedMessage(), cause);
}
else if (cause instanceof IOException)
{
- log.error(cause.getLocalizedMessage(), cause);
+ LOG.error(cause.getLocalizedMessage(), cause);
}
else if (cause instanceof SAXException)
{
- log.error(cause.getLocalizedMessage(), cause);
+ LOG.error(cause.getLocalizedMessage(), cause);
}
else if (cause instanceof TransformerException)
{
- log.error(cause.getLocalizedMessage(), cause);
+ LOG.error(cause.getLocalizedMessage(), cause);
}
else if (cause instanceof RuntimeException)
{
@@ -585,7 +588,7 @@
}
else
{
- log.info("The RegistryEntry " + relPath + "is already initialized on repository " + repName);
+ LOG.info("The RegistryEntry " + relPath + "is already initialized on repository " + repName);
}
sysProvider.close();
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -500,7 +500,10 @@
}
catch (RepositoryException e)
{
- //ok - repository does not exists
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
// check does this repository name already reserved, otherwise generate and return token
@@ -717,7 +720,10 @@
}
catch (NameNotFoundException e)
{
- // skip this exception
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (NamingException e)
{
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/AbstractXMLViewNodeRepresentation.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -152,17 +152,20 @@
try
{
if (isSystem)
+ {
node.getSession().exportSystemView(node.getPath(), pout, false, false);
+ }
else
+ {
node.getSession().exportDocumentView(node.getPath(), pout, false, false);
+ }
}
catch (Exception e)
{
- /*
- * Nothing to do. Can give exception if nothing read from stream,
- * this exception generated by
- * XMLStreamWriterImpl#writeStartDocument.
- */
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
finally
{
@@ -173,6 +176,10 @@
}
catch (Exception e)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/JcrURLConnection.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.ext.resource;
import org.exoplatform.services.jcr.ext.common.SessionProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
import java.io.InputStream;
@@ -35,6 +37,8 @@
public class JcrURLConnection extends URLConnection
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.ext.resource.JcrURLConnection");
+
private SessionProvider sessionProvider;
private NodeRepresentationService nodeRepresentationService;
@@ -183,13 +187,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return nodeRepresentation.getMediaType();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -204,13 +213,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return (int)nodeRepresentation.getContentLenght();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return -1;
}
@@ -237,13 +251,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return nodeRepresentation.getContentEncoding();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return null;
}
@@ -258,13 +277,18 @@
try
{
if (!connected)
+ {
connect();
+ }
return nodeRepresentation.getLastModified();
}
catch (Exception e)
{
- //e.printStackTrace();
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return 0;
}
@@ -335,9 +359,12 @@
sessionProvider.close();
}
}
- catch (Throwable t)
+ catch (Exception t)
{
- ;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + t.getMessage());
+ }
}
finally
{
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/UnifiedNodeReference.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -18,9 +18,11 @@
*/
package org.exoplatform.services.jcr.ext.resource;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
-import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.jcr.datamodel.Identifier;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.net.MalformedURLException;
import java.net.URI;
@@ -39,6 +41,8 @@
public class UnifiedNodeReference
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference");
+
public static final String JCR_SCHEME = "jcr";
private String userInfo;
@@ -277,6 +281,10 @@
{
// exceptions can get thrown here if class not be loaded y system ClassLoader
// or if class can't be instantiated.
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
}
return handler;
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/resource/representation/NtFileNodeRepresentation.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -21,6 +21,8 @@
import org.exoplatform.common.util.HierarchicalProperty;
import org.exoplatform.services.jcr.core.ExtendedSession;
import org.exoplatform.services.jcr.ext.resource.NodeRepresentation;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
import java.io.InputStream;
@@ -42,6 +44,9 @@
public class NtFileNodeRepresentation implements NodeRepresentation
{
+ private static final Log LOG = ExoLogger
+ .getLogger("org.exoplatform.services.jcr.ext.resource.representation.NtFileNodeRepresentation");
+
private Node node;
private NodeRepresentation content;
@@ -191,8 +196,10 @@
}
catch (PathNotFoundException e)
{
- //e.printStackTrace();
- //return null;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
return props;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -112,7 +112,7 @@
}
/** Logger. */
- static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.GroovyScript2RestLoader");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.GroovyScript2RestLoader");
/** Default node types for Groovy scripts. */
private static final String DEFAULT_NODETYPE = "exo:groovyResourceContainer";
@@ -335,12 +335,15 @@
}
catch (IndexOfflineRepositoryException e)
{
- //it's okay. Retrying;
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
catch (Exception e)
{
// skip
- LOG.error(e);
+ LOG.error("An exception occurred: " + e.getMessage());
}
}
try
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdMkd.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -40,7 +40,7 @@
public class CmdMkd extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdMkd");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdMkd");
public CmdMkd()
{
@@ -103,10 +103,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, srcPath));
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRest.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -19,6 +19,8 @@
package org.exoplatform.services.ftp.command;
import org.exoplatform.services.ftp.FtpConst;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.io.IOException;
@@ -31,6 +33,8 @@
public class CmdRest extends FtpCommandImpl
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.ftp.command.CmdRest");
+
public CmdRest()
{
commandName = FtpConst.Commands.CMD_REST;
@@ -53,6 +57,10 @@
}
catch (Exception exc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
reply(String.format(FtpConst.Replyes.REPLY_500, FtpConst.Commands.CMD_REST));
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRetr.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -42,7 +42,7 @@
public class CmdRetr extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRetr");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRetr");
public CmdRetr()
{
@@ -142,7 +142,7 @@
}
catch (Throwable exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
clientSession().closeDataTransiver();
@@ -172,13 +172,21 @@
}
catch (PathNotFoundException exc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Throwable exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return false;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnFr.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -37,7 +37,7 @@
public class CmdRnFr extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnFr");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnFr");
public CmdRnFr()
{
@@ -72,10 +72,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, resName));
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdRnTo.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -39,7 +39,7 @@
public class CmdRnTo extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnTo");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdRnTo");
public CmdRnTo()
{
@@ -101,13 +101,21 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exceprion. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exceprion. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, pathName));
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdSize.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -39,7 +39,7 @@
public class CmdSize extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdSize");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdSize");
public CmdSize()
{
@@ -79,13 +79,21 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550_SIZE, resName));
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -49,7 +49,7 @@
public class CmdStor extends FtpCommandImpl
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdStor");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "CmdStor");
public CmdStor()
{
@@ -74,7 +74,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
if (params.length < 2)
@@ -219,7 +219,7 @@
}
catch (Exception exc)
{
- log.info("Failurinc closing input stream");
+ LOG.info("Failurinc closing input stream");
}
if (cacheFileName != null)
@@ -238,10 +238,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
clientSession().closeDataTransiver();
@@ -261,10 +265,14 @@
}
catch (RepositoryException rexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + rexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return null;
}
@@ -308,10 +316,14 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return null;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/FtpCommandImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -48,7 +48,7 @@
public abstract class FtpCommandImpl implements FtpCommand
{
- private static Log log = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "FtpCommandImpl");
+ private static final Log LOG = ExoLogger.getLogger(FtpConst.FTP_PREFIX + "FtpCommandImpl");
protected boolean isNeedLogin = true;
@@ -154,7 +154,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
return null;
}
return files;
@@ -178,13 +178,21 @@
}
catch (PathNotFoundException pexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + pexc.getMessage());
+ }
}
catch (NoSuchWorkspaceException wexc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + wexc.getMessage());
+ }
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
reply(String.format(FtpConst.Replyes.REPLY_550, resName));
}
@@ -235,7 +243,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
FtpSystemCoder systemCoder =
@@ -273,8 +281,8 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage());
- log.info("Data transmit failed.");
+ LOG.info("Unhandled exception. " + exc.getMessage());
+ LOG.info("Data transmit failed.");
}
reply(FtpConst.Replyes.REPLY_226);
Modified: jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -20,6 +20,8 @@
import org.exoplatform.common.util.HierarchicalProperty;
import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import java.net.URI;
import java.util.HashSet;
@@ -41,6 +43,8 @@
public abstract class GenericResource implements Resource
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.jcr.webdav.resource.GenericResource");
+
/**
* Resource identifier.
*/
@@ -113,6 +117,10 @@
}
catch (Exception exc)
{
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
}
Modified: jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -18,6 +18,9 @@
*/
package org.exoplatform.frameworks.jcr.cli;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;
@@ -32,6 +35,8 @@
public class HelpCommand extends AbstractCliCommand
{
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.frameworks.jcr.cli.HelpCommand");
+
private TreeMap<String, String> map = new TreeMap<String, String>();
private final int WORD_LENGTH = 15;
@@ -79,7 +84,10 @@
}
catch (Exception e)
{
- // no parameters found
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + e.getMessage());
+ }
}
if (findHelpCommand != null)
{
Modified: jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java 2012-01-26 14:46:34 UTC (rev 5529)
+++ jcr/branches/1.15.x/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/data/FtpDataTransiverImpl.java 2012-01-27 08:26:44 UTC (rev 5530)
@@ -39,7 +39,7 @@
public class FtpDataTransiverImpl implements FtpDataTransiver
{
- private static Log log = ExoLogger.getLogger("exo.jcr.framework.command.FtpDataTransiverImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.framework.command.FtpDataTransiverImpl");
protected Socket dataSocket = null;
@@ -65,7 +65,7 @@
}
catch (Exception exc)
{
- log.info("Can't open active mode. PORT is busy. " + exc.getMessage(), exc);
+ LOG.info("Can't open active mode. PORT is busy. " + exc.getMessage(), exc);
}
return false;
}
@@ -94,7 +94,7 @@
}
catch (Exception exc)
{
- log.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
+ LOG.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
}
}
@@ -123,11 +123,14 @@
}
catch (SocketException exc)
{
- // ..
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + exc.getMessage());
+ }
}
catch (Exception exc)
{
- log.error(exc.getLocalizedMessage(), exc);
+ LOG.error(exc.getLocalizedMessage(), exc);
}
try
@@ -139,7 +142,7 @@
}
catch (Exception exc)
{
- log.info("Unhandled exception. " + exc.getMessage(), exc);
+ LOG.info("Unhandled exception. " + exc.getMessage(), exc);
}
return outStream.toByteArray();
@@ -157,7 +160,7 @@
}
catch (Exception exc)
{
- log.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
+ LOG.info(FtpConst.EXC_MSG + exc.getMessage(), exc);
}
}
return false;
12 years, 3 months
exo-jcr SVN: r5529 - ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 09:46:34 -0500 (Thu, 26 Jan 2012)
New Revision: 5529
Modified:
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 14:45:10 UTC (rev 5528)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 14:46:34 UTC (rev 5529)
@@ -71,7 +71,7 @@
{
if (m == null)
{
- throw new IllegalArgumentException("parameter \"m\" cannot be null");
+ throw new IllegalArgumentException("No null map accepted");
}
this.m = new HashMap<String, List<String>>(m.size());
for (Map.Entry<String, List<String>> e : m.entrySet())
12 years, 3 months
exo-jcr SVN: r5528 - ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-26 09:45:10 -0500 (Thu, 26 Jan 2012)
New Revision: 5528
Modified:
ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
Log:
EXOJCR-1725: Fixed the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2
Modified: ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java
===================================================================
--- ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 14:42:57 UTC (rev 5527)
+++ ws/branches/2.3.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/InputHeadersMap.java 2012-01-26 14:45:10 UTC (rev 5528)
@@ -71,7 +71,7 @@
{
if (m == null)
{
- throw new IllegalArgumentException("parameter \"m\" cannot be null");
+ throw new IllegalArgumentException("No null map accepted");
}
this.m = new HashMap<String, List<String>>(m.size());
for (Map.Entry<String, List<String>> e : m.entrySet())
12 years, 3 months