File: 0001-528191-Replace-uses-of-org.eclipse.jface.util.Assert.patch

package info (click to toggle)
eclipse-wtp 3.18-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 20,712 kB
  • sloc: java: 213,874; xml: 3,945; sh: 74; makefile: 9
file content (224 lines) | stat: -rw-r--r-- 11,387 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
From 5dd251905b5179b9b583da56265f0f5ab208787f Mon Sep 17 00:00:00 2001
From: Nitin Dahyabhai <thatnitind@gmail.com>
Date: Sun, 9 Aug 2020 03:26:37 -0400
Subject: [PATCH] [528191] Replace uses of org.eclipse.jface.util.Assert and
       org.eclipse.jface.text.Assert because of their deletion.

---

upstream link: https://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=5dd251905b5179b9b583da56265f0f5ab208787f

diff --git a/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java b/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
index 033bed456..cf2ec62b6 100644
--- a/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
+++ b/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2020 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -17,10 +17,10 @@ package org.eclipse.wst.sse.core.internal.cleanup;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.eclipse.jface.text.Assert;
+import org.eclipse.core.runtime.Assert;
 
 public class StructuredContentCleanupHandlerImpl implements StructuredContentCleanupHandler {
-	protected Map fCleanupProcessors;
+	protected Map<String,IStructuredCleanupProcessor> fCleanupProcessors;
 
 	public IStructuredCleanupProcessor getCleanupProcessor(String contentType) {
 		Assert.isNotNull(contentType);
@@ -28,14 +28,14 @@ public class StructuredContentCleanupHandlerImpl implements StructuredContentCle
 		if (fCleanupProcessors == null)
 			return null;
 
-		return (IStructuredCleanupProcessor) fCleanupProcessors.get(contentType);
+		return fCleanupProcessors.get(contentType);
 	}
 
 	public void setCleanupProcessor(IStructuredCleanupProcessor cleanupProcessor, String contentType) {
 		Assert.isNotNull(contentType);
 
 		if (fCleanupProcessors == null)
-			fCleanupProcessors = new HashMap();
+			fCleanupProcessors = new HashMap<>();
 
 		if (fCleanupProcessors == null)
 			fCleanupProcessors.remove(contentType);
diff --git a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
index 6045cd5e2..975786461 100644
--- a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
+++ b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2020 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -12,9 +12,9 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.hyperlink;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.Assert;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DocumentEvent;
 import org.eclipse.jface.text.IDocument;
diff --git a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
index 5d285b81b..bb3949640 100644
--- a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
+++ b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2020 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -14,9 +14,9 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.preferences;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jface.text.Assert;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 
diff --git a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
index f45d6eca7..0ccfd4b05 100644
--- a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
+++ b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java
@@ -14,8 +14,8 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.preferences.ui;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.util.Assert;
 import org.eclipse.ui.editors.text.EditorsUI;
 
 /**
diff --git a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
index 2e568434d..890447f59 100644
--- a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
+++ b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2020 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -14,13 +14,13 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.preferences.ui;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.preference.FieldEditor;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.IntegerFieldEditor;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.preference.StringFieldEditor;
 import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Assert;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.swt.SWT;
diff --git a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
index e60810f45..dc3929d53 100644
--- a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
+++ b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
+ * Copyright (c) 2001, 2020 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -18,24 +18,24 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.util.Assert;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.ui.texteditor.ITextEditor;
 
 public class SelectionHistory {
 	private ITextEditor fEditor;
-	private List fHistory;
-	private List fHistoryActions;
+	private List<IRegion> fHistory;
+	private List<IAction> fHistoryActions;
 	private int fSelectionChangeListenerCounter;
 	private ISelectionChangedListener fSelectionListener;
 
 	public SelectionHistory(ITextEditor editor) {
 		Assert.isNotNull(editor);
 		fEditor = editor;
-		fHistory = new ArrayList(3);
+		fHistory = new ArrayList<>(3);
 		fSelectionListener = new ISelectionChangedListener() {
 			public void selectionChanged(SelectionChangedEvent event) {
 				if (fSelectionChangeListenerCounter == 0)
@@ -67,7 +67,7 @@ public class SelectionHistory {
 		if (isEmpty())
 			return null;
 		int size = fHistory.size();
-		IRegion result = (IRegion) fHistory.remove(size - 1);
+		IRegion result = fHistory.remove(size - 1);
 		updateHistoryAction();
 		return result;
 	}
@@ -93,7 +93,7 @@ public class SelectionHistory {
 		Assert.isNotNull(action);
 		
 		if (fHistoryActions == null)
-			fHistoryActions = new ArrayList();
+			fHistoryActions = new ArrayList<IAction>();
 		if (!fHistoryActions.contains(action))
 			fHistoryActions.add(action);
 		
@@ -110,9 +110,9 @@ public class SelectionHistory {
 			if (fHistory != null && !fHistory.isEmpty())
 				enabled = true;
 
-			Iterator iter = fHistoryActions.iterator();
+			Iterator<IAction> iter = fHistoryActions.iterator();
 			while (iter.hasNext()) {
-				((IAction)iter.next()).setEnabled(enabled);
+				iter.next().setEnabled(enabled);
 			}
 		}
 	}
diff --git a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
index 04bb4ab78..fe46927fa 100644
--- a/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
+++ b/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java
@@ -14,10 +14,10 @@
  *******************************************************************************/
 package org.eclipse.wst.sse.ui.internal.selection;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.Assert;
 import org.eclipse.wst.sse.core.StructuredModelManager;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-- 
2.11.0