String.indexOf(char) is faster than String.indexOf(String).

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1405630 13f79535-47bb-0310-9956-ffa450edef68
master
Robert Scholte 2012-11-04 20:38:18 +00:00
parent 1de1779688
commit b7120e30cc
2 changed files with 4 additions and 4 deletions

View File

@ -445,7 +445,7 @@ public class PluginDescriptorGenerator
String roleHint = null; String roleHint = null;
int posRoleHintSeparator = role.indexOf( "#" ); int posRoleHintSeparator = role.indexOf( '#' );
if ( posRoleHintSeparator > 0 ) if ( posRoleHintSeparator > 0 )
{ {
roleHint = role.substring( posRoleHintSeparator + 1 ); roleHint = role.substring( posRoleHintSeparator + 1 );

View File

@ -149,7 +149,7 @@ public abstract class AbstractMojoTaglet
{ {
String nextToken = token.nextToken(); String nextToken = token.nextToken();
if ( nextToken.indexOf( "=" ) == -1 ) if ( nextToken.indexOf( '=' ) == -1 )
{ {
// using pattern: @annotation <annotationValue> // using pattern: @annotation <annotationValue>
tagValue = nextToken; tagValue = nextToken;
@ -178,7 +178,7 @@ public abstract class AbstractMojoTaglet
{ {
String nextToken = token.nextToken(); String nextToken = token.nextToken();
if ( nextToken.indexOf( "=" ) == -1 ) if ( nextToken.indexOf( '=' ) == -1 )
{ {
// using pattern: @annotation <annotationValue> // using pattern: @annotation <annotationValue>
continue; continue;
@ -385,7 +385,7 @@ public abstract class AbstractMojoTaglet
*/ */
private static List<String> getOnlyValues( String text ) private static List<String> getOnlyValues( String text )
{ {
if ( text.indexOf( "|" ) == -1 ) if ( text.indexOf( '|' ) == -1 )
{ {
return Collections.emptyList(); return Collections.emptyList();
} }