Changeset 11:26d62e6d6696 in rrlib_serialization-java


Ignore:
Timestamp:
27.02.2014 00:19:57 (6 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Bugfix in StringInputStream.readObject() - returned a Double object when a Float was requested

File:
1 edited

Legend:

Unmodified
Added
Removed
  • StringInputStream.java

    r2 r11  
    320320            } else if (type == float.class || type == double.class) { 
    321321                String s = readWhile("-.", StringInputStream.DIGIT | StringInputStream.WHITESPACE | StringInputStream.LETTER, true); 
    322                 return type == float.class ? Float.parseFloat(s) : Double.parseDouble(s); 
     322                if (type == float.class) { 
     323                    return Float.parseFloat(s); 
     324                } else { 
     325                    return Double.parseDouble(s); 
     326                } 
    323327            } else { 
    324328                String s = readWhile("-", StringInputStream.DIGIT | StringInputStream.WHITESPACE, true); 
Note: See TracChangeset for help on using the changeset viewer.