Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-6099

Replace getParameterTypes().length with getParameterCount()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • None

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

      common-core/src/main/java/org/teiid/core/util/PropertiesUtils.java:            if (! methodName.startsWith("set") || method.getParameterTypes().length != 1 ) { //$NON-NLS-1$
      common-core/src/main/java/org/teiid/core/util/PropertiesUtils.java:            if (! methodName.startsWith("set") || method.getParameterTypes().length != 1 || !StringUtil.endsWithIgnoreCase(methodName, name)) { //$NON-NLS-1$
      engine/src/main/java/org/teiid/query/eval/TeiidScriptEngine.java:                    if (md.getMethod() == null || md.getMethod().getParameterTypes().length > 0 || md.getMethod().getReturnType() == Void.class || md.getMethod().getReturnType() == void.class) {
      engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java:                    int i = invocationMethod.getParameterTypes().length;
      engine/src/main/java/org/teiid/query/function/FunctionTree.java:                requiresContext = (invocationMethod.getParameterTypes().length > 0 && org.teiid.CommandContext.class.isAssignableFrom(invocationMethod.getParameterTypes()[0]));
      runtime/src/main/java/org/teiid/deployers/TranslatorUtil.java:        } else if (method.getParameterTypes().length != 0) {
      

              Unassigned Unassigned
              clara0 Clara Fang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: