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 206632 - Do not fire ClassPath changes after project reload unless necessary
Summary: Do not fire ClassPath changes after project reload unless necessary
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 206445
  Show dependency tree
 
Reported: 2011-12-22 04:58 UTC by pekarna
Modified: 2011-12-22 12:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pekarna 2011-12-22 04:58:24 UTC
When working on large maven projects, scanning takes ages.
That's understandable.

But whenever a pom.xml is edited, it seems that all projects are re-scanned, even if not necessary - e.g. a comment was changed.

I suggest to implement some kind of heuristic which would reduce cases when scanning is triggered.

For example:
  * A tree of the XML document would need to change - that's quite easy and fast to check using stax.
  * Inside <dependencies>, <parent>, <depencencyManagement>, <properties>, and <activation>, change of non-whitespace strings would also trigger scanning.
    I believe that changes of strings elsewhere only affects build, so NetBeans could safely ignore.

It would take some deeper analysis, but could be really worth a try. NetBeans unresponsive for 5 minutes any time I change a pom.xml is really something I'd rather not enjoy :)
Comment 1 Jesse Glick 2011-12-22 12:18:49 UTC
If pom.xml is edited, the MavenProject has to be reloaded; trying to determine the kind of text edited would be far too difficult and unreliable, changes to some non-classpath metadata such as <name> still need to be recognized, and project loading is usually quick anyway.

But reloading the project should not trigger change events in various query results (e.g. ClassPath) unless the classpath actually changed as a result of your edit (e.g. you added a <dependency>). And that is in fact exactly the behavior I observe: if I make a real change to dependencies, the log file records a rescan as expected; if I edit some comments in the POM, nothing of the sort happens. If this is not what you see, then I need steps to reproduce.