You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by df...@apache.org on 2004/02/18 07:27:40 UTC

cvs commit: jakarta-oro/src/java/examples grep.java

dfs         2004/02/17 22:27:40

  Modified:    src/java/examples grep.java
  Log:
  Reformatted code to make it slightly more legible by condensing two
  try blocks into one.
  
  Revision  Changes    Path
  1.9       +6 -9      jakarta-oro/src/java/examples/grep.java
  
  Index: grep.java
  ===================================================================
  RCS file: /home/cvs/jakarta-oro/src/java/examples/grep.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- grep.java	13 Feb 2004 22:01:58 -0000	1.8
  +++ grep.java	18 Feb 2004 06:27:40 -0000	1.9
  @@ -59,21 +59,18 @@
   	// lines to the given OutputStream
   	processor.addAction(args[0]);
         }
  +
  +      for(_file = 1; _file < args.length; _file++)
  +	processor.processMatches(new FileInputStream(args[_file]), System.out);
  +
       } catch(MalformedPatternException e) {
         System.err.println("Bad pattern.");
         e.printStackTrace();
         System.exit(1);
  -    }
  -
  -    for(_file = 1; _file < args.length; _file++) {
  -      try {
  -	processor.processMatches(new FileInputStream(args[_file]), System.out);
  -      } catch(IOException e) {
  +    } catch(IOException e) {
   	System.err.println("Error opening or reading " + args[_file]);
   	e.printStackTrace();
   	System.exit(1);
  -      }
       }
     }
  -
   }
  
  
  

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