Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7678

Settings (v3) and Settings.Builder() cannot unset a non-null field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0-alpha-4
    • 4.0.0-alpha-5, 4.0.0
    • Core, Settings
    • None

    Description

       

      Testing code:

          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

       

      It seems related to the the build() method of Model Builder with forceCopy = false :

       

      ${field.name} != null ? ${field.name} : ( base != null ? base.${field.name} : null )${sep}
      

       

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              gzm55 James Z.M. Gao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: