Changeset 9202 in josm for trunk


Ignore:
Timestamp:
2015-12-28T17:36:08+01:00 (9 years ago)
Author:
Don-vip
Message:

see #11924 - add robustness for short versions "9" and "9-ea"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/TestUtils.java

    r9199 r9202  
    117117            version = version.substring(2);
    118118        }
    119         return Integer.parseInt(version.substring(0, version.indexOf('.')));
     119        // Allow these formats:
     120        // 1.7.0_91
     121        // 1.8.0_72-ea
     122        // 9-ea
     123        // 9
     124        // 9.0.1
     125        int dotPos = version.indexOf('.');
     126        int dashPos = version.indexOf('-');
     127        return Integer.parseInt(version.substring(0,
     128                dotPos > -1 ? dotPos : dashPos > -1 ? dashPos : 1));
    120129    }
    121130}
Note: See TracChangeset for help on using the changeset viewer.