gnodet commented on code in PR #11922:
URL: https://github.com/apache/maven/pull/11922#discussion_r3284326790
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java:
##########
@@ -1398,7 +1398,7 @@ private Model readEffectiveModel() throws
ModelBuilderException {
// path correctly if it was not set in the input model
if (inputModel.getParent() != null &&
inputModel.getParent().getRelativePath() == null) {
String relPath;
- if (parentModel.getPomFile() != null && isBuildRequest()) {
+ if (parentModel.getPomFile() != null &&
inputModel.getPomFile() != null && isBuildRequest()) {
Review Comment:
The null check is correct and matches the existing `parentModel.getPomFile()
!= null` guard.
Nit: since `isBuildRequest()` is a simple boolean and both `getPomFile()`
calls involve virtual dispatch, you could reorder for marginally faster
short-circuiting in the non-build-request case:
```suggestion
if (isBuildRequest() && parentModel.getPomFile() != null &&
inputModel.getPomFile() != null) {
```
Not a blocker — just a thought.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]