diff options
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java')
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java index 94470c5fd2c..c1ea5db41e3 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/about/AboutFeaturesButtonManager.java @@ -20,88 +20,88 @@ import java.util.Map; /** * Utility class used to associate BundleInfo's that have the same provider and - * image. The algorithm in <code>java.util.zip.CRC32</code> is used to determine + * image. The algorithm in <code>java.util.zip.CRC32</code> is used to determine * image identity. */ public class AboutFeaturesButtonManager { private Map<Key, List<AboutBundleGroupData>> providerMap = new HashMap<>(); - private static class Key { - public String providerName; + private static class Key { + public String providerName; - public Long crc; + public Long crc; - /** - * @param crc must not be null - */ - public Key(String providerName, Long crc) { - this.providerName = providerName; - this.crc = crc; - } + /** + * @param crc must not be null + */ + public Key(String providerName, Long crc) { + this.providerName = providerName; + this.crc = crc; + } - @Override + @Override public boolean equals(Object o) { - if (!(o instanceof Key)) { + if (!(o instanceof Key)) { return false; } - Key other = (Key) o; - if (!providerName.equals(other.providerName)) { + Key other = (Key) o; + if (!providerName.equals(other.providerName)) { return false; } - return crc.equals(other.crc); - } + return crc.equals(other.crc); + } - @Override + @Override public int hashCode() { - return providerName.hashCode(); - } - } + return providerName.hashCode(); + } + } - /** - * @return true if a button should be added (i.e., the argument has an image - * and it does not already have a button) - */ - public boolean add(AboutBundleGroupData info) { - // no button for features without an image - Long crc = info.getFeatureImageCrc(); - if (crc == null) { + /** + * @return true if a button should be added (i.e., the argument has an image and + * it does not already have a button) + */ + public boolean add(AboutBundleGroupData info) { + // no button for features without an image + Long crc = info.getFeatureImageCrc(); + if (crc == null) { return false; } - String providerName = info.getProviderName(); - Key key = new Key(providerName, crc); + String providerName = info.getProviderName(); + Key key = new Key(providerName, crc); List<AboutBundleGroupData> infoList = providerMap.get(key); - if (infoList != null) { - infoList.add(info); - return false; - } + if (infoList != null) { + infoList.add(info); + return false; + } infoList = new ArrayList<>(); - infoList.add(info); - providerMap.put(key, infoList); - return true; - } + infoList.add(info); + providerMap.put(key, infoList); + return true; + } - /** - * Return an array of all bundle groups that share the argument's provider and - * image. Returns an empty array if there isn't any related information. - */ - public AboutBundleGroupData[] getRelatedInfos(AboutBundleGroupData info) { - // if there's no image, then there won't be a button - Long crc = info.getFeatureImageCrc(); - if (crc == null) { + /** + * Return an array of all bundle groups that share the argument's provider and + * image. Returns an empty array if there isn't any related information. + */ + public AboutBundleGroupData[] getRelatedInfos(AboutBundleGroupData info) { + // if there's no image, then there won't be a button + Long crc = info.getFeatureImageCrc(); + if (crc == null) { return new AboutBundleGroupData[0]; } - String providerName = info.getProviderName(); - Key key = new Key(providerName, crc); + String providerName = info.getProviderName(); + Key key = new Key(providerName, crc); List<AboutBundleGroupData> infoList = providerMap.get(key); - if (infoList == null) { + if (infoList == null) { return new AboutBundleGroupData[0]; } return infoList.toArray(new AboutBundleGroupData[0]); - } + } } |