Skip to content

Commit bdb0fda

Browse files
eclipse-equinox-botlaeubi
authored andcommitted
Perform clean code of bundles/org.eclipse.equinox.p2.repository.tools
1 parent 47c9491 commit bdb0fda

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ private void recreateRepository(IProgressMonitor monitor) throws ProvisionExcept
126126

127127
IArtifactRepository repository = manager.createRepository(repoLocation, repoName,
128128
IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, repoProperties);
129-
if (!(repository instanceof IFileArtifactRepository)) {
129+
if (!(repository instanceof IFileArtifactRepository simple)) {
130130
throw new ProvisionException(NLS.bind(Messages.exception_notLocalFileRepo, repository.getLocation()));
131131
}
132132

133-
IFileArtifactRepository simple = (IFileArtifactRepository) repository;
134133
for (IArtifactKey key : repoMap.keySet()) {
135134
IArtifactDescriptor[] descriptors = repoMap.get(key);
136135

bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public class HostCheckAnalyzer extends IUAnalyzer {
3535

3636
@Override
3737
public void analyzeIU(IInstallableUnit iu) {
38-
if (iu instanceof IInstallableUnitFragment) {
39-
IInstallableUnitFragment fragment = (IInstallableUnitFragment) iu;
38+
if (iu instanceof IInstallableUnitFragment fragment) {
4039
Collection<IRequirement> hosts = fragment.getHost();
4140
for (IRequirement req : hosts) {
4241
IMatchExpression<IInstallableUnit> hostMatch = req.getMatches();

0 commit comments

Comments
 (0)