From bcel-usermichaelchan@example.org Thu Jun 03 19:29:42 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 20249 invoked from network); 3 Jun 2004 19:29:42 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 3 Jun 2004 19:29:42 -0000
Received: (qmail 1061 invoked by uid 500); 3 Jun 2004 19:29:58 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 1030 invoked by uid 500); 3 Jun 2004 19:29:57 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 1014 invoked by uid 99); 3 Jun 2004 19:29:57 -0000
Received: from [83.161.120.155] (HELO mail.gmx.net) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 03 Jun 2004 12:29:57 -0700
Received: (qmail 8093 invoked by uid 65534); 3 Jun 2004 19:29:33 -0000
Received: from 80-218-61-25.dclient.hispeed.ch (EHLO 80-218-61-25.dclient.hispeed.ch) (83.161.120.155)
  by mail.gmx.net (mp022) with SMTP; 03 Jun 2004 21:29:33 +0200
X-Authenticated: #1279373
Subject: Re: Modification of java.lang.Object
From: Daniel Schregenberger <michaelchan@example.org>
To: Todd Wright <michaelchan@example.org>
Cc: BCEL Users List <michaelchan@example.org>
In-Reply-To: <michaelchan@example.org>
References: <1084305680.7572.29.camel@localhost>
	 <michaelchan@example.org> <1084471941.7556.16.camel@localhost>
	 <michaelchan@example.org>
Content-Type: text/plain
Message-Id: <1086290967.8637.16.camel@localhost>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.6 
Date: Thu, 03 Jun 2004 21:29:27 +0200
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

On Die, 2004-05-18 at 16:28, Todd Wright wrote:
> > > What I'm doing is to put all the objects in a hash table.  That means
> > > you can associate whatever info you want with them.  You have to
> > > make sure that you use System.identityhashcode and the == operator,
> > > you have to use weak references (unless you don't mind no garbage
> > > collection occurring) and you have to be careful that your own
> > > objects (eg the WeakReferences themselves) don't get put into the
> > > system.
> > >
> > > Apart from that it's quite simple.  :-)
> >
> > I was thinking about this approach too. There's a high probability that
> > I will try it this way now.
> > Thanks for pointing out the difficult parts!
> 
> I wrote something like this using BCEL without VM changes.  It's all open 
> source:
> 
> Offline I modify all class constructors to register the newly created instance 
> in a table, using WeakReferences to allow GC:
>   http://profiler.cougaar.org/#design
> For and overview and snapshots, see:
>   http://profiler.cougaar.org/
> I implemented a table that's quite similar to your design:
> http://cougaar.org/cgi-bin/viewcvs.cgi/profiler_impl/src/org/cougaar/profiler/InstancesTable.java?rev=HEAD&cvsroot=profiler&content-type=text/vnd.viewcvs-markup
> 
> It was discussed on the "advanced-java" mailing list:
>    
> http://discuss.develop.com/archives/wa.exe?A2=ind0312&L=ADVANCED-JAVA&T=0&I=-3&P=1321
> 
> Since the above discussion I've fixed several limitations, such as String and 
> Thread tracking.  Some "java.lang" classes are still out of reach due to the 
> VM:
>   Class
>   Object
>   String$CaseInsensitiveComparator
>   java.lang.ThreadGroup
>   java.lang.Throwable
>   java.lang.ref.Reference
>   java.lang.ref.SoftReference
>   java.lang.ref.WeakReference     # since I use WeakReferences in my table!
> The Sun JVM ignores any modifications to Class, and Object is likely the same, 
> since it's partially built into the VM.  Also, there was a minor hurdle with 
> BCEL 5.1 and "java.math.BigInteger":
>   http://issues.apache.org/bugzilla/show_bug.cgi?id=18323
> 
> A more significant limitation is array tracking, since arrays lack a 
> constructor.  I've started a workaround to modify "newarray" clients, but 
> some of the largest arrays are inside the JVM (e.g. classfile bytecodes, 
> jars, string constants, etc).
> 
> I'd be happy to discuss the details and usage...

I don't have any of these problems, since I can put these things into
the compiler. I only have to be carefull with regards to GC. 

Thanks for your help!

-- Daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 23 02:22:43 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 48944 invoked from network); 23 Jun 2004 02:22:43 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 23 Jun 2004 02:22:43 -0000
Received: (qmail 60802 invoked by uid 500); 23 Jun 2004 02:22:47 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 60507 invoked by uid 500); 23 Jun 2004 02:22:43 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 59955 invoked by uid 99); 23 Jun 2004 02:22:34 -0000
X-ASF-Spam-Status: No, hits=0.6 required=10.0
	tests=NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO floyd.qis.net) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 22 Jun 2004 19:22:34 -0700
Received: from moon.qis.net (moon.qis.net [83.161.120.155])
	by floyd.qis.net (Postfix) with ESMTP id 35E5A7391E
	for <michaelchan@example.org>; Tue, 22 Jun 2004 22:22:01 -0400 (EDT)
Received: from 83.161.120.155
	by moon.qis.net (amavisd-lite) with LMTP id 1087957930-68701-58
	for <michaelchan@example.org>; Tue Jun 22 22:32:10 2004
Received: from localhost (eclipse2.qis.net [83.161.120.155])
	by floyd.qis.net (Postfix) with ESMTP id D361173853
	for <michaelchan@example.org>; Tue, 22 Jun 2004 22:22:00 -0400 (EDT)
Received: from balt-209-150-116-156.dynamic-dial.qis.net (balt-209-150-116-156.dynamic-dial.qis.net [83.161.120.155]) 
	by webmail.qis.net (IMP) with HTTP 
	for <michaelchan@example.org>; Tue, 22 Jun 2004 22:22:00 -0400
Message-ID: <michaelchan@example.org>
Date: Tue, 22 Jun 2004 22:22:00 -0400
From: michaelchan@example.org
To: michaelchan@example.org
Subject: Re: ezmlm response
References: <michaelchan@example.org>
In-Reply-To: <michaelchan@example.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 3.2.2
X-Originating-IP: 83.161.120.155
X-Virus-Scanned: by michaelchan@example.org
X-Spam-Status: No, hits=0.0 required=5.0
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

It seems to me that when i call JavaClass.getFields(), i get all the fields in
the object even if they are defined in the super class. This is at odds with
what the documentation says. Is this the current behavior, or am I loopy? If
so, is there a way to get just the fields defined by the class itself?

Thx,
dave



---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 23 04:47:47 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 21505 invoked from network); 23 Jun 2004 04:47:47 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 23 Jun 2004 04:47:47 -0000
Received: (qmail 29430 invoked by uid 500); 23 Jun 2004 04:48:08 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 29151 invoked by uid 500); 23 Jun 2004 04:48:00 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 28729 invoked by uid 99); 23 Jun 2004 04:47:51 -0000
X-ASF-Spam-Status: No, hits=0.0 required=10.0
	tests=
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO unxcoms01.ecnetwork.co.nz) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 22 Jun 2004 21:47:49 -0700
Received: from serpent.ecnetwork.co.nz (serpent [83.161.120.155])
	by unxcoms01.ecnetwork.co.nz (8.12.8/8.12.8) with ESMTP id i5N4lAXL023292
	for <michaelchan@example.org>; Wed, 23 Jun 2004 16:47:11 +1200
Received: from pcjohns.ecnnz.ecnetwork.co.nz (unknown [83.161.120.155])
	by serpent.ecnetwork.co.nz (Postfix) with ESMTP id EFF971035
	for <michaelchan@example.org>; Wed, 23 Jun 2004 16:56:23 +1200 (NZST)
Subject: Re: ezmlm response
From: Simon Kitching <michaelchan@example.org>
To: BCEL Users List <michaelchan@example.org>
In-Reply-To: <michaelchan@example.org>
References: <michaelchan@example.org>
	 <michaelchan@example.org>
Content-Type: text/plain
Message-Id: <1087966030.12807.1.camel@pcsimon>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.6 
Date: Wed, 23 Jun 2004 16:47:10 +1200
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

On Wed, 2004-06-23 at 14:22, michaelchan@example.org wrote:
> It seems to me that when i call JavaClass.getFields(), i get all the fields in
> the object even if they are defined in the super class. This is at odds with
> what the documentation says. Is this the current behavior, or am I loopy? If
> so, is there a way to get just the fields defined by the class itself?

I get just the fields on the specific class, and not any inherited
fields, as expected.

Your code must be doing something odd...

Regards,

simon



