Clean up preference spy#2346
Open
vogella wants to merge 2 commits into
Open
Conversation
PreferenceEntry equals/hashCode included mutable fields (oldValue, newValue, recentlyChanged, parent) while instances live in a WritableSet that mutates them in place, breaking Set.contains/remove. Base identity on (nodePath, key). The unused 5-arg constructor accepted a parent argument but never assigned it, making it a silent bug magnet. Drop it. PreferenceEntryViewerComparator cast a long time delta to int, risking overflow. Use Long.compare. DeletePreferenceEntries removed entries from the manager, but entries are children of their PreferenceNodeEntry parent, so the call was a no-op for non-root entries. Remove from the actual parent instead. Preparation for eclipse-pde#2344
- Rename PreferenceSpyAddon.initialzePreferenceSpy typo to initializePreferenceSpy. - Rename DeletePreferenceEntries / DeleteAllPreferenceEntries in PreferenceSpyPart to camelCase per Java convention. - PreferenceSpyConfiguration: make BUNDLE_ID a static final constant and drop the stray double semicolon. - Use pattern matching for instanceof in PreferenceSpyPart, CollapseAllHandler and ExpandAllHandler. - Type PreferenceNodeEntry.preferenceEntries as IObservableSet<PreferenceEntry> instead of IObservableSet<Object>, simplifying findPreferenceEntry and the content provider walker. - Remove the second setInput call in preferenceChanged: the WritableSet already propagates the addition to the viewer. - Drop the unused setPreferenceEntries setter and removeRecentPreferenceNodeEntry. - Extract the '*default*' marker used by ShowAllPreferencesHandler into a constant. Preparation for eclipse-pde#2344
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Planned for 4.41
Modernizes and tidies the Preference Spy bundle on top of the bug-fix PR (#2345): fixes the
initialzetypo, givesDeletePreferenceEntries/DeleteAllPreferenceEntriesproper camelCase names, turnsbundleIdinto a static finalBUNDLE_IDand drops a stray double semicolon, applies pattern-matchinginstanceof, typesPreferenceNodeEntry.preferenceEntriesasIObservableSet<PreferenceEntry>(which collapses the manualinstanceofwalks in the content provider andfindPreferenceEntry), removes a redundantsetInputcall that propagates for free through the observable set, drops two unused setters, and extracts the"*default*"marker into a constant.Depends on #2345; will be rebased onto master after that lands.
Preparation for #2344.