@@ -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 {
0 commit comments