From 01fca40148396c892dae2d105b010adc4622d7e1 Mon Sep 17 00:00:00 2001 From: Alshama M S Date: Mon, 21 Aug 2023 14:19:09 +0530 Subject: [PATCH] Code Cleanup in pde.core: Edits --- .../pde/internal/core/builders/ExtensionPointSchemaBuilder.java | 1 + .../pde/internal/core/builders/FeatureConsistencyChecker.java | 2 ++ .../eclipse/pde/internal/core/builders/UpdateSiteBuilder.java | 2 ++ .../pde/internal/core/project/ProjectModifyOperation.java | 1 + 4 files changed, 6 insertions(+) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/ExtensionPointSchemaBuilder.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/ExtensionPointSchemaBuilder.java index 44cf8991d1..b87f0f54a4 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/ExtensionPointSchemaBuilder.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/ExtensionPointSchemaBuilder.java @@ -70,6 +70,7 @@ public boolean visit(IResourceDelta delta) { } if (resource instanceof IFile candidate) { + // see if this is it if (isSchemaFile(candidate)) { // That's it, but only check it if it has been added or changed if (delta.getKind() != IResourceDelta.REMOVED) { diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureConsistencyChecker.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureConsistencyChecker.java index 198c958a6e..999275b3ee 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureConsistencyChecker.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/FeatureConsistencyChecker.java @@ -49,6 +49,7 @@ public boolean visit(IResourceDelta delta) { IResource resource = delta.getResource(); if (resource instanceof IProject project) { + // Only check projects with feature nature try { return (project.hasNature(PDE.FEATURE_NATURE)); } catch (CoreException e) { @@ -57,6 +58,7 @@ public boolean visit(IResourceDelta delta) { } } if (resource instanceof IFile candidate) { + // see if this is it if (isManifestFile(candidate)) { // That's it, but only check it if it has been added or changed if (delta.getKind() != IResourceDelta.REMOVED) { diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/UpdateSiteBuilder.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/UpdateSiteBuilder.java index 97583f50a2..f8afd55866 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/UpdateSiteBuilder.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/UpdateSiteBuilder.java @@ -46,6 +46,7 @@ public boolean visit(IResourceDelta delta) { IResource resource = delta.getResource(); if (resource instanceof IProject project) { + // Only check projects with feature nature try { return (project.hasNature(PDE.SITE_NATURE)); } catch (CoreException e) { @@ -54,6 +55,7 @@ public boolean visit(IResourceDelta delta) { } } if (resource instanceof IFile candidate) { + // see if this is it if (candidate.getName().equals("site.xml")) { //$NON-NLS-1$ // That's it, but only check it if it has been added or changed if (delta.getKind() != IResourceDelta.REMOVED) { diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/project/ProjectModifyOperation.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/project/ProjectModifyOperation.java index 75fed4a7a7..6f2538a123 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/project/ProjectModifyOperation.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/project/ProjectModifyOperation.java @@ -517,6 +517,7 @@ private void configureManifest(IBundleProjectDescription description, IBundlePro } } if (pluginBase instanceof IFragment fragment) { + // host specification IHostDescription host = description.getHost(); if (!isEqual(host, before.getHost())) { fragment.setPluginId(host.getName());