SPIGOT-2540: Add nullability annotations to entire Bukkit API
By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.bukkit.plugin;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
@@ -19,7 +21,7 @@ public class PluginLogger extends Logger {
|
||||
*
|
||||
* @param context A reference to the plugin
|
||||
*/
|
||||
public PluginLogger(Plugin context) {
|
||||
public PluginLogger(@NotNull Plugin context) {
|
||||
super(context.getClass().getCanonicalName(), null);
|
||||
String prefix = context.getDescription().getPrefix();
|
||||
pluginName = prefix != null ? new StringBuilder().append("[").append(prefix).append("] ").toString() : "[" + context.getDescription().getName() + "] ";
|
||||
@@ -28,7 +30,7 @@ public class PluginLogger extends Logger {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void log(LogRecord logRecord) {
|
||||
public void log(@NotNull LogRecord logRecord) {
|
||||
logRecord.setMessage(pluginName + logRecord.getMessage());
|
||||
super.log(logRecord);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user