Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

#Java - Code Snippets for '#Org.apache.bcel.generic.ConstantPoolGen' - 1 code snippet(s) found

 Sample 1. Code Sample / Example / Snippet of org.apache.bcel.generic.ConstantPoolGen

    public void testCreateIntegerElementValue() throws Exception


final ClassGen cg = createClassGen("HelloWorld");

final ConstantPoolGen cp = cg.getConstantPool();

final SimpleElementValueGen evg = new SimpleElementValueGen(

ElementValueGen.PRIMITIVE_INT, cp, 555);

assertTrue("Should have the same index in the constantpool but "

+ evg.getIndex() + "!=" + cp.lookupInteger(555),

evg.getIndex() == cp.lookupInteger(555));

checkSerialize(evg, cp);


   Like      Feedback      org.apache.bcel.generic.ConstantPoolGen

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner