11package com .github .lppedd .cc .configuration ;
22
33import static com .intellij .uiDesigner .core .GridConstraints .*;
4- import static org .apache .commons .validator .routines .UrlValidator .NO_FRAGMENTS ;
54
65import java .awt .*;
76import java .util .Map ;
87
98import javax .swing .*;
109
11- import org .apache .commons .validator .routines .UrlValidator ;
1210import org .jetbrains .annotations .NotNull ;
1311import 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