Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Oct 11, 2011
1 parent 89b2aa1 commit f54ddf7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
Expand Up @@ -26,7 +26,6 @@
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;
Expand Down
Expand Up @@ -153,7 +153,8 @@ public PersistentPropertyPath<T> getExtensionForBaseOf(PersistentPropertyPath<T>
List<T> properties = new ArrayList<T>();
Iterator<T> iterator = iterator();

for (@SuppressWarnings("unused") T candidate : base) {
for (@SuppressWarnings("unused")
T candidate : base) {
iterator.next();
}

Expand All @@ -164,13 +165,26 @@ public PersistentPropertyPath<T> getExtensionForBaseOf(PersistentPropertyPath<T>
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()
Expand Down Expand Up @@ -208,12 +222,8 @@ public int hashCode() {
return properties.hashCode();
}

@Override
public String toString() {
return toDotPath();
}

public int getLength() {
return properties.size();
}
@Override
public String toString() {
return toDotPath();
}
}

0 comments on commit f54ddf7

Please sign in to comment.