---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Mon Jun 28 09:27:10 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 26881 invoked from network); 28 Jun 2004 09:27:10 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 28 Jun 2004 09:27:10 -0000
Received: (qmail 26860 invoked by uid 500); 28 Jun 2004 09:27:20 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 26785 invoked by uid 500); 28 Jun 2004 09:27:18 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 26731 invoked by uid 99); 28 Jun 2004 09:27:17 -0000
X-ASF-Spam-Status: No, hits=1.2 required=10.0
	tests=PLING_PLING
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO smtp.MacauCableTV.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 28 Jun 2004 02:27:16 -0700
Received: from mis004 ([83.161.120.155])
          by smtp.MacauCableTV.com (Lotus Domino Release 5.0.2b (Intl))
          with SMTP id 2004062817264616:34045 ;
          Mon, 28 Jun 2004 17:26:46 +0800 
Message-ID: <000901c45cf2$07feda00$5c64a8c0@mctv>
Reply-To: "Eric Chow" <michaelchan@example.org>
From: "Eric Chow" <michaelchan@example.org>
To: <michaelchan@example.org>
Subject: modify class !!!
Date: Mon, 28 Jun 2004 17:26:40 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MIMETrack: Itemize by SMTP Server on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/28/2004 05:26:46 PM,
	Serialize by Router on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/28/2004 05:26:49 PM,
	Serialize complete at 06/28/2004 05:26:49 PM
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="iso-8859-1"
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Hello, 

I am a beginner in using BCEL. 

Is it possible to modify the variable values and variable name with BCEL? 

For example, 

class test { 
public void init(int a, String x) { 
int i; 
String o; 

i = a + 1; 
o = x + " ... "; 
} 
} 


In the above java, after I compiled it to test.class, how can I change the 

1. init(int a, String x) to init(int intVar, String strVar) 
2. int i ----> int tmpVar; 
3. String o ----> String oVar; 
4. i = a + 1 ----> i = 10; 



Best regards, 
Eric 


==========================
If you know what you are doing, 
it is not called RESEARCH!
==========================

---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Mon Jun 28 12:34:39 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 54849 invoked from network); 28 Jun 2004 12:34:39 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 28 Jun 2004 12:34:39 -0000
Received: (qmail 7568 invoked by uid 500); 28 Jun 2004 12:34:34 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 7487 invoked by uid 500); 28 Jun 2004 12:34:31 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 11443 invoked by uid 99); 28 Jun 2004 09:59:36 -0000
X-ASF-Spam-Status: No, hits=1.2 required=10.0
	tests=PLING_PLING
X-Spam-Check-By: apache.org
Subject: Re: modify class !!!
From: Dick Eimers <michaelchan@example.org>
Reply-To: michaelchan@example.org
To: Eric Chow <michaelchan@example.org>
Cc: michaelchan@example.org
In-Reply-To: <000901c45cf2$07feda00$5c64a8c0@mctv>
References: <000901c45cf2$07feda00$5c64a8c0@mctv>
Content-Type: text/plain
Organization: UU.nl
Message-Id: <michaelchan@example.org>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) 
Date: Mon, 28 Jun 2004 11:58:52 +0200
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N


> Is it possible to modify the variable values and variable name with BCEL? 
> 
> For example, 
> 
> class test { 
> public void init(int a, String x) { 
> int i; 
> String o; 
> 
> i = a + 1; 
> o = x + " ... "; 
> } 
> } 

Don't know if I correctly understand your intentions,  but let me give
it a shot:

> 1. init(int a, String x) to init(int intVar, String strVar) 

Done :) names of variables are a Java language notion, in a Java class
file these are mapped do local variable indexes, so this is a non-issue.

> 2. int i ----> int tmpVar; 

'i' is just local variable slot for some time. If the variable is out of
scope, the local variable slot could be reused. non-issue. 'i' doesn't
really exist, just added to the LocalVariableTable attribute by the
compiler for debugging purposes.
 
> 3. String o ----> String oVar; 

idem. 

> 4. i = a + 1 ----> i = 10; 

Can't say anything about this since there is no pattern. I mean, do you
mean rewriting the 'i' variable to 10? The value of 'i' is the result of
a evaluating a bytecode sequence. Consider the following; 

.. 
iload_1
iconst_1
iadd
istore ?
..

