//# 14 errors, 150 messages
//#
/*
    //#Version.java:1:1: class: com.dmdirc.updater.Version
    //#Version.java:1:1: method: com.dmdirc.updater.Version.com.dmdirc.updater.Version__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.updater;

/**
 * Describes a version of a component, either as an integer or as a String which
 * corresponds to the output of `git-describe --tags`.
 *
 * @since 0.6.3m1
 * @author chris
 */
public class Version implements Comparable<Version> {
    //#Version.java:32: method: int com.dmdirc.updater.Version.compareTo(Object)
    //#Version.java:32: Warning: suspicious precondition
    //#    The precondition for this.intVersion - x0.intVersion is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Object)
    //#    suspicious precondition index: [4]
    //#    Attribs:  Soft
    //#input(int compareTo(Object)): __Descendant_Table[com/dmdirc/updater/Version]
    //#input(int compareTo(Object)): __Descendant_Table[others]
    //#input(int compareTo(Object)): __Dispatch_Table.compareTo(Lcom/dmdirc/updater/Version;)I
    //#input(int compareTo(Object)): this
    //#input(int compareTo(Object)): this.__Tag
    //#input(int compareTo(Object)): this.intVersion
    //#input(int compareTo(Object)): this.strVersion
    //#input(int compareTo(Object)): this.strVersion._tainted
    //#input(int compareTo(Object)): x0
    //#input(int compareTo(Object)): x0.__Tag
    //#input(int compareTo(Object)): x0.intVersion
    //#input(int compareTo(Object)): x0.strVersion
    //#input(int compareTo(Object)): x0.strVersion._tainted
    //#output(int compareTo(Object)): return_value
    //#pre[2] (int compareTo(Object)): this.__Tag == com/dmdirc/updater/Version
    //#pre[7] (int compareTo(Object)): x0 != null
    //#pre[8] (int compareTo(Object)): x0.__Tag == com/dmdirc/updater/Version
    //#pre[4] (int compareTo(Object)): (soft) this.intVersion - x0.intVersion in {-6_442_450_943, -2_147_483_648..4_294_967_295, 6_442_450_943}
    //#post(int compareTo(Object)): init'ed(return_value)
    //#unanalyzed(int compareTo(Object)): Effects-of-calling:java.lang.String:matches
    //#unanalyzed(int compareTo(Object)): Effects-of-calling:java.lang.Integer:parseInt
    //#unanalyzed(int compareTo(Object)): Effects-of-calling:java.lang.String:split
    //#unanalyzed(int compareTo(Object)): Effects-of-calling:java.lang.Math:max
    //#unanalyzed(int compareTo(Object)): Effects-of-calling:java.lang.String:equals
    //#Version.java:32: end of method: int com.dmdirc.updater.Version.compareTo(Object)

    protected final int intVersion;
    protected final String strVersion;

    public Version(final int version) {
    //#Version.java:37: method: void com.dmdirc.updater.Version.com.dmdirc.updater.Version(int)
    //#input(void com.dmdirc.updater.Version(int)): this
    //#input(void com.dmdirc.updater.Version(int)): version
    //#output(void com.dmdirc.updater.Version(int)): this.intVersion
    //#output(void com.dmdirc.updater.Version(int)): this.strVersion
    //#post(void com.dmdirc.updater.Version(int)): this.intVersion == version
    //#post(void com.dmdirc.updater.Version(int)): init'ed(this.intVersion)
    //#post(void com.dmdirc.updater.Version(int)): this.strVersion == null
        this.intVersion = version;
        this.strVersion = null;
    }
    //#Version.java:40: end of method: void com.dmdirc.updater.Version.com.dmdirc.updater.Version(int)

    public Version(final String version) {
    //#Version.java:42: method: void com.dmdirc.updater.Version.com.dmdirc.updater.Version(String)
    //#input(void com.dmdirc.updater.Version(String)): this
    //#input(void com.dmdirc.updater.Version(String)): version
    //#output(void com.dmdirc.updater.Version(String)): this.intVersion
    //#output(void com.dmdirc.updater.Version(String)): this.strVersion
    //#pre[2] (void com.dmdirc.updater.Version(String)): version != null
    //#post(void com.dmdirc.updater.Version(String)): init'ed(this.intVersion)
    //#post(void com.dmdirc.updater.Version(String)): this.strVersion == One-of{null, version}
    //#post(void com.dmdirc.updater.Version(String)): init'ed(this.strVersion)
    //#test_vector(void com.dmdirc.updater.Version(String)): java.lang.String:matches(...)@43: {0}, {1}
    //#test_vector(void com.dmdirc.updater.Version(String)): java.lang.String:matches(...)@46: {0}, {1}
        if (version.matches("^[0-9]+$")) {
            this.intVersion = Integer.parseInt(version);
            this.strVersion = null;
        } else if (version.matches("^[0-9]+(\\.[0-9]+)*((a|b|rc|m)[0-9]+)*(\\-[0-9]+\\-g[a-z0-9]{7})?$")) {
            this.intVersion = Integer.MIN_VALUE;
            this.strVersion = version;
        } else {
            this.intVersion = Integer.MIN_VALUE;
            this.strVersion = null;
        }
    }
    //#Version.java:53: end of method: void com.dmdirc.updater.Version.com.dmdirc.updater.Version(String)

