GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add MethodAccessSystemGetProperty predicate by JLLeitschuh · Pull Request #4898 · github/codeql

Conversation

@JLLeitschuh

@JLLeitschuh JLLeitschuh commented Jan 2, 2021

Copy link
Copy Markdown
Contributor

This simple predicate looks for calls to System.getProperty with a compile time constant.

This pattern is pretty common. As an example: https://lgtm.com/query/1737527738205752665/

This PR is a dependency for both #4388 & #4473

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JLLeitschuh
Add MethodAccessSystemGetProperty predicate
54950c2
@JLLeitschuh
JLLeitschuh requested a review from a team as a code owner January 2, 2021 01:26
@github-actions github-actions Bot added the Java label Jan 2, 2021
smowton
smowton reviewed Jan 4, 2021
View reviewed changes
Comment thread java/ql/src/semmle/code/java/PrintAst.ql Outdated
*/
override predicate shouldPrint(Element e, Location l) { super.shouldPrint(e, l) }
override predicate shouldPrint(Element e, Location l) { super.shouldPrint(e, l) and
not l.getFile().getBaseName().matches("SystemGetPropertyCall.java") }

@smowton smowton Jan 4, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Accidentally committed?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JLLeitschuh JLLeitschuh Jan 4, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nope, this is intentional. Do you want me to just update the test result?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aschackmull aschackmull Jan 4, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yes, please update the test result instead.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JLLeitschuh JLLeitschuh Jan 5, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This should be resolved now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java/ql/src/semmle/code/java/JDK.qll Outdated
MethodAccessSystemGetProperty() { getMethod() instanceof MethodSystemGetProperty }

/**
* Holds true if this is a compile-time constant call for the specified `propertyName`.

@smowton smowton Jan 4, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
* Holds true if this is a compile-time constant call for the specified `propertyName`.
* Holds true if this call gets a compile-time constant property `propertyName`.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JLLeitschuh JLLeitschuh Jan 4, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I believe this is resolved.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aschackmull
aschackmull reviewed Jan 4, 2021
View reviewed changes
Comment thread java/ql/src/semmle/code/java/JDK.qll Resolved

Uh oh!

There was an error while loading. Please reload this page.

aschackmull
aschackmull reviewed Jan 4, 2021
View reviewed changes
Comment thread java/ql/src/semmle/code/java/JDK.qll Resolved

Uh oh!

There was an error while loading. Please reload this page.

aschackmull
aschackmull reviewed Jan 4, 2021
View reviewed changes
Comment thread java/ql/test/library-tests/JDK/SystemGetPropertyCall.ql Resolved

Uh oh!

There was an error while loading. Please reload this page.

@smowton smowton self-assigned this Jan 4, 2021
JLLeitschuh and others added 2 commits January 4, 2021 10:13
@JLLeitschuh @aschackmull
Apply suggestions from code review
028e475
Co-authored-by: Anders Schack-Mulligen <[email protected]>
@JLLeitschuh
Update PrintAst.actual with new test output
ba4a562
@JLLeitschuh
JLLeitschuh force-pushed the feat/JLL/system_get_property branch from 99c0ef1 to ba4a562 Compare January 5, 2021 04:38
@JLLeitschuh

JLLeitschuh commented Jan 5, 2021

Copy link
Copy Markdown
Contributor Author

This should be ready for another review pass. 😄

Thanks for the quick turnarround on feedback!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aschackmull
aschackmull approved these changes Jan 5, 2021
View reviewed changes
@aschackmull
aschackmull merged commit 26a9ba4 into github:main Jan 5, 2021
@JLLeitschuh
JLLeitschuh deleted the feat/JLL/system_get_property branch January 5, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aschackmull aschackmull aschackmull approved these changes
+1 more reviewer
@smowton smowton smowton left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@smowton smowton

Labels

Java

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@JLLeitschuh @smowton @aschackmull
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.