client: update pmd

This commit is contained in:
Adam
2022-04-24 11:49:53 -04:00
parent 6a4544ed2e
commit 36730dccbc
23 changed files with 53 additions and 51 deletions

View File

@@ -34,7 +34,7 @@ public class ChatMessageBuilder
public ChatMessageBuilder append(final ChatColorType type)
{
builder.append("<col").append(type.name()).append(">");
builder.append("<col").append(type.name()).append('>');
return this;
}

View File

@@ -447,7 +447,7 @@ class WidgetInspector extends DevToolsFrame
picker = parent.createChild(-1, WidgetType.GRAPHIC);
log.info("Picker is {}.{} [{}]", WidgetInfo.TO_GROUP(picker.getId()), WidgetInfo.TO_CHILD(picker.getId()), picker.getIndex());
log.info("Picker is {}.{} [{}]", TO_GROUP(picker.getId()), TO_CHILD(picker.getId()), picker.getIndex());
picker.setSpriteId(SpriteID.MOBILE_FINGER_ON_INTERFACE);
picker.setOriginalWidth(15);
@@ -521,7 +521,7 @@ class WidgetInspector extends DevToolsFrame
{
continue;
}
String name = WidgetInfo.TO_GROUP(entry.getParam1()) + "." + WidgetInfo.TO_CHILD(entry.getParam1());
String name = TO_GROUP(entry.getParam1()) + "." + TO_CHILD(entry.getParam1());
if (entry.getParam0() != -1)
{

View File

@@ -445,7 +445,7 @@ public class FishingPlugin extends Plugin
if (seconds < 10)
{
trawlerText.append("0");
trawlerText.append('0');
}
trawlerText.append(seconds);

View File

@@ -41,7 +41,6 @@ import jogamp.opengl.x11.glx.X11GLXContext;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.plugins.gpu.template.Template;
import net.runelite.client.util.OSType;
import org.jocl.CL;
import static org.jocl.CL.*;
import org.jocl.CLException;
import org.jocl.Pointer;
@@ -96,7 +95,7 @@ class OpenCLManager
void init(GL4 gl)
{
CL.setExceptionsEnabled(true);
setExceptionsEnabled(true);
switch (OSType.getOSType())
{
@@ -121,55 +120,55 @@ class OpenCLManager
{
if (programUnordered != null)
{
CL.clReleaseProgram(programUnordered);
clReleaseProgram(programUnordered);
programUnordered = null;
}
if (programSmall != null)
{
CL.clReleaseProgram(programSmall);
clReleaseProgram(programSmall);
programSmall = null;
}
if (programLarge != null)
{
CL.clReleaseProgram(programLarge);
clReleaseProgram(programLarge);
programLarge = null;
}
if (kernelUnordered != null)
{
CL.clReleaseKernel(kernelUnordered);
clReleaseKernel(kernelUnordered);
kernelUnordered = null;
}
if (kernelSmall != null)
{
CL.clReleaseKernel(kernelSmall);
clReleaseKernel(kernelSmall);
kernelSmall = null;
}
if (kernelLarge != null)
{
CL.clReleaseKernel(kernelLarge);
clReleaseKernel(kernelLarge);
kernelLarge = null;
}
if (commandQueue != null)
{
CL.clReleaseCommandQueue(commandQueue);
clReleaseCommandQueue(commandQueue);
commandQueue = null;
}
if (context != null)
{
CL.clReleaseContext(context);
clReleaseContext(context);
context = null;
}
if (device != null)
{
CL.clReleaseDevice(device);
clReleaseDevice(device);
device = null;
}
}

View File

@@ -829,7 +829,7 @@ public class GrandExchangePlugin extends Plugin
if (resetTime != null)
{
Duration remaining = Duration.between(Instant.now(), resetTime);
sb.append(" (").append(DurationFormatUtils.formatDuration(remaining.toMillis(), "H:mm")).append(")");
sb.append(" (").append(DurationFormatUtils.formatDuration(remaining.toMillis(), "H:mm")).append(')');
}
}

View File

@@ -246,7 +246,7 @@ public class GroundItemsOverlay extends Overlay
{
itemStringBuilder.append(" (")
.append(QuantityFormatter.quantityToStackSize(item.getQuantity()))
.append(")");
.append(')');
}
}

View File

@@ -663,7 +663,7 @@ public class GroundItemsPlugin extends Plugin
{
notificationStringBuilder.append(" (")
.append(QuantityFormatter.quantityToStackSize(item.getQuantity()))
.append(")");
.append(')');
}
}

View File

@@ -173,7 +173,7 @@ public class ItemStatOverlay extends Overlay
Duration highestDuration = durationRange.getHighestDuration();
if (lowestDuration != highestDuration)
{
sb.append("~");
sb.append('~');
sb.append(DurationFormatUtils.formatDuration(highestDuration.toMillis(), "m:ss"));
}
}
@@ -381,7 +381,7 @@ public class ItemStatOverlay extends Overlay
{
if (config.relative())
{
b.append("/");
b.append('/');
}
b.append(c.getFormattedTheoretical());
}
@@ -397,9 +397,9 @@ public class ItemStatOverlay extends Overlay
if (config.absolute() && (config.relative() || config.theoretical()))
{
b.append(")");
b.append(')');
}
b.append(" ").append(c.getStat().getName());
b.append(' ').append(c.getStat().getName());
b.append("</br>");
return b.toString();

View File

@@ -106,7 +106,7 @@ class Bookcase
b.append("Center");
}
b.append(" ");
b.append(' ');
switch (location.getPlane())
{
@@ -123,7 +123,7 @@ class Bookcase
if (KourendLibraryPlugin.debug)
{
b.append(" ").append(index.stream().map(Object::toString).collect(Collectors.joining(", ")));
b.append(' ').append(index.stream().map(Object::toString).collect(Collectors.joining(", ")));
}
return b.toString();
}

View File

@@ -79,7 +79,7 @@ class Library
Library()
{
populateBooks();
step = byIndex.size() / Book.values().length;
step = byIndex.size() / values().length;
reset();
}

View File

@@ -144,7 +144,7 @@ public class Raid
}
else
{
builder.append(" ");
builder.append(' ');
}
}

View File

@@ -83,7 +83,7 @@ class RunEnergyOverlay extends Overlay
if (config.replaceOrbText())
{
sb.append("Run Energy: ").append(client.getEnergy()).append("%");
sb.append("Run Energy: ").append(client.getEnergy()).append('%');
}
else
{

View File

@@ -106,7 +106,7 @@ public class RunepouchOverlay extends WidgetItemOverlay
tooltipBuilder
.append(amount)
.append(" ")
.append(' ')
.append(ColorUtil.wrapWithColorTag(rune.getName(), Color.YELLOW))
.append("</br>");

View File

@@ -855,7 +855,7 @@ public class SlayerPlugin extends Plugin
sb.append(task.getTask());
if (!Strings.isNullOrEmpty(task.getLocation()))
{
sb.append(" (").append(task.getLocation()).append(")");
sb.append(" (").append(task.getLocation()).append(')');
}
sb.append(": ");
if (killed < 0)

View File

@@ -82,7 +82,7 @@ public abstract class TabContentPanel extends JPanel
LocalDateTime currentTime = LocalDateTime.now();
if (endTime.getDayOfWeek() != currentTime.getDayOfWeek())
{
sb.append(endTime.getDayOfWeek().getDisplayName(TextStyle.SHORT, Locale.getDefault())).append(" ");
sb.append(endTime.getDayOfWeek().getDisplayName(TextStyle.SHORT, Locale.getDefault())).append(' ');
}
sb.append("at ");
sb.append(formatter.format(endTime));

View File

@@ -187,8 +187,8 @@ public class TimeTrackingPlugin extends Plugin
{
if (commandExecuted.getCommand().equals("resetfarmtick"))
{
configManager.unsetRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.FARM_TICK_OFFSET_PRECISION);
configManager.unsetRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.FARM_TICK_OFFSET);
configManager.unsetRSProfileConfiguration(CONFIG_GROUP, TimeTrackingConfig.FARM_TICK_OFFSET_PRECISION);
configManager.unsetRSProfileConfiguration(CONFIG_GROUP, TimeTrackingConfig.FARM_TICK_OFFSET);
}
}

View File

@@ -550,7 +550,7 @@ public class FarmingTracker
// Same RS account but different profile type
if (profileType != RuneScapeProfileType.getCurrent(client))
{
stringBuilder.append("(")
stringBuilder.append('(')
.append(Text.titleCase(profile.getType()))
.append(") ");
}
@@ -564,13 +564,13 @@ public class FarmingTracker
//Don't print profile type when logged out if is STANDARD
if (client.getGameState() == GameState.LOGIN_SCREEN && profileType == RuneScapeProfileType.STANDARD)
{
stringBuilder.append("(")
stringBuilder.append('(')
.append(profile.getDisplayName())
.append(") ");
}
else
{
stringBuilder.append("(")
stringBuilder.append('(')
.append(profile.getDisplayName())
.append(" - ")
.append(Text.titleCase(profile.getType()))
@@ -580,7 +580,7 @@ public class FarmingTracker
// Different RS account but same profile type
else
{
stringBuilder.append("(")
stringBuilder.append('(')
.append(profile.getDisplayName())
.append(") ");
}
@@ -616,7 +616,7 @@ public class FarmingTracker
stringBuilder.append(patch.getRegion().isDefinite() ? "the " : "")
.append(patch.getRegion().getName())
.append(".");
.append('.');
notifier.notify(stringBuilder.toString());
}

View File

@@ -100,7 +100,7 @@ public class TwitchIRCClient extends Thread implements AutoCloseable
return;
}
try
try // NOPMD: UseTryWithResources
{
register(username, password);
join(channel);

View File

@@ -105,7 +105,7 @@ public class OverlayUtil
public static void renderImageLocation(Client client, Graphics2D graphics, LocalPoint localPoint, BufferedImage image, int zOffset)
{
net.runelite.api.Point imageLocation = Perspective.getCanvasImageLocation(client, localPoint, image, zOffset);
Point imageLocation = Perspective.getCanvasImageLocation(client, localPoint, image, zOffset);
if (imageLocation != null)
{
renderImageLocation(graphics, imageLocation, image);
@@ -182,7 +182,7 @@ public class OverlayUtil
renderImageLocation(client, graphics, localLocation, image, 0);
}
public static void renderHoverableArea(Graphics2D graphics, Shape area, net.runelite.api.Point mousePosition, Color fillColor, Color borderColor, Color borderHoverColor)
public static void renderHoverableArea(Graphics2D graphics, Shape area, Point mousePosition, Color fillColor, Color borderColor, Color borderHoverColor)
{
if (area != null)
{

View File

@@ -182,12 +182,12 @@ public class LineComponent implements LayoutableRenderableEntity
if (wordLen + spaceWidth > spaceLeft)
{
wrapped.append("\n").append(word);
wrapped.append('\n').append(word);
spaceLeft = maxWidth - wordLen;
}
else
{
wrapped.append(" ").append(word);
wrapped.append(' ').append(word);
spaceLeft -= spaceWidth + wordLen;
}
}

View File

@@ -40,11 +40,11 @@ public class WorldUtil
*/
public static EnumSet<WorldType> toWorldTypes(final EnumSet<net.runelite.http.api.worlds.WorldType> apiTypes)
{
final EnumSet<net.runelite.api.WorldType> types = EnumSet.noneOf(net.runelite.api.WorldType.class);
final EnumSet<WorldType> types = EnumSet.noneOf(WorldType.class);
for (net.runelite.http.api.worlds.WorldType apiType : apiTypes)
{
types.add(net.runelite.api.WorldType.valueOf(apiType.name()));
types.add(WorldType.valueOf(apiType.name()));
}
return types;