@@ -250,7 +250,7 @@ public void arraySubtyping() {
250
250
" @Nullable Integer[] x2 = nullableIntArr;" ,
251
251
" // legal (covariant array subtypes)" ,
252
252
" x2 = nonnullIntArr;" ,
253
- " // BUG: Diagnostic contains: Cannot assign from type @Nullable Integer[] to type Integer[]" ,
253
+ " // BUG: Diagnostic contains: Cannot assign from type @Nullable Integer [] to type Integer []" ,
254
254
" x1 = nullableIntArr;" ,
255
255
" }" ,
256
256
"}" )
@@ -272,7 +272,7 @@ public void arraySubtypingWithNewExpression() {
272
272
" @Nullable Integer[] x2 = new Integer[0];" ,
273
273
" // legal" ,
274
274
" x2 = new @Nullable Integer[0];" ,
275
- " // BUG: Diagnostic contains: Cannot assign from type @Nullable Integer[] to type Integer[]" ,
275
+ " // BUG: Diagnostic contains: Cannot assign from type @Nullable Integer [] to type Integer []" ,
276
276
" x1 = new @Nullable Integer[0];" ,
277
277
" }" ,
278
278
"}" )
@@ -290,7 +290,7 @@ public void arraysAndGenerics() {
290
290
"class Test {" ,
291
291
" void foo(List<@Nullable Integer[]> l) {}" ,
292
292
" void testPositive(List<Integer[]> p) {" ,
293
- " // BUG: Diagnostic contains: Cannot pass parameter of type List<Integer[]>" ,
293
+ " // BUG: Diagnostic contains: Cannot pass parameter of type List<Integer []>" ,
294
294
" foo(p);" ,
295
295
" }" ,
296
296
" void testNegative(List<@Nullable Integer[]> p) {" ,
@@ -312,7 +312,7 @@ public void genericArraysReturnedAndPassed() {
312
312
" static class Bar<T> {" ,
313
313
" Foo<T>[] getFoosPositive() {" ,
314
314
" @Nullable Foo<T>[] result = new Foo[0];" ,
315
- " // BUG: Diagnostic contains: Cannot return expression of type @Nullable Foo<T>[] from method" ,
315
+ " // BUG: Diagnostic contains: Cannot return expression of type @Nullable Foo<T> [] from method" ,
316
316
" return result;" ,
317
317
" }" ,
318
318
" Foo<T>[] getFoosNegative() {" ,
@@ -321,7 +321,7 @@ public void genericArraysReturnedAndPassed() {
321
321
" }" ,
322
322
" void takeFoos(Foo<T>[] foos) {}" ,
323
323
" void callTakeFoosPositive(@Nullable Foo<T>[] p) {" ,
324
- " // BUG: Diagnostic contains: Cannot pass parameter of type @Nullable Foo<T>[]" ,
324
+ " // BUG: Diagnostic contains: Cannot pass parameter of type @Nullable Foo<T> []" ,
325
325
" takeFoos(p);" ,
326
326
" }" ,
327
327
" void callTakeFoosNegative(Foo<T>[] p) {" ,
@@ -331,9 +331,9 @@ public void genericArraysReturnedAndPassed() {
331
331
" void callTakeFoosVarargsPositive(@Nullable Foo<T>[] p, Foo<T>[] p2) {" ,
332
332
" // Under the hood, a @Nullable Foo<T>[][] is passed, which is not a subtype" ,
333
333
" // of the formal parameter type Foo<T>[][]" ,
334
- " // BUG: Diagnostic contains: Cannot pass parameter of type @Nullable Foo<T>[]" ,
334
+ " // BUG: Diagnostic contains: Cannot pass parameter of type @Nullable Foo<T> []" ,
335
335
" takeFoosVarargs(p);" ,
336
- " // BUG: Diagnostic contains: Cannot pass parameter of type @Nullable Foo<T>[]" ,
336
+ " // BUG: Diagnostic contains: Cannot pass parameter of type @Nullable Foo<T> []" ,
337
337
" takeFoosVarargs(p2, p);" ,
338
338
" }" ,
339
339
" void callTakeFoosVarargsNegative(Foo<T>[] p) {" ,
@@ -367,7 +367,7 @@ public void overridesReturnType() {
367
367
" @Override" ,
368
368
" Integer[] foo() { return new Integer[0]; }" ,
369
369
" @Override" ,
370
- " // BUG: Diagnostic contains: Method returns @Nullable Integer[], but overridden method returns Integer[]" ,
370
+ " // BUG: Diagnostic contains: Method returns @Nullable Integer [], but overridden method returns Integer []" ,
371
371
" @Nullable Integer[] bar() { return new @Nullable Integer[0]; }" ,
372
372
" }" ,
373
373
"}" )
@@ -389,7 +389,7 @@ public void overridesParameterType() {
389
389
" }" ,
390
390
" class Sub extends Super {" ,
391
391
" @Override" ,
392
- " // BUG: Diagnostic contains: Parameter has type Integer[], but overridden method has parameter type @Nullable Integer[]" ,
392
+ " // BUG: Diagnostic contains: Parameter has type Integer [], but overridden method has parameter type @Nullable Integer []" ,
393
393
" void foo(Integer[] p) { }" ,
394
394
" @Override" ,
395
395
" void bar(@Nullable Integer[] p) { }" ,
@@ -407,7 +407,7 @@ public void ternaryOperator() {
407
407
"import org.jspecify.annotations.Nullable;" ,
408
408
"class Test {" ,
409
409
" static Integer[] testPositive(Integer[] p, boolean t) {" ,
410
- " // BUG: Diagnostic contains: Conditional expression must have type Integer[]" ,
410
+ " // BUG: Diagnostic contains: Conditional expression must have type Integer []" ,
411
411
" Integer[] t1 = t ? new Integer[0] : new @Nullable Integer[0];" ,
412
412
" // BUG: Diagnostic contains: Conditional expression must have type" ,
413
413
" return t ? new @Nullable Integer[0] : new @Nullable Integer[0];" ,
0 commit comments