Questions tagged [bcel]

Apache Byte Code Engineering Library, an open-source library for inspecting and manipulating Java byte code files (.class files)

For details see: http://jakarta.apache.org/bcel/

123 questions
0
votes
0 answers

BCEL - debugging return statements

I want to modify existing *.class file. When method is finished and returns its value I want to display debug message "Got result: %return value%". How can I achieve this using BCEL?
radzio
  • 2,862
  • 4
  • 26
  • 35
0
votes
0 answers

Is EventKind available in BCEL or Javassist library?

I would like to abstract this open-source project to use library such as BCEL and Javassist, but I am not can those 2 libraries work together or I must decide just 1 dynamic code analysis library(BCEL, Javassist, ASM, cgLib) to be implemented as…
0
votes
1 answer

get Javassist MethodInfo from Apache BCEL JavaClass

I recently wanted to make this github projectWhyline to use library instead of writing own code. This project has a javaagent and I am stucked in the whyline/tracing/ClassInstrumener.java class. So I found out that Apache BCEL and Javassist has…
0
votes
0 answers

How to prove this concurrency issue by unit test?

I know there is a concurrency issue here in org.apache.bcel.util.SyntheticRepository and eventhough I know I happen to get ConcurrentModificationException, I cannot reproduce it by unit test. public class SyntheticRepository extends…
Sybuser
  • 735
  • 10
  • 27
0
votes
0 answers

How do I fix this crash in Eclipse when launching any test as a coverage configuration?

Here is the unit test causing crashes on all others unit tests when launched as coverage configuration : public class JiraBcel362TestCase extends AbstractTestCase { @Test public void testProcessConstantPoolWithCondyEntry() throws…
Sybuser
  • 735
  • 10
  • 27
0
votes
0 answers

How do I create a class with bcel and bcel-util which passes the verifier?

I have a simple class that I'm trying to re-create programatically with BCEL library. public class HelloWorld { public static void main(String[] args) { switch (args[0]) { case "Hello": System.out.println("Hello…
Sybuser
  • 735
  • 10
  • 27
0
votes
0 answers

Is there a replacement for deprecated options -Xverify:none and -noverify that were deprecated in JDK 13?

The project I'm working on creates .class files that are not exactly the same as what produces JDK compiler. In particular, there's a part of the project that allows to programmatically create a .class file, and for testing, I take as input a…
Sybuser
  • 735
  • 10
  • 27
0
votes
1 answer

How to specify ClassParser constructor parameter?

I'm trying to use ClassParser to get method parameter names, ClassParser constructor takes class name as parameter for example: ClassParser parser = new ClassParser("Main.class"); I 'm trying to set the parameter to String class I 've tried to use…
Feras Odeh
  • 9,136
  • 20
  • 77
  • 121
0
votes
1 answer

How to extract relations between classes using java files instead of class files?

I'm trying to modify the code below to make it work on java files instead of class files. But I have no idea what are some possible ways to do that. So basically I have to get rid of BCEL ClassParser and extract relations directly from Java files?…
0
votes
1 answer

Error trying to calculate CKJM in Java classes

I am trying to calculate the Chidamber and Kemerer object-oriented metrics in java with ckjm 1.9 but I encounter this error for some of the classes. java -jar freecol/ckjm-1.9/build/ckjm-1.9.jar…
Adjuzi
  • 1
  • 3
0
votes
3 answers

Could I add the comments to my java class with the BCEL?

1.Could I add the comments to my existing java class with the BCEL? 2.Could I add the comments to my newly manually generated java class with the BCEL?
MaSEL
  • 505
  • 1
  • 5
  • 20
0
votes
0 answers

BCEL bytecode, how to get method source line?

I want to get the number of line where a method is in a class. I was doing this getting the first LineNumber of the method, and getting the src_line from that. But, it doesn't work because comments and initializations doesn't have LineNumber…
0
votes
1 answer

java trace of all runtime variable access

I need to log all run-time access to any variable or object My current direction is to markup the classfile with modified bytecode Performance is not currently an issue BCEL looks nice to add some trace instructions to each relevant opcode in the…
Y A
  • 1
  • 1
0
votes
1 answer

Get annotation name using Apache Bcel

I'm using this code to get Java Class annotation: JavaClass jclas = new ClassParser("src\\test\\org\\poc\\TestClass.class").parse(); ClassGen cg = new ClassGen(jclas); AnnotationEntryGen[] attributes = cg.getAnnotationEntries(); for…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
0
votes
1 answer

Read annotations using Apache Bcel library

I'm trying to read class annotations using this code: JavaClass jclas = new ClassParser("src\\test\\org\\poc\\TargetHello.class").parse(); ClassGen cg = new ClassGen(jclas); Attribute[] attributes = cg.getAttributes(); for…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
1 2 3
8 9