Skip to content

Fix ClassCastException when creating new class from Direct Menu Item#1997

Merged
vogella merged 1 commit intoeclipse-pde:masterfrom
vogella:copilot/fix-classcastexception-in-menu
Oct 23, 2025
Merged

Fix ClassCastException when creating new class from Direct Menu Item#1997
vogella merged 1 commit intoeclipse-pde:masterfrom
vogella:copilot/fix-classcastexception-in-menu

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Oct 7, 2025

Creating a new class via the "Class URI" link in the E4 application model
editor threw a ClassCastException due to an invalid type conversion in the
data binding configuration of AbstractNewClassPage.java.

The target-to-model UpdateValueStrategy was missing a converter to transform
the String value from the text field into an IPackageFragmentRoot, leading
to a failed cast by the default converter.

This change introduces StringToPackageFragmentRootConverter to properly map String paths to IPackageFragmentRoot instances and integrates it into
the data binding setup. Users can now open the new class wizard and create
handler classes without errors.

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Test Results

   771 files  ±0     771 suites  ±0   1h 19m 35s ⏱️ + 14m 40s
 3 609 tests ±0   3 557 ✅ ±0   52 💤 ±0  0 ❌ ±0 
10 827 runs  ±0  10 670 ✅ ±0  157 💤 ±0  0 ❌ ±0 

Results for commit ad7f0e1. ± Comparison against base commit f588de6.

♻️ This comment has been updated with latest results.

@vogella vogella force-pushed the copilot/fix-classcastexception-in-menu branch from f4a3bee to 2413d08 Compare October 8, 2025 06:38
@vogella
Copy link
Contributor Author

vogella commented Oct 9, 2025

@HannesWell are the failing tests tracked somewhere? I don't think they are related to this change.

@vogella vogella force-pushed the copilot/fix-classcastexception-in-menu branch from 8032896 to 4eaf9ed Compare October 9, 2025 21:36
Creating a new class via the "Class URI" link in the E4 application
model
editor threw a ClassCastException due to an invalid type conversion in
the
data binding configuration of AbstractNewClassPage.java.

The target-to-model UpdateValueStrategy was missing a converter to
transform
the String value from the text field into an IPackageFragmentRoot,
leading
to a failed cast by the default converter.

This change introduces StringToPackageFragmentRootConverter to properly
map String paths to IPackageFragmentRoot instances and integrates it
into
the data binding setup. Users can now open the new class wizard and
create
handler classes without errors.
@vogella vogella force-pushed the copilot/fix-classcastexception-in-menu branch from 4eaf9ed to ad7f0e1 Compare October 23, 2025 14:25
@vogella vogella merged commit d7659ef into eclipse-pde:master Oct 23, 2025
19 checks passed
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