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 203890 - A cache for tasks inside CompilationInfo
Summary: A cache for tasks inside CompilationInfo
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2011-10-18 11:16 UTC by Jan Lahoda
Modified: 2011-10-27 14:03 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch. (13.57 KB, patch)
2011-10-18 11:16 UTC, Jan Lahoda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2011-10-18 11:16:14 UTC
Created attachment 112169 [details]
Proposed patch.

Often, tasks need to cache some information either inside the given invocation of the task or in across different invocations of the task. In some cases, it is even desirable for tasks to share some precomputed data. To facilitate this need, I am proposing to add CompilationInfo.{get,put}CachedValue methods. Please see the attached patch.
Comment 1 Jesse Glick 2011-10-18 13:14:36 UTC
Fix <issue number="999999"/>.


Missing Javadoc for CacheClearPolicy.


Test should verify that all values, incl. ON_TASK_END, are kept within the same task.
Comment 2 Tomas Zezula 2011-10-18 14:36:22 UTC
Seems fine to me.
Only one minor possible change. Rename CompilationInfoImpl.invalidate() to eg. CompilationInfoImpl.dispose() or something as the invalidate is used in CompilationInfo and does taskFinished(). This may be misleading.
Comment 3 Jan Lahoda 2011-10-26 13:24:23 UTC
I tried to resolve all the above requests and committed:
http://hg.netbeans.org/jet-main/rev/ff29dda08558

Please let me know if something needs to be improved. Thanks.
Comment 4 Quality Engineering 2011-10-27 14:03:29 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/ff29dda08558
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #203890: introducing cache to CompilationInfo that tasks can use to improve performance by keeping data across tasks or partial reparses.