@@ -245,13 +245,7 @@ private Description match(
245
245
}
246
246
247
247
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 ();
255
249
}
256
250
257
251
@ AutoValue
@@ -271,21 +265,27 @@ static Api create(MethodSymbol method) {
271
265
272
266
abstract boolean isConstructor ();
273
267
268
+ final String deprecationMessage () {
269
+ return shortName ()
270
+ + " is deprecated and should be inlined"
271
+ ;
272
+ }
273
+
274
274
/** Returns {@code FullyQualifiedClassName#methodName}. */
275
- String methodId () {
275
+ final String methodId () {
276
276
return String .format ("%s#%s" , className (), methodName ());
277
277
}
278
278
279
279
/**
280
280
* Returns a short, human readable description of this API (e.g., {@code
281
281
* ClassName.methodName()}).
282
282
*/
283
- String shortName () {
283
+ final String shortName () {
284
284
return String .format ("%s.%s()" , simpleClassName (), methodName ());
285
285
}
286
286
287
287
/** Returns the simple class name (e.g., {@code ClassName}). */
288
- String simpleClassName () {
288
+ final String simpleClassName () {
289
289
return Iterables .getLast (CLASS_NAME_SPLITTER .split (className ()));
290
290
}
291
291
}
0 commit comments