This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256172 - Cannot resolve import within project
Summary: Cannot resolve import within project
Status: RESOLVED DUPLICATE of bug 255901
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.1
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-26 00:55 UTC by bht
Modified: 2015-10-26 08:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (226.59 KB, text/plain)
2015-10-26 00:55 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2015-10-26 00:55:53 UTC
Created attachment 156970 [details]
messages.log

With refactoring and editing activity, the IDE fails to resolve an import of a class in the same project. I renamed the class at some stage.

From my perspective, there is no way to recover from this now. I tried to modify and change the modified class without effect.

What I am doing is by no means special, and I am not a crazy developer. Everybody does this kind of thing all the time. I suspect that CPU performance is perhaps a factor - I have a main program running at the same time while I am editing - or may be not. But regardless, editing has been very fast due to dual CPU perhaps. So I don't think that performance is an excuse at all, perhaps it just helps to reproduce the problem.

I have seen this before without additional CPU load.
Comment 1 bht 2015-10-26 01:55:07 UTC
I discovered:

Seems that a main class running, started via the IDE run context command, not concerned with the classes being edited, but using other classes in the project, blocked the execution of the IDE's scanning.

After I stopped the running class from the output window, scanning was reported in the status bar and the references were fixed. Not only was an import broken, but also a reference to a method.

I can imagine that this happens also while a debugging session is running. Or perhaps an embedded servlet engine like Jetty is running. Very common scenario.

I can see that the IDE's quality is improving dramatically, but I still find cases like this one that have the potential to erode developer confidence.
Comment 2 Tomas Zezula 2015-10-26 08:57:07 UTC
I believe it's a duplicate of the issue #255901.
This report comes from maven so there is no NbBuildLogger responsible for entering protected mode but the maven equivalent.
Also it's questionable how realistic the idea of locking indexing while the project is built (executed) until the project ends or it does not emit output for 5 sec is.

The issue #255901 (for Ant) at least fixes the case when the project is executed to update the caches nad not to run old code.

*** This bug has been marked as a duplicate of bug 255901 ***