Simplify the variable declaration and corresponding codegen bit
by relying on local variable type inference.
Change-Id: I3976b20ce5acbce66b1057bb3e374e18aaef3155
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a133b671c53ec3d5a6831f628940ec24e32ca734)
«ENDFOR»
'''
- override protected generateCopyAugmentation(Type implType) {
- val hashMapRef = JU_HASHMAP.importedName
- val augmentTypeRef = augmentType.importedName
- return '''
- «JU_MAP.importedName»<«CLASS.importedName»<? extends «augmentTypeRef»>, «augmentTypeRef»> aug = base.augmentations();
- if (!aug.isEmpty()) {
- this.«AUGMENTATION_FIELD» = new «hashMapRef»<>(aug);
- }
- '''
- }
+ override protected generateCopyAugmentation(Type implType) '''
+ final var aug = base.augmentations();
+ if (!aug.isEmpty()) {
+ this.«AUGMENTATION_FIELD» = new «JU_HASHMAP.importedName»<>(aug);
+ }
+ '''
}