Enable PMD rule UnnecessaryModifier and fix violations

This commit is contained in:
Manuel Fuhr 2022-11-13 16:04:56 +01:00
parent b68f1587b2
commit 5f942cc458
6 changed files with 19 additions and 20 deletions

View file

@ -6,11 +6,11 @@ public interface TagValueValidator {
* @param tagValueSet the way description to check * @param tagValueSet the way description to check
* @return 0 = nothing, 1=no matching, 2=normal * @return 0 = nothing, 1=no matching, 2=normal
*/ */
public int accessType(byte[] tagValueSet); int accessType(byte[] tagValueSet);
public byte[] unify(byte[] tagValueSet, int offset, int len); byte[] unify(byte[] tagValueSet, int offset, int len);
public boolean isLookupIdxUsed(int idx); boolean isLookupIdxUsed(int idx);
public void setDecodeForbidden(boolean decodeForbidden); void setDecodeForbidden(boolean decodeForbidden);
} }

View file

@ -7,16 +7,16 @@ package btools.mapaccess;
public interface OsmPos { public interface OsmPos {
public int getILat(); int getILat();
public int getILon(); int getILon();
public short getSElev(); short getSElev();
public double getElev(); double getElev();
public int calcDistance(OsmPos p); int calcDistance(OsmPos p);
public long getIdFromPos(); long getIdFromPos();
} }

View file

@ -37,7 +37,7 @@ public final class MixCoderDataInputStream extends DataInputStream {
return lastValue; return lastValue;
} }
public final boolean decodeBit() throws IOException { public boolean decodeBit() throws IOException {
fillBuffer(); fillBuffer();
boolean value = ((b & 1) != 0); boolean value = ((b & 1) != 0);
b >>>= 1; b >>>= 1;
@ -45,7 +45,7 @@ public final class MixCoderDataInputStream extends DataInputStream {
return value; return value;
} }
public final int decodeVarBits2() throws IOException { public int decodeVarBits2() throws IOException {
int range = 0; int range = 0;
while (!decodeBit()) { while (!decodeBit()) {
range = 2 * range + 1; range = 2 * range + 1;
@ -58,7 +58,7 @@ public final class MixCoderDataInputStream extends DataInputStream {
* *
* @see #encodeBounded * @see #encodeBounded
*/ */
public final int decodeBounded(int max) throws IOException { public int decodeBounded(int max) throws IOException {
int value = 0; int value = 0;
int im = 1; // integer mask int im = 1; // integer mask
while ((value | im) <= max) { while ((value | im) <= max) {
@ -75,7 +75,7 @@ public final class MixCoderDataInputStream extends DataInputStream {
* @see #encodeVarBits * @see #encodeVarBits
*/ */
public final int decodeVarBits() throws IOException { public int decodeVarBits() throws IOException {
fillBuffer(); fillBuffer();
int b12 = b & 0xfff; int b12 = b & 0xfff;
int len = vl_length[b12]; int len = vl_length[b12];

View file

@ -59,7 +59,7 @@ public final class MixCoderDataOutputStream extends DataOutputStream {
} }
} }
public final void encodeBit(boolean value) throws IOException { public void encodeBit(boolean value) throws IOException {
if (bm == 0x100) { if (bm == 0x100) {
writeByte((byte) b); writeByte((byte) b);
bm = 1; bm = 1;
@ -71,7 +71,7 @@ public final class MixCoderDataOutputStream extends DataOutputStream {
bm <<= 1; bm <<= 1;
} }
public final void encodeVarBits(int value) throws IOException { public void encodeVarBits(int value) throws IOException {
int range = 0; int range = 0;
while (value > range) { while (value > range) {
encodeBit(false); encodeBit(false);
@ -82,7 +82,7 @@ public final class MixCoderDataOutputStream extends DataOutputStream {
encodeBounded(range, value); encodeBounded(range, value);
} }
public final void encodeBounded(int max, int value) throws IOException { public void encodeBounded(int max, int value) throws IOException {
int im = 1; // integer mask int im = 1; // integer mask
while (im <= max) { while (im <= max) {
if (bm == 0x100) { if (bm == 0x100) {

View file

@ -2,7 +2,7 @@ package btools.util;
public interface ProgressListener { public interface ProgressListener {
public void updateProgress(String task, int progress); void updateProgress(String task, int progress);
public boolean isCanceled(); boolean isCanceled();
} }

View file

@ -34,7 +34,6 @@
<exclude name="SimplifyBooleanReturns" /> <exclude name="SimplifyBooleanReturns" />
<exclude name="UncommentedEmptyConstructor" /> <exclude name="UncommentedEmptyConstructor" />
<exclude name="UncommentedEmptyMethodBody" /> <exclude name="UncommentedEmptyMethodBody" />
<exclude name="UnnecessaryModifier" />
<exclude name="UnusedFormalParameter" /> <exclude name="UnusedFormalParameter" />
<exclude name="UnusedLocalVariable" /> <exclude name="UnusedLocalVariable" />
<exclude name="UnusedPrivateField" /> <exclude name="UnusedPrivateField" />