20
20
import com .googlecode .objectify .impl .translate .CollectionTranslatorFactory .CollectionListNodeTranslator ;
21
21
import com .googlecode .objectify .impl .translate .MapTranslatorFactory .MapMapNodeTranslator ;
22
22
import com .googlecode .objectify .repackaged .gentyref .GenericTypeReflector ;
23
+ import com .googlecode .objectify .util .LogUtils ;
23
24
24
25
25
26
/**
@@ -78,7 +79,7 @@ else if (translator instanceof MapMapNodeTranslator && actual.hasMap()) {
78
79
value = translator .load (actual , ctx );
79
80
}
80
81
81
- setOnPojo (onPojo , value , ctx );
82
+ setOnPojo (onPojo , value , ctx , node . getPath () );
82
83
}
83
84
catch (SkipException ex ) {
84
85
// No prob, skip this one
@@ -90,25 +91,30 @@ else if (translator instanceof MapMapNodeTranslator && actual.hasMap()) {
90
91
* Sets the property on the pojo to the value. However, sensitive to the value possibly being a Result<?>
91
92
* wrapper, in which case it enqueues the set operation until the loadcontext is done.
92
93
*/
93
- private void setOnPojo (final Object pojo , final Object value , LoadContext ctx ) {
94
+ private void setOnPojo (final Object pojo , final Object value , LoadContext ctx , final Path path ) {
94
95
if (value instanceof Result ) {
95
96
if (log .isLoggable (Level .FINEST ))
96
- log .finest ("Delaying set property " + property .getName ());
97
+ log .finest (LogUtils . msg ( path , "Delaying set property " + property .getName () ));
97
98
98
99
ctx .delay (new Runnable () {
99
100
@ Override
100
101
public void run () {
101
102
Object actualValue = ((Result <?>)value ).now ();
102
103
103
104
if (log .isLoggable (Level .FINEST ))
104
- log .finest ("Setting delayed property " + property .getName () + " to " + actualValue );
105
+ log .finest (LogUtils . msg ( path , "Setting delayed property " + property .getName () + " to " + actualValue ) );
105
106
106
107
property .set (pojo , actualValue );
107
108
}
109
+
110
+ @ Override
111
+ public String toString () {
112
+ return "(delayed Runnable to set " + property .getName () + ")" ;
113
+ }
108
114
});
109
115
} else {
110
116
if (log .isLoggable (Level .FINEST ))
111
- log .finest ("Setting property " + property .getName () + " to " + value );
117
+ log .finest (LogUtils . msg ( path , "Setting property " + property .getName () + " to " + value ) );
112
118
113
119
property .set (pojo , value );
114
120
}
@@ -220,7 +226,7 @@ public Translator<T> create(final Path path, final Annotation[] fieldAnnotations
220
226
@ Override
221
227
protected T loadMap (Node node , LoadContext ctx ) {
222
228
if (log .isLoggable (Level .FINEST ))
223
- log .finest ("Instantiating a " + clazz .getName ());
229
+ log .finest (LogUtils . msg ( node . getPath (), "Instantiating a " + clazz .getName () ));
224
230
225
231
T pojo = fact .construct (clazz );
226
232
0 commit comments