You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/03/13 18:36:00 UTC
[jira] [Commented] (MNG-7678) Settings (v3) and Settings.Builder() cannot unset a non-null field
[ https://issues.apache.org/jira/browse/MNG-7678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699788#comment-17699788 ]
ASF GitHub Bot commented on MNG-7678:
-------------------------------------
gnodet merged PR #983:
URL: https://github.com/apache/maven/pull/983
> Settings (v3) and Settings.Builder() cannot unset a non-null field
> ------------------------------------------------------------------
>
> Key: MNG-7678
> URL: https://issues.apache.org/jira/browse/MNG-7678
> Project: Maven
> Issue Type: Bug
> Components: Core, Settings
> Affects Versions: 4.0.0-alpha-4
> Reporter: James Z.M. Gao
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.0.0-alpha-5
>
>
>
> Testing code:
> {noformat}
> final Settings s = new Settings();
> s.setLocalRepository("xxx");
> assertEquals("xxx", s.getLocalRepository()); // OK
> s.setLocalRepository("yyy");
> assertEquals("yyy", s.getLocalRepository()); // OK
> s.setLocalRepository(null);
> assertNull(s.getLocalRepository()); // FAIL{noformat}
>
> It seems related to the the build() method of Model Builder with forceCopy = false :
>
> {noformat}
> ${field.name} != null ? ${field.name} : ( base != null ? base.${field.name} : null )${sep}
> {noformat}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)