Re: [classlib][regex] Is this a issue of java.util.regex.Matcher.region(int, int);

2006-07-27 Thread Nikolay Kuznetsov

Hello Spark Shen,


It seems that Matcher.region(int, int) will not have any effects when
called. This can be demonstrated by the following test case


there is an issue quite similar to one you have raised filled by Richard:
http://issues.apache.org/jira/browse/HARMONY-759

I'll try to provide a fix today, thanks for reminding.


BTW, there are other issues about java.util.regex. If necessary, can we
disscuss all these issues case by case.


Surely, we can discuss issues if needed, but if smth just does not
work, please fill an issue in JIRA, I'm looking after regex issues. If
you need some problems to fix urgently, let me know separately.

Yours sincerely,
  Nik.

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib][regex] Is this a issue of java.util.regex.Matcher.region(int, int);

2006-07-27 Thread Spark Shen

Nikolay Kuznetsov 写道:

Hello Spark Shen,


It seems that Matcher.region(int, int) will not have any effects when
called. This can be demonstrated by the following test case


there is an issue quite similar to one you have raised filled by Richard:
http://issues.apache.org/jira/browse/HARMONY-759

I'll try to provide a fix today, thanks for reminding.


BTW, there are other issues about java.util.regex. If necessary, can we
disscuss all these issues case by case.


Surely, we can discuss issues if needed, but if smth just does not
work, please fill an issue in JIRA, I'm looking after regex issues. If
you need some problems to fix urgently, let me know separately.

Thank you very much, do I need to raise a new JIRA for this issue? Using 
the test case I give,

I debug into the code. The calling stack is as follow:

SequenceSet.indexOf(CharSequence, int)
SequenceSet.find(int, CharSequence, MatchResultImpl) line: 69
SingleSet.find(int, CharSequence, MatchResultImpl) line: 52
Matcher.findAt(int) line: 317
Matcher.find(int) line: 304
Matcher.find() line: 342

in indexOf line 115 : int last = string.charAt(charCount - 1); the value 
of string is c.
I figure out this string variable is a member of SequenceSet. Since the 
region in my test case setting is (0, 2),

I am not sure whether the string value here should be smth like a.

Since SequenceSet is construct when Pattern.complile() and this members 
value of the constructed SequenceSet
seems never change ever since, does it make sense that when region is 
called, value of SequeceSet should also be updated?


Hope this guess would be helpful. :-)

Correct me if I am wrong.

Best regards

Yours sincerely,
Nik.

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Spark Shen
China Software Development Lab, IBM



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[classlib][regex] Is this a issue of java.util.regex.Matcher.region(int, int);

2006-07-26 Thread Spark Shen

Hi All:
It seems that Matcher.region(int, int) will not have any effects when 
called. This can be demonstrated by the following test case:

public void test_RegionII() {
   CharBuffer buffer = CharBuffer.wrap(new char[] { 'a', 'a', 'b', 'b',
   '.', 'c' });

   Matcher matcher = Pattern.compile(c).matcher(buffer); 
//$NON-NLS-1$

   matcher.region(0, 2);
   assertFalse(matcher.find());
   }
This test case pass on RI, but fail on Harmony. Can I infer that, 
harmony ignores region settting when trying to find the specified pattern?

Correct me if I am wrong.

Best regards

--
Spark Shen
China Software Development Lab, IBM



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [classlib][regex] Is this a issue of java.util.regex.Matcher.region(int, int);

2006-07-26 Thread Spark Shen

Spark Shen 写道:

Hi All:
It seems that Matcher.region(int, int) will not have any effects when 
called. This can be demonstrated by the following test case:

public void test_RegionII() {
CharBuffer buffer = CharBuffer.wrap(new char[] { 'a', 'a', 'b', 'b',
'.', 'c' });

Matcher matcher = Pattern.compile(c).matcher(buffer); //$NON-NLS-1$
matcher.region(0, 2);
assertFalse(matcher.find());
}
This test case pass on RI, but fail on Harmony. Can I infer that, 
harmony ignores region settting when trying to find the specified 
pattern?

Correct me if I am wrong.

Best regards

BTW, there are other issues about java.util.regex. If necessary, can we 
disscuss all these issues case by case.


--
Spark Shen
China Software Development Lab, IBM



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]