@@ -233,15 +233,28 @@ class InvalidFormatString extends StringLiteral {
233
233
}
234
234
}
235
235
236
+ /**
237
+ * A method call to a method that parses a format string, for example a call
238
+ * to `string.Format()`.
239
+ */
240
+ abstract private class FormatStringParseCallImpl extends MethodCall {
241
+ /**
242
+ * Gets the expression used as the format string.
243
+ */
244
+ abstract Expr getFormatExpr ( ) ;
245
+ }
246
+
247
+ final class FormatStringParseCall = FormatStringParseCallImpl ;
248
+
236
249
/**
237
250
* A method call to a method that formats a string, for example a call
238
251
* to `string.Format()`.
239
252
*/
240
- class FormatCall extends MethodCall {
253
+ class FormatCall extends FormatStringParseCallImpl {
241
254
FormatCall ( ) { this .getTarget ( ) instanceof FormatMethod }
242
255
243
256
/** Gets the expression used as the format string. */
244
- Expr getFormatExpr ( ) { result = this .getArgument ( this .getFormatArgument ( ) ) }
257
+ override Expr getFormatExpr ( ) { result = this .getArgument ( this .getFormatArgument ( ) ) }
245
258
246
259
/** Gets the argument number containing the format string. */
247
260
int getFormatArgument ( ) { result = this .getTarget ( ) .( FormatMethod ) .getFormatArgument ( ) }
@@ -290,23 +303,6 @@ class FormatCall extends MethodCall {
290
303
}
291
304
}
292
305
293
- /**
294
- * A method call to a method that parses a format string, for example a call
295
- * to `string.Format()`.
296
- */
297
- abstract private class FormatStringParseCallImpl extends MethodCall {
298
- /**
299
- * Gets the expression used as the format string.
300
- */
301
- abstract Expr getFormatExpr ( ) ;
302
- }
303
-
304
- final class FormatStringParseCall = FormatStringParseCallImpl ;
305
-
306
- private class OrdinaryFormatCall extends FormatStringParseCallImpl instanceof FormatCall {
307
- override Expr getFormatExpr ( ) { result = FormatCall .super .getFormatExpr ( ) }
308
- }
309
-
310
306
/**
311
307
* A method call to `System.Text.CompositeFormat.Parse`.
312
308
*/
0 commit comments