tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [7/9] tomee git commit: Uses indexOf with chart instead of String
Date Mon, 10 Dec 2018 13:23:55 GMT
Uses indexOf with chart instead of String


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

Branch: refs/heads/master
Commit: fbe2c486d8c9000626126c8dba9ee694e7b04682
Parents: 5d75e34
Author: Otavio Santana <otaviopolianasantana@gmail.com>
Authored: Fri Dec 7 17:51:01 2018 -0200
Committer: Otavio Santana <otaviopolianasantana@gmail.com>
Committed: Fri Dec 7 17:51:01 2018 -0200

----------------------------------------------------------------------
 .../org/apache/openejb/assembler/classic/Assembler.java |  4 ++--
 .../apache/openejb/assembler/classic/JndiBuilder.java   |  2 +-
 .../src/main/java/org/apache/openejb/cli/Bootstrap.java |  6 +++---
 .../src/main/java/org/apache/openejb/cli/MainImpl.java  |  6 +++---
 .../org/apache/openejb/config/InitEjbDeployments.java   |  2 +-
 .../org/apache/openejb/config/QuickServerXmlParser.java |  2 +-
 .../java/org/apache/openejb/config/ServiceUtils.java    | 12 ++++++------
 .../org/apache/openejb/core/ivm/naming/IvmContext.java  |  8 ++++----
 .../org/apache/openejb/core/timer/EJBCronTrigger.java   |  2 +-
 .../openejb/resource/jdbc/router/FailOverRouter.java    |  2 +-
 .../java/org/apache/openejb/util/AnnotationFinder.java  |  2 +-
 .../org/apache/openejb/util/IntrospectionSupport.java   |  2 +-
 .../src/main/java/org/apache/openejb/util/Logger.java   |  4 ++--
 .../src/main/java/org/apache/openejb/util/Messages.java |  2 +-
 .../main/java/org/apache/openejb/util/URISupport.java   | 10 +++++-----
 .../java/org/apache/openejb/util/UpdateChecker.java     |  2 +-
 .../src/main/java/org/apache/openejb/util/UrlCache.java |  2 +-
 .../openejb/util/proxy/LocalBeanProxyFactory.java       |  2 +-
 .../apache/openejb/web/LightweightWebAppBuilder.java    |  2 +-
 .../openejb/config/rules/ValidationKeysAuditorTest.java |  4 ++--
 .../main/java/org/apache/openejb/javaagent/Agent.java   |  2 +-
 .../openejb/jee/HandlerChainsStringQNameAdapter.java    |  2 +-
 .../openejb/loader/provisining/MavenResolver.java       |  2 +-
 23 files changed, 42 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
index a0cf0fb..b7b2c3a 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
@@ -1434,7 +1434,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             // a bit weird but just to be consistent if user doesn't lookup directly the
resource
             final Context lastContext = Contexts.createSubcontexts(containerSystemContext,
path);
             try {
-                lastContext.rebind(path.substring(path.lastIndexOf("/") + 1, path.length()),
value.getValue());
+                lastContext.rebind(path.substring(path.lastIndexOf('/') + 1, path.length()),
value.getValue());
             } catch (final NameAlreadyBoundException nabe) {
                 nabe.printStackTrace();
             }
