This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: PR libgcj/29594


I'm checking this in.

This fixes PR libgcj/29594, a minor bug in jv-convert.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	PR libgcj/29594:
	* gnu/gcj/convert/Convert.java (main): Correctly handle missing
	input or output encodings.  Removed unused local variables.

Index: gnu/gcj/convert/Convert.java
===================================================================
--- gnu/gcj/convert/Convert.java	(revision 121182)
+++ gnu/gcj/convert/Convert.java	(working copy)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2002, 2005, 2006  Free Software Foundation
+/* Copyright (C) 1999, 2002, 2005, 2006, 2007  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -151,12 +151,6 @@
 
     try
       {
-	BytesToUnicode inDecoder
-	  = inEncodingName == null ? BytesToUnicode.getDefaultDecoder()
-	  : BytesToUnicode.getDecoder(inEncodingName);
-	UnicodeToBytes outEncoder
-	  = outEncodingName == null ? UnicodeToBytes.getDefaultEncoder()
-	  : UnicodeToBytes.getEncoder(outEncodingName);
 	InputStream inStream = inName.equals("-") ? System.in
 	  : new FileInputStream(inName);
 	OutputStream outStream;
@@ -165,9 +159,13 @@
 	else
 	  outStream = new FileOutputStream(outName);
 	InputStreamReader in
-	  = new InputStreamReader(inStream, inEncodingName);
+	  = (inEncodingName == null
+	     ? new InputStreamReader(inStream)
+	     : new InputStreamReader(inStream, inEncodingName));
 	OutputStreamWriter out
-	  = new OutputStreamWriter(outStream, outEncodingName);
+	  = (outEncodingName == null
+	     ? new OutputStreamWriter(outStream)
+	     : new OutputStreamWriter(outStream, outEncodingName));
 	char[] buffer = new char[2048];
 	for (;;)
 	  {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]