<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#copied {background-color:#ccccff;}
tr.alt #copied {background-color:#bbbbf7;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="5">Commit in <b><tt>asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd</tt></b></td></tr>
<tr><td><tt><a href="#file1">MarshalBuilder.java</a></tt> </td><td></td><td align="right" id="added">+5</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr class="alt"><td><tt>components/<a href="#file2">AttributeDeclarationComponent.java</a></tt> </td><td></td><td align="right" id="added">+3</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr><td><tt> /<a href="#file3">AttributeUseComponent.java</a></tt> </td><td></td><td align="right" id="added">+3</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr class="alt"><td><tt> /<a href="#file4">ChoiceMappingComponent.java</a></tt> </td><td></td><td align="right" id="added">+5</td><td align="right" id="removed">-3</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr><td><tt> /<a href="#file5">ComplexTypeComponent.java</a></tt> </td><td></td><td align="right" id="added">+1</td><td></td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr class="alt"><td><tt> /<a href="#file6">MultiplyOccuringParticleComponent.java</a></tt> </td><td></td><td align="right" id="added">+2</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr><td><tt> /<a href="#file7">OptionallyOccuringParticleComponent.java</a></tt> </td><td></td><td align="right" id="added">+4</td><td align="right" id="removed">-3</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr class="alt"><td><tt> /<a href="#file8">SinglyOccuringParticleComponent.java</a></tt> </td><td></td><td align="right" id="added">+3</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center">162 -> 163</td></tr>
<tr><td></td><td></td><td align="right" id="added">+26</td><td align="right" id="removed">-12</td><td></td></tr>
</table>
<small id="info">8 modified files</small><br />
<pre class="comment">
Use the correct variable name for the current value of interest when in a multiply-occuring particle loop, etc.
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd</span><br />
<div class="fileheader"><big><b>MarshalBuilder.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/MarshalBuilder.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/MarshalBuilder.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -148,7 +148,11 @@
</small></pre><pre class="diff" id="context">         }
        public static String getCurrentSourceExpr(CodegenContext context) {
</pre><pre class="diff" id="removed">-                <span id="removedchars">return</span> (String)context.getAttribute(KEY_MARSHAL_CURRENT_SOURCE_EXPR);
</pre><pre class="diff" id="added">+                <span id="addedchars">String result =</span> (String)context.getAttribute(KEY_MARSHAL_CURRENT_SOURCE_EXPR);
+                if (result == null) {
+                        throw new IllegalStateException("no source expression defined");
+                }
+                return result;
</pre><pre class="diff" id="context">         }
        public static void setCurrentSourceExpr(CodegenContext context, String expr) {
                context.setAttribute(KEY_MARSHAL_CURRENT_SOURCE_EXPR, expr);
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>AttributeDeclarationComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/AttributeDeclarationComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/AttributeDeclarationComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -5,6 +5,7 @@
</small></pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.CodegenContext;
import uk.co.badgersinfoil.asxsd.CodegenRole;
import uk.co.badgersinfoil.asxsd.MappingFunction;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.asxsd.MarshalBuilder;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.StringUtils;
import uk.co.badgersinfoil.metaas.dom.StatementContainer;
</pre><pre class="diff"><small id="info">@@ -28,7 +29,8 @@
</small></pre><pre class="diff" id="context">                         code.addStmt("_result."+context.variableNameFor(attrDecl)+" = "+converted);
                } else if (role == CodegenRole.MARSHAL) {
                        StatementContainer code = context.getCurrentMethodCode();
</pre><pre class="diff" id="removed">-                        String propertyNameExpr = "thisObject."+context.variableNameFor(attrDecl);
</pre><pre class="diff" id="added">+                        String sourceExpr = MarshalBuilder.getCurrentSourceExpr(context);
+                        String propertyNameExpr = sourceExpr+"."+context.variableNameFor(attrDecl);
</pre><pre class="diff" id="context">                         MappingFunction function = context.functionFor(attrDecl.getType());
                        String converted = function.appliedTo(propertyNameExpr);
                        code.addStmt("_result."+StringUtils.attrAccess(attrDecl)+" = "+converted);
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>AttributeUseComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/AttributeUseComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/AttributeUseComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -6,6 +6,7 @@
</small></pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.CodegenContext;
import uk.co.badgersinfoil.asxsd.CodegenRole;
import uk.co.badgersinfoil.asxsd.DocUtils;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.asxsd.MarshalBuilder;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.StringUtils;
import uk.co.badgersinfoil.asxsd.TypeBuilder;
import uk.co.badgersinfoil.asxsd.TypeDescriptor;
</pre><pre class="diff"><small id="info">@@ -41,7 +42,8 @@
</small></pre><pre class="diff" id="context">                         context.pushAttrScope();
                        if (!attrUse.isRequired()) {
                                StatementContainer code = context.getCurrentMethodCode();
</pre><pre class="diff" id="removed">-                                String propertyNameExpr = "thisObject."+context.variableNameFor(attrUse.getAttributeDeclaration());
</pre><pre class="diff" id="added">+                                String sourceExpr = MarshalBuilder.getCurrentSourceExpr(context);
+                                String propertyNameExpr = sourceExpr+"."+context.variableNameFor(attrUse.getAttributeDeclaration());
</pre><pre class="diff" id="context">                                 ASIfStatement ifStmt = code.newIf(propertyNameExpr+" != null");
                                context.setCurrentMethodCode(ifStmt);
                        }
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>ChoiceMappingComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/ChoiceMappingComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/ChoiceMappingComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -17,6 +17,7 @@
</small></pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.CodegenContext;
import uk.co.badgersinfoil.asxsd.CodegenRole;
import uk.co.badgersinfoil.asxsd.MappingFunction;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.asxsd.MarshalBuilder;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.StringUtils;
import uk.co.badgersinfoil.asxsd.TypeDescriptor;
import uk.co.badgersinfoil.asxsd.UnmarshalBuilder;
</pre><pre class="diff"><small id="info">@@ -70,7 +71,7 @@
</small></pre><pre class="diff" id="context">                         for (Iterator i=particles.iterator(); i.hasNext(); ) {
                                XSDParticle part = (XSDParticle)i.next();
                                XSDParticleContent partContent = part.getContent();
</pre><pre class="diff" id="removed">-                                StatementContainer choiceBlock = detectElementContent(context, partContent, code);
</pre><pre class="diff" id="added">+                                StatementContainer choiceBlock = detectElementContent<span id="addedchars">Marshal</span>(context, partContent, code);
</pre><pre class="diff" id="context">                                 context.pushAttrScope();
                                context.setCurrentMethodCode(choiceBlock);
                                context.generateCode(part);
</pre><pre class="diff"><small id="info">@@ -88,10 +89,11 @@
</small></pre><pre class="diff" id="context">                 }
        }
</pre><pre class="diff" id="removed">-        private StatementContainer detectElementContent(CodegenContext context, XSDParticleContent partContent, StatementContainer code) {
</pre><pre class="diff" id="added">+        private StatementContainer detectElementContent<span id="addedchars">Marshal</span>(CodegenContext context, XSDParticleContent partContent, StatementContainer code) {
</pre><pre class="diff" id="context">                 XSDElementDeclaration firstElement = findFirstElementDeclaration(partContent);
</pre><pre class="diff" id="added">+                String sourceExpr = MarshalBuilder.getCurrentSourceExpr(context);
</pre><pre class="diff" id="context">                 String propertyName = context.variableNameFor(firstElement);
</pre><pre class="diff" id="removed">-                return code.newIf(<span id="removedchars">"thisObject</span>."+propertyName+" != null");
</pre><pre class="diff" id="added">+                return code.newIf(<span id="addedchars">sourceExpr+"</span>."+propertyName+" != null");
</pre><pre class="diff" id="context">         }
        private static StatementContainer detectElementContentUnmarshal(CodegenContext context, XSDParticleContent partContent, StatementContainer code) {
</pre></div>
<hr /><a name="file5" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>ComplexTypeComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/ComplexTypeComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/ComplexTypeComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -139,6 +139,7 @@
</small></pre><pre class="diff" id="context">         }
        private void processAllComplexTypeAttributesMarshal(CodegenContext context, XSDComplexTypeDefinition ctype) {
</pre><pre class="diff" id="added">+                MarshalBuilder.setCurrentSourceExpr(context, "thisObject");
</pre><pre class="diff" id="context">                 List attrs = ctype.getAttributeContents();
                for (Iterator i=attrs.iterator(); i.hasNext(); ) {
                        XSDAttributeGroupContent attrContent = (XSDAttributeGroupContent)i.next();
</pre></div>
<hr /><a name="file6" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>MultiplyOccuringParticleComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/MultiplyOccuringParticleComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/MultiplyOccuringParticleComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -75,7 +75,8 @@
</small></pre><pre class="diff" id="context">                         XSDParticleContent elementDecl = particle.getContent();
                        String propertyName = context.variableNameFor(elementDecl);
                        String childVarName = propertyName + "_child";
</pre><pre class="diff" id="removed">-                        String accessExpr = "thisObject."+propertyName;
</pre><pre class="diff" id="added">+                        String sourceExpr = MarshalBuilder.getCurrentSourceExpr(context);
+                        String accessExpr = sourceExpr+"."+propertyName;
</pre><pre class="diff" id="context">                         TypeDescriptor typeDesc = context.getTypeDescriptor(elementDecl);
                        String typeName = typeDesc.getTypeName();
                        StatementContainer forEachBlock = containingBlock.newForEachIn("var "+childVarName+":"+typeName, accessExpr);
</pre></div>
<hr /><a name="file7" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>OptionallyOccuringParticleComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/OptionallyOccuringParticleComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/OptionallyOccuringParticleComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -42,11 +42,12 @@
</small></pre><pre class="diff" id="context">                         StatementContainer containingBlock = context.getCurrentMethodCode();
                        XSDElementDeclaration elementDecl = (XSDElementDeclaration)particle.getContent();
                        String propertyName = context.variableNameFor(elementDecl);
</pre><pre class="diff" id="removed">-                        String sourceExpr = "thisObject."+propertyName;
-                        StatementContainer ifBlock = containingBlock.newIf(sourceExpr+" != null");
</pre><pre class="diff" id="added">+                        String sourceExpr = MarshalBuilder.getCurrentSourceExpr(context);
+                        String accessExpr = sourceExpr+"."+propertyName;
+                        StatementContainer ifBlock = containingBlock.newIf(accessExpr+" != null");
</pre><pre class="diff" id="context">                         context.pushAttrScope();
                        context.setCurrentMethodCode(ifBlock);
</pre><pre class="diff" id="removed">-                        MarshalBuilder.setCurrentSourceExpr(context, <span id="removedchars">source</span>Expr);
</pre><pre class="diff" id="added">+                        MarshalBuilder.setCurrentSourceExpr(context, <span id="addedchars">access</span>Expr);
</pre><pre class="diff" id="context">
                        context.generateCode(particle.getContent());
</pre></div>
<hr /><a name="file8" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>SinglyOccuringParticleComponent.java</b></big> <small id="info">162 -> 163</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/SinglyOccuringParticleComponent.java        2007-10-07 21:30:25 UTC (rev 162)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/SinglyOccuringParticleComponent.java        2007-10-07 22:25:33 UTC (rev 163)
@@ -48,9 +48,10 @@
</small></pre><pre class="diff" id="context">                 } else if (role == CodegenRole.MARSHAL) {
                        XSDElementDeclaration elementDecl = (XSDElementDeclaration)particle.getContent();
                        String propertyName = context.variableNameFor(elementDecl);
</pre><pre class="diff" id="removed">-                        String sourceExpr = "thisObject."+propertyName;
</pre><pre class="diff" id="added">+                        String sourceExpr = MarshalBuilder.getCurrentSourceExpr(context);
+                        String accessExpr = sourceExpr+"."+propertyName;
</pre><pre class="diff" id="context">                         context.pushAttrScope();
</pre><pre class="diff" id="removed">-                        MarshalBuilder.setCurrentSourceExpr(context, <span id="removedchars">source</span>Expr);
</pre><pre class="diff" id="added">+                        MarshalBuilder.setCurrentSourceExpr(context, <span id="addedchars">access</span>Expr);
</pre><pre class="diff" id="context">                         context.generateCode(elementDecl);
                        context.popAttrScope();
                } else if (role == CodegenRole.TYPE) {
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.12</small></center>
</body></html>