-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b71
-
generic
-
generic
-
Verified
class MySJFO extends SimpleJavaFileObject {
public MySJFO( String name ) { super( name ); }
public MySJFO( String name, JavaFileObject.Kind kind ) { super( name, kind ); }
public CharSequence getCharContent(boolean ignoreEncodingErrors)
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public InputStream openInputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public OutputStream openOutputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
new MySJFO( "name.html" ).getKind() returns JavaFileObject.Kind.OTHER
import java.io.*;
import javax.tools.*;
public class SJFOgetKind {
static class MySJFO extends SimpleJavaFileObject {
public MySJFO( String name ) { super( name ); }
public MySJFO( String name, JavaFileObject.Kind kind ) { super( name, kind ); }
public CharSequence getCharContent(boolean ignoreEncodingErrors)
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public InputStream openInputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public OutputStream openOutputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
public static void main( String[] args ){
System.out.println( new MySJFO( "name.html" ).getKind() );
}
}
public MySJFO( String name ) { super( name ); }
public MySJFO( String name, JavaFileObject.Kind kind ) { super( name, kind ); }
public CharSequence getCharContent(boolean ignoreEncodingErrors)
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public InputStream openInputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public OutputStream openOutputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
new MySJFO( "name.html" ).getKind() returns JavaFileObject.Kind.OTHER
import java.io.*;
import javax.tools.*;
public class SJFOgetKind {
static class MySJFO extends SimpleJavaFileObject {
public MySJFO( String name ) { super( name ); }
public MySJFO( String name, JavaFileObject.Kind kind ) { super( name, kind ); }
public CharSequence getCharContent(boolean ignoreEncodingErrors)
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public InputStream openInputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
return null;
}
public OutputStream openOutputStream()
throws IOException, IllegalStateException, UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
public static void main( String[] args ){
System.out.println( new MySJFO( "name.html" ).getKind() );
}
}