Skip to content

fix: remove dead code catch block for ArtifactNotFoundException - #113

Closed
prathamesh04 wants to merge 1 commit into
apache:masterfrom
prathamesh04:fix/dead-code-catch
Closed

fix: remove dead code catch block for ArtifactNotFoundException#113
prathamesh04 wants to merge 1 commit into
apache:masterfrom
prathamesh04:fix/dead-code-catch

Conversation

@prathamesh04

Copy link
Copy Markdown

Description

This PR fixes a dead code issue in ArtifactLocatorStrategy.java.

Problem

The ArtifactNotFoundException catch block (lines 165-168) was unreachable because ArtifactNotFoundException extends ArtifactResolutionException. The first catch block catches all instances, making the second catch block dead code.

Solution

Removed the dead catch block and the unused import for ArtifactNotFoundException.

Related Issue

Closes #92

Changes

  • src/main/java/org/apache/maven/shared/io/location/ArtifactLocatorStrategy.java: Removed dead catch block and unused import

The ArtifactNotFoundException catch block was unreachable because
ArtifactNotFoundException extends ArtifactResolutionException, which
is caught first. This removes the dead code and the unused import.

Closes apache#92
@elharo elharo closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArtifactLocatorStrategy: ArtifactNotFoundException catch block is dead code

2 participants