At some point you get to the assignment of the 'i' variable. The value
of 'a' is in local variable slot 1 (becuase you are describing an
instance methods, thus slot 0 is used by the reference to the object
invoked on (this)). The iload_1 places a copy on the stack, next the
iconst_1 places constant 1 on the stack and the iadd instruction sums
the two top stack values. Finally, the istore instruction stores the
result of the addition in the local variable that represents the 'a'
variable.

So based on your intentions you can try to find a pattern in the
bytecode and rewrite it like, 

iload_1  
iconst_1  => iconst 10  
iadd         
istore ?     istore ?     

the key issue however is locating a pattern that works for all
methods.... 





---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Mon Jun 28 12:47:48 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 66011 invoked from network); 28 Jun 2004 12:47:48 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 28 Jun 2004 12:47:48 -0000
Received: (qmail 48086 invoked by uid 500); 28 Jun 2004 12:47:29 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 48024 invoked by uid 500); 28 Jun 2004 12:47:28 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 47972 invoked by uid 99); 28 Jun 2004 12:47:27 -0000
X-ASF-Spam-Status: No, hits=1.2 required=10.0
	tests=PLING_PLING
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO mail.comtec.e-technik.uni-kassel.de) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 28 Jun 2004 05:47:25 -0700
Received: from localhost (wlan96 [83.161.120.155])
	by mail.comtec.e-technik.uni-kassel.de (8.13.0/8.13.0) with SMTP id i5SClHHv028607
	for <michaelchan@example.org>; Mon, 28 Jun 2004 14:47:17 +0200 (CEST)
Date: Mon, 28 Jun 2004 14:49:06 +0200
From: SianLun Lau <michaelchan@example.org>
To: "BCEL Users List" <michaelchan@example.org>
Subject: Re: modify class !!!
Message-Id: <20040628144906.23891646@localhost>
In-Reply-To: <michaelchan@example.org>
References: <000901c45cf2$07feda00$5c64a8c0@mctv>
	<michaelchan@example.org>
Organization: Comtec Uni Kassel
X-Mailer: Sylpheed version 0.9.11claws (GTK+ 1.2.10; i386-redhat-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

On Mon, 28 Jun 2004 11:58:52 +0200
Dick Eimers <michaelchan@example.org> wrote:

Hi all,

> > Is it possible to modify the variable values and variable name
> > with BCEL? 

yes. but i don see why variable names should be changed :)

[snipped]
> > 4. i = a + 1 ----> i = 10; 
> 
> Can't say anything about this since there is no pattern. I mean, do
> you mean rewriting the 'i' variable to 10? The value of 'i' is the
> result of a evaluating a bytecode sequence. Consider the following; 
[snipped]
> the key issue however is locating a pattern that works for all
> methods.... 

if this is just an assignment or a self learn project, i would do it
with the help of BCELifier with the original code, and then
again with the new code. by comparing both outputs, you will see what
is actually needed to be changed.

that makes learning faster, and also, erm, more fun.

newbie,
SianLun

---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 07:05:21 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 59505 invoked from network); 30 Jun 2004 07:05:21 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 07:05:21 -0000
Received: (qmail 95796 invoked by uid 500); 30 Jun 2004 07:05:41 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 95701 invoked by uid 500); 30 Jun 2004 07:05:39 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 95625 invoked by uid 99); 30 Jun 2004 07:05:37 -0000
X-ASF-Spam-Status: No, hits=0.0 required=10.0
	tests=
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO smtp.MacauCableTV.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 30 Jun 2004 00:05:36 -0700
Received: from mis004 ([83.161.120.155])
          by smtp.MacauCableTV.com (Lotus Domino Release 5.0.2b (Intl))
          with SMTP id 2004063015045254:35293 ;
          Wed, 30 Jun 2004 15:04:52 +0800 
Message-ID: <001d01c45e70$896d3440$5c64a8c0@mctv>
Reply-To: "Eric Chow" <michaelchan@example.org>
From: "Eric Chow" <michaelchan@example.org>
To: <michaelchan@example.org>,
	"BCEL Users List" <michaelchan@example.org>
Subject: How to add a variable under a method ??
Date: Wed, 30 Jun 2004 15:04:45 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MIMETrack: Itemize by SMTP Server on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 03:04:52 PM,
	Serialize by Router on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 03:04:59 PM,
	Serialize complete at 06/30/2004 03:04:59 PM
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="utf-8"
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Hello,

Would you teach me how I can add a variable in a method ??

For example,

public void test() {

}

