[ 
https://issues.apache.org/jira/browse/MENFORCER-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17849536#comment-17849536
 ] 

ASF GitHub Bot commented on MENFORCER-503:
------------------------------------------

slawekjaranowski merged PR #315:
URL: https://github.com/apache/maven-enforcer/pull/315




> requireOS cause NPE with Maven 3.9.7
> ------------------------------------
>
>                 Key: MENFORCER-503
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-503
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>          Components: requireOS
>            Reporter: Slawomir Jaranowski
>            Assignee: Slawomir Jaranowski
>            Priority: Critical
>             Fix For: 3.5.0
>
>
> In rule {{requireOS}} we use: 
> {{org.apache.maven.model.profile.activation.ProfileActivator#isActive}}
> as
> {code:java}
> activator.isActive(createProfile(), null, null); 
> {code}
> so provided {{context}} is null ... but not Maven use {{context}} without 
> protecting it
>  
> From docs:
> {code:java}
> /**
>  * Determines whether the specified profile is active in the given activator 
> context.
>  *
>  * @param profile The profile whose activation status should be determined, 
> must not be {@code null}.
>  * @param context The environmental context used to determine the activation 
> status of the profile, must not be
>  *            {@code null}.
>  * @param problems The container used to collect problems (e.g. bad syntax) 
> that were encountered, must not be
>  *            {@code null}.
>  * @return {@code true} if the profile is active, {@code false} otherwise.
>  */
> boolean isActive( Profile profile, ProfileActivationContext context, 
> ModelProblemCollector problems ); {code}
>  
> So enforcer use it in wrong way.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to