Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 125632 Details for
Bug 264817
[search] <char> + * returns 'null' from SearchPattern.getMatchingRegions(String, String, int)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch+tests
v01.txt (text/plain), 4.77 KB, created by
Frederic Fusier
on 2009-02-13 08:01:03 EST
(
hide
)
Description:
Proposed patch+tests
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-02-13 08:01:03 EST
Size:
4.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java,v >retrieving revision 1.37 >diff -u -r1.37 UtilTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 27 Jun 2008 16:04:45 -0000 1.37 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java 13 Feb 2009 12:59:59 -0000 >@@ -182,6 +182,19 @@ > assertTrue("Pattern matching failure", > CharOperation.match("*rr*".toCharArray(), "ARRAY".toCharArray(), false)); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=264817 >+public void test19b() { >+ assertTrue("Pattern matching failure", >+ CharOperation.match("*RR*".toCharArray(), "array".toCharArray(), false)); >+} >+public void test19c() { >+ assertTrue("Pattern matching failure", >+ CharOperation.match("a*".toCharArray(), "Array".toCharArray(), false)); >+} >+public void test19d() { >+ assertTrue("Pattern matching failure", >+ CharOperation.match("A*".toCharArray(), "array".toCharArray(), false)); >+} > > public void test20() { > >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/StringOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/StringOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 StringOperation.java >--- search/org/eclipse/jdt/internal/core/search/StringOperation.java 13 Feb 2009 12:52:22 -0000 1.2 >+++ search/org/eclipse/jdt/internal/core/search/StringOperation.java 13 Feb 2009 13:00:01 -0000 >@@ -361,7 +361,11 @@ > break; > } > } else { >- if (patternChar != (isCaseSensitive ? name.charAt(iName) : ScannerHelper.toLowerCase(name.charAt(iName)))) { >+ if (isCaseSensitive) { >+ if (patternChar != name.charAt(iName)) { >+ return null; >+ } >+ } else if (ScannerHelper.toLowerCase(patternChar) != ScannerHelper.toLowerCase(name.charAt(iName))) { > return null; > } > switch (previous) { >@@ -446,7 +450,8 @@ > break; > } > } else { >- if ((isCaseSensitive ? name.charAt(iName) : ScannerHelper.toLowerCase(name.charAt(iName))) != patternChar) { >+ if ((isCaseSensitive && name.charAt(iName) != patternChar) || >+ (ScannerHelper.toLowerCase(name.charAt(iName)) != ScannerHelper.toLowerCase(patternChar))) { > iPattern = segmentStart; // mismatch - restart current segment > iName = ++prefixStart; > start = prefixStart; >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.87 >diff -u -r1.87 CharOperation.java >--- compiler/org/eclipse/jdt/core/compiler/CharOperation.java 12 Feb 2009 15:27:02 -0000 1.87 >+++ compiler/org/eclipse/jdt/core/compiler/CharOperation.java 13 Feb 2009 13:00:01 -0000 >@@ -2518,11 +2518,14 @@ > && (patternChar = pattern[iPattern]) != '*') { > if (iName == nameEnd) > return false; >- if (patternChar >- != (isCaseSensitive >- ? name[iName] >- : ScannerHelper.toLowerCase(name[iName])) >- && patternChar != '?') { >+ if (patternChar != '?') { >+ if (isCaseSensitive) { >+ if (ScannerHelper.toLowerCase(patternChar) != >+ ScannerHelper.toLowerCase(name[iName])) { >+ return false; >+ } >+ } >+ } else if (patternChar != name[iName]) { > return false; > } > iName++; >@@ -2552,9 +2555,16 @@ > continue checkSegment; > } > /* check current name character */ >- if ((isCaseSensitive ? name[iName] : ScannerHelper.toLowerCase(name[iName])) >- != patternChar >- && patternChar != '?') { >+ if (patternChar != '?') { >+ if (isCaseSensitive) { >+ if (ScannerHelper.toLowerCase(patternChar) != >+ ScannerHelper.toLowerCase(name[iName])) { >+ iPattern = segmentStart; // mismatch - restart current segment >+ iName = ++prefixStart; >+ continue checkSegment; >+ } >+ } >+ } else if (patternChar != name[iName]) { > iPattern = segmentStart; // mismatch - restart current segment > iName = ++prefixStart; > continue checkSegment; >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/MatchingRegionsTest.java,v >retrieving revision 1.2 >diff -u -r1.2 MatchingRegionsTest.java >Binary files /tmp/cvs5MZwhx and MatchingRegionsTest.java differ
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264817
:
125627
|
125632
|
125638