d408351 - added new signature with customizable TraceComponent
502288
public final static void logException(TraceComponent compTc, Throwable t, EJBMethodMetaData m, BeanO bean) {
        //d408351 - only log recursive exceptions if they have not been logged before
        if (hasBeenLogged(t)) {
            return;
        }

        BeanId beanId = null;
        if (bean != null) {
            beanId = bean.getId();
        }

        if (m == null) {
            if (beanId == null) {
                Tr.error(compTc, "NON_APPLICATION_EXCEPTION_CNTR0018E", t);
            } else {
                Tr.error(compTc, "NON_APPLICATION_EXCEPTION_ON_BEAN_CNTR0021E", new Object[] { t, beanId });
            }
        } else {
            String methodName = m.getMethodName();
            if (beanId == null) {
                Tr.error(compTc, "NON_APPLICATION_EXCEPTION_METHOD_CNTR0019E", new Object[] { t, methodName });
            } else {
                Tr.error(compTc, "NON_APPLICATION_EXCEPTION_METHOD_ON_BEAN_CNTR0020E", new Object[] { t, methodName, beanId });
            }

        }

    }
261085
@SuppressWarnings("unchecked")
    private void setupTraceStateObjectField(ClassTraceInfo info) {
        // Skip adding trace object field if it already exists
        AnnotationNode traceObjectAnnotation = getAnnotation(TRACE_OBJECT_FIELD_TYPE.getDescriptor(), info.classNode.visibleAnnotations);
        if (traceObjectAnnotation != null) {
            TraceObjectFieldAnnotationVisitor visitor = new TraceObjectFieldAnnotationVisitor();
            traceObjectAnnotation.accept(visitor);
            List<FieldNode> fields = getFieldsByDesc(visitor.getFieldDescriptor(), info.classNode.fields);
            for (FieldNode fn : fields) {
                if (fn.name.equals(visitor.getFieldName())) {
                    info.traceStateField = fn;
                    break;
                }
            }
            return;
        }

        // If a logger or trace component has been declared, use it.
        // Preference is given to the Liberty TraceComponent over the
        // WebSphere TraceComponent and either TraceComponent over a
        // Logger reference.  If none are declared, generate as a
        // synthetic.
        if (info.libertyTraceComponentFieldNode != null) {
            info.traceStateField = info.libertyTraceComponentFieldNode;
            info.traceStateFieldAlreadyInitialized = info.libertyTraceComponentFieldAlreadyInitialized;
        } else if (info.websphereTraceComponentFieldNode != null) {
            StringBuilder sb = new StringBuilder();
            sb.append("INFO: Runtime BCI is not supported for com.ibm.ejs.ras.  Build-time BCI will be used for class ");
            sb.append(info.classNode.name.replace('/', '.'));
            sb.append(".  Consider using the com.ibm.websphere.ras package.");
            info.warnings.add(sb.toString());
            info.traceStateField = info.websphereTraceComponentFieldNode;
            info.traceStateFieldAlreadyInitialized = info.websphereTraceComponentFieldAlreadyInitialized;
        } else if (info.loggerFieldNode != null) {
            StringBuilder sb = new StringBuilder();
            sb.append("INFO: Runtime BCI is not supported for JSR47 Logging.  Build-time BCI will be used for class ");
            sb.append(info.classNode.name.replace('/', '.'));
            sb.append(".");
            info.warnings.add(sb.toString());
            info.traceStateField = info.loggerFieldNode;
            info.traceStateFieldAlreadyInitialized = info.loggerFieldAlreadyInitialized;
        } else if (defaultTraceType == TraceType.LIBERTY) {
            // TODO: Check for an outer class and a declared field
            int access = (Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL | Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC);
            info.traceStateField = (FieldNode) info.classNode.visitField(access, "$$$tc$$$", LIBERTY_TRACE_COMPONENT_TYPE.getDescriptor(), null, null);
        }

        // Add the class annotation with the field name and descriptor
        if (info.traceStateField != null) {
            AnnotationVisitor av = info.classNode.visitAnnotation(TRACE_OBJECT_FIELD_TYPE.getDescriptor(), true);
            av.visit("fieldName", info.traceStateField.name);
            av.visit("fieldDesc", info.traceStateField.desc);
            av.visitEnd();
        }
    }
