-
Notifications
You must be signed in to change notification settings - Fork 121
UI support for setting filter attribute in feature editor #1942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,13 +25,16 @@ | |||||||
| import org.eclipse.pde.core.plugin.IMatchRules; | ||||||||
| import org.eclipse.pde.core.plugin.IPluginImport; | ||||||||
| import org.eclipse.pde.core.plugin.IPluginReference; | ||||||||
| import org.eclipse.pde.internal.core.ifeature.IFeatureImport; | ||||||||
| import org.eclipse.pde.internal.core.plugin.ImportObject; | ||||||||
| import org.eclipse.pde.internal.ui.PDEPlugin; | ||||||||
| import org.eclipse.pde.internal.ui.PDEUIMessages; | ||||||||
| import org.eclipse.pde.internal.ui.editor.FormEntryAdapter; | ||||||||
| import org.eclipse.pde.internal.ui.editor.FormLayoutFactory; | ||||||||
| import org.eclipse.pde.internal.ui.editor.PDEFormPage; | ||||||||
| import org.eclipse.pde.internal.ui.editor.PDESection; | ||||||||
| import org.eclipse.pde.internal.ui.editor.validation.ControlValidationUtility; | ||||||||
| import org.eclipse.pde.internal.ui.editor.validation.TextValidator; | ||||||||
| import org.eclipse.pde.internal.ui.parts.ComboPart; | ||||||||
| import org.eclipse.pde.internal.ui.parts.FormEntry; | ||||||||
| import org.eclipse.swt.SWT; | ||||||||
|
|
@@ -44,13 +47,18 @@ | |||||||
| import org.eclipse.ui.forms.IPartSelectionListener; | ||||||||
| import org.eclipse.ui.forms.widgets.FormToolkit; | ||||||||
| import org.eclipse.ui.forms.widgets.Section; | ||||||||
| import org.osgi.framework.FrameworkUtil; | ||||||||
| import org.osgi.framework.InvalidSyntaxException; | ||||||||
|
|
||||||||
| public class MatchSection extends PDESection implements IPartSelectionListener { | ||||||||
|
|
||||||||
|
|
||||||||
|
||||||||
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The InvalidSyntaxException is silently swallowed without logging or user feedback. While validation occurs in validateFilter(), the exception here indicates the filter was accepted by the validator but failed when creating the actual filter. This scenario should be logged for debugging purposes, similar to how CoreException is handled.
| } catch (InvalidSyntaxException e) { | |
| } catch (InvalidSyntaxException e) { | |
| PDEPlugin.logException(e); |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method unconditionally casts fCurrentImport to IFeatureImport, but MatchSection is also used for plugin imports (IPluginImport) in DependenciesPage. This will cause a ClassCastException when used in the plugin context. The code should check the type and cast appropriately to either IPluginImport or IFeatureImport, both of which support the filter property.
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unconditional cast to IFeatureImport will cause a ClassCastException when MatchSection is used in the plugin dependencies context where fCurrentImport is an IPluginImport. Check the instance type and cast appropriately, as both IPluginImport and IFeatureImport support the filter property.
| fFilterText.setValue(((IFeatureImport) fCurrentImport).getFilter()); | |
| fFilterText.setValue(fCurrentImport.getFilter()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra blank lines at the end of the file should be removed to maintain consistent code formatting.