How to all the default methods in JDK/JRE API interfaces using Structured Quary Language


I have come across the need to find all the default methods in JDK, I also understand Structured Query Language is the best to way to get there i.e. structural search..

if knows the syntax, pl. do share..


Comment actions Permalink

Intellij should consider building the structural search query visually with UI i.e. asking for access, method or class or interface, with return parameter type and with method parameter types etc.

Comment actions Permalink

Under the tool button in the upper right of the Structural Search dialog, select the Existing Templates action. In the dialog that appears select the Constructors & methods template and click OK. You can now edit this template in the Structural Search dialog. Add a default modifier. Now search in your desired scope.

Comment actions Permalink

Thank You Petr.

interface $Interface$ {
default $ReturnType$ $Method$ ($ParameterType$ $Parameter$);

As per this search in project and libraries scope in JDK 17 I do see 366 places for one parameter methods. 

For all 0 to infinity parameters use this 

and the count of such match in JDK 17 is 817

Comment actions Permalink

Is it possible to say this match should happen only in java.* package part of this structural search (want to eliminate all com.sun packages from the results.


Please sign in to leave a comment.