deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject [3/3] deltaspike git commit: DELTASPIKE-645 squid:S1155 - Collection.isEmpty() should be used to test for emptiness
Date Wed, 13 Jul 2016 04:01:42 GMT
DELTASPIKE-645 squid:S1155 - Collection.isEmpty() should be used to test for emptiness

This closes #53


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/712fc6dc
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/712fc6dc
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/712fc6dc

Branch: refs/heads/master
Commit: 712fc6dca9bb732bee094b9107929b20d439c952
Parents: a56d062
Author: George Kankava <george.kankava@devfactory.com>
Authored: Tue Jun 28 21:13:01 2016 +0400
Committer: John D. Ament <johndament@apache.org>
Committed: Wed Jul 13 00:01:21 2016 -0400

----------------------------------------------------------------------
 .../core/api/resourceloader/ClasspathResourceProvider.java         | 2 +-
 .../deltaspike/data/impl/builder/result/DefaultQueryResult.java    | 2 +-
 .../deltaspike/data/impl/builder/result/QueryProcessorFactory.java | 2 +-
 .../org/apache/deltaspike/data/impl/criteria/QueryCriteria.java    | 2 +-
 .../jpa/impl/transaction/context/TransactionBeanStorage.java       | 2 +-
 .../org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java    | 2 +-
 .../org/apache/deltaspike/proxy/impl/AsmProxyClassGenerator.java   | 2 +-
 .../proxy/impl/invocation/AbstractManualInvocationHandler.java     | 2 +-
 .../org/apache/deltaspike/scheduler/impl/SchedulerExtension.java   | 2 +-
 .../security/impl/authorization/SecuredAnnotationAuthorizer.java   | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/ClasspathResourceProvider.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/ClasspathResourceProvider.java
b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/ClasspathResourceProvider.java
index 618ae62..47aeb77 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/ClasspathResourceProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/ClasspathResourceProvider.java
@@ -120,7 +120,7 @@ public class ClasspathResourceProvider extends AbstractResourceProvider
 
     private String urlsToString(List<URL> urls, String name)
     {
-        if (urls.size() == 0)
+        if (urls.isEmpty())
         {
             return String.format("No resources found for '%s'",name);
         }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/DefaultQueryResult.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/DefaultQueryResult.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/DefaultQueryResult.java
index 2548984..bc70a1f 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/DefaultQueryResult.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/DefaultQueryResult.java
@@ -231,7 +231,7 @@ public class DefaultQueryResult<T> implements QueryResult<T>
     public T getAnyResult()
     {
         List<T> queryResult = getResultList();
-        return queryResult.size() > 0 ? queryResult.get(0) : null;
+        return !queryResult.isEmpty() ? queryResult.get(0) : null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
index 9a72dca..4bc5777 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/result/QueryProcessorFactory.java
@@ -149,7 +149,7 @@ public final class QueryProcessorFactory
                 default:
                     @SuppressWarnings("unchecked")
                     List<Object> queryResult = query.getResultList();
-                    result = queryResult.size() > 0 ? queryResult.get(0) : null;
+                    result = !queryResult.isEmpty() ? queryResult.get(0) : null;
             }
             if (context.isOptional())
             {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/criteria/QueryCriteria.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/criteria/QueryCriteria.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/criteria/QueryCriteria.java
index ab66083..4157114 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/criteria/QueryCriteria.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/criteria/QueryCriteria.java
@@ -132,7 +132,7 @@ public class QueryCriteria<C, R> implements Criteria<C, R>
     public R getAnyResult()
     {
         List<R> queryResult = getResultList();
-        return queryResult.size() > 0 ? queryResult.get(0) : null;
+        return !queryResult.isEmpty() ? queryResult.get(0) : null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/context/TransactionBeanStorage.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/context/TransactionBeanStorage.java
b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/context/TransactionBeanStorage.java
index 1a37fef..376051e 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/context/TransactionBeanStorage.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/context/TransactionBeanStorage.java
@@ -183,7 +183,7 @@ public class TransactionBeanStorage
 
         destroyBeans(currentTci.contextualInstances);
 
-        if (oldTci.size() > 0)
+        if (!oldTci.isEmpty())
         {
             currentTci = oldTci.pop();
             endTransactionScope();

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
index b30c398..19a8099 100644
--- a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
+++ b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
@@ -110,7 +110,7 @@ public abstract class DeltaSpikeProxyFactory
 
             // check if a interceptor is defined on class level. if not, skip interceptor
methods
             if (interceptMethods != null
-                    && interceptMethods.size() > 0
+                    && !interceptMethods.isEmpty()
                     && !containsInterceptorBinding(beanManager, targetClass.getDeclaredAnnotations()))
             {
                 // loop every method and check if a interceptor is defined on the method
-> otherwise don't overwrite

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/AsmProxyClassGenerator.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/AsmProxyClassGenerator.java
b/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/AsmProxyClassGenerator.java
index a887c28..64408a8 100644
--- a/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/AsmProxyClassGenerator.java
+++ b/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/AsmProxyClassGenerator.java
@@ -337,7 +337,7 @@ public class AsmProxyClassGenerator implements ProxyClassGenerator
 
         // catch checked exceptions and rethrow it
         boolean throwableCatched = false;
-        if (exceptionsToCatch.size() > 0)
+        if (!exceptionsToCatch.isEmpty())
         {
             rethrow = mg.mark();
             mg.visitVarInsn(Opcodes.ASTORE, 1);

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/invocation/AbstractManualInvocationHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/invocation/AbstractManualInvocationHandler.java
b/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/invocation/AbstractManualInvocationHandler.java
index 37f763c..92bfc3c 100644
--- a/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/invocation/AbstractManualInvocationHandler.java
+++ b/deltaspike/modules/proxy/impl-asm5/src/main/java/org/apache/deltaspike/proxy/impl/invocation/AbstractManualInvocationHandler.java
@@ -36,7 +36,7 @@ public abstract class AbstractManualInvocationHandler implements InvocationHandl
 
         // check if interceptors are defined, otherwise just call the original logik
         List<Interceptor<?>> interceptors = interceptorLookup.lookup(proxy, method);
-        if (interceptors != null && interceptors.size() > 0)
+        if (interceptors != null && !interceptors.isEmpty())
         {
             try
             {

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
index 1780373..6bb5790 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
@@ -221,7 +221,7 @@ public class SchedulerExtension implements Extension, Deactivatable
                 afterBeanDiscovery.addDefinitionError(t);
             }
         }
-        else if (this.foundManagedJobClasses.size() > 0)
+        else if (!this.foundManagedJobClasses.isEmpty())
         {
             LOG.warning(
                 this.foundManagedJobClasses.size() + " scheduling-jobs found, but there is
no configured scheduler");

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/712fc6dc/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/authorization/SecuredAnnotationAuthorizer.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/authorization/SecuredAnnotationAuthorizer.java
b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/authorization/SecuredAnnotationAuthorizer.java
index 4ece4bb..a718137 100644
--- a/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/authorization/SecuredAnnotationAuthorizer.java
+++ b/deltaspike/modules/security/impl/src/main/java/org/apache/deltaspike/security/impl/authorization/SecuredAnnotationAuthorizer.java
@@ -125,7 +125,7 @@ public class SecuredAnnotationAuthorizer
 
                 violations = voter.checkPermission(voterContext);
 
-                if (violations != null && violations.size() > 0)
+                if (violations != null && !violations.isEmpty())
                 {
                     if (voterContext instanceof EditableAccessDecisionVoterContext)
                     {


Mime
View raw message