Revert PathMetadataFactory change

This commit is contained in:
Timo Westkämper 2014-12-07 23:03:03 +02:00
parent eb60a83372
commit e90c2f48a6
2 changed files with 1 additions and 12 deletions

View File

@ -61,21 +61,10 @@ public final class PathMetadataFactory {
* @param delegate
* @return
*/
@Deprecated
public static <T> PathMetadata<T> forDelegate(Path<T> delegate) {
return new PathMetadata<T>(delegate, delegate, PathType.DELEGATE);
}
/**
* Create a new PathMetadata for delegate access
*
* @param delegate
* @return
*/
public static <T> PathMetadata<T> forDelegate(Expression<T> delegate) {
return new PathMetadata<T>(null, delegate, PathType.DELEGATE);
}
/**
* Create a new PathMetadata for indexed list access
*

View File

@ -73,7 +73,7 @@ public final class ValidatingVisitor implements Visitor<Set<Expression<?>>, Set<
@Override
public Set<Expression<?>> visit(Path<?> expr, Set<Expression<?>> known) {
if (!known.contains(expr.getRoot()) && expr.getMetadata().getPathType() != PathType.DELEGATE) {
if (!known.contains(expr.getRoot())) {
throw new IllegalArgumentException(String.format(errorTemplate, expr.getRoot()));
}
return known;