Commit 05189c81 authored by Emmanuel Bourg's avatar Emmanuel Bourg

Imported Upstream version 8.0.17

parent a9ddd3c6
......@@ -266,7 +266,14 @@ You can build them by using the following commands:
You will be prompted for the GPG passphrase when the release build
starts, unless "gpg.passphrase" property is set.
2. Build the release:
2. If building the Windows installer
If running the build in a UAC enabled environment, building the Windows
installer requires elevated privileges. The simplest way to do this is to
open the command prompt used for the build with the "Run as administrator"
option.
3. Build the release:
cd ${tomcat.source}
ant release
......
Apache Tomcat
Copyright 1999-2014 The Apache Software Foundation
Copyright 1999-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
......@@ -25,7 +25,7 @@
# ----- Version Control Flags -----
version.major=8
version.minor=0
version.build=15
version.build=17
version.patch=0
version.suffix=
......@@ -212,10 +212,10 @@ objenesis.home=${base.path}/objenesis-${objenesis.version}
objenesis.loc=https://objenesis.googlecode.com/files/objenesis-${objenesis.version}-bin.zip
objenesis.jar=${objenesis.home}/objenesis-${objenesis.version}.jar
# ----- Checkstyle, version 5.1 or later -----
checkstyle.version=5.7
# ----- Checkstyle, version 6.0 or later -----
checkstyle.version=6.2
checkstyle.home=${base.path}/checkstyle-${checkstyle.version}
checkstyle.loc=${base-sf.loc}/checkstyle/checkstyle/${checkstyle.version}/checkstyle-${checkstyle.version}-bin.zip
checkstyle.loc=${base-sf.loc}/checkstyle/checkstyle/${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar
checkstyle.jar=${checkstyle.home}/checkstyle-${checkstyle.version}-all.jar
# ----- JSON Libraries (for bayeux module) -----
......
This diff is collapsed.
......@@ -64,7 +64,7 @@
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
......@@ -76,7 +76,7 @@
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
......
......@@ -317,7 +317,8 @@
<!-- -->
<!-- cgiPathPrefix The CGI search path will start at -->
<!-- webAppRootDir + File.separator + this prefix. -->
<!-- [WEB-INF/cgi] -->
<!-- If not set, then webAppRootDir is used. -->
<!-- Recommended value: WEB-INF/cgi -->
<!-- -->
<!-- debug Debugging detail level for messages logged -->
<!-- by this servlet. [0] -->
......
......@@ -229,15 +229,39 @@ public class BeanELResolver extends ELResolver {
try {
BeanInfo info = Introspector.getBeanInfo(this.type);
PropertyDescriptor[] pds = info.getPropertyDescriptors();
for (int i = 0; i < pds.length; i++) {
this.properties.put(pds[i].getName(), new BeanProperty(
type, pds[i]));
for (PropertyDescriptor pd: pds) {
this.properties.put(pd.getName(), new BeanProperty(type, pd));
}
if (System.getSecurityManager() != null) {
// When running with SecurityManager, some classes may be
// not accessible, but have accessible interfaces.
populateFromInterfaces(type);
}
} catch (IntrospectionException ie) {
throw new ELException(ie);
}
}
private void populateFromInterfaces(Class<?> aClass) throws IntrospectionException {
Class<?> interfaces[] = aClass.getInterfaces();
if (interfaces.length > 0) {
for (Class<?> ifs : interfaces) {
BeanInfo info = Introspector.getBeanInfo(ifs);
PropertyDescriptor[] pds = info.getPropertyDescriptors();
for (PropertyDescriptor pd : pds) {
if (!this.properties.containsKey(pd.getName())) {
this.properties.put(pd.getName(), new BeanProperty(
this.type, pd));
}
}
}
}
Class<?> superclass = aClass.getSuperclass();
if (superclass != null) {
populateFromInterfaces(superclass);
}
}
private BeanProperty get(ELContext ctx, String name) {
BeanProperty property = this.properties.get(name);
if (property == null) {
......
......@@ -44,7 +44,7 @@ public class BeanNameELResolver extends ELResolver {
if (beanNameResolver.isNameResolved(beanName)) {
try {
Object result = beanNameResolver.getBean((String) property);
Object result = beanNameResolver.getBean(beanName);
context.setPropertyResolved(base, property);
return result;
} catch (Throwable t) {
......
......@@ -53,7 +53,6 @@ public abstract class ExpressionFactory {
private static final String PROPERTY_NAME = "javax.el.ExpressionFactory";
private static final String SEP;
private static final String PROPERTY_FILE;
private static final CacheValue nullTcclFactory = new CacheValue();
......@@ -62,29 +61,19 @@ public abstract class ExpressionFactory {
static {
if (IS_SECURITY_ENABLED) {
SEP = AccessController.doPrivileged(
new PrivilegedAction<String>(){
@Override
public String run() {
return System.getProperty("file.separator");
}
}
);
PROPERTY_FILE = AccessController.doPrivileged(
new PrivilegedAction<String>(){
@Override
public String run() {
return System.getProperty("java.home") + SEP +
"lib" + SEP + "el.properties";
return System.getProperty("java.home") + File.separator +
"lib" + File.separator + "el.properties";
}
}
);
} else {
SEP = System.getProperty("file.separator");
PROPERTY_FILE = System.getProperty("java.home") + SEP + "lib" +
SEP + "el.properties";
PROPERTY_FILE = System.getProperty("java.home") + File.separator + "lib" +
File.separator + "el.properties";
}
}
......
......@@ -21,18 +21,19 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* @since EL 3.0
*/
public class ImportHandler {
private List<String> packages = new ArrayList<>();
private Map<String,Class<?>> clazzes = new HashMap<>();
private Map<String,Class<?>> statics = new HashMap<>();
private List<String> packageNames = new ArrayList<>();
private ConcurrentHashMap<String,String> classNames = new ConcurrentHashMap<>();
private Map<String,Class<?>> clazzes = new ConcurrentHashMap<>();
private Map<String,Class<?>> statics = new ConcurrentHashMap<>();
public ImportHandler() {
......@@ -103,33 +104,20 @@ public class ImportHandler {
public void importClass(String name) throws javax.el.ELException {
if (!name.contains(".")) {
int lastPeriodIndex = name.lastIndexOf('.');
if (lastPeriodIndex < 0) {
throw new ELException(Util.message(
null, "importHandler.invalidClassName", name));
}
Class<?> clazz = findClass(name);
String unqualifiedName = name.substring(lastPeriodIndex + 1);
String currentName = classNames.putIfAbsent(unqualifiedName, name);
if (clazz == null) {
throw new ELException(Util.message(
null, "importHandler.classNotFound", name));
}
String simpleName = clazz.getSimpleName();
Class<?> conflict = clazzes.get(simpleName);
if (conflict == null) {
// No conflict - add it
clazzes.put(simpleName, clazz);
} else {
// Check for a duplicate
if (conflict.equals(clazz)) {
// This is a duplicate.
// NO-OP
} else {
throw new ELException(Util.message(null,
"importHandler.ambiguousImport", name, conflict.getName()));
}
if (currentName != null && !currentName.equals(name)) {
// Conflict. Same unqualifiedName, different fully qualified names
throw new ELException(Util.message(null,
"importHandler.ambiguousImport", name, currentName));
}
}
......@@ -148,7 +136,7 @@ public class ImportHandler {
null, "importHandler.invalidPackage", name));
}
}
packages.add(name);
packageNames.add(name);
}
......@@ -157,27 +145,40 @@ public class ImportHandler {
return null;
}
// Has it been previously resolved?
Class<?> result = clazzes.get(name);
if (result == null) {
// Search the package imports - note there may be multiple matches
// (which correctly triggers an error)
for (String p : packages) {
String className = p + '.' + name;
Class<?> clazz = findClass(className);
if (clazz != null) {
if (result != null) {
throw new ELException(Util.message(null,
"importHandler.ambiguousImport", className,
result.getName()));
}
result = clazz;
}
if (result != null) {
return result;
}
// Search the class imports
String className = classNames.get(name);
if (className != null) {
Class<?> clazz = findClass(className);
if (clazz != null) {
clazzes.put(className, clazz);
return clazz;
}
if (result != null) {
clazzes.put(name, result);
}
// Search the package imports - note there may be multiple matches
// (which correctly triggers an error)
for (String p : packageNames) {
className = p + '.' + name;
Class<?> clazz = findClass(className);
if (clazz != null) {
if (result != null) {
throw new ELException(Util.message(null,
"importHandler.ambiguousImport", className,
result.getName()));
}
result = clazz;
}
}
if (result != null) {
clazzes.put(name, result);
}
return result;
}
......@@ -190,8 +191,9 @@ public class ImportHandler {
private Class<?> findClass(String name) {
Class<?> clazz;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
clazz = Class.forName(name);
clazz = cl.loadClass(name);
} catch (ClassNotFoundException e) {
return null;
}
......
......@@ -179,6 +179,8 @@ public interface ServletResponse {
* @param length
* an integer specifying the length of the content being returned
* to the client; sets the Content-Length header
*
* @since Servlet 3.1
*/
public void setContentLengthLong(long length);
......
......@@ -119,8 +119,10 @@ public class ServletResponseWrapper implements ServletResponse {
}
/**
* The default behavior of this method is to call setContentLength(long len)
* The default behavior of this method is to call setContentLengthLong(long len)
* on the wrapped response object.
*
* @since Servlet 3.1
*/
@Override
public void setContentLengthLong(long length) {
......
......@@ -22,7 +22,7 @@ err.io.nullArray=Null passed for byte array in write method
err.io.indexOutOfBounds=Invalid offset [{0}] and / or length [{1}] specified for array of size [{2}]
err.io.short_read=Short Read
http.method_not_implemented=Method {0} is not is not implemented by this servlet for this URI
http.method_not_implemented=Method {0} is not implemented by this servlet for this URI
http.method_get_not_supported=HTTP method GET is not supported by this URL
http.method_post_not_supported=HTTP method POST is not supported by this URL
......
......@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.catalina;
import org.apache.catalina.connector.Request;
......
......@@ -273,9 +273,11 @@ public interface Container extends Lifecycle {
/**
* Return the Realm with which this Container is associated. If there is
* no associated Realm, return the Realm associated with our parent
* Container (if any); otherwise return <code>null</code>.
* Obtain the Realm with which this Container is associated.
*
* @return The associated Realm; if there is no associated Realm, the
* Realm associated with the parent Container (if any); otherwise
* return <code>null</code>.
*/
public Realm getRealm();
......@@ -336,25 +338,31 @@ public interface Container extends Lifecycle {
/**
* Return the child Container, associated with this Container, with
* the specified name (if any); otherwise, return <code>null</code>
* Obtain a child Container by name.
*
* @param name Name of the child Container to be retrieved
*
* @return The child Container with the given name or <code>null</code> if
* no such child exists.
*/
public Container findChild(String name);
/**
* Return the set of children Containers associated with this Container.
* If this Container has no children, a zero-length array is returned.
* Obtain the child Containers associated with this Container.
*
* @return An array containing all children of this container. If this
* Container has no children, a zero-length array is returned.
*/
public Container[] findChildren();
/**
* Return the set of container listeners associated with this Container.
* If this Container has no registered container listeners, a zero-length
* array is returned.
* Obtain the container listeners associated with this Container.
*
* @return An array containing the container listeners associated with this
* Container. If this Container has no registered container
* listeners, a zero-length array is returned.
*/
public ContainerListener[] findContainerListeners();
......@@ -411,17 +419,24 @@ public interface Container extends Lifecycle {
/**
* Identify the AccessLog to use to log a request/response that was destined
* for this container but was handled earlier in the processing chain so
* that the request/response still appears in the correct access logs.
* Obtain the AccessLog to use to log a request/response that is destined
* for this container. This is typically used when the request/response was
* handled (and rejected) earlier in the processing chain so that the
* request/response still appears in the correct access logs.
*
* @return The AccessLog to use for a request/response destined for this
* container
*/
public AccessLog getAccessLog();
/**
* Returns the number of threads available for starting and stopping any
* Obtain the number of threads available for starting and stopping any
* children associated with this container. This allows start/stop calls to
* children to be processed in parallel.
*
* @return The currently configured number of threads used to start/stop
* children associated with this container
*/
public int getStartStopThreads();
......@@ -437,12 +452,16 @@ public interface Container extends Lifecycle {
/**
* Obtain the location of CATALINA_BASE.
*
* @return The location of CATALINA_BASE.
*/
public File getCatalinaBase();
/**
* Obtain the location of CATALINA_HOME.
*
* @return The location of CATALINA_HOME.
*/
public File getCatalinaHome();
}
......@@ -56,14 +56,18 @@ public final class ContainerEvent extends EventObject {
/**
* Return the event data of this event.
*
* @return The data, if any, associated with this event.
*/
public Object getData() {
return (this.data);
return this.data;
}
/**
* Return the Container on which this event occurred.
*
* @return The Container on which this event occurred.
*/
public Container getContainer() {
return (Container) getSource();
......@@ -72,9 +76,13 @@ public final class ContainerEvent extends EventObject {
/**
* Return the event type of this event.
*
* @return The event type of this event. Although this is a String, it is
* safe to rely on the value returned by this method remaining
* consistent between point releases.
*/
public String getType() {
return (this.type);
return this.type;
}
......
......@@ -14,11 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.catalina;
/**
* A <b>ContainerServlet</b> is a servlet that has access to Catalina
* internal functionality, and is loaded from the Catalina class loader
......@@ -30,12 +27,10 @@ package org.apache.catalina;
*/
public interface ContainerServlet {
// ------------------------------------------------------------- Properties
/**
* Return the Wrapper with which this Servlet is associated.
* Obtain the Wrapper with which this Servlet is associated.
*
* @return The Wrapper with which this Servlet is associated.
*/
public Wrapper getWrapper();
......@@ -46,6 +41,4 @@ public interface ContainerServlet {
* @param wrapper The new associated Wrapper
*/
public void setWrapper(Wrapper wrapper);
}
......@@ -109,12 +109,11 @@ public interface Context extends Container {
/**
* Return the set of initialized application event listener objects,
* in the order they were specified in the web application deployment
* descriptor, for this application.
* Obtain the registered application event listeners.
*
* @exception IllegalStateException if this method is called before
* this application has started, or after it has been stopped
* @return An array containing the application event listener instances for
* this web application in the order they were specified in the web
* application deployment descriptor
*/
public Object[] getApplicationEventListeners();
......@@ -130,12 +129,11 @@ public interface Context extends Container {
/**
* Return the set of initialized application lifecycle listener objects,
* in the order they were specified in the web application deployment
* descriptor, for this application.
* Obtain the registered application lifecycle listeners.
*
* @exception IllegalStateException if this method is called before
* this application has started, or after it has been stopped
* @return An array containing the application lifecycle listener instances
* for this web application in the order they were specified in the
* web application deployment descriptor
*/
public Object[] getApplicationLifecycleListeners();
......@@ -154,12 +152,19 @@ public interface Context extends Container {
* Obtain the character set name to use with the given Locale. Note that
* different Contexts may have different mappings of Locale to character
* set.
*
* @param locale The locale for which the mapped character set should be
* returned
*
* @return The name of the character set to use with the given Locale
*/
public String getCharset(Locale locale);
/**
* Return the URL of the XML descriptor for this context.
*
* @return The URL of the XML descriptor for this context
*/
public URL getConfigFile();
......@@ -174,6 +179,9 @@ public interface Context extends Container {
/**
* Return the "correctly configured" flag for this Context.
*
* @return <code>true</code> if the Context has been correctly configured,
* otherwise <code>false</code>
*/
public boolean getConfigured();
......@@ -190,6 +198,10 @@ public interface Context extends Container {
/**
* Return the "use cookies for session ids" flag.
*
* @return <code>true</code> if it is permitted to use cookies to track
* session IDs for this web application, otherwise
* <code>false</code>
*/
public boolean getCookies();
......@@ -303,6 +315,9 @@ public interface Context extends Container {
/**
* Return the "allow crossing servlet contexts" flag.
*
* @return <code>true</code> if cross-contest requests are allowed from this
* web applications, otherwise <code>false</code>
*/
public boolean getCrossContext();
......
......@@ -202,8 +202,10 @@ public interface Host extends Container {
/**
* Set to true if the Host should attempt to create directories for xmlBase and appBase upon startup
* @param createDirs
* Should the Host attempt to create directories for xmlBase and appBase
* upon startup.