diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java b/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java index edf94669b..39d83fc3c 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java @@ -32,7 +32,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED; import static javax.servlet.http.HttpServletResponse.SC_OK; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.StringWriter; import java.util.HashMap; diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java b/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java index 7187d6f53..d97ff1ca5 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java @@ -21,19 +21,17 @@ package org.apache.struts2.rest; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.struts2.ServletActionContext; -import org.apache.struts2.rest.handler.ContentTypeHandler; - import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.Interceptor; +import org.apache.struts2.ServletActionContext; +import org.apache.struts2.rest.handler.ContentTypeHandler; + +import javax.servlet.http.HttpServletRequest; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; /** * Uses the content handler to apply the request body to the action diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultHttpHeaders.java b/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultHttpHeaders.java index a1f64cce2..36af823e9 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultHttpHeaders.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/DefaultHttpHeaders.java @@ -23,9 +23,7 @@ package org.apache.struts2.rest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED; -import static javax.servlet.http.HttpServletResponse.SC_OK; -import static javax.servlet.http.HttpServletResponse.SC_CREATED; +import static javax.servlet.http.HttpServletResponse.*; import java.util.Date; /** diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java index 183b501c8..0529e9a88 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java @@ -21,49 +21,19 @@ package org.apache.struts2.rest; -import com.opensymphony.xwork2.ActionContext; -import com.opensymphony.xwork2.ActionEventListener; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ActionProxy; import com.opensymphony.xwork2.DefaultActionInvocation; -import com.opensymphony.xwork2.ModelDriven; -import com.opensymphony.xwork2.ObjectFactory; import com.opensymphony.xwork2.Result; -import com.opensymphony.xwork2.UnknownHandler; -import com.opensymphony.xwork2.config.ConfigurationException; import com.opensymphony.xwork2.config.entities.ActionConfig; -import com.opensymphony.xwork2.config.entities.InterceptorMapping; -import com.opensymphony.xwork2.config.entities.ResultConfig; -import com.opensymphony.xwork2.conversion.impl.XWorkConverter; -import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.inject.Inject; -import com.opensymphony.xwork2.interceptor.PreResultListener; -import com.opensymphony.xwork2.util.ValueStack; -import com.opensymphony.xwork2.util.ValueStackFactory; +import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; import com.opensymphony.xwork2.util.profiling.UtilTimerStack; -import com.opensymphony.xwork2.util.logging.Logger; -import org.apache.struts2.ServletActionContext; -import org.apache.struts2.rest.handler.ContentTypeHandler; - -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; /** diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionProxyFactory.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionProxyFactory.java index a9d61e374..c12a7ed2e 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionProxyFactory.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionProxyFactory.java @@ -21,14 +21,11 @@ package org.apache.struts2.rest; -import java.util.Map; - import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionProxy; -import com.opensymphony.xwork2.DefaultActionInvocation; import com.opensymphony.xwork2.DefaultActionProxyFactory; -import com.opensymphony.xwork2.inject.Container; -import com.opensymphony.xwork2.inject.Inject; + +import java.util.Map; /** diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java index a10e0c9cf..6da928186 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java @@ -21,12 +21,6 @@ package org.apache.struts2.rest; -import java.util.HashMap; -import java.util.Map; - -import org.apache.struts2.ServletActionContext; -import org.apache.struts2.dispatcher.mapper.ActionMapping; - import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; @@ -35,8 +29,12 @@ import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; +import org.apache.struts2.ServletActionContext; +import org.apache.struts2.dispatcher.mapper.ActionMapping; -import static javax.servlet.http.HttpServletResponse.*; +import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; +import java.util.HashMap; +import java.util.Map; /** * diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java index 0d84c3d52..9ea78e891 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java @@ -21,9 +21,9 @@ package org.apache.struts2.rest.handler; -import java.io.*; - -import com.opensymphony.xwork2.ActionInvocation; +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; /** * Handles transferring content to and from objects for a specific content type diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java index ea6f98c81..41e0d6be7 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java @@ -21,12 +21,14 @@ package org.apache.struts2.rest.handler; -import java.io.*; -import java.util.Collection; - +import net.sf.json.JSONArray; import net.sf.json.JSONObject; import net.sf.json.JsonConfig; -import net.sf.json.JSONArray; + +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; +import java.util.Collection; /** * Handles JSON content using json-lib diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java index 2d2894600..94be7af88 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java @@ -21,12 +21,12 @@ package org.apache.struts2.rest.handler; +import com.thoughtworks.xstream.XStream; + import java.io.IOException; import java.io.Reader; import java.io.Writer; -import com.thoughtworks.xstream.XStream; - /** * Handles XML content */