how can I add a variable in the test() body, 
public void test() {
   int x = 100;
}

==========================
If you know what you are doing, 
it is not called RESEARCH!
==========================

---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 07:07:53 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 60863 invoked from network); 30 Jun 2004 07:07:53 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 07:07:53 -0000
Received: (qmail 3718 invoked by uid 500); 30 Jun 2004 07:08:12 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 3639 invoked by uid 500); 30 Jun 2004 07:08:12 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 3579 invoked by uid 99); 30 Jun 2004 07:08:11 -0000
X-ASF-Spam-Status: No, hits=0.0 required=10.0
	tests=
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO smtp.MacauCableTV.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 30 Jun 2004 00:08:11 -0700
Received: from mis004 ([83.161.120.155])
          by smtp.MacauCableTV.com (Lotus Domino Release 5.0.2b (Intl))
          with SMTP id 2004063015073058:35296 ;
          Wed, 30 Jun 2004 15:07:30 +0800 
Message-ID: <003401c45e70$e898e9a0$5c64a8c0@mctv>
Reply-To: "Eric Chow" <michaelchan@example.org>
From: "Eric Chow" <michaelchan@example.org>
To: "BCEL Users List" <michaelchan@example.org>
Subject: Retrieve all the values of variables in the class ?
Date: Wed, 30 Jun 2004 15:07:25 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MIMETrack: Itemize by SMTP Server on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 03:07:30 PM,
	Serialize by Router on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 03:07:33 PM,
	Serialize complete at 06/30/2004 03:07:33 PM
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="iso-8859-1"
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Hello,

How can I get the all variable values in the class including all the globale
constant values and local variable values ??

For example,

public class A {
   private static final String s = "Hello World";

   public int sum(int a, in b) {
      int x = 100;
      return a + b + x;
   }
}


How can I get the value of "x" in the method sum and the value of String s
???


Eric


==========================
If you know what you are doing,
it is not called RESEARCH!
==========================


---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 07:56:57 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 98642 invoked from network); 30 Jun 2004 07:56:56 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 07:56:56 -0000
Received: (qmail 20053 invoked by uid 500); 30 Jun 2004 07:57:21 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 20016 invoked by uid 500); 30 Jun 2004 07:57:21 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 19989 invoked by uid 99); 30 Jun 2004 07:57:20 -0000
X-ASF-Spam-Status: No, hits=0.1 required=10.0
	tests=DNS_FROM_RFC_ABUSE
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO web13424.mail.yahoo.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 30 Jun 2004 00:57:17 -0700
Message-ID: <michaelchan@example.org>
Received: from [83.161.120.155] by web13424.mail.yahoo.com via HTTP; Wed, 30 Jun 2004 00:56:37 PDT
Date: Wed, 30 Jun 2004 00:56:37 -0700 (PDT)
From: Yasir Siraj <michaelchan@example.org>
Subject: Re: Retrieve all the values of variables in the class ?
To: BCEL Users List <michaelchan@example.org>,
  Eric Chow <michaelchan@example.org>
In-Reply-To: <003401c45e70$e898e9a0$5c64a8c0@mctv>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Hello,
   To get all class variables & their values, u can
use this
Field fields[] = jClass.getFields();
	for (int i = 0; i < fields.length; i++) {
            fields[i].getName();
            fields[i].getConstantValue();
        }

For method variables, u can use 
MethodGen mGen = new MethodGen(method,
className,constantpoolgen );
mGen.getLocalVariables();

I hope this will help.

Regards.
Yasir Siraj.
IMP-DCS
Chalmers University Of Technology
Goteborg, Sweden.

--- Eric Chow <michaelchan@example.org> wrote:
> Hello,
> 
> How can I get the all variable values in the class
> including all the globale
> constant values and local variable values ??
> 
> For example,
> 
> public class A {
>    private static final String s = "Hello World";
> 
>    public int sum(int a, in b) {
>       int x = 100;
>       return a + b + x;
>    }
> }
> 
> 
> How can I get the value of "x" in the method sum and
> the value of String s
> ???
> 
> 
> Eric
> 
> 
> ==========================
> If you know what you are doing,
> it is not called RESEARCH!
> ==========================
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> michaelchan@example.org
> For additional commands, e-mail:
> michaelchan@example.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 08:17:38 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 11032 invoked from network); 30 Jun 2004 08:17:37 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 08:17:37 -0000
Received: (qmail 76396 invoked by uid 500); 30 Jun 2004 08:18:04 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 76376 invoked by uid 500); 30 Jun 2004 08:18:04 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 76359 invoked by uid 99); 30 Jun 2004 08:18:03 -0000
X-ASF-Spam-Status: No, hits=0.0 required=10.0
	tests=
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO smtp.MacauCableTV.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 30 Jun 2004 01:17:59 -0700
Received: from mis004 ([83.161.120.155])
          by smtp.MacauCableTV.com (Lotus Domino Release 5.0.2b (Intl))
          with SMTP id 2004063016171581:35344 ;
          Wed, 30 Jun 2004 16:17:15 +0800 
