Name: gm110360 Date: 10/21/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
The exec(String command, String envp[], File dir) method of
the Runtime class tests for empty command using:
if (command == "")
IMO, this test should be done using:
if (command.length() == 0)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the following line of Java code:
Runtime.getRuntime().exec(new String());
EXPECTED VERSUS ACTUAL BEHAVIOR :
It should throw an IllegalArgumentException, but it throws
an IndexOutOfBoundsException instead.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.IndexOutOfBoundsException
at java.lang.Runtime.exec(Runtime.java:547)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at CodeSnippet_3.run(CodeSnippet_3.java:3)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain1.eval
(ScrapbookMain1.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.evalLoop
(ScrapbookMain.java:48)
at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.main
(ScrapbookMain.java:29)
REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 166038)
======================================================================
|