Bug or feature  
Author Message
vladserge





PostPosted: 2003-10-10 20:33:00 Top

java-programmer, Bug or feature Hi, can someone explain the behaviour of that snip

public class Test
{
public static void main(String[] args)
{

try
{
Class c = Class.forName("BUG");
}
catch (ClassNotFoundException e)
{
}
System.out.println("Everything works?");


try
{
Class c = Class.forName("NotbUg");
}
catch (ClassNotFoundException e)
{
}
System.out.println("Still works?");

try
{
Class c = Class.forName("bUg");
}
catch (ClassNotFoundException e)
{
}
System.out.println("Everything works!!");
}
}

class BUG
{
}

In not works on JDK 1.4.2 but JDK 1.1.4. Bug or feature that question is.

Thanks in advance.

Serge
 
J鴕gen N鳱orgaard





PostPosted: 2003-10-10 20:46:00 Top

java-programmer >> Bug or feature vladserge wrote:

>Hi, can someone explain the behaviour of that snip
>
>public class Test
> {
> public static void main(String[] args)
> {
>
> try
> {
> Class c = Class.forName("BUG");
> }
> catch (ClassNotFoundException e)
> {
> }
> System.out.println("Everything works?");
>
>
> try
> {
> Class c = Class.forName("NotbUg");
> }
> catch (ClassNotFoundException e)
> {
> }
> System.out.println("Still works?");
>
> try
> {
> Class c = Class.forName("bUg");
> }
> catch (ClassNotFoundException e)
> {
> }
> System.out.println("Everything works!!");
> }
> }
>
>class BUG
> {
> }
>
>In not works on JDK 1.4.2 but JDK 1.1.4. Bug or feature that question is.
>
>
>
What does not work?

A run:

java Test
Everything works?
Still works?
Everything works!!

java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

>Thanks in advance.
>
>Serge
>
>