@@ -233,15 +233,28 @@ class InvalidFormatString extends StringLiteral {
233233 }
234234}
235235
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+
236249/**
237250 * A method call to a method that formats a string, for example a call
238251 * to `string.Format()`.
239252 */
240- class FormatCall extends MethodCall {
253+ class FormatCall extends FormatStringParseCallImpl {
241254 FormatCall ( ) { this .getTarget ( ) instanceof FormatMethod }
242255
243256 /** 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 ( ) ) }
245258
246259 /** Gets the argument number containing the format string. */
247260 int getFormatArgument ( ) { result = this .getTarget ( ) .( FormatMethod ) .getFormatArgument ( ) }
@@ -290,23 +303,6 @@ class FormatCall extends MethodCall {
290303 }
291304}
292305
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-
310306/**
311307 * A method call to `System.Text.CompositeFormat.Parse`.
312308 */
0 commit comments