Skip to content
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

Fix "Unnecessary cast" warnings #1312

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.e4.tools.emf.ui;singleton:=true
Bundle-Version: 4.8.400.qualifier
Bundle-Version: 4.8.500.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down
2 changes: 1 addition & 1 deletion e4tools/bundles/org.eclipse.e4.tools.emf.ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>eclipse.platform.ui</groupId>
<artifactId>org.eclipse.e4.tools.emf.ui</artifactId>
<version>4.8.400-SNAPSHOT</version>
<version>4.8.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
int index, EStructuralFeature feature) {
if (liveModel) {
final EObject container = ((EObject) element).eContainer();
@SuppressWarnings("unchecked")

Check warning on line 174 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/common/Util.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
final List<Object> l = (List<Object>) container.eGet(feature);
l.remove(element);

Expand Down Expand Up @@ -326,7 +326,7 @@
IResource r = rd.getResource();
if (r instanceof IFile)
{
if ("e4xmi".equals(((IFile) r).getFileExtension())) { //$NON-NLS-1$
if ("e4xmi".equals(r.getFileExtension())) { //$NON-NLS-1$
modelResourceSet = null;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
column.getColumn().setText(Messages.ControlFactory_KeyColumn);
column.getColumn().setWidth(200);
column.setLabelProvider(new ColumnLabelProvider() {
@SuppressWarnings("unchecked")

Check warning on line 275 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
@Override
public String getText(Object element) {
final Entry<String, String> entry = (Entry<String, String>) element;
Expand All @@ -297,7 +297,7 @@

@Override
protected Object getValue(Object element) {
@SuppressWarnings("unchecked")

Check warning on line 300 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
final Entry<String, String> entry = (Entry<String, String>) element;
return entry.getKey();
}
Expand All @@ -320,7 +320,7 @@
column.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
@SuppressWarnings("unchecked")

Check warning on line 323 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
final Entry<String, String> entry = (Entry<String, String>) element;
return entry.getValue();
}
Expand All @@ -340,7 +340,7 @@
}
}

@SuppressWarnings("unchecked")

Check warning on line 343 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
@Override
protected Object getValue(Object element) {
final Entry<String, String> entry = (Entry<String, String>) element;
Expand All @@ -358,7 +358,7 @@
}
});

@SuppressWarnings("unchecked")

Check warning on line 361 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
final IListProperty<Object, Object> prop = EMFEditProperties.list(editor.getEditingDomain(), feature);
final IObservableList<Object> observableList = prop.observeDetail(editor.getMaster());
tableviewer.setInput(observableList);
Expand Down Expand Up @@ -569,7 +569,7 @@
.observeDetail(editor.getMaster());
final ObservableListContentProvider<E> cp = new ObservableListContentProvider<>();
viewer.setContentProvider(cp);
@SuppressWarnings({ "unchecked", "rawtypes" })

Check warning on line 572 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored

Check warning on line 572 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'rawtypes' is not analysed due to a compiler option being ignored
final IObservableMap<?, ?>[] attributeMaps = {
// Cast, because MUILabel is not part of E's type
((IValueProperty) E4Properties.label(editor.getEditingDomain())).observeDetail(cp.getKnownElements()),
Expand Down Expand Up @@ -674,7 +674,7 @@
final GridData gd = (GridData) viewer.getTable().getLayoutData();
gd.heightHint = 150;

@SuppressWarnings("unchecked")

Check warning on line 677 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
final IListProperty<Object, Object> prop = EMFProperties.list(feature);
viewer.setInput(prop.observeDetail(editor.getMaster()));

Expand Down Expand Up @@ -863,9 +863,9 @@
lnk.setToolTipText(((Text) e.getSource()).getText());
}
});
@SuppressWarnings("unchecked")

Check warning on line 866 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
final Binding binding = context.bindValue(textProp.observeDelayed(200, t),
((IValueProperty<Object, Object>) EMFEditProperties.value(editor.getEditingDomain(), feature))
EMFEditProperties.value(editor.getEditingDomain(), feature)
.observeDetail(editor.getMaster()),
new UpdateValueStrategy<>().setAfterConvertValidator(new ContributionURIValidator()),
new UpdateValueStrategy<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ protected void handleAdd(EClass eClass, boolean separator) {
public List<Action> getActions(Object element) {
final ArrayList<Action> l = new ArrayList<>(super.getActions(element));
l.addAll(actions);
if (((MUIElement) getMaster().getValue()).getVisibleWhen() == null) {
if (getMaster().getValue().getVisibleWhen() == null) {
l.add(addExpression);
}
return l;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
return getImage(element, ResourceProvider.IMG_MenuItem);
}

@SuppressWarnings("unchecked")

Check warning on line 119 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/MenuItemEditor.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
@Override
public Composite doGetEditor(Composite parent, Object object) {
if (composite == null) {
Expand Down Expand Up @@ -386,7 +386,7 @@
@Override
public List<Action> getActions(Object element) {
final ArrayList<Action> l = new ArrayList<>(super.getActions(element));
if (((MUIElement) getMaster().getValue()).getVisibleWhen() == null) {
if (getMaster().getValue().getVisibleWhen() == null) {
l.add(addExpression);
}
return l;
Expand Down Expand Up @@ -417,7 +417,7 @@
this.Messages = Messages;
}

@SuppressWarnings("unchecked")

Check warning on line 420 in e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/MenuItemEditor.java

View check run for this annotation

Jenkins - eclipse-pde / Compiler and API Tools

Unnecessary Code

LOW: At least one of the problems in category 'unchecked' is not analysed due to a compiler option being ignored
@Override
public T convert(Object fromObject) {
if (fromObject == null || fromObject.toString().equals(Messages.MenuItemEditor_NoExpression)) {
Expand Down
2 changes: 1 addition & 1 deletion features/org.eclipse.e4.core.tools.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.eclipse.e4.core.tools.feature"
label="%featureName"
version="4.30.200.qualifier"
version="4.30.300.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
Loading