diff options
Diffstat (limited to 'EssentialsUpdate')
22 files changed, 104 insertions, 66 deletions
diff --git a/EssentialsUpdate/nbproject/build-impl.xml b/EssentialsUpdate/nbproject/build-impl.xml index 7a38ac1d4..2f8555c4c 100644 --- a/EssentialsUpdate/nbproject/build-impl.xml +++ b/EssentialsUpdate/nbproject/build-impl.xml @@ -20,10 +20,10 @@ is divided into following sections: --> <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsUpdate-impl"> - <fail message="Please build using Ant 1.7.1 or higher."> + <fail message="Please build using Ant 1.8.0 or higher."> <condition> <not> - <antversion atleast="1.7.1"/> + <antversion atleast="1.8.0"/> </not> </condition> </fail> @@ -223,6 +223,7 @@ is divided into following sections: <property name="javac.fork" value="${jdkBug6558476}"/> <property name="jar.index" value="false"/> <property name="jar.index.metainf" value="${jar.index}"/> + <property name="copylibs.rebase" value="true"/> <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/> </target> <target name="-post-init"> @@ -409,6 +410,7 @@ is divided into following sections: <property environment="env"/> <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> <jvmarg value="${profiler.info.jvmargs.agent}"/> <jvmarg line="${profiler.info.jvmargs}"/> <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> @@ -539,7 +541,7 @@ is divided into following sections: </chainedmapper> </pathconvert> <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> - <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> <fileset dir="${build.classes.dir}"/> <manifest> <attribute name="Class-Path" value="${jar.classpath}"/> @@ -864,6 +866,14 @@ is divided into following sections: --> <target depends="init" if="have.sources" name="-javadoc-build"> <mkdir dir="${dist.javadoc.dir}"/> + <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}"> + <and> + <isset property="endorsed.classpath.cmd.line.arg"/> + <not> + <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/> + </not> + </and> + </condition> <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> <classpath> <path path="${javac.classpath}"/> @@ -875,6 +885,7 @@ is divided into following sections: <include name="**/*.java"/> <exclude name="*.java"/> </fileset> + <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/> </javadoc> <copy todir="${dist.javadoc.dir}"> <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> diff --git a/EssentialsUpdate/nbproject/genfiles.properties b/EssentialsUpdate/nbproject/genfiles.properties index 992379672..6e1d2aeac 100644 --- a/EssentialsUpdate/nbproject/genfiles.properties +++ b/EssentialsUpdate/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=fd4b98a9 -nbproject/build-impl.xml.script.CRC32=1cab9494 -nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45 +nbproject/build-impl.xml.script.CRC32=94e69885 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsUpdate/nbproject/project.properties b/EssentialsUpdate/nbproject/project.properties index fadaa4839..88315dfa0 100644 --- a/EssentialsUpdate/nbproject/project.properties +++ b/EssentialsUpdate/nbproject/project.properties @@ -4,6 +4,43 @@ annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output application.title=EssentialsUpdate application.vendor=essentialsteam +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120 +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none +auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader=0 +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2 +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=* +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4 +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4 +auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4 build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -26,12 +63,11 @@ dist.jar=${dist.dir}/EssentialsUpdate.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar +file.reference.bukkit.jar=../lib/bukkit.jar includes=** jar.compress=true javac.classpath=\ - ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}:\ - ${libs.junit_4.classpath} + ${file.reference.bukkit.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -41,7 +77,8 @@ javac.source=1.6 javac.target=1.6 javac.test.classpath=\ ${javac.classpath}:\ - ${build.classes.dir} + ${build.classes.dir}:\ + ${libs.junit_4.10.classpath} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java b/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java index 487e372c8..d2cbb8a64 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java @@ -13,13 +13,15 @@ public abstract class AbstractWorkListener private final transient Plugin plugin; private final transient VersionInfo newVersionInfo; - public final void onWorkAbort() { + public final void onWorkAbort() + { onWorkAbort(null); } - + public abstract void onWorkAbort(String message); - - public final void onWorkDone() { + + public final void onWorkDone() + { onWorkDone(null); } diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java index ec62566ca..4ed1df602 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java @@ -1,13 +1,6 @@ package com.earth2me.essentials.update; -import com.earth2me.essentials.update.chat.Command; -import com.earth2me.essentials.update.chat.ConfigCommand; -import com.earth2me.essentials.update.chat.ErrorsCommand; -import com.earth2me.essentials.update.chat.HelpCommand; -import com.earth2me.essentials.update.chat.IrcBot; -import com.earth2me.essentials.update.chat.ListCommand; -import com.earth2me.essentials.update.chat.StartupCommand; -import com.earth2me.essentials.update.chat.UsernameUtil; +import com.earth2me.essentials.update.chat.*; import java.util.HashMap; import java.util.Locale; import java.util.Map; diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java index 98dbeb2ef..be6e42ce9 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java @@ -1,6 +1,5 @@ package com.earth2me.essentials.update; -import com.earth2me.essentials.update.UpdateCheck.CheckResult; import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.command.Command; @@ -16,7 +15,8 @@ public class EssentialsUpdate extends JavaPlugin @Override public void onEnable() { - if (!getDataFolder().exists() && !getDataFolder().mkdirs() ) { + if (!getDataFolder().exists() && !getDataFolder().mkdirs()) + { Bukkit.getLogger().log(Level.SEVERE, "Could not create data folder: {0}", getDataFolder().getPath()); } essentialsHelp = new EssentialsHelp(this); diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java b/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java index b48d95dd2..06b414e93 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java @@ -1,10 +1,6 @@ package com.earth2me.essentials.update; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; +import java.io.*; import java.math.BigInteger; import java.net.HttpURLConnection; import java.net.MalformedURLException; diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java index 95ef5e64e..3d465e2e8 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java @@ -15,8 +15,8 @@ import java.util.TreeMap; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; -import org.bukkit.plugin.Plugin; import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; public class UpdateFile @@ -66,7 +66,7 @@ public class UpdateFile getFile = new GetFile(UPDATE_URL); getFile.saveTo(file); plugin.getConfig().set("lastupdate", System.currentTimeMillis()); - plugin.getConfig().save(new File(plugin.getDataFolder(),"config.yml")); + plugin.getConfig().save(new File(plugin.getDataFolder(), "config.yml")); return true; } catch (IOException ex) diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java index c34e40ae5..b9cddc38c 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java @@ -1,10 +1,10 @@ package com.earth2me.essentials.update; -import org.bukkit.configuration.Configuration; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.bukkit.configuration.Configuration; public class VersionInfo diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java index 824383285..7c99d28f6 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java @@ -1,11 +1,7 @@ package com.earth2me.essentials.update.chat; import com.earth2me.essentials.update.PastieUpload; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; +import java.io.*; import java.nio.charset.Charset; import org.bukkit.plugin.Plugin; diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java index 5fda07106..de2c6a830 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java @@ -26,12 +26,16 @@ public class ConfigCommand extends AbstractFileCommand implements Command do { final String line = page.readLine(); - if (line == null) { + if (line == null) + { break; - } else { + } + else + { input.append(line).append("\n"); } - } while (true); + } + while (true); page.close(); final String message = "Essentials config.yml: " + uploadToPastie(input); player.sendMessage("§6" + ircBot.getNick() + ": §7" + message); diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java index 7478d81b7..2c85c39fd 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java @@ -26,9 +26,8 @@ public abstract class AbstractState catch (Exception ex) { /* - * This should never happen. - * All states that are added to the map automatically, - * have to have a Constructor that accepts the StateMap. + * This should never happen. All states, that are added to the map automatically, have to have a + * Constructor that accepts the StateMap. */ throw new RuntimeException(ex); } diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java index cb88cc642..930a31bda 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java @@ -8,5 +8,5 @@ public class InstallationFinishedEvent extends Event public InstallationFinishedEvent() { super(Type.CUSTOM_EVENT); - } + } } diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java index 6db8734e7..6ce926f92 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.update.states; -import com.earth2me.essentials.update.UpdateCheck; import com.earth2me.essentials.update.AbstractWorkListener; +import com.earth2me.essentials.update.UpdateCheck; import java.util.Iterator; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java index 5671275f0..6b48f90be 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java @@ -8,17 +8,18 @@ public class UpdateOrInstallation extends AbstractState { private final transient UpdateCheck updateCheck; private transient boolean update = false; - + public UpdateOrInstallation(final StateMap stateMap, final UpdateCheck updateCheck) { super(stateMap); this.updateCheck = updateCheck; } - + @Override public boolean guessAnswer() { - if (getUpdateCheck().isEssentialsInstalled()) { + if (getUpdateCheck().isEssentialsInstalled()) + { update = true; } return update; diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java index 66eeb380d..778f5172f 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java @@ -1,9 +1,9 @@ package com.earth2me.essentials.update.tasks; +import com.earth2me.essentials.update.AbstractWorkListener; import com.earth2me.essentials.update.GetFile; import com.earth2me.essentials.update.ModuleInfo; import com.earth2me.essentials.update.VersionInfo; -import com.earth2me.essentials.update.AbstractWorkListener; import java.io.File; import java.net.URL; import java.util.logging.Level; diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java index 777e42517..3baf86be7 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java @@ -43,8 +43,8 @@ public class SelfUpdate extends AbstractWorkListener implements Task, Runnable @Override public void run() { - Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), new Runnable() { - + Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), new Runnable() + { @Override public void run() { @@ -52,6 +52,4 @@ public class SelfUpdate extends AbstractWorkListener implements Task, Runnable } }); } - - } diff --git a/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java b/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java index 1c30ad815..a24815210 100755 --- a/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java +++ b/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java @@ -15,8 +15,8 @@ found at http://www.jibble.org/licenses/ package org.jibble.pircbot; import java.io.*; -import java.net.*; -import java.util.*; +import java.net.Socket; +import java.util.StringTokenizer; /** * A Thread which reads lines from the IRC server. It then diff --git a/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java b/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java index 86ac404d2..7eddee873 100755 --- a/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java +++ b/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java @@ -14,8 +14,7 @@ found at http://www.jibble.org/licenses/ package org.jibble.pircbot; -import java.io.*; -import java.net.*; +import java.io.BufferedWriter; /** * A Thread which is responsible for sending messages to the IRC server. diff --git a/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java b/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java index a5f049cde..28148075f 100755 --- a/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java +++ b/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java @@ -15,7 +15,8 @@ found at http://www.jibble.org/licenses/ package org.jibble.pircbot; import java.io.*; -import java.net.*; +import java.net.InetAddress; +import java.net.Socket; import java.util.*; /** @@ -773,7 +774,7 @@ public abstract class PircBot implements ReplyConstants { } } - command = command.toUpperCase(); + command = command.toUpperCase(Locale.ENGLISH); if (sourceNick.startsWith(":")) { sourceNick = sourceNick.substring(1); } @@ -2558,7 +2559,7 @@ public abstract class PircBot implements ReplyConstants { * @see #onUserList(String,User[]) onUserList */ public final User[] getUsers(String channel) { - channel = channel.toLowerCase(); + channel = channel.toLowerCase(Locale.ENGLISH); User[] userArray = new User[0]; synchronized (_channels) { Hashtable users = (Hashtable) _channels.get(channel); @@ -2631,7 +2632,7 @@ public abstract class PircBot implements ReplyConstants { * Overwrite the existing entry if it exists. */ private final void addUser(String channel, User user) { - channel = channel.toLowerCase(); + channel = channel.toLowerCase(Locale.ENGLISH); synchronized (_channels) { Hashtable users = (Hashtable) _channels.get(channel); if (users == null) { @@ -2647,7 +2648,7 @@ public abstract class PircBot implements ReplyConstants { * Remove a user from the specified channel in our memory. */ private final User removeUser(String channel, String nick) { - channel = channel.toLowerCase(); + channel = channel.toLowerCase(Locale.ENGLISH); User user = new User("", nick); synchronized (_channels) { Hashtable users = (Hashtable) _channels.get(channel); @@ -2695,7 +2696,7 @@ public abstract class PircBot implements ReplyConstants { * Removes an entire channel from our memory of users. */ private final void removeChannel(String channel) { - channel = channel.toLowerCase(); + channel = channel.toLowerCase(Locale.ENGLISH); synchronized (_channels) { _channels.remove(channel); } @@ -2713,7 +2714,7 @@ public abstract class PircBot implements ReplyConstants { private final void updateUser(String channel, int userMode, String nick) { - channel = channel.toLowerCase(); + channel = channel.toLowerCase(Locale.ENGLISH); synchronized (_channels) { Hashtable users = (Hashtable) _channels.get(channel); User newUser = null; diff --git a/EssentialsUpdate/src/org/jibble/pircbot/User.java b/EssentialsUpdate/src/org/jibble/pircbot/User.java index cb2bfa051..37f981b19 100755 --- a/EssentialsUpdate/src/org/jibble/pircbot/User.java +++ b/EssentialsUpdate/src/org/jibble/pircbot/User.java @@ -13,6 +13,8 @@ found at http://www.jibble.org/licenses/ package org.jibble.pircbot; +import java.util.Locale; + /** * This class is used to represent a user on an IRC server. * Instances of this class are returned by the getUsers method @@ -38,7 +40,7 @@ public class User { User(String prefix, String nick) { _prefix = prefix; _nick = nick; - _lowerNick = nick.toLowerCase(); + _lowerNick = nick.toLowerCase(Locale.ENGLISH); } @@ -109,7 +111,7 @@ public class User { * @return true if the nicks are identical (case insensitive). */ public boolean equals(String nick) { - return nick.toLowerCase().equals(_lowerNick); + return nick.toLowerCase(Locale.ENGLISH).equals(_lowerNick); } diff --git a/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java b/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java index 92faade26..024f2248b 100644 --- a/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java +++ b/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java @@ -4,7 +4,6 @@ import com.earth2me.essentials.update.Version.Type; import java.util.TreeSet; import junit.framework.TestCase; import org.junit.Test; -import static org.junit.Assert.*; public class VersionTest extends TestCase |