Skip to content

Query for Java Static Initializer #16838

Answered by jketema
mrigankpawagi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

In the database the static initialiser block becomes a block statement that is part of a static initialiser method. The easiest way I could find to get to it is as follows:

from Class c, StaticInitializer i, BlockStmt s
where c.getAMethod() = i and i.getBody().getAChild() = s
select s

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mrigankpawagi
Comment options

@mrigankpawagi
Comment options

Answer selected by mrigankpawagi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants