You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2023/02/04 15:15:00 UTC
[jira] [Assigned] (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:all-tabpanel ]
Guillaume Nodet reassigned MNG-7678:
------------------------------------
Assignee: Guillaume Nodet
> 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
>
>
> 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)