/* (non-Javadoc)
@see org.apache.commons.logging.LogFactory#getInstance(java.lang.Class)
358823
public Log getInstance(Class c) throws LogConfigurationException
    {
        if (c!=null)
            return getInstance(c.getName());
        return getInstance((String)null);
    }
1116500
public static This getClassInstanceThis(Object instance, String className) {
        try {
            Object o = getObjectFieldValue(instance, BSHTHIS + className);
            return (This) Primitive.unwrap(o); // unwrap Primitive.Null to null
        } catch (Exception e) {
            throw new InterpreterError("Generated class: Error getting This" + e, e);
        }
    }
182433
private Logger createLoggerInstance(String loggerName) throws Exception
    {
        Class loggerClass = getConfiguration().getLoggerClass();
        Logger log = (Logger) ClassHelper.newInstance(loggerClass, String.class, loggerName);
        log.configure(getConfiguration());
        return log;
    }
919033
@Override
    public Set<Object> getInstances() {
        Set<Object> set = new HashSet<>();
        ClassLoader cl = Thread.currentThread().getContextClassLoader();

        Consumer<JsonArray> reader = array -> {
            if (array != null && array.size() > 0) {
                for (int i = 0; i < array.size(); i++) {
                    try {
                        Class<?> clazz = cl.loadClass(array.getString(i));
                        set.add(clazz.newInstance());
                    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        };

        JsonArray binders = config.getJsonArray(CONFIG_BINDERS, null);
        JsonArray instances = config.getJsonArray(CONFIG_INSTANCES, null);

        reader.accept(binders);
        reader.accept(instances);

        return set;
    }
913301
static synchronized Udev getInstance() {
        if (instance == null) {
            try {
                instance = new Udev();
            } catch (IOException e) {
                System.err.println("Udev: failed to open connection");
                e.printStackTrace();
            }
        }
        return instance;
    }
629317
public static ResourceScanner getInstance() {
		if(INSTANCE == null) {
			synchronized(ResourceScanner.class) {
				if(INSTANCE == null) {
					INSTANCE = new ResourceScanner();
				}
			}
		}
		
		return INSTANCE;
	}
1055229
public static Equ getInstance(final boolean fresh)
    {
        if (instance == null || fresh)
        {
            final Equ newInstance = new Equ();
            try
            {
                newInstance.initialize();
            } catch (final Exception e)
            {
                e.printStackTrace();
            }
            instance = newInstance;
        }
        return instance;
    }
805002
public Integer getInstance() {
    try {
      return Integer.valueOf(uri.getPath().split("/")[2]);
    } catch (IndexOutOfBoundsException e) {
      return null;
    }
  }
402981
public static BeanDescriptor getInstance(Class<?> type) {
        BeanDescriptor bd = cache.get(type);
        if (bd == null) {
            bd = new BeanDescriptor(type);
            BeanDescriptor existing = cache.putIfAbsent(type, bd);
            if (existing != null) {
                bd = existing;
            }
        }
        return bd;
    }
786181
public static ClassDescriptorCache getInstance() {
    if (INSTANCE == null) {
      synchronized (ClassDescriptorCache.class) {
        if (INSTANCE == null) {
          INSTANCE = new ClassDescriptorCache();
        }
      }
    }
    return INSTANCE;
  }
371234
@SuppressWarnings("unchecked")
    public static <T> T getObjectInstance(String className) {
        try {
            Class clazz = Class.forName(className);
            return (T) clazz.newInstance();
        } catch (Exception e) {
            throw new Error(e);
        }
    }
928800
public static LogFactory set(Class<? extends LogFactory> logFactoryClass) {
		try {
			return set(logFactoryClass.newInstance());
		} catch (Exception e) {
			throw new IllegalArgumentException("Can not instance LogFactory class!", e);
		}
	}
844749
public static XmlUtil getInstance() {

    if (instance == null) {
      synchronized (XmlUtilImpl.class) {
        if (instance == null) {
          XmlUtilImpl util = new XmlUtilImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
429958
public IJsonMarshaller getIJsonMarshallerInstance(Class<? extends IJsonMarshaller> cls) throws JsonMarshallerException {
		if(logger.isDebugEnabled()) {
			logger.debug("Try to get {} by CDI.select Unsatisfied: {}", cls.getName(), CDI.current().select(cls).isUnsatisfied());
		}
		if(CDI.current().select(cls).isUnsatisfied()) {
			throw new JsonMarshallerException(cls.getName()+" is Unsatisfied");
		}
		return CDI.current().select(cls).get();
	}
930256
public <T> T getInstance(String instanceHint, Class<? extends T> apiInterface, T apiImpl) {
		return STR.notNullOrBlank(instanceHint) ? getInstance(instanceHint, apiInterface) : allowExceptions ? apiImpl : getInstance(apiImpl, apiInterface);
	}
1012352
public Instance getInstance(final String my_instance_id) {
    // [START instance_admin_client_get_instance]
    final String instanceId = my_instance_id;
    Instance ins = instanceAdminClient.getInstance(instanceId);
    // [END instance_admin_client_get_instance]
    return ins;
  }
914516
public static <T extends PropertyDispatcher> T getInstance(Class<T> cls)
    {
        return getInstance(cls, null);
    }