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

Exceptions incorrectly logged when operator NOT is used in a statement

    Details

    • Fix Priority:
      1

      Description

      Exception messages are incorrectly built in persistence_impl_finder_find.ftl methods using the negation operator. For example the following method is generated in JournalArticlePersistenceImpl:

       

      /**
       * Returns the first journal article in the ordered set where companyId = ? and status ≠ ?.
       *
       * @param companyId the company ID
       * @param status the status
       * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
       * @return the first matching journal article
       * @throws NoSuchArticleException if a matching journal article could not be found
       */
       @Override
       public JournalArticle findByC_NotST_First(long companyId, int status,
       OrderByComparator<JournalArticle> orderByComparator)
       throws NoSuchArticleException {
      
          JournalArticle journalArticle = fetchByC_NotST_First(companyId, status,
             orderByComparator);
      
          if (journalArticle != null) {
            return journalArticle;
          }
      
          StringBundler msg = new StringBundler(6);
          msg.append(_NO_SUCH_ENTITY_WITH_KEY);
          msg.append("companyId=");
          msg.append(companyId);
          msg.append(", status=");
          msg.append(status);
          msg.append("}");
       
          throw new NoSuchArticleException(msg.toString());
       }
      

       

      (Current behaviour):

      Resulting in a exception message like this when there is not an article with a status different than the specified one:

      No JournalArticle exists with the key {groupId=23952, articleId=/1067002, status=8}

        

      Expected behaviour: Messages generated by these kind of methods should look like:

      No JournalArticle exists with the key {groupId=23952, articleId=/1067002, status!=8}

        Attachments

          Activity

            People

            • Assignee:
              cristina.rodriguez Cristina Rodriguez
              Reporter:
              cristina.rodriguez Cristina Rodriguez
              Participants of an Issue:
              Recent user:
              Cristina Rodriguez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                23 weeks, 3 days ago

                Packages

                Version Package