blob: 684c79b4c572d4435df690249e25b72370f65584 [file] [log] [blame]
// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.naming;
import com.android.tools.r8.errors.CompilationError;
import com.android.tools.r8.graph.DexField;
import com.android.tools.r8.graph.DexMethod;
import com.android.tools.r8.graph.DexType;
public class ProguardMapError extends CompilationError {
private ProguardMapError(String message) {
super(message);
}
private ProguardMapError(String message, Throwable cause) {
super(message, cause);
}
static ProguardMapError keptTypeWasRenamed(DexType type, String keptName, String rename) {
return new ProguardMapError(
type + createMessageForConflict(keptName, rename));
}
static ProguardMapError keptMethodWasRenamed(DexMethod method, String keptName, String rename) {
return new ProguardMapError(
method.toSourceString() + createMessageForConflict(keptName, rename));
}
static ProguardMapError keptFieldWasRenamed(DexField field, String keptName, String rename) {
return new ProguardMapError(
field.toSourceString() + createMessageForConflict(keptName, rename));
}
private static String createMessageForConflict(String keptName, String rename) {
return " is not being kept as " + keptName + ", but remapped to " + rename;
}
}