Cleaned up code

This commit is contained in:
mathias 2021-08-19 17:31:13 +02:00
parent e88169147c
commit e58d96b58a
No known key found for this signature in database
GPG Key ID: 8950DF62139C852A
3 changed files with 4 additions and 3 deletions

View File

@ -40,6 +40,7 @@ public class TableFactory {
/**
* Gets a storage medium from the list
*
* @param storageClass The class of the storage medium you want to get
* @return the storage medium
*/

View File

@ -135,9 +135,7 @@ public class DataBaseSelection {
messageBuilder.append((added.get()) ? ", " : "").append(v);
added.set(true);
});
StackTraceElement[] st = Thread.currentThread().getStackTrace();
StackTraceElement stack = st[st.length - 1];
LOG.debug("DEBUG <" + stack.getFileName() + ":" + stack.getLineNumber() + "> Statement: " + messageBuilder);
LOG.debug("Statement: " + messageBuilder);
return this;
}

View File

@ -167,11 +167,13 @@ public class UpdateManager {
sb.append("UPDATE ").append(tableName);
if (!setList.isEmpty()) sb.append(" SET ");
AtomicBoolean used = new AtomicBoolean(false);
setList.forEach((str, obj) -> {
if (used.get()) sb.append(", ");
sb.append(str).append(" = ?");
used.set(true);
});
if (!whereList.isEmpty()) sb.append(" WHERE ");
AtomicBoolean used2 = new AtomicBoolean(false);
whereList.forEach((str, obj) -> {