Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6845

Some methods in MessageUtils prone to NPE

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.9
    • 3.0.10, 3.1.7, 3.2.0
    • None
    • None
    • Unknown

    Description

      When attempting to upgrade Syncope 1.2 from CXF 3.0.8 to 3.0.9, I receive NPE due to some methods in MessageUtils - see for example

          public static boolean getContextualBoolean(Message m, String key, boolean defaultValue) {
              Object o = m.getContextualProperty(key);
              if (o != null) {
                  return PropertyUtils.isTrue(o);
              }
              return defaultValue;
          }
      

      As you can see, if m is NULL, NPE is thrown.

      See for reference the same method from 3.1.6:

          public static boolean getContextualBoolean(Message m, String key, boolean defaultValue) {
              if (m != null) {
                  Object o = m.getContextualProperty(key);
                  if (o != null) {
                      return PropertyUtils.isTrue(o);
                  }
              }
              return defaultValue;
          }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ilgrosso Francesco Chicchiriccò
            ilgrosso Francesco Chicchiriccò
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment