Skip to content

Commit

Permalink
Remove spurious leading space from AutoValue_Foo generated source.
Browse files Browse the repository at this point in the history
Closes #623
Fixes #622

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192124429
  • Loading branch information
Sathawale27 authored and ronshapiro committed Apr 9, 2018
1 parent 98385e3 commit c4bfbef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ void processType(TypeElement type) {
String subclass = generatedSubclassName(type, subclassDepth);
vars.subclass = TypeSimplifier.simpleNameOf(subclass);
vars.isFinal = (subclassDepth == 0);
vars.modifiers = vars.isFinal ? "final " : "abstract ";

String text = vars.toText();
text = TypeEncoder.decode(text, processingEnv, vars.pkg, type.asType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ class AutoValueTemplateVars extends AutoValueOrOneOfTemplateVars {
*/
Boolean isFinal = false;

/**
* The modifiers (for example {@code final} or {@code abstract}) for the generated subclass,
* followed by a space if they are not empty.
*/
String modifiers;

/**
* The name of the builder type as it should appear in source code, or empty if there is no
* builder type. If class {@code Address} contains {@code @AutoValue.Builder} class Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $a
#else
// Generated by com.google.auto.value.processor.AutoValueProcessor
#end
#if ($isFinal) final #else abstract #end class $subclass$formalTypes extends $origClass$actualTypes {
${modifiers}class $subclass$formalTypes extends $origClass$actualTypes {

## Fields

Expand Down

0 comments on commit c4bfbef

Please sign in to comment.