390395
def _set_signatures(self):
        """"""

        # We currently pass structs as void pointers.
        code_t = ctypes.c_int
        gpr_t = ctypes.c_int32
        int32_t = ctypes.c_int32
        node_p = ctypes.c_void_p
        pointer_t = ctypes.c_void_p
        state_p = ctypes.c_void_p
        void = None

        def sig(rettype, fname, *ptypes):
            func = getattr(self.lib, fname)
            func.restype = rettype
            func.argtypes = ptypes

        sig(node_p, "_jit_arg", state_p)
        sig(node_p, "_jit_finishi", state_p, pointer_t)
        sig(node_p, "_jit_forward", state_p)
        sig(node_p, "_jit_indirect", state_p)
        sig(node_p, "_jit_label", state_p)
        sig(node_p, "_jit_new_node_p", state_p, code_t, pointer_t)
        sig(node_p, "_jit_new_node_pww", state_p, code_t, pointer_t, word_t, word_t)
        sig(node_p, "_jit_new_node_qww", state_p, code_t, int32_t, int32_t, word_t)
        sig(node_p, "_jit_new_node_w", state_p, code_t, word_t)
        sig(node_p, "_jit_new_node_ww", state_p, code_t, word_t, word_t)
        sig(node_p, "_jit_new_node_www", state_p, code_t, word_t, word_t, word_t)
        sig(node_p, "_jit_note", state_p, char_p, ctypes.c_int)
        sig(pointer_t, "_jit_address", state_p, node_p)
        sig(pointer_t, "_jit_emit", state_p)
        sig(state_p, "jit_new_state")
        sig(void, "_jit_clear_state", state_p)
        sig(void, "_jit_destroy_state", state_p)
        sig(void, "_jit_ellipsis", state_p)
        sig(void, "_jit_epilog", state_p)
        sig(void, "_jit_finishr", state_p, gpr_t)
        sig(void, "_jit_getarg_i", state_p, gpr_t, node_p)
        sig(void, "_jit_getarg_l", state_p, gpr_t, node_p)
        sig(void, "_jit_link", state_p, node_p)
        sig(void, "_jit_patch", state_p, node_p)
        sig(void, "_jit_patch_at", state_p, node_p, node_p)
        sig(void, "_jit_prepare", state_p)
        sig(void, "_jit_prolog", state_p)
        sig(void, "_jit_pushargi", state_p, word_t)
        sig(void, "_jit_pushargr", state_p, gpr_t)
        sig(void, "_jit_ret", state_p)
        sig(void, "_jit_reti", state_p, word_t)
        sig(void, "_jit_retr", state_p, gpr_t)
        sig(void, "_jit_retval_c", state_p, gpr_t)
        sig(void, "_jit_retval_i", state_p, gpr_t)
        sig(void, "_jit_retval_s", state_p, gpr_t)
        sig(void, "_jit_retval_uc", state_p, gpr_t)
        sig(void, "_jit_retval_us", state_p, gpr_t)
        sig(void, "finish_jit")
        sig(void, "init_jit", ctypes.c_char_p) # NOTE: Don't use char_p

        if wordsize == 64:
            sig(void, "_jit_retval_l", state_p, gpr_t)
            sig(void, "_jit_retval_ui", state_p, gpr_t)
1336771
protected void modified(Map<String, Object> newProperties) throws Exception {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "modified", newProperties);
        boolean reCreateNeeded = false;

        lock.writeLock().lock();
        try {
            properties = newProperties;
            if (pm != null) {
                try {
                    processServerPoolManagerProperties(null, newProperties);
                } catch (IllegalStateException e1) {
                    if (trace && tc.isDebugEnabled())
                        Tr.debug(this, tc, "modify failed, retrying", CommonFunction.stackTraceToString(e1));
                    try {
                        processServerPoolManagerProperties(null, newProperties);
                    } catch (IllegalStateException e2) {
                        reCreateNeeded = true;
                        if (trace && tc.isDebugEnabled())
                            Tr.debug(this, tc, "retry failed", CommonFunction.stackTraceToString(e2));
                    }
                }
            }
        } finally {
            lock.writeLock().unlock();
        }

        if (reCreateNeeded)
            try {
                setChanged();
                notifyObservers();
            } catch (Throwable x) {
                FFDCFilter.processException(x, getClass().getName(), "402", this);
                if (trace && tc.isDebugEnabled())
                    Tr.debug(this, tc, x.getMessage(), CommonFunction.stackTraceToString(x));
            }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "modified");
    }
