Skip to content

Commit 62d1bf7

Browse files
nick-someoneError Prone Team
authored andcommitted
Internal refactoring.
PiperOrigin-RevId: 373634042
1 parent 5913d86 commit 62d1bf7

File tree

1 file changed

+10
-10
lines changed
  • core/src/main/java/com/google/errorprone/bugpatterns/inlineme

1 file changed

+10
-10
lines changed

core/src/main/java/com/google/errorprone/bugpatterns/inlineme/Inliner.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,7 @@ private Description match(
245245
}
246246

247247
private Description describe(Tree tree, SuggestedFix fix, Api api) {
248-
return buildDescription(tree)
249-
.setMessage(
250-
api.shortName()
251-
+ " is deprecated and should be inlined"
252-
)
253-
.addFix(fix)
254-
.build();
248+
return buildDescription(tree).setMessage(api.deprecationMessage()).addFix(fix).build();
255249
}
256250

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

272266
abstract boolean isConstructor();
273267

268+
final String deprecationMessage() {
269+
return shortName()
270+
+ " is deprecated and should be inlined"
271+
;
272+
}
273+
274274
/** Returns {@code FullyQualifiedClassName#methodName}. */
275-
String methodId() {
275+
final String methodId() {
276276
return String.format("%s#%s", className(), methodName());
277277
}
278278

279279
/**
280280
* Returns a short, human readable description of this API (e.g., {@code
281281
* ClassName.methodName()}).
282282
*/
283-
String shortName() {
283+
final String shortName() {
284284
return String.format("%s.%s()", simpleClassName(), methodName());
285285
}
286286

287287
/** Returns the simple class name (e.g., {@code ClassName}). */
288-
String simpleClassName() {
288+
final String simpleClassName() {
289289
return Iterables.getLast(CLASS_NAME_SPLITTER.split(className()));
290290
}
291291
}

0 commit comments

Comments
 (0)