All Questions
30
questions
0
votes
1
answer
46
views
Why does an anonymous inner class have such type when I disassemble the class file using javac?
When I disassembled the code given below, I noticed that the TestClass's anonymous inner class in constant pool is displayed as 'AnonymousTestApp$1', but shouldn't it be 'TestClass$1'?
The code:
...
1
vote
0
answers
151
views
How to syntax highlight a hex dump of JVM classfile?
I'm studying binary file structure of JVM classfile.
My current toolbox consists of $ xxd <classfile> and $ javap -v <classfile>.
Sample outputs of these two tools are as follows:
$ xxd ...
1
vote
2
answers
294
views
java internal method signature doesn't match constructor parameters (javap)
I have the following class containing local inner class:
class Outer {
private boolean beep;
private int foo;
public Outer(boolean beep) {
this.beep = beep;
}
public void ...
4
votes
1
answer
214
views
Problem marking the lines in the java compiler
I am a master's student and I am researching static analysis.
In one of my tests I came across a problem in marking lines in the java compiler.
I have the following java code:
226: String json = &...
0
votes
0
answers
203
views
javap -c does not give me bytecode of methods
I have a java file looking like this:
package answers;
class finalRed{
private long l;
public synchronized void increment(){
l++;
}
public void decrement(){
...
0
votes
0
answers
496
views
java.lang.verify error : Inconsistent stack height 1 != 2
I have a custom application in which we have generated the Java Instruction code.We are generating the code using javacc. In one of the Scenarios, we are getting java.lang.verify error : Inconsistent ...
3
votes
0
answers
745
views
Open .class file with Java Decompiler - incoherent errors
I am an Ubuntu user, I have a lot of .class files in which ground truth information about a dataset I'm using is stored.
I want to access this information (not modify it) and export it to .csv files ...
2
votes
1
answer
341
views
Stack=4 in Java bytecode. How does the Java Compiler compute the 4 value? (depth of the the stack)
Java Code:
public class SimpleRecursion {
public int factorial(int n) {
if (n == 0) {
return 1;
}
return n * factorial(n - 1);
}
}
Gives the following ...
1
vote
0
answers
56
views
What does stack=1 (or any integer value) mean in Java bytecode [duplicate]
I've been trying to understand how the bytecode of the following Java code works. I couldn't find the explanation of what the stack=1 and the stack=4 part mean.
Java Code:
public class ...
2
votes
1
answer
83
views
Why bytecode sequence number are not continuous
static void heapVar();
Code:
0: iconst_3
1: newarray int
3: dup
4: iconst_0
5: bipush 100
7: iastore
8: dup
9: iconst_1
10: sipush 200
13: iastore
14: ...
-1
votes
1
answer
47
views
Java byte code classes interpretation
I understand the basic Java bytecode instructions and how fields are referred from the constant pool.
But I cannot make my mind around the differences between these 2 lines:
java/lang/StringBuilder....
3
votes
0
answers
470
views
View javap -c output within IntelliJ
I'd like to view Java bytecode the way the command javap -c outputs it, not like the "View Bytecode Plugin". Is there a way to accomplish this?
Example: This method
public void increment() {
c++;...
0
votes
1
answer
215
views
Is it possible to estimate performance or cyclomatic complexity from decompiled code?
Let's say I have two alternative implementations of an algorithm, or two strategies. I could of course benchmark them with e.g. jmh. But is there any information I could get by looking at the ...
1
vote
0
answers
1k
views
how to map bytecode line number to sourcecode line number
I'm creating a program to find null pointer dereference in java. The methodology used is to first extract java byte code using javap command and then extract control flow graph(CFG) information from ...
0
votes
1
answer
580
views
Bad local StackMapTable
I've generated a simple getter method with ASM in an already existent class.
mv = cn.visitMethod(access, // public method
"get_" + f.name, // name
...