@Override public Ordering<Element> enclosedBy(Element element) { if (element instanceof ElementImpl && Iterables.all(element.getEnclosedElements(), Predicates.instanceOf(ElementImpl.class))) { ElementImpl implementation = (ElementImpl) element; if (implementation._binding instanceof SourceTypeBinding) { SourceTypeBinding sourceBinding = (SourceTypeBinding) implementation._binding; return Ordering.natural().onResultOf( Functions.compose(bindingsToSourceOrder(sourceBinding), this)); } } return DEFAULT_PROVIDER.enclosedBy(element); }
private static OrderingProvider createProvider() { if (Compiler.ECJ.isPresent()) { return new EclipseCompilerOrderingProvider(); } return DEFAULT_PROVIDER; }