Name: skT88420 Date: 08/17/99
1. Compile the code with "javac StreamConverter.java"
2. SOURCE CODE:
/******************************************************************************
*
* File Name:
*
* Project: Corelli MT System
*
* Purpose:
*
* Usage:
*
* Classes:
*
* Data Files:
*
* Programmer(s):
*
* Date:
*
* ToDo:
*-----------------------------------------------------------------------------
* Computing Research Laboratory
* New Mexico State University
* Box 30001/ Dept. 3CRL
* Las Cruces, NM 88003-8001
* Tel.: (505) 646-5466 Fax: (505) 646-6218
* E-mail: ###@###.### WWW: http: crl.nmsu.edu/
*
* Copyright (C) 1996 Computing Research Laboratory
*-----------------------------------------------------------------------------
*
* $Id: $
*
* CHANGE LOG:
* $Log: $
*
*****************************************************************************/
/*************/
/* PACKAGE */
/*************/
package CRL.expedition.CCS.util;
/*************/
/* IMPORTS */
/*************/
import java.io.*;
public class StreamConverter{
public static PrintWriter getPrintWriter(final PrintStream stream){
return new PrintWriter(stream);
}
public static PrintStream getPrintStream(final PrintWriter writer){
if(writer==null)
return null;
return new PrintStream(null){
public void flush(){
writer.flush();
}
public void close(){
writer.close();
}
public boolean checkError(){
return writer.checkError();
}
public void write(int b){
writer.write(b);
}
public void write(byte buf[],int off,int len){
writer.write(new String(buf),off,len);
}
public void print(boolean b){
writer.print(b);
}
public void print(char c){
writer.print(c);
}
public void print(int i){
writer.print(i);
}
public void print(long l){
writer.print(l);
}
public void print(float f){
writer.print(f);
}
public void print(double d){
writer.print(d);
}
public void print(char s[]){
writer.print(s);
}
public void print(String s){
writer.print(s);
}
public void print(Object obj){
writer.print(obj);
}
public void println(){
writer.println();
}
public void println(boolean x){
writer.println(x);
}
public void println(char x){
writer.println(x);
}
public void println(int x){
writer.println(x);
}
public void println(long x){
writer.println(x);
}
public void println(float x){
writer.println(x);
}
public void println(double x){
writer.println(x);
}
public void println(char x[]){
writer.println(x);
}
public void println(String x){
writer.println(x);
}
public void println(Object x){
writer.println(x);
}
};
}
}
3.ERROR MESSAGE:
sun.tools.java.CompilerError: stackSize null
at sun.tools.java.Type.stackSize(Type.java)
at sun.tools.tree.Context.declare(Context.java)
at sun.tools.javac.SourceField.check(SourceField.java)
at sun.tools.javac.SourceClass.checkFields(SourceClass.java)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java)
at sun.tools.javac.SourceClass.checkLocalClass(SourceClass.java)
at sun.tools.tree.NewInstanceExpression.checkValue(NewInstanceExpression.java)
at sun.tools.tree.ReturnStatement.check(ReturnStatement.java)
at sun.tools.tree.Statement.checkBlockStatement(Statement.java)
at sun.tools.tree.CompoundStatement.check(CompoundStatement.java)
at sun.tools.tree.Statement.checkMethod(Statement.java)
at sun.tools.javac.SourceField.check(SourceField.java)
at sun.tools.javac.SourceClass.checkFields(SourceClass.java)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java)
at sun.tools.javac.SourceClass.check(SourceClass.java)
at sun.tools.javac.Main.compile(Main.java)
at sun.tools.javac.Main.main(Main.java)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
4.N/A
5.java -version says: java version "1.1.7B"
java -fullversion says: java full version "JDK1.1.7U"
6.N/A
(Review ID: 93994)
======================================================================
- duplicates
-
JDK-4054689 Anonymous inner class with null constructor parameter throws compiler error
-
- Closed
-