Skip to content

Clean up preference spy#2346

Open
vogella wants to merge 2 commits into
eclipse-pde:masterfrom
vogella:pref-spy-cleanup
Open

Clean up preference spy#2346
vogella wants to merge 2 commits into
eclipse-pde:masterfrom
vogella:pref-spy-cleanup

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 21, 2026

Planned for 4.41

Modernizes and tidies the Preference Spy bundle on top of the bug-fix PR (#2345): fixes the initialze typo, gives DeletePreferenceEntries/DeleteAllPreferenceEntries proper camelCase names, turns bundleId into a static final BUNDLE_ID and drops a stray double semicolon, applies pattern-matching instanceof, types PreferenceNodeEntry.preferenceEntries as IObservableSet<PreferenceEntry> (which collapses the manual instanceof walks in the content provider and findPreferenceEntry), removes a redundant setInput call 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.

vogella added 2 commits May 21, 2026 13:16
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
@github-actions
Copy link
Copy Markdown

Test Results

  126 files  ±0    126 suites  ±0   35m 25s ⏱️ -24s
3 510 tests ±0  3 456 ✅ ±0   54 💤 ±0  0 ❌ ±0 
9 333 runs  ±0  9 203 ✅ ±0  130 💤 ±0  0 ❌ ±0 

Results for commit d61d193. ± Comparison against base commit 0c81951.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant