@@ -355,8 +355,8 @@ private void buildOptionsClass() {
355355 .addModifiers (Modifier .PUBLIC )
356356 .addParameter (type .classIfGeneric ().listIfIterable ().javaType , name )
357357 .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." )
360360 .addCode ("this.$L = $L;\n return this;\n " , name , name )
361361 .build ());
362362
@@ -366,8 +366,8 @@ private void buildOptionsClass() {
366366 .addModifiers (Modifier .PUBLIC )
367367 .addParameter (type .classIfGeneric ().arrayIfIterable ().javaType , name )
368368 .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." )
371371 .addCode ("this.$L = $T.asList($L);\n return this;\n " , name , Arrays .class , name )
372372 .varargs ()
373373 .build ());
@@ -379,8 +379,8 @@ private void buildOptionsClass() {
379379 .addModifiers (Modifier .PUBLIC )
380380 .addParameter (type .classIfGeneric ().javaType , name )
381381 .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." )
384384 .addCode ("this.$L = $L;\n return this;\n " , name , name )
385385 .build ());
386386 }
@@ -458,7 +458,7 @@ private void buildFactoryMethods() {
458458
459459 factoryBuilder
460460 .addParameter (ParameterSpec .builder (Names .Scope , "scope" ).build ());
461- paramTags .put ("scope" , CodeBlock .of ("current scope\n " ));
461+ paramTags .put ("scope" , CodeBlock .of ("current scope" ));
462462
463463 Set <TypeVariableName > typeVars = new LinkedHashSet <>(typeParams );
464464
@@ -473,7 +473,7 @@ private void buildFactoryMethods() {
473473 String name = getJavaName (input );
474474
475475 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 ())));
477477 factoryBuilder .addParameter (param .build ());
478478
479479 typeVars .addAll (type .findGenerics ());
@@ -501,7 +501,7 @@ private void buildFactoryMethods() {
501501
502502 ParameterSpec .Builder builder = ParameterSpec
503503 .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 ())));
505505
506506 typeVars .addAll (type .findGenerics ());
507507
@@ -523,7 +523,7 @@ private void buildFactoryMethods() {
523523 if (optionsClass != null ) {
524524 factoryBuilder .addParameter (
525525 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" ));
527527 factoryBuilder .varargs ();
528528
529529 body .beginControlFlow ("if (options != null)" );
@@ -551,9 +551,9 @@ private void buildFactoryMethods() {
551551 String description = doc .toString ();
552552 if (description .isEmpty () || description .equals ("\n " )) {
553553 factoryBuilder .addJavadoc (
554- "@param $L $L " , param , String . format ( "the %s property" , param ) );
554+ "\n @param $L the $L property " , param , param );
555555 } else {
556- factoryBuilder .addJavadoc ("@param $L $L" , param , doc );
556+ factoryBuilder .addJavadoc ("\n @param $L $L" , param , doc );
557557 }
558558 });
559559 for (TypeVariableName typeVar : typeVars ) {
@@ -562,7 +562,7 @@ private void buildFactoryMethods() {
562562 + typeVar .name
563563 + "> data type for {@code "
564564 + op .getName ()
565- + "} output and operands\n " );
565+ + "} output and operands" );
566566 }
567567
568568 factoryBuilder .addTypeVariables (typeVars );
@@ -609,7 +609,7 @@ private void buildSecondaryFactory(Map<AttrDef, TypeName> defaultTypes, Map<Stri
609609 body .add ("$T.class" , defaultTypes .get (attr ));
610610 } else {
611611 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 ));
613613 typeVars .addAll (new ResolvedType (param .type ).findGenerics ());
614614 body .add ("$L" , param .name );
615615 }
@@ -618,18 +618,19 @@ private void buildSecondaryFactory(Map<AttrDef, TypeName> defaultTypes, Map<Stri
618618
619619 body .add (");" );
620620
621- factoryBuilder .addJavadoc ("\n @return a new instance of $L, with default output types" , className );
622- factoryBuilder .addCode (body .build ());
623- factoryBuilder .addTypeVariables (typeVars );
624621 for (TypeVariableName typeVar : typeVars ) {
625622 factoryBuilder .addJavadoc (
626623 "\n @param <"
627624 + typeVar .name
628625 + "> data type for {@code "
629626 + op .getName ()
630- + "} output and operands\n " );
627+ + "} output and operands" );
631628 }
632629
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+
633634 builder .addMethod (factoryBuilder .build ());
634635 }
635636
@@ -648,7 +649,6 @@ private void buildGettersAndSetters() {
648649 builder .addMethod (
649650 MethodSpec .methodBuilder (method .name )
650651 .addParameter (method .parameters .get (0 ))
651- .addJavadoc ("Sets the $L property." , method .name )
652652 .addJavadoc (method .javadoc )
653653 .returns (ClassName .get (fullPackage , className , "Options" ))
654654 .addModifiers (Modifier .PUBLIC , Modifier .STATIC )
@@ -666,7 +666,7 @@ private void buildGettersAndSetters() {
666666 .returns (resolver .typeOf (output ).listIfIterable ().javaType )
667667 .addJavadoc ("Gets $L.\n " , name )
668668 .addJavadoc ("$L" , parseDocumentation (argDef .getDescription ()))
669- .addJavadoc ("@return $L.\n " , name )
669+ .addJavadoc ("\n @return $L." , name )
670670 .addCode ("return $L;" , name )
671671 .build ());
672672 }
0 commit comments