Author: andrew.plotnikov
Date: 2012-01-17 04:09:44 -0500 (Tue, 17 Jan 2012)
New Revision: 5458
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/core/query/lucene/AbstractIndex.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
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-17
09:08:32 UTC (rev 5457)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-01-17
09:09:44 UTC (rev 5458)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.jcr.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.SecurityHelper;
-import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.jmx.MX4JComponentAdapterFactory;
@@ -289,7 +289,8 @@
workspaceContainer.registerComponentImplementation(StandaloneStoragePluginProvider.class);
try
{
- final Class<?> containerType =
ClassLoading.forName(wsConfig.getContainer().getType(), RepositoryContainer.class);
+ final Class<?> containerType =
+ ClassLoading.forName(wsConfig.getContainer().getType(),
RepositoryContainer.class);
workspaceContainer.registerComponentImplementation(containerType);
if (isSystem)
{
@@ -309,7 +310,8 @@
String className = wsConfig.getCache().getType();
if (className != null && className.length() > 0)
{
-
workspaceContainer.registerComponentImplementation(ClassLoading.forName(className,
RepositoryContainer.class));
+
workspaceContainer.registerComponentImplementation(ClassLoading.forName(className,
+ RepositoryContainer.class));
}
else
workspaceContainer.registerComponentImplementation(LinkedWorkspaceStorageCacheImpl.class);
@@ -329,7 +331,8 @@
{
try
{
- final Class<?> lockManagerType =
ClassLoading.forName(wsConfig.getLockManager().getType(), RepositoryContainer.class);
+ final Class<?> lockManagerType =
+ ClassLoading.forName(wsConfig.getLockManager().getType(),
RepositoryContainer.class);
workspaceContainer.registerComponentImplementation(lockManagerType);
}
catch (ClassNotFoundException e)
@@ -630,7 +633,8 @@
}
try
{
- final Class<?> authenticationPolicyClass =
ClassLoading.forName(config.getAuthenticationPolicy(), RepositoryContainer.class);
+ final Class<?> authenticationPolicyClass =
+ ClassLoading.forName(config.getAuthenticationPolicy(),
RepositoryContainer.class);
registerComponentImplementation(authenticationPolicyClass);
}
catch (ClassNotFoundException e)
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java 2012-01-17
09:08:32 UTC (rev 5457)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java 2012-01-17
09:09:44 UTC (rev 5458)
@@ -18,8 +18,6 @@
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Fieldable;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.Term;
@@ -553,80 +551,6 @@
//------------------------------< internal >--------------------------------
/**
- * Returns the index parameter set on <code>f</code>.
- *
- * @param f a lucene field.
- * @return the index parameter on <code>f</code>.
- */
- private Field.Index getIndexParameter(Fieldable f)
- {
- if (!f.isIndexed())
- {
- return Field.Index.NO;
- }
- else if (f.isTokenized())
- {
- return Field.Index.ANALYZED;
- }
- else
- {
- return Field.Index.NOT_ANALYZED;
- }
- }
-
- /**
- * Returns the store parameter set on <code>f</code>.
- *
- * @param f a lucene field.
- * @return the store parameter on <code>f</code>.
- */
- private Field.Store getStoreParameter(Fieldable f)
- {
- if (f.isCompressed())
- {
- return Field.Store.COMPRESS;
- }
- else if (f.isStored())
- {
- return Field.Store.YES;
- }
- else
- {
- return Field.Store.NO;
- }
- }
-
- /**
- * Returns the term vector parameter set on <code>f</code>.
- *
- * @param f a lucene field.
- * @return the term vector parameter on <code>f</code>.
- */
- private Field.TermVector getTermVectorParameter(Fieldable f)
- {
- if (f.isStorePositionWithTermVector() && f.isStoreOffsetWithTermVector())
- {
- return Field.TermVector.WITH_POSITIONS_OFFSETS;
- }
- else if (f.isStorePositionWithTermVector())
- {
- return Field.TermVector.WITH_POSITIONS;
- }
- else if (f.isStoreOffsetWithTermVector())
- {
- return Field.TermVector.WITH_OFFSETS;
- }
- else if (f.isTermVectorStored())
- {
- return Field.TermVector.YES;
- }
- else
- {
- return Field.TermVector.NO;
- }
- }
-
- /**
* Adapter to pipe info messages from lucene into log messages.
*/
private static final class LoggingPrintStream extends PrintStream
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2012-01-17
09:08:32 UTC (rev 5457)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2012-01-17
09:09:44 UTC (rev 5458)
@@ -41,7 +41,6 @@
import org.exoplatform.services.log.Log;
import java.io.IOException;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -156,14 +155,6 @@
}
}
- private class VersionableStateComparator implements
Comparator<VersionableState>
- {
- public int compare(VersionableState nc1, VersionableState nc2)
- {
- return nc1.getPath().compareTo(nc2.getPath());
- }
- }
-
public ItemDataMergeVisitor(SessionImpl mergeSession, SessionImpl corrSession,
Map<String, String> failed,
boolean bestEffort)
{
Modified:
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
===================================================================
---
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2012-01-17
09:08:32 UTC (rev 5457)
+++
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2012-01-17
09:09:44 UTC (rev 5458)
@@ -122,7 +122,8 @@
{
try
{
- this.incrementalBackup =
(AbstractIncrementalBackupJob)ClassLoading.forName(incrementalBackupType,
this).newInstance();
+ this.incrementalBackup =
+ (AbstractIncrementalBackupJob)ClassLoading.forName(incrementalBackupType,
this).newInstance();
}
catch (Exception e)
{
Show replies by date