mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-01 04:51:34 +01:00
Removed imports
Fixed vulnerability issue with Pair Fixed database connection issue with MySQLDatabaseHandler
This commit is contained in:
parent
65d34f5842
commit
84e3ae3e8b
@ -1,7 +1,5 @@
|
|||||||
package us.tastybento.bskyblock.api.placeholders.hooks;
|
package us.tastybento.bskyblock.api.placeholders.hooks;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import us.tastybento.bskyblock.BSkyBlock;
|
||||||
import us.tastybento.bskyblock.api.commands.User;
|
import us.tastybento.bskyblock.api.commands.User;
|
||||||
import us.tastybento.bskyblock.api.placeholders.Placeholder;
|
import us.tastybento.bskyblock.api.placeholders.Placeholder;
|
||||||
|
@ -378,8 +378,6 @@ public class MySQLDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
InstantiationException, IllegalAccessException,
|
InstantiationException, IllegalAccessException,
|
||||||
IntrospectionException, InvocationTargetException, NoSuchMethodException {
|
IntrospectionException, InvocationTargetException, NoSuchMethodException {
|
||||||
|
|
||||||
// Try to connect to the database
|
|
||||||
try (Connection connection = databaseConnecter.createConnection()) {
|
|
||||||
// insertQuery is created in super from the createInsertQuery() method
|
// insertQuery is created in super from the createInsertQuery() method
|
||||||
try (PreparedStatement preparedStatement = connection.prepareStatement(insertQuery)) {
|
try (PreparedStatement preparedStatement = connection.prepareStatement(insertQuery)) {
|
||||||
// Get the uniqueId. As each class extends DataObject, it must have this method in it.
|
// Get the uniqueId. As each class extends DataObject, it must have this method in it.
|
||||||
@ -496,7 +494,6 @@ public class MySQLDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
|
|||||||
preparedStatement.executeBatch();
|
preparedStatement.executeBatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes values if required to go into a database.
|
* Serializes values if required to go into a database.
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
package us.tastybento.bskyblock.lists;
|
package us.tastybento.bskyblock.lists;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
|
||||||
import us.tastybento.bskyblock.api.placeholders.Placeholder;
|
|
||||||
import us.tastybento.bskyblock.api.placeholders.PlaceholderBuilder;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import us.tastybento.bskyblock.BSkyBlock;
|
||||||
|
import us.tastybento.bskyblock.api.placeholders.Placeholder;
|
||||||
|
import us.tastybento.bskyblock.api.placeholders.PlaceholderBuilder;
|
||||||
|
|
||||||
public class Placeholders {
|
public class Placeholders {
|
||||||
|
|
||||||
public static final Placeholder PLUGIN_NAME = new PlaceholderBuilder().identifier("bsb_plugin_name").value((user) -> BSkyBlock.getInstance().getDescription().getName()).build();
|
public static final Placeholder PLUGIN_NAME = new PlaceholderBuilder().identifier("bsb_plugin_name").value((user) -> BSkyBlock.getInstance().getDescription().getName()).build();
|
||||||
|
@ -2,8 +2,8 @@ package us.tastybento.bskyblock.util;
|
|||||||
|
|
||||||
|
|
||||||
public class Pair<X, Z> {
|
public class Pair<X, Z> {
|
||||||
public X x;
|
public final X x;
|
||||||
public Z z;
|
public final Z z;
|
||||||
|
|
||||||
public Pair(X x, Z z) {
|
public Pair(X x, Z z) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
@ -3,17 +3,19 @@
|
|||||||
*/
|
*/
|
||||||
package us.tastybento.bskyblock.database.mysql;
|
package us.tastybento.bskyblock.database.mysql;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import java.beans.IntrospectionException;
|
import java.beans.IntrospectionException;
|
||||||
import java.sql.Statement;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
Loading…
Reference in New Issue
Block a user