    /** {@inheritDoc} */
    @Override
    public int compareTo(final Version o) {
        if (o.intVersion > Integer.MIN_VALUE && this.intVersion > Integer.MIN_VALUE) {
    //#Version.java:58: method: int com.dmdirc.updater.Version.compareTo(Version)
    //#Version.java:58: Warning: suspicious precondition
    //#    The precondition for this.intVersion - o.intVersion is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    suspicious precondition index: [15]
    //#    Attribs:  Soft
    //#input(int compareTo(Version)): o
    //#input(int compareTo(Version)): o.intVersion
    //#input(int compareTo(Version)): o.strVersion
    //#input(int compareTo(Version)): o.strVersion._tainted
    //#input(int compareTo(Version)): this
    //#input(int compareTo(Version)): this.intVersion
    //#input(int compareTo(Version)): this.strVersion
    //#input(int compareTo(Version)): this.strVersion._tainted
    //#output(int compareTo(Version)): return_value
    //#pre[7] (int compareTo(Version)): o != null
    //#pre[15] (int compareTo(Version)): (soft) this.intVersion - o.intVersion in {-6_442_450_943, -2_147_483_648..4_294_967_295, 6_442_450_943}
    //#post(int compareTo(Version)): init'ed(return_value)
    //#test_vector(int compareTo(Version)): o.intVersion: {-2_147_483_648}, {-2_147_483_647..0, 4_294_967_295}
    //#test_vector(int compareTo(Version)): o.strVersion: Inverse{null}, Addr_Set{null}
    //#test_vector(int compareTo(Version)): this.intVersion: {-2_147_483_648}, {-2_147_483_647..4_294_967_295}
    //#test_vector(int compareTo(Version)): this.intVersion - o.intVersion: {0..4_294_967_295}, {-6_442_450_943, -2_147_483_648..-1}
    //#test_vector(int compareTo(Version)): this.strVersion: Inverse{null}, Addr_Set{null}
            return this.intVersion - o.intVersion;
        } else if (o.strVersion == null && this.strVersion == null) {
            return 0;
        } else if (o.strVersion == null && this.strVersion != null) {
            return 1;
        } else if (o.strVersion != null && this.strVersion == null) {
            return -1;
        } else {
            final String myParts[] = this.strVersion.split("-");
    //#Version.java:67: ?null dereference
    //#    this.strVersion != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: this.strVersion != null
    //#    VN: this.strVersion
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
            final String thParts[] = o.strVersion.split("-");
    //#Version.java:68: ?null dereference
    //#    o.strVersion != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: o.strVersion != null
    //#    VN: o.strVersion
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad

            final String myFirstParts[] = myParts[0].split("\\.|(?=a|b|rc|m)");
    //#Version.java:70: ?use of default init
    //#    init'ed(myParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: init'ed(myParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#Version.java:70: ?use of default init
    //#    init'ed(myParts[0])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: init'ed(myParts[0])
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
    //#Version.java:70: ?null dereference
    //#    not_init'ed(myParts[0])
    //#    severity: MEDIUM
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: not_init'ed(myParts[0])
    //#    VN: undefined
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
            final String thFirstParts[] = thParts[0].split("\\.|(?=a|b|rc|m)");
    //#Version.java:71: ?use of default init
    //#    init'ed(thParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: init'ed(thParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#Version.java:71: ?use of default init
    //#    init'ed(thParts[0])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: init'ed(thParts[0])
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
    //#Version.java:71: ?null dereference
    //#    not_init'ed(thParts[0])
    //#    severity: MEDIUM
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_13
    //#    assertion: not_init'ed(thParts[0])
    //#    VN: undefined
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad

            for (int i = 0; i < Math.max(myFirstParts.length, thFirstParts.length); i++) {
    //#Version.java:73: ?use of default init
    //#    init'ed(myFirstParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_14
    //#    assertion: init'ed(myFirstParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#Version.java:73: ?use of default init
    //#    init'ed(thFirstParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_14
    //#    assertion: init'ed(thFirstParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
                final boolean myExists = myFirstParts.length > i;
    //#Version.java:74: ?use of default init
    //#    init'ed(myFirstParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_15
    //#    assertion: init'ed(myFirstParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
                final boolean thExists = thFirstParts.length > i;
    //#Version.java:75: ?use of default init
    //#    init'ed(thFirstParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_18
    //#    assertion: init'ed(thFirstParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid

                final boolean myIsInt = myExists && myFirstParts[i].matches("[0-9]+");
    //#Version.java:77: Warning: test always goes same way
    //#    Test predetermined because myExists == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_21
    //#    live edge: bb_21-->bb_24
    //#    tested vn: __Temp_Initially_1
    //#    tested vn values: {0}
    //#Version.java:77: Warning: dead code
    //#    Dead code here because myExists == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_22
                final boolean thIsInt = thExists && thFirstParts[i].matches("[0-9]+");
    //#Version.java:78: Warning: test always goes same way
    //#    Test predetermined because thExists == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_25
    //#    live edge: bb_25-->bb_28
    //#    tested vn: __Temp_Initially_1
    //#    tested vn values: {0}
    //#Version.java:78: Warning: dead code
    //#    Dead code here because thExists == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_26

                final int myInt = myIsInt ? Integer.parseInt(myFirstParts[i]) : 0;
    //#Version.java:80: Warning: test always goes same way
    //#    Test predetermined because myIsInt == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_29
    //#    live edge: bb_29-->bb_31
    //#    tested vn: __Temp_Initially_1
    //#    tested vn values: {0}
    //#Version.java:80: Warning: dead code
    //#    Dead code here because myIsInt == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_30
                final int thInt = thIsInt ? Integer.parseInt(thFirstParts[i]) : 0;
    //#Version.java:81: Warning: test always goes same way
    //#    Test predetermined because thIsInt == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_32
    //#    live edge: bb_32-->bb_34
    //#    tested vn: __Temp_Initially_1
    //#    tested vn values: {0}
    //#Version.java:81: Warning: dead code
    //#    Dead code here because thIsInt == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_33

                // Please consult handwritten truth table in the care of
                // Chris for an explanation of what the hell is going on here.
                // If there's a bug in this code it should probably be
                // rewritten.
                if ((!myExists && !thExists)
    //#Version.java:87: Warning: test always goes same way
    //#    Test predetermined because myExists == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_35
    //#    live edge: bb_35-->bb_36
    //#    tested vn: __Temp_Initially_1
    //#    tested vn values: {0}
    //#Version.java:87: Warning: dead code
    //#    Dead code here because myExists == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_37
    //#Version.java:87: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_40
    //#Version.java:87: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_41
    //#Version.java:87: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_42
    //#Version.java:87: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_43
    //#Version.java:87: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_44
                        || (myIsInt && thIsInt && myInt == thInt)
                        || (myExists && thExists && !myIsInt && !thIsInt
                        && myFirstParts[i].equals(thFirstParts[i]))) {
                    continue;
                } else if ((!thExists && myIsInt)
    //#Version.java:92: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_46
    //#Version.java:92: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_48
                        || (thExists && !thIsInt && (!myExists || myIsInt))) {
                    return +1;
    //#Version.java:94: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_52
                } else if ((thIsInt && !myExists)
    //#Version.java:95: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_53
    //#Version.java:95: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_55
                        || (myExists && !myIsInt && (!thExists || thIsInt))) {
                    return -1;
    //#Version.java:97: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_59
                } else if (thIsInt && myIsInt) {
    //#Version.java:98: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_60
    //#Version.java:98: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_61
                    return myInt - thInt;
    //#Version.java:99: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_62
                } else {
                    final String myLetterParts[] = myFirstParts[i].split("(?=[0-9])", 2);
    //#Version.java:101: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_63
                    final String thLetterParts[] = thFirstParts[i].split("(?=[0-9])", 2);

                    if (myLetterParts[0].equals(thLetterParts[0])) {
                        return Integer.parseInt(myLetterParts[1])
    //#Version.java:105: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_64
                                - Integer.parseInt(thLetterParts[1]);
                    } else if (myLetterParts[0].equals("m")
    //#Version.java:107: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_65
    //#Version.java:107: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_66
    //#Version.java:107: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_67
    //#Version.java:107: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_68
                            || thLetterParts[0].equals("rc")
                            || (myLetterParts[0].equals("a") && thLetterParts[0].equals("b"))) {
                        return -1;
    //#Version.java:110: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_69
                    } else {
                        return +1;
    //#Version.java:112: Warning: dead code continues
    //#    Dead code continues
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_70
                    }
                }
            }

            final int myInt = myParts.length > 1 ? Integer.parseInt(myParts[1]) : 0;
    //#Version.java:117: ?use of default init
    //#    init'ed(myParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_72
    //#    assertion: init'ed(myParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#Version.java:117: Warning: test always goes same way
    //#    Test predetermined because myParts.length == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_72
    //#    live edge: bb_72-->bb_74
    //#    tested vn: undefined - 1
    //#    tested vn values: {-1}
    //#Version.java:117: Warning: dead code
    //#    Dead code here because myParts.length == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_73
            final int thInt = thParts.length > 1 ? Integer.parseInt(thParts[1]) : 0;
    //#Version.java:118: ?use of default init
    //#    init'ed(thParts.length)
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    basic block: bb_75
    //#    assertion: init'ed(thParts.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#Version.java:118: Warning: test always goes same way
    //#    Test predetermined because thParts.length == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    from bb: bb_75
    //#    live edge: bb_75-->bb_77
    //#    tested vn: undefined - 1
    //#    tested vn values: {-1}
    //#Version.java:118: Warning: dead code
    //#    Dead code here because thParts.length == 0
    //#    severity: LOW
    //#    class: com.dmdirc.updater.Version
    //#    method: int compareTo(Version)
    //#    dead bb: bb_76

            return myInt - thInt;
    //#Version.java:120: end of method: int com.dmdirc.updater.Version.compareTo(Version)
        }
    }

