Make GeneratedFileMarker an instance of JavadocElement

This commit is contained in:
Tony Torralba
2022-05-05 17:40:47 +02:00
committed by Ian Lynagh
parent 4f256d2958
commit 0e3db78eba

View File

@@ -51,9 +51,9 @@ library class MarkerCommentGeneratedFile extends GeneratedFile {
/**
* A marker comment that indicates that it is in a generated file.
*/
private class GeneratedFileMarker extends Top {
private class GeneratedFileMarker extends Top instanceof JavadocElement {
GeneratedFileMarker() {
exists(string msg | msg = this.(JavadocElement).getText() |
exists(string msg | msg = this.getText() |
msg.regexpMatch("(?i).*\\bGenerated By\\b.*\\bDo not edit\\b.*") or
msg.regexpMatch("(?i).*\\bThis (file|class|interface|art[ei]fact) (was|is|(has been)) (?:auto[ -]?)?gener(e?)ated.*") or
msg.regexpMatch("(?i).*\\bAny modifications to this file will be lost\\b.*") or