From 55dcb51553c59b06b32e24a532757e568cbcebe7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 3 Oct 2022 10:24:05 +0100 Subject: [PATCH] Remove redundant catch of NoSuchMethodError See gh-340 --- .../internal/ExclusionConfiguringAction.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/spring/gradle/dependencymanagement/internal/ExclusionConfiguringAction.java b/src/main/java/io/spring/gradle/dependencymanagement/internal/ExclusionConfiguringAction.java index 34ae6b8..ae20b0f 100644 --- a/src/main/java/io/spring/gradle/dependencymanagement/internal/ExclusionConfiguringAction.java +++ b/src/main/java/io/spring/gradle/dependencymanagement/internal/ExclusionConfiguringAction.java @@ -122,13 +122,8 @@ private Configuration copyConfiguration() { DependencySet allDependencies = this.configuration.getAllDependencies(); Configuration configurationCopy = this.configurationContainer.newConfiguration(this.configurationConfigurer, allDependencies.toArray(new Dependency[allDependencies.size()])); - try { - DependencyConstraintSet constraints = this.configuration.getAllDependencyConstraints(); - configurationCopy.getDependencyConstraints().addAll(constraints); - } - catch (NoSuchMethodError ex) { - // Continue - } + DependencyConstraintSet constraints = this.configuration.getAllDependencyConstraints(); + configurationCopy.getDependencyConstraints().addAll(constraints); return configurationCopy; }