Skip to content

Commit

Permalink
Remove various warnings for this-escape when using Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
Spider-Admin committed Nov 9, 2024
1 parent 7fd3bd5 commit 25be3e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/spider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public Boolean getBoolean(String key) {
return Boolean.valueOf(getString(key));
}

public Charset getCharset() {
public final Charset getCharset() {
return StandardCharsets.UTF_8;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/spider/TaskManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 Spider-Admin@Z+d9Knmjd3hQeeZU6BOWPpAAxxs
Copyright 2023 - 2024 Spider-Admin@Z+d9Knmjd3hQeeZU6BOWPpAAxxs
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -97,7 +97,7 @@ public String getDefaultTask() {
return defaultTask.toString();
}

public Connection getConnection() {
public final Connection getConnection() {
return connection;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/spider/data/Key.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 - 2023 Spider-Admin@Z+d9Knmjd3hQeeZU6BOWPpAAxxs
Copyright 2020 - 2024 Spider-Admin@Z+d9Knmjd3hQeeZU6BOWPpAAxxs
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,7 +67,7 @@ public Key(String key, Long edition, Long editionHint) {
this(key, edition, editionHint, "");
}

private void updateKeyParts() {
private final void updateKeyParts() {
keyOnly = "";
sitePath = "";
folder = "";
Expand Down Expand Up @@ -101,7 +101,7 @@ public String getKey() {
return key;
}

public Boolean isUSK() {
public final Boolean isUSK() {
return key != null && key.startsWith("USK@");
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/spider/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ private void updateDatebase(Integer version) throws SQLException {
}
}

public Integer getDatabaseVersion() throws SQLException {
public final Integer getDatabaseVersion() throws SQLException {
Integer result = -1;
getDatabaseVersion = Database.prepareStatement(connection, getDatabaseVersion, SELECT_DATABASE_VERSION_SQL);
try (ResultSet resultSet = getDatabaseVersion.executeQuery()) {
Expand Down Expand Up @@ -677,7 +677,7 @@ public void resetHighlight(Key key) throws SQLException {
resetHighlight.executeUpdate();
}

public ArrayList<Task> getTaskList() throws SQLException {
public final ArrayList<Task> getTaskList() throws SQLException {
ArrayList<Task> taskList = new ArrayList<>();
getTaskList = Database.prepareStatement(connection, getTaskList, GET_TASK_LIST_SQL);
Database.setBoolean(getTaskList, 1, true);
Expand Down Expand Up @@ -746,7 +746,7 @@ public void finishCurrentTask() throws SQLException {
}
}

public void resetTaskList() throws SQLException {
public final void resetTaskList() throws SQLException {
ArrayList<Task> list = getTaskList();
setCurrentTask(list.get(0));
}
Expand Down

0 comments on commit 25be3e3

Please sign in to comment.