Conversation
| import Stubs | ||
|
|
||
| /** Declarations used by source code. */ | ||
| class UsedInSource extends GeneratedDeclaration { |
There was a problem hiding this comment.
In C#, we're moving away from this minimal stub approach, which relies on the test input. Instead we're going to generate complete stubs of nuget packages. The stubbing API doesn't change, we're just using a different configuration: https://github.com/github/codeql/pull/5664/files#diff-fe12d2e3e080fe834b3b602ced8689b223d6785ee52c12b12268b413713e348a
Also, generating stubs for packages without extra filtering on types might help identify constructs that are not handled by the current stubbing implementation.
There was a problem hiding this comment.
we're going to generate complete stubs of [...] packages
Definitely worth considering in the future, but this is currently not supported by the Java extractor, so it seems out of scope for this pull request.
54f2ff4 to
6748b20
Compare
Since the auto test generator uses a |
Good suggestion; I'll look into it |
9d1b566 to
fc141c5
Compare
java/ql/src/utils/Stubs.qll
Outdated
|
|
||
| /** Exclude types from the standard library. */ | ||
| private class DefaultLibs extends ExcludedPackage { | ||
| DefaultLibs() { this.getName().matches(["java.%", "javax.%", "jdk.%", "sun.%"]) } |
There was a problem hiding this comment.
It seems like we need stubs for javax packages? (At least javax.servlet seemed to need stubbing).
| DefaultLibs() { this.getName().matches(["java.%", "javax.%", "jdk.%", "sun.%"]) } | |
| DefaultLibs() { this.getName().matches(["java.%", "jdk.%", "sun.%"]) } |
Co-authored-by: Chris Smowton <smowton@github.com>
fc141c5 to
af78b99
Compare
|
(apologies, I didn't realize |
A QL-based tool for generating Java stubs, to replace the current ad-hoc internal tool. Based on the C# version.
Questions and limitations:
options0andoptions1, which we probably don't want to commit.LICENSE.txtfile alongside them? (not generated by this tool)