-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.0.2, 1.1
-
sparc
-
solaris_2.5
The default constructor for this class creates invalid object:
This should not compile.
_______________________Example ______________________________________
import java.io.*;
public class bug_test {
public static void main( String argv[] ) {
FileDescriptor fdesc=new FileDescriptor(); // We create not valid object
if ((fdesc!=null) && (fdesc instanceof FileDescriptor)) // Verify all
if ( ! fdesc.valid() ) // Not represents an active connection
{
System.out.println("Not valid !");
return;
}
System.out.println("Valid ??");
}
}
____ This test successfully compiles and produces output: ______
Not valid !
This should not compile.
_______________________Example ______________________________________
import java.io.*;
public class bug_test {
public static void main( String argv[] ) {
FileDescriptor fdesc=new FileDescriptor(); // We create not valid object
if ((fdesc!=null) && (fdesc instanceof FileDescriptor)) // Verify all
if ( ! fdesc.valid() ) // Not represents an active connection
{
System.out.println("Not valid !");
return;
}
System.out.println("Valid ??");
}
}
____ This test successfully compiles and produces output: ______
Not valid !
- duplicates
-
JDK-4017418 java.io.FileOutputStream ctor (FileDescriptor fd) works wrong with invalid fd
-
- Closed
-