45
45
46
46
import static java .lang .String .format ;
47
47
import static java .util .Collections .emptyList ;
48
- import static java .util .Collections .unmodifiableMap ;
49
- import static org .neo4j .driver .internal .ParameterSupport .NO_PARAMETERS ;
48
+
50
49
import static org .neo4j .driver .v1 .Records .recordAsIs ;
51
50
52
51
public class InternalResultCursor extends InternalRecordAccessor implements ResultCursor
@@ -68,12 +67,13 @@ public class InternalResultCursor extends InternalRecordAccessor implements Resu
68
67
public InternalResultCursor ( Connection connection , String statement , Map <String , Value > parameters )
69
68
{
70
69
this .connection = connection ;
70
+ this .runResponseCollector = newRunResponseCollector ();
71
+ this .pullAllResponseCollector = newPullAllResponseCollector ( new Statement ( statement , parameters ) );
72
+ }
71
73
72
- Map <String , Value > unmodifiableParameters =
73
- (parameters == null ) || (parameters .isEmpty ()) ? NO_PARAMETERS : unmodifiableMap ( parameters );
74
- final SummaryBuilder summaryBuilder = new SummaryBuilder ( new Statement ( statement , unmodifiableParameters ) );
75
-
76
- this .runResponseCollector = new StreamCollector ()
74
+ private StreamCollector newRunResponseCollector ()
75
+ {
76
+ return new StreamCollector ()
77
77
{
78
78
@ Override
79
79
public void keys ( String [] names )
@@ -108,7 +108,12 @@ public void done()
108
108
}
109
109
}
110
110
};
111
- this .pullAllResponseCollector = new StreamCollector ()
111
+ }
112
+
113
+ private StreamCollector newPullAllResponseCollector ( Statement statement )
114
+ {
115
+ final SummaryBuilder summaryBuilder = new SummaryBuilder ( statement );
116
+ return new StreamCollector ()
112
117
{
113
118
@ Override
114
119
public void keys ( String [] names ) {}
0 commit comments