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
1 answer

BCEL - Get Class name,element names ,and method names

how to using bcel classparaser to get class names ,element names and method names ? ive already find a way to get class names but element and method names give me something wrong . Anyone can help me with that ? here is my code (with some errors…
YDev
  • 61
  • 1
  • 9
1
vote
1 answer

Static initializers in bcel

In BCEL, I would like to initialize static fields in the static initializer of a class. I haven't found a way to do so however... any hints? I need something like: // Field descriptor #8 [I private static int[] a; static {}; 0 bipush 10 …
Toon Verwaest
1
vote
1 answer

how to add if instruction before an if instruction by bcel

I want to use BCEL to add/insert some if_instruction before a specific if_instruction which is in my method. Here is my method: public void printMax(int x , int y){ int max=x; //////here is my desire position////////// if(y>x) max=y; …
sh kashani
  • 44
  • 3
1
vote
0 answers

symbol not found: static method in abstract class (BCEL)

I'm a bit stuck on this. I can't compile because java claims not to find the method setRepository(), which is defined for the abstract class Repository in the follow code: public abstract class Repository { private static…
bcr
  • 1,328
  • 11
  • 27
1
vote
2 answers

Is it possible to obtain java.lang.reflection.Method directly from java class file's Constant_Method_REF?

I am using BCEL to transform method byte code to achieve method interceptor with anonymous inner class style, while intercepting the method, I need to process some annotations on the intercepted method. I use BCEL to intercept method access other…
Barry Zhong
  • 470
  • 3
  • 17
1
vote
2 answers

Where can I find BCEL 6.0 and how can I modify it adding a patch?

I used for my project BCEL-5.2 and after few months I realized that it doesn't contain the class for the local variable type table. I saw that is present in BCEL-6.0 and I found also a patch to apply at it. Where can I find the source code of this…
1
vote
0 answers

Moving an inner class to another outer class using bcel

I want to move an inner class from an outer class to another outer class. Is it possible to do it using bcel? For e.g: class Outer1{ --- class Inner{ ---- } } will be converted to: class Outer2{ --- class Inner{ …
soham
  • 35
  • 6
1
vote
1 answer

Figure out method name from line number in Java?

Given a line number, the code file, as well as the compiled class file if necessary, what is the most elegant way to get the signature of the surrounding method (if the line number is even in a method)? Things to keep in mind: the line might not…
Epaga
  • 38,231
  • 58
  • 157
  • 245
1
vote
1 answer

Java BCEL Injection/replacement gone wrong

Background: I'm injecting the Minecraft Launcher to obtain the applet (which I've done), but now I wish to load minecraft's file through my class loader. I found the method which GameUpdater.java (Minecraft's gameupdater, also dispatcher for the…
Fellixombc
  • 123
  • 2
  • 10
1
vote
2 answers

Java find out what imports a .class has

Is there a way to find out what imports a class has? In this question: Jon Skeet says that you can't do this using reflection, but If you want to find all the types used within the compiled code, that's a slightly different matter. You may want…
LanguagesNamedAfterCofee
  • 5,782
  • 7
  • 45
  • 72
1
vote
1 answer

How to determine the Method invoked by an InvokeInstruction (BCEL)?

I am trying to determine the MethodGen of the callee for a given InvokeInstruction in the BCEL library. The problem is that I don't know how to use the InvokeInstruction to get to the MethodGen that it is trying to invoke. If I have a BCEL MethodGen…
jbranchaud
  • 5,909
  • 9
  • 45
  • 70
1
vote
0 answers

Monkey patching a library until the OSS project releases a patch

I am using a well established piece of open source library in my code, I have discovered a bug in it and have reported it to the community. However I am not really qualified to fix the bug as I would not know all the side effects of changing the…
nwaltham
  • 2,067
  • 1
  • 22
  • 40
0
votes
2 answers

taglib call to managedbean call

i have an managed bean(session scope) like this: class Home {// as homeBean public void doSomething(ActionEvent ae, int a, int b){ System.out.println("result="+(a+b)); } } i like to call this
Grim
  • 1,938
  • 10
  • 56
  • 123
0
votes
1 answer

String (from bytecodes) from Java BCEL differs from Javap and other tools

I use BCEL library to extract bytecode from a particular Method. To do that, I use getCode() function from BCEL Method class. When I do: String code = metod.getCode().toString(); System.out.print(code); If you look at lcd opcode, I get this: but,…
Pier-Alexandre Bouchard
  • 5,135
  • 5
  • 37
  • 72
0
votes
1 answer

Java delegating call BCEL/ASM

Hello dear members of SOF! What I am looking for? I've been searching and searching around web how can I implement/inject interface on class(that has been compiled of course) and add the required methods by the interfaces on the class. I've also…
Ruuhkis
  • 1,924
  • 1
  • 27
  • 46
1 2 3
8 9