Utility method for acquiring a reference to the NIOFileResource class without
asking the class loader every single time after we know it's not there.

@return the NIO class object
761155
protected Class<?> getNIOFileResourceClass() {
		final String method = "getNIOFileResourceClass"; //$NON-NLS-1$

		if (tryNIO && nioFileResourceClass == null) {
			try {
				nioFileResourceClass = classLoader
						.loadClass("com.ibm.jaggr.core.impl.resource.NIOFileResource"); //$NON-NLS-1$
			} catch (ClassNotFoundException e) {
				tryNIO = false; // Don't try this again.
				if (log.isLoggable(Level.WARNING)) {
					log.logp(Level.WARNING, CLAZZ, method, e.getMessage());
					log.logp(Level.WARNING, CLAZZ, method, WARN_MESSAGE);
				}
			} catch (UnsupportedClassVersionError e) {
				tryNIO = false; // Don't try this again.
				if (log.isLoggable(Level.WARNING)) {
					log.logp(Level.WARNING, CLAZZ, method, e.getMessage());
					log.logp(Level.WARNING, CLAZZ, method, WARN_MESSAGE);
				}
			}
		}
		return nioFileResourceClass;
	}
860344
public RuntimeResourceDefinition getResourceDefinition(IBaseResource theResource) {
		validateInitialized();
		Validate.notNull(theResource, "theResource must not be null");
		return getResourceDefinition(theResource.getClass());
	}
1313227
private static final LockFile newNIOLockFile() {

        if (NIO_FILELOCK_AVAILABLE && NIO_LOCKFILE_CLASS != null) {
            try {
                return (LockFile) NIO_LOCKFILE_CLASS.newInstance();
            } catch (Exception e) {

                // e.printStackTrace()
            }
        }

        return null;
    }
28711
public static ClassLoader getCurrentClassLoader() {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (cl == null) {
            cl = ClassLoaderUtils.class.getClassLoader();
        }
        return cl == null ? ClassLoader.getSystemClassLoader() : cl;
    }
280123
public ResourceClassLoader getCustomResourceClassLoader(Resource[] resources) throws IOException {

	if (ArrayUtil.isEmpty(resources)) return this;

	String key = hash(resources);
	ResourceClassLoader rcl = (customCLs == null) ? null : customCLs.get(key);

	if (rcl != null) return rcl;

	resources = ResourceUtil.merge(this.getResources(), resources);
	rcl = new ResourceClassLoader(resources, getParent());

	if (customCLs == null) customCLs = new ReferenceMap<String, ResourceClassLoader>();

	customCLs.put(key, rcl);
	return rcl;
    }
1061816
public static FileUtil getInstance() {

    if (instance == null) {
      synchronized (FileUtilImpl.class) {
        if (instance == null) {
          FileUtilImpl util = new FileUtilImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
1094757
public OClass getLinkedClass() {
    if (linkedClass == null && linkedClassName != null)
      linkedClass = owner.owner.getClass(linkedClassName);
    return linkedClass;
  }
901817
public ClassLoader getClassLoader() throws UnableToAdaptException, MalformedURLException {
        lock.readLock().lock();
        try {
            if (classloader != null)
                return classloader;
        } finally {
            lock.readLock().unlock();
        }
        if (!rarFileExists())
            return null;
        lock.writeLock().lock();
        try {
            if (classloader == null) {
                classloader = createRarClassLoader();
            }
            return classloader;
        } finally {
            lock.writeLock().unlock();
        }
    }
366066
public static ClassLoader getClassLoader() {
		ClassLoader classLoader = getContextClassLoader();
		if (classLoader == null) {
			classLoader = ClassLoaderUtil.class.getClassLoader();
			if (null == classLoader) {
				classLoader = ClassLoader.getSystemClassLoader();
			}
		}
		return classLoader;
	}
294015
public static ClassLoader getDefaultClassLoader() {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader == null) {
            loader = ClassUtils.class.getClassLoader();
            if (loader == null) {
                loader = ClassLoader.getSystemClassLoader();
            }
        }
        return loader;
    }
330932
public static ClassLoader getThreadContextClassLoader()
    {
        Thread thread=Thread.currentThread();
        ClassLoader classLoader=thread.getContextClassLoader();
        
        return classLoader;
    }
310764
public static ClassLoader getContextClassLoader() {
        ClassLoader loader = null;
        try {
            loader = Thread.currentThread().getContextClassLoader();
        } catch (Throwable e) {
        }
        if (loader == null) {
            loader = ClassUtils.class.getClassLoader();
        }
        return loader;
    }
970628
public static Class getClass(String className, boolean initialize) throws ClassNotFoundException
    {
        return Class.forName(className, initialize, getClassLoader());
    }
488218
private static SerializerFactory getInstance() {
    if (instance == null) {
      String className = JacksonSerializerFactory.class.getName();
      try {
        className = System.getProperty(SERIALIZER_FACTORY_CLASS_NAME);
      } catch (Exception e) {
      }

      if (className != null) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        try {
          Class<?> clazz = loader.loadClass(className);
          instance = (SerializerFactory) clazz.newInstance();
        } catch (Exception e) {
          throw new IllegalArgumentException("Error instantiating serializer factory.");
        }
      } else {
        instance = new JacksonSerializerFactory();
      }
    }
    return instance;
  }
478902
public JClass getSuperClass()
  {
    Class cl = _class.getSuperclass();

    if (cl != null)
      return _loader.forName(cl.getName());
    else
      return null;
  }
626533
protected static Resources getDefaultResources() { // NOPMD it's thread save!
    if (SelectBoxWithIconInputWidget.defaultResource == null) {
      synchronized (Resources.class) {
        if (SelectBoxWithIconInputWidget.defaultResource == null) {
          SelectBoxWithIconInputWidget.defaultResource = GWT.create(Resources.class);
        }
      }
    }
    return SelectBoxWithIconInputWidget.defaultResource;
  }
1176129
public static final PhoneNumberServiceAsync getPhoneNumberService() { // NOPMD it's thread save!
    if (ServiceFactory.phoneNumberService == null) {
      synchronized (PhoneNumberServiceAsync.class) {
        if (ServiceFactory.phoneNumberService == null) {
          ServiceFactory.phoneNumberService = GWT.create(PhoneNumberServiceAsync.class);
        }
      }
      final PathDefinitionInterface pathDefinition = GWT.create(PathDefinitionInterface.class);
      ((RestServiceProxy) ServiceFactory.phoneNumberService)
          .setResource(new Resource(pathDefinition.getRestBasePath() + "/" + PhoneNumber.ROOT));
    }
    return ServiceFactory.phoneNumberService;
  }