You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by jo...@apache.org on 2005/07/27 21:43:32 UTC
cvs commit: ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg GroupHandlerSG.java SequenceHandlerSG.java
jochen 2005/07/27 12:43:32
Modified: src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg Tag:
v0_4 GroupHandlerSG.java SequenceHandlerSG.java
Log:
A sequence was always treated as a required group,
even if all particles were optional.
Revision Changes Path
No revision
No revision
1.4.2.4 +15 -5 ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupHandlerSG.java
Index: GroupHandlerSG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/GroupHandlerSG.java,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -r1.4.2.3 -r1.4.2.4
--- GroupHandlerSG.java 19 Jul 2005 21:02:47 -0000 1.4.2.3
+++ GroupHandlerSG.java 27 Jul 2005 19:43:31 -0000 1.4.2.4
@@ -155,13 +155,23 @@
return false;
} else {
if (particleSG.isGroup()) {
- ParticleSG[] particles = particleSG.getGroupSG().getParticles();
- for (int i = 0; i < particles.length; i++) {
- if (isRequiredParticle(particles[i])) {
- return true;
+ GroupSG group = particleSG.getGroupSG();
+ ParticleSG[] particles = group.getParticles();
+ if (group.isChoice()) {
+ for (int i = 0; i < particles.length; i++) {
+ if (!isRequiredParticle(particles[i])) {
+ return false;
+ }
}
+ return true;
+ } else {
+ for (int i = 0; i < particles.length; i++) {
+ if (isRequiredParticle(particles[i])) {
+ return true;
+ }
+ }
+ return false;
}
- return false;
} else {
return true;
}
1.3.2.1 +2 -1 ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/SequenceHandlerSG.java
Index: SequenceHandlerSG.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/jaxme/org/apache/ws/jaxme/generator/sg/impl/ccsg/SequenceHandlerSG.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- SequenceHandlerSG.java 10 Mar 2005 10:14:01 -0000 1.3
+++ SequenceHandlerSG.java 27 Jul 2005 19:43:31 -0000 1.3.2.1
@@ -141,8 +141,9 @@
/** Assuming, we are currently in state <code>pState</code>,
* returns the index of the last valid particle. Returns
* -1, if there is no valid particle.
+ * @throws SAXException
*/
- private int getLastValidParticle(int pState) {
+ private int getLastValidParticle(int pState) throws SAXException {
int lastParticle;
if (pState == 0) {
lastParticle = 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org