code: private Annotation[][] getConstructorParameterAnnotations(Constructor<?> constructor) {
          /*
           * TODO: Remove after JDK9 is the minimum JDK supported
           *
           * JDK9+ correctly accounts for the synthetic parameter and when it becomes
           * the minimum version this method should no longer be required.
           */
          int parameterCount = constructor.getParameterTypes().length;
          Annotation[][] annotations = constructor.getParameterAnnotations();
          int diff = parameterCount - annotations.length;
          if (diff > 0) {
              // May happen on JDK8 and below. We add elements to the front of the array to account for the synthetic params:
              // - for an inner class we expect one param to account for the synthetic outer reference
              // - for an enum we expect two params to account for the synthetic name and ordinal
              if ((!constructor.getDeclaringClass().isEnum() && diff > 1) || diff > 2) {
                  throw new GroovyBugError(
                          "Constructor parameter annotations length [" + annotations.length + "] " +
                          "does not match the parameter length: " + constructor
                  );
              }
              Annotation[][] adjusted = new Annotation[parameterCount][];
              for (int i = 0; i < diff; i++) {
                  adjusted[i] = EMPTY_ANNOTATION_ARRAY;
              }
              System.arraycopy(annotations, 0, adjusted, diff, annotations.length);
              return adjusted;
          }
          return annotations;
      }
docs: Synthetic parameters such as those added for inner class constructors may
  not be included in the parameter annotations array. This is the case when
  at least one parameter of an inner class constructor has an annotation with
  a RUNTIME retention (this occurs for JDK8 and below). This method will
  normalize the annotations array so that it contains the same number of
  elements as the array returned from {@link Constructor#getParameterTypes()}.
  
  If adjustment is required, the adjusted array will be prepended with a
  zero-length element. If no adjustment is required, the original array
  from {@link Constructor#getParameterAnnotations()} will be returned.
  
  @param constructor the Constructor for which to return parameter annotations
  @return array of arrays containing the annotations on the parameters of the given Constructor