No implementations found

I have maven project with two modules and parent pom.xml. In the first module I have interface, in the second - implementation. If I import the first module, open interface and press Ctrl+Alt+F7 - I see that "No implementations found". Why can't Idea (version 12.0.3) find implementation in the second module?

Please see screenshots:

1) Interface in the imported module.

interface.jpg

2) Implementation:
implementation.jpg

10 comments

Hi Alex,

Could you provide a sample project which illustrates the problem?

Denis

0

Thank's for reply. Please, see attached zip file.



Attachment(s):
sample.zip
0

Thanks for the samle. The answer is that 'Find usages' looks for usages and implementation is not considered to be a usage. For example, you can add the following method to A1Impl class at your sample:

public void test(A1 a) {
  a.a1();               
}                       


Then 'Find Usages' will locate it. Alternatively, you can invoke 'Find Usages Settings' (mapped to Ctrl+Alt+Shift+F7 at the default keymap, also available via Main Menu | Edit | Find | Find Usages Settings). It allows to specify that implementation methods should be chosen as well:

find.png
Please note that there is a dedicated action to quickly show list of all overriding methods - 'Navigate to Implementation (s)' (Ctrl+Alt+B at the default keymap, also available via Main Menu | Navigate | Implementation (s)). It also works for class hierarchy down traversal.

Denis

0

No, problem is in scope. Implementation class place in the "Project and Libraries" scope, but I can't select it. Why is it not present in scope dropdown?
Could you find implemention using Ctrl+Alt+B in sample project? I can't.

0

I'm afraid I don't understand the problem. 'Find Usages Settings' works fine at the sample project you attached if 'Implementing methods' box is checked. 'Project and Libraries' scope is also available for selection at 'Find Usages Settings' dialog at the sample project.

Denis

0

Sorry, I understand. Scope available in the sample project, but in another project not. Please, see screenshot
scope.jpg

Why?

0

I have small mistake in sample project. Could you add module test1 using "Import module" (File->Import module... like maven project). After that interface will be in the "Project file" scope and Ctrl+Alt+B will not work. Pleas see screenshots

scope.jpg

scope.jpg

0

Can't reproduce that locally. Could provide a sample project for that problem?

Denis

0

Reproduced the problem, thanks. Created a ticket - IDEA-100571.

Denis

0

Please sign in to leave a comment.