Skip to content

Commit 1d94af3

Browse files
Perform clean code of ui/org.eclipse.pde.core
1 parent b6b9ddf commit 1d94af3

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static boolean hasExtensibleAPI(IPluginModelBase model) {
162162

163163
public static boolean isPatchFragment(Resource desc) {
164164
IPluginModelBase model = PluginRegistry.findModel(desc);
165-
return model instanceof IFragmentModel ? isPatchFragment(((IFragmentModel) model).getFragment()) : false;
165+
return model instanceof IFragmentModel i ? isPatchFragment(i.getFragment()) : false;
166166
}
167167

168168
public static boolean isPatchFragment(IPluginModelBase model) {

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public String getSchemaVersion() {
7777
if (root instanceof AbstractExtensions) {
7878
return ((AbstractExtensions) root).getSchemaVersion();
7979
}
80-
return (root instanceof IPluginBase) ? ((IPluginBase) root).getSchemaVersion() : null;
80+
return (root instanceof IPluginBase i) ? i.getSchemaVersion() : null;
8181
}
8282

8383
@Override

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public void deleteBuildFiles(Object object) throws CoreException {
380380
}
381381

382382
if (model.getUnderlyingResource() != null && !isCustomBuild(model)) {
383-
String directory = (model instanceof IFeatureModel) ? ((IFeatureModel) model).getInstallLocation() : ((IPluginModelBase) model).getInstallLocation();
383+
String directory = (model instanceof IFeatureModel i2) ? i2.getInstallLocation() : ((IPluginModelBase) model).getInstallLocation();
384384
File dir = new File(directory);
385385
File[] children = dir.listFiles();
386386
if (children != null) {

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/feature/FeatureImport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class FeatureImport extends VersionableObject implements IFeatureImport {
3838
public IPlugin getPlugin() {
3939
if (id != null && fType == PLUGIN) {
4040
IPluginModelBase model = PluginRegistry.findModel(id, version, VersionUtil.matchRuleFromLiteral(fMatch));
41-
return model instanceof IPluginModel ? ((IPluginModel) model).getPlugin() : null;
41+
return model instanceof IPluginModel i ? i.getPlugin() : null;
4242
}
4343
return null;
4444
}

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public IPluginModelBase getPluginModel() {
116116
return ((IBundlePluginModelProvider) fModel).getBundlePluginModel();
117117
}
118118

119-
return fModel instanceof IPluginModelBase ? (IPluginModelBase) fModel : null;
119+
return fModel instanceof IPluginModelBase i ? i : null;
120120
}
121121

122122
@Override

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/plugin/PluginReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String getId() {
4343
public IPlugin getPlugin() {
4444
if (fPlugin == null && fId != null) {
4545
IPluginModelBase model = findModel();
46-
fPlugin = model instanceof IPluginModel ? ((IPluginModel) model).getPlugin() : null;
46+
fPlugin = model instanceof IPluginModel i ? i.getPlugin() : null;
4747
}
4848
return fPlugin;
4949
}

0 commit comments

Comments
 (0)