Polishing.

This commit is contained in:
Oliver Gierke
2011-10-11 13:02:21 +02:00
parent 89b2aa162a
commit f54ddf7cb1
2 changed files with 26 additions and 17 deletions

View File

@@ -26,7 +26,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

View File

@@ -153,7 +153,8 @@ class DefaultPersistentPropertyPath<T extends PersistentProperty<T>> implements
List<T> properties = new ArrayList<T>();
Iterator<T> iterator = iterator();
for (@SuppressWarnings("unused") T candidate : base) {
for (@SuppressWarnings("unused")
T candidate : base) {
iterator.next();
}
@@ -164,13 +165,26 @@ class DefaultPersistentPropertyPath<T extends PersistentProperty<T>> implements
return new DefaultPersistentPropertyPath<T>(properties);
}
public PersistentPropertyPath<T> getParentPath() {
int size = properties.size();
if (size <= 1) {
return this;
}
return new DefaultPersistentPropertyPath<T>(properties.subList(0,size-1));
}
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getParentPath()
*/
public PersistentPropertyPath<T> getParentPath() {
int size = properties.size();
if (size <= 1) {
return this;
}
return new DefaultPersistentPropertyPath<T>(properties.subList(0, size - 1));
}
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.context.PersistentPropertyPath#getLength()
*/
public int getLength() {
return properties.size();
}
/*
* (non-Javadoc)
* @see java.lang.Iterable#iterator()
@@ -208,12 +222,8 @@ class DefaultPersistentPropertyPath<T extends PersistentProperty<T>> implements
return properties.hashCode();
}
@Override
public String toString() {
return toDotPath();
}
public int getLength() {
return properties.size();
}
@Override
public String toString() {
return toDotPath();
}
}