@@ -2630,7 +2630,7 @@ public class Assembler extends AssemblerTool implements org.apache.openejb.spi.A
             object = globalContext.lookup(name);
         } catch (final NamingException e) {
             // if we catch a NamingException, check to see if the resource is a LaztObjectReference
that has not been initialized correctly
-            final String ctx = name.substring(0, name.lastIndexOf("/"));
+            final String ctx = name.substring(0, name.lastIndexOf('/'));
             final String objName = name.substring(ctx.length() + 1);
             final NamingEnumeration<Binding> bindings = globalContext.listBindings(ctx);
             while (bindings.hasMoreElements()) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
index 1f22357..640fb42 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
@@ -203,7 +203,7 @@ public class JndiBuilder {
             format = options.get(JNDINAME_FORMAT, "{deploymentId}{interfaceType.annotationName}");
 
             { // illegal format check
-                final int index = format.indexOf(":");
+                final int index = format.indexOf(':');
                 if (index > -1) {
                     logger.error("Illegal " + JNDINAME_FORMAT + " contains a colon ':'. 
Everything before the colon will be removed, '" + format + "' ");
                     format = format.substring(index + 1);

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
index 9582fcb..1b5ca52 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
@@ -64,7 +64,7 @@ public class Bootstrap {
             if (classURL != null) {
                 String propsString = classURL.getFile();
 
-                propsString = propsString.substring(0, propsString.indexOf("!"));
+                propsString = propsString.substring(0, propsString.indexOf('!'));
 
                 final URI uri = URLs.uri(propsString);
 
@@ -83,8 +83,8 @@ public class Bootstrap {
     }
 
     private static void addProperty(final String arg) {
-        final String prop = arg.substring(arg.indexOf("-D") + 2, arg.indexOf("="));
-        final String val = arg.substring(arg.indexOf("=") + 1);
+        final String prop = arg.substring(arg.indexOf("-D") + 2, arg.indexOf('='));
+        final String val = arg.substring(arg.indexOf('=') + 1);
 
         JavaSecurityManagers.setSystemProperty(prop, val);
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java b/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java
index 239a860..e241f17 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cli/MainImpl.java
@@ -166,8 +166,8 @@ public class MainImpl implements Main {
         // be changed.
         for (final String arg : args) {
             if (arg.indexOf("-Dopenejb.base") != -1) {
-                final String prop = arg.substring(arg.indexOf("-D") + 2, arg.indexOf("="));
-                final String val = arg.substring(arg.indexOf("=") + 1);
+                final String prop = arg.substring(arg.indexOf("-D") + 2, arg.indexOf('='));
+                final String val = arg.substring(arg.indexOf('=') + 1);
 
                 JavaSecurityManagers.setSystemProperty(prop, val);
             }
@@ -188,7 +188,7 @@ public class MainImpl implements Main {
         // Now read in and apply the properties specified on the command line
         for (final String arg : args) {
             final int idx = arg.indexOf("-D");
-            final int eq = arg.indexOf("=");
+            final int eq = arg.indexOf('=');
             if (idx >= 0 && eq > idx) {
                 final String prop = arg.substring(idx + 2, eq);
                 final String val = arg.substring(eq + 1);

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
index c9b768c..5658d5d 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/InitEjbDeployments.java
@@ -208,7 +208,7 @@ public class InitEjbDeployments implements DynamicDeployer {
 
         // we don't have the ejb class object (only the string name) so we have
         // to extract the simple name from the FQN of the class
-        final int simpleNameIdx = bean.getEjbClass().lastIndexOf(".");
+        final int simpleNameIdx = bean.getEjbClass().lastIndexOf('.');
         contextData.put("ejbClass.simpleName", bean.getEjbClass().substring(simpleNameIdx
+ 1));
 
         contextData.put("ejbName", bean.getEjbName());

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/config/QuickServerXmlParser.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/QuickServerXmlParser.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/QuickServerXmlParser.java
index df68658..1cae67e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/QuickServerXmlParser.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/QuickServerXmlParser.java
@@ -78,7 +78,7 @@ public class QuickServerXmlParser extends DefaultHandler {
             if (protocol == null) {
                 protocol = DEFAULT_CONNECTOR_KEY;
             } else if (protocol.contains("/")) {
-                protocol = protocol.substring(0, protocol.indexOf("/"));
+                protocol = protocol.substring(0, protocol.indexOf('/'));
             }
             final String port = attributes.getValue("port");
             final String ssl = attributes.getValue("secure");

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
index 45eb971..170966b 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
@@ -237,12 +237,12 @@ public class ServiceUtils {
         String providerName = null;
         String serviceName = null;
 
-        if (id.indexOf("#") != -1) {
-            providerName = id.substring(0, id.indexOf("#"));
-            serviceName = id.substring(id.indexOf("#") + 1);
-        } else if (id.indexOf(":") != -1) {
-            providerName = id.substring(0, id.indexOf(":"));
-            serviceName = id.substring(id.indexOf(":") + 1);
+        if (id.indexOf('#') != -1) {
+            providerName = id.substring(0, id.indexOf('#'));
+            serviceName = id.substring(id.indexOf('#') + 1);
+        } else if (id.indexOf(':') != -1) {
+            providerName = id.substring(0, id.indexOf(':'));
+            serviceName = id.substring(id.indexOf(':') + 1);
         } else {
             providerName = currentDefaultProviderUrl(DEFAULT_PROVIDER_URL);
             serviceName = id;

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/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 0c9eb04..ead5b3f 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
@@ -114,7 +114,7 @@ public class IvmContext implements Context, Serializable {
         }
 
         final String compoundName;
-        final int index = compositName.indexOf(":");
+        final int index = compositName.indexOf(':');
         if (index > -1) {
 
             final String prefix = compositName.substring(0, index);
@@ -307,7 +307,7 @@ public class IvmContext implements Context, Serializable {
         if(checkReadOnly()) {
             return;
         }
-        final int indx = name.indexOf(":");
+        final int indx = name.indexOf(':');
         if (indx > -1) {
             /*
              The ':' character will be in the path if its an absolute path name starting
with the schema
@@ -348,7 +348,7 @@ public class IvmContext implements Context, Serializable {
         if(checkReadOnly()) {
             return;
         }
-        final int indx = name.indexOf(":");
+        final int indx = name.indexOf(':');
         if (indx > -1) {
             /*
              The ':' character will be in the path if its an absolute path name starting
with the schema
@@ -422,7 +422,7 @@ public class IvmContext implements Context, Serializable {
             //TODO: null is fine if there is a one time - 10 calls will log a single time
- log line (warning?)
             return null;
         }
-        final int indx = name.indexOf(":");
+        final int indx = name.indexOf(':');
         if (indx > -1) {
             /*
           The ':' character will be in the path if its an absolute path name starting with
the schema

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java
index 585a3e9..97e2f6e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java
@@ -162,7 +162,7 @@ public class EJBCronTrigger extends CronTriggerImpl {
         expr = expr.replaceAll("\\s+", "").toUpperCase(Locale.ENGLISH);
 
 
-        if (expr.length() > 1 && expr.indexOf(",") > 0) {
+        if (expr.length() > 1 && expr.indexOf(',') > 0) {
 
             final String[] expressions = expr.split(",");
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
index 934d5ee..a759bb9 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/router/FailOverRouter.java
@@ -124,7 +124,7 @@ public class FailOverRouter extends AbstractRouter {
                     public Collection<DataSourceHolder> prepare(final Collection<DataSourceHolder>
list) {
                         final int step;
                         if (strategy.contains("%")) {
-                            step = Math.max(1, Integer.parseInt(strategy.substring(strategy.lastIndexOf("%")
+ 1)));
+                            step = Math.max(1, Integer.parseInt(strategy.substring(strategy.lastIndexOf('%')
+ 1)));
                         } else {
                             step = 1;
                         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/AnnotationFinder.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/AnnotationFinder.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/AnnotationFinder.java
index 65ac86e..e833805 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/AnnotationFinder.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/AnnotationFinder.java
@@ -230,7 +230,7 @@ public class AnnotationFinder {
     private static List<String> jar(final URL location) throws IOException, URISyntaxException
{
         String jarPath = location.getFile();
         if (jarPath.contains("!")) {
-            jarPath = jarPath.substring(0, jarPath.indexOf("!"));
+            jarPath = jarPath.substring(0, jarPath.indexOf('!'));
         }
         final URL url = new URL(jarPath);
         if ("file".equals(url.getProtocol())) { // ZipFile is faster than ZipInputStream

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/IntrospectionSupport.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/IntrospectionSupport.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/IntrospectionSupport.java
index 1f0a16e..6815e41 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/IntrospectionSupport.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/IntrospectionSupport.java
@@ -262,7 +262,7 @@ public class IntrospectionSupport {
 
     public static String simpleName(final Class clazz) {
         String name = clazz.getName();
-        final int p = name.lastIndexOf(".");
+        final int p = name.lastIndexOf('.');
         if (p >= 0) {
             name = name.substring(p + 1);
         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
index 640a064..e7cb77c 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
@@ -216,7 +216,7 @@ public class Logger {
     private static final Computable<String, String> heirarchyResolver = new Computable<String,
String>() {
         @Override
         public String compute(final String key) throws InterruptedException {
-            final int index = key.lastIndexOf(".");
+            final int index = key.lastIndexOf('.');
             final String parent = key.substring(0, index);
             if (parent.contains(OPENEJB)) {
                 return parent;
@@ -318,7 +318,7 @@ public class Logger {
 
     private static String packageName(final Class clazz) {
         final String name = clazz.getName();
-        return name.substring(0, name.lastIndexOf("."));
+        return name.substring(0, name.lastIndexOf('.'));
     }
 
     private static Boolean isLog4j;

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java b/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java
index ddaf1b0..ef7f835 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/Messages.java
@@ -43,7 +43,7 @@ public class Messages {
 
     private static String packageName(final Class clazz) {
         final String name = clazz.getName();
-        return name.substring(0, name.lastIndexOf("."));
+        return name.substring(0, name.lastIndexOf('.'));
     }
 
     public Messages(final String resourceName) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java
index bb2c6cb..829327b 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/URISupport.java
@@ -172,7 +172,7 @@ public class URISupport {
             if (uri != null) {
                 final String[] parameters = uri.split("&");
                 for (int i = 0; i < parameters.length; i++) {
-                    final int p = parameters[i].indexOf("=");
+                    final int p = parameters[i].indexOf('=');
                     if (p >= 0) {
                         final String name = URLDecoder.decode(parameters[i].substring(0,
p), "UTF-8");
                         final String value = URLDecoder.decode(parameters[i].substring(p
+ 1), "UTF-8");
@@ -227,15 +227,15 @@ public class URISupport {
         }
 
         int p;
-        final int intialParen = ssp.indexOf("(");
+        final int intialParen = ssp.indexOf('(');
         if (intialParen == 0) {
             rc.host = ssp.substring(0, intialParen);
-            p = rc.host.indexOf("/");
+            p = rc.host.indexOf('/');
             if (p >= 0) {
                 rc.path = rc.host.substring(p);
                 rc.host = rc.host.substring(0, p);
             }
-            p = ssp.lastIndexOf(")");
+            p = ssp.lastIndexOf(')');
             componentString = ssp.substring(intialParen + 1, p);
             params = ssp.substring(p + 1).trim();
 
@@ -250,7 +250,7 @@ public class URISupport {
             rc.components[i] = new URI(components[i].trim());
         }
 
-        p = params.indexOf("?");
+        p = params.indexOf('?');
         if (p >= 0) {
             if (p > 0) {
                 rc.path = stripPrefix(params.substring(0, p), "/");

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/UpdateChecker.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/UpdateChecker.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/UpdateChecker.java
index fd8a35a..83e3cca 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/UpdateChecker.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/UpdateChecker.java
@@ -74,7 +74,7 @@ public class UpdateChecker {
 
                 final String userInfo = proxyUrl.getUserInfo();
                 if (userInfo != null) {
-                    final int sep = userInfo.indexOf(":");
+                    final int sep = userInfo.indexOf(':');
                     if (sep >= 0) {
                         JavaSecurityManagers.setSystemProperty(proxyProtocol + ".proxyUser",
userInfo.substring(0, sep));
                         JavaSecurityManagers.setSystemProperty(proxyProtocol + ".proxyPassword",
userInfo.substring(sep + 1));

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java b/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java
index 25c20a1..e532d41 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/UrlCache.java
@@ -202,7 +202,7 @@ public class UrlCache {
 
         // generate a nice cache file name
         final String name = sourceFile.getName();
-        final int dot = name.lastIndexOf(".");
+        final int dot = name.lastIndexOf('.');
         String prefix = name;
         String suffix = "";
         if (dot > 0) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
index 07667ad..551d435 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyFactory.java
@@ -676,7 +676,7 @@ public class LocalBeanProxyFactory implements Opcodes {
                 String className = parameterType.getCanonicalName();
 
                 if (parameterType.isMemberClass()) {
-                    final int lastDot = className.lastIndexOf(".");
+                    final int lastDot = className.lastIndexOf('.');
                     className = className.substring(0, lastDot) + "$" + className.substring(lastDot
+ 1);
                 }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java
b/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java
index 2c72a19..9a869c3 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/web/LightweightWebAppBuilder.java
@@ -432,7 +432,7 @@ public class LightweightWebAppBuilder implements WebAppBuilder {
         try { // in WEB-INF/classes
             return loader.loadClass(className(classname));
         } catch (final ClassNotFoundException cnfe) { // in a dependency (jar)
-            return loader.loadClass(className(path.substring(path.indexOf("!") + 2)));
+            return loader.loadClass(className(path.substring(path.indexOf('!') + 2)));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
b/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
index 843e22f..dca0411 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
@@ -161,7 +161,7 @@ public class ValidationKeysAuditorTest {
 
     private String createConfluenceLink(final String string) {
         String link = "[" + string + " | ";
-        final String temp = string.substring(0, string.lastIndexOf("."));
+        final String temp = string.substring(0, string.lastIndexOf('.'));
         final String location = "https://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/"
+ temp + ".java?revision=HEAD&view=markup ]";
         link = link + location;
         return link;
@@ -302,7 +302,7 @@ public class ValidationKeysAuditorTest {
     private static Set<String> stripPrefixes(final Set<String> allKeys) {
         final Set<String> keys = new HashSet<>();
         for (String key : allKeys) {
-            key = key.substring(key.indexOf(".") + 1);
+            key = key.substring(key.indexOf('.') + 1);
             if (!keys.contains(key))
                 keys.add(key);
         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java
----------------------------------------------------------------------
diff --git a/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java
b/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java
index 092fbc1..9e18a41 100644
--- a/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java
+++ b/container/openejb-javaagent/src/main/java/org/apache/openejb/javaagent/Agent.java
@@ -170,7 +170,7 @@ public class Agent {
         final RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
         String pid = bean.getName();
         if (pid.contains("@")) {
-            pid = pid.substring(0, pid.indexOf("@"));
+            pid = pid.substring(0, pid.indexOf('@'));
         }
         return pid;
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-jee/src/main/java/org/apache/openejb/jee/HandlerChainsStringQNameAdapter.java
----------------------------------------------------------------------
diff --git a/container/openejb-jee/src/main/java/org/apache/openejb/jee/HandlerChainsStringQNameAdapter.java
b/container/openejb-jee/src/main/java/org/apache/openejb/jee/HandlerChainsStringQNameAdapter.java
index 294286f..3f5f91e 100644
--- a/container/openejb-jee/src/main/java/org/apache/openejb/jee/HandlerChainsStringQNameAdapter.java
+++ b/container/openejb-jee/src/main/java/org/apache/openejb/jee/HandlerChainsStringQNameAdapter.java
@@ -37,7 +37,7 @@ public class HandlerChainsStringQNameAdapter extends XmlAdapter<String,
QName> {
         if (value == null || value.isEmpty()) {
             return new QName(XMLConstants.NULL_NS_URI, "");
         }
-        final int colonIndex = value.indexOf(":");
+        final int colonIndex = value.indexOf(':');
         if (colonIndex == -1) {
             return new QName(XMLConstants.NULL_NS_URI, value);
         }

http://git-wip-us.apache.org/repos/asf/tomee/blob/fbe2c486/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
index 2f8c60d..3f82993 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
@@ -115,7 +115,7 @@ public class MavenResolver implements ArchiveResolver, ProvisioningResolverAware
 
             // try first locally
         } else {
-            final int repoIdx = raw.lastIndexOf("!");
+            final int repoIdx = raw.lastIndexOf('!');
             toParse = raw.substring(repoIdx + 1);
         }
 


Mime
View raw message