Skip to content

Commit 94a2311

Browse files
committed
clean up
1 parent c6959b7 commit 94a2311

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/main/java/org/maxgamer/quickshop/api/database/WarpedResultSet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.sql.SQLException;
2424

2525
public interface WarpedResultSet extends AutoCloseable {
26+
@Override
2627
void close() throws SQLException;
2728

2829
ResultSet getResultSet();

src/main/java/org/maxgamer/quickshop/localization/text/distributions/crowdin/CrowdinOTA.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,15 @@ public List<String> getAvailableFiles() {
149149
public String getFile(String fileCrowdinPath, String crowdinLocale, boolean forceFlush) throws Exception {
150150
Manifest manifest = getManifest();
151151
// Validate
152-
if (manifest == null)
152+
if (manifest == null) {
153153
throw new IllegalStateException("Failed to get project manifest");
154-
if (!manifest.getFiles().contains(fileCrowdinPath))
154+
}
155+
if (!manifest.getFiles().contains(fileCrowdinPath)) {
155156
throw new IllegalArgumentException("The file " + fileCrowdinPath + " not exists on Crowdin");
156-
if (manifest.getCustomLanguages() != null && !manifest.getCustomLanguages().contains(crowdinLocale))
157+
}
158+
if (manifest.getCustomLanguages() != null && !manifest.getCustomLanguages().contains(crowdinLocale)) {
157159
throw new IllegalArgumentException("The locale " + crowdinLocale + " not exists on Crowdin");
160+
}
158161
// Post path (replaced with locale code)
159162
String postProcessingPath = fileCrowdinPath.replace("%locale%", crowdinLocale);
160163
// Create path hash to store the file

src/main/java/org/maxgamer/quickshop/util/config/ConfigurationUpdater.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ public void update() {
4040
try {
4141
ConfigUpdater configUpdater = updateScript.getAnnotation(ConfigUpdater.class);
4242
int current = getConfig().getInt("config-version");
43-
if (current >= configUpdater.version())
43+
if (current >= configUpdater.version()) {
4444
continue;
45+
}
4546
Util.debugLog("Executing " + updateScript.getName() + " for version " + configUpdater.version());
46-
if (updateScript.getParameterCount() == 0)
47+
if (updateScript.getParameterCount() == 0) {
4748
updateScript.invoke(this);
48-
if (updateScript.getParameterCount() == 1 && (updateScript.getParameterTypes()[0] == int.class || updateScript.getParameterTypes()[0] == Integer.class))
49+
}
50+
if (updateScript.getParameterCount() == 1 && (updateScript.getParameterTypes()[0] == int.class || updateScript.getParameterTypes()[0] == Integer.class)) {
4951
updateScript.invoke(this, current);
52+
}
5053
getConfig().set("config-version", configUpdater.version() + 1);
5154
} catch (Throwable throwable) {
5255
plugin.getLogger().log(Level.WARNING, "Failed execute update script " + updateScript.getName() + " for updating to version " + updateScript.getAnnotation(ConfigUpdater.class).version() + ", some configuration options may missing or outdated", throwable);
@@ -58,8 +61,9 @@ public void update() {
5861
public List<Method> getUpdateScripts() {
5962
List<Method> methods = new ArrayList<>();
6063
for (Method declaredMethod : this.getClass().getDeclaredMethods()) {
61-
if (declaredMethod.getAnnotation(ConfigUpdater.class) == null)
64+
if (declaredMethod.getAnnotation(ConfigUpdater.class) == null) {
6265
continue;
66+
}
6367
methods.add(declaredMethod);
6468
}
6569
methods.sort(Comparator.comparingInt(o -> o.getAnnotation(ConfigUpdater.class).version()));

0 commit comments

Comments
 (0)