svn commit: r960166 - in /tomcat/taglibs/standard/trunk/impl: ./ src/main/java/org/apache/taglibs/standard/tag/common/core/ src/test/java/org/apache/taglibs/standard/tag/common/ src/test/java/org/apac
Author: bayard Date: Sat Jul 3 07:36:34 2010 New Revision: 960166 URL: http://svn.apache.org/viewvc?rev=960166&view=rev Log: Implementing commented out code - c:set now removes variables from ELContext VariableMapper. Test and fix patches from Jeremy Boynes #49526 Added: tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/ tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/ tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (with props) Modified: tomcat/taglibs/standard/trunk/impl/pom.xml tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Modified: tomcat/taglibs/standard/trunk/impl/pom.xml URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/pom.xml?rev=960166&r1=960165&r2=960166&view=diff == --- tomcat/taglibs/standard/trunk/impl/pom.xml (original) +++ tomcat/taglibs/standard/trunk/impl/pom.xml Sat Jul 3 07:36:34 2010 @@ -68,7 +68,12 @@ - + + junit + junit + 4.8.1 + + org.apache.taglibs taglibs-standard-spec 1.2-SNAPSHOT @@ -103,9 +108,15 @@ junit junit - 3.8.2 + 4.8.1 test + + org.easymock + easymock + 3.0 + test + @@ -126,6 +137,7 @@ org/apache/taglibs/standard/lang/jstl/test/StaticFunctionTests.java org/apache/taglibs/standard/TestVersion.java +org/apache/taglibs/standard/tag/**/Test*.java Modified: tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java?rev=960166&r1=960165&r2=960166&view=diff == --- tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (original) +++ tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Sat Jul 3 07:36:34 2010 @@ -128,12 +128,10 @@ public class SetSupport extends BodyTagS //set variable in var Mapper vm.setVariable(var, (ValueExpression)result); } else { -/* -//else if not valueExpression - make sure to remove it from the Var mapper -//if the scope is page, should I remove this? -if (vm.resolveVariable(var)!=null) { +// make sure to remove it from the VariableMapper if we will be setting into page scope +if (scope == PageContext.PAGE_SCOPE && vm.resolveVariable(var) != null) { vm.setVariable(var, null); -}*/ +} pageContext.setAttribute(var, result, scope); } } else { Added: tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java?rev=960166&view=auto == --- tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (added) +++ tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Sat Jul 3 07:36:34 2010 @@ -0,0 +1,109 @@ +/* + * 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 org.apache.taglibs.standard.tag.common.core; + +import org.junit.Before; +import org.junit.Test; + +import javax.el.ELContext; +import javax.el.ValueExpression; +import javax.el.Variabl
DO NOT REPLY [Bug 49526] c:set does not remove variables from ELContext VariableMapper
https://issues.apache.org/bugzilla/show_bug.cgi?id=49526 Henri Yandell changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #6 from Henri Yandell 2010-07-03 03:37:22 EDT --- Thanks - both patches applied. svn ci -m "Implementing commented out code - c:set now removes variables from ELContext VariableMapper. Test and fix patches from Jeremy Boynes #49526" Sendingimpl/pom.xml Sending impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Adding impl/src/test/java/org/apache/taglibs/standard/tag/common Adding impl/src/test/java/org/apache/taglibs/standard/tag/common/core Adding impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Transmitting file data ... Committed revision 960166. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r960167 - /tomcat/taglibs/standard/trunk/standard-test/pom.xml
Author: bayard Date: Sat Jul 3 07:42:06 2010 New Revision: 960167 URL: http://svn.apache.org/viewvc?rev=960167&view=rev Log: Configuring the jetty stop port, stops the plugin complaining at the end Modified: tomcat/taglibs/standard/trunk/standard-test/pom.xml Modified: tomcat/taglibs/standard/trunk/standard-test/pom.xml URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/standard-test/pom.xml?rev=960167&r1=960166&r2=960167&view=diff == --- tomcat/taglibs/standard/trunk/standard-test/pom.xml (original) +++ tomcat/taglibs/standard/trunk/standard-test/pom.xml Sat Jul 3 07:42:06 2010 @@ -195,6 +195,8 @@ 6.1.10 10 + + stop 8080 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 49544] Lambda Probe don't work
https://issues.apache.org/bugzilla/show_bug.cgi?id=49544 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from Mark Thomas 2010-07-03 05:45:45 EDT --- Lambda probe is not part of the Apache Tomcat project. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49546] New: Add test cases for SetSupport
https://issues.apache.org/bugzilla/show_bug.cgi?id=49546 Summary: Add test cases for SetSupport Product: Taglibs Version: 1.2.0 Platform: PC Status: NEW Severity: enhancement Priority: P2 Component: Standard Taglib AssignedTo: dev@tomcat.apache.org ReportedBy: jboy...@apache.org Add test cases for common logic -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49546] Add test cases for SetSupport
https://issues.apache.org/bugzilla/show_bug.cgi?id=49546 --- Comment #1 from Jeremy Boynes 2010-07-03 11:54:54 EDT --- Created an attachment (id=25691) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25691) Add test cases for determining result Refactors result logic into separate helper method to ease testing. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r960234 - in /tomcat/taglibs/standard/trunk/impl/src: main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java test/java/org/apache/taglibs/standard/tag/common/core/TestSetSup
Author: bayard Date: Sat Jul 3 16:24:54 2010 New Revision: 960234 URL: http://svn.apache.org/viewvc?rev=960234&view=rev Log: Adding test cases for common c:set logic; along with a refactoring of the result into a separate helper method to ease testing. Patch from Jeremy Boynes: #49546 Modified: tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Modified: tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java?rev=960234&r1=960233&r2=960234&view=diff == --- tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (original) +++ tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Sat Jul 3 16:24:54 2010 @@ -91,22 +91,8 @@ public class SetSupport extends BodyTagS public int doEndTag() throws JspException { -Object result; // what we'll store in scope:var - -// determine the value by... -if (value != null) { -// ... reading our attribute -result = value; -} else if (valueSpecified) { -// ... accepting an explicit null -result = null; -} else { -// ... retrieving and trimming our body -if (bodyContent == null || bodyContent.getString() == null) -result = ""; -else -result = bodyContent.getString().trim(); -} +// what we'll store in scope:var +Object result = getResult(); // decide what to do with the result if (var != null) { @@ -196,6 +182,27 @@ public class SetSupport extends BodyTagS return EVAL_PAGE; } +Object getResult() { +Object result; // what we'll store in scope:var + +// determine the value by... +if (value != null) { +// ... reading our attribute +result = value; +} else if (valueSpecified) { +// ... accepting an explicit null +result = null; +} else { +// ... retrieving and trimming our body +if (bodyContent == null || bodyContent.getString() == null) +result = ""; +else +result = bodyContent.getString().trim(); +} + +return result; +} + /** * Convert an object to an expected type according to the conversion * rules of the Expression Language. Modified: tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java?rev=960234&r1=960233&r2=960234&view=diff == --- tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (original) +++ tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Sat Jul 3 16:24:54 2010 @@ -16,6 +16,7 @@ */ package org.apache.taglibs.standard.tag.common.core; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -24,6 +25,7 @@ import javax.el.ValueExpression; import javax.el.VariableMapper; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.BodyContent; import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; @@ -31,6 +33,8 @@ import static org.easymock.EasyMock.repl import static org.easymock.EasyMock.verify; public class TestSetSupport { +private static String VALUE = "Hello"; +private static final String VAR = "x"; private PageContext pageContext; private ELContext elContext; @@ -39,13 +43,15 @@ public class TestSetSupport { @Before public void setup() { -tag = new SetSupport(); pageContext = createMock(PageContext.class); elContext = createMock(ELContext.class); vm = createMock(VariableMapper.class); expect(pageContext.getELContext()).andStubReturn(elContext); expect(elContext.getVariableMapper()).andStubReturn(vm); + +tag = new SetSupport(); +tag.setPageContext(pageContext); } /** @@ -55,13 +61,12 @@ public class TestSetSupport { */ @Test public void test49526WhenNotMapped() throws JspException { -tag.setPageContext(
DO NOT REPLY [Bug 49546] Add test cases for SetSupport
https://issues.apache.org/bugzilla/show_bug.cgi?id=49546 Henri Yandell changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED OS/Version||All --- Comment #2 from Henri Yandell 2010-07-03 12:25:46 EDT --- Thanks Jeremy. svn ci -m "Adding test cases for common c:set logic; along with a refactoring of the result into a separate helper method to ease testing. Patch from Jeremy Boynes: #49546" Sending impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Sending impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Transmitting file data .. Committed revision 960234. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49547] New: Minor performance enhancement in set result evaluation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49547 Summary: Minor performance enhancement in set result evaluation Product: Taglibs Version: 1.2.0 Platform: PC Status: NEW Severity: enhancement Priority: P2 Component: Standard Taglib AssignedTo: dev@tomcat.apache.org ReportedBy: jboy...@apache.org Eliminate one comparison when evaluating body content as the content of "value" attribute can always be used when it has been specified. Jasper's implementation of BodyContent#getString() constructs a new value each time so only call it once to avoid an unnecessary object creation. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49547] Minor performance enhancement in set result evaluation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49547 --- Comment #1 from Jeremy Boynes 2010-07-03 13:27:20 EDT --- Created an attachment (id=25692) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25692) patch to remove one check and a unneeded call to BodyContent#getString -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49542] IteratedValueExpression and IndexedValueExpression implementation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49542 Henri Yandell changed: What|Removed |Added Status|NEW |NEEDINFO OS/Version||All --- Comment #2 from Henri Yandell 2010-07-03 13:50:43 EDT --- Why add the private lastContext variable to IteratedExpression? Other than that it looks good. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49547] Minor performance enhancement in set result evaluation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49547 Henri Yandell changed: What|Removed |Added Status|NEW |NEEDINFO OS/Version||All --- Comment #2 from Henri Yandell 2010-07-03 14:13:05 EDT --- There's a functionality change here: If valueSpecified is false, yet there is a value, it used to return value. Now it returns bodyContent based results. I don't see this being in the spec, so presumably this is bad design that we're stuck with supporting; a protected status variable in addition to the main one, rather than a 'isValueSpecified()' method. Thoughts? -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49547] Minor performance enhancement in set result evaluation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49547 --- Comment #3 from Jeremy Boynes 2010-07-03 14:53:00 EDT --- value and valueSpecified are both protected variables and part of our implementation rather than the spec. The container will just call setValue(Object) to set the attribute's value and both our subclasses set both variables in their implementation. My thought was that the contract this has with its subclasses is that both must be set and if that is met the change works. The original tests I added weren't doing that which was why it was OK to change them. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49547] Minor performance enhancement in set result evaluation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49547 Jeremy Boynes changed: What|Removed |Added Status|NEEDINFO|NEW -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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
DO NOT REPLY [Bug 49542] IteratedValueExpression and IndexedValueExpression implementation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49542 Jeremy Boynes changed: What|Removed |Added Attachment #25686|0 |1 is obsolete|| --- Comment #3 from Jeremy Boynes 2010-07-03 14:58:15 EDT --- Created an attachment (id=25693) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25693) Remove field added in error -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r960259 - in /tomcat/taglibs/standard/trunk/impl/src: main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java test/java/org/apache/taglibs/standard/tag/common/core/TestSetSup
Author: bayard Date: Sat Jul 3 19:34:40 2010 New Revision: 960259 URL: http://svn.apache.org/viewvc?rev=960259&view=rev Log: Improving the performance of SetSupport by only calling bodyContent.getString() once per Jeremy's patch #49547 Modified: tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Modified: tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java?rev=960259&r1=960258&r2=960259&view=diff == --- tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java (original) +++ tomcat/taglibs/standard/trunk/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Sat Jul 3 19:34:40 2010 @@ -44,6 +44,11 @@ import org.apache.taglibs.standard.resou /** * Support for handlers of thetag. * + * The protected value and valueSpecified + * attributes must be set in sync. That is, if you set the value then + * you should set valueSpecified to true, if you unset the value, then + * you should set valueSpecified to false. + * * @author Shawn Bayern */ public class SetSupport extends BodyTagSupport { @@ -183,24 +188,18 @@ public class SetSupport extends BodyTagS } Object getResult() { -Object result; // what we'll store in scope:var - -// determine the value by... -if (value != null) { -// ... reading our attribute -result = value; -} else if (valueSpecified) { -// ... accepting an explicit null -result = null; +if (valueSpecified) { +return value; +} else if (bodyContent == null) { +return ""; } else { -// ... retrieving and trimming our body -if (bodyContent == null || bodyContent.getString() == null) -result = ""; -else -result = bodyContent.getString().trim(); +String content = bodyContent.getString(); +if (content == null) { +return ""; +} else { +return content.trim(); +} } - -return result; } /** Modified: tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java?rev=960259&r1=960258&r2=960259&view=diff == --- tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java (original) +++ tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Sat Jul 3 19:34:40 2010 @@ -62,6 +62,7 @@ public class TestSetSupport { @Test public void test49526WhenNotMapped() throws JspException { tag.setVar(VAR); +tag.valueSpecified = true; tag.value = VALUE; // verify mapper is checked but that no action is taken @@ -80,6 +81,7 @@ public class TestSetSupport { @Test public void test49526WhenAlreadyMapped() throws JspException { tag.setVar(VAR); +tag.valueSpecified = true; tag.value = VALUE; // verify mapper is checked and the mapped variable removed @@ -100,6 +102,7 @@ public class TestSetSupport { @Test public void test49526WhenNotUsingPageContext() throws JspException { tag.setVar(VAR); +tag.valueSpecified = true; tag.value = VALUE; tag.setScope("request"); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 49547] Minor performance enhancement in set result evaluation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49547 Henri Yandell changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #4 from Henri Yandell 2010-07-03 15:35:24 EDT --- Agreed that the contract would be that both must be set. I've added javadoc that the two attributes must be in sync as a part of this commit: svn ci -m "Improving the performance of SetSupport by only calling bodyContent.getString() once per Jeremy's patch #49547"Sending impl/src/main/java/org/apache/taglibs/standard/tag/common/core/SetSupport.java Sending impl/src/test/java/org/apache/taglibs/standard/tag/common/core/TestSetSupport.java Transmitting file data .. Committed revision 960259. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r960261 - /tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
Author: bayard Date: Sat Jul 3 19:39:02 2010 New Revision: 960261 URL: http://svn.apache.org/viewvc?rev=960261&view=rev Log: Improved javadoc per Jeremy's #49542 patch Modified: tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java Modified: tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java?rev=960261&r1=960260&r2=960261&view=diff == --- tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java (original) +++ tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java Sat Jul 3 19:39:02 2010 @@ -30,6 +30,9 @@ import java.util.Vector; import javax.el.ELContext; import javax.el.ValueExpression; +/** + * Helper class for accessing members of a deferred expression result by index. + */ public final class IteratedExpression { protected final ValueExpression orig; protected final String delims; @@ -38,12 +41,25 @@ public final class IteratedExpression { private int currentIndex=0; private enum TypesEnum {Undefined, ACollection, AnIterator, AnEnumeration, AMap, AString}; private TypesEnum type = TypesEnum.Undefined; - -public IteratedExpression(ValueExpression valueExpression, String stringTokenSeparator) { -orig = valueExpression; -delims = stringTokenSeparator; + +/** + * Constructor specifying the expression to access. + * If the expression evaluates to a String, then it will be split using the specified delimiters. + * @param orig the original expression to be accessed + * @param delims delimiters to be used to split a String result + */ +public IteratedExpression(ValueExpression orig, String delims) { +this.orig = orig; +this.delims = delims; } - + +/** + * Iterates the original expression and returns the value at the index. + * + * @param context against which the expression should be evaluated + * @param i the index of the value to return + * @return the value at the index + */ public Object getItem(ELContext context, int i) { if (originalListObject == null) { originalListObject = orig.getValue(context); @@ -77,7 +93,12 @@ public final class IteratedExpression { } return currentObject; } - + +/** + * Returns the original expression. + * + * @return the original expression + */ public ValueExpression getValueExpression() { return orig; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r960262 - in /tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core: IndexedValueExpression.java IteratedValueExpression.java
Author: bayard Date: Sat Jul 3 19:40:07 2010 New Revision: 960262 URL: http://svn.apache.org/viewvc?rev=960262&view=rev Log: Fixing equals method to be consistent with hashCode, and making the serialVersionUID be 1L per the spec javadoc. Per Jeremy Boynes' #49542 report Modified: tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java Modified: tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java?rev=960262&r1=960261&r2=960262&view=diff == --- tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java (original) +++ tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java Sat Jul 3 19:40:07 2010 @@ -24,25 +24,41 @@ import java.io.Serializable; import javax.el.ELContext; import javax.el.ValueExpression; +/** + * ValueExpression that refers to a specific member of an indexed variable. + * This allows individual members of an indexed collection to be used as lvalues. + */ public final class IndexedValueExpression extends ValueExpression implements Serializable { +// serialVersionUID value defined by specification JavaDoc +private static final long serialVersionUID = 1L; -private static final long serialVersionUID = -7300711701036452952L; +/** + * The index variable. + */ protected final Integer i; + +/** + * The indexed variable. + */ protected final ValueExpression orig; - -public IndexedValueExpression(ValueExpression valueExpression, int _i) { + +/** + * Constructor specifying indexed variable and index. + * + * @param valueExpression that evaluates to the indexed variable + * @param i index specifying the member + */ +public IndexedValueExpression(ValueExpression valueExpression, int i) { orig = valueExpression; -i=_i; +this.i = i; } - -public boolean equals(Object arg0) { -boolean rc=false; -if (arg0!=null) { -if (arg0.equals(orig)) { -rc = true; -} -} -return rc; + +public boolean equals(Object o) { +if (this == o) return true; +if (o == null || getClass() != o.getClass()) return false; + +IndexedValueExpression that = (IndexedValueExpression) o; +return i.equals(that.i) && orig.equals(that.orig); } public Class getExpectedType() { Modified: tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java?rev=960262&r1=960261&r2=960262&view=diff == --- tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java (original) +++ tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java Sat Jul 3 19:40:07 2010 @@ -22,26 +22,29 @@ package javax.servlet.jsp.jstl.core; import javax.el.ELContext; import javax.el.ValueExpression; +/** + * ValueExpression that refers to a specific member of an indexed variable backed by an IteratedExpression. + * This allows individual members of an indexed collection to be used as lvalues. + */ public final class IteratedValueExpression extends ValueExpression { +// serialVersionUID value defined by specification JavaDoc +private static final long serialVersionUID = 1L; -private static final long serialVersionUID = 2771035360633553883L; -//IteratedExpression is not serializable -protected final IteratedExpression iteratedExpression; protected final int i; - -public IteratedValueExpression(IteratedExpression _iteratedExpression, int _i) { -iteratedExpression = _iteratedExpression; -i = _i; +// TODO: IteratedExpression is not serializable - should this be ignored? +protected final IteratedExpression iteratedExpression; + +public IteratedValueExpression(IteratedExpression _iteratedExpr, int i) { +iteratedExpression = _iteratedExpr; +this.i = i; } -public boolean equals(Object arg0) { -if (arg0==null) { -return false; -} -if (iteratedExpression.getValueExpression().equals(arg0)) { -return true; -} -return false; +public boolean equals(Object obj) { +if (this == obj) return true; +
DO NOT REPLY [Bug 49542] IteratedValueExpression and IndexedValueExpression implementation
https://issues.apache.org/bugzilla/show_bug.cgi?id=49542 Henri Yandell changed: What|Removed |Added Status|NEEDINFO|RESOLVED Resolution||FIXED --- Comment #4 from Henri Yandell 2010-07-03 15:40:46 EDT --- svn ci -m "Improved javadoc per Jeremy's #49542 patch" src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java Sending src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java Transmitting file data . Committed revision 960261. svn ci -m "Fixing equals method to be consistent with hashCode, and making the serialVersionUID be 1L per the spec javadoc. Per Jeremy Boynes' #49542 report" Sending spec/src/main/java/javax/servlet/jsp/jstl/core/IndexedValueExpression.java Sending spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedValueExpression.java Transmitting file data .. Committed revision 960262. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r960283 - in /tomcat/trunk: java/org/apache/catalina/core/AsyncContextImpl.java test/org/apache/catalina/core/TestAsyncContextImpl.java webapps/docs/changelog.xml
Author: pero Date: Sat Jul 3 22:48:16 2010 New Revision: 960283 URL: http://svn.apache.org/viewvc?rev=960283&view=rev Log: Fix Bug 49528 - HttpServletRequest.isAsyncStarted() returns false when a Runnable is started Add isDebugEnabled statements. Todo: Why we doesn't start directly a container thread with asyncContext.start()? Currently we start user runnable as an internal forward. Added: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=960283&r1=960282&r2=960283&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Sat Jul 3 22:48:16 2010 @@ -253,7 +253,7 @@ public class AsyncContextImpl implements } public boolean isStarted() { -return (state.get() == AsyncState.STARTED || state.get() == AsyncState.DISPATCHING); +return (state.get() == AsyncState.STARTED || state.get() == AsyncState.DISPATCHING || state.get() == AsyncState.DISPATCHED); } public void setStarted(Context context) { @@ -292,7 +292,8 @@ public class AsyncContextImpl implements public void doInternalDispatch() throws ServletException, IOException { if (this.state.compareAndSet(AsyncState.TIMING_OUT, AsyncState.COMPLETING)) { -log.debug("TIMING OUT!"); + if( log.isDebugEnabled()) + log.debug("TIMING OUT!"); boolean listenerInvoked = false; for (AsyncListenerWrapper listener : listeners) { listener.fireOnTimeout(event); @@ -303,15 +304,18 @@ public class AsyncContextImpl implements } doInternalComplete(true); } else if (this.state.compareAndSet(AsyncState.ERROR_DISPATCHING, AsyncState.COMPLETING)) { -log.debug("ON ERROR!"); +if( log.isDebugEnabled()) +log.debug("ON ERROR!"); boolean listenerInvoked = false; for (AsyncListenerWrapper listener : listeners) { try { listener.fireOnError(event); }catch (IllegalStateException x) { -log.debug("Listener invoked invalid state.",x); +if( log.isDebugEnabled()) +log.debug("Listener invoked invalid state.",x); }catch (Exception x) { -log.debug("Exception during onError.",x); +if(log.isDebugEnabled()) +log.debug("Exception during onError.",x); } listenerInvoked = true; } Added: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=960283&view=auto == --- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (added) +++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Sat Jul 3 22:48:16 2010 @@ -0,0 +1,120 @@ +/* + * 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 org.apache.catalina.core; + +import java.io.File; +import java.io.IOException; + +import javax.servlet.ServletException; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.catalina.Context; +import org.apache.catalina.Wrapper; +import org.apache.catalina.startup.Tomcat; +import org.apache.catalina.startup.TomcatBaseTest; + +/** + * Simulate Bug 49528. + * + * @author Peter Rossbach + * @version $Revision$ + */ +public class TestAsyncContextImpl extends TomcatBaseTest { + +public void testIsAsyncStarted() throws Exception { +
DO NOT REPLY [Bug 49528] HttpServletRequest.isAsyncStarted() returns false when a Runnable is started
https://issues.apache.org/bugzilla/show_bug.cgi?id=49528 Peter Rossbach changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #2 from Peter Rossbach 2010-07-03 18:51:16 EDT --- Check Revision 960283 and review my test case TestAsyncContextImpl. Fix is proposed at tomcat 7.0.1 Many thanks to report this bug. Peter -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- 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: r960284 - in /tomcat/trunk: java/org/apache/catalina/loader/WebappLoader.java test/org/apache/catalina/loader/TestVirtualWebappLoader.java
Author: pero Date: Sat Jul 3 23:02:46 2010 New Revision: 960284 URL: http://svn.apache.org/viewvc?rev=960284&view=rev Log: Fix NPE and add small test case to check VirtualWebappLoader. Added: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java?rev=960284&r1=960283&r2=960284&view=diff == --- tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Sat Jul 3 23:02:46 2010 @@ -483,9 +483,7 @@ public class WebappLoader extends Lifecy * such that the loaded classes should be reloaded? */ public boolean modified() { - -return (classLoader.modified()); - +return classLoader != null ? classLoader.modified() : false ; } @@ -493,7 +491,7 @@ public class WebappLoader extends Lifecy * Used to periodically signal to the classloader to release JAR resources. */ public void closeJARs(boolean force) { -if (classLoader !=null){ +if (classLoader !=null) { classLoader.closeJARs(force); } } Added: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java?rev=960284&view=auto == --- tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java (added) +++ tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java Sat Jul 3 23:02:46 2010 @@ -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 org.apache.catalina.loader; + +import java.io.File; + +import org.apache.catalina.core.StandardContext; +import org.apache.catalina.startup.Tomcat; +import org.apache.catalina.startup.TomcatBaseTest; +import org.apache.naming.resources.FileDirContext; + +public class TestVirtualWebappLoader extends TomcatBaseTest { + +public void testModified() throws Exception { +WebappLoader loader = new WebappLoader(); +assertNull(loader.getClassLoader()); +assertFalse(loader.modified()); +} + +public void testStartInternal() throws Exception { +Tomcat tomcat = getTomcatInstance(); +File appDir = new File("test/webapp-3.0"); +// Must have a real docBase - just use temp +StandardContext ctx = +(StandardContext)tomcat.addContext("/", appDir.getAbsolutePath()); + +VirtualWebappLoader loader = new VirtualWebappLoader(); + +loader.setContainer(ctx); +ctx.setLoader(loader); +ctx.setResources(new FileDirContext()); +ctx.resourcesStart(); +File dir = new File("test/webapp-3.0-fragments/WEB-INF/lib"); +loader.setVirtualClasspath(dir.getAbsolutePath() + "/*.jar"); +loader.startInternal(); +String[] repos = loader.getRepositories(); +assertEquals(2,repos.length); +loader.stopInternal(); +// ToDo: Why doesn't remove repositories? +repos = loader.getRepositories(); +assertEquals(2, repos.length); + +// no leak +loader.startInternal(); +repos = loader.getRepositories(); +assertEquals(2,repos.length); + +// clear loader +ctx.setLoader(null); +// see tearDown()! +tomcat.start(); +} +} Propchange: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java -- svn:eol-style = native Propchange: tomcat/trunk/test/org/apache/catalina/loader/TestVirtualWebappLoader.java -- svn:keywords = Author Date Id Revision ---
Re: svn commit: r960283 - in /tomcat/trunk: java/org/apache/catalina/core/AsyncContextImpl.java test/org/apache/catalina/core/TestAsyncContextImpl.java webapps/docs/changelog.xml
Hi Peter, On 04.07.2010 00:48, p...@apache.org wrote: Author: pero Date: Sat Jul 3 22:48:16 2010 New Revision: 960283 URL: http://svn.apache.org/viewvc?rev=960283&view=rev Log: Fix Bug 49528 - HttpServletRequest.isAsyncStarted() returns false when a Runnable is started Add isDebugEnabled statements. Todo: Why we doesn't start directly a container thread with asyncContext.start()? Currently we start user runnable as an internal forward. Added: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=960283&r1=960282&r2=960283&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Sat Jul 3 22:48:16 2010 @@ -253,7 +253,7 @@ public class AsyncContextImpl implements } public boolean isStarted() { -return (state.get() == AsyncState.STARTED || state.get() == AsyncState.DISPATCHING); +return (state.get() == AsyncState.STARTED || state.get() == AsyncState.DISPATCHING || state.get() == AsyncState.DISPATCHED); } public void setStarted(Context context) { @@ -292,7 +292,8 @@ public class AsyncContextImpl implements public void doInternalDispatch() throws ServletException, IOException { if (this.state.compareAndSet(AsyncState.TIMING_OUT, AsyncState.COMPLETING)) { -log.debug("TIMING OUT!"); + if( log.isDebugEnabled()) + log.debug("TIMING OUT!"); Style nitpicks: - indentation wrong, maybe tabs involved - spacing around "if" boolean listenerInvoked = false; for (AsyncListenerWrapper listener : listeners) { listener.fireOnTimeout(event); @@ -303,15 +304,18 @@ public class AsyncContextImpl implements } doInternalComplete(true); } else if (this.state.compareAndSet(AsyncState.ERROR_DISPATCHING, AsyncState.COMPLETING)) { -log.debug("ON ERROR!"); +if( log.isDebugEnabled()) +log.debug("ON ERROR!"); - spacing around "if" boolean listenerInvoked = false; for (AsyncListenerWrapper listener : listeners) { try { listener.fireOnError(event); }catch (IllegalStateException x) { -log.debug("Listener invoked invalid state.",x); +if( log.isDebugEnabled()) +log.debug("Listener invoked invalid state.",x); - spacing around "if" }catch (Exception x) { -log.debug("Exception during onError.",x); +if(log.isDebugEnabled()) +log.debug("Exception during onError.",x); - spacing around "if" } listenerInvoked = true; } Added: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=960283&view=auto == --- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (added) +++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Sat Jul 3 22:48:16 2010 +private BUG49528Servlet createTestApp(Tomcat tomcat) { +// Must have a real docBase - just use temp +File docBase = new File(System.getProperty("java.io.tmpdir")); + +// Create the folder that will trigger the redirect +File foo = new File(docBase, "async"); +if (!foo.exists()&& !foo.mkdirs()) { - spacing around "&&" Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=960283&r1=960282&r2=960283&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sat Jul 3 22:48:16 2010 @@ -38,6 +38,10 @@ +49528: HttpServletRequest.isAsyncStarted() now returns true when a Runnable is started! +Reported by Pieter Libin (pero) + + - indentation - no need for exclamation mark Regards, Rainer - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org