WN-5141 fix whitespace issues

This commit is contained in:
jdyer1
2023-11-27 08:21:57 -06:00
committed by Lukasz Lenart
parent 97dbdc1c90
commit 8b8de96b49
11 changed files with 95 additions and 97 deletions
+3 -4
View File
@@ -89,8 +89,7 @@
<failOnError>true</failOnError>
</configuration>
</plugin>
</plugins>
</plugins>
</build>
<profiles>
<profile>
@@ -181,8 +180,8 @@
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-freemarker-jakarta</artifactId>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-freemarker-jakarta</artifactId>
</dependency>
<dependency>
@@ -44,7 +44,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
private UrlDecoder decoder;
public Restful2ActionMapper() {
setSlashesInActionNames("true");
setSlashesInActionNames("true");
}
@Inject
@@ -58,9 +58,9 @@ public class Restful2ActionMapper extends DefaultActionMapper {
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(jakarta.servlet.http.HttpServletRequest)
*/
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
if (!isSlashesInActionNames()) {
throw new IllegalStateException("This action mapper requires the setting 'slashesInActionNames' to be set to 'true'");
}
if (!isSlashesInActionNames()) {
throw new IllegalStateException("This action mapper requires the setting 'slashesInActionNames' to be set to 'true'");
}
ActionMapping mapping = super.getMapping(request, configManager);
if (mapping == null) {
@@ -113,7 +113,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
}
if (idParameterName != null && lastSlashPos > -1) {
actionName = actionName.substring(0, lastSlashPos);
actionName = actionName.substring(0, lastSlashPos);
}
}
@@ -156,7 +156,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
mapping.getParams().putAll(parameters);
}
} catch (Exception e) {
LOG.warn("Unable to determine parameters from the url", e);
LOG.warn("Unable to determine parameters from the url", e);
}
mapping.setName(actionName.substring(actionSlashPos+1));
}
@@ -189,12 +189,12 @@ public class Restful2ActionMapper extends DefaultActionMapper {
}
}
public String getIdParameterName() {
return idParameterName;
}
public String getIdParameterName() {
return idParameterName;
}
@Inject(required=false,value=StrutsConstants.STRUTS_ID_PARAMETER_NAME)
public void setIdParameterName(String idParameterName) {
this.idParameterName = idParameterName;
}
@Inject(required = false, value = StrutsConstants.STRUTS_ID_PARAMETER_NAME)
public void setIdParameterName(String idParameterName) {
this.idParameterName = idParameterName;
}
}
@@ -99,8 +99,8 @@ public class JakartaMultiPartRequest extends AbstractMultiPartRequest {
}
protected void processUpload(HttpServletRequest request, String saveDir) throws IOException {
if (JakartaServletFileUpload.isMultipartContent(request)) {
if (JakartaServletFileUpload.isMultipartContent(request)) {
for (FileItem item : parseRequest(request, saveDir)) {
LOG.debug("Found file item: [{}]", sanitizeNewlines(item.getFieldName()));
if (item.isFormField()) {
@@ -350,21 +350,21 @@ public class CookieInterceptorTest extends StrutsInternalTestCase {
new Cookie(pollution4, "pollution4");
fail("It shouldn't be possible to create cookie: " + pollution4);
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution4 + "\" is a reserved token"));
assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution4 + "\" is a reserved token"));
}
try {
new Cookie(pollution5, "pollution5");
fail("It shouldn't be possible to create cookie: " + pollution5);
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution5 + "\" is a reserved token"));
assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution5 + "\" is a reserved token"));
}
try {
new Cookie(pollution6, "pollution6");
fail("It shouldn't be possible to create cookie: " + pollution6);
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution6 + "\" is a reserved token"));
assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution6 + "\" is a reserved token"));
}
request.setCookies(
@@ -1136,10 +1136,10 @@ public class IteratorTagTest extends AbstractUITagTest {
class TestMockBodyContent extends MockBodyContent {
public TestMockBodyContent(String content, Writer targetWriter) {
super(content, response, targetWriter);
}
super(content, response, targetWriter);
}
public String getString() {
public String getString() {
return ".-.";
}
}
@@ -124,13 +124,13 @@ public class StrutsMockHttpServletRequest extends MockHttpServletRequest {
public RequestDispatcher getRequestDispatcher(String string) {
this.requestDispatherString = string;
if(this.requestDispatcher == null) {
this.requestDispatcher = new MockRequestDispatcher(string);
this.requestDispatcher = new MockRequestDispatcher(string);
}
return this.requestDispatcher;
}
public void setRequestDispatcher(RequestDispatcher rd) {
this.requestDispatcher = rd;
this.requestDispatcher = rd;
}
/**
@@ -42,7 +42,7 @@ public class StrutsMockPageContext extends MockPageContext {
public StrutsMockPageContext() { }
public StrutsMockPageContext(ServletContext context, HttpServletRequest request, HttpServletResponse response) {
super(context, request, response);
super(context, request, response);
}
@@ -73,15 +73,15 @@ public class StrutsMockPageContext extends MockPageContext {
}
@Override
public JspWriter getOut() {
if (this.smpcOut == null) {
this.smpcOut = new StrutsMockJspWriter(new StringWriter());
}
return this.smpcOut;
}
public JspWriter getOut() {
if (this.smpcOut == null) {
this.smpcOut = new StrutsMockJspWriter(new StringWriter());
}
return this.smpcOut;
}
public void setJspWriter(JspWriter w) {
this.smpcOut = w;
this.smpcOut = w;
}
public Object findAttribute(String s) {
@@ -304,38 +304,38 @@ public class StrutsMockServletContext implements ServletContext {
return null;
}
@Override
public Dynamic addJspFile(String servletName, String jspFile) {
return null;
}
@Override
public Dynamic addJspFile(String servletName, String jspFile) {
return null;
}
@Override
public int getSessionTimeout() {
return 0;
}
@Override
public int getSessionTimeout() {
return 0;
}
@Override
public void setSessionTimeout(int sessionTimeout) {
// no-op
}
@Override
public void setSessionTimeout(int sessionTimeout) {
// no-op
}
@Override
public String getRequestCharacterEncoding() {
return null;
}
@Override
public String getRequestCharacterEncoding() {
return null;
}
@Override
public void setRequestCharacterEncoding(String encoding) {
// no-op
}
@Override
public void setRequestCharacterEncoding(String encoding) {
// no-op
}
@Override
public String getResponseCharacterEncoding() {
return null;
}
@Override
public String getResponseCharacterEncoding() {
return null;
}
@Override
public void setResponseCharacterEncoding(String encoding) {
// no-op
}
@Override
public void setResponseCharacterEncoding(String encoding) {
// no-op
}
}
+3 -3
View File
@@ -40,8 +40,8 @@
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
@@ -53,7 +53,7 @@
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<artifactId>jakarta.el</artifactId>
<scope>test</scope>
</dependency>
@@ -294,39 +294,38 @@ public class StrutsMockServletContext implements ServletContext {
this.contextPath = contextPath;
}
@Override
public Dynamic addJspFile(String servletName, String jspFile) {
return null;
}
@Override
public Dynamic addJspFile(String servletName, String jspFile) {
return null;
}
@Override
public int getSessionTimeout() {
return 0;
}
@Override
public int getSessionTimeout() {
return 0;
}
@Override
public void setSessionTimeout(int sessionTimeout) {
}
@Override
public void setSessionTimeout(int sessionTimeout) {
@Override
public String getRequestCharacterEncoding() {
return null;
}
}
@Override
public void setRequestCharacterEncoding(String encoding) {
}
@Override
public String getRequestCharacterEncoding() {
return null;
}
@Override
public String getResponseCharacterEncoding() {
return null;
}
@Override
public void setRequestCharacterEncoding(String encoding) {
@Override
public void setResponseCharacterEncoding(String encoding) {
}
}
@Override
public String getResponseCharacterEncoding() {
return null;
}
@Override
public void setResponseCharacterEncoding(String encoding) {
}
}
+2 -2
View File
@@ -84,12 +84,12 @@
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>