Skip to content

Conversation

Marcono1234
Copy link
Contributor

Often queries check for a toString() method, however previously there was no built-in CodeQL class for this.
This pull request adds ToStringMethod to JDK.qll.

@Marcono1234 Marcono1234 requested a review from a team as a code owner April 8, 2021 19:38
@github-actions github-actions bot added the Java label Apr 8, 2021
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Apr 9, 2021
@github github deleted a comment Apr 9, 2021
@github github deleted a comment Apr 9, 2021
@Marcono1234 Marcono1234 force-pushed the marcono1234/toString-method branch from b88a650 to 9349e69 Compare April 10, 2021 02:01
Copy link
Contributor Author

@Marcono1234 Marcono1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force-pushed the changes to keep the Git history clean.
No rebasing was done so the diff between the commits only shows the relevant changes.

e = ma.getQualifier() and
toString.getName() = "toString" and
toString.getNumberOfParameters() = 0 and
not toString.isStatic()
Copy link
Contributor Author

@Marcono1234 Marcono1234 Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this check because it does not seem possible to declare a static toString() method.

@aschackmull aschackmull merged commit e003b04 into github:main Apr 12, 2021
@Marcono1234 Marcono1234 deleted the marcono1234/toString-method branch April 12, 2021 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants