No need to dispose Colors
Change-Id: If28050d631bc2b26fe561778efb1fb251f3d0284
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/185935
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
index 5817e22..f28beb8 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,6 @@
*******************************************************************************/
package org.eclipse.search.internal.ui;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -68,7 +67,6 @@
import org.eclipse.search.ui.ISearchResultViewEntry;
import org.eclipse.search.ui.SearchUI;
-
/**
* A special viewer to present search results. The viewer implements an
* optimized adding and removing strategy. Furthermore it manages
@@ -594,8 +592,6 @@
Menu menu= getTable().getMenu();
if (menu != null)
menu.dispose();
- if (fPotentialMatchFgColor != null)
- fPotentialMatchFgColor.dispose();
if (fActionGroup != null) {
fActionGroup.dispose();
fActionGroup= null;
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
index d9843cb..cd8e7c1 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,7 +15,6 @@
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
@@ -41,15 +40,6 @@
protected Map<RGB, Color> fColorTable= new HashMap<>(10);
/**
- * Release all of the color resources held onto by the receiver.
- */
- public void dispose() {
- Iterator<Color> e= fColorTable.values().iterator();
- while (e.hasNext())
- e.next().dispose();
- }
-
- /**
* Return the color that is stored in the color table under the given RGB
* value.
*
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java
index 0fea9b2..bfd27b6 100644
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java
+++ b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -14,7 +14,6 @@
package org.eclipse.ui.examples.templateeditor.editors;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
@@ -25,11 +24,6 @@
protected Map<RGB, Color> fColorTable = new HashMap<>(10);
- public void dispose() {
- Iterator<Color> e = fColorTable.values().iterator();
- while (e.hasNext())
- e.next().dispose();
- }
public Color getColor(RGB rgb) {
Color color = fColorTable.get(rgb);
if (color == null) {
diff --git a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java
index 50c463a..4ea7c2e 100644
--- a/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java
+++ b/org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -36,12 +36,6 @@
}
@Override
- public void dispose() {
- colorManager.dispose();
- super.dispose();
- }
-
- @Override
protected void createActions() {
super.createActions();