Meet error when extending FileWriter with JDK1.5.0
There is a fragment of Java code as follows:
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class FilterFileWriter extends FileWriter
{
private short _tokenCounter = 0;
private StringBuffer _buffer = new StringBuffer();
private String _pattern = "Bioseq-set";
private String _lastAppend = "";
private boolean _doWrite = true;
public void write(char[] arg0, int arg1, int arg2) throws IOException
{
super.write(arg0, arg1, arg2);
}
public void write(int arg0) throws IOException
{
if( _doWrite )
{
super.write( arg0 );
}
if(_lastAppend.equalsIgnoreCase( _pattern ) && !_doWrite && arg0 == 60 )
{
_doWrite = true;
super.write( arg0 );
_lastAppend = "";
}
}
public void write(String arg0, int arg1, int arg2) throws IOException
{
super.write(arg0, arg1, arg2);
}
public void write(char[] arg0) throws IOException
{
//Launcher.getLoggerInstance().info( "Writing array " + arg0[0] );
super.write(arg0);
}
public void write(String str) throws IOException
{
if( str.equalsIgnoreCase( _pattern ) )
{
if( _lastAppend.equalsIgnoreCase( "</" ) )
{
_doWrite = false;
_lastAppend = str;
return;
}
}
if( str.equalsIgnoreCase( "></" ) )
{
_lastAppend = str;
return;
}
if( _lastAppend.equalsIgnoreCase( "></" ) )
{
super.write( _lastAppend );
}
if( _doWrite )
{
super.write( str );
}
if( str.trim().length() > 0 )
{
_lastAppend = str;
}
}
public void write( String str, boolean force ) throws Exception
{
if( force )
{
super.write( str );
}
}
public FilterFileWriter(File arg0) throws IOException
{
super(arg0);
}
public FilterFileWriter(File arg0, boolean arg1) throws IOException
{
super(arg0, arg1);
}
public FilterFileWriter(FileDescriptor arg0)
{
super(arg0);
}
public FilterFileWriter(String arg0) throws IOException
{
super(arg0);
}
public FilterFileWriter(String arg0, boolean arg1) throws IOException
{
super(arg0, arg1);
}
private boolean hasPattern()
{
return _buffer != null && _buffer.toString().indexOf( _pattern ) >= 0;
}
}
When compiling, meet following error:
The return type is incompatible with Appendable.append(char), Writer.append(char),Writer.append(char)
Why? and How to resolve this error?
Thanks a lot!

