summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-10-11 07:36:14 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-10-14 08:10:38 (EDT)
commit565a21ee8779cfe82e989c4a8f3457b162b31feb (patch)
tree8f4fe239884f3962d16bbb4a9cce51b09e681440
parentc2b7195928e4aca6066867972d8b3d0de517a66d (diff)
downloadeclipse.platform.ui-565a21ee8779cfe82e989c4a8f3457b162b31feb.zip
eclipse.platform.ui-565a21ee8779cfe82e989c4a8f3457b162b31feb.tar.gz
eclipse.platform.ui-565a21ee8779cfe82e989c4a8f3457b162b31feb.tar.bz2
Bug 302536 - [Markers] Broken double checked locking inI20131015-0800refs/changes/62/16762/3
MarkerSupportRegistry Change-Id: Ia354ff6d385af588644792563b3c99f803378ead Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java76
1 files changed, 34 insertions, 42 deletions
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java
index a62a548..3ce9a2c 100644
--- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java
+++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/internal/MarkerSupportRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,9 +40,9 @@ import org.eclipse.ui.views.markers.MarkerField;
/**
* The ProblemFilterRegistryReader is the registry reader for declarative
* problem filters. See the org.eclipse.ui.markerSupport extension point.
- *
+ *
* @since 3.2
- *
+ *
*/
public class MarkerSupportRegistry implements IExtensionChangeHandler {
@@ -60,7 +60,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
private static final Object WARNING = "WARNING";//$NON-NLS-1$
private static final String MARKER_ID = "markerId"; //$NON-NLS-1$
-
+
/**
* Filter enablement : A zero/negative integer implies that the limit is
* disabled.
@@ -153,7 +153,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
*/
public static final String PROBLEMS_GENERATOR = "org.eclipse.ui.ide.problemsGenerator"; //$NON-NLS-1$
-
+
/**
* The all markers generator.
*/
@@ -168,22 +168,14 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
private static MarkerSupportRegistry singleton;
- // Create a lock so that initialisation happens in one thread
- private static Object creationLock = new Object();
-
/**
* Get the instance of the registry.
- *
+ *
* @return MarkerSupportRegistry
*/
- public static MarkerSupportRegistry getInstance() {
+ public static synchronized MarkerSupportRegistry getInstance() {
if (singleton == null) {
- synchronized (creationLock) {
- if (singleton == null) {
- // thread
- singleton = new MarkerSupportRegistry();
- }
- }
+ singleton = new MarkerSupportRegistry();
}
return singleton;
}
@@ -236,7 +228,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
* Process the extension and register the result with the tracker. Fill the
* map of groupingEntries and attribueMappings processed for post
* processing.
- *
+ *
* @param tracker
* @param extension
* @param groupIDsToEntries
@@ -334,7 +326,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
extensionCollection = (Collection) generatorExtensions.get(generatorName);
else
extensionCollection = new ArrayList();
-
+
extensionCollection.add(element);
generatorExtensions.put(generatorName, extensionCollection);
tracker.registerObject(extension, element,
@@ -364,7 +356,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Create a table of MarkerFields
- *
+ *
* @param tracker
* @param extension
* @param element
@@ -388,7 +380,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Process the cross references after all of the extensions have been read.
- *
+ *
* @param groupIDsToEntries
* Mapping of group names to the markerGroupingEntries registered
* for them
@@ -409,7 +401,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Set up the fields and filters
- *
+ *
* @param generatorExtensions
* the extensions to the generators,
*/
@@ -428,7 +420,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Process the grouping entries into thier required grouping entries.
- *
+ *
* @param groupingEntries
*/
private void processGroupingEntries(Map groupingEntries) {
@@ -461,7 +453,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Process the attribute mappings into thier required grouping entries.
- *
+ *
* @param entryIDsToEntries
* @param attributeMappings
*/
@@ -508,7 +500,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the markerTypes defined in element.
- *
+ *
* @param element
* @return String[]
*/
@@ -524,7 +516,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler#addExtension(org.eclipse.core.runtime.dynamichelpers.IExtensionTracker,
* org.eclipse.core.runtime.IExtension)
*/
@@ -541,7 +533,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the collection of currently registered filters.
- *
+ *
* @return Collection of ProblemFilter
*/
public Collection getRegisteredFilters() {
@@ -560,7 +552,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the constant for scope from element. Return -1 if there is no value.
- *
+ *
* @param element
* @return int one of MarkerView#ON_ANY MarkerView#ON_SELECTED_ONLY
* MarkerView#ON_SELECTED_AND_CHILDREN
@@ -589,7 +581,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the constant for scope from element. Return -1 if there is no value.
- *
+ *
* @param element
* @return int one of MarkerView#ON_ANY MarkerView#ON_SELECTED_ONLY
* MarkerView#ON_SELECTED_AND_CHILDREN
@@ -615,7 +607,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Read the problem filters in the receiver.
- *
+ *
* @param element
* the filter element
* @return ProblemFilter
@@ -688,7 +680,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler#removeExtension(org.eclipse.core.runtime.IExtension,
* java.lang.Object[])
*/
@@ -748,7 +740,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Remove the value from all of the collection sets in cache. If the
* collection is empty remove the key as well.
- *
+ *
* @param value
* @param cache
*/
@@ -782,7 +774,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the category associated with marker. Return <code>null</code> if
* there are none.
- *
+ *
* @param marker
* @return String or <code>null</code>
*/
@@ -798,7 +790,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the category associated with markerType. Return <code>null</code>
* if there are none.
- *
+ *
* @param markerType
* @return String or <code>null</code>
*/
@@ -811,7 +803,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Return the TableSorter that corresponds to type.
- *
+ *
* @param type
* @return TableSorter
*/
@@ -829,7 +821,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Return the list of root marker types.
- *
+ *
* @return List of MarkerType.
*/
private MarkerType getRootType() {
@@ -843,7 +835,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Find the best match sorter for typeName in the children. If it cannot be
* found then return <code>null</code>.
- *
+ *
* @param typeName
* @param type
* @return TableSorter or <code>null</code>.
@@ -873,7 +865,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Return the FieldMarkerGroups in the receiver.
- *
+ *
* @return Collection of {@link MarkerGroup}
*/
public Collection getMarkerGroups() {
@@ -882,7 +874,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Return the default groupfield.
- *
+ *
* @return IField
*/
IField getDefaultGroupField() {
@@ -892,7 +884,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the generator descriptor for id
- *
+ *
* @param id
* @return ContentGeneratorDescriptor or <code>null</code>.
*/
@@ -904,7 +896,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Return the default content generator descriptor.
- *
+ *
* @return ContentGeneratorDescriptor
*/
public ContentGeneratorDescriptor getDefaultContentGenDescriptor () {
@@ -913,7 +905,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Get the markerGroup associated with categoryName
- *
+ *
* @param categoryName
* @return FieldMarkerGroup or <code>null</code>
*/
@@ -925,7 +917,7 @@ public class MarkerSupportRegistry implements IExtensionChangeHandler {
/**
* Return the field that maps to id.
- *
+ *
* @param id
* @return {@link MarkerField} or <code>null</code>
*/