1*2167191dSAndroid Build Coastguard Worker /* 2*2167191dSAndroid Build Coastguard Worker * Copyright 2020 The JSpecify Authors. 3*2167191dSAndroid Build Coastguard Worker * 4*2167191dSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*2167191dSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*2167191dSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*2167191dSAndroid Build Coastguard Worker * 8*2167191dSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*2167191dSAndroid Build Coastguard Worker * 10*2167191dSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*2167191dSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*2167191dSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*2167191dSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*2167191dSAndroid Build Coastguard Worker * limitations under the License. 15*2167191dSAndroid Build Coastguard Worker */ 16*2167191dSAndroid Build Coastguard Worker package wildcardswithdefault; 17*2167191dSAndroid Build Coastguard Worker 18*2167191dSAndroid Build Coastguard Worker import org.jspecify.annotations.NullMarked; 19*2167191dSAndroid Build Coastguard Worker import org.jspecify.annotations.Nullable; 20*2167191dSAndroid Build Coastguard Worker import org.jspecify.annotations.NullnessUnspecified; 21*2167191dSAndroid Build Coastguard Worker 22*2167191dSAndroid Build Coastguard Worker @NullMarked 23*2167191dSAndroid Build Coastguard Worker public class WildcardsWithDefault { noBoundsNotNull(A<?, ?, ?> a)24*2167191dSAndroid Build Coastguard Worker public void noBoundsNotNull(A<?, ?, ?> a) {} 25*2167191dSAndroid Build Coastguard Worker noBoundsNullable( A<? extends @Nullable Object, ? extends @Nullable Object, ? extends @Nullable Object> a)26*2167191dSAndroid Build Coastguard Worker public void noBoundsNullable( 27*2167191dSAndroid Build Coastguard Worker A<? extends @Nullable Object, ? extends @Nullable Object, ? extends @Nullable Object> a) {} 28*2167191dSAndroid Build Coastguard Worker } 29*2167191dSAndroid Build Coastguard Worker 30*2167191dSAndroid Build Coastguard Worker @NullMarked 31*2167191dSAndroid Build Coastguard Worker class A<T extends Object, E extends @Nullable Object, F extends @NullnessUnspecified Object> {} 32*2167191dSAndroid Build Coastguard Worker 33*2167191dSAndroid Build Coastguard Worker @NullMarked 34*2167191dSAndroid Build Coastguard Worker class Use { main( A<Object, Object, Object> aNotNullNotNullNotNull, A<Object, Object, @Nullable Object> aNotNullNotNullNull, A<Object, @Nullable Object, Object> aNotNullNullNotNull, A<Object, @Nullable Object, @Nullable Object> aNotNullNullNull, WildcardsWithDefault b)35*2167191dSAndroid Build Coastguard Worker public static void main( 36*2167191dSAndroid Build Coastguard Worker A<Object, Object, Object> aNotNullNotNullNotNull, 37*2167191dSAndroid Build Coastguard Worker // jspecify_nullness_not_enough_information 38*2167191dSAndroid Build Coastguard Worker A<Object, Object, @Nullable Object> aNotNullNotNullNull, 39*2167191dSAndroid Build Coastguard Worker A<Object, @Nullable Object, Object> aNotNullNullNotNull, 40*2167191dSAndroid Build Coastguard Worker // jspecify_nullness_not_enough_information 41*2167191dSAndroid Build Coastguard Worker A<Object, @Nullable Object, @Nullable Object> aNotNullNullNull, 42*2167191dSAndroid Build Coastguard Worker WildcardsWithDefault b) { 43*2167191dSAndroid Build Coastguard Worker b.noBoundsNotNull(aNotNullNotNullNotNull); 44*2167191dSAndroid Build Coastguard Worker b.noBoundsNotNull(aNotNullNotNullNull); 45*2167191dSAndroid Build Coastguard Worker b.noBoundsNotNull(aNotNullNullNotNull); 46*2167191dSAndroid Build Coastguard Worker b.noBoundsNotNull(aNotNullNullNull); 47*2167191dSAndroid Build Coastguard Worker 48*2167191dSAndroid Build Coastguard Worker b.noBoundsNullable(aNotNullNotNullNotNull); 49*2167191dSAndroid Build Coastguard Worker b.noBoundsNullable(aNotNullNotNullNull); 50*2167191dSAndroid Build Coastguard Worker b.noBoundsNullable(aNotNullNullNotNull); 51*2167191dSAndroid Build Coastguard Worker b.noBoundsNullable(aNotNullNullNull); 52*2167191dSAndroid Build Coastguard Worker } 53*2167191dSAndroid Build Coastguard Worker } 54