RuleBasedScanner and getColumn() [message #323800] |
Tue, 08 January 2008 23:42  |
Eclipse User |
|
|
|
I've recently been working on new document structure, and was using a
RuleBasedScanner subclass to scan for partition changes. I was relying
on getColumn(), since my partition end tokens had to start in column 0.
The problem is that RuleBasedScanner apparently caches the result of
getColumn() in the fColumn member. It only gets reset on the next call
to nextToken().
In my subclass, I fixed this by overriding read() and unread() to
invalidate the getColumn() cache (i.e. set fColumn to UNDEFINED). I'm
just curious whether this behavior is expected, or a bug.
|
|
|
Re: RuleBasedScanner and getColumn() [message #323843 is a reply to message #323800] |
Wed, 09 January 2008 19:19  |
Eclipse User |
|
|
|
Anthony W. Juckel wrote:
> I've recently been working on new document structure, and was using a
> RuleBasedScanner subclass to scan for partition changes. I was relying
> on getColumn(), since my partition end tokens had to start in column 0.
>
> The problem is that RuleBasedScanner apparently caches the result of
> getColumn() in the fColumn member. It only gets reset on the next call
> to nextToken().
>
> In my subclass, I fixed this by overriding read() and unread() to
> invalidate the getColumn() cache (i.e. set fColumn to UNDEFINED). I'm
> just curious whether this behavior is expected, or a bug.
Submitted as bug #214770.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=214770
I've included a test case and patch with the bug report, under the
assumption that the behavior was incorrect and worth fixing (well, it
was worth it to me, obviously).
|
|
|
Powered by
FUDForum. Page generated in 0.03200 seconds