|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2018 the original author or authors. |
| 2 | + * Copyright 2002-2019 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -481,23 +481,26 @@ public Annotation[] getParameterAnnotations() {
|
481 | 481 | if (anns == null) {
|
482 | 482 | anns = super.getParameterAnnotations();
|
483 | 483 | for (Annotation[][] ifcAnns : getInterfaceParameterAnnotations()) {
|
484 |
| - Annotation[] paramAnns = ifcAnns[getParameterIndex()]; |
485 |
| - if (paramAnns.length > 0) { |
486 |
| - List<Annotation> merged = new ArrayList<>(anns.length + paramAnns.length); |
487 |
| - merged.addAll(Arrays.asList(anns)); |
488 |
| - for (Annotation paramAnn : paramAnns) { |
489 |
| - boolean existingType = false; |
490 |
| - for (Annotation ann : anns) { |
491 |
| - if (ann.annotationType() == paramAnn.annotationType()) { |
492 |
| - existingType = true; |
493 |
| - break; |
| 484 | + int index = getParameterIndex(); |
| 485 | + if (index < ifcAnns.length) { |
| 486 | + Annotation[] paramAnns = ifcAnns[index]; |
| 487 | + if (paramAnns.length > 0) { |
| 488 | + List<Annotation> merged = new ArrayList<>(anns.length + paramAnns.length); |
| 489 | + merged.addAll(Arrays.asList(anns)); |
| 490 | + for (Annotation paramAnn : paramAnns) { |
| 491 | + boolean existingType = false; |
| 492 | + for (Annotation ann : anns) { |
| 493 | + if (ann.annotationType() == paramAnn.annotationType()) { |
| 494 | + existingType = true; |
| 495 | + break; |
| 496 | + } |
| 497 | + } |
| 498 | + if (!existingType) { |
| 499 | + merged.add(adaptAnnotation(paramAnn)); |
494 | 500 | }
|
495 | 501 | }
|
496 |
| - if (!existingType) { |
497 |
| - merged.add(adaptAnnotation(paramAnn)); |
498 |
| - } |
| 502 | + anns = merged.toArray(new Annotation[0]); |
499 | 503 | }
|
500 |
| - anns = merged.toArray(new Annotation[0]); |
501 | 504 | }
|
502 | 505 | }
|
503 | 506 | this.combinedAnnotations = anns;
|
|
0 commit comments