lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/queryParser QueryParser.java QueryParser.jj
Date Thu, 13 Nov 2003 11:42:26 GMT
ehatcher    2003/11/13 03:42:26

  Modified:    src/java/org/apache/lucene/queryParser QueryParser.java
                        QueryParser.jj
  Log:
  only throw ParseException from parse methods
  
  Revision  Changes    Path
  1.7       +9 -10     jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.java
  
  Index: QueryParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- QueryParser.java	9 Oct 2003 01:22:21 -0000	1.6
  +++ QueryParser.java	13 Nov 2003 11:42:26 -0000	1.7
  @@ -83,13 +83,8 @@
      */
     static public Query parse(String query, String field, Analyzer analyzer)
          throws ParseException {
  -    try {
  -      QueryParser parser = new QueryParser(field, analyzer);
  -      return parser.parse(query);
  -    }
  -    catch (TokenMgrError tme) {
  -      throw new ParseException(tme.getMessage());
  -    }
  +    QueryParser parser = new QueryParser(field, analyzer);
  +    return parser.parse(query);
     }
   
     /** Constructs a query parser.
  @@ -106,11 +101,15 @@
      * <a href="lucene.search.Query.html">Query</a>.
      *  @param query	the query string to be parsed.
      *  @throws ParseException if the parsing fails
  -   *  @throws TokenMgrError if ther parsing fails
      */
  -  public Query parse(String query) throws ParseException, TokenMgrError {
  +  public Query parse(String query) throws ParseException {
       ReInit(new FastCharStream(new StringReader(query)));
  -    return Query(field);
  +    try {
  +      return Query(field);
  +    }
  +    catch (TokenMgrError tme) {
  +      throw new ParseException(tme.getMessage());
  +    }
     }
   
     /**
  
  
  
  1.37      +9 -10     jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj
  
  Index: QueryParser.jj
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- QueryParser.jj	13 Oct 2003 14:37:51 -0000	1.36
  +++ QueryParser.jj	13 Nov 2003 11:42:26 -0000	1.37
  @@ -145,13 +145,8 @@
      */
     static public Query parse(String query, String field, Analyzer analyzer)
          throws ParseException {
  -    try {
  -      QueryParser parser = new QueryParser(field, analyzer);
  -      return parser.parse(query);
  -    }
  -    catch (TokenMgrError tme) {
  -      throw new ParseException(tme.getMessage());
  -    }
  +    QueryParser parser = new QueryParser(field, analyzer);
  +    return parser.parse(query);
     }
   
     /** Constructs a query parser.
  @@ -168,11 +163,15 @@
      * <a href="lucene.search.Query.html">Query</a>.
      *  @param query	the query string to be parsed.
      *  @throws ParseException if the parsing fails
  -   *  @throws TokenMgrError if ther parsing fails
      */
  -  public Query parse(String query) throws ParseException, TokenMgrError {
  +  public Query parse(String query) throws ParseException {
       ReInit(new FastCharStream(new StringReader(query)));
  -    return Query(field);
  +    try {
  +      return Query(field);
  +    }
  +    catch (TokenMgrError tme) {
  +      throw new ParseException(tme.getMessage());
  +    }
     }
   
     /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message