Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-1476

Replace usages of getParameterTypes().length with getParameterCount()

XMLWordPrintable

      getParameterTypes().length is inefficient because it creates an array clone, while getParameterCount() directly returns the length.

      Targets
          Occurrences of 'getParameterTypes().length' in Directory /Users/christineji/ws/quarkus
      arc-processor  (2 usages found)
          io.quarkus.arc.processor  (2 usages found)
              DecoratorGenerator.java  (2 usages found)
                  239 ResultHandle[] args = new ResultHandle[abstractMethod.getParameterTypes().length];
                  249 ResultHandle[] args = new ResultHandle[entry.getKey().getParameterTypes().length];
      quarkus-amazon-lambda-deployment  (1 usage found)
          io.quarkus.amazon.lambda.deployment  (1 usage found)
              AmazonLambdaProcessor.java  (1 usage found)
                  165 && method.getParameterTypes().length == 2
      quarkus-arquillian  (2 usages found)
          io.quarkus.arquillian  (2 usages found)
              InjectionEnricher.java  (2 usages found)
                  49 if (method.getParameterTypes().length > 0) {
                  135 Object[] values = new Object[method.getParameterTypes().length];
      quarkus-core-deployment  (9 usages found)
          io.quarkus.deployment.builditem.nativeimage  (1 usage found)
              ReflectiveMethodBuildItem.java  (1 usage found)
                  28 String[] params = new String[method.getParameterTypes().length];
          io.quarkus.deployment.proxy  (1 usage found)
              ProxyFactory.java  (1 usage found)
                  199 for (int i = 0; i < injectConstructor.getParameterTypes().length; ++i) {
          io.quarkus.deployment.recording  (7 usages found)
              BytecodeRecorderImpl.java  (7 usages found)
                  330 && method.getParameterTypes().length == 0
                  417 && method.getParameterTypes().length == 0
                  422 && method.getParameterTypes().length == 0
                  427 && method.getParameterTypes().length == 1
                  1159 if (current == null || current.getParameterTypes().length < c.getParameterTypes().length) {
                  1162 } else if (current != null && current.getParameterTypes().length == c.getParameterTypes().length) {
                  1322 if (m.getParameterTypes().length > 0
      quarkus-rest-client  (2 usages found)
          io.quarkus.restclient.runtime  (2 usages found)
              QuarkusRestClientBuilder.java  (2 usages found)
                  607 .filter(m -> builderMethodName.equals(m.getName()) && m.getParameterTypes().length >= 1)
                  614 if (builderMethod.getParameterTypes().length > 1) {
      resteasy-reactive  (1 usage found)
          org.jboss.resteasy.reactive.server.core  (1 usage found)
              ResteasyReactiveRequestContext.java  (1 usage found)
                  178 parameters = new Object[target.getParameterTypes().length];
      

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              clara0 Clara Fang (Inactive)
              Michal Vavrik Michal Vavrik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: