Buggy code:
public final class JavaConventions { private static final char fgDot = '.' ; private static final String fgJAVA = "JAVA" ; private static final Scanner SCANNER = new Scanner ( ) ; private JavaConventions ( ) { } public static boolean isOverlappingRoots ( IPath rootPath1 , IPath rootPath2 ) { } private static synchronized char [ ] scannedIdentifier ( String id ) { } public static IStatus validateCompilationUnitName ( String name ) { } public static IStatus validateClassFileName ( String name ) { } public static IStatus validateFieldName ( String name ) { } public static IStatus validateIdentifier ( String id ) { } public static IStatus validateImportDeclaration ( String name ) { } public static IStatus validateJavaTypeName ( String name ) { } public static IStatus validateMethodName ( String name ) { } public static IStatus validatePackageName ( String name ) { if ( name == null ) { return new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.package.nullName" ) , null ) ; } int length ; if ( ( length = name . length ( ) ) == 0 ) { return new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.package.emptyName" ) , null ) ; } if ( ( ( name . charAt ( 0 ) ) == ( JavaConventions . fgDot ) ) || ( ( name . charAt ( ( length - 1 ) ) ) == ( JavaConventions . fgDot ) ) ) { return new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.package.dotName" ) , null ) ; } <START_BUG> if ( ( Scanner . isWhitespace ( name . charAt ( 0 ) ) ) || ( Scanner . isWhitespace ( name . charAt ( ( ( name . length ( ) ) - 1 ) ) ) ) ) { <END_BUG> return new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.package.nameWithBlanks" ) , null ) ; } int dot = 0 ; while ( ( dot != ( - 1 ) ) && ( dot < ( length - 1 ) ) ) { if ( ( ( ( dot = name . indexOf ( JavaConventions . fgDot , ( dot + 1 ) ) ) != ( - 1 ) ) && ( dot < ( length - 1 ) ) ) && ( ( name . charAt ( ( dot + 1 ) ) ) == ( JavaConventions . fgDot ) ) ) { return new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.package.consecutiveDotsName" ) , null ) ; } } IWorkspace workspace = ResourcesPlugin . getWorkspace ( ) ; StringTokenizer st = new StringTokenizer ( name , new String ( new char [ ] { JavaConventions . fgDot } ) ) ; boolean firstToken = true ; while ( st . hasMoreTokens ( ) ) { String typeName = st . nextToken ( ) ; typeName = typeName . trim ( ) ; char [ ] scannedID = JavaConventions . scannedIdentifier ( typeName ) ; if ( scannedID == null ) { return new Status ( IStatus . ERROR , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.illegalIdentifier" , typeName ) , null ) ; } IStatus status = workspace . validateName ( new String ( scannedID ) , IResource . FOLDER ) ; if ( ! ( status . isOK ( ) ) ) { return status ; } if ( ( firstToken && ( ( scannedID . length ) > 0 ) ) && ( Character . isUpperCase ( scannedID [ 0 ] ) ) ) { return new Status ( IStatus . WARNING , JavaCore . PLUGIN_ID , ( - 1 ) , Util . bind ( "convention.package.uppercaseName" ) , null ) ; } firstToken = false ; } return new Status ( IStatus . OK , JavaCore . PLUGIN_ID , ( - 1 ) , "OK" , null ) ; } public static IJavaModelStatus validateClasspath ( IJavaProject javaProject , IClasspathEntry [ ] classpath , IPath outputLocation ) { } public static IJavaModelStatus validateClasspathEntry ( IJavaProject javaProject , IClasspathEntry entry , boolean checkSourceAttachment ) { } }

Fix:
if ( ( CharOperation . isWhitespace ( name . charAt ( 0 ) ) ) || ( CharOperation . isWhitespace ( name . charAt ( ( ( name . length ( ) ) - 1 ) ) ) ) ) {