src/share/classes/com/sun/tools/javap/JavapTask.java

changeset 1321
489905e5018e
parent 581
f2fdd52e4e87
child 1442
fcf89720ae71
     1.1 --- a/src/share/classes/com/sun/tools/javap/JavapTask.java	Wed Sep 05 12:00:30 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javap/JavapTask.java	Fri Sep 07 11:12:16 2012 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -374,8 +374,8 @@
    1.11          task_locale = locale;
    1.12      }
    1.13  
    1.14 -    public void setLog(PrintWriter log) {
    1.15 -        this.log = log;
    1.16 +    public void setLog(Writer log) {
    1.17 +        this.log = getPrintWriterForWriter(log);
    1.18      }
    1.19  
    1.20      public void setLog(OutputStream s) {
    1.21 @@ -383,7 +383,7 @@
    1.22      }
    1.23  
    1.24      private static PrintWriter getPrintWriterForStream(OutputStream s) {
    1.25 -        return new PrintWriter(s, true);
    1.26 +        return new PrintWriter(s == null ? System.err : s, true);
    1.27      }
    1.28  
    1.29      private static PrintWriter getPrintWriterForWriter(Writer w) {

mercurial