Bug 29594 - jv-convert with no args NPE
Summary: jv-convert with no args NPE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-25 18:34 UTC by Tom Tromey
Modified: 2007-01-26 01:06 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-01-26 00:05:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2006-10-25 18:34:39 UTC
If I run jv-convert with no arguments I see an NPE:

opsy. jv-convert
Exception in thread "main" java.lang.NullPointerException
   at gnu.gcj.convert.IOConverter.canonicalize(libgcj.so.7)
   at gnu.gcj.convert.BytesToUnicode.getDecoder(libgcj.so.7)
   at java.io.InputStreamReader.<init>(libgcj.so.7)
   at gnu.gcj.convert.Convert.main(libgcj.so.7)


Arguably we ought to fix this problem by replacing jv-convert
with Classpath's native2ascii.
Comment 1 Tom Tromey 2007-01-26 00:05:46 UTC
Testing a fix.
Comment 2 Tom Tromey 2007-01-26 00:24:36 UTC
It turns out to be pretty hard to make jv-convert use the classpath
getopt code, since all gcj classes are built by the main compilation
and not the tools compilation (in libjava/classpath/).
I'm going to go for a simpler stop-gap patch and then look at
moving the jv-convert functionality into classpath's native2ascii.
Comment 3 Tom Tromey 2007-01-26 01:05:26 UTC
Subject: Bug 29594

Author: tromey
Date: Fri Jan 26 01:05:13 2007
New Revision: 121197

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121197
Log:
	PR libgcj/29594:
	* gnu/gcj/convert/Convert.java (main): Correctly handle missing
	input or output encodings.  Removed unused local variables.

Modified:
    trunk/libjava/ChangeLog
    trunk/libjava/classpath/lib/gnu/gcj/convert/Convert.class
    trunk/libjava/gnu/gcj/convert/Convert.java

Comment 4 Tom Tromey 2007-01-26 01:06:00 UTC
Fix checked in.