Changeset 16533
- Timestamp:
- 2008-07-24T14:40:48+12:00 (16 years ago)
- Location:
- release-kits/shared/ant-tasks/orans
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/shared/ant-tasks/orans/RegexSearchReplace.java
r16532 r16533 40 40 } 41 41 42 int noReplaces = 0; 42 43 43 44 //create the output stream … … 71 72 try { 72 73 while ( (line = in.readLine()) != null ) { 73 line = line.replaceAll( pattern, replacement); 74 75 String oldLine = line; 76 line = line.replaceAll(pattern, replacement); 77 if ( !oldLine.equals( line ) ) { 78 noReplaces++; 79 } 80 74 81 out.write(line); 75 82 out.newLine(); … … 116 123 throw new BuildException( "Error - Couldn't write to the specified file" ); 117 124 } 118 125 126 String linesWord = "lines"; 127 if ( noReplaces == 1 ) { 128 linesWord = "line"; 129 } 130 System.out.println( "Changed " + noReplaces + " " + linesWord + " in " + file ); 119 131 } 120 132
Note:
See TracChangeset
for help on using the changeset viewer.