762031
private void updateTraceConfiguration(TraceState state) {
		if (DIRECTORY_TYPE.equals(state.ivStorageType)) {
			LogRepositoryComponent.setTraceDirectoryDestination(state.ivDataDirectory, state.ivPurgeBySizeEnabled, state.ivPurgeByTimeEnabled, 
				state.ivFileSwitchEnabled, state.ivBufferingEnabled, state.ivPurgeMaxSize * ONE_MEG , state.ivPurgeMinTime * MILLIS_IN_HOURS, 
				state.ivFileSwitchTime, state.ivOutOfSpaceAction);
		} else if (MEMORYBUFFER_TYPE.equals(state.ivStorageType)) {
			LogRepositoryComponent.setTraceMemoryDestination(state.ivDataDirectory, state.ivMemoryBufferSize * ONE_MEG);
		} else {
			throw new IllegalArgumentException("Unknown value for trace storage type: " + state.ivStorageType);
		}
	}
925446
private void genMethodTypeSignature(ExecutableElement method, StringBuilder sb) {
    genOptFormalTypeParameters(method.getTypeParameters(), sb);
    sb.append('(');
    for (VariableElement param : method.getParameters()) {
      genTypeSignature(param.asType(), sb);
    }
    sb.append(')');
    genTypeSignature(method.getReturnType(), sb);
    List<? extends TypeMirror> thrownTypes = method.getThrownTypes();
    if (hasGenericSignature(thrownTypes)) {
      for (TypeMirror thrownType : thrownTypes) {
        sb.append('^');
        genTypeSignature(thrownType, sb);
      }
    }
  }
462767
def cache_call_signatures(source, user_pos, stmt):
    """"""
    index = user_pos[0] - 1
    lines = source.splitlines() or ['']
    if source and source[-1] == '\n':
        lines.append('')

    before_cursor = lines[index][:user_pos[1]]
    other_lines = lines[stmt.start_pos[0]:index]
    whole = '\n'.join(other_lines + [before_cursor])
    before_bracket = re.match(r'.*\(', whole, re.DOTALL)

    module_path = stmt.get_parent_until().path
    return None if module_path is None else (module_path, before_bracket, stmt.start_pos)
667787
function buildFunctionSignature (paramTypes, returnTypes, isPayable, additionalMods) {
  return 'function (' + util.concatWithSeperator(paramTypes, ',') + ')' + ((isPayable) ? ' payable' : '') + ((additionalMods) ? ' ' + additionalMods : '') + ((returnTypes.length) ? ' returns (' + util.concatWithSeperator(returnTypes, ',') + ')' : '')
}
240368
private void onOwnableType(Generic ownableType) {
                    Generic ownerType = ownableType.getOwnerType();
                    if (ownerType != null && ownerType.getSort().isParameterized()) {
                        onOwnableType(ownerType);
                        signatureVisitor.visitInnerClassType(ownableType.asErasure().getSimpleName());
                    } else {
                        signatureVisitor.visitClassType(ownableType.asErasure().getInternalName());
                    }
                    for (Generic typeArgument : ownableType.getTypeArguments()) {
                        typeArgument.accept(new OfTypeArgument(signatureVisitor));
                    }
                }
1211751
function enhanceSpm (comName, checkSignature, fn) {
  var sp = new SerialPort(comName)
    , open = false;

  sp.writable = true;
  sp.on('open', function() {
    open = true;
    if (checkSignature)
      getSignature(sp, function(e, sig) {
        fn(e, sp, sig);
      });
    else
      fn(null, sp, null);
  });

  sp.once('error', function(e) {
    console.log('ERROR', e, comName);
    if (!open)
      fn(e);
  });
}
594657
private void genTypeSignature(TypeMirror type, StringBuilder sb) {
    switch (type.getKind()) {
      case BOOLEAN:
      case BYTE:
      case CHAR:
      case DOUBLE:
      case FLOAT:
      case INT:
      case LONG:
      case SHORT:
      case VOID:
        sb.append(TypeUtil.getBinaryName(type));
        break;
      case ARRAY:
        // ArrayTypeSignature ::= "[" TypSignature.
        sb.append('[');
        genTypeSignature(((ArrayType) type).getComponentType(), sb);
        break;
      case DECLARED:
        String typeName = elementUtil.getBinaryName(TypeUtil.asTypeElement(type));
        if (!TypeUtil.isStubType(typeName)) {
          // ClassTypeSignature ::= "L" {Ident "/"} Ident
          //   OptTypeArguments {"." Ident OptTypeArguments} ";".
          sb.append('L');
          sb.append(typeName.replace('.', '/'));
          genOptTypeArguments(((DeclaredType) type).getTypeArguments(), sb);
          sb.append(';');
        }
        break;
      case TYPEVAR:
        // TypeVariableSignature ::= "T" Ident ";".
        sb.append('T');
        sb.append(ElementUtil.getName(((TypeVariable) type).asElement()));
        sb.append(';');
        break;
      case WILDCARD:
        // TypeArgument ::= (["+" | "-"] FieldTypeSignature) | "*".
        TypeMirror upperBound = ((WildcardType) type).getExtendsBound();
        TypeMirror lowerBound = ((WildcardType) type).getSuperBound();
        if (upperBound != null) {
          sb.append('+');
          genTypeSignature(upperBound, sb);
        } else if (lowerBound != null) {
          sb.append('-');
          genTypeSignature(lowerBound, sb);
        } else {
          sb.append('*');
        }
        break;
      default:
        throw new AssertionError("Unexpected type kind: " + type.getKind());
    }
  }
