bug fix

Artin Modaresi <[email protected]> Thu, 7 Nov 2002 19:50:41 +0100
Newsgroups gmane.comp.java.enhydra.zeus
Message-ID <B832E8A868EAD411A4F8009027E00E270CAA2E@wtexchange01>
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2868E.92357490
Content-Type: text/plain;
	charset="iso-8859-1"

Hi,
 
I made a bug fix for the problem I had. Since I don't see it in the online
cvs I'm sending it in.
It's in the org.enhydra.zeus.generator.SimpleGenerator. Just add the snippet
between the 
begin and end comment and paste it in:
 
 

        // support: escapeTextValue
        writer.write("    private String escapeTextValue(");
        writer.write("String textValue) {\n");
        writer.write("        String returnValue = textValue;\n");
        writer.write("        for (int i = 0; i < returnValue.length(); ");
        writer.write("i++) {\n");
        writer.write("            char ch = returnValue.charAt(i);\n");
        writer.write("            if (ch == '<') {\n");
        writer.write("                returnValue = new StringBuffer()\n");
        writer.write("                    .append(returnValue.substring(");
        writer.write("0, i))\n");
        writer.write("                    .append(\"&lt;\")\n");
        writer.write("                    .append(returnValue.");
        writer.write("substring(i+1))\n");
        writer.write("                    .toString();\n");

// bug fix - begin cut from here

        writer.write("            } else if (ch == '&') {\n");
        writer.write("                returnValue = new StringBuffer()\n");
        writer.write("                    .append(returnValue.substring(");
        writer.write("0, i))\n");
        writer.write("                    .append(\"&amp;\")\n");
        writer.write("                    .append(returnValue.");
        writer.write("substring(i+1))\n");
        writer.write("                    .toString();\n");

// bug fix - end cut here

        writer.write("            } else if (ch == '>') {\n");
        writer.write("                returnValue = new StringBuffer()\n");
        writer.write("                    .append(returnValue.substring(");
        writer.write("0, i))\n");
        writer.write("                    .append(\"&gt;\")\n");
        writer.write("                    .append(returnValue.");
        writer.write("substring(i+1))\n");
        writer.write("                    .toString();\n");
        writer.write("            }\n");
        writer.write("        }\n");
        writer.write("        return returnValue;\n");
        writer.write("    }\n\n");
 
 

------_=_NextPart_001_01C2868E.92357490
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.50.4916.2300" name=GENERATOR></HEAD>
<BODY style="COLOR: #000000; FONT-FAMILY: Arial">
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2>Hi,</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2>I made a bug fix for the problem I had. Since I don't see it in the 
online cvs I'm sending it in.</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2>It's in the org.enhydra.zeus.generator.SimpleGenerator. Just add the 
snippet between the </FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2>begin&nbsp;</FONT></SPAN></SPAN><SPAN class=342105516-07112002><SPAN 
class=897434618-07112002><FONT size=2>and end comment and paste it 
in:</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2></FONT></SPAN></SPAN>&nbsp;</DIV><SPAN class=342105516-07112002><SPAN 
class=897434618-07112002>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // support: 
escapeTextValue<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp; private String 
escapeTextValue(");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("String textValue) 
{\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String returnValue = 
textValue;\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; 
returnValue.length(); ");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("i++) {\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
char ch = 
returnValue.charAt(i);\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (ch == '&lt;') {\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
returnValue = new 
StringBuffer()\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(returnValue.substring(");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("0, i))\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(\"&amp;lt;\")\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(returnValue.");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("substring(i+1))\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.toString();\n");</FONT></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR><FONT 
size=2>// bug fix -&nbsp;<SPAN class=897434618-07112002>begin</SPAN><SPAN 
class=897434618-07112002> cut from here</SPAN><BR></FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
} else if (ch == '&amp;') {\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
returnValue = new 
StringBuffer()\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(returnValue.substring(");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("0, i))\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(\"&amp;amp;\")\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(returnValue.");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("substring(i+1))\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.toString();\n");<BR></FONT></DIV>
<DIV><FONT size=2>// bug fix - end<SPAN class=897434618-07112002> cut 
here</SPAN><BR></FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
} else if (ch == '&gt;') {\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
returnValue = new 
StringBuffer()\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(returnValue.substring(");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("0, i))\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(\"&amp;gt;\")\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.append(returnValue.");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("substring(i+1))\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.toString();\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 
returnValue;\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
writer.write("&nbsp;&nbsp;&nbsp; }\n\n");</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT 
size=2></FONT></SPAN></SPAN>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C2868E.92357490--