public static Function<ClassPathRoot, ClassPathRoot> toCachingRoot() { return a -> { // ugly hack to determine where caching will be useful if (a instanceof IOHeavyRoot ) { return new NameCachingRoot(a); } return a; }; }
private static List<ClassPathRoot> wrapToAvoidIOOperations( List<ClassPathRoot> roots) { return FCollection.map(roots, NameCachingRoot.toCachingRoot()); }
@Override public InputStream getData(String name) throws IOException { final Collection<String> names = classNames(); if (!names.contains(ClassName.fromString(name).asJavaName())) { return null; } return this.child.getData(name); }
@Override public InputStream getData(String name) throws IOException { final Collection<String> names = classNames(); if (!names.contains(ClassName.fromString(name).asJavaName())) { return null; } return this.child.getData(name); }
private static List<ClassPathRoot> wrapToAvoidIOOperations( List<ClassPathRoot> roots) { return FCollection.map(roots, NameCachingRoot.toCachingRoot()); }
public static Function<ClassPathRoot, ClassPathRoot> toCachingRoot() { return a -> { // ugly hack to determine where caching will be useful if (a instanceof IOHeavyRoot ) { return new NameCachingRoot(a); } return a; }; }