@@ -46,17 +46,24 @@ abstract class GeneratedFile extends File { }
4646 */
4747library class MarkerCommentGeneratedFile extends GeneratedFile {
4848 MarkerCommentGeneratedFile ( ) {
49- exists ( JavadocElement t | t .getFile ( ) = this |
50- exists ( string msg | msg = t .getText ( ) |
51- msg .regexpMatch ( "(?i).*\\bGenerated By\\b.*\\bDo not edit\\b.*" ) or
52- msg .regexpMatch ( "(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is|(has been)) (?:auto[ -]?)?gener(e?)ated.*" ) or
53- msg .regexpMatch ( "(?i).*\\bAny modifications to this file will be lost\\b.*" ) or
54- msg .regexpMatch ( "(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is) (?:mechanically|automatically) generated\\b.*" ) or
55- msg .regexpMatch ( "(?i).*\\bThe following code was (?:auto[ -]?)?generated (?:by|from)\\b.*" ) or
56- msg .regexpMatch ( "(?i).*\\bAutogenerated by Thrift.*" ) or
57- msg .regexpMatch ( "(?i).*\\bGenerated By.*JavaCC.*" ) or
58- msg .regexpMatch ( "(?i).*\\bGenerated from .* by ANTLR.*" )
59- )
49+ any ( GeneratedFileMarker t ) .getFile ( ) = this
50+ }
51+ }
52+
53+ /**
54+ * A marker comment that indicates that it is in a generated file.
55+ */
56+ private class GeneratedFileMarker extends Top {
57+ GeneratedFileMarker ( ) {
58+ exists ( string msg | msg = this .( JavadocElement ) .getText ( ) |
59+ msg .regexpMatch ( "(?i).*\\bGenerated By\\b.*\\bDo not edit\\b.*" ) or
60+ msg .regexpMatch ( "(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is|(has been)) (?:auto[ -]?)?gener(e?)ated.*" ) or
61+ msg .regexpMatch ( "(?i).*\\bAny modifications to this file will be lost\\b.*" ) or
62+ msg .regexpMatch ( "(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is) (?:mechanically|automatically) generated\\b.*" ) or
63+ msg .regexpMatch ( "(?i).*\\bThe following code was (?:auto[ -]?)?generated (?:by|from)\\b.*" ) or
64+ msg .regexpMatch ( "(?i).*\\bAutogenerated by Thrift.*" ) or
65+ msg .regexpMatch ( "(?i).*\\bGenerated By.*JavaCC.*" ) or
66+ msg .regexpMatch ( "(?i).*\\bGenerated from .* by ANTLR.*" )
6067 )
6168 }
6269}
0 commit comments