I still believe it is related to the used decompiler.
It can be assumed that the signature of the method is DatabaseError.throwSqlException(int i)
.
The statement DatabaseError.throwSqlException((int)23)
would be compiled as DatabaseError.throwSqlException(23)
- the literal is of type int
and the method parameter type is of type int
the DatabaseError.throwSqlException((int)23L)
would be compiled as DatabaseError.throwSqlException(23)
- the value can be stored without precision lose in an int
and the method parameter type is of type int
The byte code is in both cases
bipush 23 // push the value on the operand stack
invokestatic // DatabaseError.throwSqlException:(I)V
Decompiled it would be DatabaseError.throwSqlException(23)
. Because in case it was 23L
in the source code, this information isn't in the bytecode.
A bytecode similar to DatabaseError.throwSqlException((int)23)
could be
ldc2_w // push a long from constant pool on the operand stack
l2i // convert top value on the operand stack from long to int
invokestatic // DatabaseError.throwSqlException:(I)V
But this is decompiled by jad
and jd-gui
to DatabaseError.throwSqlException((int)23L)
(notice the L
after the value).
edit The above bytecode is decompiled by CFR
as DatabaseError.throwSqlException((int)23)
. So it really depend on the used decompiler.