/[classpath]/gjdoc/src/gnu/classpath/tools/gjdoc/Parser.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/gjdoc/Parser.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by julian, Wed Dec 15 10:35:15 2004 UTC revision 1.19 by julian, Wed Dec 15 16:10:05 2004 UTC
# Line 33  import com.sun.javadoc.*; Line 33  import com.sun.javadoc.*;
33    
34  import gnu.classpath.tools.IOToolkit;  import gnu.classpath.tools.IOToolkit;
35  import gnu.classpath.tools.NotifyingInputStreamReader;  import gnu.classpath.tools.NotifyingInputStreamReader;
36    import gnu.classpath.tools.MalformedInputListener;
37    import gnu.classpath.tools.MalformedInputEvent;
38    
39     class IgnoredFileParseException extends ParseException     class IgnoredFileParseException extends ParseException
40     {     {
# Line 593  public class Parser { Line 595  public class Parser {
595    
596     private int currentLine;     private int currentLine;
597    
598     static char[] loadFile(File file, String encoding)     static char[] loadFile(final File file, String encoding)
599        throws IOException        throws IOException
600     {     {
601        InputStream in = new FileInputStream(file);        InputStream in = new FileInputStream(file);
602          NotifyingInputStreamReader notifyingInput
603             = new NotifyingInputStreamReader(in, encoding);
604          notifyingInput.addMalformedInputListener(new MalformedInputListener() {
605                public void malformedInputEncountered(MalformedInputEvent event) {
606                   Main.getRootDoc().printWarning("Illegal character in file " + file + ", line " + event.getLineNumber() + ", column " + event.getColumnNumber());
607                   try {
608                      Main.getRootDoc().printWarning(IOToolkit.getLineFromFile(file, event.getLineNumber()));
609                      Main.getRootDoc().printWarning(IOToolkit.getColumnDisplayLine(event.getColumnNumber()));
610                   }
611                   catch (IOException ignore) {
612                   }
613                }
614             });
615        Reader reader        Reader reader
616           = new BufferedReader(new NotifyingInputStreamReader(in, encoding));           = new BufferedReader(notifyingInput);
617        char[] result = IOToolkit.readFully(reader);        char[] result = IOToolkit.readFully(reader);
618        reader.close();        reader.close();
619        return result;        return result;

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26