Changeset 75:5e4fe13e31b9 in livinglogic.java.ul4

Show
Ignore:
Timestamp:
06/04/08 20:43:54 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Writing int does the wrong thing: fixed. Use the new header. Don't throw IOException in dumps().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/src/com/livinglogic/sxtl/Template.java

    r74 r75  
    2828    } 
    2929 
    30     public static final String SXTL_HEADER = "sxtl"; 
     30    public static final String SXTL_HEADER = "ull"; 
    3131 
    3232    public static final String SXTL_VERSION = "1"; 
     
    273273    protected static void writeint(Writer writer, int value, char terminator) throws IOException 
    274274    { 
    275         writer.write(value); 
     275        writer.write(String.valueOf(value)); 
    276276        writer.write(terminator); 
    277277    } 
     
    285285        else 
    286286        { 
    287             writer.write(value.length()); 
     287            writer.write(String.valueOf(value.length())); 
    288288            writer.write(terminator1); 
    289289            writer.write(value); 
     
    296296            writer.write("-"); 
    297297        else 
    298             writer.write(spec); 
     298            writer.write(String.valueOf(spec)); 
    299299    } 
    300300 
     
    303303        writer.write(SXTL_HEADER); 
    304304        writer.write("\n"); 
    305         writer.write(1); 
     305        writer.write("1"); 
    306306        writer.write("\n"); 
    307307        writestr(writer, source, '\'', '"'); 
     
    334334                writer.write("^"); 
    335335            } 
    336         } 
    337     } 
    338  
    339     public String dumps() throws IOException 
     336            writer.write("\n"); 
     337        } 
     338    } 
     339 
     340    public String dumps() 
    340341    { 
    341342        StringWriter writer = new StringWriter(); 
    342         dump(writer); 
     343        try 
     344        { 
     345            dump(writer); 
     346        } 
     347        catch (IOException ex) // can not happen, when dumping the a StringWriter 
     348        { 
     349        } 
    343350        return writer.toString(); 
    344351    }