Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-11844

nullpointer in code generated by servicebuilder

    Details

      Description

      When defining a service like this

      <entity name="CalEventInvitation" ...
      <column name="calEventId" type="long" />
      <column name="inviteeUserId" type="Long" convert-null="false" />

      <finder name="CalEventIdAndInviteeUserId" return-type="CalEventInvitation">
      <finder-column name="calEventId" />
      <finder-column name="inviteeUserId" />
      </finder>
      ....
      </entity>

      ServiceBuilder will create a class called CalEventInvitationPersistenceImpl that contains the following lines

      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_CALEVENTIDANDINVITEEUSERID,
      new Object[]

      { new Long(calEventInvitationModelImpl.getOriginalCalEventId()), new Long(calEventInvitationModelImpl.getOriginalInviteeUserId()) }

      );

      Because originalInviteeUserId is a primitive wrapper type it's getter can return null and a nullpointerexception will be thrown in the above code in that case

        Attachments

          Activity

            People

            Assignee:
            michael.saechang Michael Saechang
            Reporter:
            jelmer Jelmer Kuperus (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              9 years, 15 weeks, 6 days ago

                Packages

                Version Package
                --Sprint 12/11
                6.1.0 CE RC1