Skip to content

Commit

Permalink
Annotate create methods with @NotNull for better inferring in Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Jan 23, 2022
1 parent 3b750e7 commit 3082d6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface BukkitCommandHandler extends CommandHandler {
* @param plugin Plugin to create for
* @return The newly created command handler
*/
static BukkitCommandHandler create(@NotNull Plugin plugin) {
static @NotNull BukkitCommandHandler create(@NotNull Plugin plugin) {
return new BukkitHandler(plugin);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface BungeeCommandHandler extends CommandHandler {
* @param plugin Plugin to create for
* @return The newly created command handler
*/
static BungeeCommandHandler create(@NotNull Plugin plugin) {
static @NotNull BungeeCommandHandler create(@NotNull Plugin plugin) {
return new BungeeHandler(plugin);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface VelocityCommandHandler extends CommandHandler {
* (namespace:command) will not work. Use {@link #create(Object, ProxyServer)}
*/
@Deprecated
static VelocityCommandHandler create(@NotNull ProxyServer server) {
static @NotNull VelocityCommandHandler create(@NotNull ProxyServer server) {
return new VelocityHandler(null, server);
}

Expand All @@ -37,7 +37,7 @@ static VelocityCommandHandler create(@NotNull ProxyServer server) {
* @param server Server proxy to register for
* @return The newly created handler
*/
static VelocityCommandHandler create(Object plugin, @NotNull ProxyServer server) {
static @NotNull VelocityCommandHandler create(Object plugin, @NotNull ProxyServer server) {
return new VelocityHandler(plugin, server);
}

Expand Down

0 comments on commit 3082d6d

Please sign in to comment.