Author: andrew.plotnikov
Date: 2011-12-29 10:14:53 -0500 (Thu, 29 Dec 2011)
New Revision: 5389
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.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/query/QueryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/AbstractWorkspaceDataReceiver.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -874,15 +874,14 @@
final Set<String> nodes =
this.indexSearcherHolder.getNodesByNodeType(nodeTypeName);
if (nodes.size() > 0)
{
- String message =
- "Can not remove " + nodeTypeName.getAsString()
- + " nodetype, because the following node types is used in nodes with
uuid: ";
+ StringBuilder message =
+ new StringBuilder("Can not remove
").append(nodeTypeName.getAsString()).append(
+ " nodetype, because the following node types is used in nodes with
uuid: ");
for (final String uuids : nodes)
{
- message += uuids + " ";
+ message.append(uuids).append(" ");
}
- throw new RepositoryException(message);
-
+ throw new RepositoryException(message.toString());
}
this.nodeTypeRepository.unregisterNodeType(nodeType);
}
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 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -548,14 +548,14 @@
getNodes(nodesData, new
InternalQName[]{removePropertyDefinitionData.getName()}, new InternalQName[]{});
if (nodes.size() > 0)
{
- String message =
- "Can not remove " +
removePropertyDefinitionData.getName().getAsString()
- + " PropertyDefinitionData, because the following nodes have
these properties: ";
+ StringBuilder message =
+ new StringBuilder("Can not remove
").append(removePropertyDefinitionData.getName().getAsString())
+ .append(" PropertyDefinitionData, because the following nodes
have these properties: ");
for (NodeData nodeData : nodes)
{
- message += nodeData.getQPath().getAsString() + " ";
+ message.append(nodeData.getQPath().getAsString()).append("
");
}
- throw new ConstraintViolationException(message);
+ throw new ConstraintViolationException(message.toString());
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryImpl.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryImpl.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -65,7 +65,6 @@
* A string constant representing the JCR-SQL2 query language.
*
* @since JCR 2.0
- * TODO: REMOVE WHEN JSR 283 IS FINAL!!
*/
public static final String JCR_SQL2 = "JCR-SQL2";
@@ -73,7 +72,6 @@
* A string constant representing the JCR-JQOM query language.
*
* @since JCR 2.0
- * TODO: REMOVE WHEN JSR 283 IS FINAL!!
*/
public static final String JCR_JQOM = "JCR-JQOM";
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -192,7 +192,6 @@
case PropertyType.REFERENCE :
case PropertyType.STRING :
return ValueDataConvertor.readString(value);
- // TODO: JSR 283 now node types
default :
return null;
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -88,7 +88,7 @@
private final QPath path;
- private VersionableState(QPath path, int result) //NOSONAR
+ private VersionableState(QPath path, int result) // NOSONAR
{
this.path = path;
this.result = result;
@@ -156,7 +156,7 @@
}
}
- private class VersionableStateComparator implements Comparator<VersionableState>
//NOSONAR
+ private class VersionableStateComparator implements Comparator<VersionableState>
// NOSONAR
{
public int compare(VersionableState nc1, VersionableState nc2)
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -151,8 +151,8 @@
if (dbDialect == DBConstants.DB_DIALECT_MYSQL_MYISAM || dbDialect ==
DBConstants.DB_DIALECT_MYSQL_MYISAM_UTF8)
{
LOG.warn("MyISAM is not supported due to its lack of transaction support
and integrity check, so use it only"
- + " if you don't expect any support and performances in read
accesses are more important than the consistency"
- + " in your use-case. This dialect is only dedicated to the
community.");
+ + " if you don't expect any support and performances in read
accesses are more important than the consistency"
+ + " in your use-case. This dialect is only dedicated to the
community.");
}
if (dbSourceName != null)
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -219,7 +219,7 @@
}
}
- private class Updater100 extends Updater //NOSONAR
+ private class Updater100 extends Updater // NOSONAR
{
@Override
@@ -230,7 +230,7 @@
}
}
- private class Updater101 extends Updater //NOSONAR
+ private class Updater101 extends Updater // NOSONAR
{
@Override
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -26,19 +26,12 @@
import org.exoplatform.services.jcr.impl.util.JCRDateFormat;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import org.exoplatform.ws.frameworks.json.JsonHandler;
-import org.exoplatform.ws.frameworks.json.JsonParser;
-import org.exoplatform.ws.frameworks.json.impl.BeanBuilder;
-import org.exoplatform.ws.frameworks.json.impl.JsonDefaultHandler;
-import org.exoplatform.ws.frameworks.json.impl.JsonParserImpl;
-import org.exoplatform.ws.frameworks.json.value.JsonValue;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IMarshallingContext;
import org.jibx.runtime.IUnmarshallingContext;
import org.jibx.runtime.JiBXException;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -425,28 +418,6 @@
return conf.getRepositoryConfiguration(getBackupConfig().getRepository());
}
- /**
- * Will be created the Object from JSON binary data.
- *
- * @param cl
- * Class
- * @param data
- * binary data (JSON)
- * @return Object
- * @throws Exception
- * will be generated Exception
- */
- private Object getObject(Class cl, byte[] data) throws Exception
- {
- JsonHandler jsonHandler = new JsonDefaultHandler();
- JsonParser jsonParser = new JsonParserImpl();
- InputStream inputStream = new ByteArrayInputStream(data);
- jsonParser.parse(inputStream, jsonHandler);
- JsonValue jsonValue = jsonHandler.getJsonObject();
-
- return new BeanBuilder().createObject(cl, jsonValue);
- }
-
private List<String> readWorkspaceBackupInfo() throws XMLStreamException,
IOException
{
List<String> wsBackupInfo = new ArrayList<String>();
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/AbstractWorkspaceDataReceiver.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/AbstractWorkspaceDataReceiver.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/AbstractWorkspaceDataReceiver.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -120,7 +120,6 @@
*/
public AbstractWorkspaceDataReceiver() throws RepositoryConfigurationException
{
- // TODO: need to use FileCleaner from FileCleanerHolder
this.fileCleaner = new FileCleaner(ReplicationService.FILE_CLEANRE_TIMEOUT);
mapPendingBinaryFile = new HashMap<String, PendingBinaryFile>();
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -206,7 +206,7 @@
/**
* OperationType constructor.
*/
- private OperationType() //NOSONAR
+ private OperationType() // NOSONAR
{
}
@@ -215,7 +215,7 @@
/**
* Constants constructor.
*/
- private Constants() //NOSONAR
+ private Constants() // NOSONAR
{
}
}
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java
===================================================================
---
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java 2011-12-29
15:10:05 UTC (rev 5388)
+++
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java 2011-12-29
15:14:53 UTC (rev 5389)
@@ -115,7 +115,7 @@
/**
* Private constructor.
*/
- private DavDocument() //NOSONAR
+ private DavDocument() // NOSONAR
{
}
@@ -199,7 +199,7 @@
/**
* Private constructor.
*/
- private DavProperty() //NOSONAR
+ private DavProperty() // NOSONAR
{
}
@@ -244,7 +244,7 @@
/**
* Private constructor.
*/
- private ResourceType() //NOSONAR
+ private ResourceType() // NOSONAR
{
}
@@ -271,7 +271,7 @@
/**
* Private constructor.
*/
- private CacheConstants() //NOSONAR
+ private CacheConstants() // NOSONAR
{
}
@@ -293,7 +293,7 @@
/**
* Private constructor.
*/
- private Lock() //NOSONAR
+ private Lock() // NOSONAR
{
}
@@ -329,7 +329,7 @@
/**
* Private constructor.
*/
- private NodeTypes() //NOSONAR
+ private NodeTypes() // NOSONAR
{
}
@@ -450,9 +450,8 @@
/**
* Private constructor.
*/
- private DateFormat() //NOSONAR
+ private DateFormat() // NOSONAR
{
-
}
/**