Author: markt
Date: Wed Dec 31 05:33:19 2008
New Revision: 730390
URL: http://svn.apache.org/viewvc?rev=730390&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42077
Don't include nulls in iterator. Based on a patch by Mathias Broekelmann
Modified:
tomcat/tc6.0.x/trunk/ (props changed)
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/javax/el/CompositeELResolver.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 31 05:33:19 2008
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,687503,687645,690781,691392,691805,692748,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,709294,709811,709816,710063,710125,710205,711126,711600,712461,718360,719602,719626,719628,726052,728032,728947,729057
+/tomcat/trunk:601180,606992,612607,630314,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,687503,687645,690781,691392,691805,692748,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,709294,709811,709816,710063,710125,710205,711126,711600,712461,718360,719602,719626,719628,720069,726052,728032,728947,729057
Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=730390&r1=730389&r2=730390&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Dec 31 05:33:19 2008
@@ -175,12 +175,6 @@
+1: markt, fhanik
-1:
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42077
- Don't include nulls in iterator. Based on a patch by Mathias Broekelmann
- http://svn.apache.org/viewvc?rev=720069&view=rev
- +1: markt, fhanik, jim
- -1:
-
* Use consistent (and more useful) JPDA defaults in catalina.bat
http://svn.apache.org/viewvc?rev=721040&view=rev
+1: markt, fhanik
Modified: tomcat/tc6.0.x/trunk/java/javax/el/CompositeELResolver.java
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/javax/el/CompositeELResolver.java?rev=730390&r1=730389&r2=730390&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/javax/el/CompositeELResolver.java (original)
+++ tomcat/tc6.0.x/trunk/java/javax/el/CompositeELResolver.java Wed Dec 31
05:33:19 2008
@@ -19,6 +19,7 @@
import java.beans.FeatureDescriptor;
import java.util.Iterator;
+import java.util.NoSuchElementException;
public class CompositeELResolver extends ELResolver {
@@ -127,16 +128,18 @@
private final int size;
- private Iterator itr;
+ private Iterator<FeatureDescriptor> itr;
private int idx;
- public FeatureIterator(ELContext context, Object base,
- ELResolver[] resolvers, int size) {
- this.context = context;
- this.base = base;
- this.resolvers = resolvers;
- this.size = size;
+ private FeatureDescriptor next;
+
+ public FeatureIterator(ELContext context, Object base,
+ ELResolver[] resolvers, int size) {
+ this.context = context;
+ this.base = base;
+ this.resolvers = resolvers;
+ this.size = size;
this.idx = 0;
this.guaranteeIterator();
@@ -150,27 +153,35 @@
}
}
- public boolean hasNext() {
- return this.itr != null;
- }
+ public boolean hasNext() {
+ if (this.next != null)
+ return true;
+ if (this.itr != null){
+ while (this.next == null && itr.hasNext()) {
+ this.next = itr.next();
+ }
+ } else {
+ return false;
+ }
+ if (this.next == null) {
+ this.itr = null;
+ this.guaranteeIterator();
+ }
+ return hasNext();
+ }
+
+ public FeatureDescriptor next() {
+ if (!hasNext())
+ throw new NoSuchElementException();
+ FeatureDescriptor next = this.next;
+ this.next = null;
+ return next;
- public FeatureDescriptor next() {
- Object result = null;
- if (this.itr != null) {
- if (this.itr.hasNext()) {
- result = this.itr.next();
- if (!this.itr.hasNext()) {
- this.itr = null;
- this.guaranteeIterator();
- }
- }
- }
- return (FeatureDescriptor) result;
- }
+ }
public void remove() {
throw new UnsupportedOperationException();
}
}
-}
+}
\ No newline at end of file
Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=730390&r1=730389&r2=730390&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Dec 31 05:33:19 2008
@@ -274,6 +274,11 @@
Correct typo in JSP EL examples. (markt)
</fix>
<fix>
+ <bug>42077</bug>: Ensure the iterator returned by
+ javax.el.CompositeELResolver#getFeatureDescriptor() skips any null
+ FeatureDescriptors. Patch provided by Mathias Broekelmann. (markt)
+ </fix>
+ <fix>
<bug>45427</bug>: Correctly handle unmatched quotes in EL expressions.
(markt)
</fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]