Skip to content

Fix preference spy correctness bugs#2345

Open
vogella wants to merge 1 commit into
eclipse-pde:masterfrom
vogella:pref-spy-bugs
Open

Fix preference spy correctness bugs#2345
vogella wants to merge 1 commit into
eclipse-pde:masterfrom
vogella:pref-spy-bugs

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 21, 2026

Planned for 4.41

Fixes four real correctness issues in the Preference Spy: PreferenceEntry's equals/hashCode included mutable fields while instances live in a WritableSet that mutates them in place, which silently broke Set lookups; PreferenceEntryViewerComparator cast a long time delta to int and could overflow; the DeletePreferenceEntries handler removed entries from the root manager instead of their PreferenceNodeEntry parent, making the action a no-op for non-root rows; and a buggy 5-arg constructor accepted a parent argument that it never assigned. Identity is now (nodePath, key), comparator uses Long.compare, delete walks to the actual parent, and the dead constructor is gone.

Preparation for #2344.

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
@github-actions
Copy link
Copy Markdown

Test Results

  122 files   -     4    122 suites   - 4   31m 27s ⏱️ - 4m 22s
3 510 tests ±    0  3 455 ✅  -     1   54 💤 ± 0  1 ❌ +1 
7 194 runs   - 2 139  7 087 ✅  - 2 116  106 💤  - 24  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 32b431e. ± 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