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
34
test/langtools/tools/javac/lambda/UnderscoreAsIdent.java
Normal file
34
test/langtools/tools/javac/lambda/UnderscoreAsIdent.java
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @summary Check usages of underscore as identifier generate warnings
|
||||
* @compile/fail/ref=UnderscoreAsIdent8.out --release 8 -XDrawDiagnostics -Xlint:-options -Werror UnderscoreAsIdent.java
|
||||
* @compile/fail/ref=UnderscoreAsIdent9.out --release 9 -XDrawDiagnostics -Werror UnderscoreAsIdent.java
|
||||
* @compile/fail/ref=UnderscoreAsIdent22.out -XDrawDiagnostics UnderscoreAsIdent.java
|
||||
*/
|
||||
package _._;
|
||||
|
||||
import _._;
|
||||
|
||||
class _ {
|
||||
String _ = null;
|
||||
void _(String _) { }
|
||||
void testLocal() {
|
||||
String _ = null;
|
||||
}
|
||||
void testFor() {
|
||||
for (int _ = 0; _ < 10; _++);
|
||||
}
|
||||
void testTry() {
|
||||
try { } catch (Throwable _) { }
|
||||
}
|
||||
void testLabel() {
|
||||
_:
|
||||
for (;;) {
|
||||
break _;
|
||||
}
|
||||
_:
|
||||
for (;;) {
|
||||
continue _;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue