Fixed a bug in cloning that prevented a null from being usable
as a 'precloned' value. This made Spatial attempt to clone its parent.
This commit is contained in:
parent
008768f18c
commit
271f6492dd
@ -207,10 +207,10 @@ public class Cloner {
|
|||||||
|
|
||||||
// Check the index to see if we already have it
|
// Check the index to see if we already have it
|
||||||
Object clone = index.get(object);
|
Object clone = index.get(object);
|
||||||
if( clone != null ) {
|
if( clone != null || index.containsKey(object) ) {
|
||||||
if( log.isLoggable(Level.FINER) ) {
|
if( log.isLoggable(Level.FINER) ) {
|
||||||
log.finer("cloned:" + object.getClass() + "@" + System.identityHashCode(object)
|
log.finer("cloned:" + object.getClass() + "@" + System.identityHashCode(object)
|
||||||
+ " as cached:" + clone.getClass() + "@" + System.identityHashCode(clone));
|
+ " as cached:" + (clone == null ? "null" : (clone.getClass() + "@" + System.identityHashCode(clone))));
|
||||||
}
|
}
|
||||||
return type.cast(clone);
|
return type.cast(clone);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user