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
1
vote
4 answers

FindBugs not accepting bcel.jar in ANT script

I installed findbugs into my ant lib directory and added the following code into my main ANT script:
user64133
  • 1,149
  • 3
  • 9
  • 10
1
vote
1 answer

Invoking Method using BCEL

is there any expert in this community who have worked with BCEL and can guide me about invocation of method using BCEL just like we use to do with java reflection. Note:to support your answer any sort of book or web reference will become a great…
zaree
  • 641
  • 2
  • 6
  • 15
1
vote
0 answers

how to get package name from a class file?

I want to get package name from a .class file, but after trying to use org.apache.bcel, I am not satisfied with it because there are always some classes which can not be parsed. the rate is about 20 over 500. So, is there any other library which can…
ruiruige1991
  • 615
  • 1
  • 10
  • 21
1
vote
0 answers

Java BCEL getfield instruction

Goal I have a class A with a method called getStr. I want to replicate the code inside the method using a Instructionlist in BCEL. public class A { private String str; private String getStr() { return this.str; } } Problem I…
Filip
  • 41
  • 1
  • 6
1
vote
2 answers

Java: adding debug call to every method with BCEL

I'm working with BCEL trying to add System.out.println() invoke to every method's first line (except init and clinit methods), to see what methods are called and when This is my code atm (with some pseudo): Instruction ins = null; f (first…
johnh
  • 21
  • 4
1
vote
1 answer

How to create class with final static fields in any byte code library?

I'm trying to create a simple class that contains static final object fields, using any byte code library. I have tried BCEL and Byte Buddy but had no success. The class I want to construct looks like this. Thanks. public class ConstructedClass{ …
gondor89
  • 53
  • 5
1
vote
3 answers

Is there a Java byte code reader implemented in javascript?

I know there are lots of libraries that read byte codes that are written in Java. Does someone know of a byte code library that is implemented in Javascript?
vkraemer
  • 9,864
  • 2
  • 30
  • 44
1
vote
1 answer

Determining the LCOM4 (Lack of Cohesion in Methods) by parsing the Java Bytecode using BCEL

I have built a program, which takes in a provided ".class" file and parses it using the BCEL, but I'm a bit lost when it comes to using the resulting object to determine the LCOM4 value. I've scoured the whole web, trying to find a proper tutorial…
1
vote
1 answer

Getting weird errors on stack manipulation

As part of some simulations that I am running using a tool called JIST/SWANS I am getting some weird errors. This simulator has been written for Java 1.4 and I am attempting to port it to 1.5. What I am trying to do is to compile the original code…
Legend
  • 113,822
  • 119
  • 272
  • 400
1
vote
1 answer

finbugs Error constructing methodGen

I have very strange issue with findbugs: Error constructing methodGen org.apache.bcel.classfile.ClassFormatException: Invalid method signature: !+Lsome/packag/and/SomeClass org.apache.bcel.classfile.Utility.typeOfSignature(Utility.java:1012) …
Roman Makhlin
  • 973
  • 1
  • 11
  • 27
1
vote
1 answer

Identify Local variable data types in Apache Byte Code engineering library (bcel)

I'm using Apache bcel library to read java class files. It allows to identify the local variable names for a given method from the org.apache.bcel.classfile.Method.getLineNumberTable() call. But the details does not include the data type related…
Sameera Manorathna
  • 558
  • 12
  • 26
1
vote
1 answer

Generate a code from a java class that uses another java class (BCEL)

I am trying to generate(and modify) the code of an output class from another class using the ByteCode Engineering Library (by Apache) . String class_name = c_gen.getClassName(); Method[] Methods = c_gen.getMethods(); for (int…
Oussama Achech
  • 131
  • 1
  • 11
1
vote
0 answers

Java/BCEL Inconsistent stack height

I am working on my assignment in which I'm supposed to modify a class file using BCEL to print certain information when a getfield operation is called. That includes printing a String if the value of referenced field is greater than 30. The issue…
swistaq
  • 11
  • 2
1
vote
1 answer

error "java.lang.VerifyError: StackMapTable error: bad offset" using BCEL

I m doing java instrumentation with BCEL. my java agent i m testing against some Java webapp, which is running on tomcat8.0 server. If i don't do instrumentation on every class loads in JVM (or don't do instrumentation on package starting with java,…
rahulk
  • 175
  • 3
  • 15
1
vote
2 answers

Parse Jar file and find relationships between classes?

How to detect whether the class from the jar file is extending other class or if there are method calls to other class objects or other class objects are created ? and then system out which class extend which class and which class called methods…
YDev
  • 61
  • 1
  • 9
1 2 3
8 9