tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [6/9] tomee git commit: updates strings to use isEmpty method
Date Mon, 10 Dec 2018 13:23:54 GMT
updates strings to use isEmpty method


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/5d75e345
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/5d75e345
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/5d75e345

Branch: refs/heads/master
Commit: 5d75e345b90dea135e3d1109bfde1032f091df10
Parents: 42605b7
Author: Otavio Santana <otaviopolianasantana@gmail.com>
Authored: Fri Dec 7 17:49:17 2018 -0200
Committer: Otavio Santana <otaviopolianasantana@gmail.com>
Committed: Fri Dec 7 17:49:17 2018 -0200

----------------------------------------------------------------------
 .../openejb/assembler/classic/EjbResolver.java  |  2 +-
 .../openejb/config/AnnotationDeployer.java      | 28 ++++++++++----------
 .../openejb/config/EjbJarInfoBuilder.java       |  4 +--
 .../config/PersistenceContextAnnFactory.java    |  2 +-
 .../openejb/core/ivm/naming/IvmContext.java     |  2 +-
 .../openejb/core/webservices/JaxWsUtils.java    |  6 ++---
 .../resource/jdbc/dbcp/BasicDataSource.java     |  2 +-
 .../jdbc/dbcp/BasicManagedDataSource.java       |  2 +-
 .../apache/openejb/util/Log4jPrintWriter.java   |  4 +--
 .../apache/openejb/util/LoggingPrintWriter.java |  4 +--
 .../java/org/apache/openejb/util/Strings.java   |  2 +-
 .../openejb/jee/oejb2/NamespaceFilter.java      |  2 +-
 .../java/org/apache/openejb/loader/Options.java | 12 ++++-----
 13 files changed, 36 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EjbResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EjbResolver.java
b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EjbResolver.java
index ff0d273..51377cb 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EjbResolver.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EjbResolver.java
@@ -234,7 +234,7 @@ public class EjbResolver {
 
     public String resolve(final Reference ref, final URI moduleUri) {
 
-        if (ref.getMappedName() != null && !ref.getMappedName().equals("")) {
+        if (ref.getMappedName() != null && !ref.getMappedName().isEmpty()) {
             return ref.getMappedName();
         }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
index 0996468..79b5ed8 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
@@ -3151,7 +3151,7 @@ public class AnnotationDeployer implements DynamicDeployer {
 
                         final String className = webService.endpointInterface();
 
-                        if (!className.equals("")) {
+                        if (!className.isEmpty()) {
                             sessionBean.setServiceEndpoint(className);
                         } else {
                             sessionBean.setServiceEndpoint(defaultEndpoint.getName());
@@ -3816,7 +3816,7 @@ public class AnnotationDeployer implements DynamicDeployer {
                     final InitMethod initMethod = new InitMethod(method.get());
 
                     final Init init = method.getAnnotation(Init.class);
-                    if (init.value() != null && !init.value().equals("")) {
+                    if (init.value() != null && !init.value().isEmpty()) {
                         initMethod.setCreateMethod(init.value());
                     }
 
@@ -4119,7 +4119,7 @@ public class AnnotationDeployer implements DynamicDeployer {
             final String name = consumer.getJndiConsumerName();
             if (member == null) {
                 boolean shouldReturn = false;
-                if (ejb.name().equals("")) {
+                if (ejb.name().isEmpty()) {
                     fail(name, "ejbAnnotation.onClassWithNoName");
                     shouldReturn = true;
                 }
@@ -4209,21 +4209,21 @@ public class AnnotationDeployer implements DynamicDeployer {
 
             // Set the ejb-link, if any
             String ejbName = ejb.beanName();
-            if (ejbName.equals("")) {
+            if (ejbName.isEmpty()) {
                 ejbName = null;
             }
             ejbRef.setEjbLink(ejbName);
 
             // Set the mappedName, if any
             String mappedName = ejb.mappedName();
-            if (mappedName.equals("")) {
+            if (mappedName.isEmpty()) {
                 mappedName = null;
             }
             ejbRef.setMappedName(mappedName);
 
             // Set lookup name, if any
             String lookupName = getLookupName(ejb);
-            if (lookupName.equals("")) {
+            if (lookupName.isEmpty()) {
                 lookupName = null;
             }
             ejbRef.setLookupName(lookupName);
@@ -4347,7 +4347,7 @@ public class AnnotationDeployer implements DynamicDeployer {
 
             // Get the ref-name
             String refName = resource.name();
-            if (refName.equals("")) {
+            if (refName.isEmpty()) {
                 refName = member.getDeclaringClass().getName() + "/" + member.getName();
             }
 
@@ -4399,7 +4399,7 @@ public class AnnotationDeployer implements DynamicDeployer {
                      * Add an env-entry via @Resource if 'lookup' attribute is set.
                      */
                     final String lookupName = getLookupName(resource);
-                    if (!lookupName.equals("")) {
+                    if (!lookupName.isEmpty()) {
                         final EnvEntry envEntry = new EnvEntry();
                         envEntry.setName(refName);
                         consumer.getEnvEntry().add(envEntry);
@@ -4480,14 +4480,14 @@ public class AnnotationDeployer implements DynamicDeployer {
             }
 
             // Override the mapped name if not set
-            if (reference.getMappedName() == null && !resource.mappedName().equals(""))
{
+            if (reference.getMappedName() == null && !resource.mappedName().isEmpty())
{
                 reference.setMappedName(resource.mappedName());
             }
 
             // Override the lookup name if not set
             if (reference.getLookupName() == null) {
                 final String lookupName = getLookupName(resource);
-                if (!lookupName.equals("")) {
+                if (!lookupName.isEmpty()) {
                     reference.setLookupName(lookupName);
                 }
             }
@@ -4606,7 +4606,7 @@ public class AnnotationDeployer implements DynamicDeployer {
                 }
             }
 
-            if (persistenceUnitRef.getPersistenceUnitName() == null && !persistenceUnit.unitName().equals(""))
{
+            if (persistenceUnitRef.getPersistenceUnitName() == null && !persistenceUnit.unitName().isEmpty())
{
                 persistenceUnitRef.setPersistenceUnitName(persistenceUnit.unitName());
             }
         }
@@ -4903,7 +4903,7 @@ public class AnnotationDeployer implements DynamicDeployer {
             ServiceRef serviceRef;
 
             String refName = webService.name();
-            if (refName.equals("")) {
+            if (refName.isEmpty()) {
                 if (member == null) {
                     //TODO fail
                     return;
@@ -4964,7 +4964,7 @@ public class AnnotationDeployer implements DynamicDeployer {
             // Set the mappedName
             if (serviceRef.getMappedName() == null) {
                 String mappedName = webService.mappedName();
-                if (mappedName.equals("")) {
+                if (mappedName.isEmpty()) {
                     mappedName = null;
                 }
                 serviceRef.setMappedName(mappedName);
@@ -4973,7 +4973,7 @@ public class AnnotationDeployer implements DynamicDeployer {
             // wsdl file
             if (serviceRef.getWsdlFile() == null) {
                 final String wsdlLocation = webService.wsdlLocation();
-                if (!wsdlLocation.equals("")) {
+                if (!wsdlLocation.isEmpty()) {
                     serviceRef.setWsdlFile(wsdlLocation);
                 }
             }

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
index 1d0ba80..1ef4dd2 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/EjbJarInfoBuilder.java
@@ -665,11 +665,11 @@ public class EjbJarInfoBuilder {
         methodInfo.ejbName = method.getEjbName();
         methodInfo.methodIntf = method.getMethodIntf() == null ? null : method.getMethodIntf().toString();
         methodInfo.methodName = method.getMethodName();
-        if (methodInfo.methodName == null || methodInfo.methodName.equals("")) {
+        if (methodInfo.methodName == null || methodInfo.methodName.isEmpty()) {
             methodInfo.methodName = "*";
         }
         methodInfo.className = method.getClassName();
-        if (methodInfo.className == null || methodInfo.className.equals("")) {
+        if (methodInfo.className == null || methodInfo.className.isEmpty()) {
             methodInfo.className = "*";
         }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
index f15f4ab..1ab0dcc 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
@@ -84,7 +84,7 @@ public class PersistenceContextAnnFactory {
             }
 
             String name = persistenceContext.name();
-            if (name == null || name.equals("")) {
+            if (name == null || name.isEmpty()) {
                 name = member == null ? null : member.getDeclaringClass().getName() + "/"
+ member.getName();
             }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
index 3a6d985..0c9eb04 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
@@ -109,7 +109,7 @@ public class IvmContext implements Context, Serializable {
     }
 
     public Object lookup(final String compositName) throws NamingException {
-        if (compositName.equals("")) {
+        if (compositName.isEmpty()) {
             return this;
         }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/core/webservices/JaxWsUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/webservices/JaxWsUtils.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/webservices/JaxWsUtils.java
index 29f04b2..6dd3931 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/webservices/JaxWsUtils.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/webservices/JaxWsUtils.java
@@ -286,12 +286,12 @@ public final class JaxWsUtils {
 
     public static String getServiceWsdlLocation(final Class<?> clazz, final ClassLoader
loader) {
         final String wsdlLocation = getWsdlLocation(clazz);
-        if (wsdlLocation != null && !wsdlLocation.equals("")) {
+        if (wsdlLocation != null && !wsdlLocation.isEmpty()) {
             return wsdlLocation;
         }
 
         final String serviceInterfaceClassName = getServiceInterface(clazz);
-        if (serviceInterfaceClassName != null && !serviceInterfaceClassName.equals(""))
{
+        if (serviceInterfaceClassName != null && !serviceInterfaceClassName.isEmpty())
{
             try {
                 final Class serviceInterfaceClass = loader.loadClass(serviceInterfaceClassName);
                 return getWsdlLocation(serviceInterfaceClass);
@@ -304,7 +304,7 @@ public final class JaxWsUtils {
 
     public static boolean containsWsdlLocation(final Class<?> clazz, final ClassLoader
loader) {
         final String wsdlLocSEIFromAnnotation = getServiceWsdlLocation(clazz, loader);
-        return wsdlLocSEIFromAnnotation != null && !wsdlLocSEIFromAnnotation.equals("");
+        return wsdlLocSEIFromAnnotation != null && !wsdlLocSEIFromAnnotation.isEmpty();
     }
 
     public static String getBindingUriFromAnn(final Class<?> clazz) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicDataSource.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicDataSource.java
b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicDataSource.java
index 38a5097..181ec26 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicDataSource.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicDataSource.java
@@ -153,7 +153,7 @@ public class BasicDataSource extends org.apache.commons.dbcp2.BasicDataSource
im
     }
 
     public synchronized void setDefaultTransactionIsolation(final String s) {
-        if (s == null || s.equals("")) {
+        if (s == null || s.isEmpty()) {
             return;
         }
         final int level = IsolationLevels.getIsolationLevel(s);

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
index c3d92e5..6983a60 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/dbcp/BasicManagedDataSource.java
@@ -260,7 +260,7 @@ public class BasicManagedDataSource extends org.apache.commons.dbcp2.managed.Bas
         final ReentrantLock l = lock;
         l.lock();
         try {
-            if (s == null || s.equals("")) {
+            if (s == null || s.isEmpty()) {
                 return;
             }
             final int level = IsolationLevels.getIsolationLevel(s);

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jPrintWriter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jPrintWriter.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jPrintWriter.java
index f8b3069..6a11c5d 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jPrintWriter.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Log4jPrintWriter.java
@@ -46,7 +46,7 @@ public class Log4jPrintWriter extends PrintWriter {
     }
 
     public void flush() {
-        if (!text.toString().equals("")) {
+        if (!text.toString().isEmpty()) {
             flushLine();
         }
     }
@@ -88,7 +88,7 @@ public class Log4jPrintWriter extends PrintWriter {
     }
 
     public void println() {
-        if (!text.toString().equals("")) {
+        if (!text.toString().isEmpty()) {
             flushLine();
         }
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/util/LoggingPrintWriter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/LoggingPrintWriter.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/LoggingPrintWriter.java
index ab26c0d..561f318 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/LoggingPrintWriter.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/LoggingPrintWriter.java
@@ -41,7 +41,7 @@ public class LoggingPrintWriter extends PrintWriter {
     }
 
     public void flush() {
-        if (!text.toString().equals("")) {
+        if (!text.toString().isEmpty()) {
             flushLine();
         }
     }
@@ -83,7 +83,7 @@ public class LoggingPrintWriter extends PrintWriter {
     }
 
     public void println() {
-        if (!text.toString().equals("")) {
+        if (!text.toString().isEmpty()) {
             flushLine();
         }
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-core/src/main/java/org/apache/openejb/util/Strings.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Strings.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Strings.java
index f1b8e48..b568308 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/Strings.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Strings.java
@@ -100,7 +100,7 @@ public class Strings {
     }
 
     public static String replaceNullOrBlankStringWithNonBreakingSpace(final String stringToCheckForNull)
{
-        if (stringToCheckForNull == null || stringToCheckForNull.equals("")) {
+        if (stringToCheckForNull == null || stringToCheckForNull.isEmpty()) {
             return "&nbsp;";
         } else {
             return stringToCheckForNull;

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb2/NamespaceFilter.java
----------------------------------------------------------------------
diff --git a/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb2/NamespaceFilter.java
b/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb2/NamespaceFilter.java
index 896f234..a8a1eb1 100644
--- a/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb2/NamespaceFilter.java
+++ b/container/openejb-jee/src/main/java/org/apache/openejb/jee/oejb2/NamespaceFilter.java
@@ -190,7 +190,7 @@ public class NamespaceFilter extends XMLFilterImpl {
             } else {
                 uri = possibleNamespaces.get(0);
             }
-        } else if (correctable && !previousNs.equals(uri) && !previousNs.equals(""))
{
+        } else if (correctable && !previousNs.equals(uri) && !previousNs.isEmpty())
{
             uri = previousNs;
         }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/5d75e345/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index d6e2482..fb4ac13 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -112,7 +112,7 @@ public class Options {
 
         final String value = properties.getProperty(property);
 
-        if (value == null || value.equals("")) {
+        if (value == null || value.isEmpty()) {
             return parent.get(property, defaultValue);
         }
 
@@ -131,7 +131,7 @@ public class Options {
     public int get(final String property, final int defaultValue) {
         final String value = properties.getProperty(property);
 
-        if (value == null || value.equals("")) {
+        if (value == null || value.isEmpty()) {
             return parent.get(property, defaultValue);
         }
 
@@ -146,7 +146,7 @@ public class Options {
     public long get(final String property, final long defaultValue) {
         final String value = properties.getProperty(property);
 
-        if (value == null || value.equals("")) {
+        if (value == null || value.isEmpty()) {
             return parent.get(property, defaultValue);
         }
 
@@ -161,7 +161,7 @@ public class Options {
     public boolean get(final String property, final boolean defaultValue) {
         final String value = properties.getProperty(property);
 
-        if (value == null || value.equals("")) {
+        if (value == null || value.isEmpty()) {
             return parent.get(property, defaultValue);
         }
 
@@ -192,7 +192,7 @@ public class Options {
     public <T extends Enum<T>> T get(final String property, final T defaultValue)
{
         final String value = properties.getProperty(property);
 
-        if (value == null || value.equals("")) {
+        if (value == null || value.isEmpty()) {
             return parent.get(property, defaultValue);
         }
 
@@ -234,7 +234,7 @@ public class Options {
     protected <T extends Enum<T>> Set<T> getAll(final String property,
final Set<T> defaultValue, final Class<T> enumType) {
         final String value = properties.getProperty(property);
 
-        if (value == null || value.equals("")) {
+        if (value == null || value.isEmpty()) {
             return parent.getAll(property, defaultValue, enumType);
         }
 


Mime
View raw message