Skip to content

Commit

Permalink
Internal refactoring.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 373634042
  • Loading branch information
nick-someone authored and Error Prone Team committed May 13, 2021
1 parent 5913d86 commit 62d1bf7
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,7 @@ private Description match(
}

private Description describe(Tree tree, SuggestedFix fix, Api api) {
return buildDescription(tree)
.setMessage(
api.shortName()
+ " is deprecated and should be inlined"
)
.addFix(fix)
.build();
return buildDescription(tree).setMessage(api.deprecationMessage()).addFix(fix).build();
}

@AutoValue
Expand All @@ -271,21 +265,27 @@ static Api create(MethodSymbol method) {

abstract boolean isConstructor();

final String deprecationMessage() {
return shortName()
+ " is deprecated and should be inlined"
;
}

/** Returns {@code FullyQualifiedClassName#methodName}. */
String methodId() {
final String methodId() {
return String.format("%s#%s", className(), methodName());
}

/**
* Returns a short, human readable description of this API (e.g., {@code
* ClassName.methodName()}).
*/
String shortName() {
final String shortName() {
return String.format("%s.%s()", simpleClassName(), methodName());
}

/** Returns the simple class name (e.g., {@code ClassName}). */
String simpleClassName() {
final String simpleClassName() {
return Iterables.getLast(CLASS_NAME_SPLITTER.split(className()));
}
}
Expand Down

0 comments on commit 62d1bf7

Please sign in to comment.