//# 0 errors, 145 messages
//#
/*
    //#PluginComponent.java:1:1: class: com.dmdirc.updater.components.PluginComponent
 * 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.components;

import com.dmdirc.config.ConfigManager;
import com.dmdirc.config.IdentityManager;
import com.dmdirc.plugins.PluginInfo;
import com.dmdirc.updater.UpdateChecker;
import com.dmdirc.updater.UpdateComponent;
import com.dmdirc.updater.Version;

import java.io.File;

/**
 * An update component for plugins.
 * 
 * @author chris
 */
public class PluginComponent implements UpdateComponent {
    
    /** The plugin this component is for. */
    private final PluginInfo plugin;
    
    /** The config to use. */
    private static final ConfigManager config = IdentityManager.getGlobalConfig();
    //#PluginComponent.java:45: method: com.dmdirc.updater.components.PluginComponent.com.dmdirc.updater.components.PluginComponent__static_init
    //#PluginComponent.java:45: Warning: method not available - call not analyzed
    //#    call on ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: com.dmdirc.updater.components.PluginComponent__static_init
    //#    unanalyzed callee: ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): __Descendant_Table[com/dmdirc/updater/components/PluginComponent]
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.doInstall(Ljava/lang/String;)Z
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getFriendlyName()Ljava/lang/String;
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getFriendlyVersion()Ljava/lang/String;
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getName()Ljava/lang/String;
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getVersion()Lcom/dmdirc/updater/Version;
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/PluginComponent]
    //#output(com.dmdirc.updater.components.PluginComponent__static_init): config
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): __Descendant_Table[com/dmdirc/updater/components/PluginComponent] == &__Dispatch_Table
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/PluginComponent] == &__Dispatch_Table
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.doInstall(Ljava/lang/String;)Z == &doInstall
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getFriendlyName()Ljava/lang/String; == &getFriendlyName
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getFriendlyVersion()Ljava/lang/String; == &getFriendlyVersion
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getName()Ljava/lang/String; == &getName
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): __Dispatch_Table.getVersion()Lcom/dmdirc/updater/Version; == &getVersion
    //#post(com.dmdirc.updater.components.PluginComponent__static_init): init'ed(config)
    //#PluginComponent.java:45: end of method: com.dmdirc.updater.components.PluginComponent.com.dmdirc.updater.components.PluginComponent__static_init

    /**
     * Creates a new PluginComponent for the specified plugin, to enable it to
     * be updated automatically.
     * 
     * @param plugin The plugin to be added to the updater
     */
    public PluginComponent(final PluginInfo plugin) {
    //#PluginComponent.java:53: method: void com.dmdirc.updater.components.PluginComponent.com.dmdirc.updater.components.PluginComponent(PluginInfo)
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): "addon-"._tainted
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): __Descendant_Table[com/dmdirc/updater/components/PluginComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): __Descendant_Table[others]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): __Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateChecker.components
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/UpdateComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/ActionGroupComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/ClientComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/DefaultsComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/LauncherComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/ModeAliasesComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[com/dmdirc/updater/components/PluginComponent]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Descendant_Table[others]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/UpdateComponent.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/Version.__Descendant_Table[com/dmdirc/updater/Version]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/Version.__Descendant_Table[others]
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/Version.__Dispatch_Table.isValid()Z
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/components/ActionGroupComponent.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/components/ClientComponent.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/components/DefaultsComponent.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/components/LauncherComponent.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com/dmdirc/updater/components/ModeAliasesComponent.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): config
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): plugin
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): this
    //#input(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): this.__Tag
    //#output(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): this.plugin
    //#pre[1] (void com.dmdirc.updater.components.PluginComponent(PluginInfo)): plugin != null
    //#pre[3] (void com.dmdirc.updater.components.PluginComponent(PluginInfo)): (soft) this.__Tag == com/dmdirc/updater/components/PluginComponent
    //#presumption(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@45 != null
    //#presumption(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com.dmdirc.plugins.PluginInfo:getVersion(...).__Tag@56 == com/dmdirc/updater/Version
    //#presumption(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com.dmdirc.plugins.PluginInfo:getVersion(...)@56 != null
    //#post(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): this.plugin == plugin
    //#post(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): this.plugin != null
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:com.dmdirc.plugins.PluginInfo:getAddonID
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:com.dmdirc.plugins.PluginInfo:getName
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:com.dmdirc.config.ConfigManager:getOption
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:getName
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.util.List:remove
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): Effects-of-calling:java.util.List:add
    //#test_vector(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com.dmdirc.config.ConfigManager:hasOptionInt(...)@56: {0}, {1}
    //#test_vector(void com.dmdirc.updater.components.PluginComponent(PluginInfo)): com.dmdirc.plugins.PluginInfo:getAddonID(...)@56: {-2_147_483_648..0}, {1..4_294_967_295}
        this.plugin = plugin;
        
        if ((plugin.getAddonID() > 0 && plugin.getVersion().isValid())
    //#PluginComponent.java:56: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.plugins.PluginInfo:getAddonID()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: void com.dmdirc.updater.components.PluginComponent(PluginInfo)
    //#    unanalyzed callee: int com.dmdirc.plugins.PluginInfo:getAddonID()
    //#PluginComponent.java:56: Warning: method not available - call not analyzed
    //#    call on Version com.dmdirc.plugins.PluginInfo:getVersion()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: void com.dmdirc.updater.components.PluginComponent(PluginInfo)
    //#    unanalyzed callee: Version com.dmdirc.plugins.PluginInfo:getVersion()
    //#PluginComponent.java:56: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.plugins.PluginInfo:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: void com.dmdirc.updater.components.PluginComponent(PluginInfo)
    //#    unanalyzed callee: String com.dmdirc.plugins.PluginInfo:getName()
    //#PluginComponent.java:56: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.config.ConfigManager:hasOptionInt(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: void com.dmdirc.updater.components.PluginComponent(PluginInfo)
    //#    unanalyzed callee: bool com.dmdirc.config.ConfigManager:hasOptionInt(String, String)
                || (config.hasOptionInt("plugin-addonid", plugin.getName()))) {
            UpdateChecker.removeComponent(getName());
            UpdateChecker.registerComponent(this);
        }
    }
    //#PluginComponent.java:61: end of method: void com.dmdirc.updater.components.PluginComponent.com.dmdirc.updater.components.PluginComponent(PluginInfo)

    /** {@inheritDoc} */
    @Override
    public String getName() {
        if (plugin.getAddonID() > 0) {
    //#PluginComponent.java:66: method: String com.dmdirc.updater.components.PluginComponent.getName()
    //#PluginComponent.java:66: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.plugins.PluginInfo:getAddonID()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: String getName()
    //#    unanalyzed callee: int com.dmdirc.plugins.PluginInfo:getAddonID()
    //#input(String getName()): "addon-"._tainted
    //#input(String getName()): config
    //#input(String getName()): this
    //#input(String getName()): this.plugin
    //#output(String getName()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getName()): return_value
    //#new obj(String getName()): java.lang.StringBuilder:toString(...)
    //#pre[2] (String getName()): this.plugin != null
    //#presumption(String getName()): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@45 != null
    //#post(String getName()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getName()): return_value in Addr_Set{&java.lang.StringBuilder:toString(...),&java.lang.StringBuilder:toString(...)}
    //#test_vector(String getName()): com.dmdirc.plugins.PluginInfo:getAddonID(...)@66: {-2_147_483_648..0}, {1..4_294_967_295}
            return "addon-" + plugin.getAddonID();
    //#PluginComponent.java:67: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.plugins.PluginInfo:getAddonID()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: String getName()
    //#    unanalyzed callee: int com.dmdirc.plugins.PluginInfo:getAddonID()
        } else {
            return "addon-" + config.getOption("plugin-addonid", plugin.getName());
    //#PluginComponent.java:69: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.plugins.PluginInfo:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: String getName()
    //#    unanalyzed callee: String com.dmdirc.plugins.PluginInfo:getName()
    //#PluginComponent.java:69: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.ConfigManager:getOption(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: String getName()
    //#    unanalyzed callee: String com.dmdirc.config.ConfigManager:getOption(String, String)
    //#PluginComponent.java:69: end of method: String com.dmdirc.updater.components.PluginComponent.getName()
        }
    }

    /** {@inheritDoc} */
    @Override    
    public String getFriendlyName() {
        return plugin.getNiceName();
    //#PluginComponent.java:76: method: String com.dmdirc.updater.components.PluginComponent.getFriendlyName()
    //#PluginComponent.java:76: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.plugins.PluginInfo:getNiceName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: String getFriendlyName()
    //#    unanalyzed callee: String com.dmdirc.plugins.PluginInfo:getNiceName()
    //#input(String getFriendlyName()): this
    //#input(String getFriendlyName()): this.plugin
    //#output(String getFriendlyName()): return_value
    //#pre[2] (String getFriendlyName()): this.plugin != null
    //#post(String getFriendlyName()): init'ed(return_value)
    //#PluginComponent.java:76: end of method: String com.dmdirc.updater.components.PluginComponent.getFriendlyName()
    }

    /** {@inheritDoc} */
    @Override
    public String getFriendlyVersion() {
        return plugin.getFriendlyVersion();
    //#PluginComponent.java:82: method: String com.dmdirc.updater.components.PluginComponent.getFriendlyVersion()
    //#PluginComponent.java:82: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.plugins.PluginInfo:getFriendlyVersion()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: String getFriendlyVersion()
    //#    unanalyzed callee: String com.dmdirc.plugins.PluginInfo:getFriendlyVersion()
    //#input(String getFriendlyVersion()): this
    //#input(String getFriendlyVersion()): this.plugin
    //#output(String getFriendlyVersion()): return_value
    //#pre[2] (String getFriendlyVersion()): this.plugin != null
    //#post(String getFriendlyVersion()): init'ed(return_value)
    //#PluginComponent.java:82: end of method: String com.dmdirc.updater.components.PluginComponent.getFriendlyVersion()
    }

    /** {@inheritDoc} */
    @Override    
    public Version getVersion() {
        return plugin.getVersion();
    //#PluginComponent.java:88: method: Version com.dmdirc.updater.components.PluginComponent.getVersion()
    //#PluginComponent.java:88: Warning: method not available - call not analyzed
    //#    call on Version com.dmdirc.plugins.PluginInfo:getVersion()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: Version getVersion()
    //#    unanalyzed callee: Version com.dmdirc.plugins.PluginInfo:getVersion()
    //#input(Version getVersion()): this
    //#input(Version getVersion()): this.plugin
    //#output(Version getVersion()): return_value
    //#pre[2] (Version getVersion()): this.plugin != null
    //#post(Version getVersion()): init'ed(return_value)
    //#PluginComponent.java:88: end of method: Version com.dmdirc.updater.components.PluginComponent.getVersion()
    }

    /** {@inheritDoc} */
    @Override    
    public boolean doInstall(final String path) throws Throwable {
        final File target = new File(plugin.getFullFilename());
    //#PluginComponent.java:94: method: bool com.dmdirc.updater.components.PluginComponent.doInstall(String)
    //#PluginComponent.java:94: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.plugins.PluginInfo:getFullFilename()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: String com.dmdirc.plugins.PluginInfo:getFullFilename()
    //#input(bool doInstall(String)): ".update"._tainted
    //#input(bool doInstall(String)): path
    //#input(bool doInstall(String)): this
    //#input(bool doInstall(String)): this.plugin
    //#output(bool doInstall(String)): return_value
    //#pre[3] (bool doInstall(String)): this.plugin != null
    //#post(bool doInstall(String)): init'ed(return_value)
    //#test_vector(bool doInstall(String)): com.dmdirc.plugins.PluginInfo:isLoaded(...)@100: {1}, {0}
    //#test_vector(bool doInstall(String)): com.dmdirc.plugins.PluginInfo:isLoaded(...)@114: {0}, {1}
    //#test_vector(bool doInstall(String)): com.dmdirc.plugins.PluginInfo:isLoaded(...)@96: {1}, {0}
    //#test_vector(bool doInstall(String)): com.dmdirc.plugins.PluginInfo:isUnloadable(...)@100: {1}, {0}
    //#test_vector(bool doInstall(String)): com.dmdirc.plugins.PluginInfo:isUnloadable(...)@96: {1}, {0}
    //#test_vector(bool doInstall(String)): java.io.File:exists(...)@104: {0}, {1}
    //#test_vector(bool doInstall(String)): java.io.File:exists(...)@96: {0}, {1}
    //#test_vector(bool doInstall(String)): java.io.File:renameTo(...)@100: {1}, {0}
        
        if ((plugin.isUnloadable() || !plugin.isLoaded()) && target.exists()) {
    //#PluginComponent.java:96: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.plugins.PluginInfo:isUnloadable()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: bool com.dmdirc.plugins.PluginInfo:isUnloadable()
    //#PluginComponent.java:96: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.plugins.PluginInfo:isLoaded()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: bool com.dmdirc.plugins.PluginInfo:isLoaded()
            target.delete();
        }
        
        if ((!plugin.isUnloadable() && plugin.isLoaded()) || !new File(path).renameTo(target)) {
    //#PluginComponent.java:100: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.plugins.PluginInfo:isUnloadable()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: bool com.dmdirc.plugins.PluginInfo:isUnloadable()
    //#PluginComponent.java:100: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.plugins.PluginInfo:isLoaded()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: bool com.dmdirc.plugins.PluginInfo:isLoaded()
            // Windows rocks!
            final File newTarget = new File(plugin.getFullFilename() + ".update");
    //#PluginComponent.java:102: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.plugins.PluginInfo:getFullFilename()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: String com.dmdirc.plugins.PluginInfo:getFullFilename()
            
            if (newTarget.exists()) {
                newTarget.delete();
            }
            
            new File(path).renameTo(newTarget);
            return true;
        }
        
        plugin.pluginUpdated();
    //#PluginComponent.java:112: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.plugins.PluginInfo:pluginUpdated()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: void com.dmdirc.plugins.PluginInfo:pluginUpdated()
        
        if (plugin.isLoaded()) {
    //#PluginComponent.java:114: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.plugins.PluginInfo:isLoaded()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: bool com.dmdirc.plugins.PluginInfo:isLoaded()
            plugin.unloadPlugin();
    //#PluginComponent.java:115: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.plugins.PluginInfo:unloadPlugin()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: void com.dmdirc.plugins.PluginInfo:unloadPlugin()
            plugin.loadPlugin();
    //#PluginComponent.java:116: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.plugins.PluginInfo:loadPlugin()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.updater.components.PluginComponent
    //#    method: bool doInstall(String)
    //#    unanalyzed callee: void com.dmdirc.plugins.PluginInfo:loadPlugin()
        }
        
        return false;
    //#PluginComponent.java:119: end of method: bool com.dmdirc.updater.components.PluginComponent.doInstall(String)
    }

}
    //#PluginComponent.java:: end of class: com.dmdirc.updater.components.PluginComponent