Message-ID: <001701c45e7a$a7366f00$5c64a8c0@mctv>
Reply-To: "Eric Chow" <michaelchan@example.org>
From: "Eric Chow" <michaelchan@example.org>
To: "BCEL Users List" <michaelchan@example.org>
References: <michaelchan@example.org>
Subject: Re: Retrieve all the values of variables in the class ?
Date: Wed, 30 Jun 2004 16:17:10 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MIMETrack: Itemize by SMTP Server on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 04:17:15 PM,
	Serialize by Router on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 04:17:19 PM,
	Serialize complete at 06/30/2004 04:17:19 PM
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="iso-8859-1"
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Would you please to show me a complete example ???


Eric

----- Original Message ----- 
From: "Yasir Siraj" <michaelchan@example.org>
To: "BCEL Users List" <michaelchan@example.org>; "Eric Chow"
<michaelchan@example.org>
Sent: Wednesday, June 30, 2004 3:56 PM
Subject: Re: Retrieve all the values of variables in the class ?


> Hello,
>    To get all class variables & their values, u can
> use this
> Field fields[] = jClass.getFields();
> for (int i = 0; i < fields.length; i++) {
>             fields[i].getName();
>             fields[i].getConstantValue();
>         }
>
> For method variables, u can use
> MethodGen mGen = new MethodGen(method,
> className,constantpoolgen );
> mGen.getLocalVariables();
>
> I hope this will help.
>
> Regards.
> Yasir Siraj.
> IMP-DCS
> Chalmers University Of Technology
> Goteborg, Sweden.
>
> --- Eric Chow <michaelchan@example.org> wrote:
> > Hello,
> >
> > How can I get the all variable values in the class
> > including all the globale
> > constant values and local variable values ??
> >
> > For example,
> >
> > public class A {
> >    private static final String s = "Hello World";
> >
> >    public int sum(int a, in b) {
> >       int x = 100;
> >       return a + b + x;
> >    }
> > }
> >
> >
> > How can I get the value of "x" in the method sum and
> > the value of String s
> > ???
> >
> >
> > Eric
> >
> >
> > ==========================
> > If you know what you are doing,
> > it is not called RESEARCH!
> > ==========================
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > michaelchan@example.org
> > For additional commands, e-mail:
> > michaelchan@example.org
> >
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: michaelchan@example.org
> For additional commands, e-mail: michaelchan@example.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 09:25:20 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 47913 invoked from network); 30 Jun 2004 09:25:20 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 09:25:20 -0000
Received: (qmail 48923 invoked by uid 500); 30 Jun 2004 09:25:47 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 48844 invoked by uid 500); 30 Jun 2004 09:25:45 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 48778 invoked by uid 99); 30 Jun 2004 09:25:43 -0000
X-ASF-Spam-Status: No, hits=0.1 required=10.0
	tests=DNS_FROM_RFC_ABUSE
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO web13422.mail.yahoo.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 30 Jun 2004 02:25:39 -0700
Message-ID: <michaelchan@example.org>
Received: from [83.161.120.155] by web13422.mail.yahoo.com via HTTP; Wed, 30 Jun 2004 02:24:57 PDT
Date: Wed, 30 Jun 2004 02:24:57 -0700 (PDT)
From: Yasir Siraj <michaelchan@example.org>
Subject: Re: Retrieve all the values of variables in the class ?
To: BCEL Users List <michaelchan@example.org>,
  Eric Chow <michaelchan@example.org>
In-Reply-To: <001701c45e7a$a7366f00$5c64a8c0@mctv>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Here's an example.

