public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add missing java.io.PrintStream constructors
@ 2009-07-27 23:03 Andrew John Hughes
  2009-07-28  8:27 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew John Hughes @ 2009-07-27 23:03 UTC (permalink / raw)
  To: gcc-patches, Java Patch List

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Simple fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40616 by
porting the constructors over from Classpath:

2009-07-27  Andrew John Hughes  <ahughes@redhat.com>

        * java/io/PrintStream.class: Regenerated.
        * java/io/PrintStream.h: Updated.
        * java/io/PrintStream.java:
        (PrintStream(File)): Ported from GNU Classpath
        version.
        (PrintStream(File, String)): Likewise.
        (PrintStream(String)): Likewise.
        (PrintStream(String, String)): Likewise.

Ok for trunk?
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8

[-- Attachment #2: printstream.diff --]
[-- Type: text/plain, Size: 3868 bytes --]

Index: libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ConstructorDocImpl.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: libjava/classpath/lib/java/io/PrintStream.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: libjava/java/io/PrintStream.h
===================================================================
--- libjava/java/io/PrintStream.h	(revision 150100)
+++ libjava/java/io/PrintStream.h	(working copy)
@@ -27,6 +27,10 @@
 {
 
 public:
+  PrintStream(::java::io::File *);
+  PrintStream(::java::io::File *, ::java::lang::String *);
+  PrintStream(::java::lang::String *);
+  PrintStream(::java::lang::String *, ::java::lang::String *);
   PrintStream(::java::io::OutputStream *);
   PrintStream(::java::io::OutputStream *, jboolean);
   PrintStream(::java::io::OutputStream *, jboolean, ::java::lang::String *);
Index: libjava/java/io/PrintStream.java
===================================================================
--- libjava/java/io/PrintStream.java	(revision 150100)
+++ libjava/java/io/PrintStream.java	(working copy)
@@ -123,6 +123,74 @@
   }
 
   /**
+   * This method initializes a new <code>PrintStream</code> object to write
+   * to the specified output File. Doesn't autoflush.
+   *
+   * @param file The <code>File</code> to write to.
+   * @throws FileNotFoundException if an error occurs while opening the file.
+   *
+   * @since 1.5
+   */
+  public PrintStream (File file)
+    throws FileNotFoundException
+  {
+    this (new FileOutputStream(file), false);
+  }
+
+  /**
+   * This method initializes a new <code>PrintStream</code> object to write
+   * to the specified output File. Doesn't autoflush.
+   *
+   * @param file The <code>File</code> to write to.
+   * @param encoding The name of the character encoding to use for this
+   * object.
+   * @throws FileNotFoundException If an error occurs while opening the file.
+   * @throws UnsupportedEncodingException If the charset specified by
+   * <code>encoding</code> is invalid.
+   *
+   * @since 1.5
+   */
+  public PrintStream (File file, String encoding)
+    throws FileNotFoundException,UnsupportedEncodingException
+  {
+    this (new FileOutputStream(file), false, encoding);
+  }
+
+  /**
+   * This method initializes a new <code>PrintStream</code> object to write
+   * to the specified output File. Doesn't autoflush.
+   *
+   * @param fileName The name of the <code>File</code> to write to.
+   * @throws FileNotFoundException if an error occurs while opening the file,
+   *
+   * @since 1.5
+   */
+  public PrintStream (String fileName)
+    throws FileNotFoundException
+  {
+    this (new FileOutputStream(new File(fileName)), false);
+  }
+
+  /**
+   * This method initializes a new <code>PrintStream</code> object to write
+   * to the specified output File. Doesn't autoflush.
+   *
+   * @param fileName The name of the <code>File</code> to write to.
+   * @param encoding The name of the character encoding to use for this
+   * object.
+   * @throws FileNotFoundException if an error occurs while opening the file.
+   * @throws UnsupportedEncodingException If the charset specified by
+   * <code>encoding</code> is invalid.
+   *
+   * @since 1.5
+   */
+  public PrintStream (String fileName, String encoding)
+      throws FileNotFoundException,UnsupportedEncodingException
+  {
+    this (new FileOutputStream(new File(fileName)), false, encoding);
+  }
+
+  /**
    * This method intializes a new <code>PrintStream</code> object to write
    * to the specified output sink.  This constructor also allows "auto-flush"
    * functionality to be specified where the stream will be flushed after

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add missing java.io.PrintStream constructors
  2009-07-27 23:03 [PATCH] Add missing java.io.PrintStream constructors Andrew John Hughes
@ 2009-07-28  8:27 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2009-07-28  8:27 UTC (permalink / raw)
  To: Andrew John Hughes; +Cc: gcc-patches, Java Patch List

On 07/28/2009 01:03 AM, Andrew John Hughes wrote:
> Simple fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40616 by
> porting the constructors over from Classpath:
> 
> 2009-07-27  Andrew John Hughes  <ahughes@redhat.com>
> 
>         * java/io/PrintStream.class: Regenerated.
>         * java/io/PrintStream.h: Updated.
>         * java/io/PrintStream.java:
>         (PrintStream(File)): Ported from GNU Classpath
>         version.
>         (PrintStream(File, String)): Likewise.
>         (PrintStream(String)): Likewise.
>         (PrintStream(String, String)): Likewise.
> 
> Ok for trunk?

Sure.

Andrew.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-28  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 23:03 [PATCH] Add missing java.io.PrintStream constructors Andrew John Hughes
2009-07-28  8:27 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).