From 620f9a5739d32022b6cd7f094893ef76172fae96 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 27 Mar 2012 06:06:51 +0000 Subject: [PATCH] small opto when charfilter is used: don't call this method twice in end git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1305742 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java b/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java index 360a0363650..bf62ee1c0ea 100644 --- a/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java +++ b/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java @@ -260,7 +260,8 @@ public final class JapaneseTokenizer extends Tokenizer { @Override public void end() { // Set final offset - offsetAtt.setOffset(correctOffset(pos), correctOffset(pos)); + int finalOffset = correctOffset(pos); + offsetAtt.setOffset(finalOffset, finalOffset); } // Returns the added cost that a 2nd best segmentation is