This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch ex in repository https://gitbox.apache.org/repos/asf/maven.git
commit cceea99248879e9368fe65e6b4c41f3d799a41f8 Author: Elliotte Rusty Harold <elh...@ibiblio.org> AuthorDate: Mon Mar 31 08:13:14 2025 -0400 No catch block needed when rethrowing same exception --- .../maven/plugin/DefaultPluginDescriptorCache.java | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/impl/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java b/impl/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java index df5550517b..3371047c87 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java +++ b/impl/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java @@ -67,21 +67,17 @@ public PluginDescriptor get(Key cacheKey) { public PluginDescriptor get(Key key, PluginDescriptorSupplier supplier) throws PluginDescriptorParsingException, PluginResolutionException, InvalidPluginDescriptorException { - try { - PluginDescriptor desc = descriptors.get(key); - if (desc == null) { - synchronized (key) { - desc = descriptors.get(key); - if (desc == null) { - desc = supplier.load(); - descriptors.putIfAbsent(key, clone(desc)); - } + PluginDescriptor desc = descriptors.get(key); + if (desc == null) { + synchronized (key) { + desc = descriptors.get(key); + if (desc == null) { + desc = supplier.load(); + descriptors.putIfAbsent(key, clone(desc)); } } - return clone(desc); - } catch (PluginDescriptorParsingException | PluginResolutionException | InvalidPluginDescriptorException e) { - throw e; } + return clone(desc); } public void put(Key cacheKey, PluginDescriptor pluginDescriptor) {