-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.20 EE GA2
-
Fix Version/s: 6.1.X EE, 6.2.0 CE RC4
-
Component/s: Legacy Components, Legacy Components > API
-
Environment:LIFERAY VERSION: 6.1 GA2
OPERATING SYSTEM: N/A
APPLICATION SERVER: Tomcat 7.0
JAVA VIRTUAL MACHINE: N/A
DATABASE: Hypersonic
-
Branch Version/s:6.1.x
-
Backported to Branch:Committed
-
Story Points:5
-
Git Pull Request:
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.