Skip to content

Commit 3152095

Browse files
eclipse-pde-botakurtakov
authored andcommitted
Perform clean code of ds/org.eclipse.pde.ds.ui
1 parent 5b1d6bf commit 3152095

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

ds/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/editor/DSEditor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ public boolean isSaveAsAllowed() {
162162
@Override
163163
public void doSave(IProgressMonitor monitor) {
164164
IEditorInput input = getEditorInput();
165-
if (input instanceof IFileEditorInput) {
166-
IFileEditorInput fileInput = (IFileEditorInput) input;
165+
if (input instanceof IFileEditorInput fileInput) {
167166
addDSBuilder(fileInput.getFile());
168167
}
169168
super.doSave(monitor);

ds/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/editor/sections/DSPropertiesSection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ public class DSPropertiesSection extends TableSection {
7878
static class ContentProvider implements IStructuredContentProvider {
7979
@Override
8080
public Object[] getElements(Object inputElement) {
81-
if (inputElement instanceof IDSModel) {
82-
IDSModel model = (IDSModel) inputElement;
81+
if (inputElement instanceof IDSModel model) {
8382
IDSComponent component = model.getDSComponent();
8483
if (component != null) {
8584
// gets all children from DS component to get properties and

ds/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/editor/sections/DSProvideSection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ public class DSProvideSection extends TableSection implements
7676
static class ContentProvider implements IStructuredContentProvider {
7777
@Override
7878
public Object[] getElements(Object inputElement) {
79-
if (inputElement instanceof IDSModel) {
80-
IDSModel model = (IDSModel) inputElement;
79+
if (inputElement instanceof IDSModel model) {
8180
IDSComponent component = model.getDSComponent();
8281
if (component != null) {
8382
IDSService service = component.getService();

ds/org.eclipse.pde.ds.ui/src/org/eclipse/pde/internal/ds/ui/editor/sections/DSReferenceSection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ public void dispose() {
120120
static class ContentProvider implements IStructuredContentProvider {
121121
@Override
122122
public Object[] getElements(Object inputElement) {
123-
if (inputElement instanceof IDSModel) {
124-
IDSModel model = (IDSModel) inputElement;
123+
if (inputElement instanceof IDSModel model) {
125124
IDSComponent component = model.getDSComponent();
126125
if (component != null) {
127126
return component.getReferences();

0 commit comments

Comments
 (0)