implied constant promotion aborts compilation
Brought to you by:
mecki
public class O
{
public void m() { long l = 5; }
}
Compiling this class with Janino 2.1.0 using Sun's
1.4.2_06-b03 JVM under Windows results in the
compilation being aborted with this error message:
java.lang.RuntimeException: O.m(): Operand stack
underrun at offset 1
Putting "5L" at the right-hand side of the equals sign
compiles. Looks like Janino doesn't promote the
constant "5" from its default type (int) to the needed
type (long), or something.
Logged In: YES
user_id=865893
The assignment conversion was missing for local variable
initializers. No problem for byte/short/char/int, but if the
variable or the initialzer have type long/float/double, then
you get JVM errors.
Not good programming style to write "double x = 0", eh? ;-)
Added assignment conversion. Will be fixed in the next
(post-2.1.0) release; not scheduled yet.
Logged In: NO
Others have also seen this:
http://jira.codehaus.org/browse/DROOLS-252
(on double-typed variables)
Logged In: NO
> Will be fixed in the next (post-2.1.0) release; not
scheduled yet.
Could you attach a patch here in the meantime? Thanks.
Logged In: NO
> Will be fixed in the next (post-2.1.0) release; not
scheduled yet.
Could you attach a patch here in the meantime? Thanks.
Logged In: YES
user_id=865893
No problem, here's your patch.