Integer.getInteger patch for null argument

Mark Wielaard mark@klomp.org
Tue Apr 16 14:31:00 GMT 2002


Hi,

On Tue, 2002-04-16 at 04:14, Bryce McKinlay wrote:
> 
> I think a better fix would be to add an IllegalArgumentException catch 
> to the existing try block, and move the System.getProperty() call inside 
> it. And fix System.getProperty() since it doesn't seem to throw the 
> right exception on a null argument ;-)

System.getProperty(null) does actually throw the correct
NullPointerException. But the spec does indeed indicate that
System.getProperty("") should throw an IllegalArgumentException, which
it doesn't. Classpath also does this wrong.

I will look into it, but it might not make it for 3.1 since I have
already committed the previous patch and I might not have enough time to
change System and all other primitive wrapper classes correctly now.

Cheers,

Mark



More information about the Java-patches mailing list