You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by sf...@apache.org on 2011/07/16 14:45:21 UTC
svn commit: r1147422 - in
/chemistry/opencmis/trunk/chemistry-opencmis-client:
chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/
chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/b...
Author: sfermigier
Date: Sat Jul 16 12:45:17 2011
New Revision: 1147422
URL: http://svn.apache.org/viewvc?rev=1147422&view=rev
Log:
Clean up.
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/SessionFactory.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/AbstractMapCacheLevel.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/TransientWrapper.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AclServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/AtomParserTest.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/cache/CacheTest.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractCmisTestCase.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadOnlyTests.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ChangeEventsImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/cache/CacheImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterable.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterator.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/ItemIterableTest.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/SessionFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/SessionFactory.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/SessionFactory.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/SessionFactory.java Sat Jul 16 12:45:17 2011
@@ -59,8 +59,6 @@ public interface SessionFactory {
/**
* Creates a new session.
*
- * @param T
- * a class implementing the {@link Session} interface
* @param parameters
* a {@code Map} of name/value pairs with parameters for the
* session
@@ -78,4 +76,5 @@ public interface SessionFactory {
* {@code SessionParameter.REPOSITORY_ID} should not be set.
*/
List<Repository> getRepositories(Map<String, String> parameters);
+
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/AbstractMapCacheLevel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/AbstractMapCacheLevel.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/AbstractMapCacheLevel.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/cache/impl/AbstractMapCacheLevel.java Sat Jul 16 12:45:17 2011
@@ -34,7 +34,7 @@ public abstract class AbstractMapCacheLe
private Map<String, Object> fMap;
private boolean fFallbackEnabled = false;
- private String fFallbackKey = null;
+ private String fFallbackKey;
private boolean fSingleValueEnabled = false;
public abstract void initialize(Map<String, String> parameters);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java Sat Jul 16 12:45:17 2011
@@ -33,7 +33,7 @@ public class SessionImpl implements Bind
private static final long serialVersionUID = 1L;
- private Map<String, Object> data;
+ private final Map<String, Object> data;
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/TransientWrapper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/TransientWrapper.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/TransientWrapper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/TransientWrapper.java Sat Jul 16 12:45:17 2011
@@ -26,7 +26,7 @@ import java.io.Serializable;
public class TransientWrapper implements Serializable {
private static final long serialVersionUID = 1L;
- private transient Object object = null;
+ private transient Object object;
public TransientWrapper(Object object) {
this.object = object;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/NTLMAuthenticationProvider.java Sat Jul 16 12:45:17 2011
@@ -81,7 +81,7 @@ public class NTLMAuthenticationProvider
*/
static class OpenCMISAuthenticator extends Authenticator {
- private PasswordAuthentication passwordAuthentication = null;
+ private PasswordAuthentication passwordAuthentication;
/**
* Resets the user and password. The next request will not be
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java Sat Jul 16 12:45:17 2011
@@ -456,14 +456,14 @@ public class AbstractAtomPubService impl
return null;
}
- int beginn = errorContent.indexOf("<!--exception-->");
+ int begin = errorContent.indexOf("<!--exception-->");
int end = errorContent.indexOf("<!--/exception-->");
- if ((beginn == -1) || (end == -1) || (beginn > end)) {
+ if (begin == -1 || end == -1 || begin > end) {
return null;
}
- return errorContent.substring(beginn + "<!--exception-->".length(), end);
+ return errorContent.substring(begin + "<!--exception-->".length(), end);
}
protected String extractErrorMessage(String message, String errorContent) {
@@ -471,14 +471,14 @@ public class AbstractAtomPubService impl
return message;
}
- int beginn = errorContent.indexOf("<!--message-->");
+ int begin = errorContent.indexOf("<!--message-->");
int end = errorContent.indexOf("<!--/message-->");
- if ((beginn == -1) || (end == -1) || (beginn > end)) {
+ if (begin == -1 || end == -1 || begin > end) {
return message;
}
- return errorContent.substring(beginn + "<!--message-->".length(), end);
+ return errorContent.substring(begin + "<!--message-->".length(), end);
}
// ---- helpers ----
@@ -669,7 +669,7 @@ public class AbstractAtomPubService impl
private static Map<String, Set<String>> convertAclToMap(Acl acl) {
Map<String, Set<String>> result = new HashMap<String, Set<String>>();
- if ((acl == null) || (acl.getAces() == null)) {
+ if (acl == null || acl.getAces() == null) {
return result;
}
@@ -681,7 +681,7 @@ public class AbstractAtomPubService impl
}
// although a principal must not be null, check it
- if ((ace.getPrincipal() == null) || (ace.getPrincipal().getId() == null)) {
+ if (ace.getPrincipal() == null || ace.getPrincipal().getId() == null) {
// ignore
continue;
}
@@ -748,7 +748,6 @@ public class AbstractAtomPubService impl
ReturnVersion returnVersion, String filter, Boolean includeAllowableActions,
IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
Boolean includeAcl, ExtensionsData extension) {
- ObjectData result = null;
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Constants.PARAM_ID, objectIdOrPath);
@@ -769,7 +768,7 @@ public class AbstractAtomPubService impl
UrlBuilder url = new UrlBuilder(link);
// workaround for missing template parameter in the CMIS spec
- if ((returnVersion != null) && (returnVersion != ReturnVersion.THIS)) {
+ if (returnVersion != null && returnVersion != ReturnVersion.THIS) {
url.addParameter(Constants.PARAM_RETURN_VERSION, returnVersion);
}
@@ -783,6 +782,7 @@ public class AbstractAtomPubService impl
}
lockLinks();
+ ObjectData result = null;
try {
// clean up cache
removeLinks(repositoryId, entry.getId());
@@ -806,7 +806,6 @@ public class AbstractAtomPubService impl
* Retrieves a type definition.
*/
protected TypeDefinition getTypeDefinitionInternal(String repositoryId, String typeId) {
- TypeDefinition result = null;
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(Constants.PARAM_ID, typeId);
@@ -826,6 +825,7 @@ public class AbstractAtomPubService impl
}
lockTypeLinks();
+ TypeDefinition result = null;
try {
// clean up cache
removeTypeLinks(repositoryId, entry.getId());
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AclServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AclServiceImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AclServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AclServiceImpl.java Sat Jul 16 12:45:17 2011
@@ -43,7 +43,6 @@ public class AclServiceImpl extends Abst
public Acl applyAcl(String repositoryId, String objectId, Acl addAces, Acl removeAces,
AclPropagation aclPropagation, ExtensionsData extension) {
- Acl result = null;
// fetch the current ACL
Acl originalAces = getAcl(repositoryId, objectId, false, null);
@@ -58,12 +57,12 @@ public class AclServiceImpl extends Abst
// update ACL
AtomAcl acl = updateAcl(repositoryId, objectId, newACL, aclPropagation);
- result = convert(acl.getACL(), null);
+ Acl result = convert(acl.getACL(), null);
return result;
}
- public org.apache.chemistry.opencmis.commons.data.Acl getAcl(String repositoryId, String objectId,
+ public Acl getAcl(String repositoryId, String objectId,
Boolean onlyBasicPermissions, ExtensionsData extension) {
// find the link
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/CmisAtomPubSpi.java Sat Jul 16 12:45:17 2011
@@ -37,21 +37,19 @@ import org.apache.commons.logging.LogFac
*/
public class CmisAtomPubSpi implements CmisSpi {
- private static final long serialVersionUID = 1L;
-
private static final Log log = LogFactory.getLog(CmisAtomPubSpi.class);
- private BindingSession session;
+ private final BindingSession session;
- private RepositoryService repositoryService;
- private NavigationService navigationService;
- private ObjectService objectService;
- private VersioningService versioningService;
- private DiscoveryService discoveryService;
- private MultiFilingService multiFilingService;
- private RelationshipService relationshipService;
- private PolicyService policyService;
- private AclService aclService;
+ private final RepositoryService repositoryService;
+ private final NavigationService navigationService;
+ private final ObjectService objectService;
+ private final VersioningService versioningService;
+ private final DiscoveryService discoveryService;
+ private final MultiFilingService multiFilingService;
+ private final RelationshipService relationshipService;
+ private final PolicyService policyService;
+ private final AclService aclService;
/**
* Constructor.
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/local/CmisLocalSpi.java Sat Jul 16 12:45:17 2011
@@ -45,20 +45,19 @@ import org.apache.commons.logging.LogFac
*/
public class CmisLocalSpi implements CmisSpi {
- private static final long serialVersionUID = 1L;
-
private static final Log log = LogFactory.getLog(CmisLocalSpi.class);
- private CmisServiceFactory factory;
+ private final CmisServiceFactory factory;
+
+ private final RepositoryService repositoryService;
+ private final NavigationService navigationService;
+ private final ObjectService objectService;
+ private final VersioningService versioningService;
+ private final DiscoveryService discoveryService;
+ private final MultiFilingService multiFilingService;
+ private final RelationshipService relationshipService;
+ private final PolicyService policyService;
- private RepositoryService repositoryService;
- private NavigationService navigationService;
- private ObjectService objectService;
- private VersioningService versioningService;
- private DiscoveryService discoveryService;
- private MultiFilingService multiFilingService;
- private RelationshipService relationshipService;
- private PolicyService policyService;
private AclService aclService;
/**
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/AbstractPortProvider.java Sat Jul 16 12:45:17 2011
@@ -217,12 +217,12 @@ public abstract class AbstractPortProvid
* Creates a service object.
*/
protected Service initServiceObject(String serviceKey) {
- Service serviceObject = null;
if (log.isDebugEnabled()) {
log.debug("Initializing Web Service " + serviceKey + "...");
}
+ Service serviceObject;
try {
// get WSDL URL
URL wsdlUrl = new URL((String) session.get(serviceKey));
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/CmisWebServicesSpi.java Sat Jul 16 12:45:17 2011
@@ -37,19 +37,17 @@ import org.apache.commons.logging.LogFac
*/
public class CmisWebServicesSpi implements CmisSpi {
- private static final long serialVersionUID = 1L;
-
private static final Log log = LogFactory.getLog(CmisWebServicesSpi.class);
- private RepositoryService repositoryService;
- private NavigationService navigationService;
- private ObjectService objectService;
- private VersioningService versioningService;
- private DiscoveryService discoveryService;
- private MultiFilingService multiFilingService;
- private RelationshipService relationshipService;
- private PolicyService policyService;
- private AclService aclService;
+ private final RepositoryService repositoryService;
+ private final NavigationService navigationService;
+ private final ObjectService objectService;
+ private final VersioningService versioningService;
+ private final DiscoveryService discoveryService;
+ private final MultiFilingService multiFilingService;
+ private final RelationshipService relationshipService;
+ private final PolicyService policyService;
+ private final AclService aclService;
/**
* Constructor.
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/MultiFilingServiceImpl.java Sat Jul 16 12:45:17 2011
@@ -29,6 +29,8 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort;
import org.apache.chemistry.opencmis.commons.spi.MultiFilingService;
+import javax.xml.ws.Holder;
+
/**
* MultiFiling Service Web Services client.
*/
@@ -49,7 +51,7 @@ public class MultiFilingServiceImpl exte
MultiFilingServicePort port = portProvider.getMultiFilingServicePort();
try {
- javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+ Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
port.addObjectToFolder(repositoryId, objectId, folderId, allVersions, portExtension);
@@ -67,7 +69,7 @@ public class MultiFilingServiceImpl exte
MultiFilingServicePort port = portProvider.getMultiFilingServicePort();
try {
- javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+ Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
port.removeObjectFromFolder(repositoryId, objectId, folderId, portExtension);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PolicyServiceImpl.java Sat Jul 16 12:45:17 2011
@@ -35,6 +35,8 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.jaxb.PolicyServicePort;
import org.apache.chemistry.opencmis.commons.spi.PolicyService;
+import javax.xml.ws.Holder;
+
/**
* Policy Service Web Services client.
*/
@@ -54,7 +56,7 @@ public class PolicyServiceImpl extends A
PolicyServicePort port = portProvider.getPolicyServicePort();
try {
- javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+ Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
port.applyPolicy(repositoryId, policyId, objectId, portExtension);
@@ -72,7 +74,7 @@ public class PolicyServiceImpl extends A
PolicyServicePort port = portProvider.getPolicyServicePort();
try {
- javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+ Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
port.removePolicy(repositoryId, policyId, objectId, portExtension);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/PortProvider.java Sat Jul 16 12:45:17 2011
@@ -60,8 +60,9 @@ public class PortProvider extends Abstra
private static final Log log = LogFactory.getLog(PortProvider.class);
- private boolean useCompression;
- private boolean useClientCompression;
+ private final boolean useCompression;
+ private final boolean useClientCompression;
+
private String acceptLanguage;
/**
@@ -85,13 +86,13 @@ public class PortProvider extends Abstra
* Creates a port object.
*/
protected Object createPortObject(Service service) {
- Object portObject = null;
if (log.isDebugEnabled()) {
log.debug("Creating Web Service port object of " + (service == null ? "???" : service.getServiceName())
+ "...");
}
+ Object portObject;
try {
if (service instanceof RepositoryService) {
portObject = ((RepositoryService) service).getRepositoryServicePort(new MTOMFeature());
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/AtomParserTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/AtomParserTest.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/AtomParserTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/atompub/AtomParserTest.java Sat Jul 16 12:45:17 2011
@@ -127,24 +127,24 @@ public class AtomParserTest extends Test
}
protected void assertEquals(CmisProperty expected, CmisProperty actual) throws Exception {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
- if ((expected == null) || (actual == null)) {
+ if (expected == null || actual == null) {
fail("Property is null!");
}
assertEquals(expected.getPropertyDefinitionId(), actual.getPropertyDefinitionId());
- assertEquals(expected.getClass(), actual.getClass());
+ assertSame(expected.getClass(), actual.getClass());
- Method m1 = expected.getClass().getMethod("getValue", new Class<?>[0]);
- List<?> values1 = (List<?>) m1.invoke(expected, new Object[0]);
+ Method m1 = expected.getClass().getMethod("getValue");
+ List<?> values1 = (List<?>) m1.invoke(expected);
assertNotNull(values1);
assertFalse(values1.isEmpty());
- Method m2 = actual.getClass().getMethod("getValue", new Class<?>[0]);
- List<?> values2 = (List<?>) m2.invoke(actual, new Object[0]);
+ Method m2 = actual.getClass().getMethod("getValue");
+ List<?> values2 = (List<?>) m2.invoke(actual);
assertNotNull(values2);
assertFalse(values2.isEmpty());
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/cache/CacheTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/cache/CacheTest.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/cache/CacheTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/cache/CacheTest.java Sat Jul 16 12:45:17 2011
@@ -54,15 +54,15 @@ public class CacheTest extends TestCase
valueObj = cache.get("l1", "l2a", "l3", "l4");
assertTrue(valueObj instanceof String);
- assertTrue(value1 == valueObj);
+ assertSame(value1, valueObj);
valueObj = cache.get("l1", "l2b", "l3", "l4");
assertTrue(valueObj instanceof String);
- assertTrue(value2 == valueObj);
+ assertSame(value2, valueObj);
valueObj = cache.get("l1", "l2c", "l3", "l4");
assertTrue(valueObj instanceof String);
- assertTrue(value3 == valueObj);
+ assertSame(value3, valueObj);
// remove leaf
cache.remove("l1", "l2", "l3", "l4");
@@ -73,7 +73,7 @@ public class CacheTest extends TestCase
cache.put(value1, "l1", "l2", "l3", "l4");
valueObj = cache.get("l1", "l2", "l3", "l4");
assertTrue(valueObj instanceof String);
- assertTrue(value1 == valueObj);
+ assertSame(value1, valueObj);
// remove branch
cache.remove("l1", "l2");
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractCmisTestCase.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractCmisTestCase.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractCmisTestCase.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/framework/AbstractCmisTestCase.java Sat Jul 16 12:45:17 2011
@@ -292,7 +292,7 @@ public abstract class AbstractCmisTestCa
assertNotNull(repository.getCapabilities());
- return (repository.getCapabilities().getAclCapability() != CapabilityAcl.NONE);
+ return repository.getCapabilities().getAclCapability() != CapabilityAcl.NONE;
}
/**
@@ -303,7 +303,7 @@ public abstract class AbstractCmisTestCa
assertNotNull(repository.getCapabilities());
- return (repository.getCapabilities().getAclCapability() == CapabilityAcl.MANAGE);
+ return repository.getCapabilities().getAclCapability() == CapabilityAcl.MANAGE;
}
/**
@@ -318,7 +318,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return (repository.getCapabilities().getRenditionsCapability() != CapabilityRenditions.NONE);
+ return repository.getCapabilities().getRenditionsCapability() != CapabilityRenditions.NONE;
}
/**
@@ -333,7 +333,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return repository.getCapabilities().isGetDescendantsSupported().booleanValue();
+ return repository.getCapabilities().isGetDescendantsSupported();
}
/**
@@ -348,7 +348,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return repository.getCapabilities().isGetFolderTreeSupported().booleanValue();
+ return repository.getCapabilities().isGetFolderTreeSupported();
}
/**
@@ -363,7 +363,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return (repository.getCapabilities().getChangesCapability() != CapabilityChanges.NONE);
+ return repository.getCapabilities().getChangesCapability() != CapabilityChanges.NONE;
}
/**
@@ -378,7 +378,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return (repository.getCapabilities().getQueryCapability() != CapabilityQuery.NONE);
+ return repository.getCapabilities().getQueryCapability() != CapabilityQuery.NONE;
}
/**
@@ -394,7 +394,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return (relType != null);
+ return relType != null;
}
/**
@@ -409,7 +409,7 @@ public abstract class AbstractCmisTestCa
return false;
}
- return (relType != null);
+ return relType != null;
}
/**
@@ -847,13 +847,13 @@ public abstract class AbstractCmisTestCa
Boolean isVersionable = ((DocumentTypeDefinition) type).isVersionable();
assertNotNull(isVersionable);
- return isVersionable.booleanValue();
+ return isVersionable;
}
// ---- asserts ----
protected void assertEquals(TypeDefinition expected, TypeDefinition actual, boolean checkPropertyDefintions) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -878,7 +878,7 @@ public abstract class AbstractCmisTestCa
return;
}
- if ((expected.getPropertyDefinitions() == null) && (actual.getPropertyDefinitions() == null)) {
+ if (expected.getPropertyDefinitions() == null && actual.getPropertyDefinitions() == null) {
return;
}
@@ -900,7 +900,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(PropertyDefinition<?> expected, PropertyDefinition<?> actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -932,7 +932,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(Properties expected, Properties actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -944,11 +944,11 @@ public abstract class AbstractCmisTestCa
fail("Actual properties data is null!");
}
- if ((expected.getProperties() == null) && (actual.getProperties() == null)) {
+ if (expected.getProperties() == null && actual.getProperties() == null) {
return;
}
- if ((expected.getProperties() == null) || (actual.getProperties() == null)) {
+ if (expected.getProperties() == null || actual.getProperties() == null) {
fail("Properties are null!");
}
@@ -976,11 +976,11 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(PropertyData<?> expected, PropertyData<?> actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
- if ((expected == null) || (actual == null)) {
+ if (expected == null || actual == null) {
fail("Properties data is null!");
}
@@ -1051,7 +1051,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(AllowableActions expected, AllowableActions actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -1087,7 +1087,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(Acl expected, Acl actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -1099,7 +1099,7 @@ public abstract class AbstractCmisTestCa
fail("Actual ACL data is null!");
}
- if ((expected.getAces() == null) && (actual.getAces() == null)) {
+ if (expected.getAces() == null && actual.getAces() == null) {
return;
}
@@ -1120,7 +1120,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(Ace expected, Ace actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -1142,7 +1142,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEquals(RenditionData expected, RenditionData actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
@@ -1188,7 +1188,7 @@ public abstract class AbstractCmisTestCa
}
protected void assertEqualLists(List<?> expected, List<?> actual) {
- if ((expected == null) && (actual == null)) {
+ if (expected == null && actual == null) {
return;
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadOnlyTests.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadOnlyTests.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadOnlyTests.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadOnlyTests.java Sat Jul 16 12:45:17 2011
@@ -30,7 +30,7 @@ import org.apache.chemistry.opencmis.com
*/
public class SimpleReadOnlyTests extends AbstractSimpleReadOnlyTests {
- private Set<String> fTests;
+ private final Set<String> fTests;
public SimpleReadOnlyTests() {
fTests = new HashSet<String>();
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/test/java/org/apache/chemistry/opencmis/client/bindings/webservices/SimpleReadWriteTests.java Sat Jul 16 12:45:17 2011
@@ -29,7 +29,7 @@ import org.apache.chemistry.opencmis.com
*/
public class SimpleReadWriteTests extends AbstractSimpleReadWriteTests {
- private Set<String> fTests;
+ private final Set<String> fTests;
public SimpleReadWriteTests() {
fTests = new HashSet<String>();
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java Sat Jul 16 12:45:17 2011
@@ -91,7 +91,7 @@ public abstract class AbstractCmisObject
if ((objectType.getPropertyDefinitions() == null) || objectType.getPropertyDefinitions().size() < 9) {
// there must be at least the 9 standard properties that all objects
// have
- throw new IllegalArgumentException("Object type must have property defintions!");
+ throw new IllegalArgumentException("Object type must have property definitions!");
}
this.session = session;
@@ -288,13 +288,12 @@ public abstract class AbstractCmisObject
}
public ObjectId updateProperties(Map<String, ?> properties, boolean refresh) {
- if ((properties == null) || (properties.isEmpty())) {
+ if (properties == null || properties.isEmpty()) {
throw new IllegalArgumentException("Properties must not be empty!");
}
- String newObjectId = null;
-
readLock();
+ String newObjectId = null;
try {
String objectId = getObjectId();
Holder<String> objectIdHolder = new Holder<String>(objectId);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ChangeEventsImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ChangeEventsImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ChangeEventsImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/ChangeEventsImpl.java Sat Jul 16 12:45:17 2011
@@ -25,8 +25,8 @@ import org.apache.chemistry.opencmis.cli
public class ChangeEventsImpl implements ChangeEvents {
- private String latestChangeLogToken = null;
- private List<ChangeEvent> events = null;
+ private String latestChangeLogToken;
+ private List<ChangeEvent> events;
private boolean hasMoreItems = false;
private long totalNumItems = -1;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl.java Sat Jul 16 12:45:17 2011
@@ -69,8 +69,6 @@ public class SessionFactoryImpl implemen
* provider and cache instance override the values in the session parameters
* if they are not <code>null</code>.
*
- * @param T
- * a class implementing the {@link Session} interface
* @param parameters
* a {@code Map} of name/value pairs with parameters for the
* session
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java Sat Jul 16 12:45:17 2011
@@ -100,17 +100,17 @@ public class SessionImpl implements Sess
/*
* session parameter (serializable)
*/
- private Map<String, String> parameters = null;
+ private Map<String, String> parameters;
/*
* CMIS binding (serializable)
*/
- private CmisBinding binding = null;
+ private CmisBinding binding;
/*
* Session Locale, determined from session parameter (serializable)
*/
- private Locale locale = null;
+ private Locale locale;
/*
* Object factory (serializable)
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/cache/CacheImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/cache/CacheImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/cache/CacheImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/cache/CacheImpl.java Sat Jul 16 12:45:17 2011
@@ -51,7 +51,7 @@ public class CacheImpl implements Cache
private LinkedHashMap<String, CacheItem<Map<String, CmisObject>>> objectMap;
private LinkedHashMap<String, CacheItem<String>> pathToIdMap;
- private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+ private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
/**
* Default constructor.
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/ObjectFactoryImpl.java Sat Jul 16 12:45:17 2011
@@ -95,7 +95,7 @@ public class ObjectFactoryImpl implement
private static final long serialVersionUID = 1L;
- private Session session = null;
+ private Session session;
/**
* Default constructor.
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterable.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterable.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterable.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterable.java Sat Jul 16 12:45:17 2011
@@ -27,8 +27,8 @@ import org.apache.chemistry.opencmis.cli
*/
public abstract class AbstractIterable<T> implements ItemIterable<T> {
- private AbstractPageFetcher<T> pageFetcher;
- private long skipCount;
+ private final AbstractPageFetcher<T> pageFetcher;
+ private final long skipCount;
private AbstractIterator<T> iterator;
protected AbstractIterable(AbstractPageFetcher<T> pageFetcher) {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterator.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/util/AbstractIterator.java Sat Jul 16 12:45:17 2011
@@ -34,9 +34,9 @@ public abstract class AbstractIterator<T
private int skipOffset;
private final AbstractPageFetcher<T> pageFetcher;
- private Page<T> page = null;
- private Long totalNumItems = null;
- private Boolean hasMoreItems = null;
+ private Page<T> page;
+ private Long totalNumItems;
+ private Boolean hasMoreItems;
/**
* Construct
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CacheTest.java Sat Jul 16 12:45:17 2011
@@ -20,13 +20,11 @@ package org.apache.chemistry.opencmis.cl
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;
-import junit.framework.Assert;
import org.apache.chemistry.opencmis.client.api.CmisObject;
import org.apache.chemistry.opencmis.client.runtime.cache.Cache;
@@ -35,6 +33,8 @@ import org.apache.chemistry.opencmis.com
import org.junit.Before;
import org.junit.Test;
+import static junit.framework.Assert.*;
+
public class CacheTest {
@Before
@@ -54,28 +54,28 @@ public class CacheTest {
cache.put(obj1, cacheKey);
// access object
- Assert.assertTrue(cache.containsId(id, cacheKey));
+ assertTrue(cache.containsId(id, cacheKey));
// access object
CmisObject obj2 = cache.getById(id, cacheKey);
- Assert.assertEquals(obj1, obj2);
+ assertEquals(obj1, obj2);
// clear cache
cache.clear();
// access object (not found)
- Assert.assertFalse(cache.containsId(id, cacheKey));
+ assertFalse(cache.containsId(id, cacheKey));
// access object (not found)
CmisObject obj4 = cache.getById(id, cacheKey);
- Assert.assertNull(obj4);
+ assertNull(obj4);
}
@Test
public void cacheSizeTest() {
int cacheSize = 50000;
Cache cache = createCache(cacheSize, 3600 * 1000);
- Assert.assertEquals(cacheSize, cache.getCacheSize());
+ assertEquals(cacheSize, cache.getCacheSize());
}
@Test
@@ -90,10 +90,10 @@ public class CacheTest {
cache.put(obj, cacheKey);
}
- Assert.assertNull(cache.getById("id0", cacheKey)); // thrown out
- Assert.assertNotNull(cache.getById("id1", cacheKey));
- Assert.assertNotNull(cache.getById("id2", cacheKey));
- Assert.assertNotNull(cache.getById("id3", cacheKey));
+ assertNull(cache.getById("id0", cacheKey)); // thrown out
+ assertNotNull(cache.getById("id1", cacheKey));
+ assertNotNull(cache.getById("id2", cacheKey));
+ assertNotNull(cache.getById("id3", cacheKey));
}
@SuppressWarnings("static-access")
@@ -107,15 +107,15 @@ public class CacheTest {
CmisObject obj = this.createCmisObject(id);
cache.put(obj, cacheKey);
- Assert.assertNotNull(cache.getById(id, cacheKey));
+ assertNotNull(cache.getById(id, cacheKey));
Thread.currentThread().sleep(750);
- Assert.assertNull(cache.getById(id, cacheKey));
+ assertNull(cache.getById(id, cacheKey));
}
@Test
- public void serializationTest() throws IOException, ClassNotFoundException {
+ public void serializationTest() throws Exception {
int cacheSize = 10;
Cache cache = createCache(cacheSize, 3600 * 1000);
@@ -138,7 +138,7 @@ public class CacheTest {
for (int k = 0; k < cacheSize; k++) {
CmisObject o1 = cache.getById("id" + k, cacheKey);
CmisObject o2 = cache2.getById("id" + k, cacheKey);
- Assert.assertEquals(o1.getId(), o2.getId());
+ assertEquals(o1.getId(), o2.getId());
}
}
@@ -146,7 +146,6 @@ public class CacheTest {
* Create a Mock for testing Cache is sufficient.
*
* @param id
- * @param path
* @return a mocked object
*/
private static CmisObject createCmisObject(final String id) {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/ItemIterableTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/ItemIterableTest.java?rev=1147422&r1=1147421&r2=1147422&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/ItemIterableTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/ItemIterableTest.java Sat Jul 16 12:45:17 2011
@@ -18,10 +18,6 @@
*/
package org.apache.chemistry.opencmis.client.runtime;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -36,6 +32,8 @@ import org.apache.commons.logging.LogFac
import org.apache.log4j.PropertyConfigurator;
import org.junit.Test;
+import static org.junit.Assert.*;
+
public class ItemIterableTest {
private static final Log log = LogFactory.getLog(ItemIterableTest.class);
@@ -197,11 +195,11 @@ public class ItemIterableTest {
assertNotNull(p);
Iterator<String> i = p.iterator();
assertNotNull(i);
- assertEquals(true, p.getHasMoreItems());
+ assertTrue(p.getHasMoreItems());
for (int idx = 0; i.hasNext() && idx < (pageSize + 1); idx++) {
i.next();
}
- assertEquals(false, p.getHasMoreItems());
+ assertFalse(p.getHasMoreItems());
}
@Test