Finding a variable name using BCEL

Let's say I have a simple class with the main method.
The first line in the main method looks like this:
boolean x = false;
How would I find the NAME of that boolean ("x") using BCEL?
Thank you very much in advance. I tried searching the internet, but there is very little documentation on BCEL.

Well, first you need to read the VM spec to learn that local variables are stored as an attribute of a method: http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#5956
Then look at the BCEL class diagram, and note that JavaClass contains Methods, which contain Attributes, which may be a LocalVariableTable: http://jakarta.apache.org/bcel/images/javaclass.gif
Then, it's time to go to the BCEL JavaDoc (which I agree, is difficult to find -- I didn't see a link to it, but I do know the structure of Apache projects): http://jakarta.apache.org/bcel/apidocs/
At which point you'll see that the Method object has a method to retrieve the local variable table: http://jakarta.apache.org/bcel/apidocs/org/apache/bcel/classfile/Method.html#getLocalVariableTable()
And, if you work your way through that, you'll see that (like everything else in the .class file), each local variable is a reference into the constant pool.
Of course, to see local variables at all, you'll have to compile your original class with -g

Similar Messages

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • How to find out query name using Elements of the query builder.

    Hi SDNers,
    how to find out query name using Elements of the query .
    thanks,
    satyaa

    Hi,
    For having a look at the relation between BEx tables,check the link below:
    http://wiki.sdn.sap.com/wiki/display/BI/ExploretherelationbetweenBEx+Tables
    -Vikram

  • How to find Logical database name using selection view

    Hi Experts,
                      How can we find logical database name using selection view in se36.
    Regards,
    Mani

    Hi,
    If you want to see the logincal database used in the report ( tcode se38) in the intial screen select the attribute tab
    and click display you will bw able to see the logical datbase ysed for the report.
    Thanks.

  • How to find the query name using infoset name

    Hi Experts
           Iam new to the sap queries(SQ01,SQ02), some queries already created.
          now i want to do some modification, my problem is i am not able to find the query name.
          I know the infoset name, can you tell me how to find the query name using the infoset name, is ther any table for this.
    i tried in sq01 also, but its confusion, pls advice me on this.
    thanks in advance.
    regards
    rajaram

    Hi
    try like this..
    SQ02 --> go to --> Query Directory..
    from there you can get all the queries belong to a Infoset.

  • Error: Cannot find symbol: Variable Name

    Hi Guys,
    I'm having some trouble with a piece of code. The error that I'm getting is:
    program.java:17: cannot find symbol
    symbol : variable name
    location: class program
    name.CTI(names[0].charAt(0));
    ^
    My Code is shown here:
    import java.io.*;
    import java.lang.*;
    class program{
         public static void main(String[] args){
              String names [] = {"brian", "stu", "mouse"};
              program name = new program ();
              name.sortArrayStr(names);
              //name.CTI(names[0].charAt(0));
         public void sortArrayStr( String[] names ){
              name.CTI(names[0].charAt(0));
         public int CTI ( char letter ){
              char c = letter;
            int k = (int) c;
            System.out.println("ASCII  = "  + k + ".");
              return k;
    }What I'm trying to do is get the name.CTI method caled from within sortArrayStr. When i call name.CTI from main it works fine, (commented part) but when i try from sortArrayStr I get this problem.
    Anyone have any ideas?
    Many Thanks

    Variable name is a local variable defined in method main, so it can not be referenced by writing name in another method like sortArrayStr.
    The good news is, if you want to call CTI from sortArrayStr, just do it:
    public void sortArrayStr( String[] names ){
        CTI(names[0].charAt(0));
    }

  • What's user variable name using Smart View POV function (ex:HypGetActiveMember)?

    Hi,
    We want to use Smart View POV function (ex:HypGetActiveMember) to get the active member of user variables from HFM forms selected into Excel, but we don't know the user variable name in the following paragraph of Smart View developer guide:
    "To uniquely identify the user variable, provide the user variable name rather than the dimension name."
    For example, what's the user variable name of Year dimension? How to get the user variable name?
    Any information would be appreciated. Thank you!

    Hi,
    I guess user variable name is set by users/developers. I am not very clear on your question. If you have defined some variables to select any members from a dimension then it will be in HFM only. In planning we have two kinds of variables User Variables (we set it from Planning Preferences) and Substitution variable (we set it from Essbase Consol in the backend). Without looking into your application it is difficult to say the user variable name. Like for Year the user variables can be "PreviousYear", "CurrentYear", or "NextYear" etc.
    Soumya

  • Accessing variable names using String

    I have to check up to 13 JCheckBox variables to see if they are checked or not, and I have the variables named: count1, count2, count3,...,count13. I wanted to know if there was a way to go through them in a while loop until I found the last one that was checked. I want to do the following:
    int i = 1;
    while([count+i].isSelected()) {
    i++;
    int foodCount = i;
    //foodCount is stored in database
    I am doing this for a pet store and I don't want to have 12 extra columns in the database - I just want to have one for the overall food count. Any ideas how I can dynamically create a variable name?

    Put the JCheckBoxes in an arrayJCheckBox[] myCheckBoxes = {check1, check2, check3,...,check13};
    JCheckBox someCheckBox = null;
    for (int x=0; x<myCheckBoxes.length; x++) {
      if (myCheckBoxes[x].isSelected()) someCheckBox = myCheckBox[x];
    }

  • How to find the package  name  using  request number

    I want to check the   package name  using the request  no   ,
    Plz help me

    Hi
    You can use SE03  for the same. In that
    Object Directory Node --> Change Object Directory Entries of Objects in a Request.
    Dbclick on that and provide chield request and press F8 you will get the object with the package.
    Hope this will Help.
    Regards,
    Hiren Patel

  • Creating variable names using a counter

    Hi all
    I have a snippet of code that I am trying to work in Flash 6,
    it is attached to this post. Inside the for loop I am trying to
    define the class variable instance names dynamically using the 'i'
    counter encapsulated within the eval function. Is there anyway I
    can add dynamically named variables or am I just kidding myself.
    regards
    John Walsh
    www.javono.com

    I think KGlad meant to post the following, probably
    accidentally did italics in bbcode
    import ButtonClass;
    var a:Array= new Array("alonso_btn", "gerrard_btn");
    for (var i = 0; i < a.length; i++) {
    this[a[ i ] = new ButtonClass();
    }

  • Finding a Script Name used in System Program

    Hello Friends,
    Is there any way by which we can find the name of SAP Script used in any
    perticular System program.
    If yes please tell me,
    Thanks in advance..... ...

    Hi,
    You can check via transaction NACE or check table TNAPR.
    Regards,
    Ferry Lianto

  • To find the table name using field name

    Hi,
    Do we have any transaction code using field name to find out the table name
    Regards,
    P.Arunkumar.

    Hi Arun,
    The best way to find out table from field is,
    Use SE15 Transaction->dictionary fields ->table fields->goto table field columns
    Enter ur fields..
    or you can use ST05
    Reward points if it is useful
    Regards,
    R.Brahmankar

  • Request.getRemoteUser()  to find out login name using NtlmFilter

    can we implement request.getRemoteUser() without using NtlmHttpFilter.
    Actually, i do not want to uise the filter because i am already using a filter.
    So can we make any declaration of the Ntlm class and use it such that we can easily access the login name without using the Ntlm Filter in the DD(web.xml)?
    A timely response will be highly appreciated.

    Hi,
    For having a look at the relation between BEx tables,check the link below:
    http://wiki.sdn.sap.com/wiki/display/BI/ExploretherelationbetweenBEx+Tables
    -Vikram

  • Find current host name using Java

    I am running currently on Oracle 9i app server in a clustered environment. My application has business logic that needs current host name. How can I find out the host name without externalising(like properties file) the information. Is there a java api like
    .getHostName()
    Rama

    try this:
    import java.net.InetAddress;
    public class Foo {
        public static String getLocalhostName() {
            String hostName = "";
         try {
             InetAddress address =
              InetAddress.getLocalHost();
                hostName = address.getHostName();
            } catch (Exception e) {
                // error handle any which way you like
                e.printStackTrace (System.err);
            return hostName;
    }cheers,
    Georg.

  • Where can I find the file name used by a External Table

    I need to run a SQL to retrive the file name that a External Table points to.

    take a look at dba_external_locations

Maybe you are looking for

  • Error message - "This computer is no longer authorized for apps installed on iphone"

    I started getting this message a couple of weeks ago.  I get it everytime i start itunes and try to sync with my iphone.  The computer is authorized.  After I resubmit my password, itunes tells me that the computer is already authorized and to contin

  • Icon "sticks" to cursor in finder

    When trying to drag an application icon off the dock the icon "sticks" to the cursor.  Also, in finder windows the same phenomenon occurs when I attempt to move an icon to a new location. Attempted solutions: restart with PRAM clear, reinstall OS X,

  • Rebate Agreement Create/Change by BAPI_AGREEMENTS, BAPI_PRICES_CONDITIONS

    I have to create/change Rebate agreement by the transaction code VBO1 and VBO2. I found two function modules(not RFC) BAPI_AGREEMENTS and BAPI_PRICES_CONDITIONS. However I found these function modules are not SAP Released yet (in ECC 6.0). Is it okay

  • Please explain on this interface

    can anyone help me on this Interface points that I have put in my resume to make a impressive resume...but it is not clear for me... Interfaces· . Sales order interface: Developed the inbound interface to create sales orders using BAPI_SALESORDER_CRE

  • Why can't I import video

    My video file is .avi I can play it with quick time but when dragging it into itunes, it came flied back to where it was.