Bug 198402 - Provide a way to dump classes cache
Provide a way to dump classes cache
Status: NEW
Product: java
Classification: Unclassified
Component: Source
7.0
PC Linux
: P2 with 1 vote (vote)
: TBD
Assigned To: Svata Dedic
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-06 16:59 UTC by pekarna
Modified: 2015-01-07 14:08 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pekarna 2011-05-06 16:59:50 UTC
Since cache is a bit buggy in NetBeans 7.0 (I reported that earlier but can't find in BZ), I must delete ~/.netbeans/var quite often.

(The problem is that some packages are reported as missing, sometimes it behaves like it had old versions of classes, etc. Deleting var fixes it.)

But seems to delete Maven repositories indexes. Which then takes very long to redownload and reindex.

Could there be some menu item to dump classes cache? E.g "Tools > Dump classes cache" or "Source > ... ". Or better, fix the cache :)
Comment 1 pekarna 2011-05-06 17:03:13 UTC
Related to Bug 115670 - Ability to define cache location instead of dev/var/cache and ability to clean it
Comment 2 pekarna 2011-05-06 17:07:31 UTC
It's a duplicate, but I will leave it for devs to close to notice this :) Thx
Comment 3 superole2 2012-05-24 12:24:02 UTC
what is it a duplicate of?

The reason I'm asking is because I too have a problem with:

(In reply to comment #0)
> (The problem is that some packages are reported as missing, sometimes it
> behaves like it had old versions of classes, etc. Deleting var fixes it.)

And I too would like to see some menu item to dump classes cache.
Comment 4 jbeskin 2012-09-21 13:13:29 UTC
This is still a regular problem with Netbeans. Especially when using git
as a backend, since git will rapidly change files when switching branches
or during merges. Once Netbeans gets it's index corrupted, the only solution
is to remove the cache and restart.

It seems to me that one of the underlying bugs here is that "clean and build"
really should include cleaning the cache for all the packages and classes 
referenced. If that's not possible, a simple command would surely help.
Comment 5 superole2 2013-05-06 15:26:33 UTC
(In reply to comment #4)
> It seems to me that one of the underlying bugs here is that "clean and build"
> really should include cleaning the cache for all the packages and classes 
> referenced. If that's not possible, a simple command would surely help.

This is a very good suggestion.
NetBeans needs to be able to clear the cache on a per project basis.
Comment 6 cheesus 2013-05-28 15:14:37 UTC
I have just experienced the same problem, with dev-201304242301:
Did a random file copy+refactor, and had a class with the a wromng package declaration.
Fixed the declaration, but the application as deployed to app server (JBoss AS7 in this case) always failed with the error about the wron package.
Killed all processes, "Clean And Build", scan for external changes, restart NB...
nothing helped.
In the end, I had to manually delete (MacOS)
   rm -rf /Users/XXX/Library/Caches/NetBeans/dev/index
to get it back to run.

1. of course, cache should not be stable, but it will happen eventually...

2. "Clean and Build" should definetly delete all caches. That's why I choose clean.

3. "Scan for external changes" should rebuild bad caches anyway.

4. As the last resort, a manual clear cache should be available. In Netbeans, not as Terminal command...


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo