Some minor improvements from static analysis

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2017-11-07 17:28:28 +11:00
parent 2a82e16c61
commit 417599c2ab
15 changed files with 44 additions and 56 deletions

View File

@@ -30,7 +30,7 @@ public final class NumberConversions {
}
try {
return Integer.valueOf(object.toString());
return Integer.parseInt(object.toString());
} catch (NumberFormatException e) {
} catch (NullPointerException e) {
}
@@ -43,7 +43,7 @@ public final class NumberConversions {
}
try {
return Float.valueOf(object.toString());
return Float.parseFloat(object.toString());
} catch (NumberFormatException e) {
} catch (NullPointerException e) {
}
@@ -56,7 +56,7 @@ public final class NumberConversions {
}
try {
return Double.valueOf(object.toString());
return Double.parseDouble(object.toString());
} catch (NumberFormatException e) {
} catch (NullPointerException e) {
}
@@ -69,7 +69,7 @@ public final class NumberConversions {
}
try {
return Long.valueOf(object.toString());
return Long.parseLong(object.toString());
} catch (NumberFormatException e) {
} catch (NullPointerException e) {
}
@@ -82,7 +82,7 @@ public final class NumberConversions {
}
try {
return Short.valueOf(object.toString());
return Short.parseShort(object.toString());
} catch (NumberFormatException e) {
} catch (NullPointerException e) {
}
@@ -95,7 +95,7 @@ public final class NumberConversions {
}
try {
return Byte.valueOf(object.toString());
return Byte.parseByte(object.toString());
} catch (NumberFormatException e) {
} catch (NullPointerException e) {
}

View File

@@ -41,7 +41,7 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator {
{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0},
{2, 0, 1, 3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {3, 0, 1, 2}, {3, 0, 2, 1}, {0, 0, 0, 0}, {3, 1, 2, 0},
{2, 1, 0, 3}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {3, 1, 0, 2}, {0, 0, 0, 0}, {3, 2, 0, 1}, {3, 2, 1, 0}};
protected static double offsetW;
protected double offsetW;
private static final SimplexNoiseGenerator instance = new SimplexNoiseGenerator();
protected SimplexNoiseGenerator() {