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(\"<\")\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(\"&\")\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(\">\")\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> </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 </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> </DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT
size=2></FONT></SPAN></SPAN> </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> // support:
escapeTextValue<BR>
writer.write(" private String
escapeTextValue(");<BR>
writer.write("String textValue)
{\n");<BR>
writer.write(" String returnValue =
textValue;\n");<BR>
writer.write(" for (int i = 0; i <
returnValue.length(); ");<BR>
writer.write("i++) {\n");<BR>
writer.write("
char ch =
returnValue.charAt(i);\n");<BR>
writer.write("
if (ch == '<') {\n");<BR>
writer.write("
returnValue = new
StringBuffer()\n");<BR>
writer.write("
.append(returnValue.substring(");<BR>
writer.write("0, i))\n");<BR>
writer.write("
.append(\"&lt;\")\n");<BR>
writer.write("
.append(returnValue.");<BR>
writer.write("substring(i+1))\n");<BR>
writer.write("
.toString();\n");</FONT></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><BR><FONT
size=2>// bug fix - <SPAN class=897434618-07112002>begin</SPAN><SPAN
class=897434618-07112002> cut from here</SPAN><BR></FONT></DIV>
<DIV><FONT size=2>
writer.write("
} else if (ch == '&') {\n");<BR>
writer.write("
returnValue = new
StringBuffer()\n");<BR>
writer.write("
.append(returnValue.substring(");<BR>
writer.write("0, i))\n");<BR>
writer.write("
.append(\"&amp;\")\n");<BR>
writer.write("
.append(returnValue.");<BR>
writer.write("substring(i+1))\n");<BR>
writer.write("
.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>
writer.write("
} else if (ch == '>') {\n");<BR>
writer.write("
returnValue = new
StringBuffer()\n");<BR>
writer.write("
.append(returnValue.substring(");<BR>
writer.write("0, i))\n");<BR>
writer.write("
.append(\"&gt;\")\n");<BR>
writer.write("
.append(returnValue.");<BR>
writer.write("substring(i+1))\n");<BR>
writer.write("
.toString();\n");<BR>
writer.write("
}\n");<BR>
writer.write("
}\n");<BR>
writer.write(" return
returnValue;\n");<BR>
writer.write(" }\n\n");</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT
size=2></FONT></SPAN></SPAN> </DIV>
<DIV><SPAN class=342105516-07112002><SPAN class=897434618-07112002><FONT
size=2></FONT></SPAN></SPAN> </DIV></BODY></HTML>
------_=_NextPart_001_01C2868E.92357490--