private static final long serialVersionUID = 1L;
- private Object base;
- private Object property;
+ private final Object base;
+ private final Object property;
public ValueReference(Object base, Object property) {
this.base = base;
* @since Servlet 3.0
*/
public class AsyncEvent {
- private AsyncContext context;
- private ServletRequest request;
- private ServletResponse response;
- private Throwable throwable;
+ private final AsyncContext context;
+ private final ServletRequest request;
+ private final ServletResponse response;
+ private final Throwable throwable;
public AsyncEvent(AsyncContext context) {
this.context = context;
+ this.request = null;
+ this.response = null;
+ this.throwable = null;
}
public AsyncEvent(AsyncContext context, ServletRequest request,
this.context = context;
this.request = request;
this.response = response;
+ this.throwable = null;
}
public AsyncEvent(AsyncContext context, Throwable throwable) {
this.context = context;
this.throwable = throwable;
+ this.request = null;
+ this.response = null;
}
public AsyncEvent(AsyncContext context, ServletRequest request,
private static final ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
- private EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
- private TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
- private String[] rolesAllowed = new String[0];
+ private final EmptyRoleSemantic emptyRoleSemantic;// = EmptyRoleSemantic.PERMIT;
+ private final TransportGuarantee transportGuarantee;// = TransportGuarantee.NONE;
+ private final String[] rolesAllowed;// = new String[0];
/**
* Default constraint is permit with no transport guarantee.
*/
public HttpConstraintElement() {
// Default constructor
+ this.emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
+ this.transportGuarantee = TransportGuarantee.NONE;
+ this.rolesAllowed = new String[0];
}
/**
*/
public HttpConstraintElement(EmptyRoleSemantic emptyRoleSemantic) {
this.emptyRoleSemantic = emptyRoleSemantic;
+ this.transportGuarantee = TransportGuarantee.NONE;
+ this.rolesAllowed = new String[0];
}
/**
*/
public HttpConstraintElement(TransportGuarantee transportGuarantee,
String... rolesAllowed) {
+ this.emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
this.transportGuarantee = transportGuarantee;
this.rolesAllowed = rolesAllowed;
}
private static final ResourceBundle lStrings =
ResourceBundle.getBundle(LSTRING_FILE);
- private String methodName;
+ private final String methodName;
public HttpMethodConstraintElement(String methodName) {
if (methodName == null || methodName.length() == 0) {
*/
public class MultipartConfigElement {
- private String location = "";
- private long maxFileSize = -1;
- private long maxRequestSize = -1;
- private int fileSizeThreshold = 0;
+ private final String location;// = "";
+ private final long maxFileSize;// = -1;
+ private final long maxRequestSize;// = -1;
+ private final int fileSizeThreshold;// = 0;
public MultipartConfigElement(String location) {
// Keep empty string default if location is null
if (location != null) {
this.location = location;
+ } else {
+ this.location = "";
}
+ this.maxFileSize = -1;
+ this.maxRequestSize = -1;
+ this.fileSizeThreshold = 0;
}
public MultipartConfigElement(String location, long maxFileSize,
// Keep empty string default if location is null
if (location != null) {
this.location = location;
+ } else {
+ this.location = "";
}
this.maxFileSize = maxFileSize;
this.maxRequestSize = maxRequestSize;
* @since v 2.3
*/
public class ServletContextAttributeEvent extends ServletContextEvent {
- private String name;
- private Object value;
+ private final String name;
+ private final Object value;
/**
* Construct a ServletContextAttributeEvent from the given context for the
* @since Servlet 2.4
*/
public class ServletRequestAttributeEvent extends ServletRequestEvent {
- private String name;
- private Object value;
+ private final String name;
+ private final Object value;
/**
* Construct a ServletRequestAttributeEvent giving the servlet context of
* @since Servlet 2.4
*/
public class ServletRequestEvent extends java.util.EventObject {
- private ServletRequest request;
+ private final ServletRequest request;
/**
* Construct a ServletRequestEvent for the given ServletContext and
*/
public class ServletSecurityElement extends HttpConstraintElement {
- private Map<String,HttpMethodConstraintElement> methodConstraints =
+ private final Map<String,HttpMethodConstraintElement> methodConstraints =
new HashMap<String,HttpMethodConstraintElement>();
/**
*/
public class UnavailableException extends ServletException {
- private Servlet servlet; // what's unavailable
- private boolean permanent; // needs admin action?
- private int seconds; // unavailability estimate
+ private final Servlet servlet; // what's unavailable
+ private final boolean permanent; // needs admin action?
+ private final int seconds; // unavailability estimate
/**
* @param servlet
super(msg);
this.servlet = servlet;
permanent = true;
+ this.seconds = 0;
}
/**
*/
public UnavailableException(String msg) {
super(msg);
-
+ seconds = 0;
+ servlet = null;
permanent = true;
}
this.seconds = -1;
else
this.seconds = seconds;
-
+ servlet = null;
permanent = false;
}
/* The name to which the object is being bound or unbound */
- private String name;
+ private final String name;
/* The object is being bound or unbound */
- private Object value;
+ private final Object value;
/**
* Constructs an event that notifies an object that it has been bound to or
public HttpSessionBindingEvent(HttpSession session, String name) {
super(session);
this.name = name;
+ this.value = null;
}
/**
*/
public final class ErrorData {
- private Throwable throwable;
- private int statusCode;
- private String uri;
- private String servletName;
+ private final Throwable throwable;
+ private final int statusCode;
+ private final String uri;
+ private final String servletName;
/**
* Creates a new ErrorData object.
// private fields
- private JspWriter enclosingWriter;
+ private final JspWriter enclosingWriter;
}
/*
* fields
*/
- private String name;
- private String functionClass;
- private String functionSignature;
+ private final String name;
+ private final String functionClass;
+ private final String functionSignature;
}
public TagAttributeInfo(String name, boolean required, String type,
boolean reqTime) {
- this.name = name;
- this.required = required;
- this.type = type;
- this.reqTime = reqTime;
+ this(name, required, type, reqTime, false);
}
/**
public TagAttributeInfo(String name, boolean required, String type,
boolean reqTime, boolean fragment) {
- this(name, required, type, reqTime);
- this.fragment = fragment;
+ this(name, required, type, reqTime, fragment, null, false, false, null, null);
}
/**
boolean reqTime, boolean fragment, String description,
boolean deferredValue, boolean deferredMethod,
String expectedTypeName, String methodSignature) {
- this(name, required, type, reqTime, fragment);
+ this.name = name;
+ this.required = required;
+ this.type = type;
+ this.reqTime = reqTime;
+ this.fragment = fragment;
this.description = description;
this.deferredValue = deferredValue;
this.deferredMethod = deferredMethod;
/*
* private fields
*/
- private String name;
+ private final String name;
- private String type;
+ private final String type;
- private boolean reqTime;
+ private final boolean reqTime;
- private boolean required;
+ private final boolean required;
/*
* private fields for JSP 2.0
*/
- private boolean fragment;
+ private final boolean fragment;
/*
* private fields for JSP 2.1
*/
- private String description;
+ private final String description;
- private boolean deferredValue;
+ private final boolean deferredValue;
- private boolean deferredMethod;
+ private final boolean deferredMethod;
- private String expectedTypeName;
+ private final String expectedTypeName;
- private String methodSignature;
+ private final String methodSignature;
public boolean isDeferredMethod() {
return deferredMethod;
// private data
- private Hashtable<String, Object> attributes; // the tagname/value map
+ private final Hashtable<String, Object> attributes; // the tagname/value map
}
}
// private data
- private TagInfo tagInfo;
+ private TagInfo tagInfo;
// zero length VariableInfo array
private static final VariableInfo[] ZERO_VARIABLE_INFO = { };
}
// private fields for 2.0 info
- private String name;
- private String path;
- private TagInfo tagInfo;
+ private final String name;
+ private final String path;
+ private final TagInfo tagInfo;
}
/*
* private fields
*/
- private String nameGiven; // <name-given>
- private String nameFromAttribute; // <name-from-attribute>
- private String className; // <class>
- private boolean declare; // <declare>
- private int scope; // <scope>
+ private final String nameGiven; // <name-given>
+ private final String nameFromAttribute; // <name-from-attribute>
+ private final String className; // <class>
+ private final boolean declare; // <declare>
+ private final int scope; // <scope>
}
}
// Private data
- private String id;
- private String message;
+ private final String id;
+ private final String message;
}
}
// == private data
- private String varName;
- private String className;
- private boolean declare;
- private int scope;
+ private final String varName;
+ private final String className;
+ private final boolean declare;
+ private final int scope;
}
<code>login()/logout()</code> methods to support JACC implementations
and to improve encapsulation. Patch provided by David Jencks. (markt)
</fix>
+ <update>
+ <bug>50017</bug>: Code clean-up. No functional change. Patch provided by
+ sebb. (markt)
+ </update>
</changelog>
</subsection>
<subsection name="Coyote">