mocobeta commented on a change in pull request #2000:
URL: https://github.com/apache/lucene-solr/pull/2000#discussion_r507173608



##########
File path: lucene/core/src/java/org/apache/lucene/index/IndexUpgrader.java
##########
@@ -77,9 +77,10 @@ private static void printUsage() {
   public static void main(String[] args) throws IOException {
     parseArgs(args).upgrade();
   }
-  
+
+  /** Parse arguments. */
   @SuppressForbidden(reason = "System.out required: command line tool")
-  static IndexUpgrader parseArgs(String[] args) throws IOException {
+  public static IndexUpgrader parseArgs(String[] args) throws IOException {

Review comment:
       It should be possible to just call `main()` instead of calling 
parseArgs() and upgrade() separately. Can we omit the assertion error regarding 
to `parseArgs()`?
   
   ```
           /*
           IndexUpgrader upgrader = null;
           try {
             upgrader = IndexUpgrader.parseArgs(args.toArray(new String[0]));
           } catch (Exception e) {
             throw new AssertionError("unable to parse args: " + args, e);
           }
           upgrader.upgrade();
            */
           // this could throw IOException. 
           // we cannot identify whether the error occurs in parseArgs() or 
upgrade()
           IndexUpgrader.main(args.toArray(new String[0]));
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to