Singleton pattern

@return the instance for the context holder.
508430
public static synchronized ContextHolder getInstance() {

        if (INSTANCE == null) {
            Properties props = new Properties();
            try {
                props.load(new ClassPathResource("/cudafunctions.properties", ContextHolder.class.getClassLoader()).getInputStream());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

            INSTANCE = new ContextHolder();
            INSTANCE.configure();


            //set the properties to be accessible globally
            for (String pair : props.stringPropertyNames())
                System.getProperties().put(pair, props.getProperty(pair));


        }


        return INSTANCE;
    }
28024
public static FingerprintProperties getInstance() {
        if (instance == null) {
            synchronized (FingerprintProperties.class) {
                if (instance == null) {
                    instance = new FingerprintProperties();
                }
            }
        }
        return instance;
    }
1110585
public static ClassReader instance(Context context) {
        ClassReader instance = context.get(classReaderKey);
        if (instance == null)
            instance = new ClassReader(context, true);
        return instance;
    }
75312
public static Header getInstance() {
		if (INSTANCE == null) {
			INSTANCE = new Header();
			try {
				INSTANCE.load();
			} catch (Exception e) {
				INSTANCE.setHeader(new Properties());
			}
		}
		return INSTANCE;
	}
704285
public static Context getContext()
    {
        if (ctx == null)
        {
            try
            {
                setContext(null);
            }
            catch (Exception e)
            {
                log.error("Cannot instantiate the InitialContext", e);
                throw new OJBRuntimeException(e);
            }
        }
        return ctx;
    }
1223349
public static ParsingRuleRegistry getInstance() {
        if (null == instance) {
            synchronized (EncryptParsingRuleRegistry.class) {
                if (null == instance) {
                    instance = new EncryptParsingRuleRegistry();
                    instance.init();
                }
            }
        }
        return instance;
    }
1051126
public static synchronized DataUsageExtension instance() {
                if (SINGLETON == null) {
                        SINGLETON = new DataUsageExtension();
                        XFactory factory = XFactoryRegistry.instance().currentDefault();
                        ATTR_DATA = factory.createAttributeLiteral(KEY_DATA, "", SINGLETON);
                        SINGLETON.eventAttributes.add((XAttribute) ATTR_DATA.clone());
                        // register mapping aliases
                        for (Map.Entry<String, String> mapping : EXTENSION_DESCRIPTIONS.entrySet()) {
                                XGlobalAttributeNameMap.instance().registerMapping(mapping.getKey(), KEY_DATA, mapping.getValue());
                        }
                }
                return SINGLETON;
        }
521750
public static SystemUtil getInstance() {

    if (instance == null) {
      synchronized (SystemUtilImpl.class) {
        if (instance == null) {
          instance = new SystemUtilImpl();
        }
      }
    }
    return instance;
  }
563288
public static ClassLoader getContextClassLoader() {
        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
            @Override
            public ClassLoader run() {
                ClassLoader cl = null;
                try {
                    cl = Thread.currentThread().getContextClassLoader();
                } catch (final SecurityException ex) {
                    // fall through
                }
                return cl;
            }
        });
    }
282343
public static RequestContext get() {
        if (CURRENT_CONTEXT.get() == null) {
            synchronized (RequestContext.class) {
                if (CURRENT_CONTEXT.get() == null) {
                    createContext();
                }
            }
        }

        // ensure that RequestContextV1 is also initialized for this request
        RequestContextV1.get();

        return CURRENT_CONTEXT.get();
    }
1169949
public static TherianContext getInstance() {
        final TherianContext current = getCurrentInstance();
        if (current != null) {
            return current;
        }
        return Therian.standard().context();
    }
227156
public static ClassWriter instance(Context context) {
        ClassWriter instance = context.get(classWriterKey);
        if (instance == null)
            instance = new ClassWriter(context);
        return instance;
    }
318028
public static final Map<String, Object> getContext() {
        Map<String, Object> ctx = CTX_HOLDER.get();
        if (ctx == null) {
            return null;
        }
        return ctx;
    }
969231
public static final CThreadContext getInstance() {
		SoftReference ref = (SoftReference)CThreadContext.contextLocal
				.get(Thread.currentThread());
		CThreadContext context = null;
		if ((ref == null) || (ref.get() == null)) {
			context = new CThreadContext();
			ref = new SoftReference(context);
			CThreadContext.contextLocal.put(Thread.currentThread(), ref);
		} else {
			context = (CThreadContext)ref.get();
		}
		return context;
	}
25100
@Pure
	public static Object getContext() throws AndroidException {
		final Object ctx;
		synchronized (Android.class) {
			if (context == null) {
				throw new AndroidException();
			}
			ctx = context.get();
		}
		if (ctx == null) {
			throw new AndroidException();
		}
		return ctx;
	}
849136
public static Arguments instance(Context context) {
        Arguments instance = context.get(argsKey);
        if (instance == null) {
            instance = new Arguments(context);
        }
        return instance;
    }
838473
public static ParsingRuleRegistry getInstance() {
        if (null == instance) {
            synchronized (ShardingParsingRuleRegistry.class) {
                if (null == instance) {
                    instance = new ShardingParsingRuleRegistry();
                    instance.init();
                }
            }
        }
        return instance;
    }