apache / apache/maven-mapping

Missing null check on artifact parameter in evaluateFileNameMapping

Open Beginner friendly
#62 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
2
Forks
7
Avg merge
11h 11m
Merged PRs (30d)
4

Description

## Description

`MappingUtils.evaluateFileNameMapping(String expression, Artifact artifact)` does not validate that the `artifact` parameter is non-null. If a caller passes `null`, a `NullPointerException` is thrown at lines 91-95 when calling `artifact.getArtifactHandler()` and `artifact.getClassifier()`.

## Expected behavior

A clear `NullPointerException` should be thrown with a descriptive message, rather than an opaque NPE deep in the call stack.

## Relevant code

`src/main/java/org/apache/maven/shared/mapping/MappingUtils.java:88-98`

Contributor guide

No contributing guide indexed for this repository

Research direction

Open src/main/java/org/apache/maven/shared/mapping/MappingUtils.java and start at evaluateFileNameMapping(String expression, Artifact artifact), around lines 88-98. Confirm the null artifact path and make sure a null argument produces a clear, descriptive NullPointerException rather than failing at artifact.getArtifactHandler() or artifact.getClassifier().

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.