Debian Codegraph @

samples/DereferenceTypeVariable.java

raw
1 /*
2 * Copyright 2020 The JSpecify Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 import org.jspecify.annotations.NullMarked;
17 import org.jspecify.annotations.Nullable;
18 import org.jspecify.annotations.NullnessUnspecified;
19
20 @NullMarked
21 class DereferenceTypeVariable<
22 Never1T,
23 ChildOfNever1T extends Never1T,
24 UnspecChildOfNever1T extends @NullnessUnspecified Never1T,
25 NullChildOfNever1T extends @Nullable Never1T,
26 //
27 Never2T extends Object,
28 ChildOfNever2T extends Never2T,
29 UnspecChildOfNever2T extends @NullnessUnspecified Never2T,
30 NullChildOfNever2T extends @Nullable Never2T,
31 //
32 UnspecT extends @NullnessUnspecified Object,
33 ChildOfUnspecT extends UnspecT,
34 UnspecChildOfUnspecT extends @NullnessUnspecified UnspecT,
35 NullChildOfUnspecT extends @Nullable UnspecT,
36 //
37 ParametricT extends @Nullable Object,
38 ChildOfParametricT extends ParametricT,
39 UnspecChildOfParametricT extends @NullnessUnspecified ParametricT,
40 NullChildOfParametricT extends @Nullable ParametricT,
41 //
42 UnusedT> {
43 void x0(Never1T x) {
44 synchronized (x) {
45 }
46 }
47
48 void x1(ChildOfNever1T x) {
49 synchronized (x) {
50 }
51 }
52
53 void x2(UnspecChildOfNever1T x) {
54 // jspecify_nullness_not_enough_information
55 synchronized (x) {
56 }
57 }
58
59 void x3(NullChildOfNever1T x) {
60 // jspecify_nullness_mismatch
61 synchronized (x) {
62 }
63 }
64
65 void x4(Never2T x) {
66 synchronized (x) {
67 }
68 }
69
70 void x5(ChildOfNever2T x) {
71 synchronized (x) {
72 }
73 }
74
75 void x6(UnspecChildOfNever2T x) {
76 // jspecify_nullness_not_enough_information
77 synchronized (x) {
78 }
79 }
80
81 void x7(NullChildOfNever2T x) {
82 // jspecify_nullness_mismatch
83 synchronized (x) {
84 }
85 }
86
87 void x8(UnspecT x) {
88 // jspecify_nullness_not_enough_information
89 synchronized (x) {
90 }
91 }
92
93 void x9(ChildOfUnspecT x) {
94 // jspecify_nullness_not_enough_information
95 synchronized (x) {
96 }
97 }
98
99 void x10(UnspecChildOfUnspecT x) {
100 // jspecify_nullness_not_enough_information
101 synchronized (x) {
102 }
103 }
104
105 void x11(NullChildOfUnspecT x) {
106 // jspecify_nullness_mismatch
107 synchronized (x) {
108 }
109 }
110
111 void x12(ParametricT x) {
112 // jspecify_nullness_mismatch
113 synchronized (x) {
114 }
115 }
116
117 void x13(ChildOfParametricT x) {
118 // jspecify_nullness_mismatch
119 synchronized (x) {
120 }
121 }
122
123 void x14(UnspecChildOfParametricT x) {
124 // jspecify_nullness_mismatch
125 synchronized (x) {
126 }
127 }
128
129 void x15(NullChildOfParametricT x) {
130 // jspecify_nullness_mismatch
131 synchronized (x) {
132 }
133 }
134 }