Clean up warnings

This commit is contained in:
Mike Primm 2018-09-01 19:59:06 -05:00
parent a18a1ddc06
commit 3ba5bd3166
9 changed files with 57 additions and 57 deletions

View File

@ -45,7 +45,6 @@ import org.dynmap.debug.Debugger;
import org.dynmap.exporter.DynmapExpCommands;
import org.dynmap.hdmap.HDBlockModels;
import org.dynmap.hdmap.HDBlockStateTextureMap;
import org.dynmap.hdmap.HDMapManager;
import org.dynmap.hdmap.TexturePack;
import org.dynmap.markers.MarkerAPI;
import org.dynmap.markers.impl.MarkerAPIImpl;

View File

@ -61,11 +61,9 @@ public class PlayerFaces {
private class LoadPlayerImages implements Runnable {
public final String playername;
public final String playerskinurl;
public final UUID playeruuid;
public LoadPlayerImages(String playername, String playerskinurl, UUID playeruuid) {
this.playername = playername;
this.playerskinurl = playerskinurl;
this.playeruuid = playeruuid;
}
public void run() {
boolean has_8x8 = storage.hasPlayerFaceImage(playername, FaceType.FACE_8X8);
@ -199,7 +197,6 @@ public class PlayerFaces {
DynmapBufferedImage.freeBufferedImage(face8x8);
img.flush();
/* TODO: signal update for player icon to client */
}
}
public PlayerFaces(DynmapCore core) {

View File

@ -78,9 +78,6 @@ public class IsoHDPerspective implements HDPerspective {
private boolean need_rawbiomedata = false;
private static final BlockStep [] semi_steps = { BlockStep.Y_PLUS, BlockStep.X_MINUS, BlockStep.X_PLUS, BlockStep.Z_MINUS, BlockStep.Z_PLUS };
private DynmapBlockState full_water = null;
private RenderPatch full_water_patch = null;
private class OurPerspectiveState implements HDPerspectiveState {
DynmapBlockState blocktype = DynmapBlockState.AIR;

View File

@ -129,13 +129,6 @@ public class FenceWallBlockStateRenderer extends CustomRenderer {
list.clear();
}
}
private static int[][] sides = {
{ 1, 0, 0, SIDE_XP },
{ -1, 0, 0, SIDE_XN },
{ 0, 0, 1, SIDE_ZP },
{ 0, 0, -1, SIDE_ZN }
};
@Override
public RenderPatch[] getRenderPatchList(MapDataContext ctx) {

View File

@ -1,21 +1,10 @@
package org.dynmap.hdmap.renderer;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Map;
import org.dynmap.renderer.CustomRenderer;
import org.dynmap.renderer.DynmapBlockState;
import org.dynmap.renderer.MapDataContext;
import org.dynmap.renderer.RenderPatch;
import org.dynmap.renderer.RenderPatchFactory;
import org.dynmap.renderer.RenderPatchFactory.SideVisible;
// v1.13+ redstone wire renderer
public class RedstoneWireStateRenderer extends RedstoneWireRenderer {
private static final int x_off[] = { -1, 1, 0, 0 };
private static final int z_off[] = { 0, 0, -1, 1 };
@Override
public RenderPatch[] getRenderPatchList(MapDataContext ctx) {
int idx = ctx.getBlockType().stateIndex;

View File

@ -22,7 +22,6 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.OutputStream;
public class MapStorageResourceHandler extends AbstractHandler {

View File

@ -781,19 +781,22 @@ public class MariaDBMapStorage extends MapStorage {
public boolean setMarkerImage(String markerid, BufferOutputStream encImage) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT IconName FROM " + tableMarkerIcons + " WHERE IconName=?;");
stmt.setString(1, markerid);
ResultSet rs = stmt.executeQuery();
rs = stmt.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (encImage == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return false;
@ -812,11 +815,12 @@ public class MariaDBMapStorage extends MapStorage {
stmt.setBinaryStream(2, new BufferInputStream(encImage.buf, encImage.len), encImage.len);
}
stmt.executeUpdate();
stmt.close();
} catch (SQLException x) {
Log.severe("Marker write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;
@ -851,19 +855,22 @@ public class MariaDBMapStorage extends MapStorage {
public boolean setMarkerFile(String world, String content) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT FileName FROM " + tableMarkerFiles + " WHERE FileName=?;");
stmt.setString(1, world);
ResultSet rs = stmt.executeQuery();
rs = stmt.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (content == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return false;
@ -882,11 +889,12 @@ public class MariaDBMapStorage extends MapStorage {
stmt.setBytes(2, content.getBytes(UTF8));
}
stmt.executeUpdate();
stmt.close();
} catch (SQLException x) {
Log.severe("Marker file write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;
@ -972,20 +980,23 @@ public class MariaDBMapStorage extends MapStorage {
public boolean setStandaloneFile(String fileid, BufferOutputStream content) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT FileName FROM " + tableStandaloneFiles + " WHERE FileName=? AND ServerID=?;");
stmt.setString(1, fileid);
stmt.setLong(2, serverID);
ResultSet rs = stmt.executeQuery();
rs = stmt.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (content == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return true;
@ -1007,11 +1018,12 @@ public class MariaDBMapStorage extends MapStorage {
stmt.setBinaryStream(3, new BufferInputStream(content.buf, content.len), content.len);
}
stmt.executeUpdate();
stmt.close();
} catch (SQLException x) {
Log.severe("Standalone file write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;

View File

@ -781,19 +781,22 @@ public class MySQLMapStorage extends MapStorage {
public boolean setMarkerImage(String markerid, BufferOutputStream encImage) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT IconName FROM " + tableMarkerIcons + " WHERE IconName=?;");
stmt.setString(1, markerid);
ResultSet rs = stmt.executeQuery();
rs = stmt.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (encImage == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return false;
@ -812,11 +815,12 @@ public class MySQLMapStorage extends MapStorage {
stmt.setBinaryStream(2, new BufferInputStream(encImage.buf, encImage.len), encImage.len);
}
stmt.executeUpdate();
stmt.close();
} catch (SQLException x) {
Log.severe("Marker write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;
@ -851,19 +855,21 @@ public class MySQLMapStorage extends MapStorage {
public boolean setMarkerFile(String world, String content) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT FileName FROM " + tableMarkerFiles + " WHERE FileName=?;");
stmt.setString(1, world);
ResultSet rs = stmt.executeQuery();
rs = stmt.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (content == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return false;
@ -882,11 +888,12 @@ public class MySQLMapStorage extends MapStorage {
stmt.setBytes(2, content.getBytes(UTF8));
}
stmt.executeUpdate();
stmt.close();
} catch (SQLException x) {
Log.severe("Marker file write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;
@ -972,20 +979,22 @@ public class MySQLMapStorage extends MapStorage {
public boolean setStandaloneFile(String fileid, BufferOutputStream content) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT FileName FROM " + tableStandaloneFiles + " WHERE FileName=? AND ServerID=?;");
stmt.setString(1, fileid);
stmt.setLong(2, serverID);
ResultSet rs = stmt.executeQuery();
rs = stmt.executeQuery();
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (content == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return true;
@ -1007,11 +1016,12 @@ public class MySQLMapStorage extends MapStorage {
stmt.setBinaryStream(3, new BufferInputStream(content.buf, content.len), content.len);
}
stmt.executeUpdate();
stmt.close();
} catch (SQLException x) {
Log.severe("Standalone file write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;

View File

@ -695,20 +695,21 @@ public class SQLiteMapStorage extends MapStorage {
public boolean setMarkerImage(String markerid, BufferOutputStream encImage) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT IconName FROM MarkerIcons WHERE IconName=?;");
stmt.setString(1, markerid);
//ResultSet rs = stmt.executeQuery();
ResultSet rs = doExecuteQuery(stmt);
rs = doExecuteQuery(stmt);
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (encImage == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return false;
@ -727,13 +728,15 @@ public class SQLiteMapStorage extends MapStorage {
stmt.setString(1, markerid);
stmt.setBytes(2, encImage.buf);
}
//stmt.executeUpdate();
doExecuteUpdate(stmt);
stmt.close();
stmt = null;
} catch (SQLException x) {
Log.severe("Marker write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;
@ -769,26 +772,26 @@ public class SQLiteMapStorage extends MapStorage {
public boolean setMarkerFile(String world, String content) {
Connection c = null;
boolean err = false;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
c = getConnection();
boolean exists = false;
PreparedStatement stmt;
stmt = c.prepareStatement("SELECT FileName FROM MarkerFiles WHERE FileName=?;");
stmt.setString(1, world);
//ResultSet rs = stmt.executeQuery();
ResultSet rs = doExecuteQuery(stmt);
rs = doExecuteQuery(stmt);
if (rs.next()) {
exists = true;
}
rs.close();
rs = null;
stmt.close();
stmt = null;
if (content == null) { // If delete
// If delete, and doesn't exist, quit
if (!exists) return false;
stmt = c.prepareStatement("DELETE FROM MarkerFiles WHERE FileName=?;");
stmt.setString(1, world);
//stmt.executeUpdate();
doExecuteUpdate(stmt);
}
else if (exists) {
@ -803,11 +806,12 @@ public class SQLiteMapStorage extends MapStorage {
}
//stmt.executeUpdate();
doExecuteUpdate(stmt);
stmt.close();
} catch (SQLException x) {
Log.severe("Marker file write error - " + x.getMessage());
err = true;
} finally {
if (rs != null) { try { rs.close(); } catch (SQLException sx) {} }
if (stmt != null) { try { stmt.close(); } catch (SQLException sx) {} }
releaseConnection(c, err);
}
return !err;