undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
28
test/langtools/tools/javac/assert/Position.java
Normal file
28
test/langtools/tools/javac/assert/Position.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4469737
|
||||
* @summary Verify the source position for assertions.
|
||||
* @author gafter
|
||||
*/
|
||||
|
||||
|
||||
public class Position {
|
||||
static public void main(String[] args) {
|
||||
Position.class.getClassLoader().setClassAssertionStatus("U", true);
|
||||
new U().main();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class U {
|
||||
void main() {
|
||||
try {
|
||||
assert false; // line 20
|
||||
} catch (Throwable t) {
|
||||
if (t.getStackTrace()[0].getLineNumber() == 20) {
|
||||
return; // passed
|
||||
}
|
||||
}
|
||||
throw new Error("failed 4469737");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue