View | Details | Raw Unified | Return to bug 324189 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/core/compiler/CharOperation.java (-5 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 2514-2523 Link Here
2514
2514
2515
	/* check first segment */
2515
	/* check first segment */
2516
	char patternChar = 0;
2516
	char patternChar = 0;
2517
	while ((iPattern < patternEnd)
2517
	while (true) {
2518
		&& (patternChar = pattern[iPattern]) != '*') {
2518
		if (iPattern == patternEnd) {
2519
		if (iName == nameEnd)
2519
			if (iName == nameEnd) return true; // the chars match
2520
			return false;
2520
			return false; // pattern has ended but not the name, no match
2521
		} 
2522
		if ((patternChar = pattern[iPattern]) == '*') {
2523
			break;
2524
		}
2525
		if (iName == nameEnd) {
2526
			return false; // name has ended but not the pattern
2527
		}
2521
		if (patternChar
2528
		if (patternChar
2522
			!= (isCaseSensitive
2529
			!= (isCaseSensitive
2523
				? name[iName]
2530
				? name[iName]
(-)src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java (-1 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 738-743 Link Here
738
	// Verify that there were no unexpected results
738
	// Verify that there were no unexpected results
739
    assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
739
    assertTrue(this.camelCaseErrors.toString(), this.camelCaseErrors.length()==0);
740
}
740
}
741
// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=324189
742
public void test74() {
743
744
	assertTrue("Pattern matching failure",
745
		!CharOperation.match("A".toCharArray(), "AnotherA".toCharArray(), true));
746
}
741
public static Class testClass() {
747
public static Class testClass() {
742
	return UtilTest.class;
748
	return UtilTest.class;
743
}
749
}
(-)src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java (+15 lines)
Lines 12809-12812 Link Here
12809
		deleteProject("P");
12809
		deleteProject("P");
12810
	}
12810
	}
12811
}
12811
}
12812
// Test the special case in comment 20 of bug 324189
12813
public void testBug324189e() throws CoreException {
12814
	this.workingCopies = new ICompilationUnit[1];
12815
	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b324189/A.java",
12816
		"package b324189;\n" +
12817
		"public class A{\n" +
12818
		" public void run() {}\n" +
12819
		"}\n"+
12820
		"class AnotherA {" +
12821
		" public void run() {} \n" +
12822
		" }\n"
12823
	);
12824
	search("A.run()", METHOD, DECLARATIONS);
12825
	assertSearchResults("src/b324189/A.java void b324189.A.run() [run] EXACT_MATCH");
12826
}
12812
}
12827
}

Return to bug 324189