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/8161985/T8161985a.java
Normal file
28
test/langtools/tools/javac/8161985/T8161985a.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8161985
|
||||
* @summary Spurious override of Object.getClass leads to NPE
|
||||
* @compile/fail/ref=T8161985a.out -XDrawDiagnostics T8161985a.java
|
||||
*/
|
||||
|
||||
class T8161985 {
|
||||
public static void meth() {
|
||||
T8161985 t = new T8161985();
|
||||
t.getClass();
|
||||
|
||||
}
|
||||
public void getClass() {
|
||||
Fred1 f = new Fred1();
|
||||
System.out.println( "fred classname: " + f.getClassName());
|
||||
}
|
||||
|
||||
|
||||
abstract class Fred {
|
||||
public String getClassName() {
|
||||
return this.getClass().getSimpleName();
|
||||
}
|
||||
}
|
||||
|
||||
class Fred1 extends Fred {
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue