Skip to content

Commit 8ab1c6b

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

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
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 & 12 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

@@ -230,12 +228,11 @@ private void finishUpComponents(
230228
defaultsPanel.add(JBUI.Borders.emptyTop(7).wrap(defaultTokensPanel), gc);
231229
}
232230

233-
@SuppressWarnings("ConstantExpression")
234231
@Nullable
235232
private HyperlinkLabel buildTranslatorLabel() {
236233
final var name = CCBundle.getOrDefault("cc.translation.translator.name", "");
237234

238-
if (name.isEmpty()) {
235+
if (name.isBlank()) {
239236
return null;
240237
}
241238

@@ -245,16 +242,12 @@ private HyperlinkLabel buildTranslatorLabel() {
245242

246243
final var url = CCBundle.getOrDefault("cc.translation.translator.url", "");
247244

248-
if (url.isEmpty()) {
245+
if (url.isBlank()) {
249246
label.setText(CCBundle.get("cc.translation.text") + " " + name);
250247
} 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-
}
248+
final var hyperlink = "<hyperlink>" + name + "</hyperlink>";
249+
label.setTextWithHyperlink(CCBundle.get("cc.translation.text") + " " + hyperlink);
250+
label.setHyperlinkTarget(url);
258251
}
259252

260253
// Keep this here or it will be overwritten

0 commit comments

Comments
 (0)