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 165825 Details for
Bug 309624
[publisher] PDE Updatesite Build all generates wrong categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch v2
309624.txt (text/plain), 4.04 KB, created by
Andrew Niefer
on 2010-04-22 14:37:50 EDT
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2010-04-22 14:37:50 EDT
Size:
4.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.updatesite >Index: src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java,v >retrieving revision 1.40 >diff -u -r1.40 UpdateSite.java >--- src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java 19 Feb 2010 19:58:19 -0000 1.40 >+++ src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java 22 Apr 2010 18:36:34 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.equinox.internal.p2.updatesite; > > import java.io.*; >+import java.lang.ref.SoftReference; > import java.net.*; > import java.util.HashMap; > import java.util.Map; >@@ -48,9 +49,9 @@ > * Some variables for caching. > */ > // map of String (URI.toString()) to UpdateSite >- private static Map<String, UpdateSite> siteCache = new HashMap<String, UpdateSite>(); >+ private static Map<String, SoftReference<UpdateSite>> siteCache = new HashMap<String, SoftReference<UpdateSite>>(); > // map of String (URI.toString()) to UpdateSite (for category xmls) >- private static Map<String, UpdateSite> categoryCache = new HashMap<String, UpdateSite>(); >+ private static Map<String, SoftReference<UpdateSite>> categoryCache = new HashMap<String, SoftReference<UpdateSite>>(); > // map of String (featureID_featureVersion) to Feature > private Map<String, Feature> featureCache = new HashMap<String, Feature>(); > >@@ -81,9 +82,15 @@ > public static synchronized UpdateSite loadCategoryFile(URI location, IProgressMonitor monitor) throws ProvisionException { > if (location == null) > return null; >- UpdateSite result = categoryCache.get(location.toString()); >- if (result != null) >- return result; >+ UpdateSite result = null; >+ if (!PROTOCOL_FILE.equals(location.getScheme()) && categoryCache.containsKey(location.toString())) { >+ result = categoryCache.get(location.toString()).get(); >+ if (result != null) >+ return result; >+ //else soft reference has been cleared, take it out of the cache >+ categoryCache.remove(location.toString()); >+ } >+ > InputStream input = null; > File siteFile = loadActualSiteFile(location, location, monitor); > try { >@@ -93,7 +100,8 @@ > SiteModel siteModel = siteParser.parse(input); > String checksumString = Long.toString(checksum.getValue()); > result = new UpdateSite(siteModel, location, checksumString); >- categoryCache.put(location.toString(), result); >+ if (!PROTOCOL_FILE.equals(location.getScheme())) >+ categoryCache.put(location.toString(), new SoftReference<UpdateSite>(result)); > return result; > } catch (SAXException e) { > String msg = NLS.bind(Messages.ErrorReadingSite, location); >@@ -119,9 +127,17 @@ > public static synchronized UpdateSite load(URI location, IProgressMonitor monitor) throws ProvisionException { > if (location == null) > return null; >- UpdateSite result = siteCache.get(location.toString()); >- if (result != null) >- return result; >+ >+ UpdateSite result = null; >+ //only caching remote sites >+ if (!PROTOCOL_FILE.equals(location.getScheme()) && siteCache.containsKey(location.toString())) { >+ result = siteCache.get(location.toString()).get(); >+ if (result != null) >+ return result; >+ //else soft reference has been cleared, take it out of the cache >+ siteCache.remove(location.toString()); >+ } >+ > InputStream input = null; > File siteFile = loadSiteFile(location, monitor); > try { >@@ -131,7 +147,8 @@ > SiteModel siteModel = siteParser.parse(input); > String checksumString = Long.toString(checksum.getValue()); > result = new UpdateSite(siteModel, getSiteURI(location), checksumString); >- siteCache.put(location.toString(), result); >+ if (!PROTOCOL_FILE.equals(location.getScheme())) >+ siteCache.put(location.toString(), new SoftReference<UpdateSite>(result)); > return result; > } catch (SAXException e) { > String msg = NLS.bind(Messages.ErrorReadingSite, location);
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 309624
:
165234
|
165235
|
165236
|
165237
|
165238
|
165239
|
165240
|
165823
| 165825