Skip to content

Commit 9775907

Browse files
committed
Format code
1 parent a68e712 commit 9775907

File tree

2 files changed

+22
-25
lines changed
  • cdt-java-protocol-builder/src

2 files changed

+22
-25
lines changed

cdt-java-protocol-builder/src/main/java/com/github/kklisura/cdt/definition/builder/support/protocol/builder/TypesBuilder.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,14 @@ protected String addRefImportStatement(
503503
String arrayItemType = null;
504504

505505
if (isRefArrayItemType(arrayType.getItems())) {
506-
com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem refArrayItem = (com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem) arrayType.getItems();
507-
508-
arrayItemType = addRefImportStatement(importAwareBuilder, refArrayItem.getRef(),
509-
objectType,
510-
domain,
511-
domainTypeResolver);
506+
com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem
507+
refArrayItem =
508+
(com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem)
509+
arrayType.getItems();
510+
511+
arrayItemType =
512+
addRefImportStatement(
513+
importAwareBuilder, refArrayItem.getRef(), objectType, domain, domainTypeResolver);
512514
} else {
513515
arrayItemType = getArrayItemJavaType(arrayType.getItems());
514516
}
@@ -571,7 +573,8 @@ private static String getArrayItemJavaType(ArrayItem arrayItem) {
571573

572574
protected static boolean isRefArrayItemType(
573575
com.github.kklisura.cdt.protocol.definition.types.type.array.ArrayItem arrayItem) {
574-
return arrayItem instanceof com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem;
576+
return arrayItem
577+
instanceof com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem;
575578
}
576579

577580
protected static String getArrayItemJavaType(

cdt-java-protocol-builder/src/test/java/com/github/kklisura/cdt/definition/builder/support/protocol/builder/CommandBuilderTest.java

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,7 @@ public void testBuildCommandWithMethodWithArrayStringParam() {
402402
interfaceBuilder.setJavaDoc("Description");
403403

404404
Capture<List<MethodParam>> methodParamCapture = Capture.newInstance();
405-
interfaceBuilder.addMethod(
406-
eq("command"),
407-
anyString(),
408-
capture(methodParamCapture),
409-
eq(null));
405+
interfaceBuilder.addMethod(eq("command"), anyString(), capture(methodParamCapture), eq(null));
410406

411407
final ArrayType resolvedRefType = new ArrayType();
412408
resolvedRefType.setId("arrayRefType");
@@ -464,16 +460,14 @@ public void testBuildCommandWithMethodWithArrayRefParam() {
464460
interfaceBuilder.setJavaDoc("Description");
465461

466462
Capture<List<MethodParam>> methodParamCapture = Capture.newInstance();
467-
interfaceBuilder.addMethod(
468-
eq("command"),
469-
anyString(),
470-
capture(methodParamCapture),
471-
eq(null));
463+
interfaceBuilder.addMethod(eq("command"), anyString(), capture(methodParamCapture), eq(null));
472464

473465
final ArrayType resolvedRefType = new ArrayType();
474466
resolvedRefType.setId("arrayRefType");
475467

476-
final com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem refArrayItem = new com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem();
468+
final com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem
469+
refArrayItem =
470+
new com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem();
477471
refArrayItem.setRef("TestRefArrayItem");
478472
resolvedRefType.setItems(refArrayItem);
479473

@@ -531,23 +525,23 @@ public void testBuildCommandWithMethodWithDeepArrayRefParam() {
531525
interfaceBuilder.setJavaDoc("Description");
532526

533527
Capture<List<MethodParam>> methodParamCapture = Capture.newInstance();
534-
interfaceBuilder.addMethod(
535-
eq("command"),
536-
anyString(),
537-
capture(methodParamCapture),
538-
eq(null));
528+
interfaceBuilder.addMethod(eq("command"), anyString(), capture(methodParamCapture), eq(null));
539529

540530
final ArrayType resolvedRefType = new ArrayType();
541531
resolvedRefType.setId("arrayRefType");
542532

543-
final com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem refArrayItem = new com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem();
533+
final com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem
534+
refArrayItem =
535+
new com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem();
544536
refArrayItem.setRef("TestRefArrayItem");
545537
resolvedRefType.setItems(refArrayItem);
546538

547539
final ArrayType resolvedRefType2 = new ArrayType();
548540
resolvedRefType2.setId("arrayRefType2");
549541

550-
final com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem refArrayItem2 = new com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem();
542+
final com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem
543+
refArrayItem2 =
544+
new com.github.kklisura.cdt.protocol.definition.types.type.array.items.RefArrayItem();
551545
refArrayItem2.setRef("SomeOtherDomain.TestRefArrayItem2");
552546
resolvedRefType2.setItems(refArrayItem2);
553547

0 commit comments

Comments
 (0)