File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
main/java/io/jbock/simple/processor/writing
test/java/io/jbock/simple/processor Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -92,14 +92,18 @@ TypeSpec generate() {
9292 }
9393 spec .addAnnotation (AnnotationSpec .builder (Generated .class )
9494 .addMember ("value" , CodeBlock .of ("$S" , SimpleComponentProcessor .class .getCanonicalName ()))
95- .addMember ("comments" , CodeBlock .of ("$S" , "https://github.com/jbock-java/simple-component " +
96- Objects .toString (getClass ().getPackage ().getImplementationVersion (), "" )))
95+ .addMember ("comments" , CodeBlock .of ("$S" , getComments ()))
9796 .build ());
9897 spec .addMethod (generateAllParametersConstructor ());
9998 spec .addOriginatingElement (component .element ());
10099 return spec .build ();
101100 }
102101
102+ private String getComments () {
103+ String version = Objects .toString (getClass ().getPackage ().getImplementationVersion (), "" );
104+ return "https://github.com/jbock-java/simple-component" + (version .isEmpty () ? "" : " " + version );
105+ }
106+
103107 private MethodSpec generateFactoryMethod (FactoryElement factory ) {
104108 MethodSpec .Builder spec = MethodSpec .methodBuilder (FACTORY_METHOD )
105109 .addModifiers (STATIC )
Original file line number Diff line number Diff line change @@ -127,7 +127,6 @@ void builderParameterIdentity() {
127127 "}" );
128128 }
129129
130-
131130 @ Test
132131 void builderParameter () {
133132 JavaFileObject component = forSourceLines ("test.TestClass" ,
You can’t perform that action at this time.
0 commit comments