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

2006-08-07 Thread George Harley

Hi Nikolay,

I will look to commit 713 later on today. Been a bit busy on other things.

Best regards,
George



Nikolay Kuznetsov wrote:

Hello Spark Shen,


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


No, for this problem we already have couple of issues in JIRA:
http://issues.apache.org/jira/browse/HARMONY-713
http://issues.apache.org/jira/browse/HARMONY-759

I've updated first one with the fix, and asked to close second one as 
duplicate.

You may want to try suggested  fix with your example and/or suggest
you testcase as a patch to unit tests(You'll find Richard's test over
there).

Also, thank you very much for your help with debugging this issue, but
the guess was not completely correct. SecuenceSet is a part of the
pattern compiled(Pattern.compile("c")), and it's not affected by the
regions, at least not it's content,
which should always remain "c".

region() method affects underlying match result, which SequenceSet
should communicate doing find, but it didn't, that was a problem.

Thank you.
   Nik.

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





-
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-28 Thread Nikolay Kuznetsov

Hello Spark Shen,


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


No, for this problem we already have couple of issues in JIRA:
http://issues.apache.org/jira/browse/HARMONY-713
http://issues.apache.org/jira/browse/HARMONY-759

I've updated first one with the fix, and asked to close second one as duplicate.
You may want to try suggested  fix with your example and/or suggest
you testcase as a patch to unit tests(You'll find Richard's test over
there).

Also, thank you very much for your help with debugging this issue, but
the guess was not completely correct. SecuenceSet is a part of the
pattern compiled(Pattern.compile("c")), and it's not affected by the
regions, at least not it's content,
which should always remain "c".

region() method affects underlying match result, which SequenceSet
should communicate doing find, but it didn't, that was a problem.

Thank you.
   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]



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-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]