Following static analysis of the ome-model source tree, the following remediation of the xsd-fu Java templates has been performed:
OME Model Object template:
Removal of unnecessary casts
Removal of unused variables
Special-casing of String and numeric type member usage to remove unnecessary use of toString and valueOf
Removal of special-cases which are never used
Suppression of warnings for methods which are unused [within this source tree; many are used externally]
OME Model Enums and Handlers templates:
Correction of double-assignment of units
Suppression of unused method warnings [within this source tree; many are used externally]
OME Model Object and Enums templates:
Use <> for generics where the type can be inferred
Removal of unused imports
MetadataStore and MetadataRetrieve class templates:
Addition of missing final qualifiers
Javadoc comment fixes
Use of new-style enhanced for loops
Removal of unnecessary casts
Correct usage of lastIndexOf to not use length
Total static analysis warnings fixed: 9042 (12303 before, 3261 after)
Testing:
The refactoring should not result in any behavioural changes. All unit tests and integration tests should continue to pass. There should be no compatibility changes for downstream consumers.
Generated source changes may be downloaded from here or you can generate the diff yourself.
If you would prefer to review these changes in a more fine-grained way, it can be split out into multiple PRs without any trouble. None of the commits depend upon each other, so can be freely cherry-picked.
Following static analysis of the ome-model source tree, the following remediation of the xsd-fu Java templates has been performed:
OME Model Object template:
String
and numeric type member usage to remove unnecessary use oftoString
andvalueOf
OME Model Enums and Handlers templates:
OME Model Object and Enums templates:
<>
for generics where the type can be inferredMetadataStore and MetadataRetrieve class templates:
final
qualifiersfor
loopslastIndexOf
to not use lengthTotal static analysis warnings fixed: 9042 (12303 before, 3261 after)
Testing:
The refactoring should not result in any behavioural changes. All unit tests and integration tests should continue to pass. There should be no compatibility changes for downstream consumers.
Generated source changes may be downloaded from here or you can generate the diff yourself.
Review of the changes is here.
If you would prefer to review these changes in a more fine-grained way, it can be split out into multiple PRs without any trouble. None of the commits depend upon each other, so can be freely cherry-picked.