Retain inner-class data on incremental compile

Ensure that metadata sourced from inner-types is not deleted when
performing an incremental compile. Prior to this commit, the source
type was searched using the `Outer$Inner` format. This is not supported
`Elements.getTypeElement` so we now convert the names to `Outer.Inner`.

Closes gh-10886
This commit is contained in:
Phillip Webb
2020-10-28 21:13:08 -07:00
parent 9b4ccf4ac6
commit cf09451ffb
2 changed files with 10 additions and 1 deletions

View File

@@ -111,7 +111,7 @@ public class MetadataCollector {
}
private boolean deletedInCurrentBuild(String sourceType) {
return this.processingEnvironment.getElementUtils().getTypeElement(sourceType) == null;
return this.processingEnvironment.getElementUtils().getTypeElement(sourceType.replace('$', '.')) == null;
}
private boolean processedInCurrentBuild(String sourceType) {