Skip to content

Commit ec919d6

Browse files
vogellaclaude
andcommitted
Remove commented out code that does not serve as documentation
This commit removes commented out code (dead code) from multiple files across the codebase. The commented code was no longer serving any documentation purpose and only added clutter. Changes include: Bundles: - MarkersChangeListener.java: Removed 150+ lines of commented method implementations (needsUpdate, affectsCurrentState, etc.) and related helper methods. This code was originally commented out on 2009-11-30 in commit b417bee (Bug 292525) with a note "left commented out for further investigation". After approximately 16 years, it is unlikely that further investigation will happen. Also removed the now-empty handleNoMarkerChange() method and its call site. - MarkerContentGenerator.java: Removed commented if statement - SelectionProcessor.java: Removed 27-line commented while loop block in multi-text selection paste handling - CSSDocumentHandlerImpl.java: Removed multiple commented code blocks in startMedia, endMedia, startFontFace, endFontFace methods - HeapStatus.java: Removed commented Kyrsoft view availability check Tests: - UIDialogs.java: Removed commented test implementations in testEditActionSetsDialog and testLoadNotExistingPerspective All removed code was identified as dead code that doesn't serve documentation purposes. Version control history preserves this code if needed for future reference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9c171a0 commit ec919d6

File tree

6 files changed

+0
-290
lines changed

6 files changed

