Fixed bug in Property.

This commit is contained in:
Oliver Gierke
2011-03-28 20:31:55 +02:00
parent 23ff75ee6e
commit c05bedce17
2 changed files with 9 additions and 2 deletions

View File

@@ -285,7 +285,7 @@ public class Property {
IllegalArgumentException exception = null;
try {
return new Property(source, type);
return new Property(source, type, addTail);
} catch (IllegalArgumentException e) {
exception = e;
}
@@ -299,7 +299,7 @@ public class Property {
String head = source.substring(0, position);
String tail = source.substring(position);
return new Property(head, type, tail + addTail);
return create(head, type, tail + addTail);
}
throw exception;

View File

@@ -123,6 +123,12 @@ public class PropertyUnitTests {
Property.from("userMapMame", Bar.class);
}
@Test
public void findsNested() {
Property from = Property.from("barUserName", Sample.class);
}
private class Foo {
@@ -146,6 +152,7 @@ public class PropertyUnitTests {
private String userName;
private FooBar user;
private Bar bar;
}
private class Sample2 {