lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r813198 - in /lucene/java/trunk: contrib/queryparser/src/java/org/apache/lucene/messages/ contrib/queryparser/src/java/org/apache/lucene/queryParser/core/ contrib/queryparser/src/java/org/apache/lucene/queryParser/core/builders/ contrib/que...
Date Thu, 10 Sep 2009 02:44:51 GMT
Author: markrmiller
Date: Thu Sep 10 02:44:50 2009
New Revision: 813198

URL: http://svn.apache.org/viewvc?rev=813198&view=rev
Log:
LUCENE-1887: moves messages from queryParser contrib to core and applies Robert Muir's patch
to convert to 1.4

Added:
    lucene/java/trunk/src/java/org/apache/lucene/messages/
      - copied from r813182, lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/messages/
    lucene/java/trunk/src/test/org/apache/lucene/messages/
      - copied from r813182, lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/messages/
Removed:
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/messages/
    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/messages/
Modified:
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/QueryNodeParseException.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/builders/QueryTreeBuilder.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/GroupQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ModifierQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ProximityQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/BooleanQueryNodeBuilder.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchAllDocsQueryNodeBuilder.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchNoDocsQueryNodeBuilder.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java
    lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java
    lucene/java/trunk/src/java/org/apache/lucene/messages/MessageImpl.java
    lucene/java/trunk/src/java/org/apache/lucene/messages/NLS.java
    lucene/java/trunk/src/test/org/apache/lucene/messages/TestNLS.java

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/QueryNodeParseException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/QueryNodeParseException.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/QueryNodeParseException.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/QueryNodeParseException.java
Thu Sep 10 02:44:50 2009
@@ -58,7 +58,7 @@
   public void setQuery(CharSequence query) {
     this.query = query;
     this.message = new MessageImpl(
-        QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, "");
+        QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, new Object[] {query, ""});
   }
 
   public CharSequence getQuery() {

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/builders/QueryTreeBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/builders/QueryTreeBuilder.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/builders/QueryTreeBuilder.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/builders/QueryTreeBuilder.java
Thu Sep 10 02:44:50 2009
@@ -175,9 +175,9 @@
     if (builder == null) {
 
       throw new QueryNodeException(new MessageImpl(
-          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, node
+          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, new Object[]{node
               .toQueryString(new EscapeQuerySyntaxImpl()), node.getClass()
-              .getName()));
+              .getName()}));
 
     }
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/BoostQueryNode.java
Thu Sep 10 02:44:50 2009
@@ -51,7 +51,7 @@
   public BoostQueryNode(QueryNode query, float value) throws QueryNodeException {
     if (query == null) {
       throw new QueryNodeError(new MessageImpl(
-          QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, "query", "null"));
+          QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, new Object[]{"query", "null"}));
     }
 
     this.value = value;

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/GroupQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/GroupQueryNode.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/GroupQueryNode.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/GroupQueryNode.java
Thu Sep 10 02:44:50 2009
@@ -42,7 +42,7 @@
   public GroupQueryNode(QueryNode query) {
     if (query == null) {
       throw new QueryNodeError(new MessageImpl(
-          QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "query", "null"));
+          QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, new Object[]{"query", "null"}));
     }
 
     allocate();

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ModifierQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ModifierQueryNode.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ModifierQueryNode.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ModifierQueryNode.java
Thu Sep 10 02:44:50 2009
@@ -94,7 +94,7 @@
   public ModifierQueryNode(QueryNode query, Modifier mod) {
     if (query == null) {
       throw new QueryNodeError(new MessageImpl(
-          QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "query", "null"));
+          QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, new Object[]{"query", "null"}));
     }
 
     allocate();

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/PhraseSlopQueryNode.java
Thu Sep 10 02:44:50 2009
@@ -40,7 +40,7 @@
       throws QueryNodeException {
     if (query == null) {
       throw new QueryNodeError(new MessageImpl(
-          QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, "query", "null"));
+          QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, new Object[]{"query", "null"}));
     }
 
     this.value = value;

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ProximityQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ProximityQueryNode.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ProximityQueryNode.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/ProximityQueryNode.java
Thu Sep 10 02:44:50 2009
@@ -109,8 +109,8 @@
     if (type == Type.NUMBER) {
       if (distance <= 0) {
         throw new QueryNodeError(new MessageImpl(
-            QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "distance",
-            distance));
+            QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, new Object[]{"distance",
+            distance}));
 
       } else {
         this.distance = distance;

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/core/nodes/SlopQueryNode.java
Thu Sep 10 02:44:50 2009
@@ -47,7 +47,7 @@
   public SlopQueryNode(QueryNode query, int value) {
     if (query == null) {
       throw new QueryNodeError(new MessageImpl(
-          QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, "query", "null"));
+          QueryParserMessages.NODE_ACTION_NOT_SUPPORTED, new Object[]{"query", "null"}));
     }
 
     this.value = value;

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/BooleanQueryNodeBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/BooleanQueryNodeBuilder.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/BooleanQueryNodeBuilder.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/BooleanQueryNodeBuilder.java
Thu Sep 10 02:44:50 2009
@@ -67,9 +67,9 @@
           } catch (TooManyClauses ex) {
 
             throw new QueryNodeException(new MessageImpl(
-                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery
+                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, new Object[]{BooleanQuery
                     .getMaxClauseCount(), queryNode
-                    .toQueryString(new EscapeQuerySyntaxImpl())), ex);
+                    .toQueryString(new EscapeQuerySyntaxImpl())}), ex);
 
           }
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchAllDocsQueryNodeBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchAllDocsQueryNodeBuilder.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchAllDocsQueryNodeBuilder.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchAllDocsQueryNodeBuilder.java
Thu Sep 10 02:44:50 2009
@@ -40,9 +40,9 @@
     // validates node
     if (!(queryNode instanceof MatchAllDocsQueryNode)) {
       throw new QueryNodeException(new MessageImpl(
-          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, queryNode
+          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, new Object[]{queryNode
               .toQueryString(new EscapeQuerySyntaxImpl()), queryNode.getClass()
-              .getName()));
+              .getName()}));
     }
 
     return new MatchAllDocsQuery();

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchNoDocsQueryNodeBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchNoDocsQueryNodeBuilder.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchNoDocsQueryNodeBuilder.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/MatchNoDocsQueryNodeBuilder.java
Thu Sep 10 02:44:50 2009
@@ -40,9 +40,9 @@
     // validates node
     if (!(queryNode instanceof MatchNoDocsQueryNode)) {
       throw new QueryNodeException(new MessageImpl(
-          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, queryNode
+          QueryParserMessages.LUCENE_QUERY_CONVERSION_ERROR, new Object[]{queryNode
               .toQueryString(new EscapeQuerySyntaxImpl()), queryNode.getClass()
-              .getName()));
+              .getName()}));
     }
 
     return new BooleanQuery();

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/builders/StandardBooleanQueryNodeBuilder.java
Thu Sep 10 02:44:50 2009
@@ -68,9 +68,9 @@
           } catch (TooManyClauses ex) {
 
             throw new QueryNodeException(new MessageImpl(
-                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, BooleanQuery
+                QueryParserMessages.TOO_MANY_BOOLEAN_CLAUSES, new Object[]{BooleanQuery
                     .getMaxClauseCount(), queryNode
-                    .toQueryString(new EscapeQuerySyntaxImpl())), ex);
+                    .toQueryString(new EscapeQuerySyntaxImpl())}), ex);
 
           }
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/EscapeQuerySyntaxImpl.java
Thu Sep 10 02:44:50 2009
@@ -289,7 +289,7 @@
       return c - 'A' + 10;
     } else {
       throw new ParseException(new MessageImpl(
-          QueryParserMessages.INVALID_SYNTAX_ESCAPE_NONE_HEX_UNICODE, c));
+          QueryParserMessages.INVALID_SYNTAX_ESCAPE_NONE_HEX_UNICODE, new Object[]{c}));
     }
   }
 

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java
Thu Sep 10 02:44:50 2009
@@ -47,8 +47,8 @@
    */
   public ParseException(Token currentTokenVal,
       int[][] expectedTokenSequencesVal, String[] tokenImageVal) {
-    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(
-        currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));
+    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, new Object[]{initialise(
+        currentTokenVal, expectedTokenSequencesVal, tokenImageVal)}));
     this.currentToken = currentTokenVal;
     this.expectedTokenSequences = expectedTokenSequencesVal;
     this.tokenImage = tokenImageVal;