    /**
     * Determines whether or not this represents a valid version.
     *
     * @return True if the version is valid, false otherwise
     */
    public boolean isValid() {
        return intVersion > Integer.MIN_VALUE || strVersion != null;
    //#Version.java:130: method: bool com.dmdirc.updater.Version.isValid()
    //#input(bool isValid()): this
    //#input(bool isValid()): this.intVersion
    //#input(bool isValid()): this.strVersion
    //#output(bool isValid()): return_value
    //#post(bool isValid()): init'ed(return_value)
    //#Version.java:130: end of method: bool com.dmdirc.updater.Version.isValid()
    }

    /** {@inheritDoc} */
    @Override
    public String toString() {
        return strVersion == null ? String.valueOf(intVersion) : strVersion;
    //#Version.java:136: method: String com.dmdirc.updater.Version.toString()
    //#input(String toString()): this
    //#input(String toString()): this.intVersion
    //#input(String toString()): this.strVersion
    //#output(String toString()): java.lang.String:valueOf(...)._tainted
    //#output(String toString()): return_value
    //#new obj(String toString()): java.lang.String:valueOf(...)
    //#post(String toString()): java.lang.String:valueOf(...)._tainted == 0
    //#post(String toString()): return_value == One-of{&java.lang.String:valueOf(...), this.strVersion}
    //#post(String toString()): return_value != null
    //#Version.java:136: end of method: String com.dmdirc.updater.Version.toString()
    }

}
    //#output(com.dmdirc.updater.Version__static_init): __Descendant_Table[com/dmdirc/updater/Version]
    //#output(com.dmdirc.updater.Version__static_init): __Dispatch_Table.compareTo(Lcom/dmdirc/updater/Version;)I
    //#output(com.dmdirc.updater.Version__static_init): __Dispatch_Table.compareTo(Ljava/lang/Object;)I
    //#output(com.dmdirc.updater.Version__static_init): __Dispatch_Table.isValid()Z
    //#output(com.dmdirc.updater.Version__static_init): __Dispatch_Table.toString()Ljava/lang/String;
    //#post(com.dmdirc.updater.Version__static_init): __Descendant_Table[com/dmdirc/updater/Version] == &__Dispatch_Table
    //#post(com.dmdirc.updater.Version__static_init): __Dispatch_Table.compareTo(Lcom/dmdirc/updater/Version;)I == &compareTo
    //#post(com.dmdirc.updater.Version__static_init): __Dispatch_Table.compareTo(Ljava/lang/Object;)I == &compareTo
    //#post(com.dmdirc.updater.Version__static_init): __Dispatch_Table.isValid()Z == &isValid
    //#post(com.dmdirc.updater.Version__static_init): __Dispatch_Table.toString()Ljava/lang/String; == &toString
    //#Version.java:: end of method: com.dmdirc.updater.Version.com.dmdirc.updater.Version__static_init
    //#Version.java:: end of class: com.dmdirc.updater.Version
