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

Improve source formatter to flag swallowed(caught but not processing it) Portal/System exception

Details

    • 6.1.x
    • Committed

    Description

      Using exception throwing to do execution flow control is a very bad practice. Because creating exception needs to capture the current thread's call stack info, when the execution stack is very deep, capturing this info could cause significant overhead.

      For Portal/System Exception, things could get even worse, because we by default doing a transaction rollback at service layer on seeing them. You may actually rollback a tx even without knowing it, until later you can not see the data you just tried to save to database.

      This source formatting change won't be smart enough to catch all bad usage of throwing exception, but it can handle one typical scenario, that is you catch a portal/system exception, without any processing logic, just swallow it. This bad usage after this ticket is forbidden.

      Attachments

        Issue Links

          Activity

            People

              hugo.huijser Hugo Huijser (Inactive)
              shuyang.zhou Shuyang Zhou
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Packages

                  Version Package
                  6.1.30 EE GA3
                  6.2.0 CE M6