Commit 4653cf4d authored by Simon Barner's avatar Simon Barner
Browse files

Avoid warnings about unchecked casts

Issue-Ref: 3539
Issue-Url: https://af3-developer.fortiss.org/issues/3539

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 5e2d9c9d
AdvancedTreeViewerEditorBase.java 9d9eded6848ee78991d1416592d1136efd71d2b7 GREEN
AllocationDiagramEditorBase.java fa544546f73eea1150d90b7257b0e6bce82c288c GREEN
CommonDiagramEditorBase.java 054c2922e9e61476adf769ebb061d962503db968 GREEN
CommonDiagramEditorBase.java 69994faea09eec342b8dfaa484ffc03b60978496 YELLOW
ConstraintBasedProcessEditor.java 155a5a7ac41c668ae7ef978e8be13b83f5abd67d GREEN
ConstraintBasedProcessEditorHelper.java 11d48e8a2aecd48eea259a42ef1192c4b292a334 GREEN
DiagramEditorBase.java 09663ce095074d1a8eef086284eea0a7776e0431 GREEN
DiagramKeyHandler.java cfd15ac8f9fc933739cef5e7039960e19826d1ce GREEN
FormsEditorBase.java 4046d340913d951340084ae7240d79f8e75cb8d4 GREEN
GEFEditorBase.java dd1863cd02fac604222c4bc038e6eb8f20ac5dc7 GREEN
GEFEditorBase.java e668f596f45f07215994cbbd3929a9438331718f YELLOW
StyledTextCellEditor.java c709c5092bf54d42ddbac53c8751659020060aef GREEN
TreeViewerEditorBase.java 1c59689ff57c4f3cc180d85f13021fc03461ecb0 GREEN
......@@ -434,16 +434,16 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase<
}
/** {@inheritDoc} */
@SuppressWarnings("rawtypes")
@SuppressWarnings({"unchecked"})
@Override
public Object getAdapter(Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
// This is called, e.g., from the PrintAction
if(adapter == GraphicalViewer.class) {
return viewer;
return (S)viewer;
}
// This adapter is required for the ZoomComboContributionItem
if(adapter == ZoomManager.class) {
return getZoomManager();
return (S)getZoomManager();
}
return super.getAdapter(adapter);
}
......
......@@ -76,12 +76,12 @@ public abstract class GEFEditorBase<T extends EObject>
}
/** {@inheritDoc} */
@SuppressWarnings("rawtypes")
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
// The command stack adaption is required for some of the GEF actions
if(adapter == CommandStack.class) {
return getCommandStack();
return (S)getCommandStack();
}
return super.getAdapter(adapter);
......
ActionBarContributor.java 18d9db3744c5381cca8b6823b5f7bc18183a1cfa GREEN
ExtendableMultiPageEditor.java 25da370d1b27d87c70331cbb056946edfb5489ba GREEN
ExtendableMultiPageEditor.java f8eb6fdc347098fb03e776f23fab61109aa55d6e YELLOW
IActionContributingEditor.java 4aa7496d67822de919a8cf0af0ddaafc61bf2919 GREEN
ModelElementEditorInput.java 520aa7359b2a0718dc210d40476dd61a10f49288 GREEN
ModelElementEditorInput.java e269eff5d992d375a646e54d048f1f0efc6144dd YELLOW
TutorialStepUIEditor.java 9eadc96c302b5131ff4cc3715777718fa06ec7e8 GREEN
TutorialStepUIEditorInput.java 801d3ac79cf92a7ee125d0004ead5cb3d66d5bc3 GREEN
TutorialStepUIEditorInput.java 421a2eb8b52818d9f561328ebb008d60bfef5b4d YELLOW
......@@ -260,10 +260,11 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
if(adapter == IPropertySheetPage.class) {
return new TabbedPropertySheetPage(this);
return (S)new TabbedPropertySheetPage(this);
}
return super.getAdapter(adapter);
}
......
......@@ -60,9 +60,8 @@ public final class ModelElementEditorInput implements IEditorInput {
}
/** {@inheritDoc} */
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
return null;
}
......
......@@ -42,9 +42,8 @@ public final class TutorialStepUIEditorInput implements IEditorInput {
}
/** {@inheritDoc} */
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
return null;
}
......
IdLabeledPropertySection.java 9a419c0aa35c0ab02b38ec769cbd69cea99e66ca RED
NamedCommentedPropertySection.java 0327480eb54090508758ce1d3a97da9fde93cf0f RED
PropertiesAdapterFactory.java 607f4c1cf70e41beb916dbd69160b272e68dc301 GREEN
PropertiesAdapterFactory.java edcf34766a60f21c9ba22a1ba73aa487c3d9a946 YELLOW
......@@ -26,16 +26,16 @@ import org.fortiss.tooling.kernel.ui.util.PropertiesConstantUtils;
*
* @author hoelzl
*/
@SuppressWarnings("rawtypes")
public final class PropertiesAdapterFactory implements IAdapterFactory {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if(adapterType == ITabbedPropertySheetPageContributor.class &&
adaptableObject instanceof EObject) {
EObject modelElement = (EObject)adaptableObject;
if(IPersistencyService.getInstance().getTopLevelElementFor(modelElement) != null) {
return new ITabbedPropertySheetPageContributor() {
return (T)new ITabbedPropertySheetPageContributor() {
@Override
public String getContributorId() {
......@@ -49,7 +49,7 @@ public final class PropertiesAdapterFactory implements IAdapterFactory {
/** {@inheritDoc} */
@Override
public Class[] getAdapterList() {
public Class<?>[] getAdapterList() {
return new Class[] {ITabbedPropertySheetPageContributor.class};
}
}
......@@ -9,4 +9,4 @@ MarkerViewPart.java cbb650271b6877af205421b7cb11f930440a7ef9 GREEN
NavigatorNewMenu.java a35e391960d1dacbe7f77982e53e1891e9382d5a GREEN
NavigatorTreeContentComparator.java d9f1354cfdff78b104b28887d2397e5ca0e9755b YELLOW
NavigatorTreeContentProvider.java 1fbe97bebf3805cc1af190cecd784fc1cfd12306 GREEN
NavigatorViewPart.java 7426503b59605885d8baad9633df69b83d6e38c0 YELLOW
NavigatorViewPart.java a8b1e4e11aedb3fdf80de9ee7c25260abf144201 YELLOW
......@@ -328,11 +328,11 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe
}
/** {@inheritDoc} */
@SuppressWarnings("rawtypes")
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
if(adapter == IPropertySheetPage.class) {
return new TabbedPropertySheetPage(this);
return (S)new TabbedPropertySheetPage(this);
}
return super.getAdapter(adapter);
}
......
ConstraintBases.java 93b4743cc1f5e2677635e644663ba934ef7f7f4e GREEN
ConstraintCheckerBase.java 92de33f1a3071dc6d66a55d8c10f5d5cc967a4fc GREEN
ConstraintViolationBase.java 9b4536f39d2d433b46bdd7881e925b297709442a GREEN
ConstraintViolationBase.java ec66973ab2183623f0cd4a85c59c886dddad6cf6 YELLOW
ElementCompositorBase.java 7a445e5adde11878fe0515baca8b915287149b28 GREEN
MultiViolationConstraintCheckerBase.java 30886a94c99cf8948f64401b1db821abe06e1e6c GREEN
PrototypeProviderBase.java ebcd1794c3798b9899a620b01fd5aa0402129423 GREEN
......
......@@ -85,10 +85,11 @@ public class ConstraintViolationBase<T extends EObject> implements IConstraintVi
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
public <S> S getAdapter(Class<S> adapter) {
if(adapter == EObject.class) {
return getSource();
return (S)getSource();
}
return null;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment