Bug 203890 - A cache for tasks inside CompilationInfo
A cache for tasks inside CompilationInfo
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Source
7.1
PC Linux
: P3 (vote)
: 7.1
Assigned To: Jan Lahoda
issues@java
: API, API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
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
:


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.


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