Changeset 10268


Ignore:
Timestamp:
10/28/05 17:20:13 (16 years ago)
Author:
piso
Message:

getMessage(): trim trailing line separator (if any).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/JavaException.java

    r10263 r10268  
    33 *
    44 * Copyright (C) 2005 Peter Graves
    5  * $Id: JavaException.java,v 1.1 2005-10-28 16:39:59 piso Exp $
     5 * $Id: JavaException.java,v 1.2 2005-10-28 17:20:13 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    6262        PrintWriter pw = new PrintWriter(sw);
    6363        throwable.printStackTrace(pw);
    64         return sw.toString();
     64        String s = sw.toString();
     65        final String separator = System.getProperty("line.separator");
     66        if (s.endsWith(separator))
     67            s = s.substring(0, s.length() - separator.length());
     68        return s;
    6569    }
    6670
Note: See TracChangeset for help on using the changeset viewer.