### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/core/compiler/CharOperation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java,v retrieving revision 1.89 diff -u -r1.89 CharOperation.java --- compiler/org/eclipse/jdt/core/compiler/CharOperation.java 19 Nov 2010 19:06:48 -0000 1.89 +++ compiler/org/eclipse/jdt/core/compiler/CharOperation.java 25 Jan 2011 15:38:14 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -2514,10 +2514,17 @@ /* check first segment */ char patternChar = 0; - while ((iPattern < patternEnd) - && (patternChar = pattern[iPattern]) != '*') { - if (iName == nameEnd) - return false; + while (true) { + if (iPattern == patternEnd) { + if (iName == nameEnd) return true; // the chars match + return false; // pattern has ended but not the name, no match + } + if ((patternChar = pattern[iPattern]) == '*') { + break; + } + if (iName == nameEnd) { + return false; // name has ended but not the pattern + } if (patternChar != (isCaseSensitive ? name[iName]