@@ -59,7 +59,7 @@
   }
 
   public ParseException() {
-    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));
+    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, new Object[]{"Error"}));
   }
 
   /**

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java
Thu Sep 10 02:44:50 2009
@@ -68,7 +68,7 @@
             throw tme;
       }
       catch (Error tme) {
-          Message message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE,
query, tme.getMessage());
+          Message message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE,
new Object[]{query, tme.getMessage()});
           QueryNodeParseException e = new QueryNodeParseException(tme);
             e.setQuery(query);
             e.setNonLocalizedMessage(message);

Modified: lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java?rev=813198&r1=813197&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java
(original)
+++ lucene/java/trunk/contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/processors/AllowLeadingWildcardProcessor.java
Thu Sep 10 02:44:50 2009
@@ -74,8 +74,8 @@
           case '*':
           case '?':
             throw new QueryNodeException(new MessageImpl(
-                QueryParserMessages.LEADING_WILDCARD_NOT_ALLOWED, node
-                    .toQueryString(new EscapeQuerySyntaxImpl())));    
+                QueryParserMessages.LEADING_WILDCARD_NOT_ALLOWED, new Object[]{node
+                    .toQueryString(new EscapeQuerySyntaxImpl())}));    
         }
       }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/messages/MessageImpl.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/messages/MessageImpl.java?rev=813198&r1=813182&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/messages/MessageImpl.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/messages/MessageImpl.java Thu Sep 10 02:44:50
2009
@@ -36,7 +36,7 @@
 
   }
 
-  public MessageImpl(String key, Object... args) {
+  public MessageImpl(String key, Object[] args) {
     this(key);
     this.arguments = args;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/messages/NLS.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/messages/NLS.java?rev=813198&r1=813182&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/messages/NLS.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/messages/NLS.java Thu Sep 10 02:44:50 2009
@@ -45,7 +45,7 @@
  */
 public class NLS {
 
-  private static Map<String, Class<Object>> bundles = new HashMap<String,
Class<Object>>(
+  private static Map/*<String, Class<Object>>*/ bundles = new HashMap/*<String,
Class<Object>>*/(
       0);
 
   protected NLS() {
@@ -66,7 +66,7 @@
   }
 
   public static String getLocalizedMessage(String key, Locale locale,
-      Object... args) {
+      Object[] args) {
     String str = getLocalizedMessage(key, locale);
 
     if (args.length > 0) {
@@ -76,7 +76,7 @@
     return str;
   }
 
-  public static String getLocalizedMessage(String key, Object... args) {
+  public static String getLocalizedMessage(String key, Object[] args) {
     return getLocalizedMessage(key, Locale.getDefault(), args);
   }
 
@@ -89,7 +89,7 @@
    * @param clazz
    *          where constants will reside
    */
-  @SuppressWarnings("unchecked")
+  //@SuppressWarnings("unchecked")
   protected static void initializeMessages(String bundleName, Class clazz) {
     try {
       load(clazz);
@@ -105,8 +105,8 @@
 
     // slow resource checking
     // need to loop thru all registered resource bundles
-    for (Iterator<String> it = bundles.keySet().iterator(); it.hasNext();) {
-      Class<Object> clazz = bundles.get(it.next());
+    for (Iterator/*<String>*/ it = bundles.keySet().iterator(); it.hasNext();) {
+      Class/*<Object>*/ clazz = (Class) bundles.get((String)it.next());
       ResourceBundle resourceBundle = ResourceBundle.getBundle(clazz.getName(),
           locale);
       if (resourceBundle != null) {
@@ -126,14 +126,14 @@
   /**
    * @param clazz
    */
-  private static void load(Class<Object> clazz) {
+  private static void load(Class/*<Object>*/ clazz) {
     final Field[] fieldArray = clazz.getDeclaredFields();
 
     boolean isFieldAccessible = (clazz.getModifiers() & Modifier.PUBLIC) != 0;
 
     // build a map of field names to Field objects
     final int len = fieldArray.length;
-    Map<String, Field> fields = new HashMap<String, Field>(len * 2);
+    Map/*<String, Field>*/ fields = new HashMap/*<String, Field>*/(len * 2);
     for (int i = 0; i < len; i++) {
       fields.put(fieldArray[i].getName(), fieldArray[i]);
       loadfieldValue(fieldArray[i], isFieldAccessible, clazz);
@@ -145,7 +145,7 @@
    * @param isFieldAccessible
    */
   private static void loadfieldValue(Field field, boolean isFieldAccessible,
-      Class<Object> clazz) {
+      Class/*<Object>*/ clazz) {
     int MOD_EXPECTED = Modifier.PUBLIC | Modifier.STATIC;
     int MOD_MASK = MOD_EXPECTED | Modifier.FINAL;
     if ((field.getModifiers() & MOD_MASK) != MOD_EXPECTED)
@@ -168,7 +168,7 @@
    * @param key
    *          - Message Key
    */
-  private static void validateMessage(String key, Class<Object> clazz) {
+  private static void validateMessage(String key, Class/*<Object>*/ clazz) {
     // Test if the message is present in the resource bundle
     try {
       ResourceBundle resourceBundle = ResourceBundle.getBundle(clazz.getName(),
@@ -192,7 +192,7 @@
   /*
    * Make a class field accessible
    */
-  @SuppressWarnings("unchecked")
+  //@SuppressWarnings("unchecked")
   private static void makeAccessible(final Field field) {
     if (System.getSecurityManager() == null) {
       field.setAccessible(true);

Modified: lucene/java/trunk/src/test/org/apache/lucene/messages/TestNLS.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/messages/TestNLS.java?rev=813198&r1=813182&r2=813198&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/messages/TestNLS.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/messages/TestNLS.java Thu Sep 10 02:44:50
2009
@@ -26,13 +26,13 @@
 public class TestNLS extends TestCase {
   public void testMessageLoading() {
     Message invalidSyntax = new MessageImpl(
-        MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
+        MessagesTestBundle.Q0001E_INVALID_SYNTAX, new Object[]{"XXX"});
     assertEquals("Syntax Error: XXX", invalidSyntax.getLocalizedMessage());
   }
 
   public void testMessageLoading_ja() {
     Message invalidSyntax = new MessageImpl(
-        MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
+        MessagesTestBundle.Q0001E_INVALID_SYNTAX, new Object[]{"XXX"});
     assertEquals("構文エラー: XXX", invalidSyntax
         .getLocalizedMessage(Locale.JAPANESE));
   }
@@ -43,7 +43,7 @@
     assertEquals("Truncated unicode escape sequence.", message);
 
     message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX,
-        "XXX");
+        new Object[]{"XXX"});
     assertEquals("Syntax Error: XXX", message);
   }
 
@@ -54,7 +54,7 @@
     assertEquals("切り捨てられたユニコード・エスケープ・シーケンス。",
message);
 
     message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX,
-        Locale.JAPANESE, "XXX");
+        Locale.JAPANESE, new Object[]{"XXX"});
     assertEquals("構文エラー: XXX", message);
   }
 
@@ -66,7 +66,7 @@
     assertEquals("Truncated unicode escape sequence.", message);
 
     message = NLS.getLocalizedMessage(MessagesTestBundle.Q0001E_INVALID_SYNTAX,
-        locale, "XXX");
+        locale, new Object[]{"XXX"});
     assertEquals("Syntax Error: XXX", message);
   }
 



Mime
View raw message