Skip to content

Commit b54624a

Browse files
committed
refactor: remove commons-validator dependency
1 parent 9a819ed commit b54624a

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ dependencies {
4343
pluginVerifier()
4444
}
4545

46-
implementation(libs.commonsValidator) {
47-
exclude("commons-beanutils", "commons-beanutils")
48-
}
49-
5046
implementation(libs.jettison)
5147
implementation(libs.jsonSkema)
5248

gradle/libs.versions.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ intellijPlatform = "2.10.5"
44
grammarkit = "2022.3.2.2"
55
jettison = "1.5.4"
66
jsonSkema = "0.28.0"
7-
commonsValidator = "1.10.1"
87

98
[libraries]
109
jettison = { group = "org.codehaus.jettison", name = "jettison", version.ref = "jettison" }
1110
jsonSkema = { group = "com.github.erosb", name = "json-sKema", version.ref = "jsonSkema" }
12-
commonsValidator = { group = "commons-validator", name = "commons-validator", version.ref = "commonsValidator" }
1311

1412
[plugins]
1513
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }

src/main/java/com/github/lppedd/cc/configuration/CCMainConfigurableGui.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package com.github.lppedd.cc.configuration;
22

33
import static com.intellij.uiDesigner.core.GridConstraints.*;
4-
import static org.apache.commons.validator.routines.UrlValidator.NO_FRAGMENTS;
54

65
import java.awt.*;
76
import java.util.Map;
87

98
import javax.swing.*;
109

11-
import org.apache.commons.validator.routines.UrlValidator;
1210
import org.jetbrains.annotations.NotNull;
1311
import org.jetbrains.annotations.Nullable;
1412

@@ -235,7 +233,7 @@ private void finishUpComponents(
235233
private HyperlinkLabel buildTranslatorLabel() {
236234
final var name = CCBundle.getOrDefault("cc.translation.translator.name", "");
237235

238-
if (name.isEmpty()) {
236+
if (name.isBlank()) {
239237
return null;
240238
}
241239

@@ -245,16 +243,12 @@ private HyperlinkLabel buildTranslatorLabel() {
245243

246244
final var url = CCBundle.getOrDefault("cc.translation.translator.url", "");
247245

248-
if (url.isEmpty()) {
246+
if (url.isBlank()) {
249247
label.setText(CCBundle.get("cc.translation.text") + " " + name);
250248
} else {
251-
if (new UrlValidator(new String[] {"http", "https"}, NO_FRAGMENTS).isValid(url)) {
252-
final var hyperlink = "<hyperlink>" + name + "</hyperlink>";
253-
label.setTextWithHyperlink(CCBundle.get("cc.translation.text") + " " + hyperlink);
254-
label.setHyperlinkTarget(url);
255-
} else {
256-
label.setText(CCBundle.get("cc.translation.text") + " " + name);
257-
}
249+
final var hyperlink = "<hyperlink>" + name + "</hyperlink>";
250+
label.setTextWithHyperlink(CCBundle.get("cc.translation.text") + " " + hyperlink);
251+
label.setHyperlinkTarget(url);
258252
}
259253

260254
// Keep this here or it will be overwritten

0 commit comments

Comments
 (0)