Java Code Examples for groovy.lang.GroovyClassLoader#InnerLoader

The following examples show how to use groovy.lang.GroovyClassLoader#InnerLoader . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Verifier.java    From groovy with Apache License 2.0 6 votes vote down vote up
public static long getTimestamp(Class<?> clazz) {
    if (clazz.getClassLoader() instanceof GroovyClassLoader.InnerLoader) {
        GroovyClassLoader.InnerLoader innerLoader = (GroovyClassLoader.InnerLoader) clazz.getClassLoader();
        return innerLoader.getTimeStamp();
    }

    final Field[] fields = clazz.getFields();
    for (int i = 0; i != fields.length; ++i) {
        if (isStatic(fields[i].getModifiers())) {
            Long timestamp = getTimestampFromFieldName(fields[i].getName());
            if (timestamp != null) {
                return timestamp;
            }
        }
    }
    return Long.MAX_VALUE;
}
 
Example 2
Source File: DumpingClassLoader.java    From groovy with Apache License 2.0 4 votes vote down vote up
DebugCollector(GroovyClassLoader cl, CompilationUnit unit, SourceUnit su) {
    super(new GroovyClassLoader.InnerLoader(cl), unit, su);
}