svn commit: r1499642 - in /tomcat/trunk: java/javax/servlet/http/ java/org/apache/catalina/connector/ test/org/apache/catalina/filters/

2013-07-03 Thread violetagg
Author: violetagg
Date: Thu Jul  4 04:03:09 2013
New Revision: 1499642

URL: http://svn.apache.org/r1499642
Log:
javax.servlet.http.HttpServletRequest.upgrade(Class) and 
javax.servlet.http.HttpServletRequestWrapper.upgrade(Class) must throw 
ServletException when the instantiation of the provided class fails.

Modified:
tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
tomcat/trunk/java/org/apache/catalina/connector/Request.java
tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java?rev=1499642&r1=1499641&r2=1499642&view=diff
==
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java Thu Jul  4 
04:03:09 2013
@@ -510,8 +510,12 @@ public interface HttpServletRequest exte
  * Protocol specific headers must have already been set before this method
  * is called.
  *
+ * @throws IOException
+ * if an I/O error occurred during the upgrade
+ * @throws ServletException
+ * if the given httpUpgradeHandlerClass fails to be 
instantiated
  * @since Servlet 3.1
  */
 public  T upgrade(
-Class httpUpgradeHandlerClass) throws java.io.IOException;
+Class httpUpgradeHandlerClass) throws java.io.IOException, 
ServletException;
 }

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java?rev=1499642&r1=1499641&r2=1499642&view=diff
==
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 
(original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java Thu Jul 
 4 04:03:09 2013
@@ -370,7 +370,7 @@ public class HttpServletRequestWrapper e
  */
 @Override
 public  T upgrade(
-Class httpUpgradeHandlerClass) throws IOException {
+Class httpUpgradeHandlerClass) throws IOException, 
ServletException {
 return this._getHttpServletRequest().upgrade(httpUpgradeHandlerClass);
 }
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1499642&r1=1499641&r2=1499642&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Jul  4 
04:03:09 2013
@@ -1878,13 +1878,13 @@ public class Request
  */
 @Override
 public  T upgrade(
-Class httpUpgradeHandlerClass) throws java.io.IOException {
+Class httpUpgradeHandlerClass) throws java.io.IOException, 
ServletException {
 
 T handler;
 try {
 handler = (T) 
context.getInstanceManager().newInstance(httpUpgradeHandlerClass);
 } catch (InstantiationException | IllegalAccessException | 
InvocationTargetException | NamingException e) {
-throw new IOException(e);
+throw new ServletException(e);
 }
 
 coyoteRequest.action(ActionCode.UPGRADE, handler);

Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=1499642&r1=1499641&r2=1499642&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Thu Jul  
4 04:03:09 2013
@@ -1113,7 +1113,7 @@ public class RequestFacade implements Ht
  */
 @Override
 public  T upgrade(
-Class httpUpgradeHandlerClass) throws java.io.IOException {
+Class httpUpgradeHandlerClass) throws java.io.IOException, 
ServletException {
 return request.upgrade(httpUpgradeHandlerClass);
 }
 }

Modified: 
tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java?rev=1499642&r1=1499641&r2=1499642&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServ

svn commit: r1499561 - in /tomcat/trunk/java/javax/el: ELManager.java ExpressionFactory.java StandardELContext.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 21:16:40 2013
New Revision: 1499561

URL: http://svn.apache.org/r1499561
Log:
EL 3.0
Add new classes and methods

Added:
tomcat/trunk/java/javax/el/ELManager.java   (with props)
tomcat/trunk/java/javax/el/StandardELContext.java   (with props)
Modified:
tomcat/trunk/java/javax/el/ExpressionFactory.java

Added: tomcat/trunk/java/javax/el/ELManager.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELManager.java?rev=1499561&view=auto
==
--- tomcat/trunk/java/javax/el/ELManager.java (added)
+++ tomcat/trunk/java/javax/el/ELManager.java Wed Jul  3 21:16:40 2013
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.el;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+/**
+ * @since EL 3.0
+ */
+public class ELManager {
+
+private StandardELContext context = null;
+
+public static ExpressionFactory getExpressionFactory() {
+return Util.getExpressionFactory();
+}
+
+public StandardELContext getELContext() {
+if (context == null) {
+context = new StandardELContext(getExpressionFactory());
+}
+
+return context;
+}
+
+public ELContext setELContext(ELContext context) {
+StandardELContext oldContext = this.context;
+this.context = new StandardELContext(context);
+return oldContext;
+}
+
+public void addBeanNameResolver(BeanNameResolver beanNameResolver) {
+getELContext().addELResolver(new BeanNameELResolver(beanNameResolver));
+}
+
+public void addELResolver(ELResolver resolver) {
+getELContext().addELResolver(resolver);
+}
+
+public void mapFunction(String prefix, String function, Method method) {
+getELContext().getFunctionMapper().mapFunction(
+prefix, function, method);
+}
+
+public void setVariable(String variable, ValueExpression expression) {
+getELContext().getVariableMapper().setVariable(variable, expression);
+}
+
+public void importStatic(String staticMemberName)
+throws javax.el.ELException {
+getELContext().getImportHandler().importStatic(staticMemberName);
+}
+
+public void importClass(String className) throws javax.el.ELException {
+getELContext().getImportHandler().importClass(className);
+}
+
+public void importPackage(String packageName) {
+getELContext().getImportHandler().importPackage(packageName);
+}
+
+public Object defineBean(String name, Object bean) {
+Map localBeans = getELContext().getLocalBeans();
+
+if (bean == null) {
+return localBeans.remove(name);
+} else {
+return localBeans.put(name, bean);
+}
+}
+
+public void addEvaluationListener(EvaluationListener listener) {
+getELContext().addEvaluationListener(listener);
+}
+}

Propchange: tomcat/trunk/java/javax/el/ELManager.java
--
svn:eol-style = native

Modified: tomcat/trunk/java/javax/el/ExpressionFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ExpressionFactory.java?rev=1499561&r1=1499560&r2=1499561&view=diff
==
--- tomcat/trunk/java/javax/el/ExpressionFactory.java (original)
+++ tomcat/trunk/java/javax/el/ExpressionFactory.java Wed Jul  3 21:16:40 2013
@@ -28,8 +28,10 @@ import java.io.UnsupportedEncodingExcept
 import java.lang.ref.WeakReference;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -86,21 +88,6 @@ public abstract class ExpressionFactory 
 }
 }
 
-public abstract Object coerceToType(Object obj, Class expectedType)
-throws ELException;
-
-public abstract ValueExpression create

svn commit: r1499542 - /tomcat/trunk/java/javax/el/FunctionMapper.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 20:08:19 2013
New Revision: 1499542

URL: http://svn.apache.org/r1499542
Log:
EL 3.0
Add new method

Modified:
tomcat/trunk/java/javax/el/FunctionMapper.java

Modified: tomcat/trunk/java/javax/el/FunctionMapper.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/FunctionMapper.java?rev=1499542&r1=1499541&r2=1499542&view=diff
==
--- tomcat/trunk/java/javax/el/FunctionMapper.java (original)
+++ tomcat/trunk/java/javax/el/FunctionMapper.java Wed Jul  3 20:08:19 2013
@@ -14,16 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.el;
 
 import java.lang.reflect.Method;
 
-/**
- *
- */
 public abstract class FunctionMapper {
 
 public abstract Method resolveFunction(String prefix, String localName);
 
+/**
+ * @param prefix
+ * @param localName
+ * @param method
+ *
+ * @since EL 3.0
+ */
+public void mapFunction(String prefix, String localName, Method method) {
+// NO-OP
+}
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499538 - in /tomcat/trunk/java/javax/el: ListELResolver.java MapELResolver.java MethodExpression.java ValueExpression.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 19:51:36 2013
New Revision: 1499538

URL: http://svn.apache.org/r1499538
Log:
EL 3.0
More cosmetic changes to make API diff smaller

Modified:
tomcat/trunk/java/javax/el/ListELResolver.java
tomcat/trunk/java/javax/el/MapELResolver.java
tomcat/trunk/java/javax/el/MethodExpression.java
tomcat/trunk/java/javax/el/ValueExpression.java

Modified: tomcat/trunk/java/javax/el/ListELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ListELResolver.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==
--- tomcat/trunk/java/javax/el/ListELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ListELResolver.java Wed Jul  3 19:51:36 2013
@@ -40,7 +40,7 @@ public class ListELResolver extends ELRe
 }
 
 @Override
-public Object getValue(ELContext context, Object base, Object property) {
+public Class getType(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -50,16 +50,17 @@ public class ListELResolver extends ELRe
 List list = (List) base;
 int idx = coerce(property);
 if (idx < 0 || idx >= list.size()) {
-return null;
+throw new PropertyNotFoundException(
+new ArrayIndexOutOfBoundsException(idx).getMessage());
 }
-return list.get(idx);
+return Object.class;
 }
 
 return null;
 }
 
 @Override
-public Class getType(ELContext context, Object base, Object property) {
+public Object getValue(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -69,10 +70,9 @@ public class ListELResolver extends ELRe
 List list = (List) base;
 int idx = coerce(property);
 if (idx < 0 || idx >= list.size()) {
-throw new PropertyNotFoundException(
-new ArrayIndexOutOfBoundsException(idx).getMessage());
+return null;
 }
-return Object.class;
+return list.get(idx);
 }
 
 return null;

Modified: tomcat/trunk/java/javax/el/MapELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MapELResolver.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==
--- tomcat/trunk/java/javax/el/MapELResolver.java (original)
+++ tomcat/trunk/java/javax/el/MapELResolver.java Wed Jul  3 19:51:36 2013
@@ -41,28 +41,28 @@ public class MapELResolver extends ELRes
 }
 
 @Override
