From 6c96281aa0aaa7430c760dd9060dfa9236f8bcc3 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 30 Nov 2024 11:27:24 -0800 Subject: [PATCH] Stop using deprecated exception type (#296) --- .../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())); }