public void test() {
JavaClass jClass;
ConstantPool cp;
ConstantPoolGen cpg;
jClass = new ClassParser("HelloWorld.class").parse();
cp = jClass.getConstantPool();
cpg = new ConstantPoolGen(cp);
String className = jClass.getClassName();
Method methods[] = jClass.getMethods();
Field fields[] = jClass.getFields();
for (int i = 0; i < fields.length; i++) {
System.out.println(fields[i].getName());
System.out.println(fields[i].getConstantValue);
}
for (int j = 0; j < methods.length; j++) {
MethodGen mg = new MethodGen(methods[j], className,
cpg);
LocalVariableGen vGen[] = mg.getLocalVariables();
for (int k = 0; k < vGen.length; k++) {
System.out.println(vGen[k].getName());
}
}
}

I hope now, u'll get the idea on how to do things..

Regards.
Yasir Siraj.
IMP-DCS
Chalmers University Of Technology
Goteborg, Sweden.


=====

Regards.

Yasir Siraj. 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 09:57:02 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 68193 invoked from network); 30 Jun 2004 09:57:01 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 09:57:01 -0000
Received: (qmail 29622 invoked by uid 500); 30 Jun 2004 09:57:29 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 29493 invoked by uid 500); 30 Jun 2004 09:57:25 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 29433 invoked by uid 99); 30 Jun 2004 09:57:24 -0000
X-ASF-Spam-Status: No, hits=0.0 required=10.0
	tests=
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO smtp.MacauCableTV.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 30 Jun 2004 02:57:23 -0700
Received: from mis004 ([83.161.120.155])
          by smtp.MacauCableTV.com (Lotus Domino Release 5.0.2b (Intl))
          with SMTP id 2004063017563702:35413 ;
          Wed, 30 Jun 2004 17:56:37 +0800 
Message-ID: <001401c45e88$87d409c0$5c64a8c0@mctv>
Reply-To: "Eric Chow" <michaelchan@example.org>
From: "Eric Chow" <michaelchan@example.org>
To: "BCEL Users List" <michaelchan@example.org>
References: <michaelchan@example.org>
Subject: Re: Retrieve all the values of variables in the class ?
Date: Wed, 30 Jun 2004 17:56:31 +0800
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-MIMETrack: Itemize by SMTP Server on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 05:56:37 PM,
	Serialize by Router on mctv-off-srv/Macaucabletv(Release 5.0.2b (Intl)|16
 December 1999) at 06/30/2004 05:56:40 PM,
	Serialize complete at 06/30/2004 05:56:40 PM
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset="iso-8859-1"
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

Thank you very much.
In fact, I tried this before I posted the question.
But it just can't get the values ???? (only display the null value) !!!


Did you tried it ??

Eric



----- Original Message ----- 
From: "Yasir Siraj" <michaelchan@example.org>
To: "BCEL Users List" <michaelchan@example.org>; "Eric Chow"
<michaelchan@example.org>
Sent: Wednesday, June 30, 2004 5:24 PM
Subject: Re: Retrieve all the values of variables in the class ?


> Here's an example.
>
> public void test() {
> JavaClass jClass;
> ConstantPool cp;
> ConstantPoolGen cpg;
> jClass = new ClassParser("HelloWorld.class").parse();
> cp = jClass.getConstantPool();
> cpg = new ConstantPoolGen(cp);
> String className = jClass.getClassName();
> Method methods[] = jClass.getMethods();
> Field fields[] = jClass.getFields();
> for (int i = 0; i < fields.length; i++) {
> System.out.println(fields[i].getName());
> System.out.println(fields[i].getConstantValue);
> }
> for (int j = 0; j < methods.length; j++) {
> MethodGen mg = new MethodGen(methods[j], className,
> cpg);
> LocalVariableGen vGen[] = mg.getLocalVariables();
> for (int k = 0; k < vGen.length; k++) {
> System.out.println(vGen[k].getName());
> }
> }
> }
>
> I hope now, u'll get the idea on how to do things..
>
> Regards.
> Yasir Siraj.
> IMP-DCS
> Chalmers University Of Technology
> Goteborg, Sweden.
>
>
> =====
>
> Regards.
>
> Yasir Siraj.
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: michaelchan@example.org
> For additional commands, e-mail: michaelchan@example.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org


