You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-dev@jakarta.apache.org by Bill Stoddard <bi...@wstoddard.com> on 2003/01/27 16:11:54 UTC

Re: [Bsf-discussion] Solved: BSF-bug with "char" as argument

Rony,
Thanks, we'll get this fix in.  For future reference, unified diffs are 
a bit easier for humans to read than context diffs (ie, diff -u or cvs 
diff -u).

Bill

Rony G. Flatscher wrote:

> Hi there,
>
> while enhancing the BSF engine for Rexx and Object Rexx for BSF 2.2 
> (IBM-version) first and then adapting it to BSF 2.3 (Apache-version) I 
> finally traced down an error, which has been bugging me for a looong 
> time and which I had filed with the bug tracking system a while ago: 
> if an argument in the method signature is of type "char", then the 
> appropriate method could not be found via reflection. The reason for 
> this lies in "EngineUtils.callBeanMethod(...)", where the case of 
> "Character" is not taken care of. Here's the diff for BSF 2.2:
>
> -------------------------------- cut here 
> --------------------------------
> \bsf-2_2\lib\com\ibm\bsf\util>diff -w EngineUtils.java 
> bkp\EngineUtils.java
> 140,141d139
> <             } else if (args[i] instanceof Character) {
> <               argTypes[i] = char.class;
> -------------------------------- cut here 
> --------------------------------
>
> If the error is in 2.3, maybe this report helps resolve that issue 
> there as well.
>
> ---rony
>
> P.S.: In case of interest: the present adaptations use the BSF 
> infrastructure to allow Rexx programs to load the JVM at runtime and 
> then interact with the Java environment with the means of BSF (as if 
> the Rexx program was started via BSF), in effect using all of Java as 
> a huge "function" library. This allows for 100% portable Rexx programs 
> taking advantage of the ubiquituousness of Java. [At the same time the 
> ability to invoke Rexx programs from Java remains unchanged (actually 
> taking care of the case where Java programmers forget to register Java 
> objects in the BSF registry before invoking the Rexx programs via BSF; 
> in such a case the Rexx engine registers those Java objects on behalf 
> of the Java programmers before invoking Rexx).]
>
>
>
> _______________________________________________
> Bsf-discussion mailing list
> Bsf-discussion@www-124.ibm.com
> http://www-124.ibm.com/developerworks/oss/mailman/listinfo/bsf-discussion
>



Re: [Bsf-discussion] Solved: BSF-bug with "char" as argument

Posted by "Victor J. Orlikowski" <vj...@dulug.duke.edu>.
On Tue, Jan 28, 2003 at 02:40:41PM -0500, Bill Stoddard wrote:
> Rony G. Flatscher wrote:
> >
> >
> > Hmm, how about this version then?
> > ;)

Apologies on the late, late, late reply.
Patch applied, to be committed shortly (cleaning up the file now;
not entirely happy w/ the current state of the file).

Thanks,
Victor
-- 
Victor J. Orlikowski   | The Wall is Down, But the Threat Remains!
==================================================================
orlikowski@apache.org  | vjo@dulug.duke.edu | vjo@us.ibm.com

Re: [Bsf-discussion] Solved: BSF-bug with "char" as argument

Posted by Bill Stoddard <bi...@wstoddard.com>.
Rony G. Flatscher wrote:

> Bill,
>
>> Oh nothing to be sorry about, just pointing out something that works 
>> well for us over in the Apache httpd development mailing list.  BTW, 
>> this patch shows that two lines of code are being deleted (note the 
>> '-' by each of the lines being changed). 
>
>
> Hmm, how about this version then?
> ;)

Full marks, perfect!

Bill



Re: [Bsf-discussion] Solved: BSF-bug with "char" as argument

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Bill,

> Oh nothing to be sorry about, just pointing out something that works 
> well for us over in the Apache httpd development mailing list.  BTW, 
> this patch shows that two lines of code are being deleted (note the 
> '-' by each of the lines being changed). 

Hmm, how about this version then?
;)

----------------------------- cut here -----------------------------
E:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\util>diff -wu 
bkp\EngineUtils.java EngineUtils.java
--- bkp\EngineUtils.java        2001-01-30 17:46:18.000000000 +0100
+++ EngineUtils.java    2003-01-24 21:49:12.000000000 +0100
@@ -137,6 +137,8 @@
              else if(args[i] instanceof Double ) argTypes[i]= double.class;
            } else if (args[i] instanceof Boolean) {
              argTypes[i] = boolean.class;
+            } else if (args[i] instanceof Character) {
+              argTypes[i] = char.class;
            }
          }
          m = MethodUtils.getMethod (beanClass, methodName, argTypes,
----------------------------- cut here -----------------------------

Clearly, it shows pluses...

Seriously, obviously I did it the wrong way, so the above fisrt cites 
the original file (but beware that is still from the 2.2. distribution) 
and then the one with my changes, hence now the semantically correct 
differences are shown (i.e. additions to the present code). Will look 
after this, should another patch suggestion be posted.

Regards,

---rony




Re: [Bsf-discussion] Solved: BSF-bug with "char" as argument

Posted by Bill Stoddard <bi...@wstoddard.com>.
Rony G. Flatscher wrote:

> Bill,
>
>> Thanks, we'll get this fix in.  For future reference, unified diffs 
>> are a bit easier for humans to read than context diffs (ie, diff -u 
>> or cvs diff -u).
>
>
> Sorry for that (didn't realize it, it's a loong time that I worked 
> with diffs or cvs for that matter), here's the new output: 

Oh nothing to be sorry about, just pointing out something that works 
well for us over in the Apache httpd development mailing list.  BTW, 
this patch shows that two lines of code are being deleted (note the '-' 
by each of the lines being changed).

>
>
> ----------------------------------- cut here 
> -------------------------------------
> E:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\util>diff -uw EngineUtils.java 
> bkp\EngineUtils.java
> --- EngineUtils.java    2003-01-24 21:49:12.000000000 +0100
> +++ bkp\EngineUtils.java        2001-01-30 17:46:18.000000000 +0100
> @@ -137,8 +137,6 @@
>              else if(args[i] instanceof Double ) argTypes[i]= 
> double.class;
>            } else if (args[i] instanceof Boolean) {
>              argTypes[i] = boolean.class;
> -            } else if (args[i] instanceof Character) {
> -              argTypes[i] = char.class;
>             }
>          }
>          m = MethodUtils.getMethod (beanClass, methodName, argTypes,
> ----------------------------------- cut here 
> -------------------------------------




Re: [Bsf-discussion] Solved: BSF-bug with "char" as argument

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Bill,

> Thanks, we'll get this fix in.  For future reference, unified diffs 
> are a bit easier for humans to read than context diffs (ie, diff -u or 
> cvs diff -u).

Sorry for that (didn't realize it, it's a loong time that I worked with 
diffs or cvs for that matter), here's the new output:

----------------------------------- cut here 
-------------------------------------
E:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\util>diff -uw EngineUtils.java 
bkp\EngineUtils.java
--- EngineUtils.java    2003-01-24 21:49:12.000000000 +0100
+++ bkp\EngineUtils.java        2001-01-30 17:46:18.000000000 +0100
@@ -137,8 +137,6 @@
              else if(args[i] instanceof Double ) argTypes[i]= double.class;
            } else if (args[i] instanceof Boolean) {
              argTypes[i] = boolean.class;
-            } else if (args[i] instanceof Character) {
-              argTypes[i] = char.class;
             }
          }
          m = MethodUtils.getMethod (beanClass, methodName, argTypes,
----------------------------------- cut here 
-------------------------------------

Regards,

---rony