+0
-290
lines changed

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSDocumentHandlerImpl.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public void ignorableAtRule(String atRule) throws CSSException {
9191
if (!getNodeStack().empty()) {
9292
((CSSRuleListImpl) getNodeStack().peek()).add(ir);
9393
} else {
94-
// _getNodeStack().push(ir);
9594
nodeRoot = ir;
9695
}
9796
}
@@ -100,10 +99,6 @@ public void ignorableAtRule(String atRule) throws CSSException {
10099
public void namespaceDeclaration(String prefix, String uri)
101100
throws CSSException {
102101
//TODO replace with eclipse logging
103-
// if (logger.isDebugEnabled()) {
104-
// logger.debug("Declare namespace [prefix=" + prefix + ", uri=" + uri
105-
// + "]");
106-
// }
107102
}
108103

109104
@Override
@@ -116,7 +111,6 @@ public void importStyle(String uri, SACMediaList media,
116111
if (!getNodeStack().empty()) {
117112
((CSSRuleListImpl) getNodeStack().peek()).add(ir);
118113
} else {
119-
// _getNodeStack().push(ir);
120114
nodeRoot = ir;
121115
}
122116
}
@@ -125,27 +119,12 @@ public void importStyle(String uri, SACMediaList media,
125119
public void startMedia(SACMediaList media) throws CSSException {
126120

127121
ignore = true;
128-
// // Create the media rule and add it to the rule list
129-
// CSSMediaRuleImpl mr = new CSSMediaRuleImpl(parentStyleSheet, null,
130-
// new MediaListImpl(media));
131-
// if (!getNodeStack().empty()) {
132-
// ((CSSRuleListImpl) getNodeStack().peek()).add(mr);
133-
// }
134-
//
135-
// // Create the rule list
136-
// CSSRuleListImpl rules = new CSSRuleListImpl();
137-
// mr.setRuleList(rules);
138-
// getNodeStack().push(mr);
139-
// getNodeStack().push(rules);
140122
}
141123

142124
@Override
143125
public void endMedia(SACMediaList media) throws CSSException {
144126

145127
ignore = false;
146-
// // Pop the rule list and media rule nodes
147-
// getNodeStack().pop();
148-
// nodeRoot = getNodeStack().pop();
149128
}
150129

151130
@Override
@@ -176,26 +155,11 @@ public void endPage(String name, String pseudo_page) throws CSSException {
176155
@Override
177156
public void startFontFace() throws CSSException {
178157
ignore = true;
179-
// // Create the font face rule and add it to the rule list
180-
// CSSFontFaceRuleImpl fontFaceRule = new CSSFontFaceRuleImpl(
181-
// parentStyleSheet, null);
182-
// if (!getNodeStack().empty()) {
183-
// ((CSSRuleListImpl) getNodeStack().peek()).add(fontFaceRule);
184-
// }
185-
//
186-
// // Create the style declaration
187-
// CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(fontFaceRule);
188-
// fontFaceRule.setStyle(decl);
189-
// getNodeStack().push(fontFaceRule);
190-
// getNodeStack().push(decl);
191158
}
192159

193160
@Override
194161
public void endFontFace() throws CSSException {
195162
ignore = false;
196-
// // Pop both the style declaration and the font face rule nodes
197-
// getNodeStack().pop();
198-
// nodeRoot = getNodeStack().pop();
199163
}
200164

201165
@Override

bundles/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/SelectionProcessor.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -294,33 +294,6 @@ TextEdit replace(IMultiTextSelection selection, String replacement) {
294294
TextEdit replace= new ReplaceEdit(region.getOffset(), region.getLength(), string);
295295
root.addChild(replace);
296296
}
297-
// while (lastDelim != -1) {
298-
// // more stuff to insert
299-
// String string;
300-
// Match m= delimiterMatcher.indexOf(replacement, lastDelim);
301-
// if (m == null) {
302-
// string= replacement.substring(lastDelim);
303-
// lastDelim= -1;
304-
// } else {
305-
// string= replacement.substring(lastDelim, m.getOffset());
306-
// lastDelim= m.getOffset() + m.getText().length();
307-
// }
308-
// endLine++;
309-
// TextEdit edit;
310-
// if (endLine < fDocument.getNumberOfLines()) {
311-
// edit= createReplaceEdit(endLine, visualStartColumn, visualEndColumn, string, delete);
312-
// } else {
313-
// // insertion reaches beyond the last line
314-
// int insertLocation= root.getExclusiveEnd();
315-
// int spaces= visualStartColumn;
316-
// char[] array= new char[spaces];
317-
// Arrays.fill(array, ' ');
318-
// string= TextUtilities.getDefaultLineDelimiter(fDocument) + String.valueOf(array) + string;
319-
// edit= new InsertEdit(insertLocation, string);
320-
// insertLocation+= string.length();
321-
// }
322-
// root.addChild(edit);
323-
// }
324297
return root;
325298
}
326299
}

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,7 @@ void updateSelectedResource(Object[] newElements, boolean forceUpdate) {
758758
if (forceUpdate || updateNeededForSelection(newElements)) {
759759
internalUpdateSelectedElements(newElements);
760760
// See comments below and Bug 296695
761-
// if (contentChanged()) {
762761
requestMarkerUpdate();
763-
// }
764762
}
765763
}
766764

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkersChangeListener.java

Lines changed: 0 additions & 195 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class MarkersChangeListener implements IResourceChangeListener {
4040
private String[] listeningTypes;
4141
private boolean receiving;
4242

43-
//private static final int UPDATE_TEST_CHECK_LIMIT = 1500;
44-
4543
// The time the build started. A -1 indicates no build in progress.
4644
private long preBuildTime;
4745

@@ -130,9 +128,6 @@ public synchronized void resourceChanged(IResourceChangeEvent event) {
130128
if(!hasApplicableTypes(event)){
131129
return;
132130
}
133-
// if (!needsUpdate(event)) {
134-
// return;
135-
// }
136131

137132
if (!builder.isIncremental()) {
138133
builder.getUpdateScheduler().scheduleUpdate();
@@ -159,13 +154,6 @@ void setReceivingChange(boolean receiving) {
159154
this.receiving = receiving;
160155
}
161156

162-
/**
163-
* Markers have not changed
164-
*/
165-
private void handleNoMarkerChange() {
166-
//view.indicateUpdating(null, true, false);
167-
}
168-
169157
/**
170158
* Handle changes incrementally.
171159
* The following performs incremental updation
@@ -218,10 +206,7 @@ private void handleIncrementalChange(IResourceChangeEvent event) {
218206
MarkerUpdate update = new MarkerUpdate(added, removed, changed);
219207
builder.incrementalUpdate(update);
220208
builder.getUpdateScheduler().scheduleUpdate();
221-
} else {
222-
handleNoMarkerChange();
223209
}
224-
return;
225210
}
226211

227212
/**
@@ -254,155 +239,6 @@ private boolean isApplicableType(String[] types, String typeId) {
254239
return false;
255240
}
256241

257-
// /**
258-
// * Note: This has been left commented out for further
259-
// * investigation(*),instead we we use the above for just checking types.
260-
// * This may invoke contributed code; as a field filter can be contributed.
261-
// * But again in such a case, the view would be a contributed as well.And, it
262-
// * is the responsibility of the field filter code to ensure the select
263-
// * method of filter remains fast.
264-
// *
265-
// */
266-
// private boolean needsUpdate(IResourceChangeEvent event) {
267-
// IMarkerDelta[] markerDeltas = event.findMarkerDeltas(null, true);
268-
// MarkerEntry[] presentEntries = builder.getClonedMarkers().getClone()
269-
// .getMarkerEntryArray();
270-
// int deltaCount = markerDeltas.length;
271-
// if (deltaCount == 0) {
272-
// return false;
273-
// }
274-
// String[] types = listeningTypes;
275-
// if (hasMarkerRemoval(presentEntries, null)) {
276-
// return true;
277-
// }
278-
// int maxTestCount = deltaCount > UPDATE_TEST_CHECK_LIMIT ? UPDATE_TEST_CHECK_LIMIT
279-
// : deltaCount;
280-
//
281-
// for (int i = 0; i < markerDeltas.length; i++) {
282-
// String typeId = markerDeltas[i].getType();
283-
// if (!hasApplicableTypes(types, typeId)) {
284-
// continue;
285-
// }
286-
// if (presentEntries == null || presentEntries.length == 0) {
287-
// return true;
288-
// }
289-
// int kind = markerDeltas[i].getKind();
290-
// IMarker marker = markerDeltas[i].getMarker();
291-
// MarkerEntry markerEntry = new MarkerEntry(marker);
292-
// if (affectsCurrentState(presentEntries, markerEntry, kind)) {
293-
// return true;
294-
// }
295-
// if (i >= maxTestCount - 1) {
296-
// return true;
297-
// }
298-
// }
299-
// return false;
300-
// }
301-
//
302-
// /**
303-
// * Check if a marker change, removal, or addition is of interest to the
304-
// * view.
305-
// *
306-
// * <ul>
307-
// * <li>Set the MarkerEntry to be stale, if discovered at any point of time
308-
// * of its use.This will greatly speed up lot of parts of the view.</li>
309-
// * <li>Instead of testing all marker changes, test only upto a maximum limit
310-
// * beyond which we schedule an update anyway.</li>
311-
// *
312-
// * </ul>
313-
// *
314-
// * @param marker
315-
// * @param kind
316-
// */
317-
// private boolean affectsCurrentState(MarkerEntry[] presentEntries,
318-
// MarkerEntry marker, int kind) {
319-
// switch (kind) {
320-
// case IResourceDelta.REMOVED: {
321-
// return hasMarkerRemoval(presentEntries, marker);
322-
// }
323-
// case IResourceDelta.ADDED: {
324-
// return hasMarkerAdditionsofInterest(presentEntries, marker);
325-
// }
326-
// case IResourceDelta.CHANGED: {
327-
// return hasMarkerChanges(presentEntries, marker);
328-
// }
329-
// default: {
330-
// return false;
331-
// }
332-
// }
333-
// }
334-
//
335-
// /**
336-
// * Returns whether or not the given marker addition is of interest to the
337-
// * view.
338-
// *
339-
// * @param presentEntries
340-
// * current marker entries
341-
// * @param marker
342-
// * the marker entry
343-
// * @return <code>true</code> if build is needed <code>false</code> if no
344-
// * update needed
345-
// */
346-
// private boolean hasMarkerAdditionsofInterest(MarkerEntry[] presentEntries,
347-
// MarkerEntry marker) {
348-
// MarkerContentGenerator generator = builder.getGenerator();
349-
// if (generator.select(marker)) {
350-
// return true;
351-
// }
352-
// return false;
353-
// }
354-
//
355-
// /**
356-
// * Returns whether or not markers were removed from the view.
357-
// *
358-
// * @param presentEntriest
359-
// * current marker entries
360-
// * @param marker
361-
// * the marker entry
362-
// * @return <code>true</code> if build is needed <code>false</code> if no
363-
// * update needed
364-
// */
365-
// private boolean hasMarkerRemoval(MarkerEntry[] presentEntriest,
366-
// MarkerEntry marker) {
367-
// for (int i = 0; i < presentEntriest.length; i++) {
368-
// if (presentEntriest[i].getStaleState()
369-
// || presentEntriest[i].getMarker() == null) {
370-
// return true;
371-
// }
372-
// if (marker != null) {
373-
// if (presentEntriest[i].getMarker().equals(marker.getMarker())) {
374-
// return false;
375-
// }
376-
// }
377-
// }
378-
// return false;
379-
// }
380-
//
381-
// /**
382-
// * Returns whether or not markers were removed from the view.
383-
// *
384-
// * @param presentEntriest
385-
// * current marker entries
386-
// * @param marker
387-
// * the marker entry
388-
// * @return <code>true</code> if build is needed <code>false</code> if no
389-
// * update needed
390-
// */
391-
// private boolean hasMarkerChanges(MarkerEntry[] presentEntriest,
392-
// MarkerEntry marker) {
393-
// MarkerContentGenerator generator = builder.getGenerator();
394-
// if (generator.select(marker)) {
395-
// return true;
396-
// }
397-
// for (int i = 0; i < presentEntriest.length; i++) {
398-
// if (presentEntriest[i].getMarker().equals(marker.getMarker())) {
399-
// return true;
400-
// }
401-
//
402-
// }
403-
// return false;
404-
// }
405-
406242
/**
407243
* We are in a pre-build state.
408244
*/
@@ -604,31 +440,6 @@ void cancelQueuedUIUpdates() {
604440
view.cancelQueuedUpdates();
605441
}
606442

607-
///**
608-
// * Indicate the status message on UI.
609-
// *
610-
// * @param messsage
611-
// * the status to display
612-
// */
613-
//void indicateStatus(String messsage) {
614-
// indicateStatus(messsage, false);
615-
//}
616-
////See Bug 294303
617-
///**
618-
// * Indicate the status message on UI.
619-
// *
620-
// * @param messsage
621-
// * the status to display
622-
// * @param updateUI
623-
// * <code>true</code> update label to show changing status
624-
// */
625-
//void indicateStatus(String messsage, boolean updateUI) {
626-
// //See Bug 294303
627-
// view.indicateUpdating(messsage != null ? messsage
628-
// : MarkerMessages.MarkerView_queueing_updates, updateUI);
629-
//}
630-
631-
632443
/**
633444
* //Fix for Bug 294959.There is another patch(more exhaustive in terms
634445
* of possibilities to cover) on the bug in which we keep scheduling
@@ -709,12 +520,6 @@ void update() {
709520
go(delay, cancelable);
710521
}
711522
} else {
712-
//long diff =timeB4Update-currentTime;
713-
//if (diff <= AFTER_MARGIN && diff >= 0) {
714-
// go(0L, false);
715-
//} else {
716-
// go(LONG_DELAY, cancelable);
717-
//}
718523
go(LONG_DELAY, cancelable);
719524
}
720525
} else {

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/HeapStatus.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,6 @@ private void fillMenu(IMenuManager menuMgr) {
303303
menuMgr.add(new ClearMarkAction());
304304
menuMgr.add(new ShowMaxAction());
305305
menuMgr.add(new CloseHeapStatusAction());
306-
// if (isKyrsoftViewAvailable()) {
307-
// menuMgr.add(new ShowKyrsoftViewAction());
308-
// }
309306
}
310307

311308
/**

0 commit comments

Comments
 (0)