Camel-bindy was failing for me. Fixed Il lun 6 apr 2020, 20:50 Pascal Schumacher <[email protected]> ha scritto:
> Yes, the commit I committed this morning did not compile (saw your mail). > > Sorry about that. :( > > The reason were these PackageHelper changes: > > > https://github.com/apache/camel/commit/93e11b338ca61415a84c500622ac8f7a2024ce99#diff-e589ec19f41e386bd5611b12566203af > > The new commit does not contain these changes. > > > > > > Am 06.04.2020 um 20:42 schrieb Andrea Cosentino: > > This doesn't compile. At least this morning with jdk8 > > > > Il lun 6 apr 2020, 20:33 <[email protected]> ha scritto: > > > >> This is an automated email from the ASF dual-hosted git repository. > >> > >> pascalschumacher pushed a commit to branch master > >> in repository https://gitbox.apache.org/repos/asf/camel.git > >> > >> commit f742967176a8c8313645d2091d53071ece42c104 > >> Author: Pascal Schumacher <[email protected]> > >> AuthorDate: Mon Apr 6 20:30:15 2020 +0200 > >> > >> Switch to faster String#indexOf method taking a char parameter. > >> --- > >> .../src/main/java/org/apache/camel/parser/RouteBuilderParser.java | 2 > +- > >> .../src/main/java/org/apache/camel/parser/XmlRouteParser.java | 2 > +- > >> .../component/aws/xray/decorators/AbstractSegmentDecorator.java | 6 > >> +++--- > >> .../camel/component/aws/xray/component/TestXRayProducer.java | 2 > +- > >> .../main/java/org/apache/camel/language/bean/BeanLanguage.java | 2 > +- > >> .../java/org/apache/camel/dataformat/bindy/UnicodeHelperTest.java | 8 > >> ++++---- > >> .../java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java | 4 > ++-- > >> .../java/org/apache/camel/component/dozer/ExpressionMapper.java | 4 > ++-- > >> .../java/org/apache/camel/component/file/remote/FtpComponent.java | 4 > ++-- > >> .../org/apache/camel/component/file/remote/SftpComponent.java | 2 > +- > >> .../google/bigquery/sql/GoogleBigQuerySQLConfiguration.java | 2 > +- > >> .../src/main/java/org/apache/camel/http/base/HttpHelper.java | 2 > +- > >> .../src/main/java/org/apache/camel/http/common/HttpHelper.java | 2 > +- > >> .../main/java/org/apache/camel/component/http/HttpProducer.java | 2 > +- > >> .../java/org/apache/camel/component/irc/IrcConfiguration.java | 2 > +- > >> .../main/java/org/apache/camel/component/scp/ScpComponent.java | 2 > +- > >> .../java/org/apache/camel/component/mail/MailConfiguration.java | 2 > +- > >> .../org/apache/camel/component/milo/AbstractMiloServerTest.java | 2 > +- > >> .../org/apache/camel/component/netty/http/NettyHttpHelper.java | 2 > +- > >> .../main/java/org/apache/camel/component/rest/RestProducer.java | 4 > ++-- > >> .../salesforce/internal/streaming/SubscriptionHelper.java | 2 > +- > >> .../org/apache/camel/component/websocket/WebsocketComponent.java | 8 > >> ++++---- > >> .../camel/component/zookeeper/operations/ZooKeeperHelper.java | 2 > +- > >> .../java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java | 6 > >> +++--- > >> .../src/main/java/org/apache/camel/impl/RouteIdFactory.java | 2 > +- > >> .../java/org/apache/camel/builder/xml/XPathTransformTest.java | 2 > +- > >> .../src/main/java/org/apache/camel/main/BaseMainSupport.java | 4 > ++-- > >> .../src/main/java/org/apache/camel/support/ResourceHelper.java | 2 > +- > >> .../src/main/java/org/apache/camel/xml/io/XmlStreamReader.java | 6 > >> +++--- > >> .../src/test/java/org/apache/camel/xml/in/ModelParserTest.java | 2 > +- > >> .../main/java/org/apache/camel/maven/packaging/XRefCheckMojo.java | 4 > ++-- > >> 31 files changed, 49 insertions(+), 49 deletions(-) > >> > >> diff --git > >> > a/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/RouteBuilderParser.java > >> > b/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/RouteBuilderParser.java > >> index 76d51e1..af5bb24 100644 > >> --- > >> > a/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/RouteBuilderParser.java > >> +++ > >> > b/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/RouteBuilderParser.java > >> @@ -432,7 +432,7 @@ public final class RouteBuilderParser { > >> > >> private static String endpointComponentName(String uri) { > >> if (uri != null) { > >> - int idx = uri.indexOf(":"); > >> + int idx = uri.indexOf(':'); > >> if (idx > 0) { > >> return uri.substring(0, idx); > >> } > >> diff --git > >> > a/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/XmlRouteParser.java > >> > b/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/XmlRouteParser.java > >> index 1c1f9d3..e1a2cb0 100644 > >> --- > >> > a/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/XmlRouteParser.java > >> +++ > >> > b/catalog/camel-route-parser/src/main/java/org/apache/camel/parser/XmlRouteParser.java > >> @@ -308,7 +308,7 @@ public final class XmlRouteParser { > >> > >> private static String endpointComponentName(String uri) { > >> if (uri != null) { > >> - int idx = uri.indexOf(":"); > >> + int idx = uri.indexOf(':'); > >> if (idx > 0) { > >> return uri.substring(0, idx); > >> } > >> diff --git > >> > a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java > >> > b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java > >> index aeb457b..c5e0adc 100644 > >> --- > >> > a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java > >> +++ > >> > b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/AbstractSegmentDecorator.java > >> @@ -67,13 +67,13 @@ public abstract class AbstractSegmentDecorator > >> implements SegmentDecorator { > >> * @return The stripped value from the URI > >> */ > >> public static String stripSchemeAndOptions(Endpoint endpoint) { > >> - int start = endpoint.getEndpointUri().indexOf(":"); > >> + int start = endpoint.getEndpointUri().indexOf(':'); > >> start++; > >> // Remove any leading '/' > >> while (endpoint.getEndpointUri().charAt(start) == '/') { > >> start++; > >> } > >> - int end = endpoint.getEndpointUri().indexOf("?"); > >> + int end = endpoint.getEndpointUri().indexOf('?'); > >> return end == -1 ? endpoint.getEndpointUri().substring(start) > : > >> endpoint.getEndpointUri().substring(start, end); > >> } > >> > >> @@ -84,7 +84,7 @@ public abstract class AbstractSegmentDecorator > >> implements SegmentDecorator { > >> * @return A {@link Map} representation of the contained > parameters > >> of the provided URI > >> */ > >> public static Map<String, String> toQueryParameters(String uri) { > >> - int index = uri.indexOf("?"); > >> + int index = uri.indexOf('?'); > >> if (index != -1) { > >> String queryString = uri.substring(index + 1); > >> Map<String, String> map = new HashMap<>(); > >> diff --git > >> > a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/component/TestXRayProducer.java > >> > b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/component/TestXRayProducer.java > >> index f77fac2..23e7d17 100644 > >> --- > >> > a/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/component/TestXRayProducer.java > >> +++ > >> > b/components/camel-aws-xray/src/test/java/org/apache/camel/component/aws/xray/component/TestXRayProducer.java > >> @@ -47,6 +47,6 @@ public class TestXRayProducer extends DefaultProducer > { > >> } > >> > >> private static String trim(String endpoint) { > >> - return endpoint.substring(endpoint.indexOf(":") + 1); > >> + return endpoint.substring(endpoint.indexOf(':') + 1); > >> } > >> } > >> diff --git > >> > a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java > >> > b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java > >> index bde8853..2ae6b7b 100644 > >> --- > >> > a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java > >> +++ > >> > b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java > >> @@ -129,7 +129,7 @@ public class BeanLanguage extends LanguageSupport > >> implements GeneratedPropertyCo > >> //first check case :: because of my.own.Bean::method > >> int doubleColonIndex = expression.indexOf("::"); > >> //need to check that not inside params > >> - int beginOfParameterDeclaration = expression.indexOf("("); > >> + int beginOfParameterDeclaration = expression.indexOf('('); > >> if (doubleColonIndex > 0 && (!expression.contains("(") || > >> doubleColonIndex < beginOfParameterDeclaration)) { > >> beanName = expression.substring(0, doubleColonIndex); > >> method = expression.substring(doubleColonIndex + 2); > >> diff --git > >> > a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/UnicodeHelperTest.java > >> > b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/UnicodeHelperTest.java > >> index b2e7fdb..0dc5533 100644 > >> --- > >> > a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/UnicodeHelperTest.java > >> +++ > >> > b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/UnicodeHelperTest.java > >> @@ -166,7 +166,7 @@ public class UnicodeHelperTest { > >> @Test > >> public void testIndexOf() { > >> final UnicodeHelper lh = new UnicodeHelper("a", > >> Method.CODEPOINTS); > >> - Assert.assertEquals(-1, lh.indexOf("b")); > >> + Assert.assertEquals(-1, lh.indexOf('b')); > >> > >> final UnicodeHelper lh2 = new UnicodeHelper( > >> "a" + new String(Character.toChars(0x1f600)) + "a" + > UCSTR + > >> "A" + "k\u035fh" + "z" > >> @@ -186,7 +186,7 @@ public class UnicodeHelperTest { > >> @Test > >> public void testIndexOf2() { > >> final UnicodeHelper lh = new UnicodeHelper("a", > Method.GRAPHEME); > >> - Assert.assertEquals(-1, lh.indexOf("b")); > >> + Assert.assertEquals(-1, lh.indexOf('b')); > >> > >> final UnicodeHelper lh2 = new UnicodeHelper( > >> "a" + new String(Character.toChars(0x1f600)) + "a" + > UCSTR + > >> "A" + "k\u035fh" + "z" > >> @@ -201,8 +201,8 @@ public class UnicodeHelperTest { > >> Assert.assertEquals(11, lh2.indexOf(UCSTR), 8); > >> > >> final UnicodeHelper lh3 = new UnicodeHelper("mm̂mm̂m", > >> Method.GRAPHEME); > >> - Assert.assertEquals(0, lh3.indexOf("m")); > >> - Assert.assertEquals(2, lh3.indexOf("m", 1)); > >> + Assert.assertEquals(0, lh3.indexOf('m')); > >> + Assert.assertEquals(2, lh3.indexOf('m', 1)); > >> Assert.assertEquals(3, lh3.indexOf("m̂", 2)); > >> } > >> > >> diff --git > >> > a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java > >> > b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java > >> index feedf4f..0d57864 100644 > >> --- > >> > a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java > >> +++ > >> > b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducer.java > >> @@ -264,8 +264,8 @@ public class CxfRsProducer extends > >> DefaultAsyncProducer { > >> if (cxfMessage != null) { > >> String requestURL = > >> (String)cxfMessage.get("org.apache.cxf.request.uri"); > >> String matrixParam = null; > >> - int matrixStart = requestURL.indexOf(";"); > >> - int matrixEnd = requestURL.indexOf("?") > -1 ? > >> requestURL.indexOf("?") : requestURL.length(); > >> + int matrixStart = requestURL.indexOf(';'); > >> + int matrixEnd = requestURL.indexOf('?') > -1 ? > >> requestURL.indexOf('?') : requestURL.length(); > >> Map<String, String> maps = null; > >> if (requestURL != null && matrixStart > 0) { > >> matrixParam = requestURL.substring(matrixStart + 1, > >> matrixEnd); > >> diff --git > >> > a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java > >> > b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java > >> index f9ba88e..0d7edf8 100644 > >> --- > >> > a/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java > >> +++ > >> > b/components/camel-dozer/src/main/java/org/apache/camel/component/dozer/ExpressionMapper.java > >> @@ -112,14 +112,14 @@ public class ExpressionMapper extends > BaseConverter { > >> * The actual expression, without the language prefix. > >> */ > >> public String getExpressionPart() { > >> - return getParameter().substring(getParameter().indexOf(":") + > 1); > >> + return getParameter().substring(getParameter().indexOf(':') + > 1); > >> } > >> > >> /** > >> * The expression language used for this mapping. > >> */ > >> public String getLanguagePart() { > >> - return getParameter().substring(0, > getParameter().indexOf(":")); > >> + return getParameter().substring(0, > getParameter().indexOf(':')); > >> } > >> > >> /** > >> diff --git > >> > a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java > >> > b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java > >> index e78bfd0..c0b4dbb 100644 > >> --- > >> > a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java > >> +++ > >> > b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java > >> @@ -70,8 +70,8 @@ public class FtpComponent extends > >> RemoteFileComponent<FTPFile> { > >> */ > >> protected String getBaseUri(String uri) { > >> String baseUri = uri; > >> - if (uri.indexOf("?") != -1) { > >> - baseUri = uri.substring(0, uri.indexOf("?")); > >> + if (uri.indexOf('?') != -1) { > >> + baseUri = uri.substring(0, uri.indexOf('?')); > >> } > >> return baseUri; > >> } > >> diff --git > >> > a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java > >> > b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java > >> index 697bac9..d3fd36d 100644 > >> --- > >> > a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java > >> +++ > >> > b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java > >> @@ -48,7 +48,7 @@ public class SftpComponent extends > >> RemoteFileComponent<SftpRemoteFile> { > >> // to escape the $ for the expression (file language) > >> String baseUri = uri; > >> if (uri.contains("?")) { > >> - baseUri = uri.substring(0, uri.indexOf("?")); > >> + baseUri = uri.substring(0, uri.indexOf('?')); > >> } > >> > >> // lets make sure we create a new configuration as each > endpoint > >> can > >> diff --git > >> > a/components/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLConfiguration.java > >> > b/components/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLConfiguration.java > >> index 0f9143a..1e918fc 100644 > >> --- > >> > a/components/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLConfiguration.java > >> +++ > >> > b/components/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLConfiguration.java > >> @@ -35,7 +35,7 @@ public class GoogleBigQuerySQLConfiguration { > >> private String query; > >> > >> public void parseRemaining(String remaining) { > >> - int indexOfColon = remaining.indexOf(":"); > >> + int indexOfColon = remaining.indexOf(':'); > >> > >> if (indexOfColon < 0) { > >> throw new IllegalArgumentException("Google BigQuery > Endpoint > >> format \"projectId:query\""); > >> diff --git > >> > a/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpHelper.java > >> > b/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpHelper.java > >> index 9ddd58c..1073618 100644 > >> --- > >> > a/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpHelper.java > >> +++ > >> > b/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpHelper.java > >> @@ -46,7 +46,7 @@ public final class HttpHelper { > >> throw new ProtocolException("Invalid HTTP version string: > " + > >> s); > >> } > >> int i1 = "HTTP/".length(); > >> - int i2 = s.indexOf(".", i1); > >> + int i2 = s.indexOf('.', i1); > >> if (i2 == -1) { > >> throw new ProtocolException("Invalid HTTP version number: > " + > >> s); > >> } > >> diff --git > >> > a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java > >> > b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java > >> index 66a3d1c..1dde940 100644 > >> --- > >> > a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java > >> +++ > >> > b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java > >> @@ -223,7 +223,7 @@ public final class HttpHelper { > >> } > >> if (path.length() > 0) { > >> // inject the dynamic path before the query params, if > >> there are any > >> - int idx = uri.indexOf("?"); > >> + int idx = uri.indexOf('?'); > >> > >> // if there are no query params > >> if (idx == -1) { > >> diff --git > >> > a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java > >> > b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java > >> index 9d58cbb..b688a5e 100644 > >> --- > >> > a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java > >> +++ > >> > b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java > >> @@ -509,7 +509,7 @@ public class HttpProducer extends DefaultProducer { > >> //it removes "boundary" from Content-Type; I have > to > >> use contentType.create method. > >> if (contentTypeString != null) { > >> // using ContentType.parser for charset > >> - if (contentTypeString.indexOf("charset") > 0 || > >> contentTypeString.indexOf(";") > 0) { > >> + if (contentTypeString.indexOf("charset") > 0 || > >> contentTypeString.indexOf(';') > 0) { > >> contentType = > >> ContentType.parse(contentTypeString); > >> } else { > >> contentType = > >> ContentType.create(contentTypeString); > >> diff --git > >> > a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java > >> > b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java > >> index 5443e2d..1b3fb65 100644 > >> --- > >> > a/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java > >> +++ > >> > b/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcConfiguration.java > >> @@ -160,7 +160,7 @@ public class IrcConfiguration implements Cloneable { > >> String username = null; > >> String password = null; > >> if (userInfo != null) { > >> - int colonIndex = userInfo.indexOf(":"); > >> + int colonIndex = userInfo.indexOf(':'); > >> if (colonIndex != -1) { > >> username = userInfo.substring(0, colonIndex); > >> password = userInfo.substring(colonIndex + 1); > >> diff --git > >> > a/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java > >> > b/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java > >> index 5ee2311..f1fc631 100644 > >> --- > >> > a/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java > >> +++ > >> > b/components/camel-jsch/src/main/java/org/apache/camel/component/scp/ScpComponent.java > >> @@ -44,7 +44,7 @@ public class ScpComponent extends > >> RemoteFileComponent<ScpFile> { > >> > >> @Override > >> protected GenericFileEndpoint<ScpFile> buildFileEndpoint(String > uri, > >> String remaining, Map<String, Object> parameters) throws Exception { > >> - int query = uri.indexOf("?"); > >> + int query = uri.indexOf('?'); > >> return new ScpEndpoint(uri, this, new ScpConfiguration(new > >> URI(query >= 0 ? uri.substring(0, query) : uri))); > >> } > >> > >> diff --git > >> > a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java > >> > b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java > >> index 2688c19..29d04d1 100644 > >> --- > >> > a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java > >> +++ > >> > b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConfiguration.java > >> @@ -455,7 +455,7 @@ public class MailConfiguration implements Cloneable > { > >> // set default destination to username@host for backwards > >> compatibility > >> // can be overridden by URI parameters > >> String address = username; > >> - if (address.indexOf("@") == -1) { > >> + if (address.indexOf('@') == -1) { > >> address += "@" + host; > >> } > >> setTo(address); > >> diff --git > >> > a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java > >> > b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java > >> index 085beb7..c2c6989 100644 > >> --- > >> > a/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java > >> +++ > >> > b/components/camel-milo/src/test/java/org/apache/camel/component/milo/AbstractMiloServerTest.java > >> @@ -132,7 +132,7 @@ public abstract class AbstractMiloServerTest extends > >> CamelTestSupport { > >> boolean isJavaVersionSatisfied(int requiredVersion) { > >> String version = System.getProperty("java.version"); > >> if (!version.startsWith("1.")) { > >> - int dot = version.indexOf("."); > >> + int dot = version.indexOf('.'); > >> if (dot != -1) { > >> version = version.substring(0, dot); > >> } > >> diff --git > >> > a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java > >> > b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java > >> index c383152..be42101 100644 > >> --- > >> > a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java > >> +++ > >> > b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java > >> @@ -207,7 +207,7 @@ public final class NettyHttpHelper { > >> } > >> > >> // inject the dynamic path before the query params, if > there > >> are any > >> - int idx = uri.indexOf("?"); > >> + int idx = uri.indexOf('?'); > >> > >> // if there are no query params > >> if (idx == -1) { > >> diff --git > >> > a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestProducer.java > >> > b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestProducer.java > >> index 2f8be9f..121d2aa 100644 > >> --- > >> > a/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestProducer.java > >> +++ > >> > b/components/camel-rest/src/main/java/org/apache/camel/component/rest/RestProducer.java > >> @@ -232,8 +232,8 @@ public class RestProducer extends > DefaultAsyncProducer > >> { > >> private String resolveHeaderPlaceholders(String str, Message msg) > { > >> int startIndex = -1; > >> String res = str; > >> - while ((startIndex = res.indexOf("{", startIndex + 1)) >= 0) { > >> - int endIndex = res.indexOf("}", startIndex); > >> + while ((startIndex = res.indexOf('{', startIndex + 1)) >= 0) { > >> + int endIndex = res.indexOf('}', startIndex); > >> if (endIndex == -1) { > >> continue; > >> } > >> diff --git > >> > a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java > >> > b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java > >> index 3960ef1..8bb3c20 100644 > >> --- > >> > a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java > >> +++ > >> > b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java > >> @@ -526,7 +526,7 @@ public class SubscriptionHelper extends > ServiceSupport > >> { > >> channelName.append(topicName); > >> } > >> > >> - final int typeIdx = channelName.indexOf("/", 1); > >> + final int typeIdx = channelName.indexOf('/', 1); > >> if ("event".equals(channelName.substring(1, typeIdx)) && > >> !topicName.endsWith("__e")) { > >> channelName.append("__e"); > >> } > >> diff --git > >> > a/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java > >> > b/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java > >> index 3a34e99..9c563a8 100644 > >> --- > >> > a/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java > >> +++ > >> > b/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketComponent.java > >> @@ -550,7 +550,7 @@ public class WebsocketComponent extends > >> DefaultComponent implements SSLContextPa > >> // Is not correct as it does not support to add port in the > URI > >> //return String.format("/%s/*", remaining); > >> > >> - int index = remaining.indexOf("/"); > >> + int index = remaining.indexOf('/'); > >> if (index != -1) { > >> return remaining.substring(index, remaining.length()); > >> } else { > >> @@ -559,8 +559,8 @@ public class WebsocketComponent extends > >> DefaultComponent implements SSLContextPa > >> } > >> > >> private int extractPortNumber(String remaining) { > >> - int index1 = remaining.indexOf(":"); > >> - int index2 = remaining.indexOf("/"); > >> + int index1 = remaining.indexOf(':'); > >> + int index2 = remaining.indexOf('/'); > >> > >> if ((index1 != -1) && (index2 != -1)) { > >> String result = remaining.substring(index1 + 1, index2); > >> @@ -571,7 +571,7 @@ public class WebsocketComponent extends > >> DefaultComponent implements SSLContextPa > >> } > >> > >> private String extractHostName(String remaining) { > >> - int index = remaining.indexOf(":"); > >> + int index = remaining.indexOf(':'); > >> if (index != -1) { > >> return remaining.substring(0, index); > >> } else { > >> diff --git > >> > a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/operations/ZooKeeperHelper.java > >> > b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/operations/ZooKeeperHelper.java > >> index 89a8813..13777f2 100644 > >> --- > >> > a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/operations/ZooKeeperHelper.java > >> +++ > >> > b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/operations/ZooKeeperHelper.java > >> @@ -32,7 +32,7 @@ public final class ZooKeeperHelper { > >> > >> int pos = 1; // skip first slash, root is guaranteed to exist > >> do { > >> - pos = path.indexOf("/", pos + 1); > >> + pos = path.indexOf('/', pos + 1); > >> > >> if (pos == -1) { > >> if (makeLastNode) { > >> diff --git > >> > a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java > >> > b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java > >> index 3dab3f7..e0d746f 100644 > >> --- > >> > a/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java > >> +++ > >> > b/core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java > >> @@ -397,7 +397,7 @@ public abstract class AbstractCamelCatalog { > >> // clip the scheme from the syntax > >> alternativeSyntax = CatalogHelper.after(alternativeSyntax, > >> ":"); > >> // trim so only userinfo > >> - int idx = alternativeSyntax.indexOf("@"); > >> + int idx = alternativeSyntax.indexOf('@'); > >> String fields = alternativeSyntax.substring(0, idx); > >> String[] names = fields.split(":"); > >> > >> @@ -408,7 +408,7 @@ public abstract class AbstractCamelCatalog { > >> String password = null; > >> > >> // grab unserinfo part before @ > >> - String userInfo = authority.substring(0, > >> authority.indexOf("@")); > >> + String userInfo = authority.substring(0, > >> authority.indexOf('@')); > >> String[] parts = userInfo.split(":"); > >> if (parts.length == 2) { > >> username = parts[0]; > >> @@ -661,7 +661,7 @@ public abstract class AbstractCamelCatalog { > >> > >> public String endpointComponentName(String uri) { > >> if (uri != null) { > >> - int idx = uri.indexOf(":"); > >> + int idx = uri.indexOf(':'); > >> if (idx > 0) { > >> return uri.substring(0, idx); > >> } > >> diff --git > >> > a/core/camel-core-engine/src/main/java/org/apache/camel/impl/RouteIdFactory.java > >> > b/core/camel-core-engine/src/main/java/org/apache/camel/impl/RouteIdFactory.java > >> index 8a7eddd..bef8fa6 100644 > >> --- > >> > a/core/camel-core-engine/src/main/java/org/apache/camel/impl/RouteIdFactory.java > >> +++ > >> > b/core/camel-core-engine/src/main/java/org/apache/camel/impl/RouteIdFactory.java > >> @@ -97,7 +97,7 @@ public class RouteIdFactory implements NodeIdFactory { > >> if (colon > 0) { > >> String name = uri.substring(colon + 1); > >> > >> - int questionMark = name.indexOf("?"); > >> + int questionMark = name.indexOf('?'); > >> > >> if (questionMark > 0) { > >> return Optional.of(name.substring(0, questionMark)); > >> diff --git > >> > a/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java > >> > b/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java > >> index 559ae1f..046fada 100644 > >> --- > >> > a/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java > >> +++ > >> > b/core/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java > >> @@ -114,7 +114,7 @@ public class XPathTransformTest extends > >> ContextTestSupport { > >> if (version.startsWith("1.")) { > >> version = version.substring(2, 3); > >> } else { > >> - int dot = version.indexOf("."); > >> + int dot = version.indexOf('.'); > >> if (dot != -1) { > >> version = version.substring(0, dot); > >> } > >> diff --git > >> > a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java > >> > b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java > >> index 1679fcf..abb1983 100644 > >> --- > >> > a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java > >> +++ > >> > b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java > >> @@ -874,7 +874,7 @@ public abstract class BaseMainSupport extends > >> BaseService { > >> > >> for (String key : prop.stringPropertyNames()) { > >> if (key.startsWith("camel.component.properties.")) { > >> - int dot = key.indexOf(".", 26); > >> + int dot = key.indexOf('.', 26); > >> String option = dot == -1 ? "" : key.substring(dot + > 1); > >> String value = prop.getProperty(key, ""); > >> validateOptionAndValue(key, option, value); > >> @@ -1208,7 +1208,7 @@ public abstract class BaseMainSupport extends > >> BaseService { > >> Function<String, > >> Iterable<Object>> supplier) { > >> if (key.startsWith(keyPrefix)) { > >> // grab name > >> - final int dot = key.indexOf(".", keyPrefix.length()); > >> + final int dot = key.indexOf('.', keyPrefix.length()); > >> final String name = dot == -1 ? > >> key.substring(keyPrefix.length()) : key.substring(keyPrefix.length(), > dot); > >> > >> // enabled is a virtual property > >> diff --git > >> > a/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java > >> > b/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java > >> index 2d4df7a..8046832 100644 > >> --- > >> > a/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java > >> +++ > >> > b/core/camel-support/src/main/java/org/apache/camel/support/ResourceHelper.java > >> @@ -80,7 +80,7 @@ public final class ResourceHelper { > >> */ > >> public static String getScheme(String uri) { > >> if (hasScheme(uri)) { > >> - return uri.substring(0, uri.indexOf(":") + 1); > >> + return uri.substring(0, uri.indexOf(':') + 1); > >> } else { > >> return null; > >> } > >> diff --git > >> > a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java > >> > b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java > >> index 2102b20..fea01f3 100644 > >> --- > >> > a/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java > >> +++ > >> > b/core/camel-xml-io/src/main/java/org/apache/camel/xml/io/XmlStreamReader.java > >> @@ -640,7 +640,7 @@ public class XmlStreamReader extends Reader { > >> private static String getContentTypeMime(final String > >> httpContentType) { > >> String mime = null; > >> if (httpContentType != null) { > >> - final int i = httpContentType.indexOf(";"); > >> + final int i = httpContentType.indexOf(';'); > >> if (i == -1) { > >> mime = httpContentType.trim(); > >> } else { > >> @@ -655,7 +655,7 @@ public class XmlStreamReader extends Reader { > >> private static String getContentTypeEncoding(final String > >> httpContentType) { > >> String encoding = null; > >> if (httpContentType != null) { > >> - final int i = httpContentType.indexOf(";"); > >> + final int i = httpContentType.indexOf(';'); > >> if (i > -1) { > >> final String postMime = httpContentType.substring(i + > 1); > >> final Matcher m = CHARSET_PATTERN.matcher(postMime); > >> @@ -739,7 +739,7 @@ public class XmlStreamReader extends Reader { > >> offset += c; > >> max -= c; > >> c = is.read(bytes, offset, max); > >> - firstGT = new String(bytes, 0, offset, > >> guessedEnc).indexOf(">"); > >> + firstGT = new String(bytes, 0, offset, > >> guessedEnc).indexOf('>'); > >> } > >> if (firstGT == -1) { > >> if (c == -1) { > >> diff --git > >> > a/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java > >> > b/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java > >> index 05322bb..3f1a1ce 100644 > >> --- > >> > a/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java > >> +++ > >> > b/core/camel-xml-io/src/test/java/org/apache/camel/xml/in/ModelParserTest.java > >> @@ -64,7 +64,7 @@ public class ModelParserTest { > >> if (url.startsWith("file:")) { > >> url = url.substring("file:".length(), > >> url.indexOf("barInterceptorRoute.xml")); > >> } else if (url.startsWith("jar:file:")) { > >> - url = url.substring("jar:file:".length(), > url.indexOf("!")); > >> + url = url.substring("jar:file:".length(), > url.indexOf('!')); > >> } > >> return Paths.get(url); > >> } > >> diff --git > >> > a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/XRefCheckMojo.java > >> > b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/XRefCheckMojo.java > >> index fad050b..38e508e 100644 > >> --- > >> > a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/XRefCheckMojo.java > >> +++ > >> > b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/XRefCheckMojo.java > >> @@ -119,8 +119,8 @@ public class XRefCheckMojo extends AbstractMojo { > >> > >> Pattern xref = > >> Pattern.compile("\\b(?<all>xref:(?<link>[^\\[]+.adoc)[^\\]]*\\])"); > >> for (Map.Entry<String, Path> page : pages.entrySet()) { > >> - int firstDot = page.getKey().indexOf(":"); > >> - int secondDot = firstDot >= 0 ? page.getKey().indexOf(":", > >> firstDot + 1) : -1; > >> + int firstDot = page.getKey().indexOf(':'); > >> + int secondDot = firstDot >= 0 ? page.getKey().indexOf(':', > >> firstDot + 1) : -1; > >> String component = secondDot >= 0 ? > >> page.getKey().substring(0, firstDot) : ""; > >> String module = secondDot >= 0 ? > >> page.getKey().substring(firstDot + 1, secondDot) : ""; > >> String str = PackageHelper.loadText(page.getValue()); > >> > >> > > >
