/*
@see com.ibm.websphere.http.EncodingUtils#getJvmConverter(java.lang.String)
194493
@Override
    public String getJvmConverter(String encoding) {
        if (null != encoding) {
            String converter = this.converterMap.get(encoding.toLowerCase());
            if (null != converter) {
                return converter;
            }
        }
        return encoding;
    }
286942
public static byte[] getBytes(final String mValue) {
        byte[] bytes = null;
        try {
            if (mValue == null || mValue.length() == 0) {
                bytes = new byte[0];
            } else {
                final StringBuilder builder = new StringBuilder();
                for (int i = 0; i < mValue.length(); i++) {
                    switch (mValue.charAt(i)) {
                    case '&':
                        builder.append("&amp;");
                        break;
                    case '<':
                        builder.append("&lt;");
                        break;
                    default:
                        builder.append(mValue.charAt(i));
                    }
                }
                bytes = builder.toString().getBytes("UTF-8");

                // bytes = value.replace("&", "&amp;").replace("<", "&lt;")
                // .getBytes(ConstructorProps.DEFAULT_ENCODING);
            }
        } catch (final Exception e) {
            throw new RuntimeException("Could not convert String to byte[]: " + e.getLocalizedMessage());
        }
        return bytes;
    }
299496
@Override
	public String getCustomCacheKeyFromJwtSSOToken(String encodedjwt) {
		// TODO Auto-generated method stub
		JwtSsoTokenUtils tokenUtil = getSimpleJwtSsoTokenUtils();
		if (encodedjwt != null) {
			return tokenUtil.getCustomCacheKeyFromToken(encodedjwt);
		}
		return null;
	}
1084492
private static String getJmxResult(MBeanServerConnection connetion, String url) throws Exception {
        ObjectName name = new ObjectName(DruidStatService.MBEAN_NAME);

        return (String) conn.invoke(name, "service", new String[]{url},
                new String[]{String.class.getName()});
    }
1351332
@SuppressWarnings("unchecked")
	@Override
	public <C> IConverter<C> getConverter(final Class<C> type)
	{
		if (Temporal.class.isAssignableFrom(type))
		{
			return (IConverter<C>)converter;
		}
		else
		{
			return super.getConverter(type);
		}
	}
797957
public com.google.protobuf.ByteString
      getJavaClassBytes() {
    java.lang.Object ref = javaClass_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      javaClass_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
380111
public java.lang.String getVmId() {
    java.lang.Object ref = vmId_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      vmId_ = s;
      return s;
    }
  }
883607
@Override
    public StringConverter<?> findConverter(Class<?> cls) {
        if (Type.class.isAssignableFrom(cls) && cls != Class.class) {
            return new TypeStringConverter(cls);
        }
        return null;
    }
997890
@Override
    public StringConverter<?> findConverter(Class<?> cls) {
        if (cls == Character[].class) {
            return CharecterArrayStringConverter.INSTANCE;
        }
        return null;
    }
969286
public final FctConvertersToFromString
    lazyGetFctConvertersToFromString() throws Exception {
    String beanName = getFctConvertersToFromStringName();
    FctConvertersToFromString fctConvertersToFromString =
      (FctConvertersToFromString) this.beansMap.get(beanName);
    if (fctConvertersToFromString == null) {
      fctConvertersToFromString = new FctConvertersToFromString();
      fctConvertersToFromString.setUtlReflection(lazyGetUtlReflection());
      fctConvertersToFromString
        .setFieldsRapiHolder(lazyGetHolderRapiFields());
      fctConvertersToFromString
        .setGettersRapiHolder(lazyGetHolderRapiGetters());
      fctConvertersToFromString
        .setSettersRapiHolder(lazyGetHolderRapiSetters());
      HlFlCnNm hldFieldsCnvTfsNames = lazyGetHldFieldsCnvTfsNames();
      fctConvertersToFromString
        .setFieldConverterNamesHolder(hldFieldsCnvTfsNames);
      HolderRapiFields holderRapiFields = lazyGetHolderRapiFields();
      ASrvOrm<RS> srvOrm = lazyGetSrvOrm();
      // prepare for setting fieldFromToStringConverter
      // according Specification Beige-WEB interface version #2:
      //TODO move it as lazy into factory!!!
      for (Class<?> clazz : hldFieldsCnvTfsNames
        .getMngSettings().getClasses()) {
        for (String fieldNm : hldFieldsCnvTfsNames.getMngSettings()
          .lazFldsSts(clazz).keySet()) {
          String cnNm = hldFieldsCnvTfsNames.getFor(clazz, fieldNm);
          if (cnNm != null && (cnNm.startsWith(CnvTfsEnum.class.getSimpleName())
              || cnNm.startsWith(CnvTfsObject.class.getSimpleName())
                || cnNm.startsWith(CnvTfsHasId.class.getSimpleName()))) {
            Field field = holderRapiFields.getFor(clazz, fieldNm);
            Class ngClass = field.getType();
            //cnNm += ngClass.getSimpleName();
            if (cnNm.startsWith(CnvTfsEnum.class.getSimpleName())) {
              fctConvertersToFromString
                .getEnumsClasses().add(ngClass);
            } else if (cnNm.startsWith(CnvTfsObject.class
              .getSimpleName())) {
              fctConvertersToFromString
                .getCompositeClasses().add(ngClass);
            } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName())) {
              TableSql tableSql = srvOrm.getTablesMap()
                .get(ngClass.getSimpleName());
              if (tableSql == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "Foreign entity table not found for field/class: " + field.getName()
          + "/" + clazz);
              }
              if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "Long")) {
                fctConvertersToFromString.getHasLongIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "Integer")) {
                fctConvertersToFromString.getHasIntegerIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "String")) {
                fctConvertersToFromString.getHasStringIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              } else if (cnNm.startsWith(CnvTfsHasId
                    .class.getSimpleName() + "Composite")) {
                fctConvertersToFromString.getHasCompositeIdMap()
                  .put(ngClass, tableSql.getIdFieldName());
              }
            }
          }
        }
      }
      hldFieldsCnvTfsNames.getMngSettings().setFieldsSettings(null);
      hldFieldsCnvTfsNames.getMngSettings().setClassesSettings(null);
      this.beansMap.put(beanName, fctConvertersToFromString);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return fctConvertersToFromString;
  }
28607
@Override
    public MessageListener getMessageListener() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getMessageListener");

        MessageListener messageListener = null;

        try {
            messageListener = messageConsumer.getMessageListener();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getMessageListener", messageListener);
        }

        return messageListener;
    }
938260
@Override
    public StringConverter<?> findConverter(Class<?> cls) {
        if (cls.isArray() && cls.getComponentType().isPrimitive()) {
            if (cls == long[].class) {
                return LongArrayStringConverter.INSTANCE;
            }
            if (cls == int[].class) {
                return IntArrayStringConverter.INSTANCE;
            }
            if (cls == short[].class) {
                return ShortArrayStringConverter.INSTANCE;
            }
            if (cls == double[].class) {
                return DoubleArrayStringConverter.INSTANCE;
            }
            if (cls == float[].class) {
                return FloatArrayStringConverter.INSTANCE;
            }
        }
        return null;
    }
1339003
public static JsonElementConverter getConvertor(JsonSchema schemaNode, String namespace, WorkUnitState state)
      throws UnsupportedDateTypeException {

    Type type = schemaNode.getType();

    DateTimeZone timeZone = getTimeZone(state.getProp(ConfigurationKeys.CONVERTER_AVRO_DATE_TIMEZONE, "UTC"));
    switch (type) {
      case DATE:
        return new DateConverter(schemaNode,
            state.getProp(ConfigurationKeys.CONVERTER_AVRO_DATE_FORMAT, "yyyy-MM-dd HH:mm:ss"), timeZone, state);

      case TIMESTAMP:
        return new DateConverter(schemaNode,
            state.getProp(ConfigurationKeys.CONVERTER_AVRO_TIMESTAMP_FORMAT, "yyyy-MM-dd HH:mm:ss"), timeZone, state);

      case TIME:
        return new DateConverter(schemaNode, state.getProp(ConfigurationKeys.CONVERTER_AVRO_TIME_FORMAT, "HH:mm:ss"),
            timeZone, state);

      case FIXED:
        throw new UnsupportedDateTypeException(type.toString() + " is unsupported");

      case STRING:
        return new StringConverter(schemaNode);

      case BYTES:
        return new BinaryConverter(schemaNode, state.getProp(ConfigurationKeys.CONVERTER_AVRO_BINARY_CHARSET, "UTF8"));

      case INT:
        return new IntConverter(schemaNode);

      case LONG:
        return new LongConverter(schemaNode);

      case FLOAT:
        return new FloatConverter(schemaNode);

      case DOUBLE:
        return new DoubleConverter(schemaNode);

      case BOOLEAN:
        return new BooleanConverter(schemaNode);

      case ARRAY:
        return new ArrayConverter(schemaNode, state);

      case MAP:
        return new MapConverter(schemaNode, state);

      case ENUM:
        return new EnumConverter(schemaNode, namespace);

      case RECORD:
        return new RecordConverter(schemaNode, state, namespace);

      case NULL:
        return new NullConverter(schemaNode);

      case UNION:
        return new UnionConverter(schemaNode, state);

      default:
        throw new UnsupportedDateTypeException(type.toString() + " is unsupported");
    }
  }
479190
public Converter<NetworkResponse, ?> getResponseConverter(Type type, Annotation[] annotations) {
        checkNotNull(type, "type == null");
        checkNotNull(annotations, "annotations == null");

        for (int i = 0, count = converterFactories.size(); i < count; i++) {
            Converter<NetworkResponse, ?> converter =
                    converterFactories.get(i).fromResponse(type, annotations);
            if (converter != null) {
                return converter;
            }
        }

        StringBuilder builder = new StringBuilder("Could not locate Response converter for ")
                .append(type)
                .append(". Tried:");
        for (Factory converterFactory : converterFactories) {
            builder.append("\n * ").append(converterFactory.getClass().getName());
        }
        throw new IllegalArgumentException(builder.toString());
    }
818883
@Override
  public final IConverter<?, ColumnsValues> lazyGet(//NOPMD
    // Rule:DoubleCheckedLocking isn't true see in beige-common:
    // org.beigesoft.test.DoubleCkeckLockingWrApTest
    final Map<String, Object> pAddParam,
      final Class<?> pBeanClass) throws Exception {
    IConverter<?, ColumnsValues> convrt =
      this.convertersMap.get(pBeanClass);
    if (convrt == null) {
      // locking:
      synchronized (this.convertersMap) {
        // make sure again whether it's null after locking:
        convrt = this.convertersMap.get(pBeanClass);
        if (convrt == null) {
          if (IHasVersion.class.isAssignableFrom(pBeanClass)) {
            convrt = lazyGetCnvHasVersionToColumnsValues(pBeanClass);
          } else {
            convrt = lazyGetCnvObjectToColumnsValues(pBeanClass);
          }
        }
      }
    }
    return convrt;
  }
987395
@Override
  public ConvertManager converter()
  {
    if (_convertManager == null) {
      _convertManager = provider(Key.of(ConvertManager.class));
    }

    return _convertManager.get();
  }
171849
private JvmOperation getJvmOperation(IMethod method, JvmType context)
			throws JavaModelException {
		if (context instanceof JvmDeclaredType) {
			final JvmDeclaredType declaredType = (JvmDeclaredType) context;
			final ActionParameterTypes jdtSignature = this.actionPrototypeProvider.createParameterTypes(
					Flags.isVarargs(method.getFlags()),
					getFormalParameterProvider(method));
			for (final JvmOperation jvmOperation : declaredType.getDeclaredOperations()) {
				final ActionParameterTypes jvmSignature = this.actionPrototypeProvider.createParameterTypesFromJvmModel(
						jvmOperation.isVarArgs(),
						jvmOperation.getParameters());
				if (jvmSignature.equals(jdtSignature)) {
					return jvmOperation;
				}
			}
		}
		return null;
	}