1183507
private void addPossibleSignature(String name, Node node, NodeTraversal t) {
    if (node.isFunction()) {
      // The node we're looking at is a function, so we can add it directly
      addSignature(name, node, t.getSourceName());
    } else {
      nonMethodProperties.add(name);
    }
  }
6187
function addEntryComponentToModule(source, modulePath, classifiedName, importPath) {
    return addSymbolToNgModuleMetadata(source, modulePath, 'entryComponents', classifiedName, importPath);
}
137849
private SignatureFieldExtension initExtension() {
        SignatureFieldExtension ext = new SignatureFieldExtension(this);
        ext.addSignatureChangeListener(new SignatureFieldExtension.SignatureChangeListener() {
            
            private static final long serialVersionUID = 1L;

            @Override
            public void signatureChange(SignatureFieldExtension.SignatureChangeEvent event) {
                changingVariables = true;
                try {
                    setValue(event.getSignature(), true);
                } finally {
                    changingVariables = false;
                }
            }
        });
        return ext;
    }
65041
static void traceComponentRegistered(TraceComponent tc) {
        for (TraceComponentChangeListener listener : registeredListeners.get()) {
            listener.traceComponentRegistered(tc);
        }
    }
510219
function compareSignaturesIdentical(source, target, partialMatch, ignoreThisTypes, ignoreReturnTypes, compareTypes) {
            // TODO (drosen): De-duplicate code between related functions.
            if (source === target) {
                return -1 /* True */;
            }
            if (!(isMatchingSignature(source, target, partialMatch))) {
                return 0 /* False */;
            }
            // Check that the two signatures have the same number of type parameters. We might consider
            // also checking that any type parameter constraints match, but that would require instantiating
            // the constraints with a common set of type arguments to get relatable entities in places where
            // type parameters occur in the constraints. The complexity of doing that doesn't seem worthwhile,
            // particularly as we're comparing erased versions of the signatures below.
            if ((source.typeParameters ? source.typeParameters.length : 0) !== (target.typeParameters ? target.typeParameters.length : 0)) {
                return 0 /* False */;
            }
            // Spec 1.0 Section 3.8.3 & 3.8.4:
            // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N
            source = getErasedSignature(source);
            target = getErasedSignature(target);
            var result = -1 /* True */;
            if (!ignoreThisTypes) {
                var sourceThisType = getThisTypeOfSignature(source);
                if (sourceThisType) {
                    var targetThisType = getThisTypeOfSignature(target);
                    if (targetThisType) {
                        var related = compareTypes(sourceThisType, targetThisType);
                        if (!related) {
                            return 0 /* False */;
                        }
                        result &= related;
                    }
                }
            }
            var targetLen = target.parameters.length;
            for (var i = 0; i < targetLen; i++) {
                var s = isRestParameterIndex(source, i) ? getRestTypeOfSignature(source) : getTypeOfParameter(source.parameters[i]);
                var t = isRestParameterIndex(target, i) ? getRestTypeOfSignature(target) : getTypeOfParameter(target.parameters[i]);
                var related = compareTypes(s, t);
                if (!related) {
                    return 0 /* False */;
                }
                result &= related;
            }
            if (!ignoreReturnTypes) {
                result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));
            }
            return result;
        }
1368947
private String getParamJVMSignature(String paramsig) throws SignatureException {
        String paramJVMSig = "";
        String componentType ="";

        if(paramsig != null){

            if(paramsig.contains("[]")) {
                // Gets array dimension.
                int endindex = paramsig.indexOf("[]");
                componentType = paramsig.substring(0, endindex);
                String dimensionString =  paramsig.substring(endindex);
                if(dimensionString != null){
                    while(dimensionString.contains("[]")){
                        paramJVMSig += "[";
                        int beginindex = dimensionString.indexOf("]") + 1;
                        if(beginindex < dimensionString.length()){
                            dimensionString = dimensionString.substring(beginindex);
                        }else
                            dimensionString = "";
                    }
                }
            } else componentType = paramsig;

            paramJVMSig += getComponentType(componentType);
        }
        return paramJVMSig;
    }