Re: getting type information from this code

"Dave Brosius" <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <009601c4f9be$952244d0$387596d1@MBFG>
In the case of static finals, i believe the constant value is just folded 
into the class that uses it, and there is no reference of the class where 
the constant is defined.

----- Original Message ----- 
From: "Dean Hiller" <[email protected]>
To: "BCEL Users List" <[email protected]>
Sent: Thursday, January 13, 2005 2:33 PM
Subject: Re: getting type information from this code


> Sweet!!!  That is exactly what I want.  I will try to figure out the 
> methods
> I use in bcel to get that info.
>
> 2 more questions then....
> 1. Is there a way to find out if the -g option was used when looking at 
> the
> byte code?  I see there are different debug info also(lines, source, and
> vars)...I really would just like to see if all are on or not, or at least
> the vars so I can give an error saying class was not compiled with -g
> option.
> 2. If I have code like this
>
> public class Client {
> public void method() {
>    String s = SomeClass.CONSTANT;  //CONSTANT is static final
> }
> }
>
> Is there a way from the "Client" class file to tell that it depends on
> "SomeClass" class?  Is there anything in the bytecode that would tell me
> that?  I remember reading constants were compiled in though so I am 
> thinking
> this one is not possible, or am I wrong?
> thanks,
> dean
>
>
> ----- Original Message ----- 
> From: "Dave Brosius" <[email protected]>
> To: "BCEL Users List" <[email protected]>
> Sent: Wednesday, January 12, 2005 10:55 PM
> Subject: Re: getting type information from this code
>
>
>> No, all you know is what local variable slot the variable is found in.
> Then
>> you can look in the LocalVariableTable to find the information out
> (assuming
>> it is in the class file) [compiled with -g]
>>
>> the byte code would be something like
>>
>> aconst_null
>> astore_1
>>
>> ----- Original Message ----- 
>> From: "Dean Hiller" <[email protected]>
>> To: <[email protected]>
>> Sent: Thursday, January 13, 2005 12:36 AM
>> Subject: getting type information from this code
>>
>>
>> Am I correct in saying the byte code will not contain information on the
>> type for line 2 in the following code
>>
>>
>> line 1: public void someMethod() {
>> line 2:           DummyClass c = null;
>> line 3:  }
>>
>> Is it correct to say that the byte code will not contain info that the
>> variable c is of type DummyClass?  If I am incorrect, how do I get the
> type
>> information?
>> thanks,
>> dean
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.