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

Executing ant format-source causes imports to be removed from init.jsp when a space is excluded from the include directive

    Details

      Description

      Description

      When you exclude a space from the include directive, executing an ant format-source causes all imports to be removed from the init.jsp. The intended behavior is that the imports would remain.

      Steps to Reproduce

      1. Use ./create.sh or ./create.bat using the working directory PLUGINS_SDK_HOME/portlets to create a portlet named "Test Source Formatter" in the folder test-source-formatter-portlet.

      ./create.sh test-source-formatter "Test Source Formatter"

      2. Create a file in PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet/docroot/init.jsp with the following content:

      <%@ page import="java.util.Collections" %>

      3. Update PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet/docroot/view.jsp to include the following content:

      <%@ include file="/init.jsp" %>
      <%= Collections.emptyList() %>

      4. Run ant format-source using the working directory PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet. Note that the <%@ page import %> in PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet/docroot/init.jsp remains intact.

      5. Update PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet/docroot/view.jsp to remove the space between @ and include. It should now appear as follows:

      <%@include file="/init.jsp" %>
      <%= Collections.emptyList() %>

      6. Run ant format-source using the working directory PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet. Notice that the <%@ page import %> in PLUGINS_SDK_HOME/portlets/test-source-formatter-portlet/docroot/init.jsp has been removed.

        Attachments

          Activity

            People

            Assignee:
            hong.zhao Hong Zhao (Inactive)
            Reporter:
            ira.chui Ira Chui
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 16 weeks, 6 days ago

                Packages

                Version Package
                6.1.X EE
                6.2.0 CE RC4