refactor: clean up style and redundancy #3232
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are still plenty of inconsistencies, clearly showing that different people wrote certain parts of code, but this should trim down quite some of them.
Highlights:
ApkBuilder
were written like static methods by needlessly taking already-accessible instance fields as methods arguments.hasManifest
,hasResources
,hasSources
andhasMultipleSources
were moved toApkInfo
by having it accept anExtFile
instance that's saved tomApkFile
in order to make these methods accessible across multiple classes without having to repeat them. Point to mention:mApkFile
is not set if theApkInfo
was parsed from a stream (rather than a file), which is only used in tests usinggetResourceAsStream
and not in actual source code, so it's not an issue. Another note: themApkFile
field is marked astransient
just for compat purposes, it's not really necessary since you're now doing manual YAML serialization, so that field won't interfere either with or without that keyword,java.io
andjava.util
were more verbose than necessary. Those are easily recognizable and don't really need special mentioning. Either we make them explicitly listed across the whole project, or implicitly used with a wildcard - I chose the second option, it's just cleaner.throws
lists in certain method signatures appear on a new line despite the signature being rather short.