Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-186

StringSubstitutor map constructor throws NPE on 1.9 with null map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9, 1.10.0
    • 1.10.0
    • None

    Description

      Steps to reproduce

       

      Add a test to StringSubstitutorTest

          @Test
          public void testConstructorNullMap() {
              Map<String, Object> parameters = null;
              final StringSubstitutor s = new StringSubstitutor(parameters, "prefix", "suffix");
          }
      

       

      Test passes on 1.8. Fails on 1.9 . According to the javadoc, the map value is nullable - https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/StringSubstitutor.java#L445

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            kageiit Gautam Korlam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: