mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
refactor: Tackle a few Semgrep and ErrorProne violations (#1520)
* refactor: Tackle a few Semgrep and ErrorProne violations * Address comments
This commit is contained in:
@ -6,7 +6,9 @@ import java.lang.annotation.RetentionPolicy;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Link {
|
||||
|
||||
Class clazz() default Link.class;
|
||||
//FAWE start - address rawtypes
|
||||
Class<?> clazz() default Link.class;
|
||||
//FAWE end
|
||||
|
||||
String value();
|
||||
|
||||
|
@ -192,8 +192,8 @@ public class TargetBlock {
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
@SuppressWarnings("StatementWithEmptyBody")
|
||||
public Location getTargetBlock() {
|
||||
//noinspection StatementWithEmptyBody
|
||||
while (getNextBlock() != null && !stopMask.test(targetPos)) {
|
||||
}
|
||||
return getCurrentBlock();
|
||||
@ -205,8 +205,8 @@ public class TargetBlock {
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
@SuppressWarnings("StatementWithEmptyBody")
|
||||
public Location getSolidTargetBlock() {
|
||||
//noinspection StatementWithEmptyBody
|
||||
while (getNextBlock() != null && !solidMask.test(targetPos)) {
|
||||
}
|
||||
return getCurrentBlock();
|
||||
|
@ -21,6 +21,7 @@ package com.sk89q.worldedit.util.logging;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Filter;
|
||||
import java.util.logging.Formatter;
|
||||
import java.util.logging.Level;
|
||||
@ -131,11 +132,7 @@ public class DynamicStreamHandler extends StreamHandler {
|
||||
Formatter formatter = this.formatter;
|
||||
if (handler != null) {
|
||||
return handler.getFormatter();
|
||||
} else if (formatter != null) {
|
||||
return formatter;
|
||||
} else {
|
||||
return new SimpleFormatter();
|
||||
}
|
||||
} else return Objects.requireNonNullElseGet(formatter, SimpleFormatter::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -340,6 +340,7 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
//FAWE end
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("RedundantCast")
|
||||
public Map<Property<?>, Object> getStates() {
|
||||
//FAWE end
|
||||
BlockType type = this.getBlockType();
|
||||
@ -348,7 +349,7 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
type.getPropertiesSet(),
|
||||
(Function<Property<?>, Object>) this::getState
|
||||
);
|
||||
//noinspection RedundantCast - This is required for compilation, etc.
|
||||
//This is required for compilation, etc.
|
||||
return Collections.unmodifiableMap((Map<Property<?>, Object>) map);
|
||||
//FAWE end
|
||||
}
|
||||
|
Reference in New Issue
Block a user