From bcel-usermichaelchan@example.org Wed Jun 30 10:15:26 2004
Return-Path: <bcel-usermichaelchan@example.org>
Delivered-To: michaelchan@example.org
Received: (qmail 79949 invoked from network); 30 Jun 2004 10:15:26 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur-2.apache.org with SMTP; 30 Jun 2004 10:15:26 -0000
Received: (qmail 81373 invoked by uid 500); 30 Jun 2004 10:15:50 -0000
Delivered-To: michaelchan@example.org
Received: (qmail 81266 invoked by uid 500); 30 Jun 2004 10:15:49 -0000
Mailing-List: contact michaelchan@example.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:michaelchan@example.org>
List-Subscribe: <mailto:michaelchan@example.org>
List-Help: <mailto:michaelchan@example.org>
List-Post: <mailto:michaelchan@example.org>
List-Id: "BCEL Users List" <bcel-user.jakarta.apache.org>
Reply-To: "BCEL Users List" <michaelchan@example.org>
Delivered-To: mailing list michaelchan@example.org
Received: (qmail 80750 invoked by uid 99); 30 Jun 2004 10:15:28 -0000
X-ASF-Spam-Status: No, hits=0.1 required=10.0
	tests=DNS_FROM_RFC_ABUSE
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO web13423.mail.yahoo.com) (83.161.120.155)
  by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 30 Jun 2004 03:15:27 -0700
Message-ID: <michaelchan@example.org>
Received: from [83.161.120.155] by web13423.mail.yahoo.com via HTTP; Wed, 30 Jun 2004 03:14:43 PDT
Date: Wed, 30 Jun 2004 03:14:43 -0700 (PDT)
From: Yasir Siraj <michaelchan@example.org>
Subject: Re: Retrieve all the values of variables in the class ?
To: BCEL Users List <michaelchan@example.org>,
  Eric Chow <michaelchan@example.org>
In-Reply-To: <001401c45e88$87d409c0$5c64a8c0@mctv>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N

It's working fine for me.

Regards.

Yasir Siraj.
IMP-DCS
Chalmers University Of Technology
Goteborg, Sweden.

--- Eric Chow <michaelchan@example.org> wrote:
> Thank you very much.
> In fact, I tried this before I posted the question.
> But it just can't get the values ???? (only display
> the null value) !!!
> 
> 
> Did you tried it ??
> 
> Eric
> 
> 
> 
> ----- Original Message ----- 
> From: "Yasir Siraj" <michaelchan@example.org>
> To: "BCEL Users List"
> <michaelchan@example.org>; "Eric Chow"
> <michaelchan@example.org>
> Sent: Wednesday, June 30, 2004 5:24 PM
> Subject: Re: Retrieve all the values of variables in
> the class ?
> 
> 
> > Here's an example.
> >
> > public void test() {
> > JavaClass jClass;
> > ConstantPool cp;
> > ConstantPoolGen cpg;
> > jClass = new
> ClassParser("HelloWorld.class").parse();
> > cp = jClass.getConstantPool();
> > cpg = new ConstantPoolGen(cp);
> > String className = jClass.getClassName();
> > Method methods[] = jClass.getMethods();
> > Field fields[] = jClass.getFields();
> > for (int i = 0; i < fields.length; i++) {
> > System.out.println(fields[i].getName());
> > System.out.println(fields[i].getConstantValue);
> > }
> > for (int j = 0; j < methods.length; j++) {
> > MethodGen mg = new MethodGen(methods[j],
> className,
> > cpg);
> > LocalVariableGen vGen[] = mg.getLocalVariables();
> > for (int k = 0; k < vGen.length; k++) {
> > System.out.println(vGen[k].getName());
> > }
> > }
> > }
> >
> > I hope now, u'll get the idea on how to do
> things..
> >
> > Regards.
> > Yasir Siraj.
> > IMP-DCS
> > Chalmers University Of Technology
> > Goteborg, Sweden.
> >
> >
> > =====
> >
> > Regards.
> >
> > Yasir Siraj.
> >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > New and Improved Yahoo! Mail - 100MB free storage!
> > http://promotions.yahoo.com/new_mail
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> michaelchan@example.org
> > For additional commands, e-mail:
> michaelchan@example.org
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> michaelchan@example.org
> For additional commands, e-mail:
> michaelchan@example.org
> 
> 


=====

Regards.

Yasir Siraj. 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: michaelchan@example.org
For additional commands, e-mail: michaelchan@example.org



{'source': 'Apache Software Foundation Public Mail Archives'}