Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Conversation

@drestrepom
Copy link

  • Add the static_initializer node for the Java grammar, this node may contain multiple statements, such as initializing variables or executing functions

…tializer node

- Add the static_initializer node for the Java grammar, this node may
  contain multiple statements, such as initializing variables or
  executing functions
@drestrepom drestrepom requested a review from a team as a code owner January 30, 2025 01:00
@drestrepom
Copy link
Author

Here, a demonstration of what happens when that node is not handled

test/decl/static_initializer.java: failed to build stack graph
    0: Error executing statement edge @class_body.defs -> @declaration.defs at (225, 3)
       src/stack-graphs.tsg:225:3:
       225 |   edge @class_body.defs -> @declaration.defs
           |   ^
       in stanza
       src/stack-graphs.tsg:224:1:
       224 | (class_body (_)@declaration)@class_body {
           | ^
       matching (class_body) node
       test/decl/static_initializer.java:1:17:
       1 | class TestClass {
         |                 ^
    1: Evaluating edge sink
    2: Undefined scoped variable [syntax node static_initializer (2, 3)].defs

Error: Failed to build graph for test/decl/static_initializer.java
error: test failed, to rerun pass `--test test`

This is an example of using this node in a concurred repository

https://github.com/OWASP-Benchmark/BenchmarkJava/blob/master/src/main/java/org/owasp/benchmark/helpers/DatabaseHelper.java#L46

@CleanCut
Copy link
Contributor

CleanCut commented Sep 9, 2025

The github/stack-graphs repository is no longer being maintained. As per #502, I'm closing all issues and pull requests before archiving the repository.

@CleanCut CleanCut closed this Sep 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants