Index: lucene/src/java/org/apache/lucene/messages/Message.java
===================================================================
--- lucene/src/java/org/apache/lucene/messages/Message.java (revision 1215327)
+++ lucene/src/java/org/apache/lucene/messages/Message.java (working copy)
@@ -1,36 +0,0 @@
-package org.apache.lucene.messages;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.Locale;
-
-/**
- * Message Interface for a lazy loading.
- * For Native Language Support (NLS), system of software internationalization.
- */
-public interface Message {
-
- public String getKey();
-
- public Object[] getArguments();
-
- public String getLocalizedMessage();
-
- public String getLocalizedMessage(Locale locale);
-
-}
Index: lucene/src/java/org/apache/lucene/messages/MessageImpl.java
===================================================================
--- lucene/src/java/org/apache/lucene/messages/MessageImpl.java (revision 1215327)
+++ lucene/src/java/org/apache/lucene/messages/MessageImpl.java (working copy)
@@ -1,70 +0,0 @@
-package org.apache.lucene.messages;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.Locale;
-
-/**
- * Default implementation of Message interface.
- * For Native Language Support (NLS), system of software internationalization.
- */
-public class MessageImpl implements Message {
-
- private String key;
-
- private Object[] arguments = new Object[0];
-
- public MessageImpl(String key) {
- this.key = key;
-
- }
-
- public MessageImpl(String key, Object... args) {
- this(key);
- this.arguments = args;
- }
-
- public Object[] getArguments() {
- return this.arguments;
- }
-
- public String getKey() {
- return this.key;
- }
-
- public String getLocalizedMessage() {
- return getLocalizedMessage(Locale.getDefault());
- }
-
- public String getLocalizedMessage(Locale locale) {
- return NLS.getLocalizedMessage(getKey(), locale, getArguments());
- }
-
- @Override
- public String toString() {
- Object[] args = getArguments();
- StringBuilder sb = new StringBuilder(getKey());
- if (args != null) {
- for (int i = 0; i < args.length; i++) {
- sb.append(i == 0 ? " " : ", ").append(args[i]);
- }
- }
- return sb.toString();
- }
-
-}
Index: lucene/src/java/org/apache/lucene/messages/NLSException.java
===================================================================
--- lucene/src/java/org/apache/lucene/messages/NLSException.java (revision 1215327)
+++ lucene/src/java/org/apache/lucene/messages/NLSException.java (working copy)
@@ -1,34 +0,0 @@
-package org.apache.lucene.messages;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Interface that exceptions should implement to support lazy loading of messages.
- *
- * For Native Language Support (NLS), system of software internationalization.
- *
- * This Interface should be implemented by all exceptions that require
- * translation
- *
- */
-public interface NLSException {
- /**
- * @return a instance of a class that implements the Message interface
- */
- public Message getMessageObject();
-}
Index: lucene/src/java/org/apache/lucene/messages/NLS.java
===================================================================
--- lucene/src/java/org/apache/lucene/messages/NLS.java (revision 1215327)
+++ lucene/src/java/org/apache/lucene/messages/NLS.java (working copy)
@@ -1,206 +0,0 @@
-package org.apache.lucene.messages;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * MessageBundles classes extend this class, to implement a bundle.
- *
- * For Native Language Support (NLS), system of software internationalization.
- *
- * This interface is similar to the NLS class in eclipse.osgi.util.NLS class -
- * initializeMessages() method resets the values of all static strings, should
- * only be called by classes that extend from NLS (see TestMessages.java for
- * reference) - performs validation of all message in a bundle, at class load
- * time - performs per message validation at runtime - see NLSTest.java for
- * usage reference
- *
- * MessageBundle classes may subclass this type.
- */
-public class NLS {
-
- private static Map
-This utility API, adds support for NLS messages in the apache code.
-It is currently used by the lucene "New Flexible Query PArser".
-
-Features:
- NLS message API
-
-
-
-Lazy loading of Message Strings - -
- public class MessagesTestBundle extends NLS {
-
- private static final String BUNDLE_NAME = MessagesTestBundle.class.getName();
-
- private MessagesTestBundle() {
- // should never be instantiated
- }
-
- static {
- // register all string ids with NLS class and initialize static string
- // values
- NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class);
- }
-
- // static string must match the strings in the property files.
- public static String Q0001E_INVALID_SYNTAX;
- public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION;
-
- // this message is missing from the properties file
- public static String Q0005E_MESSAGE_NOT_IN_BUNDLE;
- }
-
- // Create a message reference
- Message invalidSyntax = new MessageImpl(MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
-
- // Do other stuff in the code...
- // when is time to display the message to the user or log the message on a file
- // the message is loaded from the correct bundle
-
- String message1 = invalidSyntax.getLocalizedMessage();
- String message2 = invalidSyntax.getLocalizedMessage(Locale.JAPANESE);
-
-
-
--Normal loading of Message Strings - -
- String message1 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION); - String message2 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.JAPANESE); -- - -
-The org.apache.lucene.messages.TestNLS junit contains several other examples. -The TestNLS java code is available from the Apache Lucene code repository. -
- - Index: lucene/src/java/org/apache/lucene/messages/Message.java =================================================================== --- lucene/src/java/org/apache/lucene/messages/Message.java (revision 1215327) +++ lucene/src/java/org/apache/lucene/messages/Message.java (working copy) @@ -1,36 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.util.Locale; - -/** - * Message Interface for a lazy loading. - * For Native Language Support (NLS), system of software internationalization. - */ -public interface Message { - - public String getKey(); - - public Object[] getArguments(); - - public String getLocalizedMessage(); - - public String getLocalizedMessage(Locale locale); - -} Index: lucene/src/java/org/apache/lucene/messages/MessageImpl.java =================================================================== --- lucene/src/java/org/apache/lucene/messages/MessageImpl.java (revision 1215327) +++ lucene/src/java/org/apache/lucene/messages/MessageImpl.java (working copy) @@ -1,70 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.util.Locale; - -/** - * Default implementation of Message interface. - * For Native Language Support (NLS), system of software internationalization. - */ -public class MessageImpl implements Message { - - private String key; - - private Object[] arguments = new Object[0]; - - public MessageImpl(String key) { - this.key = key; - - } - - public MessageImpl(String key, Object... args) { - this(key); - this.arguments = args; - } - - public Object[] getArguments() { - return this.arguments; - } - - public String getKey() { - return this.key; - } - - public String getLocalizedMessage() { - return getLocalizedMessage(Locale.getDefault()); - } - - public String getLocalizedMessage(Locale locale) { - return NLS.getLocalizedMessage(getKey(), locale, getArguments()); - } - - @Override - public String toString() { - Object[] args = getArguments(); - StringBuilder sb = new StringBuilder(getKey()); - if (args != null) { - for (int i = 0; i < args.length; i++) { - sb.append(i == 0 ? " " : ", ").append(args[i]); - } - } - return sb.toString(); - } - -} Index: lucene/src/java/org/apache/lucene/messages/NLS.java =================================================================== --- lucene/src/java/org/apache/lucene/messages/NLS.java (revision 1215327) +++ lucene/src/java/org/apache/lucene/messages/NLS.java (working copy) @@ -1,206 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * MessageBundles classes extend this class, to implement a bundle. - * - * For Native Language Support (NLS), system of software internationalization. - * - * This interface is similar to the NLS class in eclipse.osgi.util.NLS class - - * initializeMessages() method resets the values of all static strings, should - * only be called by classes that extend from NLS (see TestMessages.java for - * reference) - performs validation of all message in a bundle, at class load - * time - performs per message validation at runtime - see NLSTest.java for - * usage reference - * - * MessageBundle classes may subclass this type. - */ -public class NLS { - - private static Map-This utility API, adds support for NLS messages in the apache code. -It is currently used by the lucene "New Flexible Query PArser". -
--Features: -
-Lazy loading of Message Strings - -
- public class MessagesTestBundle extends NLS {
-
- private static final String BUNDLE_NAME = MessagesTestBundle.class.getName();
-
- private MessagesTestBundle() {
- // should never be instantiated
- }
-
- static {
- // register all string ids with NLS class and initialize static string
- // values
- NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class);
- }
-
- // static string must match the strings in the property files.
- public static String Q0001E_INVALID_SYNTAX;
- public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION;
-
- // this message is missing from the properties file
- public static String Q0005E_MESSAGE_NOT_IN_BUNDLE;
- }
-
- // Create a message reference
- Message invalidSyntax = new MessageImpl(MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
-
- // Do other stuff in the code...
- // when is time to display the message to the user or log the message on a file
- // the message is loaded from the correct bundle
-
- String message1 = invalidSyntax.getLocalizedMessage();
- String message2 = invalidSyntax.getLocalizedMessage(Locale.JAPANESE);
-
-
-
--Normal loading of Message Strings - -
- String message1 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION); - String message2 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.JAPANESE); -- - -
-The org.apache.lucene.messages.TestNLS junit contains several other examples. -The TestNLS java code is available from the Apache Lucene code repository. -
- - Index: lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.java =================================================================== --- lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.java (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.java (working copy) @@ -1,40 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -public class MessagesTestBundle extends NLS { - - private static final String BUNDLE_NAME = MessagesTestBundle.class.getName(); - - private MessagesTestBundle() { - // should never be instantiated - } - - static { - // register all string ids with NLS class and initialize static string - // values - NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class); - } - - // static string must match the strings in the property files. - public static String Q0001E_INVALID_SYNTAX; - public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION; - - // this message is missing from the properties file - public static String Q0005E_MESSAGE_NOT_IN_BUNDLE; -} Index: lucene/src/test/org/apache/lucene/messages/MessagesTestBundle_ja.properties =================================================================== --- lucene/src/test/org/apache/lucene/messages/MessagesTestBundle_ja.properties (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/MessagesTestBundle_ja.properties (working copy) @@ -1,3 +0,0 @@ -Q0001E_INVALID_SYNTAX = \u69cb\u6587\u30a8\u30e9\u30fc: {0} - -Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION = \u5207\u308a\u6368\u3066\u3089\u308c\u305f\u30e6\u30cb\u30b3\u30fc\u30c9\u30fb\u30a8\u30b9\u30b1\u30fc\u30d7\u30fb\u30b7\u30fc\u30b1\u30f3\u30b9\u3002 Index: lucene/src/test/org/apache/lucene/messages/TestNLS.java =================================================================== --- lucene/src/test/org/apache/lucene/messages/TestNLS.java (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/TestNLS.java (working copy) @@ -1,106 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.util.Locale; - -import org.apache.lucene.util.LuceneTestCase; - -/** - */ -public class TestNLS extends LuceneTestCase { - public void testMessageLoading() { - Message invalidSyntax = new MessageImpl( - MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Syntax Error: XXX", invalidSyntax.getLocalizedMessage(Locale.ENGLISH)); - } - - public void testMessageLoading_ja() { - Message invalidSyntax = new MessageImpl( - MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); - assertEquals("構文エラー: XXX", invalidSyntax - .getLocalizedMessage(Locale.JAPANESE)); - } - - public void testNLSLoading() { - String message = NLS - .getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.ENGLISH); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Truncated unicode escape sequence.", message); - - message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, Locale.ENGLISH, - "XXX"); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Syntax Error: XXX", message); - } - - public void testNLSLoading_ja() { - String message = NLS.getLocalizedMessage( - MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, - Locale.JAPANESE); - assertEquals("切り捨てられたユニコード・エスケープ・シーケンス。", message); - - message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, - Locale.JAPANESE, "XXX"); - assertEquals("構文エラー: XXX", message); - } - - public void testNLSLoading_xx_XX() { - Locale locale = new Locale("xx", "XX", ""); - String message = NLS.getLocalizedMessage( - MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, - locale); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Truncated unicode escape sequence.", message); - - message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, - locale, "XXX"); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Syntax Error: XXX", message); - } - - public void testMissingMessage() { - Locale locale = Locale.ENGLISH; - String message = NLS.getLocalizedMessage( - MessagesTestBundle.Q0005E_MESSAGE_NOT_IN_BUNDLE, locale); - - assertEquals("Message with key:Q0005E_MESSAGE_NOT_IN_BUNDLE and locale: " - + locale.toString() + " not found.", message); - } -} Index: lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.properties =================================================================== --- lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.properties (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.properties (working copy) @@ -1,3 +0,0 @@ -Q0001E_INVALID_SYNTAX = Syntax Error: {0} - -Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION = Truncated unicode escape sequence. Index: lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.java =================================================================== --- lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.java (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.java (working copy) @@ -1,40 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -public class MessagesTestBundle extends NLS { - - private static final String BUNDLE_NAME = MessagesTestBundle.class.getName(); - - private MessagesTestBundle() { - // should never be instantiated - } - - static { - // register all string ids with NLS class and initialize static string - // values - NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class); - } - - // static string must match the strings in the property files. - public static String Q0001E_INVALID_SYNTAX; - public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION; - - // this message is missing from the properties file - public static String Q0005E_MESSAGE_NOT_IN_BUNDLE; -} Index: lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.properties =================================================================== --- lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.properties (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/MessagesTestBundle.properties (working copy) @@ -1,3 +0,0 @@ -Q0001E_INVALID_SYNTAX = Syntax Error: {0} - -Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION = Truncated unicode escape sequence. Index: lucene/src/test/org/apache/lucene/messages/MessagesTestBundle_ja.properties =================================================================== --- lucene/src/test/org/apache/lucene/messages/MessagesTestBundle_ja.properties (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/MessagesTestBundle_ja.properties (working copy) @@ -1,3 +0,0 @@ -Q0001E_INVALID_SYNTAX = \u69cb\u6587\u30a8\u30e9\u30fc: {0} - -Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION = \u5207\u308a\u6368\u3066\u3089\u308c\u305f\u30e6\u30cb\u30b3\u30fc\u30c9\u30fb\u30a8\u30b9\u30b1\u30fc\u30d7\u30fb\u30b7\u30fc\u30b1\u30f3\u30b9\u3002 Index: lucene/src/test/org/apache/lucene/messages/TestNLS.java =================================================================== --- lucene/src/test/org/apache/lucene/messages/TestNLS.java (revision 1215327) +++ lucene/src/test/org/apache/lucene/messages/TestNLS.java (working copy) @@ -1,106 +0,0 @@ -package org.apache.lucene.messages; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.util.Locale; - -import org.apache.lucene.util.LuceneTestCase; - -/** - */ -public class TestNLS extends LuceneTestCase { - public void testMessageLoading() { - Message invalidSyntax = new MessageImpl( - MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Syntax Error: XXX", invalidSyntax.getLocalizedMessage(Locale.ENGLISH)); - } - - public void testMessageLoading_ja() { - Message invalidSyntax = new MessageImpl( - MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); - assertEquals("構文エラー: XXX", invalidSyntax - .getLocalizedMessage(Locale.JAPANESE)); - } - - public void testNLSLoading() { - String message = NLS - .getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.ENGLISH); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Truncated unicode escape sequence.", message); - - message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, Locale.ENGLISH, - "XXX"); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Syntax Error: XXX", message); - } - - public void testNLSLoading_ja() { - String message = NLS.getLocalizedMessage( - MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, - Locale.JAPANESE); - assertEquals("切り捨てられたユニコード・エスケープ・シーケンス。", message); - - message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, - Locale.JAPANESE, "XXX"); - assertEquals("構文エラー: XXX", message); - } - - public void testNLSLoading_xx_XX() { - Locale locale = new Locale("xx", "XX", ""); - String message = NLS.getLocalizedMessage( - MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, - locale); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Truncated unicode escape sequence.", message); - - message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, - locale, "XXX"); - /* - * if the default locale is ja, you get ja as a fallback: - * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) - */ - if (!Locale.getDefault().getLanguage().equals("ja")) - assertEquals("Syntax Error: XXX", message); - } - - public void testMissingMessage() { - Locale locale = Locale.ENGLISH; - String message = NLS.getLocalizedMessage( - MessagesTestBundle.Q0005E_MESSAGE_NOT_IN_BUNDLE, locale); - - assertEquals("Message with key:Q0005E_MESSAGE_NOT_IN_BUNDLE and locale: " - + locale.toString() + " not found.", message); - } -} Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryTreeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryTreeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryTreeBuilder.java (working copy) @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.FieldableNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/QueryParserMessages.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/QueryParserMessages.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/QueryParserMessages.java (working copy) @@ -17,7 +17,7 @@ * limitations under the License. */ -import org.apache.lucene.messages.NLS; +import org.apache.lucene.queryparser.flexible.messages.NLS; /** * Flexible Query Parser message bundle class Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeError; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java (working copy) @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeError; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java (working copy) @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.QueryNodeError; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java (working copy) @@ -17,7 +17,7 @@ * limitations under the License. */ -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeError; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.QueryNodeError; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java (working copy) @@ -23,7 +23,7 @@ import java.util.Map; import java.util.ResourceBundle; -import org.apache.lucene.messages.NLS; +import org.apache.lucene.queryparser.flexible.messages.NLS; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.util.StringUtils; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java (working copy) @@ -17,7 +17,7 @@ * limitations under the License. */ -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.QueryNodeError; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeError.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeError.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeError.java (working copy) @@ -17,8 +17,8 @@ * limitations under the License. */ -import org.apache.lucene.messages.Message; -import org.apache.lucene.messages.NLSException; +import org.apache.lucene.queryparser.flexible.messages.Message; +import org.apache.lucene.queryparser.flexible.messages.NLSException; /** * Error class with NLS support Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeException.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeException.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeException.java (working copy) @@ -19,10 +19,10 @@ import java.util.Locale; -import org.apache.lucene.messages.Message; -import org.apache.lucene.messages.MessageImpl; -import org.apache.lucene.messages.NLS; -import org.apache.lucene.messages.NLSException; +import org.apache.lucene.queryparser.flexible.messages.Message; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.NLS; +import org.apache.lucene.queryparser.flexible.messages.NLSException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeParseException.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeParseException.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/QueryNodeParseException.java (working copy) @@ -17,8 +17,8 @@ * limitations under the License. */ -import org.apache.lucene.messages.Message; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.Message; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java (revision 0) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java (working copy) @@ -0,0 +1,36 @@ +package org.apache.lucene.queryparser.flexible.messages; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.Locale; + +/** + * Message Interface for a lazy loading. + * For Native Language Support (NLS), system of software internationalization. + */ +public interface Message { + + public String getKey(); + + public Object[] getArguments(); + + public String getLocalizedMessage(); + + public String getLocalizedMessage(Locale locale); + +} Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java (working copy) Property changes on: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/Message.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java (revision 0) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java (working copy) @@ -0,0 +1,70 @@ +package org.apache.lucene.queryparser.flexible.messages; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.Locale; + +/** + * Default implementation of Message interface. + * For Native Language Support (NLS), system of software internationalization. + */ +public class MessageImpl implements Message { + + private String key; + + private Object[] arguments = new Object[0]; + + public MessageImpl(String key) { + this.key = key; + + } + + public MessageImpl(String key, Object... args) { + this(key); + this.arguments = args; + } + + public Object[] getArguments() { + return this.arguments; + } + + public String getKey() { + return this.key; + } + + public String getLocalizedMessage() { + return getLocalizedMessage(Locale.getDefault()); + } + + public String getLocalizedMessage(Locale locale) { + return NLS.getLocalizedMessage(getKey(), locale, getArguments()); + } + + @Override + public String toString() { + Object[] args = getArguments(); + StringBuilder sb = new StringBuilder(getKey()); + if (args != null) { + for (int i = 0; i < args.length; i++) { + sb.append(i == 0 ? " " : ", ").append(args[i]); + } + } + return sb.toString(); + } + +} Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java (working copy) Property changes on: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/MessageImpl.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java (revision 0) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java (working copy) @@ -0,0 +1,206 @@ +package org.apache.lucene.queryparser.flexible.messages; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * MessageBundles classes extend this class, to implement a bundle. + * + * For Native Language Support (NLS), system of software internationalization. + * + * This interface is similar to the NLS class in eclipse.osgi.util.NLS class - + * initializeMessages() method resets the values of all static strings, should + * only be called by classes that extend from NLS (see TestMessages.java for + * reference) - performs validation of all message in a bundle, at class load + * time - performs per message validation at runtime - see NLSTest.java for + * usage reference + * + * MessageBundle classes may subclass this type. + */ +public class NLS { + + private static Map+This utility API, adds support for NLS messages in the apache code. +It is currently used by the lucene "New Flexible Query PArser". +
++Features: +
+Lazy loading of Message Strings + +
+ public class MessagesTestBundle extends NLS {
+
+ private static final String BUNDLE_NAME = MessagesTestBundle.class.getName();
+
+ private MessagesTestBundle() {
+ // should never be instantiated
+ }
+
+ static {
+ // register all string ids with NLS class and initialize static string
+ // values
+ NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class);
+ }
+
+ // static string must match the strings in the property files.
+ public static String Q0001E_INVALID_SYNTAX;
+ public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION;
+
+ // this message is missing from the properties file
+ public static String Q0005E_MESSAGE_NOT_IN_BUNDLE;
+ }
+
+ // Create a message reference
+ Message invalidSyntax = new MessageImpl(MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
+
+ // Do other stuff in the code...
+ // when is time to display the message to the user or log the message on a file
+ // the message is loaded from the correct bundle
+
+ String message1 = invalidSyntax.getLocalizedMessage();
+ String message2 = invalidSyntax.getLocalizedMessage(Locale.JAPANESE);
+
+
+
++Normal loading of Message Strings + +
+ String message1 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION); + String message2 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.JAPANESE); ++ + +
+The org.apache.lucene.messages.TestNLS junit contains several other examples. +The TestNLS java code is available from the Apache Lucene code repository. +
+ + Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html (working copy) Property changes on: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/AnyQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/AnyQueryNodeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/AnyQueryNodeBuilder.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.builders.QueryTreeBuilder; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/BooleanQueryNodeBuilder.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.builders.QueryTreeBuilder; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/MatchAllDocsQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/MatchAllDocsQueryNodeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/MatchAllDocsQueryNodeBuilder.java (working copy) @@ -17,7 +17,7 @@ * limitations under the License. */ -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.MatchAllDocsQueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/MatchNoDocsQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/MatchNoDocsQueryNodeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/MatchNoDocsQueryNodeBuilder.java (working copy) @@ -17,7 +17,7 @@ * limitations under the License. */ -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.MatchNoDocsQueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/NumericRangeQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/NumericRangeQueryNodeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/NumericRangeQueryNodeBuilder.java (working copy) @@ -18,7 +18,7 @@ */ import org.apache.lucene.document.NumericField; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/StandardBooleanQueryNodeBuilder.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.builders.QueryTreeBuilder; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericRangeQueryNode.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericRangeQueryNode.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/NumericRangeQueryNode.java (working copy) @@ -1,7 +1,7 @@ package org.apache.lucene.queryparser.flexible.standard.nodes; import org.apache.lucene.document.NumericField; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.FieldQueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/EscapeQuerySyntaxImpl.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/EscapeQuerySyntaxImpl.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/EscapeQuerySyntaxImpl.java (working copy) @@ -19,7 +19,7 @@ import java.util.Locale; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.parser.EscapeQuerySyntax; import org.apache.lucene.queryparser.flexible.core.util.UnescapedCharSequence; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java (working copy) @@ -2,8 +2,8 @@ /* JavaCCOptions:KEEP_LINE_COL=null */ package org.apache.lucene.queryparser.flexible.standard.parser; - import org.apache.lucene.messages.Message; - import org.apache.lucene.messages.MessageImpl; + import org.apache.lucene.queryparser.flexible.messages.Message; + import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.*; import org.apache.lucene.queryparser.flexible.core.messages.*; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java (working copy) @@ -21,8 +21,8 @@ import java.io.StringReader; import java.util.Vector; -import org.apache.lucene.messages.Message; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.Message; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.AndQueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj (working copy) @@ -33,8 +33,8 @@ import java.io.StringReader; import java.util.Vector; -import org.apache.lucene.messages.Message; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.Message; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.AndQueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java (working copy) @@ -19,8 +19,8 @@ import java.io.StringReader; import java.util.Vector; -import org.apache.lucene.messages.Message; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.Message; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.AndQueryNode; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/AllowLeadingWildcardProcessor.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/AllowLeadingWildcardProcessor.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/AllowLeadingWildcardProcessor.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericQueryNodeProcessor.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericQueryNodeProcessor.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericQueryNodeProcessor.java (working copy) @@ -21,7 +21,7 @@ import java.text.ParseException; import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.config.FieldConfig; Index: modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericRangeQueryNodeProcessor.java =================================================================== --- modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericRangeQueryNodeProcessor.java (revision 1215327) +++ modules/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/NumericRangeQueryNodeProcessor.java (working copy) @@ -21,7 +21,7 @@ import java.text.ParseException; import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.config.FieldConfig; Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java (revision 0) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java (working copy) @@ -0,0 +1,40 @@ +package org.apache.lucene.queryparser.flexible.messages; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +public class MessagesTestBundle extends NLS { + + private static final String BUNDLE_NAME = MessagesTestBundle.class.getName(); + + private MessagesTestBundle() { + // should never be instantiated + } + + static { + // register all string ids with NLS class and initialize static string + // values + NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class); + } + + // static string must match the strings in the property files. + public static String Q0001E_INVALID_SYNTAX; + public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION; + + // this message is missing from the properties file + public static String Q0005E_MESSAGE_NOT_IN_BUNDLE; +} Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java (revision 1215327) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java (working copy) Property changes on: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties (revision 0) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties (working copy) @@ -0,0 +1,3 @@ +Q0001E_INVALID_SYNTAX = Syntax Error: {0} + +Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION = Truncated unicode escape sequence. Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties (revision 1215327) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties (working copy) Property changes on: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle.properties ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties (revision 0) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties (working copy) @@ -0,0 +1,3 @@ +Q0001E_INVALID_SYNTAX = \u69cb\u6587\u30a8\u30e9\u30fc: {0} + +Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION = \u5207\u308a\u6368\u3066\u3089\u308c\u305f\u30e6\u30cb\u30b3\u30fc\u30c9\u30fb\u30a8\u30b9\u30b1\u30fc\u30d7\u30fb\u30b7\u30fc\u30b1\u30f3\u30b9\u3002 Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties (revision 1215327) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties (working copy) Property changes on: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/MessagesTestBundle_ja.properties ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java (revision 0) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java (working copy) @@ -0,0 +1,106 @@ +package org.apache.lucene.queryparser.flexible.messages; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.Locale; + +import org.apache.lucene.util.LuceneTestCase; + +/** + */ +public class TestNLS extends LuceneTestCase { + public void testMessageLoading() { + Message invalidSyntax = new MessageImpl( + MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); + /* + * if the default locale is ja, you get ja as a fallback: + * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) + */ + if (!Locale.getDefault().getLanguage().equals("ja")) + assertEquals("Syntax Error: XXX", invalidSyntax.getLocalizedMessage(Locale.ENGLISH)); + } + + public void testMessageLoading_ja() { + Message invalidSyntax = new MessageImpl( + MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX"); + assertEquals("構文エラー: XXX", invalidSyntax + .getLocalizedMessage(Locale.JAPANESE)); + } + + public void testNLSLoading() { + String message = NLS + .getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.ENGLISH); + /* + * if the default locale is ja, you get ja as a fallback: + * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) + */ + if (!Locale.getDefault().getLanguage().equals("ja")) + assertEquals("Truncated unicode escape sequence.", message); + + message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, Locale.ENGLISH, + "XXX"); + /* + * if the default locale is ja, you get ja as a fallback: + * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) + */ + if (!Locale.getDefault().getLanguage().equals("ja")) + assertEquals("Syntax Error: XXX", message); + } + + public void testNLSLoading_ja() { + String message = NLS.getLocalizedMessage( + MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, + Locale.JAPANESE); + assertEquals("切り捨てられたユニコード・エスケープ・シーケンス。", message); + + message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, + Locale.JAPANESE, "XXX"); + assertEquals("構文エラー: XXX", message); + } + + public void testNLSLoading_xx_XX() { + Locale locale = new Locale("xx", "XX", ""); + String message = NLS.getLocalizedMessage( + MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, + locale); + /* + * if the default locale is ja, you get ja as a fallback: + * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) + */ + if (!Locale.getDefault().getLanguage().equals("ja")) + assertEquals("Truncated unicode escape sequence.", message); + + message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX, + locale, "XXX"); + /* + * if the default locale is ja, you get ja as a fallback: + * see ResourceBundle.html#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) + */ + if (!Locale.getDefault().getLanguage().equals("ja")) + assertEquals("Syntax Error: XXX", message); + } + + public void testMissingMessage() { + Locale locale = Locale.ENGLISH; + String message = NLS.getLocalizedMessage( + MessagesTestBundle.Q0005E_MESSAGE_NOT_IN_BUNDLE, locale); + + assertEquals("Message with key:Q0005E_MESSAGE_NOT_IN_BUNDLE and locale: " + + locale.toString() + " not found.", message); + } +} Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java (revision 1215327) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java (working copy) Property changes on: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/messages/TestNLS.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/SpansValidatorQueryNodeProcessor.java =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/SpansValidatorQueryNodeProcessor.java (revision 1215327) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/spans/SpansValidatorQueryNodeProcessor.java (working copy) @@ -19,7 +19,7 @@ import java.util.List; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.AndQueryNode; Index: modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java =================================================================== --- modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java (revision 1215327) +++ modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java (working copy) @@ -38,7 +38,7 @@ import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; -import org.apache.lucene.messages.MessageImpl; +import org.apache.lucene.queryparser.flexible.messages.MessageImpl; import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.apache.lucene.queryparser.flexible.core.messages.QueryParserMessages; import org.apache.lucene.queryparser.flexible.core.nodes.FuzzyQueryNode;