FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/java/ql/test/query-tests/Nullness/F.java at codeql-cli/v2.27.1 · github/codeql · GitHub
github
codeql
Repository navigation
Code
Issues
1k
(1k)
Pull requests
473
(473)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
java
/
ql
/
test
/
query-tests
/
Nullness
/
F.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (28 loc) · 874 Bytes
Breadcrumbs
codeql
/
java
/
ql
/
test
/
query-tests
/
Nullness
/
F.java
Copy path
File metadata and controls
34 lines (28 loc) · 874 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
public
class
F
{
public
void
m1
(
Object
obj
) {
if
(
obj
==
null
)
throwMyException
();
obj
.
hashCode
();
// OK
}
public
void
m2
(
Object
obj
) {
if
(
obj
==
null
)
doStuff
();
obj
.
hashCode
();
// $ Alert[java/dereferenced-value-may-be-null] // NPE
}
public
void
m3
(
Object
obj
) {
if
(
obj
==
null
)
doStuffOrThrow
(
0
);
obj
.
hashCode
();
// $ Alert[java/dereferenced-value-may-be-null] // NPE
}
public
static
class
MyException
extends
RuntimeException
{
}
public
void
throwMyException
() {
// meant to always throw
throw
new
MyException
();
}
public
void
doStuff
() {
// meant to be overridden as indicated by UnsupportedOperationException
throw
new
UnsupportedOperationException
();
}
public
void
doStuffOrThrow
(
int
i
) {
// meant to be overridden as indicated by unused parameter
throw
new
MyException
();
}
}
Back
|
FazBrowse Home
|
New Git URL