[Biojava-l] bytecode generator - test example is broken.
Mike May
Mike May" <may@dial.pipex.com
Fri, 21 Apr 2000 09:37:55 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_0085_01BFAB75.4553B3E0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0086_01BFAB75.4553B3E0"
------=_NextPart_001_0086_01BFAB75.4553B3E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi
The latest version (1.1) in the WebCVS of test.MakeHelloWorld.java is =
not consistent with the latest version (1.10) of =
org.biojava.utils.bytecode.GeneratedCodeClass. The constructor of =
GeneratedCodeClass expects an array of CodeClass whereas MakeHelloWorld =
passes a Set. The same applies to createMethod(). I expect it was =
broken by the 1.6 change to GeneratedCodeClass.
I attach a corrected version of MakeHelloWorld.java. Its all yours if =
you want it.
Would you kindly pass on my thanks to thomasd for the bytecode utility =
which is tremendously useful.
Regards
Mike May
------=_NextPart_001_0086_01BFAB75.4553B3E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>The latest version (1.1) in the WebCVS of=20
test.MakeHelloWorld.java is not consistent with the latest version =
(1.10) of=20
org.biojava.utils.bytecode.GeneratedCodeClass. The constructor of=20
GeneratedCodeClass expects an array of CodeClass whereas MakeHelloWorld =
passes a=20
Set. The same applies to createMethod(). I expect it was =
broken by=20
the 1.6 change to GeneratedCodeClass.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I attach a corrected version of =
MakeHelloWorld.java. Its=20
all yours if you want it.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Would you kindly pass on my thanks to thomasd for =
the bytecode=20
utility which is tremendously useful.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Regards</FONT></DIV>
<DIV><FONT size=3D2>Mike May</FONT></DIV></BODY></HTML>
------=_NextPart_001_0086_01BFAB75.4553B3E0--
------=_NextPart_000_0085_01BFAB75.4553B3E0
Content-Type: text/java;
name="MakeHelloWorld.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="MakeHelloWorld.java"
cGFja2FnZSB0ZXN0OwoKaW1wb3J0IG9yZy5iaW9qYXZhLnV0aWxzLmJ5dGVjb2RlLio7CgppbXBv
cnQgamF2YS51dGlsLio7CmltcG9ydCBqYXZhLmlvLio7CgpwdWJsaWMgY2xhc3MgTWFrZUhlbGxv
V29ybGQgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgdGhyb3dz
IEV4Y2VwdGlvbiB7CglDb2RlQ2xhc3MgY2xfT2JqZWN0ID0gSW50cm9zcGVjdGVkQ29kZUNsYXNz
LmZvckNsYXNzKCJqYXZhLmxhbmcuT2JqZWN0Iik7CglDb2RlQ2xhc3MgY2xfU3RyaW5nID0gSW50
cm9zcGVjdGVkQ29kZUNsYXNzLmZvckNsYXNzKCJqYXZhLmxhbmcuU3RyaW5nIik7CglDb2RlQ2xh
c3MgY2xfU3lzdGVtID0gSW50cm9zcGVjdGVkQ29kZUNsYXNzLmZvckNsYXNzKCJqYXZhLmxhbmcu
U3lzdGVtIik7CglDb2RlQ2xhc3MgY2xfUHJpbnRTdHJlYW0gPSBJbnRyb3NwZWN0ZWRDb2RlQ2xh
c3MuZm9yQ2xhc3MoImphdmEuaW8uUHJpbnRTdHJlYW0iKTsKCUNvZGVDbGFzcyBjbF9wVm9pZCA9
IEludHJvc3BlY3RlZENvZGVDbGFzcy5mb3JDbGFzcyhWb2lkLl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