Re: trouble with LDC

Simon IJskes <[email protected]> Sun, 8 Oct 2017 19:41:25 +0200
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
On 08-10-17 19:18, Roberto Andrioli wrote:
> Simon, you are sure that is not using a final field?

indeed. my example was not complete. i'm sorry.

public class A
{
     public void method()
     {
         String res = System.getProperty(C.s);
         System.out.println( res );
     }
}

public class C
{
     public static final String s = "abc" ;
}


   public void method();
     descriptor: ()V
     flags: ACC_PUBLIC
     Code:
       stack=2, locals=2, args_size=1
          0: ldc           #3                  // String abc
          2: invokestatic  #4                  // Method 
java/lang/System.getProperty:(Ljava/lang/String;)Ljava/lang/String;
          5: astore_1

Constant pool:
    #2 = Class              #22            // a/C
    #3 = String             #23            // abc

from what i can see, the javac is consistent in producing a class 
constant, which is never elsewhere in the classfile.

So a verifier can just use the constant pool to verify if all classes 
are available. if it can access it.

G. Simon


-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws