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 209856 - maven.refactoring triggers local repo indexing
Summary: maven.refactoring triggers local repo indexing
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: PERFORMANCE, REGRESSION
Depends on:
Blocks: 200263
  Show dependency tree
 
Reported: 2012-03-21 13:35 UTC by Jan Becicka
Modified: 2012-04-04 10:08 UTC (History)
1 user (show)

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 Jan Becicka 2012-03-21 13:35:20 UTC
Maven refactoring plugin does some indexing in maven repositories even if no maven project is used. Maven Plugin Factory should return null if non-maven projects are being refactored/searched.
Comment 1 Milos Kleint 2012-03-23 06:44:17 UTC
jesse, comments? what is the purpose of the find usage refactoring plugin that searches in local repo?
Comment 2 Jesse Glick 2012-03-23 15:31:03 UTC
(In reply to comment #0)
> Maven refactoring plugin does some indexing in maven repositories

It should never do any indexing; it may consult with an existing index if one is ready, which ought to be quite fast. What specifically did you observe as the slowdown?

> Maven Plugin Factory should return null if non-maven
> projects are being refactored/searched.

Perhaps so. Can still be useful to see Maven-based usages of an API even if the known clients are using Ant.

A little subtle to specify what it means for a Maven-based project to be searched, because the type being searched might actually be in a Maven project, or it might be in a binary repository artifact.


(In reply to comment #1)
> what is the purpose of the find usage refactoring plugin that
> searches in local repo?

To inform you of usages of an API beyond your open projects [1]. Otherwise you have no way to find such usages other than checking out and opening every project which might possibly use it, and waiting a long time for them all to be scanned.


[1] http://wiki.netbeans.org/NewAndNoteworthyNB71#Find_Usages_2
Comment 3 Jan Becicka 2012-03-23 16:00:33 UTC
(In reply to comment #2)
> It should never do any indexing; it may consult with an existing index if one
> is ready, which ought to be quite fast. What specifically did you observe as
> the slowdown?

I saw some progress bar (in status bar) doing something with maven.  

> Perhaps so. Can still be useful to see Maven-based usages of an API even if the
> known clients are using Ant.
> 
> A little subtle to specify what it means for a Maven-based project to be
> searched, because the type being searched might actually be in a Maven project,
> or it might be in a binary repository artifact.

Find usages has Scope, which is "open projects" "current project" etc. If you think, that your clients want to see something from maven universe, there should be specific scope for it. And since there is no such scope, it is not acceptable to slow down Find Usages just for few people, which "might be interested" in something from maven.
Comment 4 Milos Kleint 2012-03-26 11:24:51 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > It should never do any indexing; it may consult with an existing index if one
> > is ready, which ought to be quite fast. What specifically did you observe as
> > the slowdown?
> 
> I saw some progress bar (in status bar) doing something with maven.  


afaik it does trigger index download/local repo scan if these don't exist currently.
Comment 5 Jesse Glick 2012-03-28 22:20:29 UTC
It calls RepositoryQueries.findClassUsagesResult("...", null).getResults(), which is supposed to use only existing indices. When there are no loaded indices, this ought to immediately return an empty list. It seems that the refactorings in 7.2 caused this to trigger local repo indexing, which it did not use to do and which the class Javadoc does not indicate it should do. 2809e8de3470 in particular seems to have regressed this.

(In reply to comment #3)
> there should be specific scope for it

Would be nice, but impossible via current APIs AFAIK; WhereUsedPanel hardcodes the list of special scopes. (bug #191334 comment #33) Anyway, a bit off topic here.
Comment 6 Jesse Glick 2012-03-28 23:44:56 UTC
core-main #1d084767860b
Comment 7 Quality Engineering 2012-04-02 15:54:54 UTC
Integrated into 'main-golden', will be available in build *201204021038* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/dac79e2be97f
User: Jesse Glick <jglick@netbeans.org>
Log: Cleaner fix of #209856 according to mkleint; caller, not impl, controls whether indexing is triggered.
Comment 8 Quality Engineering 2012-04-04 10:08:17 UTC
Integrated into 'main-golden', will be available in build *201204040400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/93fed910e2ef
User: Milos Kleint <mkleint@netbeans.org>
Log: #209856 passing null as list of repositories means all defined repositories, to use justr the loaded ones without triggering scan, use the getLoadedContexts() method