[Cherbot-commit] SF.net SVN: cherbot: [38] trunk/src/net/sf/cherbot
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2006-10-30 09:00:55
|
Revision: 38
http://svn.sourceforge.net/cherbot/?rev=38&view=rev
Author: christianhujer
Date: 2006-10-30 01:00:29 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Declared nullability on some classes.
Modified Paths:
--------------
trunk/src/net/sf/cherbot/BlackListManager.java
trunk/src/net/sf/cherbot/Manager.java
Modified: trunk/src/net/sf/cherbot/BlackListManager.java
===================================================================
--- trunk/src/net/sf/cherbot/BlackListManager.java 2006-10-29 23:11:41 UTC (rev 37)
+++ trunk/src/net/sf/cherbot/BlackListManager.java 2006-10-30 09:00:29 UTC (rev 38)
@@ -8,6 +8,7 @@
import java.util.SortedSet;
import java.util.TreeSet;
+import org.jetbrains.annotations.NotNull;
/**
* Manages a black list of users that may not use Cherbot.
@@ -55,7 +56,7 @@
* Create the BlackListManager.
* @param cherbot CherBot
*/
- public BlackListManager(final CherBot cherbot) {
+ public BlackListManager(@NotNull final CherBot cherbot) {
super(cherbot, "blacklist");
}
@@ -78,7 +79,7 @@
* Puts a player to the blacklist.
* @param player Player to blacklist
*/
- private void addBlacklist(final String player) {
+ private void addBlacklist(@NotNull final String player) {
checkPermission(PERM_BLACKLIST);
if (blacklist.add(player)) {
answer("Added " + player + " to the blacklist.");
@@ -92,7 +93,7 @@
* Removes a player from the blacklist.
* @param player Player to remove
*/
- private void removeBlacklist(final String player) {
+ private void removeBlacklist(@NotNull final String player) {
checkPermission(PERM_BLACKLIST);
if (blacklist.remove(player)) {
answer("Removed " + player + " from the blacklist.");
@@ -107,7 +108,7 @@
* @param player Player to check
* @return <code>true</code> if <var>player</var> is blacklisted, otherwise <code>false</code>.
*/
- public boolean isBlacklisted(final String player) {
+ public boolean isBlacklisted(@NotNull final String player) {
return blacklist.contains(player);
}
Modified: trunk/src/net/sf/cherbot/Manager.java
===================================================================
--- trunk/src/net/sf/cherbot/Manager.java 2006-10-29 23:11:41 UTC (rev 37)
+++ trunk/src/net/sf/cherbot/Manager.java 2006-10-30 09:00:29 UTC (rev 38)
@@ -27,6 +27,8 @@
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Base class for managers.
@@ -109,7 +111,7 @@
* @param cherBot CherBot to create Manager for.
* @param topic Topic name to use
*/
- protected Manager(final CherBot cherBot, final String topic) {
+ protected Manager(@NotNull final CherBot cherBot, @NotNull final String topic) {
this(cherBot, topic, 0);
}
@@ -119,7 +121,7 @@
* @param topic Topic name to use
* @param delay Delay to use for notifications
*/
- protected Manager(final CherBot cherBot, final String topic, final int delay) {
+ protected Manager(@NotNull final CherBot cherBot, @NotNull final String topic, @NotNull final int delay) {
this.cherBot = cherBot;
this.topic = topic;
this.delay = delay;
@@ -138,7 +140,7 @@
* Add a command.
* @param command Command to add
*/
- private void addCommand(final Command command) {
+ private void addCommand(@NotNull final Command command) {
commands.add(command);
cherBot.addCommand(command);
}
@@ -170,7 +172,7 @@
* @param txt message to check
* @throws SmutException in case smut was found
*/
- public void checkSmut(final String txt) throws SmutException {
+ public void checkSmut(@NotNull final String txt) throws SmutException {
final Manager smutManager = cherBot.getManager("smut");
assert smutManager != this : "A Manager for \"smut\" must override Manager.checkSmut(String)!";
if (smutManager == this) {
@@ -188,7 +190,7 @@
* @return player name
* @throws NoSuchPlayerException in case CherBot doesn't know that player
*/
- protected String player(final String player) {
+ @NotNull protected String player(@NotNull final String player) {
final Manager playerManager = cherBot.getManager("players");
if (playerManager == null) {
return player;
@@ -206,7 +208,7 @@
* If the bot does not have a Manager for that topic, this method simply returns <code>null</code>.
* @return current time
*/
- protected TimeManager.Time getCurrentTime() {
+ @Nullable protected TimeManager.Time getCurrentTime() {
final Manager timeManager = cherBot.getManager("time");
if (timeManager == null) {
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|