Hi Markus -

     Thanks much - I'm going to give that a whirl and see if it improves
Importscrubber's accuracy - it certainly should....

     Thanks,

Tom Copeland
[EMAIL PROTECTED]
703-317-5193


                                                                                       
                                                       
                    Markus Dahm                                                        
                                                       
                    <markus.dahm@        To:     [EMAIL PROTECTED]            
                                                       
                    berlin.de>           cc:                                           
                                                       
                                         Subject:     Re: ImportScrubberTask           
                                                       
                    10/23/2001                                                         
                                                       
                    05:43 AM                                                           
                                                       
                    Please                                                             
                                                       
                    respond to                                                         
                                                       
                    general                                                            
                                                       
                                                                                       
                                                       
                                                                                       
                                                       




On Monday 22 October 2001 22:21, you wrote:
Hi,

> When writing JNI code which references Java classes, one has to use
> special markup on the fully qualified class names.
> I.e. "Lorg/apache/turbine/Turbine;" would be the string literal
> corresponding to the class org.apache.turbine.Turbine, and something
> like "(Ljava/lang/String;Ljava/lang/String;)V" to denote a method
> which takes two String parameters.  Looking at some bytecode using
> `strings`, I notice that this seems to apply to at least part of a
> method signature.  Not a lot of help here, but maybe something to
> think about.  <shrug/>

ok, here's my two cents (or was it dimes?): There are two ways how classes
can be referenced in class files: either through a direct reference to a
ConstantClass object in the constant pool, or through the signature of a
method/field. The former case is easy to detect, because you just have to
scan the constant pool. The latter is a little more difficult to detect,
but
I think you can do it by scanning the byte code and just take only those
constant pool entries (i.e. strings) into account that are referenced by a,

say, GETFIELD instruction. I think I even introduced an interface into BCEL

to denote such instructions named "LoadClass".
It takes a little more time than the heuristic method, but is still O(n) ;
-)

Cheers
           Markus
--
Email:          [EMAIL PROTECTED]                    Phone: +49 30 838
75141
WWW:    http://www.berlin.de/~markus.dahm/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


                                                                            
                                                                            
 -------------------------------------------------------------------------- 


This email may contain confidential and proprietary information which is
for the sole use of the intended recipient.  If you received this email in
error, please notify the sender and delete this email from your computer.
Any review, distribution or retransmission of or reliance on this email by
anyone other than the intended recipient is forbidden.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to