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

Summary: A cache for tasks inside CompilationInfo
Product: java Reporter: Jan Lahoda <jlahoda>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED FIXED    
Severity: normal CC: apireviews, jglick
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 7.1   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Proposed patch.

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.