Clean up AndroidManifestProcessor.
MergeErrorException is not used.
Switched Function to lambda.
Removed unused dep on asm.
RELNOTES: None.
@@ -27,7 +27,6 @@ import com.android.manifmerger.MergingReport.MergedManifestKind;
import com.android.manifmerger.PlaceholderHandler;
import com.android.utils.Pair;
import com.android.utils.StdLogger;
-import com.google.common.base.Function;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -71,31 +70,14 @@ public class AndroidManifestProcessor {
private static final ImmutableMap<SystemProperty, String> SYSTEM_PROPERTY_NAMES =
Maps.toMap(
Arrays.asList(SystemProperty.values()),
- new Function<SystemProperty, String>() {
- @Override
- public String apply(SystemProperty property) {
+ property -> {
if (property == SystemProperty.PACKAGE) {
return "applicationId";
} else {
return property.toCamelCase();
}
- }
});
- /** Exception encapsulating the error report of a manifest merge operation. */
- public static final class MergeErrorException extends Exception {
- private final MergingReport report;
-
- private MergeErrorException(MergingReport report) {
- super(report.getReportString());
- this.report = report;
- }
-
- public MergingReport getMergingReport() {
- return report;
- }
- }
-
/** Creates a new processor with the appropriate logger. */
public static AndroidManifestProcessor with(StdLogger stdLogger) {
return new AndroidManifestProcessor(stdLogger);
@@ -218,8 +200,7 @@ public class AndroidManifestProcessor {
int versionCode,
String versionName,
MergedAndroidData primaryData,
- Path processedManifest)
- throws IOException {
+ Path processedManifest) {
ManifestMerger2.MergeType mergeType =
variantType == VariantType.DEFAULT
