[MINOR: better handling of optional debug/verbose streams. nickel@x9c.fr**20090323215054] { hunk ./src/fr/x9c/nickel/AntTask.java 59 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/AntTask.java 240 - this.verbose ? System.out : null, - this.debug ? System.err : null, + this.verbose ? System.out : new DiscardingPrintStream(), + this.debug ? System.err : new DiscardingPrintStream(), addfile ./src/fr/x9c/nickel/DiscardingPrintStream.java hunk ./src/fr/x9c/nickel/DiscardingPrintStream.java 1 +/* + * This file is part of Nickel. + * Copyright (C) 2007-2009 Xavier Clerc. + * + * Nickel is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Nickel is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package fr.x9c.nickel; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.Locale; + +/** + * This class implements a {@link java.io.PrintStream} that + * just does nothing when an attempt is made to write/print + * anything. It thus just discards any passed data.
+ *
+ * This class never throws any exception, should null + * values be passed to methods. + * + * @author Xavier Clerc + * @version 1.2 + * @since 1.2 + */ +public final class DiscardingPrintStream extends PrintStream { + + /** + * Construct an instance. + */ + public DiscardingPrintStream() { + super(new ByteArrayOutputStream(1)); + } // end empty constructor + + /** + * {@inheritDoc} + */ + @Override + public PrintStream append(final char c) { + return this; + } // end method 'append(char)' + + /** + * {@inheritDoc} + */ + @Override + public PrintStream append(final CharSequence csq) { + return this; + } // end method 'append(CharSequence)' + + /** + * {@inheritDoc} + */ + @Override + public PrintStream append(final CharSequence csq, + final int start, + final int end) { + return this; + } // end method 'append(CharSequence, int, int)' + + /** + * {@inheritDoc} + */ + @Override + public boolean checkError() { + return false; + } // end method 'checkError()' + + /** + * {@inheritDoc} + */ + @Override + public void close() { + } // end method 'close()' + + /** + * {@inheritDoc} + */ + @Override + public void flush() { + } // end method 'flush()' + + /** + * {@inheritDoc} + */ + @Override + public PrintStream format(final Locale l, + final String format, + final Object... args) { + return this; + } // end method 'format(Locale, String, Object...)' + + /** + * {@inheritDoc} + */ + @Override + public PrintStream format(final String format, + final Object... args) { + return this; + } // end method 'format(String, Object...)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final boolean b) { + } // end method 'print(boolean)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final char c) { + } // end method 'print(char)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final char[] s) { + } // end method 'print(char[])' + + /** + * {@inheritDoc} + */ + @Override + public void print(final double d) { + } // end method 'print(double)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final float f) { + } // end method 'print(float)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final int i) { + } // end method 'print(int)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final long l) { + } // end method 'print(long)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final Object obj) { + } // end method 'print(Object)' + + /** + * {@inheritDoc} + */ + @Override + public void print(final String s) { + } // end method 'print(String)' + + /** + * {@inheritDoc} + */ + @Override + public PrintStream printf(final Locale l, + final String format, + final Object... args) { + return this; + } // end method 'printf(Locale, String, Object...)' + + /** + * {@inheritDoc} + */ + @Override + public PrintStream printf(final String format, + final Object... args) { + return this; + } // end method 'printf(String, Object...)' + + /** + * {@inheritDoc} + */ + @Override + public void println() { + } // end method 'println()' + + /** + * {@inheritDoc} + */ + @Override + public void println(final boolean x) { + } // end method 'println(boolean)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final char x) { + } // end method 'println(char)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final char[] x) { + } // end method 'println(char[])' + + /** + * {@inheritDoc} + */ + @Override + public void println(final double x) { + } // end method 'println(double)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final float x) { + } // end method 'println(float)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final int x) { + } // end method 'println(int)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final long x) { + } // end method 'println(long)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final Object x) { + } // end method 'println(Object)' + + /** + * {@inheritDoc} + */ + @Override + public void println(final String x) { + } // end method 'println(String)' + + /** + * {@inheritDoc} + */ + @Override + public void write(final byte[] buf, + final int off, + final int len) { + } // end method 'write(byte[], int, int)' + + /** + * {@inheritDoc} + */ + @Override + public void write(final int b) { + } // end method 'write(int)' + +} // end class 'DiscardingPrintStream' hunk ./src/fr/x9c/nickel/Main.java 51 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/Main.java 99 - if (verbose != null) { - verbose.println(Main.COMPLETE_NAME); - } // end if + verbose.println(Main.COMPLETE_NAME); hunk ./src/fr/x9c/nickel/Main.java 105 - if (verbose != null) { - verbose.println(String.format(Main.FILE_TRACE, filename)); - } // end if + verbose.println(String.format(Main.FILE_TRACE, filename)); hunk ./src/fr/x9c/nickel/Main.java 125 - if (verbose != null) { - verbose.println(); - } // end if + verbose.println(); hunk ./src/fr/x9c/nickel/Main.java 146 - if (verbose != null) { - verbose.println(); - } // end if + verbose.println(); hunk ./src/fr/x9c/nickel/Main.java 151 - if (verbose != null) { - verbose.println(); - } // end if + verbose.println(); hunk ./src/fr/x9c/nickel/Main.java 163 - if (debug != null) { - t.printStackTrace(debug); - } // end if + t.printStackTrace(debug); hunk ./src/fr/x9c/nickel/ModuleProducer.java 37 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/ModuleProducer.java 54 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/ModuleProducer.java 57 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/ModuleProducer.java 67 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/ModuleProducer.java 70 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/Parameters.java 36 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/Parameters.java 116 - * Where comments should be printed during process - * (null if such print should not occur). + * Where comments should be printed during process. hunk ./src/fr/x9c/nickel/Parameters.java 122 - * an error occurs (null if such print should not occur). + * an error occurs. hunk ./src/fr/x9c/nickel/Parameters.java 154 - * (null if such print should not occur) + * - should not be null + * (use {@link fr.x9c.nickel.DiscardingPrintStream} if no output is wanted) hunk ./src/fr/x9c/nickel/Parameters.java 158 - * (null if such print should not occur) + * - should not be null + * (use {@link fr.x9c.nickel.DiscardingPrintStream} if no output is wanted) hunk ./src/fr/x9c/nickel/Parameters.java 187 + assert verbose != null : "null verbose"; + assert debug != null : "null verbose"; hunk ./src/fr/x9c/nickel/Parameters.java 222 - * Returns the stream where comments should be printed during process - * (null if such print should not occur). + * Returns the stream where comments should be printed during process. hunk ./src/fr/x9c/nickel/Parameters.java 224 - * (null if such print should not occur) hunk ./src/fr/x9c/nickel/Parameters.java 231 - * should be printed when an error occurs - * (null if such print should not occur). + * should be printed when an error occurs. hunk ./src/fr/x9c/nickel/Parameters.java 234 - * (null if such print should not occur) hunk ./src/fr/x9c/nickel/Parameters.java 313 - PrintStream verbose = null; - PrintStream debug = null; + PrintStream verbose = new DiscardingPrintStream(); + PrintStream debug = new DiscardingPrintStream(); hunk ./src/fr/x9c/nickel/classes/ClassesModuleProducer.java 34 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/classes/ClassesModuleProducer.java 75 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ClassesModuleProducer.java 86 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 55 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 177 - * Where comments should be printed during process - * (null if such print should not occur). + * Where comments should be printed during process. hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 183 - * an error occurs (null if such print should not occur). + * an error occurs. hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 253 - if (this.verbose != null) { - this.verbose.println(CodeGenerator.CODE_GEN_TRACE); - } // end if + this.verbose.println(CodeGenerator.CODE_GEN_TRACE); hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 319 - if (this.verbose != null) { - this.verbose.println(String.format(CodeGenerator.CLASS_TRACE, - cls.getOCamlName())); - } // end if + this.verbose.println(String.format(CodeGenerator.CLASS_TRACE, + cls.getOCamlName())); hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 973 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 983 + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/CodeGenerator.java 995 - if (debug != null) { - ioe.printStackTrace(debug); - } // end if + ioe.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 50 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 436 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 439 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 451 - if (verbose != null) { - verbose.println(String.format(OCamlClass.RESOLVING_TRACE, - this.javaName)); - } // end if + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; + verbose.println(String.format(OCamlClass.RESOLVING_TRACE, + this.javaName)); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 486 - if (debug != null) { - cnfe.printStackTrace(debug); - } // end if + cnfe.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 500 - if (debug != null) { - le.printStackTrace(debug); - } // end if + le.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 569 - if (verbose != null) { - verbose.println(String.format(OCamlClass.MAPPING_TRACE, + verbose.println(String.format(OCamlClass.MAPPING_TRACE, + name, + "field")); + if (count > 1) { + verbose.println(String.format(OCamlClass.MULTIPLE_MATCH, + "field", hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 576 - "field")); - if (count > 1) { - verbose.println(String.format(OCamlClass.MULTIPLE_MATCH, - "field", - name, - count)); - } // end if + count)); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 608 - if (verbose != null) { - verbose.println(String.format(OCamlClass.MAPPING_TRACE, + verbose.println(String.format(OCamlClass.MAPPING_TRACE, + sign, + "constructor")); + if (count > 1) { + verbose.println(String.format(OCamlClass.MULTIPLE_MATCH, + "constructor", hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 615 - "constructor")); - if (count > 1) { - verbose.println(String.format(OCamlClass.MULTIPLE_MATCH, - "constructor", - sign, - count)); - } // end if + count)); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 647 - if (verbose != null) { - verbose.println(String.format(OCamlClass.MAPPING_TRACE, + verbose.println(String.format(OCamlClass.MAPPING_TRACE, + sign, + "method")); + if (count > 1) { + verbose.println(String.format(OCamlClass.MULTIPLE_MATCH, + "method", hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 654 - "method")); - if (count > 1) { - verbose.println(String.format(OCamlClass.MULTIPLE_MATCH, - "method", - sign, - count)); - } // end if + count)); hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 660 - if (verbose != null) { - for (int i = usedField.nextClearBit(0); - i < this.field.size(); - i = usedField.nextClearBit(i + 1)) { - verbose.println(String.format(OCamlClass.NOT_USED, - "field", - this.field.get(i))); - } // end for - for (int i = usedFields.nextClearBit(0); - i < this.fields.size(); - i = usedFields.nextClearBit(i + 1)) { - verbose.println(String.format(OCamlClass.NOT_USED, - "fields", - this.fields.get(i))); - } // end for - for (int i = usedConstructor.nextClearBit(0); - i < this.constructor.size(); - i = usedConstructor.nextClearBit(i + 1)) { - verbose.println(String.format(OCamlClass.NOT_USED, - "constructor", - this.constructor.get(i))); - } // end for - for (int i = usedConstructors.nextClearBit(0); - i < this.constructors.size(); - i = usedConstructors.nextClearBit(i + 1)) { - verbose.println(String.format(OCamlClass.NOT_USED, - "constructors", - this.constructors.get(i))); - } // end for - for (int i = usedMethod.nextClearBit(0); - i < this.method.size(); - i = usedMethod.nextClearBit(i + 1)) { - verbose.println(String.format(OCamlClass.NOT_USED, - "method", - this.method.get(i))); - } // end for - for (int i = usedMethods.nextClearBit(0); - i < this.methods.size(); - i = usedMethods.nextClearBit(i + 1)) { - verbose.println(String.format(OCamlClass.NOT_USED, - "methods", - this.methods.get(i))); - } // end for - } // end if + for (int i = usedField.nextClearBit(0); + i < this.field.size(); + i = usedField.nextClearBit(i + 1)) { + verbose.println(String.format(OCamlClass.NOT_USED, + "field", + this.field.get(i))); + } // end for + for (int i = usedFields.nextClearBit(0); + i < this.fields.size(); + i = usedFields.nextClearBit(i + 1)) { + verbose.println(String.format(OCamlClass.NOT_USED, + "fields", + this.fields.get(i))); + } // end for + for (int i = usedConstructor.nextClearBit(0); + i < this.constructor.size(); + i = usedConstructor.nextClearBit(i + 1)) { + verbose.println(String.format(OCamlClass.NOT_USED, + "constructor", + this.constructor.get(i))); + } // end for + for (int i = usedConstructors.nextClearBit(0); + i < this.constructors.size(); + i = usedConstructors.nextClearBit(i + 1)) { + verbose.println(String.format(OCamlClass.NOT_USED, + "constructors", + this.constructors.get(i))); + } // end for + for (int i = usedMethod.nextClearBit(0); + i < this.method.size(); + i = usedMethod.nextClearBit(i + 1)) { + verbose.println(String.format(OCamlClass.NOT_USED, + "method", + this.method.get(i))); + } // end for + for (int i = usedMethods.nextClearBit(0); + i < this.methods.size(); + i = usedMethods.nextClearBit(i + 1)) { + verbose.println(String.format(OCamlClass.NOT_USED, + "methods", + this.methods.get(i))); + } // end for hunk ./src/fr/x9c/nickel/classes/OCamlClass.java 704 - if ((verbose != null) && (this.wrapper && Modifier.isAbstract(modifiers))) { + if (this.wrapper && Modifier.isAbstract(modifiers)) { hunk ./src/fr/x9c/nickel/classes/ParseXML.java 48 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/classes/ParseXML.java 131 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 134 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 148 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 151 - if (verbose != null) { - verbose.println(ParseXML.XML_PARSE_TRACE); - } // end if + verbose.println(ParseXML.XML_PARSE_TRACE); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 176 - if (debug != null) { - e.printStackTrace(debug); - } // end if + e.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 179 - if (debug != null) { - se.printStackTrace(debug); - } // end if + se.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 184 - if (debug != null) { - pce.printStackTrace(debug); - } // end if + pce.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 189 - if (debug != null) { - ioe.printStackTrace(debug); - } // end if + ioe.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 194 - if (debug != null) { - fce.printStackTrace(debug); - } // end if + fce.printStackTrace(debug); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 213 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 216 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 229 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; + hunk ./src/fr/x9c/nickel/classes/ParseXML.java 251 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 254 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 267 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 276 - if (verbose != null) { - verbose.printf("... module '%s'\n", name); - } // end if + verbose.printf("... module '%s'\n", name); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 339 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 342 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 352 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 370 - if (verbose != null) { - verbose.printf("... meta named '%s' with value '%s'\n", name, value); - } // end if + verbose.printf("... meta named '%s' with value '%s'\n", name, value); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 378 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 381 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 391 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 407 - if (verbose != null) { - verbose.printf("... external class '%s' mapped to '%s'\n", - javaName, - ocamlName); - } // end if + verbose.printf("... external class '%s' mapped to '%s'\n", + javaName, + ocamlName); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 419 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 422 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 435 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 457 - if (verbose != null) { - final String type; - switch (kind) { - case CLASS: - type = "class"; - break; - case INTERFACE: - type = "interface"; - break; - case ENUM: - type = "enum"; - break; - default: - assert false : "invalid class kind"; - type = "???"; - break; - } // end switch - verbose.printf("... %s '%s' mapped to '%s'\n", - type, - javaName, - ocamlName); - } // end if + final String type; + switch (kind) { + case CLASS: + type = "class"; + break; + case INTERFACE: + type = "interface"; + break; + case ENUM: + type = "enum"; + break; + default: + assert false : "invalid class kind"; + type = "???"; + break; + } // end switch + verbose.printf("... %s '%s' mapped to '%s'\n", + type, + javaName, + ocamlName); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 547 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 550 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 560 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 569 - if (verbose != null) { - verbose.printf("... ... field '%s'\n", name); - } // end if + verbose.printf("... ... field '%s'\n", name); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 578 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 581 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 591 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 600 - if (verbose != null) { - verbose.printf("... ... fields '%s'\n", pattern); - } // end if + verbose.printf("... ... fields '%s'\n", pattern); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 609 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 612 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 622 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 631 - if (verbose != null) { - verbose.printf("... ... constructor '%s'\n", sign); - } // end if + verbose.printf("... ... constructor '%s'\n", sign); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 640 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 643 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 653 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 662 - if (verbose != null) { - verbose.printf("... ... constructors '%s'\n", pattern); - } // end if + verbose.printf("... ... constructors '%s'\n", pattern); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 671 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 674 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 684 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 693 - if (verbose != null) { - verbose.printf("... ... method '%s'\n", sign); - } // end if + verbose.printf("... ... method '%s'\n", sign); hunk ./src/fr/x9c/nickel/classes/ParseXML.java 702 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 705 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/classes/ParseXML.java 715 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/classes/ParseXML.java 724 - if (verbose != null) { - verbose.printf("... ... methods '%s'\n", pattern); - } // end if + verbose.printf("... ... methods '%s'\n", pattern); hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 45 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 100 - * Where comments should be printed during process - * (null if such print should not occur). + * Where comments should be printed during process. hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 106 - * an error occurs (null if such print should not occur). + * an error occurs. hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 148 - if (this.verbose != null) { - this.verbose.println(CodeGenerator.CODE_GEN_TRACE); - } // end if + this.verbose.println(CodeGenerator.CODE_GEN_TRACE); hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 207 - if (debug != null) { - se.printStackTrace(debug); - } // end if + se.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 384 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 394 + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/CodeGenerator.java 402 - if (debug != null) { - ioe.printStackTrace(debug); - } // end if + ioe.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 36 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 93 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 104 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 129 - if (debug != null) { - cnfe.printStackTrace(debug); - } // end if + cnfe.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 133 - if (debug != null) { - nsme.printStackTrace(debug); - } // end if + nsme.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 137 - if (debug != null) { - ie.printStackTrace(debug); - } // end if + ie.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 141 - if (debug != null) { - iae.printStackTrace(debug); - } // end if + iae.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/DatabaseModuleProducer.java 145 - if (debug != null) { - ite.printStackTrace(debug); - } // end if + ite.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/ParseXML.java 48 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/database/ParseXML.java 103 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 106 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 120 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/ParseXML.java 123 - if (verbose != null) { - verbose.println(ParseXML.XML_PARSE_TRACE); - } // end if + verbose.println(ParseXML.XML_PARSE_TRACE); hunk ./src/fr/x9c/nickel/database/ParseXML.java 148 - if (debug != null) { - e.printStackTrace(debug); - } // end if + e.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/ParseXML.java 151 - if (debug != null) { - se.printStackTrace(debug); - } // end if + se.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/ParseXML.java 156 - if (debug != null) { - pce.printStackTrace(debug); - } // end if + pce.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/ParseXML.java 161 - if (debug != null) { - ioe.printStackTrace(debug); - } // end if + ioe.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/ParseXML.java 166 - if (debug != null) { - fce.printStackTrace(debug); - } // end if + fce.printStackTrace(debug); hunk ./src/fr/x9c/nickel/database/ParseXML.java 185 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 188 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 201 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; + hunk ./src/fr/x9c/nickel/database/ParseXML.java 223 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 226 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 239 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/ParseXML.java 248 - if (verbose != null) { - verbose.printf("... dbmodule '%s'\n", name); - } // end if + verbose.printf("... dbmodule '%s'\n", name); hunk ./src/fr/x9c/nickel/database/ParseXML.java 288 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 291 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 301 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/ParseXML.java 319 - if (verbose != null) { - verbose.printf("... meta named '%s' with value '%s'\n", name, value); - } // end if + verbose.printf("... meta named '%s' with value '%s'\n", name, value); hunk ./src/fr/x9c/nickel/database/ParseXML.java 327 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 330 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 340 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/ParseXML.java 355 - if (verbose != null) { - verbose.printf("... command '%s' with code '%s'\n", name, code); - } // end if + verbose.printf("... command '%s' with code '%s'\n", name, code); hunk ./src/fr/x9c/nickel/database/ParseXML.java 363 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 366 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/ParseXML.java 376 + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; hunk ./src/fr/x9c/nickel/database/ParseXML.java 392 - if (verbose != null) { - verbose.printf("... query '%s' with code '%s'\n", name, code); - } // end if + verbose.printf("... query '%s' with code '%s'\n", name, code); hunk ./src/fr/x9c/nickel/database/SQLStatement.java 34 - * @version 1.1 + * @version 1.2 hunk ./src/fr/x9c/nickel/database/SQLStatement.java 169 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/SQLStatement.java 172 - * (null if such print should not occur) + * - should not be null hunk ./src/fr/x9c/nickel/database/SQLStatement.java 180 - if (verbose != null) { - verbose.println(String.format(SQLStatement.RESOLVING_TRACE, this.name)); - } // end if + assert verbose != null : "null verbose"; + assert debug != null : "null debug"; + verbose.println(String.format(SQLStatement.RESOLVING_TRACE, this.name)); hunk ./src/fr/x9c/nickel/database/SQLStatement.java 200 - if (debug != null) { - se.printStackTrace(debug); - } // end if + se.printStackTrace(debug); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 34 - null, + new DiscardingPrintStream(), hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 43 - null, + new DiscardingPrintStream(), hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 54 - null, - null, + new DiscardingPrintStream(), + new DiscardingPrintStream(), hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 64 + final DiscardingPrintStream dps = new DiscardingPrintStream(); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 66 - new Parameters(null, null, null, ".", "pack", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(null, dps, dps, ".", "pack", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 70 - new Parameters(Parameters.Action.PROCESS, null, null, null, "pack", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, null, "pack", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 74 - new Parameters(Parameters.Action.PROCESS, null, null, ".", null, "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", null, "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 78 - new Parameters(Parameters.Action.PROCESS, null, null, ".", "pack", null, "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", "pack", null, "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 82 - new Parameters(Parameters.Action.PROCESS, null, null, ".", "pack", "ml", null, "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", "pack", "ml", null, "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 86 - new Parameters(Parameters.Action.PROCESS, null, null, ".", "pack", "ml", "/", null, Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", "pack", "ml", "/", null, Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 90 - new Parameters(Parameters.Action.PROCESS, null, null, ".", "pack", "ml", "/", "prefix", null, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", "pack", "ml", "/", "prefix", null, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 94 - new Parameters(Parameters.Action.PROCESS, null, null, ".", "pack", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, (String[]) null); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", "pack", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, (String[]) null); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 100 - new Parameters(Parameters.Action.PROCESS, null, null, ".", "pack.if", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); + new Parameters(Parameters.Action.PROCESS, dps, dps, ".", "pack.if", "ml", "/", "prefix", Parameters.ModuleKind.CLASSES, "abc.xml"); hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 107 - null, - null, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 116 - System.out, - null, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 125 - null, - null, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 134 - null, - null, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 143 - null, - null, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 152 - null, - System.err, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 161 - null, - null, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 204 - final PrintStream v, - final PrintStream d, hunk ./tests/unit/src/fr/x9c/nickel/ParametersTest.java 215 - assertEquals(v, p.getVerboseStream()); - assertEquals(d, p.getDebugStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/ClassComparatorTest.java 21 +import fr.x9c.nickel.DiscardingPrintStream; hunk ./tests/unit/src/fr/x9c/nickel/classes/ClassComparatorTest.java 77 - c1.resolve(ClassComparator.class.getClassLoader(), null, null); - c2.resolve(ClassComparator.class.getClassLoader(), null, null); + c1.resolve(ClassComparator.class.getClassLoader(), + new DiscardingPrintStream(), + new DiscardingPrintStream()); + c2.resolve(ClassComparator.class.getClassLoader(), + new DiscardingPrintStream(), + new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 25 +import fr.x9c.nickel.DiscardingPrintStream; hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 68 - occ.resolve(ClassComparator.class.getClassLoader(), null, null); + occ.resolve(ClassComparator.class.getClassLoader(), new DiscardingPrintStream(), new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 87 - occ.resolve(ClassComparator.class.getClassLoader(), null, null); + occ.resolve(ClassComparator.class.getClassLoader(), new DiscardingPrintStream(), new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 100 - occ.resolve(ClassComparator.class.getClassLoader(), null, null); + occ.resolve(ClassComparator.class.getClassLoader(), new DiscardingPrintStream(), new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 118 - occ.resolve(ClassComparator.class.getClassLoader(), null, null); + occ.resolve(ClassComparator.class.getClassLoader(), new DiscardingPrintStream(), new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 146 - occ.resolve(ClassComparator.class.getClassLoader(), null, null); + occ.resolve(ClassComparator.class.getClassLoader(), new DiscardingPrintStream(), new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/classes/OCamlClassTest.java 161 - occ.resolve(ClassComparator.class.getClassLoader(), null, null); + occ.resolve(ClassComparator.class.getClassLoader(), new DiscardingPrintStream(), new DiscardingPrintStream()); hunk ./tests/unit/src/fr/x9c/nickel/database/SQLStatementTest.java 29 +import fr.x9c.nickel.DiscardingPrintStream; hunk ./tests/unit/src/fr/x9c/nickel/database/SQLStatementTest.java 65 - stat.resolve(conn, null, null); + stat.resolve(conn, new DiscardingPrintStream(), new DiscardingPrintStream()); }