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

Executing ant format-source causes imports to be removed from init.jsp when using apostrophe's instead of quotes

    Details

      Description

      Description

      When you use apostrophe's in 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 replace the quotes with apostrophes. 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:
              sharry.shi Sharry Shi
              Reporter:
              james.schueler Harrison Schueler (Inactive)
              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:
                5 years, 39 weeks, 5 days ago

                Packages

                Version Package
                6.1.X EE
                6.2.0 CE RC5