test/com/sun/javadoc/lib/JavadocTester.java

Fri, 01 Jul 2011 13:34:37 -0700

author
ksrini
date
Fri, 01 Jul 2011 13:34:37 -0700
changeset 1052
409b104f8b86
parent 554
9d9f26857129
child 2036
8df12c315ea3
permissions
-rw-r--r--

6735320: StringIndexOutOfBoundsException for empty @serialField tag
Reviewed-by: jjg, bpatel

duke@1 1 /*
ksrini@1052 2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
ohair@554 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 20 * or visit www.oracle.com if you need additional information or have any
ohair@554 21 * questions.
duke@1 22 */
duke@1 23
duke@1 24 import com.sun.javadoc.*;
duke@1 25 import java.util.*;
duke@1 26 import java.io.*;
duke@1 27
duke@1 28
duke@1 29 /**
duke@1 30 * Runs javadoc and then runs regression tests on the resulting output.
duke@1 31 * This class currently contains three tests:
duke@1 32 * <ul>
duke@1 33 * <li> String search: Reads each file, complete with newlines,
duke@1 34 * into a string. Lets you search for strings that contain
duke@1 35 * newlines. String matching is case-sensitive.
duke@1 36 * You can run javadoc multiple times with different arguments,
duke@1 37 * generating output into different destination directories, and
duke@1 38 * then perform a different array of tests on each one.
duke@1 39 * To do this, the run method accepts a test array for testing
duke@1 40 * that a string is found, and a negated test array for testing
duke@1 41 * that a string is not found.
duke@1 42 * <li> Run diffs: Iterate through the list of given file pairs
duke@1 43 * and diff the pairs.
duke@1 44 * <li> Check exit code: Check the exit code of Javadoc and
duke@1 45 * record whether the test passed or failed.
duke@1 46 * </ul>
duke@1 47 *
duke@1 48 * @author Doug Kramer
duke@1 49 * @author Jamie Ho
duke@1 50 * @since 1.4.2
duke@1 51 */
duke@1 52 public abstract class JavadocTester {
duke@1 53
duke@1 54 protected static final String FS = System.getProperty("file.separator");
duke@1 55 protected static final String PS = System.getProperty("path.separator");
duke@1 56 protected static final String NL = System.getProperty("line.separator");
duke@1 57 protected static final String SRC_DIR = System.getProperty("test.src", ".");
duke@1 58 protected static final String JAVA_VERSION = System.getProperty("java.version");
duke@1 59 protected static final String[][] NO_TEST = new String[][] {};
duke@1 60
duke@1 61 /**
duke@1 62 * Use this as the file name in the test array when you want to search
duke@1 63 * for a string in the error output.
duke@1 64 */
duke@1 65 public static final String ERROR_OUTPUT = "ERROR_OUTPUT";
duke@1 66
duke@1 67 /**
duke@1 68 * Use this as the file name in the test array when you want to search
duke@1 69 * for a string in the notice output.
duke@1 70 */
duke@1 71 public static final String NOTICE_OUTPUT = "NOTICE_OUTPUT";
duke@1 72
duke@1 73 /**
duke@1 74 * Use this as the file name in the test array when you want to search
duke@1 75 * for a string in the warning output.
duke@1 76 */
duke@1 77 public static final String WARNING_OUTPUT = "WARNING_OUTPUT";
duke@1 78
duke@1 79 /**
duke@1 80 * Use this as the file name in the test array when you want to search
duke@1 81 * for a string in standard output.
duke@1 82 */
duke@1 83 public static final String STANDARD_OUTPUT = "STANDARD_OUTPUT";
duke@1 84
duke@1 85 /**
duke@1 86 * The default doclet.
duke@1 87 */
duke@1 88 public static final String DEFAULT_DOCLET_CLASS = "com.sun.tools.doclets.formats.html.HtmlDoclet";
duke@1 89 public static final String DEFAULT_DOCLET_CLASS_OLD = "com.sun.tools.doclets.standard.Standard";
duke@1 90
duke@1 91 /**
duke@1 92 * The writer to write error messages.
duke@1 93 */
duke@1 94 public StringWriter errors;
duke@1 95
duke@1 96 /**
duke@1 97 * The writer to write notices.
duke@1 98 */
duke@1 99 public StringWriter notices;
duke@1 100
duke@1 101 /**
duke@1 102 * The writer to write warnings.
duke@1 103 */
duke@1 104 public StringWriter warnings;
duke@1 105
duke@1 106 /**
duke@1 107 * The buffer of warning output..
duke@1 108 */
duke@1 109 public StringBuffer standardOut;
duke@1 110
duke@1 111 /**
duke@1 112 * The current subtest number.
duke@1 113 */
duke@1 114 private static int numTestsRun = 0;
duke@1 115
duke@1 116 /**
duke@1 117 * The number of subtests passed.
duke@1 118 */
duke@1 119 private static int numTestsPassed = 0;
duke@1 120
duke@1 121 /**
duke@1 122 * The current run of javadoc
duke@1 123 */
duke@1 124 private static int javadocRunNum = 0;
duke@1 125
duke@1 126 /**
jjg@389 127 * Whether or not to match newlines exactly.
jjg@389 128 * Set this value to false if the match strings
jjg@389 129 * contain text from javadoc comments containing
jjg@389 130 * non-platform newlines.
jjg@389 131 */
jjg@389 132 protected boolean exactNewlineMatch = true;
jjg@389 133
jjg@389 134 /**
duke@1 135 * Construct a JavadocTester.
duke@1 136 */
duke@1 137 public JavadocTester() {
duke@1 138 }
duke@1 139
duke@1 140 /**
duke@1 141 * Return the bug id.
duke@1 142 * @return the bug id
duke@1 143 */
duke@1 144 public abstract String getBugId();
duke@1 145
duke@1 146 /**
duke@1 147 * Return the name of the bug.
duke@1 148 * @return the name of the bug
duke@1 149 */
duke@1 150 public abstract String getBugName();
duke@1 151
duke@1 152 /**
duke@1 153 * Execute the tests.
duke@1 154 *
duke@1 155 * @param tester the tester to execute
duke@1 156 * @param args the arguments to pass to Javadoc
duke@1 157 * @param testArray the array of tests
duke@1 158 * @param negatedTestArray the array of negated tests
duke@1 159 * @return the return code for the execution of Javadoc
duke@1 160 */
duke@1 161 public static int run(JavadocTester tester, String[] args,
duke@1 162 String[][] testArray, String[][] negatedTestArray) {
duke@1 163 int returnCode = tester.runJavadoc(args);
duke@1 164 tester.runTestsOnHTML(testArray, negatedTestArray);
duke@1 165 return returnCode;
duke@1 166 }
duke@1 167
duke@1 168 /**
duke@1 169 * Execute Javadoc using the default doclet.
duke@1 170 *
duke@1 171 * @param args the arguments to pass to Javadoc
duke@1 172 * @return the return code from the execution of Javadoc
duke@1 173 */
duke@1 174 public int runJavadoc(String[] args) {
duke@1 175 float javaVersion = Float.parseFloat(JAVA_VERSION.substring(0,3));
duke@1 176 String docletClass = javaVersion < 1.5 ?
duke@1 177 DEFAULT_DOCLET_CLASS_OLD : DEFAULT_DOCLET_CLASS;
duke@1 178 return runJavadoc(docletClass, args);
duke@1 179 }
duke@1 180
duke@1 181
duke@1 182 /**
duke@1 183 * Execute Javadoc.
duke@1 184 *
duke@1 185 * @param docletClass the doclet being tested.
duke@1 186 * @param args the arguments to pass to Javadoc
duke@1 187 * @return the return code from the execution of Javadoc
duke@1 188 */
duke@1 189 public int runJavadoc(String docletClass, String[] args) {
duke@1 190 javadocRunNum++;
duke@1 191 if (javadocRunNum == 1) {
duke@1 192 System.out.println("\n" + "Running javadoc...");
duke@1 193 } else {
duke@1 194 System.out.println("\n" + "Running javadoc (run "
duke@1 195 + javadocRunNum + ")...");
duke@1 196 }
duke@1 197 initOutputBuffers();
duke@1 198
duke@1 199 ByteArrayOutputStream stdout = new ByteArrayOutputStream();
ksrini@1052 200 PrintStream prevOut = System.out;
duke@1 201 System.setOut(new PrintStream(stdout));
ksrini@1052 202
ksrini@1052 203 ByteArrayOutputStream stderr = new ByteArrayOutputStream();
ksrini@1052 204 PrintStream prevErr = System.err;
ksrini@1052 205 System.setErr(new PrintStream(stderr));
ksrini@1052 206
duke@1 207 int returnCode = com.sun.tools.javadoc.Main.execute(
duke@1 208 getBugName(),
duke@1 209 new PrintWriter(errors, true),
duke@1 210 new PrintWriter(warnings, true),
duke@1 211 new PrintWriter(notices, true),
duke@1 212 docletClass,
jjg@140 213 getClass().getClassLoader(),
duke@1 214 args);
ksrini@1052 215 System.setOut(prevOut);
duke@1 216 standardOut = new StringBuffer(stdout.toString());
ksrini@1052 217 System.setErr(prevErr);
ksrini@1052 218 errors.write(NL + stderr.toString());
ksrini@1052 219
duke@1 220 printJavadocOutput();
duke@1 221 return returnCode;
duke@1 222 }
duke@1 223
duke@1 224 /**
duke@1 225 * Create new string writer buffers
duke@1 226 */
duke@1 227 private void initOutputBuffers() {
duke@1 228 errors = new StringWriter();
duke@1 229 notices = new StringWriter();
duke@1 230 warnings = new StringWriter();
duke@1 231 }
duke@1 232
duke@1 233 /**
duke@1 234 * Run array of tests on the resulting HTML.
duke@1 235 * This method accepts a testArray for testing that a string is found
duke@1 236 * and a negatedTestArray for testing that a string is not found.
duke@1 237 *
duke@1 238 * @param testArray the array of tests
duke@1 239 * @param negatedTestArray the array of negated tests
duke@1 240 */
duke@1 241 public void runTestsOnHTML(String[][] testArray, String[][] negatedTestArray) {
duke@1 242 runTestsOnHTML(testArray, false);
duke@1 243 runTestsOnHTML(negatedTestArray, true);
duke@1 244 }
duke@1 245
duke@1 246 /**
duke@1 247 * Run the array of tests on the resulting HTML.
duke@1 248 *
duke@1 249 * @param testArray the array of tests
duke@1 250 * @param isNegated true if test is negated; false otherwise
duke@1 251 */
duke@1 252 private void runTestsOnHTML(String[][] testArray , boolean isNegated) {
duke@1 253 for (int i = 0; i < testArray.length; i++) {
duke@1 254
duke@1 255 numTestsRun++;
duke@1 256
duke@1 257 System.out.print("Running subtest #" + numTestsRun + "... ");
duke@1 258
duke@1 259 // Get string to find
duke@1 260 String stringToFind = testArray[i][1];
duke@1 261
duke@1 262 // Read contents of file into a string
duke@1 263 String fileString;
duke@1 264 try {
duke@1 265 fileString = readFileToString(testArray[i][0]);
duke@1 266 } catch (Error e) {
duke@1 267 if (isNegated) {
duke@1 268 numTestsPassed += 1;
duke@1 269 System.out.println("Passed\n not found:\n"
duke@1 270 + stringToFind + " in non-existent " + testArray[i][0] + "\n");
duke@1 271 continue;
duke@1 272 }
duke@1 273 throw e;
duke@1 274 }
duke@1 275 // Find string in file's contents
duke@1 276 boolean isFound = findString(fileString, stringToFind);
duke@1 277 if ((isNegated && !isFound) || (!isNegated && isFound) ) {
duke@1 278 numTestsPassed += 1;
duke@1 279 System.out.println( "Passed" + "\n"
duke@1 280 + (isNegated ? "not found:" : "found:") + "\n"
duke@1 281 + stringToFind + " in " + testArray[i][0] + "\n");
duke@1 282 } else {
duke@1 283 System.out.println( "FAILED" + "\n"
duke@1 284 + "for bug " + getBugId()
duke@1 285 + " (" + getBugName() + ")" + "\n"
duke@1 286 + "when searching for:" + "\n"
duke@1 287 + stringToFind
duke@1 288 + " in " + testArray[i][0] + "\n");
duke@1 289 }
duke@1 290 }
duke@1 291 }
duke@1 292
duke@1 293 /**
duke@1 294 * Iterate through the list of given file pairs and diff each file.
duke@1 295 *
duke@1 296 * @param filePairs the pairs of files to diff.
duke@1 297 * @throws an Error is thrown if any differences are found between
duke@1 298 * file pairs.
duke@1 299 */
duke@1 300 public void runDiffs(String[][] filePairs) throws Error {
duke@1 301 runDiffs(filePairs, true);
duke@1 302 }
duke@1 303
duke@1 304 /**
duke@1 305 * Iterate through the list of given file pairs and diff each file.
duke@1 306 *
duke@1 307 * @param filePairs the pairs of files to diff.
duke@1 308 * @param throwErrorIFNoMatch flag to indicate whether or not to throw
duke@1 309 * an error if the files do not match.
duke@1 310 *
duke@1 311 * @throws an Error is thrown if any differences are found between
duke@1 312 * file pairs and throwErrorIFNoMatch is true.
duke@1 313 */
duke@1 314 public void runDiffs(String[][] filePairs, boolean throwErrorIfNoMatch) throws Error {
duke@1 315 for (int i = 0; i < filePairs.length; i++) {
duke@1 316 diff(filePairs[i][0], filePairs[i][1], throwErrorIfNoMatch);
duke@1 317 }
duke@1 318 }
duke@1 319
duke@1 320 /**
duke@1 321 * Check the exit code of Javadoc and record whether the test passed
duke@1 322 * or failed.
duke@1 323 *
duke@1 324 * @param expectedExitCode The exit code that is required for the test
duke@1 325 * to pass.
duke@1 326 * @param actualExitCode The actual exit code from the previous run of
duke@1 327 * Javadoc.
duke@1 328 */
duke@1 329 public void checkExitCode(int expectedExitCode, int actualExitCode) {
duke@1 330 numTestsRun++;
duke@1 331 if (expectedExitCode == actualExitCode) {
duke@1 332 System.out.println( "Passed" + "\n" + " got return code " +
duke@1 333 actualExitCode);
duke@1 334 numTestsPassed++;
duke@1 335 } else {
duke@1 336 System.out.println( "FAILED" + "\n" + "for bug " + getBugId()
duke@1 337 + " (" + getBugName() + ")" + "\n" + "Expected return code " +
duke@1 338 expectedExitCode + " but got " + actualExitCode);
duke@1 339 }
duke@1 340 }
duke@1 341
duke@1 342 /**
duke@1 343 * Print a summary of the test results.
duke@1 344 */
duke@1 345 protected void printSummary() {
duke@1 346 if ( numTestsRun != 0 && numTestsPassed == numTestsRun ) {
duke@1 347 // Test passed
duke@1 348 System.out.println("\n" + "All " + numTestsPassed
duke@1 349 + " subtests passed");
duke@1 350 } else {
duke@1 351 // Test failed
duke@1 352 throw new Error("\n" + (numTestsRun - numTestsPassed)
duke@1 353 + " of " + (numTestsRun)
duke@1 354 + " subtests failed for bug " + getBugId()
duke@1 355 + " (" + getBugName() + ")" + "\n");
duke@1 356 }
duke@1 357 }
duke@1 358
duke@1 359 /**
duke@1 360 * Print the output stored in the buffers.
duke@1 361 */
duke@1 362 protected void printJavadocOutput() {
duke@1 363 System.out.println(STANDARD_OUTPUT + " : \n" + getStandardOutput());
duke@1 364 System.err.println(ERROR_OUTPUT + " : \n" + getErrorOutput());
duke@1 365 System.err.println(WARNING_OUTPUT + " : \n" + getWarningOutput());
duke@1 366 System.out.println(NOTICE_OUTPUT + " : \n" + getNoticeOutput());
duke@1 367 }
duke@1 368
duke@1 369 /**
duke@1 370 * Read the file and return it as a string.
duke@1 371 *
duke@1 372 * @param fileName the name of the file to read
duke@1 373 * @return the file in string format
duke@1 374 */
duke@1 375 public String readFileToString(String fileName) throws Error {
duke@1 376 if (fileName.equals(ERROR_OUTPUT)) {
duke@1 377 return getErrorOutput();
duke@1 378 } else if (fileName.equals(NOTICE_OUTPUT)) {
duke@1 379 return getNoticeOutput();
duke@1 380 } else if (fileName.equals(WARNING_OUTPUT)) {
duke@1 381 return getWarningOutput();
duke@1 382 } else if (fileName.equals(STANDARD_OUTPUT)) {
duke@1 383 return getStandardOutput();
duke@1 384 }
duke@1 385 try {
duke@1 386 File file = new File(fileName);
duke@1 387 if ( !file.exists() ) {
duke@1 388 System.out.println("\n" + "FILE DOES NOT EXIST: " + fileName);
duke@1 389 }
duke@1 390 BufferedReader in = new BufferedReader(new FileReader(file));
duke@1 391
duke@1 392 // Create an array of characters the size of the file
duke@1 393 char[] allChars = new char[(int)file.length()];
duke@1 394
duke@1 395 // Read the characters into the allChars array
duke@1 396 in.read(allChars, 0, (int)file.length());
duke@1 397 in.close();
duke@1 398
duke@1 399 // Convert to a string
duke@1 400 String allCharsString = new String(allChars);
duke@1 401 return allCharsString;
duke@1 402 } catch (FileNotFoundException e) {
duke@1 403 System.err.println(e);
duke@1 404 throw new Error("File not found: " + fileName);
duke@1 405 } catch (IOException e) {
duke@1 406 System.err.println(e);
duke@1 407 throw new Error("Error reading file: " + fileName);
duke@1 408 }
duke@1 409 }
duke@1 410
duke@1 411 /**
duke@1 412 * Compare the two given files.
duke@1 413 *
duke@1 414 * @param file1 the first file to compare.
duke@1 415 * @param file2 the second file to compare.
duke@1 416 * @param throwErrorIFNoMatch flag to indicate whether or not to throw
duke@1 417 * an error if the files do not match.
duke@1 418 * @return true if the files are the same and false otherwise.
duke@1 419 */
duke@1 420 public boolean diff(String file1, String file2, boolean throwErrorIFNoMatch) throws Error {
duke@1 421 String file1Contents = readFileToString(file1);
duke@1 422 String file2Contents = readFileToString(file2);
duke@1 423 numTestsRun++;
duke@1 424 if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
duke@1 425 System.out.println("Diff successful: " + file1 + ", " + file2);
duke@1 426 numTestsPassed++;
duke@1 427 return true;
duke@1 428 } else if (throwErrorIFNoMatch) {
duke@1 429 throw new Error("Diff failed: " + file1 + ", " + file2);
duke@1 430 } else {
duke@1 431 return false;
duke@1 432 }
duke@1 433 }
duke@1 434
duke@1 435 /**
duke@1 436 * Search for the string in the given file and return true
duke@1 437 * if the string was found.
jjg@389 438 * If exactNewlineMatch is false, newlines will be normalized
jjg@389 439 * before the comparison.
duke@1 440 *
duke@1 441 * @param fileString the contents of the file to search through
duke@1 442 * @param stringToFind the string to search for
duke@1 443 * @return true if the string was found
duke@1 444 */
duke@1 445 private boolean findString(String fileString, String stringToFind) {
jjg@389 446 if (exactNewlineMatch) {
jjg@389 447 return fileString.indexOf(stringToFind) >= 0;
jjg@389 448 } else {
jjg@389 449 return fileString.replace(NL, "\n").indexOf(stringToFind.replace(NL, "\n")) >= 0;
jjg@389 450 }
duke@1 451 }
duke@1 452
jjg@389 453
duke@1 454 /**
duke@1 455 * Return the standard output.
duke@1 456 * @return the standard output
duke@1 457 */
duke@1 458 public String getStandardOutput() {
duke@1 459 return standardOut.toString();
duke@1 460 }
duke@1 461
duke@1 462 /**
duke@1 463 * Return the error output.
duke@1 464 * @return the error output
duke@1 465 */
duke@1 466 public String getErrorOutput() {
duke@1 467 return errors.getBuffer().toString();
duke@1 468 }
duke@1 469
duke@1 470 /**
duke@1 471 * Return the notice output.
duke@1 472 * @return the notice output
duke@1 473 */
duke@1 474 public String getNoticeOutput() {
duke@1 475 return notices.getBuffer().toString();
duke@1 476 }
duke@1 477
duke@1 478 /**
duke@1 479 * Return the warning output.
duke@1 480 * @return the warning output
duke@1 481 */
duke@1 482 public String getWarningOutput() {
duke@1 483 return warnings.getBuffer().toString();
duke@1 484 }
duke@1 485
duke@1 486 /**
duke@1 487 * A utility to copy a directory from one place to another.
duke@1 488 * We may possibly want to move this to our doclet toolkit in
duke@1 489 * the near future and maintain it from there.
duke@1 490 *
duke@1 491 * @param targetDir the directory to copy.
duke@1 492 * @param destDir the destination to copy the directory to.
duke@1 493 */
duke@1 494 public static void copyDir(String targetDir, String destDir) {
duke@1 495 if (targetDir.endsWith("SCCS")) {
duke@1 496 return;
duke@1 497 }
duke@1 498 try {
duke@1 499 File targetDirObj = new File(targetDir);
duke@1 500 File destDirParentObj = new File(destDir);
duke@1 501 File destDirObj = new File(destDirParentObj, targetDirObj.getName());
duke@1 502 if (! destDirParentObj.exists()) {
duke@1 503 destDirParentObj.mkdir();
duke@1 504 }
duke@1 505 if (! destDirObj.exists()) {
duke@1 506 destDirObj.mkdir();
duke@1 507 }
duke@1 508 String[] files = targetDirObj.list();
duke@1 509 for (int i = 0; i < files.length; i++) {
duke@1 510 File srcFile = new File(targetDirObj, files[i]);
duke@1 511 File destFile = new File(destDirObj, files[i]);
duke@1 512 if (srcFile.isFile()) {
duke@1 513 System.out.println("Copying " + srcFile + " to " + destFile);
duke@1 514 copyFile(destFile, srcFile);
duke@1 515 } else if(srcFile.isDirectory()) {
duke@1 516 copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
duke@1 517 }
duke@1 518 }
duke@1 519 } catch (IOException exc) {
duke@1 520 throw new Error("Could not copy " + targetDir + " to " + destDir);
duke@1 521 }
duke@1 522 }
duke@1 523
duke@1 524 /**
duke@1 525 * Copy source file to destination file.
duke@1 526 *
duke@1 527 * @throws SecurityException
duke@1 528 * @throws IOException
duke@1 529 */
duke@1 530 public static void copyFile(File destfile, File srcfile)
duke@1 531 throws IOException {
duke@1 532 byte[] bytearr = new byte[512];
duke@1 533 int len = 0;
duke@1 534 FileInputStream input = new FileInputStream(srcfile);
duke@1 535 File destDir = destfile.getParentFile();
duke@1 536 destDir.mkdirs();
duke@1 537 FileOutputStream output = new FileOutputStream(destfile);
duke@1 538 try {
duke@1 539 while ((len = input.read(bytearr)) != -1) {
duke@1 540 output.write(bytearr, 0, len);
duke@1 541 }
duke@1 542 } catch (FileNotFoundException exc) {
duke@1 543 } catch (SecurityException exc) {
duke@1 544 } finally {
duke@1 545 input.close();
duke@1 546 output.close();
duke@1 547 }
duke@1 548 }
duke@1 549 }

mercurial