//# 0 errors, 41 messages
//#
/*
    //#Info.java:1:1: class: com.dmdirc.ui.core.util.Info
    //#Info.java:1:1: method: com.dmdirc.ui.core.util.Info.com.dmdirc.ui.core.util.Info__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.ui.core.util;

import com.dmdirc.config.IdentityManager;

import java.util.Locale;

/**
 * Retrives various pieces of information about DMDirc.
 */
public class Info {
    
    /** Not intended to be instantiated. */
    private Info() {
    //#Info.java:35: method: void com.dmdirc.ui.core.util.Info.com.dmdirc.ui.core.util.Info()
        //Prevent instantiation.
    }
    //#Info.java:37: end of method: void com.dmdirc.ui.core.util.Info.com.dmdirc.ui.core.util.Info()

    /**
     * Returns the DMDirc version info.
     * 
     * @return DMDirc version string
     */
    public static String getDMDircVersion() {
        return IdentityManager.getGlobalConfig().getOption("version", "version")
    //#Info.java:45: method: String com.dmdirc.ui.core.util.Info.getDMDircVersion()
    //#Info.java:45: Warning: method not available - call not analyzed
    //#    call on ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.ui.core.util.Info
    //#    method: String getDMDircVersion()
    //#    unanalyzed callee: ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#Info.java:45: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.ConfigManager:getOption(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.ui.core.util.Info
    //#    method: String getDMDircVersion()
    //#    unanalyzed callee: String com.dmdirc.config.ConfigManager:getOption(String, String)
    //#input(String getDMDircVersion()): " ("._tainted
    //#input(String getDMDircVersion()): ")"._tainted
    //#output(String getDMDircVersion()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getDMDircVersion()): return_value
    //#new obj(String getDMDircVersion()): java.lang.StringBuilder:toString(...)
    //#presumption(String getDMDircVersion()): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@45 != null
    //#presumption(String getDMDircVersion()): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@45 != null
    //#post(String getDMDircVersion()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getDMDircVersion()): return_value == &java.lang.StringBuilder:toString(...)
    //#Info.java:45: end of method: String com.dmdirc.ui.core.util.Info.getDMDircVersion()
                + " ("
                + IdentityManager.getGlobalConfig().getOption("updater", "channel")
                + ")";
    }

    /**
     * Returns the systems java version.
     * 
     * @return Java version string
     */
    public static String getJavaVersion() {
        return System.getProperty("java.vm.name", "unknown") + " " +
    //#Info.java:57: method: String com.dmdirc.ui.core.util.Info.getJavaVersion()
    //#input(String getJavaVersion()): " "._tainted
    //#input(String getJavaVersion()): " ["._tainted
    //#input(String getJavaVersion()): "]"._tainted
    //#output(String getJavaVersion()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getJavaVersion()): return_value
    //#new obj(String getJavaVersion()): java.lang.StringBuilder:toString(...)
    //#post(String getJavaVersion()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getJavaVersion()): return_value == &java.lang.StringBuilder:toString(...)
    //#Info.java:57: end of method: String com.dmdirc.ui.core.util.Info.getJavaVersion()
                System.getProperty("java.version", "unknown") +
                " [" + System.getProperty("java.vm.vendor", "uknown") + "]";
    }

    /**
     * Returns the systems OS version.
     * 
     * @return OS version string
     */
    public static String getOSVersion() {
        return System.getProperty("os.name", "unknown") + " " +
    //#Info.java:68: method: String com.dmdirc.ui.core.util.Info.getOSVersion()
    //#input(String getOSVersion()): " "._tainted
    //#input(String getOSVersion()): "; "._tainted
    //#output(String getOSVersion()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getOSVersion()): return_value
    //#new obj(String getOSVersion()): java.lang.StringBuilder:toString(...)
    //#presumption(String getOSVersion()): java.util.Locale:getDefault(...)@68 != null
    //#post(String getOSVersion()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getOSVersion()): return_value == &java.lang.StringBuilder:toString(...)
    //#Info.java:68: end of method: String com.dmdirc.ui.core.util.Info.getOSVersion()
                System.getProperty("os.version", "unknown") + " " +
                System.getProperty("os.arch", "unknown") + "; " +
                System.getProperty("file.encoding", "unknown") + "; " + Locale.getDefault().
                toString();
    }
}
    //#output(com.dmdirc.ui.core.util.Info__static_init): __Descendant_Table[com/dmdirc/ui/core/util/Info]
    //#post(com.dmdirc.ui.core.util.Info__static_init): __Descendant_Table[com/dmdirc/ui/core/util/Info] == &__Dispatch_Table
    //#Info.java:: end of method: com.dmdirc.ui.core.util.Info.com.dmdirc.ui.core.util.Info__static_init
    //#Info.java:: end of class: com.dmdirc.ui.core.util.Info
