Merge pull request #2044 from Lucwousin/consider-your-style-checked

project: Update checkstyle rules
This commit is contained in:
Lucwousin
2019-11-16 15:51:07 +01:00
committed by GitHub
113 changed files with 183 additions and 391 deletions
@@ -24,7 +24,4 @@
*/
package net.runelite.cache.definitions;
public interface WorldMapTypeBase
{
}
public interface WorldMapTypeBase {}
@@ -25,13 +25,12 @@
package net.runelite.cache.definitions.loaders;
import java.util.HashMap;
import net.runelite.cache.definitions.ItemDefinition;
import net.runelite.cache.io.InputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
public class ItemLoader
{
private static final Logger logger = LoggerFactory.getLogger(ItemLoader.class);
@@ -40,7 +39,7 @@ public class ItemLoader
{
ItemDefinition def = new ItemDefinition(id);
InputStream is = new InputStream(b);
while (true)
{
int opcode = is.readUnsignedByte();
@@ -25,7 +25,6 @@
package net.runelite.cache;
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
+12 -5
View File
@@ -32,6 +32,8 @@
<module name="SuppressionCommentFilter"/>
<module name="LeftCurly">
<property name="option" value="nl"/>
<!-- allow {} on anonymous classes and lambdas-->
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, STATIC_INIT"/>
</module>
<module name="RightCurly">
<property name="option" value="alone"/>
@@ -42,12 +44,12 @@
<property name="message" value="Indent must use tab characters"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="import (?!static|java\.awt).*\*"/>
<property name="message" value="Multiline imports are disallowed if they are not static"/>
<property name="ignoreComments" value="true"/>
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyTypes" value="true"/>
</module>
<module name="WhitespaceAround"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA"/>
</module>
@@ -57,6 +59,11 @@
<property name="format" value="else[ \t]*[\r\n]+[ \t]*if"/>
<property name="message" value="Newline should not be between else and if"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="^[\r\n\s]+import"/>
<property name="maximum" value="1"/>
<property name="message" value="There should not be empty lines in the imports list"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>
@@ -28,7 +28,6 @@ package net.runelite.asm.attributes;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.runelite.asm.Type;
import net.runelite.asm.attributes.annotation.Annotation;
import net.runelite.asm.attributes.annotation.Element;
@@ -25,7 +25,4 @@
package net.runelite.asm.attributes.code.instruction.types;
public interface ArrayStoreInstruction extends MappableInstruction
{
}
public interface ArrayStoreInstruction extends MappableInstruction {}
@@ -25,7 +25,4 @@
package net.runelite.asm.attributes.code.instruction.types;
public interface ComparisonInstruction
{
}
public interface ComparisonInstruction {}
@@ -25,7 +25,4 @@
package net.runelite.asm.attributes.code.instruction.types;
public interface ConversionInstruction
{
}
public interface ConversionInstruction {}
@@ -25,6 +25,4 @@
package net.runelite.asm.attributes.code.instruction.types;
public interface GetFieldInstruction extends FieldInstruction
{
}
public interface GetFieldInstruction extends FieldInstruction {}
@@ -25,7 +25,4 @@
package net.runelite.asm.attributes.code.instruction.types;
public interface ReturnInstruction
{
}
public interface ReturnInstruction {}
@@ -25,6 +25,4 @@
package net.runelite.asm.attributes.code.instruction.types;
public interface SetFieldInstruction extends FieldInstruction, MappableInstruction
{
}
public interface SetFieldInstruction extends FieldInstruction, MappableInstruction {}
@@ -40,7 +40,6 @@ import net.runelite.asm.execution.InstructionContext;
import net.runelite.asm.execution.Stack;
import net.runelite.asm.execution.StackContext;
import static net.runelite.asm.execution.StaticStep.stepInto;
import net.runelite.asm.execution.Value;
import net.runelite.asm.pool.Method;
import net.runelite.asm.signature.Signature;
@@ -25,11 +25,10 @@
package net.runelite.asm.execution;
import net.runelite.asm.Type;
import java.util.Arrays;
import java.util.List;
import net.runelite.asm.Method;
import net.runelite.asm.Type;
public class Stack
{
@@ -40,13 +39,13 @@ public class Stack
{
stack = new StackContext[sz * 2]; // XXX FIXME
}
public Stack(Stack other)
{
this.size = other.size;
this.stack = other.stack.clone();
}
private void printStack(StackContext ctx, int level)
{
for (int i = 0; i < level; ++i)
@@ -66,7 +65,7 @@ public class Stack
printStack(stack[c], 0);
throw new RuntimeException("Stack overflow");
}
assert !i.getType().equals(Type.VOID);
stack[size] = i;
@@ -80,12 +79,12 @@ public class Stack
return stack[--size];
}
public int getSize()
{
return size;
}
public List<StackContext> getStack()
{
return Arrays.asList(stack);
@@ -25,10 +25,9 @@
package net.runelite.asm.execution;
import net.runelite.asm.Type;
import java.util.ArrayList;
import java.util.List;
import net.runelite.asm.Type;
public class VariableContext
{
@@ -46,13 +45,13 @@ public class VariableContext
type = ctx.getType();
value = ctx.getValue();
}
public VariableContext(Type type) // for entrypoints
{
this.type = type;
value = Value.UNKNOWN;
}
public VariableContext(InstructionContext i, VariableContext other)
{
ic = i;
@@ -60,24 +59,24 @@ public class VariableContext
type = other.type;
value = other.value;
}
public VariableContext(InstructionContext i, Type type, Value value)
{
ic = i;
this.type = type;
this.value = value;
}
public StackContext getStackContext()
{
return ctx;
}
public InstructionContext getInstructionWhichStored()
{
return ic;
}
public Type getType()
{
return type;
@@ -87,7 +86,7 @@ public class VariableContext
{
return value;
}
public void addRead(InstructionContext ctx)
{
if (!read.contains(ctx))
@@ -103,7 +102,7 @@ public class VariableContext
{
return isParameter;
}
public VariableContext markParameter()
{
isParameter = true;
@@ -25,9 +25,8 @@
package net.runelite.asm.pool;
import net.runelite.asm.Type;
import java.util.Objects;
import net.runelite.asm.Type;
public class Field
{
@@ -24,8 +24,6 @@
*/
package net.runelite.asm.signature;
import net.runelite.asm.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -33,6 +31,7 @@ import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.runelite.asm.Type;
public class Signature
{
@@ -24,6 +24,7 @@
*/
package net.runelite.deob;
import java.util.List;
import net.runelite.asm.ClassFile;
import net.runelite.asm.Field;
import net.runelite.asm.Method;
@@ -33,8 +34,6 @@ import net.runelite.asm.attributes.annotation.Annotation;
import net.runelite.asm.attributes.annotation.Element;
import net.runelite.asm.signature.Signature;
import java.util.List;
public class DeobAnnotations
{
public static final Type OBFUSCATED_NAME = new Type("Lnet/runelite/mapping/ObfuscatedName;");
@@ -25,6 +25,7 @@
package net.runelite.deob.deobfuscators;
import java.util.List;
import net.runelite.asm.ClassFile;
import net.runelite.asm.ClassGroup;
import net.runelite.asm.Field;
@@ -35,31 +36,29 @@ import net.runelite.deob.DeobAnnotations;
import net.runelite.deob.Deobfuscator;
import net.runelite.deob.util.NameMappings;
import java.util.List;
public class RenameUnique implements Deobfuscator
{
private Renamer renamer;
private void generateClassNames(NameMappings map, ClassGroup group)
{
int i = 0;
for (ClassFile cf : group.getClasses())
{
if (cf.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN)
{
continue;
}
map.map(cf.getPoolClass(), "class" + i++);
}
}
private void generateFieldNames(NameMappings map, ClassGroup group)
{
int i = 0;
for (ClassFile cf : group.getClasses())
for (Field field : cf.getFields())
{
@@ -67,7 +66,7 @@ public class RenameUnique implements Deobfuscator
{
continue;
}
map.map(field.getPoolField(), "field" + i++);
}
}
@@ -75,7 +74,7 @@ public class RenameUnique implements Deobfuscator
private void generateMethodNames(NameMappings map, ClassGroup group)
{
int i = 0;
for (ClassFile cf : group.getClasses())
for (Method method : cf.getMethods())
{
@@ -83,16 +82,16 @@ public class RenameUnique implements Deobfuscator
{
continue;
}
List<Method> virtualMethods = VirtualMethods.getVirtualMethods(method);
assert !virtualMethods.isEmpty();
String name;
if (virtualMethods.size() == 1)
name = "method" + i++;
else
name = "vmethod" + i++;
for (Method m : virtualMethods)
map.map(m.getPoolMethod(), name);
}
@@ -103,13 +102,13 @@ public class RenameUnique implements Deobfuscator
{
group.buildClassGraph();
group.lookup();
NameMappings mappings = new NameMappings();
this.generateClassNames(mappings, group);
this.generateFieldNames(mappings, group);
this.generateMethodNames(mappings, group);
renamer = new Renamer(mappings);
renamer.run(group);
}
@@ -25,7 +25,6 @@
package net.runelite.deob.deobfuscators.packethandler;
import java.util.Objects;
import net.runelite.asm.Type;
import net.runelite.asm.attributes.code.Instruction;
import net.runelite.asm.execution.InstructionContext;
@@ -1,6 +1,5 @@
package net.runelite.gamepack;
import java.io.File;
import java.io.IOException;
import java.net.URL;
@@ -24,7 +24,4 @@
*/
package net.runelite.deob.deobfuscators.unusedclass;
public class EmptyClass
{
}
public class EmptyClass {}
@@ -24,7 +24,4 @@
*/
package net.runelite.deob.deobfuscators.unusedclass;
public interface EmptyInterface
{
}
public interface EmptyInterface {}
@@ -70,9 +70,7 @@ public class HookImporter
Assert.assertNotNull(is);
Gson gson = new Gson();
java.lang.reflect.Type type = new TypeToken<Map<String, ClassHook>>()
{
}.getType();
java.lang.reflect.Type type = new TypeToken<Map<String, ClassHook>>() {}.getType();
hooks = gson.fromJson(new InputStreamReader(is), type);
group = JarUtil.loadJar(IN);
@@ -81,9 +81,7 @@ public class HookImporter
InputStream is = getClass().getResourceAsStream("hooks.json");
Gson gson = new Gson();
java.lang.reflect.Type type = new TypeToken<List<HookClass>>()
{
}.getType();
java.lang.reflect.Type type = new TypeToken<List<HookClass>>() {}.getType();
hooks = gson.fromJson(new InputStreamReader(is), type);
}
@@ -115,9 +115,7 @@ public class AnimationClient
{
InputStream in = response.body().byteStream();
// CHECKSTYLE:OFF
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<AnimationKey>>()
{
}.getType());
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<AnimationKey>>() {}.getType());
// CHECKSTYLE:ON
}
catch (JsonParseException ex)
@@ -102,9 +102,7 @@ public class LootTrackerClient
}
InputStream in = response.body().byteStream();
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<LootRecord>>()
{
}.getType());
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<LootRecord>>() {}.getType());
}
catch (JsonParseException ex)
{
@@ -16,10 +16,6 @@
package net.runelite.http.api.ws;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@@ -31,6 +27,9 @@ import com.google.gson.internal.Streams;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Adapts values whose runtime type may differ from their declaration type. This
@@ -27,6 +27,4 @@ package net.runelite.http.api.ws.messages.party;
import net.runelite.api.events.Event;
import net.runelite.http.api.ws.WebsocketMessage;
public class Part extends WebsocketMessage implements Event
{
}
public class Part extends WebsocketMessage implements Event {}
@@ -30,6 +30,4 @@ import net.runelite.api.events.Event;
@Value
@EqualsAndHashCode(callSuper = true)
public class UserSync extends PartyMemberMessage implements Event
{
}
public class UserSync extends PartyMemberMessage implements Event {}
@@ -101,9 +101,7 @@ public class XteaClient
{
InputStream in = response.body().byteStream();
// CHECKSTYLE:OFF
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<XteaKey>>()
{
}.getType());
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<XteaKey>>() {}.getType());
// CHECKSTYLE:ON
}
catch (JsonParseException ex)
@@ -110,9 +110,7 @@ public class TwitterService
}
InputStream in = response.body().byteStream();
Type listType = new TypeToken<List<TwitterStatusesResponseItem>>()
{
}.getType();
Type listType = new TypeToken<List<TwitterStatusesResponseItem>>() {}.getType();
List<TwitterStatusesResponseItem> statusesResponse = RuneLiteAPI.GSON
.fromJson(new InputStreamReader(in), listType);
@@ -58,9 +58,7 @@ public class OsbuddyClient
throw new IOException("Error retrieving summary from OSBuddy: " + responseOk.message());
}
Type type = new TypeToken<Map<Integer, OsbuddySummaryItem>>()
{
}.getType();
Type type = new TypeToken<Map<Integer, OsbuddySummaryItem>>() {}.getType();
return RuneLiteAPI.GSON.fromJson(responseOk.body().string(), type);
}
@@ -26,9 +26,8 @@
package net.runelite.http.service.util;
import net.runelite.http.api.hiscore.HiscoreEndpoint;
import java.beans.PropertyEditorSupport;
import net.runelite.http.api.hiscore.HiscoreEndpoint;
public class HiscoreEndpointEditor extends PropertyEditorSupport
{
@@ -29,7 +29,4 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = "Not found")
public class NotFoundException extends RuntimeException
{
}
public class NotFoundException extends RuntimeException {}
@@ -24,7 +24,4 @@
*/
package net.runelite.protocol.api.handshake;
public abstract class HandshakePacket
{
}
public abstract class HandshakePacket {}
@@ -29,7 +29,4 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class LoginHandshakePacket extends HandshakePacket
{
}
public class LoginHandshakePacket extends HandshakePacket {}
@@ -27,6 +27,4 @@ package net.runelite.api;
/**
* Represents the friend and ignore list manager.
*/
public interface FriendManager
{
}
public interface FriendManager {}
@@ -27,6 +27,4 @@ package net.runelite.api;
/**
* Detects when the window is focused or unfocused.
*/
public interface KeyFocusListener
{
}
public interface KeyFocusListener {}
@@ -27,6 +27,4 @@ package net.runelite.api;
/**
* Represents a chat entity that has a name.
*/
public interface Nameable extends Comparable
{
}
public interface Nameable extends Comparable {}
@@ -33,6 +33,4 @@ import java.lang.annotation.RetentionPolicy;
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
public @interface VisibleForDevtools
{
}
public @interface VisibleForDevtools {}
@@ -1,5 +1,3 @@
package net.runelite.api.events;
public interface Event
{
}
public interface Event {}
@@ -26,7 +26,6 @@ package net.runelite.api.widgets;
import java.awt.Rectangle;
import java.util.Collection;
import net.runelite.api.FontTypeFace;
import net.runelite.api.Point;
import net.runelite.api.Sprite;
@@ -37,6 +37,4 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface Alpha
{
}
public @interface Alpha {}
@@ -1,5 +1,3 @@
package net.runelite.client.config;
public class Button
{
}
public class Button {}
@@ -24,6 +24,4 @@
*/
package net.runelite.client.config;
public interface Config
{
}
public interface Config {}
@@ -1,5 +1,3 @@
package net.runelite.client.config;
public class Title
{
}
public class Title {}
@@ -35,7 +35,4 @@ import net.runelite.api.events.Event;
* it has nothing to do with whether an account is being logged out.
*/
@Data
public class SessionClose implements Event
{
}
public class SessionClose implements Event {}
@@ -35,7 +35,4 @@ import net.runelite.api.events.Event;
* it has nothing to do with whether an account is being logged in.
*/
@Data
public class SessionOpen implements Event
{
}
public class SessionOpen implements Event {}
@@ -24,6 +24,4 @@
*/
package net.runelite.client.input;
public interface KeyListener extends java.awt.event.KeyListener
{
}
public interface KeyListener extends java.awt.event.KeyListener {}
@@ -24,6 +24,4 @@
*/
package net.runelite.client.plugins.achievementdiary;
public interface Requirement
{
}
public interface Requirement {}
@@ -26,7 +26,6 @@
*/
package net.runelite.client.plugins.aoewarnings;
import com.google.inject.Provides;
import java.awt.Color;
import java.time.Instant;
@@ -27,6 +27,13 @@
package net.runelite.client.plugins.barbarianassault;
import com.google.common.collect.ImmutableMap;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Stroke;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.api.Perspective;
@@ -39,14 +46,6 @@ import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayUtil;
import javax.inject.Inject;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.BasicStroke;
import java.util.Map;
@Singleton
class AboveSceneOverlay extends Overlay
{
@@ -31,7 +31,6 @@ import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.api.Point;
@@ -26,18 +26,17 @@
package net.runelite.client.plugins.barbarianassault;
import com.google.common.collect.Sets;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import javax.inject.Inject;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import net.runelite.client.menus.AbstractComparableEntry;
import net.runelite.client.menus.MenuManager;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
class BarbarianAssaultMenu
{
private final MenuManager menuManager;
@@ -26,15 +26,14 @@
package net.runelite.client.plugins.barbarianassault;
import com.google.common.collect.ImmutableList;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import net.runelite.api.NPC;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
@Data
class Healer
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.barbarianassault;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
@@ -24,13 +24,12 @@
*/
package net.runelite.client.plugins.barbarianassault;
import lombok.AccessLevel;
import lombok.Getter;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import lombok.AccessLevel;
import lombok.Getter;
class Timer
{
@@ -25,14 +25,13 @@
*/
package net.runelite.client.plugins.barbarianassault;
import java.awt.Color;
import java.awt.image.BufferedImage;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.ui.overlay.infobox.InfoBox;
import java.awt.Color;
import java.awt.image.BufferedImage;
@EqualsAndHashCode(callSuper = true)
@Data
public class TimerBox extends InfoBox
@@ -27,6 +27,7 @@
package net.runelite.client.plugins.barbarianassault;
import com.google.common.collect.ImmutableList;
import java.awt.Color;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
@@ -35,8 +36,6 @@ import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.chat.ChatMessageBuilder;
import java.awt.Color;
@Data
public class Wave
{
@@ -24,14 +24,13 @@
*/
package net.runelite.client.plugins.bosstimetracker;
import net.runelite.client.ui.overlay.infobox.InfoBox;
import java.awt.image.BufferedImage;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import net.runelite.client.ui.overlay.infobox.InfoBox;
public class BossTimeTracker extends InfoBox
{
@@ -24,29 +24,27 @@
*/
package net.runelite.client.plugins.bosstimetracker;
import lombok.Getter;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.util.Text;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.game.ItemManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.eventbus.EventBus;
import javax.inject.Inject;
import java.time.Duration;
import java.time.Instant;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.inject.Inject;
import lombok.Getter;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import static net.runelite.api.ItemID.FIRE_CAPE;
import static net.runelite.api.ItemID.INFERNAL_CAPE;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.util.Text;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.game.ItemManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
@PluginDescriptor(
name = "Boss Time Tracker",
@@ -28,7 +28,6 @@ package net.runelite.client.plugins.chatnotifications;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.inject.Provides;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -41,17 +40,17 @@ import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.api.MessageNode;
import net.runelite.api.events.ChatMessage;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.util.Text;
import net.runelite.client.Notifier;
import net.runelite.client.RuneLiteProperties;
import net.runelite.client.chat.ChatColorType;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.api.util.Text;
@PluginDescriptor(
name = "Chat Notifications",
@@ -1,11 +1,10 @@
package net.runelite.client.plugins.combatcounter;
import java.awt.Color;
import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import java.awt.*;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
@@ -57,7 +56,7 @@ public interface CombatCounterConfig extends Config
{
return new Title();
}
@Alpha
@ConfigItem(
keyName = "selfColor",
@@ -70,7 +69,7 @@ public interface CombatCounterConfig extends Config
{
return Color.green;
}
@Alpha
@ConfigItem(
keyName = "totalColor",
@@ -83,7 +82,7 @@ public interface CombatCounterConfig extends Config
{
return Color.RED;
}
@Alpha
@ConfigItem(
keyName = "otherColor",
@@ -96,7 +95,7 @@ public interface CombatCounterConfig extends Config
{
return Color.white;
}
@Alpha
@ConfigItem(
keyName = "bgColor",
@@ -109,7 +108,7 @@ public interface CombatCounterConfig extends Config
{
return new Color(70, 61, 50, 156);
}
@Alpha
@ConfigItem(
keyName = "titleColor",
@@ -24,7 +24,6 @@
*/
package net.runelite.client.plugins.equipmentinspector;
import com.google.inject.Provides;
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationTargetException;
@@ -108,9 +108,7 @@ public class GrandExchangePlugin extends Plugin
private static final OSBGrandExchangeClient CLIENT = new OSBGrandExchangeClient();
private static final String OSB_GE_TEXT = "<br>OSBuddy Actively traded price: ";
private static final String BUY_LIMIT_GE_TEXT = "<br>Buy limit: ";
private static final TypeToken<Map<Integer, Integer>> BUY_LIMIT_TOKEN = new TypeToken<Map<Integer, Integer>>()
{
};
private static final TypeToken<Map<Integer, Integer>> BUY_LIMIT_TOKEN = new TypeToken<Map<Integer, Integer>>() {};
@Getter(AccessLevel.PACKAGE)
private NavigationButton button;
@@ -24,20 +24,19 @@
*/
package net.runelite.client.plugins.grotesqueguardians;
import java.util.ArrayList;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.api.NPC;
import static net.runelite.api.NpcID.DUSK_7888;
import net.runelite.api.events.GameTick;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.ui.overlay.OverlayManager;
import java.util.ArrayList;
import net.runelite.api.events.GameTick;
import net.runelite.api.NPC;
import javax.annotation.Nullable;
import net.runelite.api.Client;
import static net.runelite.api.NpcID.DUSK_7888;
@PluginDescriptor(
@@ -28,7 +28,6 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -140,9 +140,7 @@ public class GroundMarkerPlugin extends Plugin
return GSON.fromJson(json, new GroundMarkerListTypeToken().getType());
}
private static class GroundMarkerListTypeToken extends TypeToken<List<GroundMarkerPoint>>
{
}
private static class GroundMarkerListTypeToken extends TypeToken<List<GroundMarkerPoint>> {}
private GroundMarkerConfig.amount amount;
@Getter(AccessLevel.PACKAGE)
@@ -301,10 +301,7 @@ public class InventorySetupPlugin extends Plugin
{
// TODO add last resort?, serialize exception just make empty map
final Gson gson = new Gson();
Type type = new TypeToken<HashMap<String, InventorySetup>>()
{
}.getType();
Type type = new TypeToken<HashMap<String, InventorySetup>>() {}.getType();
inventorySetups.clear();
inventorySetups.putAll(gson.fromJson(json, type));
}
@@ -371,7 +368,7 @@ public class InventorySetupPlugin extends Plugin
{
return;
}
final String setupName = panel.getSelectedInventorySetup();
if (!setupName.isEmpty())
{
@@ -11,7 +11,6 @@
package net.runelite.client.plugins.loottracker;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.time.Duration;
@@ -1451,9 +1451,7 @@ public class LootTrackerPlugin extends Plugin
try
{
Collection<LootRecord> lootRecords = new ArrayList<>(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE),
new TypeToken<ArrayList<LootRecord>>()
{
}.getType()));
new TypeToken<ArrayList<LootRecord>>() {}.getType()));
DSLContext dslContext = databaseManager.getDsl();
@@ -26,6 +26,4 @@ package net.runelite.client.plugins.loottracker.localstorage.events;
import net.runelite.api.events.Event;
public class LTNameChange implements Event
{
}
public class LTNameChange implements Event {}
@@ -17,9 +17,7 @@ public class GrimyHerbLookup
{
final InputStream herbFile = GrimyHerbLookup.class.getResourceAsStream("/herbs.json");
Gson gson = new Gson();
mapping = gson.fromJson(new InputStreamReader(herbFile), new TypeToken<Map<String, HerbInfo>>()
{
}.getType());
mapping = gson.fromJson(new InputStreamReader(herbFile), new TypeToken<Map<String, HerbInfo>>() {}.getType());
}
public int getCleanLevel(int itemId)
@@ -1,5 +1,3 @@
package net.runelite.client.plugins.menuentryswapper.util;
public class HerbNotFoundException extends RuntimeException
{
}
public class HerbNotFoundException extends RuntimeException {}
@@ -25,30 +25,29 @@
package net.runelite.client.plugins.nightmarezone;
import com.google.inject.Provides;
import java.awt.Color;
import java.time.Duration;
import java.time.Instant;
import java.util.Arrays;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.AccessLevel;
import java.time.Duration;
import java.time.Instant;
import lombok.Getter;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.Varbits;
import net.runelite.api.events.ChatMessage;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.util.Text;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.Notifier;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.api.util.Text;
@PluginDescriptor(
name = "Nightmare Zone",
@@ -81,7 +80,7 @@ public class NightmareZonePlugin extends Plugin
@Getter
private int pointsPerHour;
private Instant nmzSessionStartTime;
// This starts as true since you need to get
@@ -62,9 +62,7 @@ public class NotesManager
if (!Strings.isNullOrEmpty(configJson))
{
final Gson gson = new Gson();
notes = gson.fromJson(configJson, new TypeToken<ArrayList<String>>()
{
}.getType());
notes = gson.fromJson(configJson, new TypeToken<ArrayList<String>>() {}.getType());
}
if (notes == null)
@@ -503,9 +503,7 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
return null;
}
Set<ObjectPoint> points = GSON.fromJson(json, new TypeToken<Set<ObjectPoint>>()
{
}.getType());
Set<ObjectPoint> points = GSON.fromJson(json, new TypeToken<Set<ObjectPoint>>() {}.getType());
// Prior to multiloc support the plugin would mark objects named "null", which breaks
// in most cases due to the specific object being identified being ambiguous, so remove
// them
@@ -24,34 +24,13 @@
*/
package net.runelite.client.plugins.runepouch;
import com.google.common.collect.ImmutableMap;
import java.awt.image.BufferedImage;
import java.util.Map;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import static net.runelite.api.ItemID.AIR_RUNE;
import static net.runelite.api.ItemID.ASTRAL_RUNE;
import static net.runelite.api.ItemID.BLOOD_RUNE;
import static net.runelite.api.ItemID.BODY_RUNE;
import static net.runelite.api.ItemID.CHAOS_RUNE;
import static net.runelite.api.ItemID.COSMIC_RUNE;
import static net.runelite.api.ItemID.DEATH_RUNE;
import static net.runelite.api.ItemID.DUST_RUNE;
import static net.runelite.api.ItemID.EARTH_RUNE;
import static net.runelite.api.ItemID.FIRE_RUNE;
import static net.runelite.api.ItemID.LAVA_RUNE;
import static net.runelite.api.ItemID.LAW_RUNE;
import static net.runelite.api.ItemID.MIND_RUNE;
import static net.runelite.api.ItemID.MIST_RUNE;
import static net.runelite.api.ItemID.MUD_RUNE;
import static net.runelite.api.ItemID.NATURE_RUNE;
import static net.runelite.api.ItemID.SMOKE_RUNE;
import static net.runelite.api.ItemID.SOUL_RUNE;
import static net.runelite.api.ItemID.STEAM_RUNE;
import static net.runelite.api.ItemID.WATER_RUNE;
import static net.runelite.api.ItemID.WRATH_RUNE;
import static net.runelite.api.ItemID.*;
public enum Runes
{
@@ -258,9 +258,7 @@ public class ScreenMarkerPlugin extends Plugin
}
final Gson gson = new Gson();
final List<ScreenMarker> screenMarkerData = gson.fromJson(json, new TypeToken<ArrayList<ScreenMarker>>()
{
}.getType());
final List<ScreenMarker> screenMarkerData = gson.fromJson(json, new TypeToken<ArrayList<ScreenMarker>>() {}.getType());
return screenMarkerData.stream().map(ScreenMarkerOverlay::new);
}
@@ -44,9 +44,7 @@ class SlayerXpDropLookup
try (final InputStream xpFile = getClass().getResourceAsStream("/slayer_xp.json"))
{
Gson gson = new Gson();
xpMap = gson.fromJson(new InputStreamReader(xpFile), new TypeToken<Map<String, List<Double>>>()
{
}.getType());
xpMap = gson.fromJson(new InputStreamReader(xpFile), new TypeToken<Map<String, List<Double>>>() {}.getType());
}
}
@@ -486,9 +486,7 @@ public class SpellbookPlugin extends Plugin
}
// CHECKSTYLE:OFF
final Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>()
{
}
final Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>() {}
.getType());
// CHECKSTYLE:ON
@@ -28,7 +28,6 @@
*/
package net.runelite.client.plugins.suppliestracker;
import com.google.inject.Provides;
import java.awt.image.BufferedImage;
import java.util.ArrayDeque;
@@ -153,9 +153,7 @@ public class ClockManager
if (!Strings.isNullOrEmpty(timersJson))
{
final Gson gson = new Gson();
final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>()
{
}.getType());
final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>() {}.getType());
this.timers.clear();
this.timers.addAll(timers);
@@ -170,9 +168,7 @@ public class ClockManager
if (!Strings.isNullOrEmpty(stopwatchesJson))
{
final Gson gson = new Gson();
final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>()
{
}.getType());
final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>() {}.getType());
this.stopwatches.clear();
this.stopwatches.addAll(stopwatches);
@@ -136,9 +136,7 @@ public class WikiSearchChatboxTextInput extends ChatboxTextInput
try
{
JsonArray jar = new JsonParser().parse(body).getAsJsonArray();
List<String> apredictions = gson.fromJson(jar.get(1), new TypeToken<List<String>>()
{
}.getType());
List<String> apredictions = gson.fromJson(jar.get(1), new TypeToken<List<String>>() {}.getType());
if (apredictions.size() > MAX_NUM_PREDICTIONS)
{
@@ -9,7 +9,6 @@
package net.runelite.client.plugins.wildernesslocations;
import com.google.inject.Provides;
import java.awt.Color;
import javax.inject.Inject;
@@ -32,6 +32,7 @@ import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.Shape;
import java.util.List;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.AnimationID;
import net.runelite.api.Client;
@@ -40,8 +41,6 @@ import net.runelite.api.GraphicsObject;
import net.runelite.api.Perspective;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import javax.inject.Inject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -31,8 +31,6 @@ public class HiscorePanelTest
@Test
public void testConstructor()
{
new HiscorePanel(new HiscorePlugin()
{
});
new HiscorePanel(new HiscorePlugin() {});
}
}
@@ -32,7 +32,6 @@ import net.runelite.api.ItemID;
import net.runelite.api.Skill;
import net.runelite.api.Varbits;
import net.runelite.client.plugins.maxhit.calculators.MagicMaxHitCalculator;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -36,7 +36,6 @@ import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.plugins.attackstyles.WeaponType;
import net.runelite.client.plugins.maxhit.calculators.MeleeMaxHitCalculator;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -36,7 +36,6 @@ import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.plugins.maxhit.attackstyle.WeaponType;
import net.runelite.client.plugins.maxhit.calculators.RangeMaxHitCalculator;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -31,7 +31,4 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR})
public @interface Inject
{
}
public @interface Inject {}
@@ -24,18 +24,17 @@
*/
package net.runelite.mixins;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.runelite.api.Client;
import static net.runelite.api.Opcodes.RUNELITE_EXECUTE;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.widgets.JavaScriptCallback;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.runelite.api.mixins.Copy;
import net.runelite.api.mixins.Inject;
import net.runelite.api.mixins.Mixin;
import net.runelite.api.mixins.Replace;
import net.runelite.api.mixins.Shadow;
import net.runelite.api.widgets.JavaScriptCallback;
import net.runelite.rs.api.RSClient;
import net.runelite.rs.api.RSScript;
import net.runelite.rs.api.RSScriptEvent;
@@ -1,9 +1,8 @@
package net.runelite.mixins;
import net.runelite.api.Sprite;
import java.util.HashMap;
import java.util.Map;
import net.runelite.api.Sprite;
import net.runelite.api.mixins.Copy;
import net.runelite.api.mixins.Inject;
import net.runelite.api.mixins.Mixin;
@@ -1,6 +1,5 @@
package net.runelite.mixins;
import java.awt.Dimension;
import net.runelite.api.mixins.Copy;
import net.runelite.api.mixins.Mixin;
@@ -1,9 +1,8 @@
package net.runelite.mixins;
import net.runelite.api.Constants;
import java.awt.Container;
import java.awt.Dimension;
import net.runelite.api.Constants;
import net.runelite.api.mixins.Inject;
import net.runelite.api.mixins.Mixin;
import net.runelite.rs.api.RSClient;
@@ -34,18 +34,15 @@ import java.lang.annotation.Target;
* Inject a method to create and construct an object.
* The object type is inferred from the return value
* of the method.
*
*
* {@code
* {@literal @}Construct
* RSIndexedImage createIndexedImage();
* }
*
*
* @author Adam
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface Construct
{
}
public @interface Construct {}
@@ -1,5 +1,3 @@
package net.runelite.rs.api;
public interface RSCanvas
{
}
public interface RSCanvas {}
@@ -2,6 +2,4 @@ package net.runelite.rs.api;
import net.runelite.api.ClanMember;
public interface RSClanMate extends RSBuddy, ClanMember
{
}
public interface RSClanMate extends RSBuddy, ClanMember {}
@@ -24,6 +24,4 @@
*/
package net.runelite.rs.api;
public interface RSDecimator
{
}
public interface RSDecimator {}
@@ -1,5 +1,3 @@
package net.runelite.rs.api;
public interface RSFont extends RSAbstractFont
{
}
public interface RSFont extends RSAbstractFont {}

Some files were not shown because too many files have changed in this diff Show More