Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.2k
Commit0309e91
committed
Fixes unchecked warnings when calling Mockito.mock(Class)
This is an issue well known by the Mockito community, but prone to notbefixed:mockito/mockito#1531Generics allow to ensure type-safety at compile time instead of runtime.However, here it is used mainly to auto-cast the created object, thusavoiding this burden on the developer. Indeed, it is in a context wheretype safety is usually not a requirement, since the use of this methodis often the most trivial we can have: provide a class and expect a veryinstance of this class in return.This commit thus creates a less constrained mock method which builds onMockito's one, but without the constraint inducing this warning.1 parent73d9c4f commit0309e91
File tree
2 files changed
+12
-2
lines changed- javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor
2 files changed
+12
-2
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
2550 | 2549 | | |
2551 | 2550 | | |
2552 | 2551 | | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2553 | 2558 | | |
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
2549 | 2548 | | |
2550 | 2549 | | |
2551 | 2550 | | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
2552 | 2557 | | |
0 commit comments
Comments
(0)