@@ -355,8 +355,8 @@ private void buildOptionsClass() {
355
355
.addModifiers (Modifier .PUBLIC )
356
356
.addParameter (type .classIfGeneric ().listIfIterable ().javaType , name )
357
357
.addJavadoc ("Sets the $L option.\n " , name )
358
- .addJavadoc ("@param $L $L\n " , name , parseDocumentation (description ))
359
- .addJavadoc ("@return this Options instance.\n " )
358
+ .addJavadoc ("\n @param $L $L" , name , parseDocumentation (description ))
359
+ .addJavadoc ("\n @return this Options instance." )
360
360
.addCode ("this.$L = $L;\n return this;\n " , name , name )
361
361
.build ());
362
362
@@ -366,8 +366,8 @@ private void buildOptionsClass() {
366
366
.addModifiers (Modifier .PUBLIC )
367
367
.addParameter (type .classIfGeneric ().arrayIfIterable ().javaType , name )
368
368
.addJavadoc ("Sets the $L option.\n " , name )
369
- .addJavadoc ("@param $L $L\n " , name , parseDocumentation (description ))
370
- .addJavadoc ("@return this Options instance.\n " )
369
+ .addJavadoc ("\n @param $L $L" , name , parseDocumentation (description ))
370
+ .addJavadoc ("\n @return this Options instance." )
371
371
.addCode ("this.$L = $T.asList($L);\n return this;\n " , name , Arrays .class , name )
372
372
.varargs ()
373
373
.build ());
@@ -379,8 +379,8 @@ private void buildOptionsClass() {
379
379
.addModifiers (Modifier .PUBLIC )
380
380
.addParameter (type .classIfGeneric ().javaType , name )
381
381
.addJavadoc ("Sets the $L option.\n " , name )
382
- .addJavadoc ("@param $L $L\n " , name , parseDocumentation (description ))
383
- .addJavadoc ("@return this Options instance.\n " )
382
+ .addJavadoc ("\n @param $L $L" , name , parseDocumentation (description ))
383
+ .addJavadoc ("\n @return this Options instance." )
384
384
.addCode ("this.$L = $L;\n return this;\n " , name , name )
385
385
.build ());
386
386
}
@@ -458,7 +458,7 @@ private void buildFactoryMethods() {
458
458
459
459
factoryBuilder
460
460
.addParameter (ParameterSpec .builder (Names .Scope , "scope" ).build ());
461
- paramTags .put ("scope" , CodeBlock .of ("current scope\n " ));
461
+ paramTags .put ("scope" , CodeBlock .of ("current scope" ));
462
462
463
463
Set <TypeVariableName > typeVars = new LinkedHashSet <>(typeParams );
464
464
@@ -473,7 +473,7 @@ private void buildFactoryMethods() {
473
473
String name = getJavaName (input );
474
474
475
475
ParameterSpec .Builder param = ParameterSpec .builder (type .iterableIfIterable ().javaType , name );
476
- paramTags .put (name , CodeBlock .of ("$L\n " , parseDocumentation (argDef .getDescription ())));
476
+ paramTags .put (name , CodeBlock .of ("$L" , parseDocumentation (argDef .getDescription ())));
477
477
factoryBuilder .addParameter (param .build ());
478
478
479
479
typeVars .addAll (type .findGenerics ());
@@ -501,7 +501,7 @@ private void buildFactoryMethods() {
501
501
502
502
ParameterSpec .Builder builder = ParameterSpec
503
503
.builder (type .classIfGeneric ().listIfIterable ().javaType , getJavaName (attr ));
504
- paramTags .put (getJavaName (attr ), CodeBlock .of ("$L\n " , parseDocumentation (apiAttr .getDescription ())));
504
+ paramTags .put (getJavaName (attr ), CodeBlock .of ("$L" , parseDocumentation (apiAttr .getDescription ())));
505
505
506
506
typeVars .addAll (type .findGenerics ());
507
507
@@ -523,7 +523,7 @@ private void buildFactoryMethods() {
523
523
if (optionsClass != null ) {
524
524
factoryBuilder .addParameter (
525
525
ParameterSpec .builder (ArrayTypeName .of (ClassName .get (fullPackage , className , "Options" )), "options" ).build ());
526
- paramTags .put ("options" , CodeBlock .of ("$L" , "carries optional attribute values\n " ));
526
+ paramTags .put ("options" , CodeBlock .of ("$L" , "carries optional attribute values" ));
527
527
factoryBuilder .varargs ();
528
528
529
529
body .beginControlFlow ("if (options != null)" );
@@ -551,9 +551,9 @@ private void buildFactoryMethods() {
551
551
String description = doc .toString ();
552
552
if (description .isEmpty () || description .equals ("\n " )) {
553
553
factoryBuilder .addJavadoc (
554
- "@param $L $L " , param , String . format ( "the %s property" , param ) );
554
+ "\n @param $L the $L property " , param , param );
555
555
} else {
556
- factoryBuilder .addJavadoc ("@param $L $L" , param , doc );
556
+ factoryBuilder .addJavadoc ("\n @param $L $L" , param , doc );
557
557
}
558
558
});
559
559
for (TypeVariableName typeVar : typeVars ) {
@@ -562,7 +562,7 @@ private void buildFactoryMethods() {
562
562
+ typeVar .name
563
563
+ "> data type for {@code "
564
564
+ op .getName ()
565
- + "} output and operands\n " );
565
+ + "} output and operands" );
566
566
}
567
567
568
568
factoryBuilder .addTypeVariables (typeVars );
@@ -609,7 +609,7 @@ private void buildSecondaryFactory(Map<AttrDef, TypeName> defaultTypes, Map<Stri
609
609
body .add ("$T.class" , defaultTypes .get (attr ));
610
610
} else {
611
611
factoryBuilder .addParameter (param );
612
- factoryBuilder .addJavadoc ("@param $L $L" , param .name , paramTags .get (param .name ));
612
+ factoryBuilder .addJavadoc ("\n @param $L $L" , param .name , paramTags .get (param .name ));
613
613
typeVars .addAll (new ResolvedType (param .type ).findGenerics ());
614
614
body .add ("$L" , param .name );
615
615
}
@@ -618,18 +618,19 @@ private void buildSecondaryFactory(Map<AttrDef, TypeName> defaultTypes, Map<Stri
618
618
619
619
body .add (");" );
620
620
621
- factoryBuilder .addJavadoc ("\n @return a new instance of $L, with default output types" , className );
622
- factoryBuilder .addCode (body .build ());
623
- factoryBuilder .addTypeVariables (typeVars );
624
621
for (TypeVariableName typeVar : typeVars ) {
625
622
factoryBuilder .addJavadoc (
626
623
"\n @param <"
627
624
+ typeVar .name
628
625
+ "> data type for {@code "
629
626
+ op .getName ()
630
- + "} output and operands\n " );
627
+ + "} output and operands" );
631
628
}
632
629
630
+ factoryBuilder .addJavadoc ("\n @return a new instance of $L, with default output types" , className );
631
+ factoryBuilder .addCode (body .build ());
632
+ factoryBuilder .addTypeVariables (typeVars );
633
+
633
634
builder .addMethod (factoryBuilder .build ());
634
635
}
635
636
@@ -648,7 +649,6 @@ private void buildGettersAndSetters() {
648
649
builder .addMethod (
649
650
MethodSpec .methodBuilder (method .name )
650
651
.addParameter (method .parameters .get (0 ))
651
- .addJavadoc ("Sets the $L property." , method .name )
652
652
.addJavadoc (method .javadoc )
653
653
.returns (ClassName .get (fullPackage , className , "Options" ))
654
654
.addModifiers (Modifier .PUBLIC , Modifier .STATIC )
@@ -666,7 +666,7 @@ private void buildGettersAndSetters() {
666
666
.returns (resolver .typeOf (output ).listIfIterable ().javaType )
667
667
.addJavadoc ("Gets $L.\n " , name )
668
668
.addJavadoc ("$L" , parseDocumentation (argDef .getDescription ()))
669
- .addJavadoc ("@return $L.\n " , name )
669
+ .addJavadoc ("\n @return $L." , name )
670
670
.addCode ("return $L;" , name )
671
671
.build ());
672
672
}
0 commit comments