mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-03 14:01:47 +01:00
Fix two sonarcloud issues. (#1936)
- Field can be static - Unused import
This commit is contained in:
parent
2fbfdfa0e9
commit
41e844cca1
@ -29,7 +29,6 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
@ -53,7 +53,7 @@ public class PlanCommand {
|
||||
private final ImportSystem importSystem;
|
||||
private final ErrorLogger errorLogger;
|
||||
|
||||
private final String DB_ARG_OPTIONS = "MySQL/SQLite";
|
||||
private static final String DB_ARG_OPTIONS = "MySQL/SQLite";
|
||||
|
||||
@Inject
|
||||
public PlanCommand(
|
||||
|
@ -80,7 +80,8 @@ public class Contributors {
|
||||
new Contributor("10935336", LANG),
|
||||
new Contributor("EyuphanMandiraci", LANG),
|
||||
new Contributor("4drian3d", LANG),
|
||||
new Contributor("\u6d1b\u4f0a", LANG)
|
||||
new Contributor("\u6d1b\u4f0a", LANG),
|
||||
new Contributor("portlek", CODE)
|
||||
};
|
||||
|
||||
private Contributors() {
|
||||
|
@ -36,6 +36,8 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class Locale extends HashMap<Lang, Message> {
|
||||
|
||||
private static final Pattern FIND_SCRIPT = Pattern.compile("(<script id=[\"|'].*[\"|']>[\\s\\S]*?</script>|<script>[\\s\\S]*?</script>|<script src=[\"|'].*[\"|']></script>|<link [\\s\\S]*?>)");
|
||||
|
||||
public static Locale forLangCodeString(PlanFiles files, String code) throws IOException {
|
||||
return forLangCode(LangCode.fromString(code), files);
|
||||
}
|
||||
@ -111,9 +113,7 @@ public class Locale extends HashMap<Lang, Message> {
|
||||
return from;
|
||||
}
|
||||
|
||||
Pattern scripts = Pattern.compile("(<script id=[\"|'].*[\"|']>[\\s\\S]*?</script>|<script>[\\s\\S]*?</script>|<script src=[\"|'].*[\"|']></script>|<link [\\s\\S]*?>)");
|
||||
|
||||
Matcher scriptMatcher = scripts.matcher(from);
|
||||
Matcher scriptMatcher = FIND_SCRIPT.matcher(from);
|
||||
List<String> foundScripts = new ArrayList<>();
|
||||
while (scriptMatcher.find()) {
|
||||
foundScripts.add(scriptMatcher.toMatchResult().group(0));
|
||||
@ -132,7 +132,7 @@ public class Locale extends HashMap<Lang, Message> {
|
||||
|
||||
StringBuilder complete = new StringBuilder(translated.length());
|
||||
|
||||
String[] parts = scripts.split(translated.toString());
|
||||
String[] parts = FIND_SCRIPT.split(translated.toString());
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
complete.append(parts[i]);
|
||||
if (i < parts.length - 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user