File tree Expand file tree Collapse file tree
main/java/graphql/execution
instrumentation/dataloader
test/groovy/graphql/execution/instrumentation/dataloader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ public List<DeferredExecution> getDeferredExecutions() {
140140 }
141141
142142 /**
143- * TODO Javadoc
144- * @return
143+ * Returns true if this field is part of a deferred execution
144+ * @return true if this field is part of a deferred execution
145145 */
146146 @ ExperimentalApi
147147 public boolean isDeferred () {
Original file line number Diff line number Diff line change 1111public class LevelMap {
1212
1313 // A reasonable default that guarantees no additional allocations for most use cases.
14- private static final int DEFAULT_INITIAL_SIZE = 8 ;
14+ private static final int DEFAULT_INITIAL_SIZE = 16 ;
1515
1616 // this array is mutable in both size and contents.
1717 private int [] countsByLevel ;
@@ -54,14 +54,13 @@ private void maybeResize(int level) {
5454
5555 @ Override
5656 public String toString () {
57- return Arrays .toString (this .countsByLevel );
58- // StringBuilder result = new StringBuilder();
59- // result.append("IntMap[");
60- // for (int i = 0; i < countsByLevel.length; i++) {
61- // result.append("level=").append(i).append(",count=").append(countsByLevel[i]).append(" ");
62- // }
63- // result.append("]");
64- // return result.toString();
57+ StringBuilder result = new StringBuilder ();
58+ result .append ("IntMap[" );
59+ for (int i = 0 ; i < countsByLevel .length ; i ++) {
60+ result .append ("level=" ).append (i ).append (",count=" ).append (countsByLevel [i ]).append (" " );
61+ }
62+ result .append ("]" );
63+ return result .toString ();
6564 }
6665
6766 public String toString (int level ) {
Original file line number Diff line number Diff line change @@ -83,10 +83,6 @@ class DeferWithDataLoaderTest extends Specification {
8383 then :
8484 combined. errors == null
8585 combined. data == expectedData
86-
87- // With deferred results, we don't achieve the same efficiency.
88- // batchCompareDataFetchers.departmentsForShopsBatchLoaderCounter.get() == 3
89- // batchCompareDataFetchers.productsForDepartmentsBatchLoaderCounter.get() == 3
9086 }
9187
9288 def " multiple fields on same defer block" () {
You can’t perform that action at this time.
0 commit comments