@@ -49,13 +49,21 @@ class MethodParameterTests {
4949
5050	private  MethodParameter  intReturnType ;
5151
52+ 	private  MethodParameter  jspecifyNullableParameter ;
53+ 
54+ 	private  MethodParameter  springNullableParameter ;
55+ 
5256
5357	@ BeforeEach 
5458	void  setup () throws  NoSuchMethodException  {
5559		method  = getClass ().getMethod ("method" , String .class , long .class );
5660		stringParameter  = new  MethodParameter (method , 0 );
5761		longParameter  = new  MethodParameter (method , 1 );
5862		intReturnType  = new  MethodParameter (method , -1 );
63+ 		Method  jspecifyNullableMethod  = getClass ().getMethod ("jspecifyNullableMethod" , String .class );
64+ 		jspecifyNullableParameter  = new  MethodParameter (jspecifyNullableMethod , 0 );
65+ 		Method  springNullableMethod  = getClass ().getMethod ("springNullableMethod" , String .class );
66+ 		springNullableParameter  = new  MethodParameter (springNullableMethod , 0 );
5967	}
6068
6169
@@ -238,21 +246,29 @@ void nestedWithTypeIndexReturnsNewInstance() throws Exception {
238246	}
239247
240248	@ Test 
241- 	void  nullableWithSpringAnnotation () {
242- 		MethodParameter  m  = MethodParameter .forExecutable (method , 1 );
243- 		assertThat (m .isOptional ()).isTrue ();
249+ 	void  jspecifyNullableParameter () {
250+ 		assertThat (jspecifyNullableParameter .isOptional ()).isTrue ();
244251	}
245252
246253	@ Test 
247- 	void  nullableWithJSpecifyAnnotation () {
248- 		MethodParameter  m  = MethodParameter .forExecutable (method , 0 );
249- 		assertThat (m .isOptional ()).isTrue ();
254+ 	void  springNullableParameter () {
255+ 		assertThat (springNullableParameter .isOptional ()).isTrue ();
250256	}
251257
252- 	public  int  method (@ org . jspecify . annotations . Nullable   String  p1 ,  @ org . springframework . lang . Nullable  long  p2 ) {
258+ 	public  int  method (String  p1 , long  p2 ) {
253259		return  42 ;
254260	}
255261
262+ 	public  @ org .jspecify .annotations .Nullable  String  jspecifyNullableMethod (@ org .jspecify .annotations .Nullable  String  parameter ) {
263+ 		return  parameter ;
264+ 	}
265+ 
266+ 	@ SuppressWarnings ("deprecation" )
267+ 	@ org .springframework .lang .Nullable 
268+ 	public  String  springNullableMethod (@ org .springframework .lang .Nullable  String  parameter ) {
269+ 		return  parameter ;
270+ 	}
271+ 
256272	@ SuppressWarnings ("unused" )
257273	private  static  class  NestedClass  {
258274
0 commit comments