From c3a8ab3b0927331343c52b78e3ab0c16b8f84f57 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 30 Nov 2024 11:11:01 -0800 Subject: [PATCH] Stop using deprecated exception type --- .../hudson/plugins/promoted_builds/PromotionProcess.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java b/src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java index 1f8e0b6b..54411f01 100644 --- a/src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java +++ b/src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java @@ -1,6 +1,5 @@ package hudson.plugins.promoted_builds; -import antlr.ANTLRException; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.BulkChange; import hudson.EnvVars; @@ -249,7 +248,7 @@ public String getAssignedLabelString() { try { LabelExpression.parseExpression(assignedLabel); return assignedLabel; - } catch (ANTLRException e) { + } catch (IllegalArgumentException e) { // must be old label or host name that includes whitespace or other unsafe chars return LabelAtom.escape(assignedLabel); } @@ -651,7 +650,7 @@ public FormValidation doCheckLabelString(@QueryParameter String value) { return FormValidation.ok(); // nothing typed yet try { Label.parseExpression(value); - } catch (ANTLRException e) { + } catch (IllegalArgumentException e) { return FormValidation.error(e, Messages.JobPropertyImpl_LabelString_InvalidBooleanExpression(e.getMessage())); }