Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 100313 Details for
Bug 232186
Expensive localized property retrieval
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Optimization
patch.txt (text/plain), 2.25 KB, created by
John Arthorne
on 2008-05-14 17:29:45 EDT
(
hide
)
Description:
Optimization
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2008-05-14 17:29:45 EDT
Size:
2.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.ui >Index: src/org/eclipse/equinox/internal/provisional/p2/ui/query/IUPropertyUtils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/provisional/p2/ui/query/IUPropertyUtils.java,v >retrieving revision 1.4 >diff -u -r1.4 IUPropertyUtils.java >--- src/org/eclipse/equinox/internal/provisional/p2/ui/query/IUPropertyUtils.java 13 May 2008 23:25:17 -0000 1.4 >+++ src/org/eclipse/equinox/internal/provisional/p2/ui/query/IUPropertyUtils.java 14 May 2008 21:28:43 -0000 >@@ -13,6 +13,7 @@ > import java.net.URL; > import java.util.*; > import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; >+import org.eclipse.equinox.internal.p2.metadata.InstallableUnit; > import org.eclipse.equinox.internal.p2.ui.ProvUIActivator; > import org.eclipse.equinox.internal.provisional.p2.metadata.*; > import org.eclipse.equinox.internal.provisional.p2.metadata.query.IUPropertyQuery; >@@ -132,7 +133,7 @@ > String localeKey = makeLocalizedKey(actualKey, (String) jter.next()); > translation = localizationIU.getProperty(localeKey); > if (translation != null) >- return translation; >+ return cacheResult(iu, localizedKey, translation); > } > } > } >@@ -142,10 +143,22 @@ > String localeKey = makeLocalizedKey(actualKey, nextLocale); > String nextValue = iu.getProperty(localeKey); > if (nextValue != null) >- return nextValue; >+ return cacheResult(iu, localizedKey, nextValue); > } > >- return actualKey; >+ return cacheResult(iu, localizedKey, actualKey); >+ } >+ >+ /** >+ * Cache the translated property value to optimize future retrieval of the same value. >+ * Currently we just cache on the installable unit object in memory. In future >+ * we should push support for localized property retrieval into IInstallableUnit >+ * so we aren't required to reach around the API here. >+ */ >+ private static String cacheResult(IInstallableUnit iu, String localizedKey, String localizedValue) { >+ if (iu instanceof InstallableUnit) >+ ((InstallableUnit) iu).setProperty(localizedKey, localizedValue); >+ return localizedValue; > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232186
:
100311
|
100313
|
100316
|
100324