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.
Summary: | Maven POM Autocompletion | ||
---|---|---|---|
Product: | cnd | Reporter: | Blackpanther |
Component: | Project | Assignee: | Alexander Simon <alexvsimon> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexvsimon, jglick |
Priority: | P3 | Keywords: | PERFORMANCE, THREAD |
Version: | 7.0 | ||
Hardware: | PC | ||
OS: | Windows 7 x64 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 183681 | ||
Bug Blocks: | |||
Attachments: | Thread Dump taken during bug |
Description
Blackpanther
2010-12-18 17:46:06 UTC
could you please attach thread-dump when the IDE is stuck ? http://wiki.netbeans.org/GenerateThreadDump Created attachment 104978 [details]
Thread Dump taken during bug
When I tried to generate thread dump by pressing Ctrl+Break in my console window, an error were generated but the POM completion worked. MakeProjectFileOwnerQuery.getOwner must not call OpenProjects.getOpenProjects. Generally FOQ impls should avoid any reliance on the open project list, but where it is necessary to pay attention to open projects to disambiguate choices, you need to listen to changes in the set of open projects and make the actual gO call fast and nonblocking. (In reply to comment #4) > MakeProjectFileOwnerQuery.getOwner must not call OpenProjects.getOpenProjects. > Generally FOQ impls should avoid any reliance on the open project list, but > where it is necessary to pay attention to open projects to disambiguate > choices, you need to listen to changes in the set of open projects and make the > actual gO call fast and nonblocking. API do not mentioned that "FileOwnerQueryImplementation.getOwner()" must not call OpenProjects.getOpenProjects. So it is not MakeProjectFileOwnerQuery issue. It seems OpenProjects.getOpenProjects() violates "Command Query Separation" principle (see http://en.wikipedia.org/wiki/Command-query_separation). (In reply to comment #5) > API do not mentioned that "FileOwnerQueryImplementation.getOwner()" must not > call OpenProjects.getOpenProjects. Fixed in core-main #abd2a3c89640. Now please fix your impl. (In reply to comment #7) > Fixed in core-main #abd2a3c89640. Now please fix your impl. 1. Your change set introduced significant constraint. It is unacceptable for API. Did changes pass API review? IMHO you should deprecate class and introduce new "lite weight File Owner Query Implementation". 2. Root of issue is *blocking* method OpenProjects.getOpenProjects(). Make method nonblocking or provide new nonblocking version of the method. (In reply to comment #8) > Your change set introduced significant constraint. No, this constraint has been there since the project system was designed in 4.0, it just was not mentioned in this particular piece of Javadoc. The infrastructure layer (incl. FOQ) should not call into the UI layer (incl. OPL). When I get a chance I will prepare a patch to MakeProjectFileOwnerQuery and reassign for review. P1s & P2s come first, though. fixed when Bug #195505 was fixed. Not sure I understand 21982ffd50a9 well enough to really comment, but this sounds like the right approach, more or less in line with comment #4. The idea is that "low-level" APIs such as file ownership, queries, etc. should not depend on "high-level" APIs such as which projects are open in the GUI. Where for performance or logistical reasons it is impractical to compute information needed for a low-level API for nonopen projects, the low-level API should attempt to gracefully return incomplete information, with project open events being used as a hint to guide which calculations should proceed. For example, Maven projects claim ownership of artifacts in the local repository that their build would produce (needed for the Java editor), but the source project location cannot be guessed from the artifact itself; in 6.x this FOQI checked the open project list directly, which caused a lot of problems, so in 7.0 there is rather an artifact -> source cache which is updated when a project is opened. (In reply to comment #11) > For example, Maven projects claim ownership of artifacts in the local > repository that their build would produce (needed for the Java editor), but the > source project location cannot be guessed from the artifact itself; in 6.x this > FOQI checked the open project list directly, which caused a lot of problems, so > in 7.0 there is rather an artifact -> source cache which is updated when a > project is opened. Is this artifact supported somehow by Project API or it's in Maven only? Where can I have a look? Thanks, Vladimir. (In reply to comment #12) > Is this artifact supported somehow by Project API or it's in Maven only? Maven only. > Where can I have a look? maven/src/org/netbeans/modules/maven/queries/MavenFileOwnerQueryImpl.java where registerProject is called from the project's open hook. |