If the following two files are compiled, javap -c -l reveals
that one of the instructions for xxx.java has been assigned a
line number from yyy.java.
This has two effects:
- debuggers have to ignore line numbers on such instructions
- the output of javac depends in an unpredictable way on
the compilation process (see bug #1256390), because
the bogus line numbers only appear if the compiler has
chosen to recompile the file containing the inlined constant.
(As it happens, constants extracted from the binary file do not have
source locations.)
==> xxx.java <==
class xxx {
static int f() {
return yyy.EOF; // line 3
}
}
==> yyy.java <==
class yyy {
static
final
int
EOF = -1; // line 5
}
Method int f()
0 iconst_m1
1 ireturn
Line numbers for method int f()
line 5: 0
line 3: 1
that one of the instructions for xxx.java has been assigned a
line number from yyy.java.
This has two effects:
- debuggers have to ignore line numbers on such instructions
- the output of javac depends in an unpredictable way on
the compilation process (see bug #1256390), because
the bogus line numbers only appear if the compiler has
chosen to recompile the file containing the inlined constant.
(As it happens, constants extracted from the binary file do not have
source locations.)
==> xxx.java <==
class xxx {
static int f() {
return yyy.EOF; // line 3
}
}
==> yyy.java <==
class yyy {
static
final
int
EOF = -1; // line 5
}
Method int f()
0 iconst_m1
1 ireturn
Line numbers for method int f()
line 5: 0
line 3: 1