-public Object getValue(ELContext context, Object base, Object property) {
+public Class getType(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
 
 if (base instanceof Map) {
 context.setPropertyResolved(true);
-return ((Map) base).get(property);
+return Object.class;
 }
 
 return null;
 }
 
 @Override
-public Class getType(ELContext context, Object base, Object property) {
+public Object getValue(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
 
 if (base instanceof Map) {
 context.setPropertyResolved(true);
-return Object.class;
+return ((Map) base).get(property);
 }
 
 return null;

Modified: tomcat/trunk/java/javax/el/MethodExpression.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MethodExpression.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==
--- tomcat/trunk/java/javax/el/MethodExpression.java (original)
+++ tomcat/trunk/java/javax/el/MethodExpression.java Wed Jul  3 19:51:36 2013
@@ -20,9 +20,32 @@ public abstract class MethodExpression e
 
 private static final long serialVersionUID = 8163925562047324656L;
 
-public abstract MethodInfo getMethodInfo(ELContext context) throws 
NullPointerException, PropertyNotFoundException, MethodNotFoundException, 
ELException;
+/**
+ * @throws NullPointerException
+ *  If the supplied context is null
+ * @throws PropertyNotFoundException
+ *  If a property/variable resolution failed because no match
+ *  was found or a match was found but was not readable
+ * @throws MethodNotFoundException
+ *  If no matching method can be found
+ * @throws ELException
+ *  Wraps any exception throw whilst resolving the property
+ */
+public abstract MethodInfo getMethodInfo(ELContext conte

svn commit: r1499535 - in /tomcat/trunk/java: javax/el/ javax/servlet/jsp/el/ org/apache/jasper/el/

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 19:37:14 2013
New Revision: 1499535

URL: http://svn.apache.org/r1499535
Log:
EL 3.0
Replace runtime exception declarations with Javadoc to better document API and 
to align code with spec API to aid checking for binary compatibility

Modified:
tomcat/trunk/java/javax/el/ArrayELResolver.java
tomcat/trunk/java/javax/el/BeanELResolver.java
tomcat/trunk/java/javax/el/BeanNameELResolver.java
tomcat/trunk/java/javax/el/CompositeELResolver.java
tomcat/trunk/java/javax/el/ELContext.java
tomcat/trunk/java/javax/el/ELResolver.java
tomcat/trunk/java/javax/el/ListELResolver.java
tomcat/trunk/java/javax/el/MapELResolver.java
tomcat/trunk/java/javax/el/ResourceBundleELResolver.java
tomcat/trunk/java/javax/el/TypeConverter.java
tomcat/trunk/java/javax/servlet/jsp/el/ImplicitObjectELResolver.java
tomcat/trunk/java/javax/servlet/jsp/el/ScopedAttributeELResolver.java
tomcat/trunk/java/org/apache/jasper/el/ELResolverImpl.java

Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=1499535&r1=1499534&r2=1499535&view=diff
==
--- tomcat/trunk/java/javax/el/ArrayELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ArrayELResolver.java Wed Jul  3 19:37:14 2013
@@ -35,8 +35,7 @@ public class ArrayELResolver extends ELR
 }
 
 @Override
-public Class getType(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
+public Class getType(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -52,8 +51,7 @@ public class ArrayELResolver extends ELR
 }
 
 @Override
-public Object getValue(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
+public Object getValue(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -72,9 +70,7 @@ public class ArrayELResolver extends ELR
 
 @Override
 public void setValue(ELContext context, Object base, Object property,
-Object value) throws NullPointerException,
-PropertyNotFoundException, PropertyNotWritableException,
-ELException {
+Object value) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -101,8 +97,7 @@ public class ArrayELResolver extends ELR
 }
 
 @Override
-public boolean isReadOnly(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
+public boolean isReadOnly(ELContext context, Object base, Object property) 
{
 if (context == null) {
 throw new NullPointerException();
 }

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=1499535&r1=1499534&r2=1499535&view=diff
==
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Wed Jul  3 19:37:14 2013
@@ -70,8 +70,7 @@ public class BeanELResolver extends ELRe
 }
 
 @Override
-public Class getType(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
+public Class getType(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -84,8 +83,7 @@ public class BeanELResolver extends ELRe
 }
 
 @Override
-public Object getValue(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
+public Object getValue(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -116,9 +114,7 @@ public class BeanELResolver extends ELRe
 
 @Override
 public void setValue(ELContext context, Object base, Object property,
-Object value) throws NullPointerException,
-PropertyNotFoundException, PropertyNotWritableException,
-ELException {
+Object value) {
 if (context == null) {
 throw new NullPointerException();
 }
@@ -194,8 +190,7 @@ public class BeanELResolver extends ELRe
 }
 
 @Override
-public boolean isReadOnly(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
+public boolean isRead

svn commit: r1499534 - /tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java

2013-07-03 Thread violetagg
Author: violetagg
Date: Wed Jul  3 19:35:38 2013
New Revision: 1499534

URL: http://svn.apache.org/r1499534
Log:
Avoid NPE when a background thread tries to expire the HTTP sessions.

Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java

Modified: 
tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1499534&r1=1499533&r2=1499534&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java 
Wed Jul  3 19:35:38 2013
@@ -367,12 +367,14 @@ public class WsServerContainer extends W
 public void closeAuthenticatedSession(String httpSessionId) {
 Set wsSessions = 
authenticatedSessions.remove(httpSessionId);
 
-for (WsSession wsSession : wsSessions) {
-try {
-wsSession.close(AUTHENTICATED_HTTP_SESSION_CLOSED);
-} catch (IOException e) {
-// Any IOExceptions during close will have been caught and the
-// onError method called.
+if (wsSessions != null && !wsSessions.isEmpty()) {
+for (WsSession wsSession : wsSessions) {
+try {
+wsSession.close(AUTHENTICATED_HTTP_SESSION_CLOSED);
+} catch (IOException e) {
+// Any IOExceptions during close will have been caught and 
the
+// onError method called.
+}
 }
 }
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499523 - /tomcat/trunk/java/javax/el/MethodExpression.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 19:12:20 2013
New Revision: 1499523

URL: http://svn.apache.org/r1499523
Log:
EL 3.0
Adsd new method that addresses typo

Modified:
tomcat/trunk/java/javax/el/MethodExpression.java

Modified: tomcat/trunk/java/javax/el/MethodExpression.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MethodExpression.java?rev=1499523&r1=1499522&r2=1499523&view=diff
==
--- tomcat/trunk/java/javax/el/MethodExpression.java (original)
+++ tomcat/trunk/java/javax/el/MethodExpression.java Wed Jul  3 19:12:20 2013
@@ -14,12 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.el;
 
-/**
- *
- */
 public abstract class MethodExpression extends Expression {
 
 private static final long serialVersionUID = 8163925562047324656L;
@@ -29,12 +25,23 @@ public abstract class MethodExpression e
 public abstract Object invoke(ELContext context, Object[] params) throws 
NullPointerException, PropertyNotFoundException, MethodNotFoundException, 
ELException;
 
 /**
+ * @since EL 3.0
+ */
+public boolean isParametersProvided() {
+// Expected to be over-ridden by implementation
+return false;
+}
+
+/**
  * @since EL 2.2
  *
  * Note: The spelling mistake is deliberate.
  * isParmetersProvided()  - Specification definition
  * isParametersProvided() - Corrected spelling
+ *
+ * @deprecated  Use {@link #isParametersProvided()}
  */
+@Deprecated
 public boolean isParmetersProvided() {
 // Expected to be over-ridden by implementation
 return false;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499521 - in /tomcat/trunk/java/javax/el: MethodInfo.java MethodNotFoundException.java PropertyNotFoundException.java PropertyNotWritableException.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 19:08:58 2013
New Revision: 1499521

URL: http://svn.apache.org/r1499521
Log:
Re-order to simplify checking against EL spec
Remove pointless javadoc

Modified:
tomcat/trunk/java/javax/el/MethodInfo.java
tomcat/trunk/java/javax/el/MethodNotFoundException.java
tomcat/trunk/java/javax/el/PropertyNotFoundException.java
tomcat/trunk/java/javax/el/PropertyNotWritableException.java

Modified: tomcat/trunk/java/javax/el/MethodInfo.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MethodInfo.java?rev=1499521&r1=1499520&r2=1499521&view=diff
==
--- tomcat/trunk/java/javax/el/MethodInfo.java (original)
+++ tomcat/trunk/java/javax/el/MethodInfo.java Wed Jul  3 19:08:58 2013
@@ -14,12 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.el;
 
-/**
- *
- */
 public class MethodInfo {
 
 private final String name;
@@ -28,9 +24,6 @@ public class MethodInfo {
 
 private final Class returnType;
 
-/**
- *
- */
 public MethodInfo(String name, Class returnType, Class[] paramTypes) 
{
 this.name = name;
 this.returnType = returnType;
@@ -41,12 +34,11 @@ public class MethodInfo {
 return this.name;
 }
 
-public Class[] getParamTypes() {
-return this.paramTypes;
-}
-
 public Class getReturnType() {
 return this.returnType;
 }
 
+public Class[] getParamTypes() {
+return this.paramTypes;
+}
 }

Modified: tomcat/trunk/java/javax/el/MethodNotFoundException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MethodNotFoundException.java?rev=1499521&r1=1499520&r2=1499521&view=diff
==
--- tomcat/trunk/java/javax/el/MethodNotFoundException.java (original)
+++ tomcat/trunk/java/javax/el/MethodNotFoundException.java Wed Jul  3 19:08:58 
2013
@@ -14,42 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.el;
 
-/**
- *
- */
 public class MethodNotFoundException extends ELException {
 
 private static final long serialVersionUID = -3631968116081480328L;
 
-/**
- *
- */
 public MethodNotFoundException() {
 super();
 }
 
-/**
- * @param message
- */
 public MethodNotFoundException(String message) {
 super(message);
 }
 
-/**
- * @param message
- * @param cause
- */
-public MethodNotFoundException(String message, Throwable cause) {
-super(message, cause);
-}
-
-/**
- * @param cause
- */
 public MethodNotFoundException(Throwable cause) {
 super(cause);
 }
+
+public MethodNotFoundException(String message, Throwable cause) {
+super(message, cause);
+}
 }

Modified: tomcat/trunk/java/javax/el/PropertyNotFoundException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/PropertyNotFoundException.java?rev=1499521&r1=1499520&r2=1499521&view=diff
==
--- tomcat/trunk/java/javax/el/PropertyNotFoundException.java (original)
+++ tomcat/trunk/java/javax/el/PropertyNotFoundException.java Wed Jul  3 
19:08:58 2013
@@ -14,43 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.el;
 
-/**
- *
- */
 public class PropertyNotFoundException extends ELException {
 
 private static final long serialVersionUID = -3799200961303506745L;
 
-/**
- *
- */
 public PropertyNotFoundException() {
 super();
 }
 
-/**
- * @param message
- */
 public PropertyNotFoundException(String message) {
 super(message);
 }
 
-/**
- * @param message
- * @param cause
- */
-public PropertyNotFoundException(String message, Throwable cause) {
-super(message, cause);
-}
-
-/**
- * @param cause
- */
 public PropertyNotFoundException(Throwable cause) {
 super(cause);
 }
 
+public PropertyNotFoundException(String message, Throwable cause) {
+super(message, cause);
+}
 }

Modified: tomcat/trunk/java/javax/el/PropertyNotWritableException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/PropertyNotWritableException.java?rev=1499521&r1=1499520&r2=1499521&view=diff
==
--- tomcat/trunk/java/javax/el/PropertyNotWritableException.java (original)
+++ tomcat/trunk/java/javax/el/PropertyNotWritableException.java Wed Jul  3 
19:08:58 2013
@@ -14,42 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.

svn commit: r1499520 - /tomcat/trunk/java/javax/el/ResourceBundleELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 19:06:35 2013
New Revision: 1499520

URL: http://svn.apache.org/r1499520
Log:
API has been fixed in EL 3.0

Modified:
tomcat/trunk/java/javax/el/ResourceBundleELResolver.java

Modified: tomcat/trunk/java/javax/el/ResourceBundleELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ResourceBundleELResolver.java?rev=1499520&r1=1499519&r2=1499520&view=diff
==
--- tomcat/trunk/java/javax/el/ResourceBundleELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ResourceBundleELResolver.java Wed Jul  3 
19:06:35 2013
@@ -101,10 +101,7 @@ public class ResourceBundleELResolver ex
 }
 
 @Override
-// Can't use Iterator because API needs to match
-// specification
-@SuppressWarnings({ "unchecked", "rawtypes" })
-public Iterator getFeatureDescriptors(
+public Iterator getFeatureDescriptors(
 ELContext context, Object base) {
 if (base instanceof ResourceBundle) {
 List feats = new ArrayList<>();



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499518 - /tomcat/trunk/java/javax/el/TypeConverter.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 19:03:54 2013
New Revision: 1499518

URL: http://svn.apache.org/r1499518
Log:
EL 3.0
Implement new abstract class

Added:
tomcat/trunk/java/javax/el/TypeConverter.java   (with props)

Added: tomcat/trunk/java/javax/el/TypeConverter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/TypeConverter.java?rev=1499518&view=auto
==
--- tomcat/trunk/java/javax/el/TypeConverter.java (added)
+++ tomcat/trunk/java/javax/el/TypeConverter.java Wed Jul  3 19:03:54 2013
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.Iterator;
+
+/**
+ * @since EL 3.0
+ */
+public abstract class TypeConverter extends ELResolver {
+
+@Override
+public Object getValue(ELContext context, Object base, Object property)
+throws NullPointerException, PropertyNotFoundException, 
ELException {
+return null;
+}
+
+@Override
+public Class getType(ELContext context, Object base, Object property)
+throws NullPointerException, PropertyNotFoundException, 
ELException {
+return null;
+}
+
+@Override
+public void setValue(ELContext context, Object base, Object property,
+Object value) throws NullPointerException,
+PropertyNotFoundException, PropertyNotWritableException,
+ELException {
+// NO-OP
+}
+
+@Override
+public boolean isReadOnly(ELContext context, Object base, Object property)
+throws NullPointerException, PropertyNotFoundException, 
ELException {
+return false;
+}
+
+@Override
+public Iterator getFeatureDescriptors(ELContext context,
+Object base) {
+return null;
+}
+
+@Override
+public Class getCommonPropertyType(ELContext context, Object base) {
+return null;
+}
+
+@Override
+public abstract Object convertToType(ELContext context, Object obj,
+Class type);
+}

Propchange: tomcat/trunk/java/javax/el/TypeConverter.java
--
svn:eol-style = native



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499514 - /tomcat/trunk/java/javax/el/StaticFieldELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 18:57:34 2013
New Revision: 1499514

URL: http://svn.apache.org/r1499514
Log:
Needs to extend ELResolver

Modified:
tomcat/trunk/java/javax/el/StaticFieldELResolver.java

Modified: tomcat/trunk/java/javax/el/StaticFieldELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/StaticFieldELResolver.java?rev=1499514&r1=1499513&r2=1499514&view=diff
==
--- tomcat/trunk/java/javax/el/StaticFieldELResolver.java (original)
+++ tomcat/trunk/java/javax/el/StaticFieldELResolver.java Wed Jul  3 18:57:34 
2013
@@ -27,8 +27,9 @@ import java.util.Iterator;
 /**
  * @since EL 3.0
  */
-public class StaticFieldELResolver {
+public class StaticFieldELResolver extends ELResolver {
 
+@Override
 public Object getValue(ELContext context, Object base, Object property) {
 
 if (context == null) {
@@ -64,13 +65,7 @@ public class StaticFieldELResolver {
 }
 
 
-/**
- *
- * @param context
- * @param base
- * @param property
- * @param value
- */
+@Override
 public void setValue(ELContext context, Object base, Object property,
 Object value) {
 
@@ -89,6 +84,7 @@ public class StaticFieldELResolver {
 }
 
 
+@Override
 public Object invoke(ELContext context, Object base, Object method,
 Class[] paramTypes, Object[] params) {
 
@@ -160,6 +156,7 @@ public class StaticFieldELResolver {
 return null;
 }
 
+@Override
 public Class getType(ELContext context, Object base, Object property) {
 if (context == null) {
 throw new NullPointerException();
@@ -194,6 +191,7 @@ public class StaticFieldELResolver {
 }
 
 
+@Override
 public boolean isReadOnly(ELContext context, Object base, Object property) 
{
 if (context == null) {
 throw new NullPointerException();
@@ -210,10 +208,8 @@ public class StaticFieldELResolver {
 
 /**
  * Always returns null.
- *
- * @param context
- * @param base
  */
+@Override
 public Iterator getFeatureDescriptors(ELContext context,
 Object base) {
 return null;
@@ -221,10 +217,8 @@ public class StaticFieldELResolver {
 
 /**
  * Always returns String.class.
- *
- * @param context
- * @param base
  */
+@Override
 public Class getCommonPropertyType(ELContext context, Object base) {
 return String.class;
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499513 - in /tomcat/trunk/java/javax/el: BeanELResolver.java LocalStrings.properties StaticFieldELResolver.java Util.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 18:56:14 2013
New Revision: 1499513

URL: http://svn.apache.org/r1499513
Log:
EL 3.0
Implement new class
Refactor common code to Util class

Added:
tomcat/trunk/java/javax/el/StaticFieldELResolver.java   (with props)
Modified:
tomcat/trunk/java/javax/el/BeanELResolver.java
tomcat/trunk/java/javax/el/LocalStrings.properties
tomcat/trunk/java/javax/el/Util.java

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=1499513&r1=1499512&r2=1499513&view=diff
==
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Wed Jul  3 18:56:14 2013
@@ -22,10 +22,8 @@ import java.beans.FeatureDescriptor;
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
 import java.beans.PropertyDescriptor;
-import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Arrays;
@@ -168,93 +166,26 @@ public class BeanELResolver extends ELRe
 return null;
 }
 
-ExpressionFactory factory = ExpressionFactory.newInstance();
+ExpressionFactory factory = Util.getExpressionFactory();
 
 String methodName = (String) factory.coerceToType(method, 
String.class);
 
 // Find the matching method
-Method matchingMethod = null;
-Class clazz = base.getClass();
-if (paramTypes != null) {
-try {
-matchingMethod =
-getMethod(clazz, clazz.getMethod(methodName, paramTypes));
-} catch (NoSuchMethodException e) {
-throw new MethodNotFoundException(e);
-}
-} else {
-int paramCount = 0;
-if (params != null) {
-paramCount = params.length;
-}
-Method[] methods = clazz.getMethods();
-for (Method m : methods) {
-if (methodName.equals(m.getName())) {
-if (m.getParameterTypes().length == paramCount) {
-// Same number of parameters - use the first match
-matchingMethod = getMethod(clazz, m);
-break;
-}
-if (m.isVarArgs()
-&& paramCount > m.getParameterTypes().length - 2) {
-matchingMethod = getMethod(clazz, m);
-}
-}
-}
-if (matchingMethod == null) {
-throw new MethodNotFoundException(
-"Unable to find method [" + methodName + "] with ["
-+ paramCount + "] parameters");
-}
-}
+Method matchingMethod =
+Util.findMethod(base, methodName, paramTypes, params);
+
+Object[] parameters = Util.buildParameters(
+matchingMethod.getParameterTypes(), matchingMethod.isVarArgs(),
+params);
 
-Class[] parameterTypes = matchingMethod.getParameterTypes();
-Object[] parameters = null;
-if (parameterTypes.length > 0) {
-parameters = new Object[parameterTypes.length];
-@SuppressWarnings("null")  // params.length >= 
parameterTypes.length
-int paramCount = params.length;
-if (matchingMethod.isVarArgs()) {
-int varArgIndex = parameterTypes.length - 1;
-// First argCount-1 parameters are standard
-for (int i = 0; (i < varArgIndex); i++) {
-parameters[i] = factory.coerceToType(params[i],
-parameterTypes[i]);
-}
-// Last parameter is the varargs
-Class varArgClass =
-parameterTypes[varArgIndex].getComponentType();
-final Object varargs = Array.newInstance(
-varArgClass,
-(paramCount - varArgIndex));
-for (int i = (varArgIndex); i < paramCount; i++) {
-Array.set(varargs, i - varArgIndex,
-factory.coerceToType(params[i], varArgClass));
-}
-parameters[varArgIndex] = varargs;
-} else {
-parameters = new Object[parameterTypes.length];
-for (int i = 0; i < parameterTypes.length; i++) {
-parameters[i] = factory.coerceToType(params[i],
-parameterTypes[i]);
-}
-}
-}
 Object result = null;
 try {
 result = matchingMethod.invoke(base, parameters);
-

svn commit: r1499430 - /tomcat/trunk/java/javax/el/ValueExpression.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 14:53:13 2013
New Revision: 1499430

URL: http://svn.apache.org/r1499430
Log:
Re-order to simplify checking against EL spec

Modified:
tomcat/trunk/java/javax/el/ValueExpression.java

Modified: tomcat/trunk/java/javax/el/ValueExpression.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ValueExpression.java?rev=1499430&r1=1499429&r2=1499430&view=diff
==
--- tomcat/trunk/java/javax/el/ValueExpression.java (original)
+++ tomcat/trunk/java/javax/el/ValueExpression.java Wed Jul  3 14:53:13 2013
@@ -24,15 +24,15 @@ public abstract class ValueExpression ex
 
 private static final long serialVersionUID = 8577809572381654673L;
 
-public abstract Class getExpectedType();
+public abstract Object getValue(ELContext context) throws 
NullPointerException, PropertyNotFoundException, ELException;
 
-public abstract Class getType(ELContext context) throws 
NullPointerException, PropertyNotFoundException, ELException;
+public abstract void setValue(ELContext context, Object value) throws 
NullPointerException, PropertyNotFoundException, PropertyNotWritableException, 
ELException;
 
 public abstract boolean isReadOnly(ELContext context) throws 
NullPointerException, PropertyNotFoundException, ELException;
 
-public abstract void setValue(ELContext context, Object value) throws 
NullPointerException, PropertyNotFoundException, PropertyNotWritableException, 
ELException;
+public abstract Class getType(ELContext context) throws 
NullPointerException, PropertyNotFoundException, ELException;
 
-public abstract Object getValue(ELContext context) throws 
NullPointerException, PropertyNotFoundException, ELException;
+public abstract Class getExpectedType();
 
 /**
  * @since EL 2.2



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499428 - /tomcat/trunk/java/javax/el/Expression.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 14:50:38 2013
New Revision: 1499428

URL: http://svn.apache.org/r1499428
Log:
Re-order to simplify checking against EL spec

Modified:
tomcat/trunk/java/javax/el/Expression.java

Modified: tomcat/trunk/java/javax/el/Expression.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/Expression.java?rev=1499428&r1=1499427&r2=1499428&view=diff
==
--- tomcat/trunk/java/javax/el/Expression.java (original)
+++ tomcat/trunk/java/javax/el/Expression.java Wed Jul  3 14:50:38 2013
@@ -26,14 +26,14 @@ public abstract class Expression impleme
 
 private static final long serialVersionUID = -6663767980471823812L;
 
+public abstract String getExpressionString();
+
 @Override
 public abstract boolean equals(Object obj);
 
 @Override
 public abstract int hashCode();
 
-public abstract String getExpressionString();
-
 public abstract boolean isLiteralText();
 
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499419 - in /tomcat/trunk: java/org/apache/el/lang/VariableMapperImpl.java java/org/apache/jasper/el/ELContextImpl.java test/javax/el/TestBeanELResolverVarargsInvocation.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 14:27:46 2013
New Revision: 1499419

URL: http://svn.apache.org/r1499419
Log:
Noticed requirement for null values to trigger removal when reading the EL 3.0 
spec.

Modified:
tomcat/trunk/java/org/apache/el/lang/VariableMapperImpl.java
tomcat/trunk/java/org/apache/jasper/el/ELContextImpl.java
tomcat/trunk/test/javax/el/TestBeanELResolverVarargsInvocation.java

Modified: tomcat/trunk/java/org/apache/el/lang/VariableMapperImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/VariableMapperImpl.java?rev=1499419&r1=1499418&r2=1499419&view=diff
==
--- tomcat/trunk/java/org/apache/el/lang/VariableMapperImpl.java (original)
+++ tomcat/trunk/java/org/apache/el/lang/VariableMapperImpl.java Wed Jul  3 
14:27:46 2013
@@ -45,7 +45,11 @@ public class VariableMapperImpl extends 
 @Override
 public ValueExpression setVariable(String variable,
 ValueExpression expression) {
-return this.vars.put(variable, expression);
+if (expression == null) {
+return vars.remove(variable);
+} else {
+return vars.put(variable, expression);
+}
 }
 
 @Override

Modified: tomcat/trunk/java/org/apache/jasper/el/ELContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/el/ELContextImpl.java?rev=1499419&r1=1499418&r2=1499419&view=diff
==
--- tomcat/trunk/java/org/apache/jasper/el/ELContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/el/ELContextImpl.java Wed Jul  3 
14:27:46 2013
@@ -63,11 +63,15 @@ public final class ELContextImpl extends
 @Override
 public ValueExpression setVariable(String variable,
 ValueExpression expression) {
-if (vars == null)
+if (vars == null) {
 vars = new HashMap<>();
-return vars.put(variable, expression);
+}
+if (expression == null) {
+return vars.remove(variable);
+} else {
+return vars.put(variable, expression);
+}
 }
-
 }
 
 private static final ELResolver DefaultResolver;

Modified: tomcat/trunk/test/javax/el/TestBeanELResolverVarargsInvocation.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/javax/el/TestBeanELResolverVarargsInvocation.java?rev=1499419&r1=1499418&r2=1499419&view=diff
==
--- tomcat/trunk/test/javax/el/TestBeanELResolverVarargsInvocation.java 
(original)
+++ tomcat/trunk/test/javax/el/TestBeanELResolverVarargsInvocation.java Wed Jul 
 3 14:27:46 2013
@@ -60,7 +60,11 @@ public class TestBeanELResolverVarargsIn
 @Override
 public ValueExpression setVariable(String arg0,
 ValueExpression arg1) {
-return vars.put(arg0, arg1);
+if (arg1 == null) {
+return vars.remove(arg0);
+} else {
+return vars.put(arg0, arg1);
+}
 }
 
 @Override



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499397 - /tomcat/trunk/java/javax/el/ELException.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 13:38:18 2013
New Revision: 1499397

URL: http://svn.apache.org/r1499397
Log:
Re-order to simplify checking against EL spec

Modified:
tomcat/trunk/java/javax/el/ELException.java

Modified: tomcat/trunk/java/javax/el/ELException.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELException.java?rev=1499397&r1=1499396&r2=1499397&view=diff
==
--- tomcat/trunk/java/javax/el/ELException.java (original)
+++ tomcat/trunk/java/javax/el/ELException.java Wed Jul  3 13:38:18 2013
@@ -45,24 +45,24 @@ public class ELException extends Runtime
 }
 
 /**
- * Creates an ELException with the given detail message and root cause.
+ * Creates an ELException with the given cause
  *
- * @param message
- *the detail message
  * @param cause
  *the originating cause of this exception
  */
-public ELException(String message, Throwable cause) {
-super(message, cause);
+public ELException(Throwable cause) {
+super(cause);
 }
 
 /**
- * Creates an ELException with the given cause
+ * Creates an ELException with the given detail message and root cause.
  *
+ * @param message
+ *the detail message
  * @param cause
  *the originating cause of this exception
  */
-public ELException(Throwable cause) {
-super(cause);
+public ELException(String message, Throwable cause) {
+super(message, cause);
 }
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499396 - /tomcat/trunk/java/javax/el/ELContext.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 13:37:05 2013
New Revision: 1499396

URL: http://svn.apache.org/r1499396
Log:
EL 3.0
Implement new methods

Modified:
tomcat/trunk/java/javax/el/ELContext.java

Modified: tomcat/trunk/java/javax/el/ELContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELContext.java?rev=1499396&r1=1499395&r2=1499396&view=diff
==
--- tomcat/trunk/java/javax/el/ELContext.java (original)
+++ tomcat/trunk/java/javax/el/ELContext.java Wed Jul  3 13:37:05 2013
@@ -17,7 +17,9 @@
 package javax.el;
 
 import java.util.ArrayList;
+import java.util.Deque;
 import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -34,6 +36,8 @@ public abstract class ELContext {
 
 private List listeners = new ArrayList<>();
 
+private Deque> lambdaArguments = new LinkedList<>();
+
 public ELContext() {
 this.resolved = false;
 }
@@ -159,6 +163,45 @@ public abstract class ELContext {
 /**
  * @since EL 3.0
  */
+public boolean isLambdaArgument(String name) {
+for (Map arguments : lambdaArguments) {
+if (arguments.containsKey(name)) {
+return true;
+}
+}
+return false;
+}
+
+/**
+ * @since EL 3.0
+ */
+public Object getLambdaArgument(String name) {
+for (Map arguments : lambdaArguments) {
+Object result = arguments.get(name);
+if (result != null) {
+return result;
+}
+}
+return null;
+}
+
+/**
+ * @since EL 3.0
+ */
+public void enterLambdaScope(Map arguments) {
+lambdaArguments.push(arguments);
+}
+
+/**
+ * @since EL 3.0
+ */
+public void exitLambdaScope() {
+lambdaArguments.pop();
+}
+
+/**
+ * @since EL 3.0
+ */
 public Object convertToType(Object obj, Class type) {
 
 boolean originalResolved = isPropertyResolved();



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499388 - in /tomcat/trunk/java/javax/el: ELContext.java Util.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 13:17:50 2013
New Revision: 1499388

URL: http://svn.apache.org/r1499388
Log:
EL 3.0
Implement new method
Creating ExpressionFactory instances is relatively expensive so they need to be 
cached but caching them is a potential memory leak since applications may ship 
their own implementations. Copy the caching approach from the ExpressionFactory 
implementation.

Modified:
tomcat/trunk/java/javax/el/ELContext.java
tomcat/trunk/java/javax/el/Util.java

Modified: tomcat/trunk/java/javax/el/ELContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELContext.java?rev=1499388&r1=1499387&r2=1499388&view=diff
==
--- tomcat/trunk/java/javax/el/ELContext.java (original)
+++ tomcat/trunk/java/javax/el/ELContext.java Wed Jul  3 13:17:50 2013
@@ -155,4 +155,23 @@ public abstract class ELContext {
 }
 }
 }
+
+/**
+ * @since EL 3.0
+ */
+public Object convertToType(Object obj, Class type) {
+
+boolean originalResolved = isPropertyResolved();
+try {
+ELResolver resolver = getELResolver();
+Object result = resolver.convertToType(this, obj, type);
+if (isPropertyResolved()) {
+return result;
+}
+} finally {
+setPropertyResolved(originalResolved);
+}
+
+return Util.getExpressionFactory().coerceToType(type, type);
+}
 }

Modified: tomcat/trunk/java/javax/el/Util.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/Util.java?rev=1499388&r1=1499387&r2=1499388&view=diff
==
--- tomcat/trunk/java/javax/el/Util.java (original)
+++ tomcat/trunk/java/javax/el/Util.java Wed Jul  3 13:17:50 2013
@@ -16,10 +16,16 @@
  */
 package javax.el;
 
+import java.lang.ref.WeakReference;
 import java.text.MessageFormat;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 class Util {
 
@@ -38,6 +44,7 @@ class Util {
 // All other instances of Throwable will be silently swallowed
 }
 
+
 static String message(ELContext context, String name, Object... props) {
 Locale locale = null;
 if (context != null) {
@@ -64,4 +71,112 @@ class Util {
 }
 
 
+private static final CacheValue nullTcclFactory = new CacheValue();
+private static final ConcurrentMap factoryCache =
+new ConcurrentHashMap<>();
+
+/**
+ * Provides a per class loader cache of ExpressionFactory instances without
+ * pinning any in memory as that could trigger a memory leak.
+ */
+static ExpressionFactory getExpressionFactory() {
+
+ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+CacheValue cacheValue = null;
+ExpressionFactory factory = null;
+
+if (tccl == null) {
+cacheValue = nullTcclFactory;
+} else {
+CacheKey key = new CacheKey(tccl);
+cacheValue = factoryCache.get(key);
+if (cacheValue == null) {
+CacheValue newCacheValue = new CacheValue();
+cacheValue = factoryCache.putIfAbsent(key, newCacheValue);
+if (cacheValue == null) {
+cacheValue = newCacheValue;
+}
+}
+}
+
+final Lock readLock = cacheValue.getLock().readLock();
+readLock.lock();
+try {
+factory = cacheValue.getExpressionFactory();
+} finally {
+readLock.unlock();
+}
+
+if (factory == null) {
+final Lock writeLock = cacheValue.getLock().writeLock();
+try {
+writeLock.lock();
+factory = cacheValue.getExpressionFactory();
+if (factory == null) {
+factory = ExpressionFactory.newInstance();
+cacheValue.setExpressionFactory(factory);
+}
+} finally {
+writeLock.unlock();
+}
+}
+
+return factory;
+}
+
+
+/**
+ * Key used to cache default ExpressionFactory information per class
+ * loader. The class loader reference is never {@code null}, because
+ * {@code null} tccl is handled separately.
+ */
+private static class CacheKey {
+private final int hash;
+private final WeakReference ref;
+
+public CacheKey(ClassLoader key) {
+hash = key.hashCode();
+ref = new WeakReference<>(key);
+}
+
+@Override
+public int hashCode() {
+  

svn commit: r1499371 - in /tomcat/trunk/java/javax/el: ArrayELResolver.java BeanELResolver.java ELContext.java ELResolver.java EvaluationListener.java ImportHandler.java ListELResolver.java MapELResol

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 12:45:46 2013
New Revision: 1499371

URL: http://svn.apache.org/r1499371
Log:
EL 3.0
Implement new EvaluationListener class
Create new Util class
Refactor i18n support

Added:
tomcat/trunk/java/javax/el/EvaluationListener.java   (with props)
tomcat/trunk/java/javax/el/Util.java   (with props)
Modified:
tomcat/trunk/java/javax/el/ArrayELResolver.java
tomcat/trunk/java/javax/el/BeanELResolver.java
tomcat/trunk/java/javax/el/ELContext.java
tomcat/trunk/java/javax/el/ELResolver.java
tomcat/trunk/java/javax/el/ImportHandler.java
tomcat/trunk/java/javax/el/ListELResolver.java
tomcat/trunk/java/javax/el/MapELResolver.java
tomcat/trunk/java/javax/el/ResourceBundleELResolver.java

Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=1499371&r1=1499370&r2=1499371&view=diff
==
--- tomcat/trunk/java/javax/el/ArrayELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ArrayELResolver.java Wed Jul  3 12:45:46 2013
@@ -83,7 +83,7 @@ public class ArrayELResolver extends ELR
 context.setPropertyResolved(true);
 
 if (this.readOnly) {
-throw new PropertyNotWritableException(message(context,
+throw new PropertyNotWritableException(Util.message(context,
 "resolverNotWriteable", base.getClass().getName()));
 }
 
@@ -92,7 +92,7 @@ public class ArrayELResolver extends ELR
 if (value != null &&
 !base.getClass().getComponentType().isAssignableFrom(
 value.getClass())) {
-throw new ClassCastException(message(context,
+throw new ClassCastException(Util.message(context,
 "objectNotAssignable", value.getClass().getName(),
 base.getClass().getComponentType().getName()));
 }

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=1499371&r1=1499370&r2=1499371&view=diff
==
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Wed Jul  3 12:45:46 2013
@@ -109,7 +109,7 @@ public class BeanELResolver extends ELRe
 if (cause instanceof VirtualMachineError) {
 throw (VirtualMachineError) cause;
 }
-throw new ELException(message(context, "propertyReadError",
+throw new ELException(Util.message(context, "propertyReadError",
 base.getClass().getName(), property.toString()), cause);
 } catch (Exception e) {
 throw new ELException(e);
@@ -131,7 +131,7 @@ public class BeanELResolver extends ELRe
 context.setPropertyResolved(true);
 
 if (this.readOnly) {
-throw new PropertyNotWritableException(message(context,
+throw new PropertyNotWritableException(Util.message(context,
 "resolverNotWriteable", base.getClass().getName()));
 }
 
@@ -148,7 +148,7 @@ public class BeanELResolver extends ELRe
 if (cause instanceof VirtualMachineError) {
 throw (VirtualMachineError) cause;
 }
-throw new ELException(message(context, "propertyWriteError",
+throw new ELException(Util.message(context, "propertyWriteError",
 base.getClass().getName(), property.toString()), cause);
 } catch (Exception e) {
 throw new ELException(e);
@@ -338,7 +338,7 @@ public class BeanELResolver extends ELRe
 private BeanProperty get(ELContext ctx, String name) {
 BeanProperty property = this.properties.get(name);
 if (property == null) {
-throw new PropertyNotFoundException(message(ctx,
+throw new PropertyNotFoundException(Util.message(ctx,
 "propertyNotFound", type.getName(), name));
 }
 return property;
@@ -393,7 +393,7 @@ public class BeanELResolver extends ELRe
 if (this.write == null) {
 this.write = getMethod(this.owner, 
descriptor.getWriteMethod());
 if (this.write == null) {
-throw new PropertyNotFoundException(message(ctx,
+throw new PropertyNotFoundException(Util.message(ctx,
 "propertyNotWritable", new Object[] {
 owner.getName(), descriptor.getName() }));
 }
@@ -405,7 +405,7 @@ public class BeanELResolver extends ELRe
 if (this.read == null) {
 this.read = getMethod(this.owner, descriptor.getReadMethod());
  

svn commit: r1499367 - /tomcat/trunk/java/javax/el/LocalStrings.properties

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 12:41:46 2013
New Revision: 1499367

URL: http://svn.apache.org/r1499367
Log:
Add the i18n messages for the import handler

Modified:
tomcat/trunk/java/javax/el/LocalStrings.properties

Modified: tomcat/trunk/java/javax/el/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/LocalStrings.properties?rev=1499367&r1=1499366&r2=1499367&view=diff
==
--- tomcat/trunk/java/javax/el/LocalStrings.properties (original)
+++ tomcat/trunk/java/javax/el/LocalStrings.properties Wed Jul  3 12:41:46 2013
@@ -22,3 +22,12 @@ propertyNotWritable=Property ''{1}'' not
 propertyReadError=Error reading ''{1}'' on type {0}
 propertyWriteError=Error writing ''{1}'' on type {0}
 objectNotAssignable=Unable to add an object of type [{0}] to an array of 
objects of type [{1}]
+
+importHandler.ambiguousImport=The class [{0}] could not be imported as it 
conflicts with [{1}] which has already been imported
+importHandler.ambiguousStaticImport=The static import [{0}] could not be 
processed as it conflicts with [{1}] which has already been imported
+importHandler.classNotFound=The class [{0}] could not be imported as it could 
not be found
+importHandler.invalidClass=The class [{0}] must be public, non-abstract and 
not an interface
+importHandler.invalidClassName=Name of class to import [{0}] must include a 
package
+importHandler.invalidClassNameForStatic=The class [{0}] specified for static 
import [{1}] is not valid
+importHandler.invalidStaticName=Name of static method or field to import [{0}] 
must include a class
+importHandler.staticNotFound=The static import [{0}] could not be found in 
class [{1}] for import [{2}]
\ No newline at end of file



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 55171] [jsr 356] All server threads become blocked after some websocket testing

2013-07-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55171

--- Comment #4 from Stoyan Boshev  ---
Created attachment 30530
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30530&action=edit
thread stack dump 2

I was able to reproduce again. Attaching the new tread stack dump as there is
some difference.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499341 - /tomcat/trunk/java/javax/el/ImportHandler.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 11:55:56 2013
New Revision: 1499341

URL: http://svn.apache.org/r1499341
Log:
EL 3.0
Implement new class

Added:
tomcat/trunk/java/javax/el/ImportHandler.java   (with props)

Added: tomcat/trunk/java/javax/el/ImportHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ImportHandler.java?rev=1499341&view=auto
==
--- tomcat/trunk/java/javax/el/ImportHandler.java (added)
+++ tomcat/trunk/java/javax/el/ImportHandler.java Wed Jul  3 11:55:56 2013
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.el;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @since EL 3.0
+ */
+public class ImportHandler {
+
+private List packages = new ArrayList<>();
+private Map> clazzes = new HashMap<>();
+private Map> statics = new HashMap<>();
+
+
+public ImportHandler() {
+importPackage("java.lang");
+}
+
+
+public void importStatic(String name) throws javax.el.ELException {
+int lastPeriod = name.lastIndexOf('.');
+
+if (lastPeriod < 0) {
+throw new ELException(ELResolver.message(
+null, "importHandler.invalidStaticName", name));
+}
+
+String className = name.substring(0, lastPeriod - 1);
+String fieldOrMethodName = name.substring(lastPeriod + 1);
+
+Class clazz = findClass(className);
+
+if (clazz == null) {
+throw new ELException(ELResolver.message(
+null, "importHandler.invalidClassNameForStatic",
+className, name));
+}
+
+boolean found = false;
+
+for (Field field : clazz.getFields()) {
+if (field.getName().equals(fieldOrMethodName)) {
+found = true;
+break;
+}
+}
+
+if (!found) {
+for (Method method : clazz.getMethods()) {
+if (method.getName().equals(fieldOrMethodName)) {
+found = true;
+break;
+}
+}
+}
+
+if (!found) {
+throw new ELException(ELResolver.message(null,
+"importHandler.staticNotFound", fieldOrMethodName,
+className, name));
+}
+
+Class conflict = statics.get(fieldOrMethodName);
+if (conflict != null) {
+throw new ELException(ELResolver.message(null,
+"importHandler.ambiguousStaticImport", name,
+conflict.getName() + '.' +  fieldOrMethodName));
+}
+
+statics.put(fieldOrMethodName, clazz);
+}
+
+
+public void importClass(String name) throws javax.el.ELException {
+if (!name.contains(".")) {
+throw new ELException(ELResolver.message(
+null, "importHandler.invalidClassName", name));
+}
+
+Class clazz = findClass(name);
+
+if (clazz == null) {
+throw new ELException(ELResolver.message(
+null, "importHandler.classNotFound", name));
+}
+}
+
+
+public void importPackage(String name) {
+// Import ambiguity is handled at resolution, not at import
+Package p = Package.getPackage(name);
+if (p == null) {
+throw new IllegalArgumentException(ELResolver.message(
+null, "importHandler.invalidPackage", name));
+}
+packages.add(name);
+}
+
+
+public java.lang.Class resolveClass(String name) {
+Class result = clazzes.get(name);
+
+if (result == null) {
+// Search the package imports
+for (String p : packages) {
+String className = p + '.' + name;
+result = findClass(className);
+if (result != null) {
+break;
+}
+}
+}
+
+return result;
+}
+
+
+public java.lang.Class resolveStatic(St

[Bug 55189] Unable to start the server

2013-07-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55189

--- Comment #3 from guillaume.mich...@amadeus.com ---
Thanks for your very kind answer and quick response.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat 7.0.42

2013-07-03 Thread Brian Burch

On 02/07/13 10:18, Mark Thomas wrote:

The proposed Apache Tomcat 7.0.42 release is now available for voting.

It can be obtained from:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.42/
The Maven staging repo is:
https://repository.apache.org/content/repositories/orgapachetomcat-098/
The svn tag is:
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_42/

The proposed 7.0.42 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 7.0.42 Stable

Cheers,

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[X] Stable - go ahead and release as 7.0.42 Stable

Validate, build, release OK on linux java-6-openjdk
Tests OK on linux java-7-openjdk
Running OK on linux java-6-sun

also, JNDIRealm with LDAP hashed passwords is fine.

Brian


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499318 - in /tomcat/trunk/java/javax/el: ArrayELResolver.java BeanELResolver.java ELResolver.java ListELResolver.java MapELResolver.java ResourceBundleELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 10:53:17 2013
New Revision: 1499318

URL: http://svn.apache.org/r1499318
Log:
Switch to varargs for simpler code

Modified:
tomcat/trunk/java/javax/el/ArrayELResolver.java
tomcat/trunk/java/javax/el/BeanELResolver.java
tomcat/trunk/java/javax/el/ELResolver.java
tomcat/trunk/java/javax/el/ListELResolver.java
tomcat/trunk/java/javax/el/MapELResolver.java
tomcat/trunk/java/javax/el/ResourceBundleELResolver.java

Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=1499318&r1=1499317&r2=1499318&view=diff
==
--- tomcat/trunk/java/javax/el/ArrayELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ArrayELResolver.java Wed Jul  3 10:53:17 2013
@@ -84,8 +84,7 @@ public class ArrayELResolver extends ELR
 
 if (this.readOnly) {
 throw new PropertyNotWritableException(message(context,
-"resolverNotWriteable", new Object[] { base.getClass()
-.getName() }));
+"resolverNotWriteable", base.getClass().getName()));
 }
 
 int idx = coerce(property);
@@ -94,9 +93,8 @@ public class ArrayELResolver extends ELR
 !base.getClass().getComponentType().isAssignableFrom(
 value.getClass())) {
 throw new ClassCastException(message(context,
-"objectNotAssignable",
-new Object[] {value.getClass().getName(),
-base.getClass().getComponentType().getName()}));
+"objectNotAssignable", value.getClass().getName(),
+base.getClass().getComponentType().getName()));
 }
 Array.set(base, idx, value);
 }

Modified: tomcat/trunk/java/javax/el/BeanELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanELResolver.java?rev=1499318&r1=1499317&r2=1499318&view=diff
==
--- tomcat/trunk/java/javax/el/BeanELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanELResolver.java Wed Jul  3 10:53:17 2013
@@ -110,8 +110,7 @@ public class BeanELResolver extends ELRe
 throw (VirtualMachineError) cause;
 }
 throw new ELException(message(context, "propertyReadError",
-new Object[] { base.getClass().getName(),
-property.toString() }), cause);
+base.getClass().getName(), property.toString()), cause);
 } catch (Exception e) {
 throw new ELException(e);
 }
@@ -133,8 +132,7 @@ public class BeanELResolver extends ELRe
 
 if (this.readOnly) {
 throw new PropertyNotWritableException(message(context,
-"resolverNotWriteable", new Object[] { base.getClass()
-.getName() }));
+"resolverNotWriteable", base.getClass().getName()));
 }
 
 Method m = this.property(context, base, property).write(context);
@@ -151,8 +149,7 @@ public class BeanELResolver extends ELRe
 throw (VirtualMachineError) cause;
 }
 throw new ELException(message(context, "propertyWriteError",
-new Object[] { base.getClass().getName(),
-property.toString() }), cause);
+base.getClass().getName(), property.toString()), cause);
 } catch (Exception e) {
 throw new ELException(e);
 }
@@ -342,8 +339,7 @@ public class BeanELResolver extends ELRe
 BeanProperty property = this.properties.get(name);
 if (property == null) {
 throw new PropertyNotFoundException(message(ctx,
-"propertyNotFound",
-new Object[] { type.getName(), name }));
+"propertyNotFound", type.getName(), name));
 }
 return property;
 }

Modified: tomcat/trunk/java/javax/el/ELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELResolver.java?rev=1499318&r1=1499317&r2=1499318&view=diff
==
--- tomcat/trunk/java/javax/el/ELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ELResolver.java Wed Jul  3 10:53:17 2013
@@ -29,7 +29,7 @@ import java.util.ResourceBundle;
  */
 public abstract class ELResolver {
 
-static String message(ELContext context, String name, Object[] props) {
+static String message(ELContext context, String name, Object... props) {
 Locale locale = null;
 if (context != null) {
 locale = context.getLocale();

Modified: tomcat/

svn commit: r1499314 - /tomcat/trunk/java/javax/el/ELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 10:48:14 2013
New Revision: 1499314

URL: http://svn.apache.org/r1499314
Log:
Make context optional when looking up messages

Modified:
tomcat/trunk/java/javax/el/ELResolver.java

Modified: tomcat/trunk/java/javax/el/ELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELResolver.java?rev=1499314&r1=1499313&r2=1499314&view=diff
==
--- tomcat/trunk/java/javax/el/ELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ELResolver.java Wed Jul  3 10:48:14 2013
@@ -30,7 +30,10 @@ import java.util.ResourceBundle;
 public abstract class ELResolver {
 
 static String message(ELContext context, String name, Object[] props) {
-Locale locale = context.getLocale();
+Locale locale = null;
+if (context != null) {
+locale = context.getLocale();
+}
 if (locale == null) {
 locale = Locale.getDefault();
 if (locale == null) {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499310 - in /tomcat/trunk/java/javax/el: BeanNameELResolver.java ELContext.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 10:25:50 2013
New Revision: 1499310

URL: http://svn.apache.org/r1499310
Log:
Re-order to simplify checking against EL spec

Modified:
tomcat/trunk/java/javax/el/BeanNameELResolver.java
tomcat/trunk/java/javax/el/ELContext.java

Modified: tomcat/trunk/java/javax/el/BeanNameELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/BeanNameELResolver.java?rev=1499310&r1=1499309&r2=1499310&view=diff
==
--- tomcat/trunk/java/javax/el/BeanNameELResolver.java (original)
+++ tomcat/trunk/java/javax/el/BeanNameELResolver.java Wed Jul  3 10:25:50 2013
@@ -98,7 +98,6 @@ public class BeanNameELResolver extends 
 public boolean isReadOnly(ELContext context, Object base, Object property)
 throws NullPointerException, PropertyNotFoundException, 
ELException {
 
-
 if (context == null) {
 throw new NullPointerException();
 }

Modified: tomcat/trunk/java/javax/el/ELContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELContext.java?rev=1499310&r1=1499309&r2=1499310&view=diff
==
--- tomcat/trunk/java/javax/el/ELContext.java (original)
+++ tomcat/trunk/java/javax/el/ELContext.java Wed Jul  3 10:25:50 2013
@@ -14,16 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package javax.el;
 
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
-/**
- *
- */
 public abstract class ELContext {
 
 private Locale locale;
@@ -32,19 +28,16 @@ public abstract class ELContext {
 
 private boolean resolved;
 
-/**
- *
- */
 public ELContext() {
 this.resolved = false;
 }
 
-// Can't use Class because API needs to match specification
-public Object getContext(@SuppressWarnings("rawtypes") Class key) {
-if (this.map == null) {
-return null;
-}
-return this.map.get(key);
+public void setPropertyResolved(boolean resolved) {
+this.resolved = resolved;
+}
+
+public boolean isPropertyResolved() {
+return this.resolved;
 }
 
 // Can't use Class because API needs to match specification
@@ -61,20 +54,18 @@ public abstract class ELContext {
 this.map.put(key, contextObject);
 }
 
-public void setPropertyResolved(boolean resolved) {
-this.resolved = resolved;
-}
-
-public boolean isPropertyResolved() {
-return this.resolved;
+// Can't use Class because API needs to match specification
+public Object getContext(@SuppressWarnings("rawtypes") Class key) {
+if (this.map == null) {
+return null;
+}
+return this.map.get(key);
 }
 
 public abstract ELResolver getELResolver();
 
 public abstract FunctionMapper getFunctionMapper();
 
-public abstract VariableMapper getVariableMapper();
-
 public Locale getLocale() {
 return this.locale;
 }
@@ -82,4 +73,6 @@ public abstract class ELContext {
 public void setLocale(Locale locale) {
 this.locale = locale;
 }
+
+public abstract VariableMapper getVariableMapper();
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499309 - /tomcat/trunk/java/javax/el/ELClass.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 10:23:26 2013
New Revision: 1499309

URL: http://svn.apache.org/r1499309
Log:
EL 3.0
Implement new class

Added:
tomcat/trunk/java/javax/el/ELClass.java   (with props)

Added: tomcat/trunk/java/javax/el/ELClass.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELClass.java?rev=1499309&view=auto
==
--- tomcat/trunk/java/javax/el/ELClass.java (added)
+++ tomcat/trunk/java/javax/el/ELClass.java Wed Jul  3 10:23:26 2013
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.el;
+
+/**
+ * @since 3.0
+ */
+public class ELClass {
+
+private final Class clazz;
+
+public ELClass(Class clazz) {
+this.clazz = clazz;
+}
+
+public Class getKlass() {
+return clazz;
+}
+}

Propchange: tomcat/trunk/java/javax/el/ELClass.java
--
svn:eol-style = native



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 55189] Unable to start the server

2013-07-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55189

--- Comment #2 from Mark Thomas  ---
Changes between major versions are expected. They are not regressions.

The changes to the session ID generation are documented in the migration guide.
[1]

Failure to read the documentation is not a bug in Tomcat.

[1] http://tomcat.apache.org/migration-7.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat 7.0.42

2013-07-03 Thread Ognjen Blagojevic

On 2.7.2013 11:18, Mark Thomas wrote:

The proposed Apache Tomcat 7.0.42 release is now available for voting.

It can be obtained from:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.42/
The Maven staging repo is:
https://repository.apache.org/content/repositories/orgapachetomcat-098/
The svn tag is:
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_42/

The proposed 7.0.42 release is:
[ ] Broken - do not release
[X] Stable - go ahead and release as 7.0.42 Stable


Tested .zip distribution on Windows 7 64-bit, and .tar.gz on CentOS 5 
64-bit.

Tested SSL/TLS connectivity for BIO, NIO and APR connectors.
Tested with several webapps that are in active development.

-Ognjen

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat 7.0.42

2013-07-03 Thread Keiichi Fujino
2013/7/2 Mark Thomas 

> The proposed Apache Tomcat 7.0.42 release is now available for voting.
>
> It can be obtained from:
> https://dist.apache.org/repos/dist/dev/tomcat/tomcat-7/v7.0.42/
> The Maven staging repo is:
> https://repository.apache.org/content/repositories/orgapachetomcat-098/
> The svn tag is:
> http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_42/
>
> The proposed 7.0.42 release is:
> [ ] Broken - do not release
> [X] Stable - go ahead and release as 7.0.42 Stable
>
>
+1
tested on test app (enable session replication).


-- 
Keiichi.Fujino


[Bug 55189] Unable to start the server

2013-07-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55189

--- Comment #1 from guillaume.mich...@amadeus.com ---
Other users who faced the same issue:
http://tomcat.10.x6.nabble.com/Hanging-on-startup-td4571254.html

Is it possible to know why this bug has been classified as invalid?

Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 55189] Unable to start the server

2013-07-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55189

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 55189] New: Unable to start the server

2013-07-03 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=55189

Bug ID: 55189
   Summary: Unable to start the server
   Product: Tomcat 7
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Manager
  Assignee: dev@tomcat.apache.org
  Reporter: guillaume.mich...@amadeus.com

/dev/random is a special file that serves as a random number generator or as a
pseudorandom number generator.

When the entropy pool is empty, reads from /dev/random will block until
additional environmental noise is gathered.

In Tomcat 6, if not specified, the default value of randomFile attribute was
/dev/urandom (no blocking read because it's "urandom"):

http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html

In Tomcat 7, the file used by default is /dev/random so it can prevent Tomcat
from starting if the entropy pool is empty.

Then a workaround can be to add "-Djava.security.egd=file:/dev/./urandom" in
JAVA_OPTS variable, but I guess we can see this change as a regression?

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499255 - /tomcat/trunk/java/javax/el/CompositeELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 08:28:29 2013
New Revision: 1499255

URL: http://svn.apache.org/r1499255
Log:
EL 3.0
Implement new method

Modified:
tomcat/trunk/java/javax/el/CompositeELResolver.java

Modified: tomcat/trunk/java/javax/el/CompositeELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/CompositeELResolver.java?rev=1499255&r1=1499254&r2=1499255&view=diff
==
--- tomcat/trunk/java/javax/el/CompositeELResolver.java (original)
+++ tomcat/trunk/java/javax/el/CompositeELResolver.java Wed Jul  3 08:28:29 2013
@@ -167,6 +167,20 @@ public class CompositeELResolver extends
 return commonType;
 }
 
+@Override
+public Object convertToType(ELContext context, Object obj, Class type) {
+context.setPropertyResolved(false);
+int sz = this.size;
+Object result = null;
+for (int i = 0; i < sz; i++) {
+result = this.resolvers[i].convertToType(context, obj, type);
+if (context.isPropertyResolved()) {
+return result;
+}
+}
+return null;
+}
+
 private static final class FeatureIterator implements 
Iterator {
 
 private final ELContext context;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499253 - /tomcat/trunk/java/javax/el/ELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 08:22:24 2013
New Revision: 1499253

URL: http://svn.apache.org/r1499253
Log:
EL 3.0
New method

Modified:
tomcat/trunk/java/javax/el/ELResolver.java

Modified: tomcat/trunk/java/javax/el/ELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELResolver.java?rev=1499253&r1=1499252&r2=1499253&view=diff
==
--- tomcat/trunk/java/javax/el/ELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ELResolver.java Wed Jul  3 08:22:24 2013
@@ -77,4 +77,16 @@ public abstract class ELResolver {
 public abstract Iterator 
getFeatureDescriptors(ELContext context, Object base);
 
 public abstract Class getCommonPropertyType(ELContext context, Object 
base);
+
+/**
+ * Converts the given object to the given type. This default implementation
+ * always returns null.
+ *
+ * @since EL 3.0
+ */
+public Object convertToType(@SuppressWarnings("unused") ELContext context,
+@SuppressWarnings("unused") Object obj,
+@SuppressWarnings("unused") Class type) {
+return null;
+}
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499251 - /tomcat/trunk/java/javax/el/ELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 08:16:33 2013
New Revision: 1499251

URL: http://svn.apache.org/r1499251
Log:
Re-order to simplify checking against EL spec

Modified:
tomcat/trunk/java/javax/el/ELResolver.java

Modified: tomcat/trunk/java/javax/el/ELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ELResolver.java?rev=1499251&r1=1499250&r2=1499251&view=diff
==
--- tomcat/trunk/java/javax/el/ELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ELResolver.java Wed Jul  3 08:16:33 2013
@@ -51,21 +51,11 @@ public abstract class ELResolver {
 }
 }
 
-public static final String RESOLVABLE_AT_DESIGN_TIME = 
"resolvableAtDesignTime";
-
 public static final String TYPE = "type";
 
-public abstract Object getValue(ELContext context, Object base, Object 
property) throws NullPointerException, PropertyNotFoundException, ELException;
-
-public abstract Class getType(ELContext context, Object base, Object 
property) throws NullPointerException, PropertyNotFoundException, ELException;
-
-public abstract void setValue(ELContext context, Object base, Object 
property, Object value) throws NullPointerException, PropertyNotFoundException, 
PropertyNotWritableException, ELException;
-
-public abstract boolean isReadOnly(ELContext context, Object base, Object 
property) throws NullPointerException, PropertyNotFoundException, ELException;
-
-public abstract Iterator 
getFeatureDescriptors(ELContext context, Object base);
+public static final String RESOLVABLE_AT_DESIGN_TIME = 
"resolvableAtDesignTime";
 
-public abstract Class getCommonPropertyType(ELContext context, Object 
base);
+public abstract Object getValue(ELContext context, Object base, Object 
property) throws NullPointerException, PropertyNotFoundException, ELException;
 
 /**
  * @since EL 2.2
@@ -77,4 +67,14 @@ public abstract class ELResolver {
 @SuppressWarnings("unused") Object[] params) {
 return null;
 }
+
+public abstract Class getType(ELContext context, Object base, Object 
property) throws NullPointerException, PropertyNotFoundException, ELException;
+
+public abstract void setValue(ELContext context, Object base, Object 
property, Object value) throws NullPointerException, PropertyNotFoundException, 
PropertyNotWritableException, ELException;
+
+public abstract boolean isReadOnly(ELContext context, Object base, Object 
property) throws NullPointerException, PropertyNotFoundException, ELException;
+
+public abstract Iterator 
getFeatureDescriptors(ELContext context, Object base);
+
+public abstract Class getCommonPropertyType(ELContext context, Object 
base);
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1499249 - /tomcat/trunk/java/javax/el/CompositeELResolver.java

2013-07-03 Thread markt
Author: markt
Date: Wed Jul  3 08:14:11 2013
New Revision: 1499249

URL: http://svn.apache.org/r1499249
Log:
Re-order to simplify checking against EL spec

Modified:
tomcat/trunk/java/javax/el/CompositeELResolver.java

Modified: tomcat/trunk/java/javax/el/CompositeELResolver.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/CompositeELResolver.java?rev=1499249&r1=1499248&r2=1499249&view=diff
==
--- tomcat/trunk/java/javax/el/CompositeELResolver.java (original)
+++ tomcat/trunk/java/javax/el/CompositeELResolver.java Wed Jul  3 08:14:11 2013
@@ -72,6 +72,52 @@ public class CompositeELResolver extends
 return null;
 }
 
+/**
+ * @since EL 2.2
+ */
+@Override
+public Object invoke(ELContext context, Object base, Object method,
+Class[] paramTypes, Object[] params) {
+context.setPropertyResolved(false);
+int sz = this.size;
+Object obj;
+for (int i = 0; i < sz; i++) {
+obj = this.resolvers[i].invoke(context, base, method, paramTypes,
+params);
+if (context.isPropertyResolved()) {
+return obj;
+}
+}
+return null;
+}
+
+@Override
+public Class getType(ELContext context, Object base, Object property)
+throws NullPointerException, PropertyNotFoundException, 
ELException {
+context.setPropertyResolved(false);
+int sz = this.size;
+Class type;
+for (int i = 0; i < sz; i++) {
+type = this.resolvers[i].getType(context, base, property);
+if (context.isPropertyResolved()) {
+if (SCOPED_ATTRIBUTE_EL_RESOLVER != null &&
+SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom(
+resolvers[i].getClass())) {
+// Special case since
+// javax.servlet.jsp.el.ScopedAttributeELResolver will
+// always return Object.class for type
+Object value =
+resolvers[i].getValue(context, base, property);
+if (value != null) {
+return value.getClass();
+}
+}
+return type;
+}
+}
+return null;
+}
+
 @Override
 public void setValue(ELContext context, Object base, Object property,
 Object value) throws NullPointerException,
@@ -121,52 +167,6 @@ public class CompositeELResolver extends
 return commonType;
 }
 
-@Override
-public Class getType(ELContext context, Object base, Object property)
-throws NullPointerException, PropertyNotFoundException, 
ELException {
-context.setPropertyResolved(false);
-int sz = this.size;
-Class type;
-for (int i = 0; i < sz; i++) {
-type = this.resolvers[i].getType(context, base, property);
-if (context.isPropertyResolved()) {
-if (SCOPED_ATTRIBUTE_EL_RESOLVER != null &&
-SCOPED_ATTRIBUTE_EL_RESOLVER.isAssignableFrom(
-resolvers[i].getClass())) {
-// Special case since
-// javax.servlet.jsp.el.ScopedAttributeELResolver will
-// always return Object.class for type
-Object value =
-resolvers[i].getValue(context, base, property);
-if (value != null) {
-return value.getClass();
-}
-}
-return type;
-}
-}
-return null;
-}
-
-/**
- * @since EL 2.2
- */
-@Override
-public Object invoke(ELContext context, Object base, Object method,
-Class[] paramTypes, Object[] params) {
-context.setPropertyResolved(false);
-int sz = this.size;
-Object obj;
-for (int i = 0; i < sz; i++) {
-obj = this.resolvers[i].invoke(context, base, method, paramTypes,
-params);
-if (context.isPropertyResolved()) {
-return obj;
-}
-}
-return null;
-}
-
 private static final class FeatureIterator implements 
Iterator {
 
 private final ELContext context;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org