Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hallgren2009-12-29 11:10:10 +0000
committerThomas Hallgren2009-12-29 11:10:10 +0000
commitadc86299eb41a35ece8a67b9329480d359abe1a6 (patch)
treec390877f71f1d3dd3e519f3a3ccea49632a68c21
parent53b17a1356bdeebcab1fff66577f9d2520ecb103 (diff)
downloadrt.equinox.p2-adc86299eb41a35ece8a67b9329480d359abe1a6.tar.gz
rt.equinox.p2-adc86299eb41a35ece8a67b9329480d359abe1a6.tar.xz
rt.equinox.p2-adc86299eb41a35ece8a67b9329480d359abe1a6.zip
298458: Add Java 5 Generics to the p2 code base
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java92
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/BlobStore.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/Mapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactDescriptor.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java87
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/FlatteningIterator.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/MappedCollectionIterator.java144
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.common/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.common/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.common/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.common/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.console/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs15
-rw-r--r--bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.console/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs626
-rw-r--r--bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.core/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java232
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java42
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java89
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java108
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java50
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java100
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/PermissiveSlicer.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java333
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java320
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java93
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/TwoTierMap.java354
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java70
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/ProfileChangeRequest.java124
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/RequestStatus.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/.settings/org.eclipse.jdt.core.prefs594
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java73
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/DirectoryWatcher.java42
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java47
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ActionManager.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DebugHelper.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineSession.java47
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java49
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java66
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/PhaseSet.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java89
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileParser.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfilePreferences.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java92
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java43
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/TouchpointManager.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CertificateChecker.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Configure.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Install.java39
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Property.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Sizing.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Unconfigure.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Uninstall.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/DefaultPhaseSet.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfile.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfileRegistry.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProvisioningPlan.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ISurrogateProfileHandler.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/MissingAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningContext.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningPlan.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/spi/Memento.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/spi/ProvisioningAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/spi/Touchpoint.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/IUMap.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/URLMetadataRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataParser.java168
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/io/MetadataWriter.java98
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/AbstractMetadataRepository.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/MetadataRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/metadata/repository/SimpleMetadataRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src_ant/org/eclipse/equinox/internal/p2/metadata/repository/ant/CreateCompositeMetadataRepositoryTask.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ArtifactKey.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/BasicVersion.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IRequiredCapability.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnit.java79
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnitFragment.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnitPatch.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/LDAPQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/OSGiVersion.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/OmniVersion.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/RequiredCapability.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ResolvedInstallableUnit.java128
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointData.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TouchpointInstruction.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/TranslationSupport.java67
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormat.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormatParser.java94
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionParser.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionVector.java57
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/IInstallableUnitPatch.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/ITouchpointData.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/MetadataFactory.java70
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/Version.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java42
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQuery.java86
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQueryable.java44
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/ContextQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/ICompositeQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IMatchQuery.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IQueryable.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IUPropertyQuery.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/InstallableUnitQuery.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/LatestIUVersionQuery.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/LimitQuery.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/MatchQuery.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/ObjectMatchQuery.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/PipedQuery.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/QueryHelpers.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/UpdateQuery.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/IInstallableUnit.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/IRequirement.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryMemberQuery.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/CategoryQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/FragmentQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/GroupQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IQueryResult.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/PatchQuery.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/FileSetDescriptor.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/QuotedTokenizer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ExecutablesDescriptor.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureManifestParser.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureParser.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java69
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/swt/tools/IconExe.java6000
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java143
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/IPublisherInfo.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/IPublisherResult.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/Publisher.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherInfo.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherResult.java88
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/ILicenseAdvice.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/IPropertyAdvice.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/IRootIUAdvice.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/JREAction.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootFilesAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUAction.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUAdvice.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/RootIUResultFilterAdvice.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/VersionAdvice.java80
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/AdviceFileAdvice.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/AdviceFileParser.java102
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ApplicationLauncherAction.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java122
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigAdvice.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigCUsAction.java71
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/EclipseInstallAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxLauncherCUAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/Feature.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java123
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAndBundlesPublisherApplication.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/IBrandingAdvice.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/IConfigAdvice.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/InstallPublisherApplication.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductFileAdvice.java43
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductPublisherApplication.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/PublisherHelper.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/AbstractPublishTask.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/FeaturesAndBundlesPublisherTask.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src_ant/org/eclipse/equinox/internal/p2/publisher/ant/ProductPublisherTask.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/.settings/org.eclipse.jdt.core.prefs15
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/comparator/Disassembler.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/comparator/JarComparator.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/comparator/Signature.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/AbstractApplication.java43
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/CompositeRepositoryApplication.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java49
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/SlicingOptions.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/LicenseAnalyzer.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/UniqueIUAnalyzer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/UnzipFeatureJarAnalyzer.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/IUAnalyzer.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/CompositeRepositoryTask.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/Repo2RunnableTask.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryList.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/SlicingOption.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeRepositoryState.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/XMLParser.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/XMLWriter.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/Credentials.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/ProgressStatistics.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/RepositoryStatusHelper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java113
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/DebugHelper.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/RepositoryHelper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/repository/AbstractRepository.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/ICompositeRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepositoryManager.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactKeyQuery.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactDescriptor.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepository.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepositoryManager.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/ArtifactDescriptor.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepository.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/metadata/IMetadataRepositoryManager.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/All p2 UI tests.launch5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/LatestIUVersionElementWrapperTest.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableArtifactRepositoryManagerTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.externalToolBuilders/New_Builder.launch11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/build.properties4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractAntProvisioningTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUPropertyUtils.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MD5Tests.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java93
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java28
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/QueryTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/OperationGenerationTest.java129
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/RepositoryListenerTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/InstructionParserTest.java45
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/PhaseTest.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/generator/PatchIUGeneration.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentMethodTest.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/FragmentTest.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPatchPersistenceTest.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPersistenceTest.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/MultipleIUAndFragmentTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java106
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AdditionalConstraints.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java58
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AbstractPublisherActionTest.java48
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AccumulateConfigDataActionTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceFileParserTest.java110
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java32
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ConfigCUsActionTest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/DefaultCUsActionTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxExecutableActionTest.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxLauncherCUActionTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/FeaturesActionTest.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/JREActionTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileAdviceTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootFilesActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java62
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UtilTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CollectActionTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.testserver/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java52
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java35
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddJVMArgumentAction.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddProgramArgumentAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddSourceBundleAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/ChmodAction.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CollectAction.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallFeatureAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/LinkAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveJVMArgumentAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveProgramArgumentAction.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveRepositoryAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RemoveSourceBundleAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/RepositoryAction.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetLauncherNameAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetProgramPropertyAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallFeatureAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Configuration.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationCache.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationParser.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/ConfigurationWriter.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/Site.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/update/XMLWriter.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ChmodAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupcopyAction.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupzipAction.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CollectAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CopyAction.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/LinkAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/MkdirAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RemoveAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RmdirAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/UnzipAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/build.properties5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/AddProfileDialog.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUGroup.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationGroup.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUImplementationPropertyPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfileGroup.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/ProfilePropertyPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/RepositoryImplementationPropertyPage.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs15
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementQueryDescriptor.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUI.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIAdapterFactory.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java70
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableArtifactRepositoryManager.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableMetadataRepositoryManager.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/RepositoryLocationQuery.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ColocatedRepositoryAction.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ExistingIUInProfileAction.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/InstallAction.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/UpdateAction.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ComboAutoCompleteField.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ContainerCheckedTreeViewer.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/IUPropertyPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionResultsWizardPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SizeComputingWizardPage.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizard.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizardPage.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UpdateWizard.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactElement.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ArtifactRepositoryElement.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableIUElement.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/IIUElement.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/IRepositoryElement.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/InstalledIUElement.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/MetadataRepositoryElement.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProfileElement.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProvElement.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElementWrapper.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/RollbackProfileElement.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/ArtifactRepositoryElementWrapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementWrapper.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/InstalledIUElementWrapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/MetadataRepositoryElementWrapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableProfileRegistry.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryContentProvider.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUComparator.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDragAdapter.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/InstallIUDropAdapter.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementComparer.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementContentProvider.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementLabelProvider.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/RepositoryDetailsLabelProvider.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/Policy.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RevertProfilePage.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/DefaultSiteParser.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/DigestParser.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/LocalUpdateSiteAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/RemoteFeaturesAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/RemoteUpdateSiteAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteCategory.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteFeature.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteModel.java37
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java93
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java4
539 files changed, 9000 insertions, 9106 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath b/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath
index ef379494d..834ea833e 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="bin_ant" path="src_ant"/>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs
index fc844dcb3..2100382a8 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Tue Dec 09 10:24:31 EST 2008
+#Tue Dec 22 19:31:57 CET 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,17 +7,17 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,7 +26,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -88,7 +88,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enab
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
index 401f48a7f..06f8a61a9 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
@@ -82,12 +82,14 @@ Import-Package: javax.xml.parsers,
org.eclipse.osgi.signedcontent;version="1.0.0",
org.eclipse.osgi.util;version="1.1.0",
org.osgi.framework;version="1.3.0",
+ org.osgi.service.prefs;version="1.1.1",
org.osgi.util.tracker;version="1.4.0",
org.w3c.dom,
org.xml.sax;resolution:=optional
Bundle-Activator: org.eclipse.equinox.internal.p2.artifact.repository.Activator
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
CDC-1.1/Foundation-1.1
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)",
org.eclipse.equinox.registry,
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/build.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/build.properties
index 6a66d4e05..086499396 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/build.properties
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/build.properties
@@ -14,3 +14,5 @@ src.includes = about.html,\
source.. = src/
source.ant_tasks/artifactRepository-ant.jar = src_ant/
jars.extra.classpath = platform:/plugin/org.apache.ant/lib/ant.jar
+javacTarget=jsr14
+javacSource=1.5 \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java
index 2dd357fb1..9302f74ce 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Activator.java
@@ -23,7 +23,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
private static BundleContext context;
private ServiceRegistration repositoryManagerRegistration;
- private static final Map createdManagers = new HashMap();
+ private static final Map<ArtifactRepositoryManager, IProvisioningAgent> createdManagers = new HashMap<ArtifactRepositoryManager, IProvisioningAgent>();
private ServiceTracker agentTracker;
public static BundleContext getContext() {
@@ -53,10 +53,10 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
repositoryManagerRegistration.unregister();
repositoryManagerRegistration = null;
synchronized (createdManagers) {
- for (Iterator it = createdManagers.keySet().iterator(); it.hasNext();) {
- ArtifactRepositoryManager manager = (ArtifactRepositoryManager) it.next();
+ for (Iterator<ArtifactRepositoryManager> it = createdManagers.keySet().iterator(); it.hasNext();) {
+ ArtifactRepositoryManager manager = it.next();
manager.shutdown();
- IProvisioningAgent agent = (IProvisioningAgent) createdManagers.get(manager);
+ IProvisioningAgent agent = createdManagers.get(manager);
agent.unregisterService(IArtifactRepositoryManager.SERVICE_NAME, manager);
}
createdManagers.clear();
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java
index 45d3500c8..c4066d7fb 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java
@@ -12,7 +12,8 @@
package org.eclipse.equinox.internal.p2.artifact.repository;
import java.net.URI;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
@@ -30,7 +31,7 @@ import org.eclipse.equinox.p2.repository.artifact.*;
* TODO the current assumption that the "location" is the dir/root limits us to
* having just one repository in a given URL..
*/
-public class ArtifactRepositoryManager extends AbstractRepositoryManager implements IArtifactRepositoryManager {
+public class ArtifactRepositoryManager extends AbstractRepositoryManager<IArtifactKey> implements IArtifactRepositoryManager {
public ArtifactRepositoryManager() {
super();
@@ -40,11 +41,11 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme
super.addRepository(repository, true, null);
}
- public IArtifactRequest createMirrorRequest(IArtifactKey key, IArtifactRepository destination, Properties destinationDescriptorProperties, Properties destinationRepositoryProperties) {
+ public IArtifactRequest createMirrorRequest(IArtifactKey key, IArtifactRepository destination, Map<String, String> destinationDescriptorProperties, Map<String, String> destinationRepositoryProperties) {
return new MirrorRequest(key, destination, destinationDescriptorProperties, destinationRepositoryProperties);
}
- public IArtifactRepository createRepository(URI location, String name, String type, Map properties) throws ProvisionException {
+ public IArtifactRepository createRepository(URI location, String name, String type, Map<String, String> properties) throws ProvisionException {
return (IArtifactRepository) doCreateRepository(location, name, type, properties);
}
@@ -52,7 +53,7 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme
return (IArtifactRepository) basicGetRepository(location);
}
- protected IRepository factoryCreate(URI location, String name, String type, Map properties, IExtension extension) throws ProvisionException {
+ protected IRepository<IArtifactKey> factoryCreate(URI location, String name, String type, Map<String, String> properties, IExtension extension) throws ProvisionException {
ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) createExecutableExtension(extension, EL_FACTORY);
if (factory == null)
return null;
@@ -60,7 +61,7 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme
return factory.create(location, name, type, properties);
}
- protected IRepository factoryLoad(URI location, IExtension extension, int flags, SubMonitor monitor) throws ProvisionException {
+ protected IRepository<IArtifactKey> factoryLoad(URI location, IExtension extension, int flags, SubMonitor monitor) throws ProvisionException {
ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) createExecutableExtension(extension, EL_FACTORY);
if (factory == null)
return null;
@@ -123,7 +124,7 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme
LogHelper.log(new Status(IStatus.ERROR, Activator.ID, "Error occurred while loading download cache.", e)); //$NON-NLS-1$
}
try {
- Map properties = new HashMap(1);
+ Map<String, String> properties = new HashMap<String, String>(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
createRepository(cacheLocation, "download cache", TYPE_SIMPLE_REPOSITORY, properties); //$NON-NLS-1$
} catch (ProvisionException e) {
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
index 5b05cf8d9..1083d302e 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
@@ -35,7 +35,7 @@ import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.osgi.util.NLS;
-public class CompositeArtifactRepository extends AbstractArtifactRepository implements IArtifactRepository, ICompositeRepository {
+public class CompositeArtifactRepository extends AbstractArtifactRepository implements ICompositeRepository<IArtifactKey> {
static final public String REPOSITORY_TYPE = CompositeArtifactRepository.class.getName();
static final private Integer REPOSITORY_VERSION = new Integer(1);
@@ -46,9 +46,9 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
// keep a list of the child URIs. they can be absolute or relative. they may or may not point
// to a valid reachable repo
- private List childrenURIs = new ArrayList();
+ private List<URI> childrenURIs = new ArrayList<URI>();
// keep a list of the repositories that we have successfully loaded
- private List loadedRepos = new ArrayList();
+ private List<ChildInfo> loadedRepos = new ArrayList<ChildInfo>();
private IArtifactRepositoryManager manager;
/**
@@ -94,7 +94,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
addChild(state.getChildren()[i], false);
}
- CompositeArtifactRepository(IArtifactRepositoryManager manager, URI location, String repositoryName, Map properties) {
+ CompositeArtifactRepository(IArtifactRepositoryManager manager, URI location, String repositoryName, Map<String, String> properties) {
super(repositoryName, REPOSITORY_TYPE, REPOSITORY_VERSION.toString(), location, null, null, properties);
this.manager = manager;
save();
@@ -114,7 +114,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
result.setProvider(getProvider());
result.setProperties(getProperties());
// it is important to directly access the field so we have the relative URIs
- result.setChildren((URI[]) childrenURIs.toArray(new URI[childrenURIs.size()]));
+ result.setChildren(childrenURIs.toArray(new URI[childrenURIs.size()]));
return result;
}
@@ -123,7 +123,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
* in it. Return a boolean value indicating whether or not the object was
* actually added.
*/
- private static boolean add(List list, Object obj) {
+ private static <T> boolean add(List<T> list, T obj) {
return list.contains(obj) ? false : list.add(obj);
}
@@ -201,8 +201,8 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
if (removed) {
// we removed the child from the list so remove the associated repo object as well
ChildInfo found = null;
- for (Iterator iter = loadedRepos.iterator(); found == null && iter.hasNext();) {
- ChildInfo current = (ChildInfo) iter.next();
+ for (Iterator<ChildInfo> iter = loadedRepos.iterator(); found == null && iter.hasNext();) {
+ ChildInfo current = iter.next();
URI repoLocation = current.repo.getLocation();
if (URIUtil.sameURI(childURI, repoLocation))
found = current;
@@ -221,10 +221,10 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
save();
}
- public List getChildren() {
- List result = new ArrayList();
- for (Iterator iter = childrenURIs.iterator(); iter.hasNext();)
- result.add(URIUtil.makeAbsolute((URI) iter.next(), location));
+ public List<URI> getChildren() {
+ List<URI> result = new ArrayList<URI>();
+ for (Iterator<URI> iter = childrenURIs.iterator(); iter.hasNext();)
+ result.add(URIUtil.makeAbsolute(iter.next(), location));
return result;
}
@@ -273,8 +273,8 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
public boolean contains(IArtifactKey key) {
- for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
- ChildInfo current = (ChildInfo) repositoryIterator.next();
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
+ ChildInfo current = repositoryIterator.next();
if (current.isGood() && current.repo.contains(key))
return true;
}
@@ -282,8 +282,8 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
public boolean contains(IArtifactDescriptor descriptor) {
- for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
- ChildInfo current = (ChildInfo) repositoryIterator.next();
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
+ ChildInfo current = repositoryIterator.next();
if (current.isGood() && current.repo.contains(descriptor))
return true;
}
@@ -291,23 +291,23 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
- ArrayList result = new ArrayList();
- for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
- ChildInfo current = (ChildInfo) repositoryIterator.next();
+ ArrayList<IArtifactDescriptor> result = new ArrayList<IArtifactDescriptor>();
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
+ ChildInfo current = repositoryIterator.next();
if (current.isGood()) {
IArtifactDescriptor[] tempResult = current.repo.getArtifactDescriptors(key);
for (int i = 0; i < tempResult.length; i++)
add(result, tempResult[i]);
}
}
- return (IArtifactDescriptor[]) result.toArray(new IArtifactDescriptor[result.size()]);
+ return result.toArray(new IArtifactDescriptor[result.size()]);
}
public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor.convert(monitor, requests.length);
MultiStatus multiStatus = new MultiStatus(Activator.ID, IStatus.OK, Messages.message_childrenRepos, null);
- for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext() && requests.length > 0;) {
- IArtifactRepository current = ((ChildInfo) repositoryIterator.next()).repo;
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext() && requests.length > 0;) {
+ IArtifactRepository current = repositoryIterator.next().repo;
IArtifactRequest[] applicable = getRequestsForRepository(current, requests);
IStatus dlStatus = current.getArtifacts(applicable, subMonitor.newChild(requests.length));
multiStatus.add(dlStatus);
@@ -331,8 +331,8 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
private IStatus getRawOrNormalArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor, boolean raw) {
- for (Iterator childIterator = loadedRepos.iterator(); childIterator.hasNext();) {
- ChildInfo current = (ChildInfo) childIterator.next();
+ for (Iterator<ChildInfo> childIterator = loadedRepos.iterator(); childIterator.hasNext();) {
+ ChildInfo current = childIterator.next();
if (current.isGood() && current.repo.contains(descriptor)) {
// Child hasn't failed & contains descriptor
IStatus status = raw ? current.repo.getRawArtifact(descriptor, destination, monitor) : current.repo.getArtifact(descriptor, destination, monitor);
@@ -358,7 +358,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
private IArtifactRequest[] filterUnfetched(IArtifactRequest[] requests) {
- ArrayList filteredRequests = new ArrayList();
+ ArrayList<IArtifactRequest> filteredRequests = new ArrayList<IArtifactRequest>();
for (int i = 0; i < requests.length; i++) {
if (requests[i].getResult() == null || !requests[i].getResult().isOK()) {
filteredRequests.add(requests[i]);
@@ -371,18 +371,18 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
private IArtifactRequest[] getRequestsForRepository(IArtifactRepository repository, IArtifactRequest[] requests) {
- ArrayList applicable = new ArrayList();
+ ArrayList<IArtifactRequest> applicable = new ArrayList<IArtifactRequest>();
for (int i = 0; i < requests.length; i++) {
if (repository.contains(requests[i].getArtifactKey()))
applicable.add(requests[i]);
}
- return (IArtifactRequest[]) applicable.toArray(new IArtifactRequest[applicable.size()]);
+ return applicable.toArray(new IArtifactRequest[applicable.size()]);
}
private void save() {
if (!isModifiable())
return;
- boolean compress = "true".equalsIgnoreCase((String) properties.get(PROP_COMPRESSED)); //$NON-NLS-1$
+ boolean compress = "true".equalsIgnoreCase(properties.get(PROP_COMPRESSED)); //$NON-NLS-1$
OutputStream os = null;
try {
URI actualLocation = getActualLocation(location, false);
@@ -441,8 +441,8 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
*/
private boolean isSane(IArtifactRepository toCheckRepo, String comparatorID) {
IArtifactComparator comparator = ArtifactComparatorFactory.getArtifactComparator(comparatorID);
- for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
- IArtifactRepository current = ((ChildInfo) repositoryIterator.next()).repo;
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
+ IArtifactRepository current = repositoryIterator.next().repo;
if (!current.equals(toCheckRepo)) {
if (!isSane(toCheckRepo, current, comparator))
return false;
@@ -455,9 +455,9 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
* Check the two given repositories against each other using the given comparator.
*/
private boolean isSane(IArtifactRepository one, IArtifactRepository two, IArtifactComparator comparator) {
- IQueryResult toCheckKeys = one.query(ArtifactKeyQuery.ALL_KEYS, null);
- for (Iterator iterator = toCheckKeys.iterator(); iterator.hasNext();) {
- IArtifactKey key = (IArtifactKey) iterator.next();
+ IQueryResult<IArtifactKey> toCheckKeys = one.query(ArtifactKeyQuery.ALL_KEYS, null);
+ for (Iterator<IArtifactKey> iterator = toCheckKeys.iterator(); iterator.hasNext();) {
+ IArtifactKey key = iterator.next();
if (!two.contains(key))
continue;
IArtifactDescriptor[] toCheckDescriptors = one.getArtifactDescriptors(key);
@@ -489,7 +489,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
*/
public boolean validate(String comparatorID) {
IArtifactComparator comparator = ArtifactComparatorFactory.getArtifactComparator(comparatorID);
- ChildInfo[] repos = (ChildInfo[]) loadedRepos.toArray(new ChildInfo[loadedRepos.size()]);
+ ChildInfo[] repos = loadedRepos.toArray(new ChildInfo[loadedRepos.size()]);
for (int outer = 0; outer < repos.length; outer++) {
for (int inner = outer + 1; inner < repos.length; inner++) {
if (!isSane(repos[outer].repo, repos[inner].repo, comparator))
@@ -516,15 +516,29 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
}
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
// Query all the all the repositories this composite repo contains
- List repos = new ArrayList();
- for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
- ChildInfo info = (ChildInfo) repositoryIterator.next();
+ List<IArtifactRepository> repos = new ArrayList<IArtifactRepository>();
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
+ ChildInfo info = repositoryIterator.next();
if (info.isGood())
repos.add(info.repo);
}
- CompoundQueryable queryable = new CompoundQueryable((IQueryable[]) repos.toArray(new IQueryable[repos.size()]));
+ @SuppressWarnings("unchecked")
+ CompoundQueryable<IArtifactKey> queryable = new CompoundQueryable<IArtifactKey>(repos.toArray(new IQueryable[repos.size()]));
return queryable.query(query, monitor);
}
+
+ public IQueryable<IArtifactDescriptor> descriptorQueryable() {
+ // Query all the all the repositories this composite repo contains
+ List<IQueryable<IArtifactDescriptor>> repos = new ArrayList<IQueryable<IArtifactDescriptor>>();
+ for (Iterator<ChildInfo> repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
+ ChildInfo info = repositoryIterator.next();
+ if (info.isGood())
+ repos.add(info.repo.descriptorQueryable());
+ }
+ @SuppressWarnings("unchecked")
+ CompoundQueryable<IArtifactDescriptor> queryable = new CompoundQueryable<IArtifactDescriptor>(repos.toArray(new IQueryable[repos.size()]));
+ return queryable;
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java
index c5a2deb75..76cda1679 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java
@@ -124,7 +124,7 @@ public class CompositeArtifactRepositoryFactory extends ArtifactRepositoryFactor
}
}
- public IArtifactRepository create(URI location, String name, String type, Map properties) {
+ public IArtifactRepository create(URI location, String name, String type, Map<String, String> properties) {
return new CompositeArtifactRepository(getManager(), location, name, properties);
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
index bdcdf0da7..ff2f42237 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
@@ -13,7 +13,8 @@
package org.eclipse.equinox.internal.p2.artifact.repository;
import java.io.*;
-import java.util.Properties;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactDescriptor;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
@@ -31,24 +32,24 @@ import org.eclipse.osgi.util.NLS;
public class MirrorRequest extends ArtifactRequest {
protected final IArtifactRepository target;
- private final Properties targetDescriptorProperties;
- private final Properties targetRepositoryProperties;
+ private final Map<String, String> targetDescriptorProperties;
+ private final Map<String, String> targetRepositoryProperties;
protected IArtifactDescriptor descriptor;
- public MirrorRequest(IArtifactKey key, IArtifactRepository targetRepository, Properties targetDescriptorProperties, Properties targetRepositoryProperties) {
+ public MirrorRequest(IArtifactKey key, IArtifactRepository targetRepository, Map<String, String> targetDescriptorProperties, Map<String, String> targetRepositoryProperties) {
super(key);
target = targetRepository;
if (targetDescriptorProperties == null || targetDescriptorProperties.isEmpty()) {
this.targetDescriptorProperties = null;
} else {
- this.targetDescriptorProperties = new Properties();
+ this.targetDescriptorProperties = new HashMap<String, String>();
this.targetDescriptorProperties.putAll(targetDescriptorProperties);
}
if (targetRepositoryProperties == null || targetRepositoryProperties.isEmpty()) {
this.targetRepositoryProperties = null;
} else {
- this.targetRepositoryProperties = new Properties();
+ this.targetRepositoryProperties = new HashMap<String, String>();
this.targetRepositoryProperties.putAll(targetRepositoryProperties);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java
index 77b0f05a1..6fb6259de 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorSelector.java
@@ -39,7 +39,7 @@ public class MirrorSelector {
/**
* Encapsulates information about a single mirror
*/
- public static class MirrorInfo implements Comparable {
+ public static class MirrorInfo implements Comparable<MirrorInfo> {
long bytesPerSecond;
int failureCount;
private final int initialRank;
@@ -57,10 +57,7 @@ public class MirrorSelector {
/**
* Comparison used to sort mirrors.
*/
- public int compareTo(Object o) {
- if (!(o instanceof MirrorInfo))
- return 0;
- MirrorInfo that = (MirrorInfo) o;
+ public int compareTo(MirrorInfo that) {
//less failures is better
if (this.failureCount != that.failureCount)
return this.failureCount - that.failureCount;
@@ -91,7 +88,7 @@ public class MirrorSelector {
MirrorInfo[] mirrors;
- private final IRepository repository;
+ private final IRepository<?> repository;
private final Random random = new Random();
@@ -100,10 +97,10 @@ public class MirrorSelector {
* not contacted and the mirrorsURL document is not parsed until a
* mirror location request is sent.
*/
- public MirrorSelector(IRepository repository) {
+ public MirrorSelector(IRepository<?> repository) {
this.repository = repository;
try {
- String base = (String) repository.getProperties().get(IRepository.PROP_MIRRORS_BASE_URL);
+ String base = repository.getProperties().get(IRepository.PROP_MIRRORS_BASE_URL);
if (base != null) {
this.baseURI = new URI(base);
} else {
@@ -204,7 +201,7 @@ public class MirrorSelector {
private MirrorInfo[] initMirrors(IProgressMonitor monitor) {
if (mirrors != null)
return mirrors;
- String mirrorsURL = (String) repository.getProperties().get(IRepository.PROP_MIRRORS_URL);
+ String mirrorsURL = repository.getProperties().get(IRepository.PROP_MIRRORS_URL);
if (mirrorsURL != null)
mirrors = computeMirrors(mirrorsURL, monitor);
return mirrors;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java
index 55330678a..2108b52f4 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/SignatureVerifier.java
@@ -78,7 +78,7 @@ public class SignatureVerifier extends ProcessingStep {
} catch (GeneralSecurityException e) {
return new Status(IStatus.ERROR, Activator.ID, Messages.SignatureVerification_failedRead + inputFile, e);
}
- ArrayList allStatus = new ArrayList(0);
+ ArrayList<IStatus> allStatus = new ArrayList<IStatus>(0);
SignedContentEntry[] entries = signedContent.getSignedEntries();
for (int i = 0; i < entries.length; i++)
try {
@@ -90,7 +90,7 @@ public class SignatureVerifier extends ProcessingStep {
break;
}
if (allStatus.size() > 0)
- return new MultiStatus(Activator.ID, IStatus.ERROR, (IStatus[]) allStatus.toArray(new IStatus[allStatus.size()]), Messages.SignatureVerification_invalidFileContent + inputFile, null);
+ return new MultiStatus(Activator.ID, IStatus.ERROR, allStatus.toArray(new IStatus[allStatus.size()]), Messages.SignatureVerification_invalidFileContent + inputFile, null);
return Status.OK_STATUS;
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/BlobStore.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/BlobStore.java
index e3697cbee..cd795e85f 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/BlobStore.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/BlobStore.java
@@ -93,9 +93,9 @@ public class BlobStore {
/**
* Delete all of the blobs in the given set.
*/
- public void deleteBlobs(Set set) {
- for (Iterator i = set.iterator(); i.hasNext();)
- deleteBlob((byte[]) i.next());
+ public void deleteBlobs(Set<byte[]> set) {
+ for (Iterator<byte[]> i = set.iterator(); i.hasNext();)
+ deleteBlob(i.next());
}
public URI fileFor(byte[] uuid) {
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java
index 6ef140ac3..69aee86ef 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java
@@ -18,7 +18,7 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;
public class DownloadJob extends Job {
static final Object FAMILY = new Object();
- private LinkedList requestsPending;
+ private LinkedList<IArtifactRequest> requestsPending;
private SimpleArtifactRepository repository;
private IProgressMonitor masterMonitor;
private MultiStatus overallStatus;
@@ -28,7 +28,7 @@ public class DownloadJob extends Job {
setSystem(true);
}
- void initialize(SimpleArtifactRepository repository, LinkedList requestsPending, IProgressMonitor masterMonitor, MultiStatus overallStatus) {
+ void initialize(SimpleArtifactRepository repository, LinkedList<IArtifactRequest> requestsPending, IProgressMonitor masterMonitor, MultiStatus overallStatus) {
this.repository = repository;
this.requestsPending = requestsPending;
this.masterMonitor = masterMonitor;
@@ -53,7 +53,7 @@ public class DownloadJob extends Job {
synchronized (requestsPending) {
if (requestsPending.isEmpty())
break;
- request = (IArtifactRequest) requestsPending.removeFirst();
+ request = requestsPending.removeFirst();
}
if (masterMonitor.isCanceled())
return Status.CANCEL_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/Mapper.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/Mapper.java
index de962a7c7..a6a3f8780 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/Mapper.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/Mapper.java
@@ -53,7 +53,7 @@ public class Mapper {
public URI map(URI repositoryLocation, String classifier, String id, String version, String format) {
String locationString = URIUtil.toUnencodedString(repositoryLocation);
- Dictionary values = new Hashtable(5);
+ Dictionary<String, Object> values = new Hashtable<String, Object>(5);
if (repositoryLocation != null)
values.put(REPOURL, locationString);
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactDescriptor.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactDescriptor.java
index 23b3e6b70..e458813ee 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactDescriptor.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactDescriptor.java
@@ -19,7 +19,7 @@ import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
public class SimpleArtifactDescriptor extends ArtifactDescriptor {
public static final String ARTIFACT_REFERENCE = "artifact.reference"; //$NON-NLS-1$
- protected Map repositoryProperties = new OrderedProperties();
+ protected Map<String, String> repositoryProperties = new OrderedProperties();
public SimpleArtifactDescriptor(IArtifactKey key) {
super(key);
@@ -34,7 +34,7 @@ public class SimpleArtifactDescriptor extends ArtifactDescriptor {
}
public String getRepositoryProperty(String propertyKey) {
- return (String) repositoryProperties.get(propertyKey);
+ return repositoryProperties.get(propertyKey);
}
public void setRepositoryProperty(String key, String value) {
@@ -44,7 +44,7 @@ public class SimpleArtifactDescriptor extends ArtifactDescriptor {
repositoryProperties.put(key, value);
}
- public void addRepositoryProperties(Map additionalProperties) {
+ public void addRepositoryProperties(Map<String, String> additionalProperties) {
repositoryProperties.putAll(additionalProperties);
}
@@ -52,7 +52,7 @@ public class SimpleArtifactDescriptor extends ArtifactDescriptor {
* Returns a read-only collection of the repository properties of the artifact descriptor.
* @return the repository properties of this artifact descriptor.
*/
- public Map getRepositoryProperties() {
+ public Map<String, String> getRepositoryProperties() {
return OrderedProperties.unmodifiableProperties(repositoryProperties);
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index 79c5f1f4f..5dd8240b2 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -15,6 +15,7 @@ import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
+import java.util.Map.Entry;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import org.eclipse.core.runtime.*;
@@ -28,10 +29,10 @@ import org.eclipse.equinox.internal.p2.repository.RepositoryTransport;
import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository;
-import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.MappedCollectionIterator;
+import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.FlatteningIterator;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
@@ -202,11 +203,11 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
static final private Integer REPOSITORY_VERSION = new Integer(1);
private static final String XML_EXTENSION = ".xml"; //$NON-NLS-1$
- protected Set artifactDescriptors = new HashSet();
+ protected Set<SimpleArtifactDescriptor> artifactDescriptors = new HashSet<SimpleArtifactDescriptor>();
/**
* Map<IArtifactKey,List<IArtifactDescriptor>> containing the index of artifacts in the repository.
*/
- protected Map artifactMap = new HashMap();
+ protected Map<IArtifactKey, List<IArtifactDescriptor>> artifactMap = new HashMap<IArtifactKey, List<IArtifactDescriptor>>();
private transient BlobStore blobStore;
transient private Mapper mapper = new Mapper();
@@ -257,19 +258,19 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
/*
* This is only called by the parser when loading a repository.
*/
- SimpleArtifactRepository(String name, String type, String version, String description, String provider, Set artifacts, String[][] mappingRules, Map properties) {
+ SimpleArtifactRepository(String name, String type, String version, String description, String provider, Set<SimpleArtifactDescriptor> artifacts, String[][] mappingRules, Map<String, String> properties) {
super(name, type, version, null, description, provider, properties);
this.artifactDescriptors.addAll(artifacts);
this.mappingRules = mappingRules;
- for (Iterator it = artifactDescriptors.iterator(); it.hasNext();)
- mapDescriptor((IArtifactDescriptor) it.next());
+ for (Iterator<SimpleArtifactDescriptor> it = artifactDescriptors.iterator(); it.hasNext();)
+ mapDescriptor(it.next());
}
private void mapDescriptor(IArtifactDescriptor descriptor) {
IArtifactKey key = descriptor.getArtifactKey();
- Collection descriptors = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> descriptors = artifactMap.get(key);
if (descriptors == null) {
- descriptors = new ArrayList();
+ descriptors = new ArrayList<IArtifactDescriptor>();
artifactMap.put(key, descriptors);
}
descriptors.add(descriptor);
@@ -277,7 +278,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
private void unmapDescriptor(IArtifactDescriptor descriptor) {
IArtifactKey key = descriptor.getArtifactKey();
- Collection descriptors = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> descriptors = artifactMap.get(key);
if (descriptors == null)
return;
@@ -286,13 +287,13 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
artifactMap.remove(key);
}
- public SimpleArtifactRepository(String repositoryName, URI location, Map properties) {
+ public SimpleArtifactRepository(String repositoryName, URI location, Map<String, String> properties) {
super(repositoryName, REPOSITORY_TYPE, REPOSITORY_VERSION.toString(), location, null, null, properties);
initializeAfterLoad(location);
if (properties != null) {
if (properties.containsKey(PUBLISH_PACK_FILES_AS_SIBLINGS)) {
synchronized (this) {
- String newValue = (String) properties.get(PUBLISH_PACK_FILES_AS_SIBLINGS);
+ String newValue = properties.get(PUBLISH_PACK_FILES_AS_SIBLINGS);
if (Boolean.TRUE.toString().equals(newValue)) {
mappingRules = PACKED_MAPPING_RULES;
} else {
@@ -326,10 +327,10 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
if (isFolderBased(descriptor))
internal.setRepositoryProperty(ARTIFACT_FOLDER, Boolean.TRUE.toString());
if (descriptor instanceof SimpleArtifactDescriptor) {
- Map repoProperties = ((SimpleArtifactDescriptor) descriptor).getRepositoryProperties();
- for (Iterator iterator = repoProperties.keySet().iterator(); iterator.hasNext();) {
- String key = (String) iterator.next();
- internal.setRepositoryProperty(key, (String) repoProperties.get(key));
+ Map<String, String> repoProperties = ((SimpleArtifactDescriptor) descriptor).getRepositoryProperties();
+ for (Iterator<Entry<String, String>> iterator = repoProperties.entrySet().iterator(); iterator.hasNext();) {
+ Entry<String, String> entry = iterator.next();
+ internal.setRepositoryProperty(entry.getKey(), entry.getValue());
}
}
return internal;
@@ -339,7 +340,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
for (int i = 0; i < descriptors.length; i++) {
if (artifactDescriptors.contains(descriptors[i]))
continue;
- ArtifactDescriptor internalDescriptor = createInternalDescriptor(descriptors[i]);
+ SimpleArtifactDescriptor internalDescriptor = createInternalDescriptor(descriptors[i]);
artifactDescriptors.add(internalDescriptor);
mapDescriptor(internalDescriptor);
}
@@ -347,17 +348,17 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
private synchronized OutputStream addPostSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
- ArrayList steps = new ArrayList();
+ ArrayList<ProcessingStep> steps = new ArrayList<ProcessingStep>();
steps.add(new SignatureVerifier());
if (steps.isEmpty())
return destination;
- ProcessingStep[] stepArray = (ProcessingStep[]) steps.toArray(new ProcessingStep[steps.size()]);
+ ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]);
// TODO should probably be using createAndLink here
return handler.link(stepArray, destination, monitor);
}
private OutputStream addPreSteps(ProcessingStepHandler handler, IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) {
- ArrayList steps = new ArrayList();
+ ArrayList<ProcessingStep> steps = new ArrayList<ProcessingStep>();
if (IArtifactDescriptor.TYPE_ZIP.equals(descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE)))
steps.add(new ZipVerifierStep());
if (MD5_CHECK_ENABLED && descriptor.getProperty(IArtifactDescriptor.DOWNLOAD_MD5) != null)
@@ -365,7 +366,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
// Add steps here if needed
if (steps.isEmpty())
return destination;
- ProcessingStep[] stepArray = (ProcessingStep[]) steps.toArray(new ProcessingStep[steps.size()]);
+ ProcessingStep[] stepArray = steps.toArray(new ProcessingStep[steps.size()]);
// TODO should probably be using createAndLink here
return handler.link(stepArray, destination, monitor);
}
@@ -527,6 +528,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
return mirrors.getMirrorLocation(baseLocation, monitor);
}
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
// if we are adapting to file or writable repositories then make sure we have a file location
if (adapter == IFileArtifactRepository.class)
@@ -556,11 +558,11 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
- Collection result = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> result = artifactMap.get(key);
if (result == null)
return new IArtifactDescriptor[0];
- return (IArtifactDescriptor[]) result.toArray(new IArtifactDescriptor[result.size()]);
+ return result.toArray(new IArtifactDescriptor[result.size()]);
}
public File getArtifactFile(IArtifactDescriptor descriptor) {
@@ -579,7 +581,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) {
final MultiStatus overallStatus = new MultiStatus(Activator.ID, IStatus.OK, null, null);
- LinkedList requestsPending = new LinkedList(Arrays.asList(requests));
+ LinkedList<IArtifactRequest> requestsPending = new LinkedList<IArtifactRequest>(Arrays.asList(requests));
int numberOfJobs = Math.min(requests.length, getMaximumThreads());
if (numberOfJobs <= 1 || (!isForceThreading() && isLocal())) {
@@ -619,12 +621,12 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
public synchronized IArtifactDescriptor getCompleteArtifactDescriptor(IArtifactKey key) {
- Collection descriptors = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> descriptors = artifactMap.get(key);
if (descriptors == null)
return null;
- for (Iterator iterator = descriptors.iterator(); iterator.hasNext();) {
- IArtifactDescriptor desc = (IArtifactDescriptor) iterator.next();
+ for (Iterator<IArtifactDescriptor> iterator = descriptors.iterator(); iterator.hasNext();) {
+ IArtifactDescriptor desc = iterator.next();
// look for a descriptor that matches the key and is "complete"
if (desc.getArtifactKey().equals(key) && desc.getProcessingSteps().length == 0)
return desc;
@@ -632,7 +634,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
return null;
}
- public synchronized Set getDescriptors() {
+ public synchronized Set<SimpleArtifactDescriptor> getDescriptors() {
return artifactDescriptors;
}
@@ -700,7 +702,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
*/
private int getMaximumThreads() {
try {
- String maxThreadString = (String) getProperties().get(PROP_MAX_THREADS);
+ String maxThreadString = getProperties().get(PROP_MAX_THREADS);
if (maxThreadString != null)
return Math.max(1, Integer.parseInt(maxThreadString));
} catch (NumberFormatException nfe) {
@@ -794,8 +796,8 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
this.location = repoLocation;
blobStore = new BlobStore(getBlobStoreLocation(repoLocation), 128);
initializeMapper();
- for (Iterator i = artifactDescriptors.iterator(); i.hasNext();) {
- ((ArtifactDescriptor) i.next()).setRepository(this);
+ for (Iterator<SimpleArtifactDescriptor> i = artifactDescriptors.iterator(); i.hasNext();) {
+ i.next().setRepository(this);
}
}
@@ -839,7 +841,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
public synchronized void removeAll() {
- IArtifactDescriptor[] toRemove = (IArtifactDescriptor[]) artifactDescriptors.toArray(new IArtifactDescriptor[artifactDescriptors.size()]);
+ IArtifactDescriptor[] toRemove = artifactDescriptors.toArray(new IArtifactDescriptor[artifactDescriptors.size()]);
boolean changed = false;
for (int i = 0; i < toRemove.length; i++)
changed |= doRemoveArtifact(toRemove[i]);
@@ -903,7 +905,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
public void save() {
- boolean compress = "true".equalsIgnoreCase((String) properties.get(PROP_COMPRESSED)); //$NON-NLS-1$
+ boolean compress = "true".equalsIgnoreCase(properties.get(PROP_COMPRESSED)); //$NON-NLS-1$
save(compress);
}
@@ -980,16 +982,17 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
return location.toString();
}
- public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
- if (monitor != null && monitor.isCanceled())
- return Collector.EMPTY_COLLECTOR;
+ public IQueryable<IArtifactDescriptor> descriptorQueryable() {
+ final Collection<List<IArtifactDescriptor>> descs = artifactMap.values();
+ return new IQueryable<IArtifactDescriptor>() {
- boolean excludeKeys = Boolean.TRUE.equals(query.getProperty(IArtifactRepository.QUERY_EXCLUDE_KEYS));
- boolean excludeDescriptors = Boolean.TRUE.equals(query.getProperty(IArtifactRepository.QUERY_EXCLUDE_DESCRIPTORS));
- if (excludeKeys && excludeDescriptors)
- return Collector.EMPTY_COLLECTOR;
+ public IQueryResult<IArtifactDescriptor> query(IQuery<IArtifactDescriptor> query, IProgressMonitor monitor) {
+ return query.perform(new FlatteningIterator<IArtifactDescriptor>(descs.iterator()));
+ }
+ };
+ }
- Iterator iterator = !excludeDescriptors ? new MappedCollectionIterator(artifactMap, !excludeKeys) : artifactMap.keySet().iterator();
- return query.perform(iterator);
+ public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
+ return query.perform(artifactMap.keySet().iterator());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java
index ebc3c0755..b08652d13 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java
@@ -174,11 +174,11 @@ public class SimpleArtifactRepositoryIO {
}
}
- private void writeArtifacts(Set artifactDescriptors) {
+ private void writeArtifacts(Set<SimpleArtifactDescriptor> artifactDescriptors) {
start(ARTIFACTS_ELEMENT);
attribute(COLLECTION_SIZE_ATTRIBUTE, artifactDescriptors.size());
- for (Iterator iter = artifactDescriptors.iterator(); iter.hasNext();) {
- SimpleArtifactDescriptor descriptor = (SimpleArtifactDescriptor) iter.next();
+ for (Iterator<SimpleArtifactDescriptor> iter = artifactDescriptors.iterator(); iter.hasNext();) {
+ SimpleArtifactDescriptor descriptor = iter.next();
IArtifactKey key = descriptor.getArtifactKey();
start(ARTIFACT_ELEMENT);
attribute(ARTIFACT_CLASSIFIER_ATTRIBUTE, key.getClassifier());
@@ -324,9 +324,9 @@ public class SimpleArtifactRepositoryIO {
if (isValidXML()) {
String[][] mappingRules = (mappingRulesHandler == null ? new String[0][0] //
: mappingRulesHandler.getMappingRules());
- Map properties = (propertiesHandler == null ? new OrderedProperties(0) //
+ Map<String, String> properties = (propertiesHandler == null ? new OrderedProperties(0) //
: propertiesHandler.getProperties());
- Set artifacts = (artifactsHandler == null ? new HashSet(0) //
+ Set<SimpleArtifactDescriptor> artifacts = (artifactsHandler == null ? new HashSet<SimpleArtifactDescriptor>(0) //
: artifactsHandler.getArtifacts());
repository = new SimpleArtifactRepository(attrValues[0], attrValues[1], attrValues[2], attrValues[3], //
attrValues[4], artifacts, mappingRules, properties);
@@ -336,18 +336,18 @@ public class SimpleArtifactRepositoryIO {
protected class MappingRulesHandler extends AbstractHandler {
- private List mappingRules;
+ private List<String[]> mappingRules;
public MappingRulesHandler(AbstractHandler parentHandler, Attributes attributes) {
super(parentHandler, MAPPING_RULES_ELEMENT);
String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
- mappingRules = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList(4));
+ mappingRules = (size != null ? new ArrayList<String[]>(new Integer(size).intValue()) : new ArrayList<String[]>(4));
}
public String[][] getMappingRules() {
String[][] rules = new String[mappingRules.size()][2];
for (int index = 0; index < mappingRules.size(); index++) {
- String[] ruleAttributes = (String[]) mappingRules.get(index);
+ String[] ruleAttributes = mappingRules.get(index);
rules[index] = ruleAttributes;
}
return rules;
@@ -366,7 +366,7 @@ public class SimpleArtifactRepositoryIO {
private final String[] required = new String[] {MAPPING_RULE_FILTER_ATTRIBUTE, MAPPING_RULE_OUTPUT_ATTRIBUTE};
- public MappingRuleHandler(AbstractHandler parentHandler, Attributes attributes, List mappingRules) {
+ public MappingRuleHandler(AbstractHandler parentHandler, Attributes attributes, List<String[]> mappingRules) {
super(parentHandler, MAPPING_RULE_ELEMENT);
mappingRules.add(parseRequiredAttributes(attributes, required));
}
@@ -378,15 +378,15 @@ public class SimpleArtifactRepositoryIO {
protected class ArtifactsHandler extends AbstractHandler {
- private Set artifacts;
+ private Set<SimpleArtifactDescriptor> artifacts;
public ArtifactsHandler(AbstractHandler parentHandler, Attributes attributes) {
super(parentHandler, ARTIFACTS_ELEMENT);
String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
- artifacts = (size != null ? new LinkedHashSet(new Integer(size).intValue()) : new LinkedHashSet(4));
+ artifacts = (size != null ? new LinkedHashSet<SimpleArtifactDescriptor>(new Integer(size).intValue()) : new LinkedHashSet<SimpleArtifactDescriptor>(4));
}
- public Set getArtifacts() {
+ public Set<SimpleArtifactDescriptor> getArtifacts() {
return artifacts;
}
@@ -403,14 +403,14 @@ public class SimpleArtifactRepositoryIO {
private final String[] required = new String[] {ARTIFACT_CLASSIFIER_ATTRIBUTE, ID_ATTRIBUTE, VERSION_ATTRIBUTE};
- private Set artifacts;
+ private Set<SimpleArtifactDescriptor> artifacts;
SimpleArtifactDescriptor currentArtifact = null;
private PropertiesHandler propertiesHandler = null;
private PropertiesHandler repositoryPropertiesHandler = null;
private ProcessingStepsHandler processingStepsHandler = null;
- public ArtifactHandler(AbstractHandler parentHandler, Attributes attributes, Set artifacts) {
+ public ArtifactHandler(AbstractHandler parentHandler, Attributes attributes, Set<SimpleArtifactDescriptor> artifacts) {
super(parentHandler, ARTIFACT_ELEMENT);
this.artifacts = artifacts;
String[] values = parseRequiredAttributes(attributes, required);
@@ -445,7 +445,7 @@ public class SimpleArtifactRepositoryIO {
protected void finished() {
if (isValidXML() && currentArtifact != null) {
- Map properties = (propertiesHandler == null ? new OrderedProperties(0) : propertiesHandler.getProperties());
+ Map<String, String> properties = (propertiesHandler == null ? new OrderedProperties(0) : propertiesHandler.getProperties());
currentArtifact.addProperties(properties);
properties = (repositoryPropertiesHandler == null ? new OrderedProperties(0) : repositoryPropertiesHandler.getProperties());
@@ -461,16 +461,16 @@ public class SimpleArtifactRepositoryIO {
protected class ProcessingStepsHandler extends AbstractHandler {
- private List processingSteps;
+ private List<ProcessingStepDescriptor> processingSteps;
public ProcessingStepsHandler(AbstractHandler parentHandler, Attributes attributes) {
super(parentHandler, PROCESSING_STEPS_ELEMENT);
String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
- processingSteps = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList(4));
+ processingSteps = (size != null ? new ArrayList<ProcessingStepDescriptor>(new Integer(size).intValue()) : new ArrayList<ProcessingStepDescriptor>(4));
}
public ProcessingStepDescriptor[] getProcessingSteps() {
- return (ProcessingStepDescriptor[]) processingSteps.toArray(new ProcessingStepDescriptor[processingSteps.size()]);
+ return processingSteps.toArray(new ProcessingStepDescriptor[processingSteps.size()]);
}
public void startElement(String name, Attributes attributes) {
@@ -487,7 +487,7 @@ public class SimpleArtifactRepositoryIO {
private final String[] required = new String[] {ID_ATTRIBUTE, STEP_REQUIRED_ATTRIBUTE};
private final String[] optional = new String[] {STEP_DATA_ATTRIBUTE};
- public ProcessingStepHandler(AbstractHandler parentHandler, Attributes attributes, List processingSteps) {
+ public ProcessingStepHandler(AbstractHandler parentHandler, Attributes attributes, List<ProcessingStepDescriptor> processingSteps) {
super(parentHandler, PROCESSING_STEP_ELEMENT);
String[] attributeValues = parseAttributes(attributes, required, optional);
processingSteps.add(new ProcessingStepDescriptor(attributeValues[0], attributeValues[2], checkBoolean(PROCESSING_STEP_ELEMENT, STEP_REQUIRED_ATTRIBUTE, attributeValues[1]).booleanValue()));
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
index 5faebcdf8..96e31da46 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
@@ -61,11 +61,11 @@ public class ProcessingStepHandler {
public static IStatus getStatus(OutputStream stream, boolean deep) {
if (!deep)
return getStatus(stream);
- ArrayList list = new ArrayList();
+ ArrayList<IStatus> list = new ArrayList<IStatus>();
int severity = collectStatus(stream, list);
if (severity == IStatus.OK)
return Status.OK_STATUS;
- IStatus[] result = (IStatus[]) list.toArray(new IStatus[list.size()]);
+ IStatus[] result = list.toArray(new IStatus[list.size()]);
return new MultiStatus(Activator.ID, severity, result, Messages.processing_step_results, null);
}
@@ -75,15 +75,15 @@ public class ProcessingStepHandler {
* @return the requested status
*/
public static IStatus getErrorStatus(OutputStream stream) {
- ArrayList list = new ArrayList();
+ ArrayList<IStatus> list = new ArrayList<IStatus>();
int severity = collectErrorStatus(stream, list);
if (severity == IStatus.OK)
return Status.OK_STATUS;
- IStatus[] result = (IStatus[]) list.toArray(new IStatus[list.size()]);
+ IStatus[] result = list.toArray(new IStatus[list.size()]);
return new MultiStatus(Activator.ID, 0, result, Messages.processing_step_results, null);
}
- private static int collectErrorStatus(OutputStream stream, ArrayList list) {
+ private static int collectErrorStatus(OutputStream stream, ArrayList<IStatus> list) {
IStatus status = getStatus(stream);
if (!status.isOK())
list.add(status);
@@ -106,7 +106,7 @@ public class ProcessingStepHandler {
return Status.OK_STATUS;
}
- private static int collectStatus(OutputStream stream, ArrayList list) {
+ private static int collectStatus(OutputStream stream, ArrayList<IStatus> list) {
IStatus status = getStatus(stream);
list.add(status);
OutputStream destination = getDestination(stream);
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java
index 1cec5b8e8..78d0444ab 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java
@@ -20,9 +20,9 @@ import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
-public abstract class AbstractArtifactRepository extends AbstractRepository implements IArtifactRepository {
+public abstract class AbstractArtifactRepository extends AbstractRepository<IArtifactKey> implements IArtifactRepository {
- protected AbstractArtifactRepository(String name, String type, String version, URI location, String description, String provider, Map properties) {
+ protected AbstractArtifactRepository(String name, String type, String version, URI location, String description, String provider, Map<String, String> properties) {
super(name, type, version, location, description, provider, properties);
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java
index 663b772fd..c3225cd91 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/ArtifactRepositoryFactory.java
@@ -43,7 +43,7 @@ public abstract class ArtifactRepositoryFactory {
* <li>A repository already exists at that location.</li>
* </ul>
*/
- public abstract IArtifactRepository create(URI location, String name, String type, Map properties) throws ProvisionException;
+ public abstract IArtifactRepository create(URI location, String name, String type, Map<String, String> properties) throws ProvisionException;
/**
* Returns the provisioning agent associated with this factory, or <code>null</code>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/FlatteningIterator.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/FlatteningIterator.java
new file mode 100644
index 000000000..e39968a1f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/FlatteningIterator.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository;
+
+import java.util.*;
+
+/**
+ * An iterator over values that are provided by iterating over collections.
+ */
+public class FlatteningIterator<T> implements Iterator<T> {
+ private static final Object NO_ELEMENT = new Object();
+ private final Iterator<? extends Collection<T>> collectionIterator;
+ private Iterator<T> currentIterator;
+
+ private T nextObject = noElement();
+
+ public FlatteningIterator(Iterator<? extends Collection<T>> collectionIterator) {
+ this.collectionIterator = collectionIterator;
+ }
+
+ public boolean hasNext() {
+ return positionNext();
+ }
+
+ public T next() {
+ if (!positionNext())
+ throw new NoSuchElementException();
+
+ T nxt = nextObject;
+ nextObject = noElement();
+ return nxt;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ private boolean positionNext() {
+ if (nextObject != NO_ELEMENT)
+ return true;
+
+ while (currentIterator == null || !currentIterator.hasNext()) {
+ if (!collectionIterator.hasNext())
+ return false;
+ currentIterator = collectionIterator.next().iterator();
+ }
+ nextObject = currentIterator.next();
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ private static <T> T noElement() {
+ return (T) NO_ELEMENT;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/MappedCollectionIterator.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/MappedCollectionIterator.java
deleted file mode 100644
index 706e523a4..000000000
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/MappedCollectionIterator.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository;
-
-import java.util.*;
-
-/**
- * An iterator over a Map, For each key we return the key, then the value. If the value is a collection, then
- * instead of returning the value, we iterate over that collection before continuing to the
- * next key.
- */
-public class MappedCollectionIterator implements Iterator {
- private Iterator keys = null;
- private Iterator collection = null;
- private Object nextValue = null;
- private boolean returnKeys = false;
- private Map map = null;
-
- /**
- * @param map - the map to iterate over
- * @param returnKeys - whether or not to include the keys, if false return only values
- */
- public MappedCollectionIterator(Map map, boolean returnKeys) {
- this.map = map;
- this.returnKeys = returnKeys;
- this.keys = map.keySet().iterator();
- }
-
- /**
- * See {@link Iterator#hasNext()}
- */
- public boolean hasNext() {
- if (returnKeys) //keys and values
- return (collection != null && collection.hasNext()) || nextValue != null || keys.hasNext();
-
- //values only
- if (collection != null && collection.hasNext())
- return true;
- while (keys.hasNext()) {
- Object key = keys.next();
- Object value = map.get(key);
- if (value instanceof Collection) {
- collection = ((Collection) value).iterator();
- } else if (value != null) {
- nextValue = value;
- collection = null;
- return true;
- }
- if (collection.hasNext())
- return true;
- }
- return false;
- }
-
- /**
- * See {@link Iterator#next()}
- */
- public Object next() {
- if (nextValue != null) {
- Object next = nextValue;
- nextValue = null;
- return next;
- }
-
- if (returnKeys) {
- if (collection != null && collection.hasNext())
- return collection.next();
-
- Object nextKey = keys.next();
- Object value = map.get(nextKey);
- if (value instanceof Collection)
- collection = ((Collection) value).iterator();
- else if (value != null) {
- nextValue = value;
- collection = null;
- }
- return nextKey;
- }
-
- //values only
- if (collection != null && collection.hasNext())
- return collection.next();
- while (keys.hasNext()) {
- Object key = keys.next();
- Object value = map.get(key);
- if (value instanceof Collection) {
- collection = ((Collection) value).iterator();
- if (!collection.hasNext())
- continue;
- return collection.next();
- } else if (value != null)
- return value;
- }
- throw new NoSuchElementException();
- }
-
- /**
- * Returns true if the iteration contains more keys
- * @return boolean
- */
- public boolean hasNextKey() {
- if (!returnKeys)
- return false;
- return keys.hasNext();
- }
-
- /**
- * Get the next key skipping over any values
- * @return the next key
- * @throws IllegalStateException if this iterator is not returning keys
- */
- public Object nextKey() {
- if (!returnKeys)
- throw new IllegalStateException();
- Object nextKey = keys.next();
- Object value = map.get(nextKey);
- if (value instanceof Collection) {
- collection = ((Collection) value).iterator();
- nextValue = null;
- } else if (value != null) {
- nextValue = value;
- collection = null;
- }
- return nextKey;
- }
-
- /**
- * See {@link Iterator#remove()}
- * This operation is not supported
- * @throws UnsupportedOperationException
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java
index 208ff7848..2f372528d 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/SimpleArtifactRepositoryFactory.java
@@ -122,7 +122,7 @@ public class SimpleArtifactRepositoryFactory extends ArtifactRepositoryFactory {
}
}
- public IArtifactRepository create(URI location, String name, String type, Map properties) {
+ public IArtifactRepository create(URI location, String name, String type, Map<String, String> properties) {
return new SimpleArtifactRepository(name, location, properties);
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java
index cfcc803ec..d6c64b210 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src_ant/org/eclipse/equinox/internal/p2/artifact/repository/ant/CreateCompositeArtifactRepositoryTask.java
@@ -34,7 +34,7 @@ public class CreateCompositeArtifactRepositoryTask extends Task {
String name = "Composite Artifact Repository";
boolean compressed = true;
boolean failOnExists = false; // should we fail if a repo already exists?
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<String, String>();
/* (non-Javadoc)
* @see org.apache.tools.ant.Task#execute()
diff --git a/bundles/org.eclipse.equinox.p2.common/.classpath b/bundles/org.eclipse.equinox.p2.common/.classpath
index 6f3b481ac..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.common/.classpath
+++ b/bundles/org.eclipse.equinox.p2.common/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.p2.common/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.common/.settings/org.eclipse.jdt.core.prefs
index becffc0e3..95c93c13e 100644
--- a/bundles/org.eclipse.equinox.p2.common/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.common/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Nov 19 09:43:53 EST 2009
+#Mon Dec 28 16:50:20 CET 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,17 +7,17 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,7 +26,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -89,7 +89,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enab
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.p2.common/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.common/META-INF/MANIFEST.MF
index cc2444519..81eb9fa2e 100644
--- a/bundles/org.eclipse.equinox.p2.common/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.common/META-INF/MANIFEST.MF
@@ -14,8 +14,9 @@ Import-Package:
org.eclipse.equinox.p2.engine,
org.eclipse.equinox.p2.metadata.query,
org.osgi.framework;version="1.3.0"
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
Export-Package: org.eclipse.equinox.internal.p2.common;x-internal:=true,
org.eclipse.equinox.p2.common
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.3.0,4.0)",
diff --git a/bundles/org.eclipse.equinox.p2.common/build.properties b/bundles/org.eclipse.equinox.p2.common/build.properties
index dc77b9c16..ca5030900 100644
--- a/bundles/org.eclipse.equinox.p2.common/build.properties
+++ b/bundles/org.eclipse.equinox.p2.common/build.properties
@@ -15,3 +15,5 @@ bin.includes = META-INF/,\
about.html,\
plugin.properties
src.includes = about.html
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.console/.classpath b/bundles/org.eclipse.equinox.p2.console/.classpath
index 7cdeb7319..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.console/.classpath
+++ b/bundles/org.eclipse.equinox.p2.console/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs
index a455b6228..87192e52e 100644
--- a/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.console/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Sep 13 22:02:41 EDT 2007
+#Mon Dec 28 17:08:33 CET 2009
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
@@ -8,24 +8,24 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -81,7 +81,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -153,7 +153,6 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF
index 40c872b6f..98f1d963b 100644
--- a/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.console/META-INF/MANIFEST.MF
@@ -24,5 +24,6 @@ Import-Package: org.eclipse.core.runtime;common=split,
org.eclipse.osgi.service.environment;version="1.0.0",
org.osgi.framework;version="1.4.0",
org.osgi.util.tracker;version="1.3.0"
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
diff --git a/bundles/org.eclipse.equinox.p2.console/build.properties b/bundles/org.eclipse.equinox.p2.console/build.properties
index a6b8330d2..246ea6cb7 100644
--- a/bundles/org.eclipse.equinox.p2.console/build.properties
+++ b/bundles/org.eclipse.equinox.p2.console/build.properties
@@ -15,3 +15,5 @@ bin.includes = META-INF/,\
about.html,\
plugin.properties
src.includes = about.html
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
index 02d3765c2..5c1d62131 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
@@ -261,9 +261,9 @@ public class ProvCommandProvider implements CommandProvider {
*/
public void _provlg(CommandInterpreter interpreter) {
String urlString = processArgument(interpreter.nextArgument());
- IQueryable queryable = null;
+ IQueryable<IInstallableUnit> queryable = null;
if (urlString == null) {
- queryable = (IQueryable) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.SERVICE_NAME);
+ queryable = (IQueryable<IInstallableUnit>) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.SERVICE_NAME);
if (queryable == null)
return;
} else {
@@ -299,7 +299,7 @@ public class ProvCommandProvider implements CommandProvider {
if (repoURL == null)
return;
IArtifactRepository repo = ProvisioningHelper.getArtifactRepository(repoURL);
- IQueryResult keys = null;
+ IQueryResult<IArtifactKey> keys = null;
try {
keys = (repo != null) ? repo.query(ArtifactKeyQuery.ALL_KEYS, null) : null;
} catch (UnsupportedOperationException e) {
@@ -311,8 +311,8 @@ public class ProvCommandProvider implements CommandProvider {
return;
}
IFileArtifactRepository fileRepo = (IFileArtifactRepository) repo.getAdapter(IFileArtifactRepository.class);
- for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
- IArtifactKey key = (IArtifactKey) iterator.next();
+ for (Iterator<IArtifactKey> iterator = keys.iterator(); iterator.hasNext();) {
+ IArtifactKey key = iterator.next();
IArtifactDescriptor[] descriptors = repo.getArtifactDescriptors(key);
for (int j = 0; j < descriptors.length; j++) {
IArtifactDescriptor descriptor = descriptors[j];
@@ -442,10 +442,10 @@ public class ProvCommandProvider implements CommandProvider {
}
}
- private IInstallableUnit[] sort(IQueryResult queryResult) {
- IInstallableUnit[] units = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
- Arrays.sort(units, new Comparator() {
- public int compare(Object arg0, Object arg1) {
+ private IInstallableUnit[] sort(IQueryResult<IInstallableUnit> queryResult) {
+ IInstallableUnit[] units = queryResult.toArray(IInstallableUnit.class);
+ Arrays.sort(units, new Comparator<IInstallableUnit>() {
+ public int compare(IInstallableUnit arg0, IInstallableUnit arg1) {
return arg0.toString().compareTo(arg1.toString());
}
});
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
index 8300d7f59..5115dc164 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
@@ -19,6 +19,7 @@ import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
@@ -151,16 +152,16 @@ public class ProvisioningHelper {
* @param monitor A progress monitor, or <code>null</code>
* @return The IUs that match the query
*/
- public static IQueryResult getInstallableUnits(URI location, IQuery query, IProgressMonitor monitor) {
- IQueryable queryable = null;
+ public static IQueryResult<IInstallableUnit> getInstallableUnits(URI location, IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
+ IQueryable<IInstallableUnit> queryable = null;
if (location == null) {
- queryable = (IQueryable) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.SERVICE_NAME);
+ queryable = (IQueryable<IInstallableUnit>) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.SERVICE_NAME);
} else {
queryable = getMetadataRepository(location);
}
if (queryable != null)
return queryable.query(query, monitor);
- return Collector.EMPTY_COLLECTOR;
+ return Collector.emptyCollector();
}
public static URI[] getMetadataRepositories() {
@@ -180,7 +181,7 @@ public class ProvisioningHelper {
public static IStatus install(String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- IQueryResult units = getInstallableUnits((URI) null, new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult<IInstallableUnit> units = getInstallableUnits((URI) null, new InstallableUnitQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');
diff --git a/bundles/org.eclipse.equinox.p2.core/.classpath b/bundles/org.eclipse.equinox.p2.core/.classpath
index 6f3b481ac..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.core/.classpath
+++ b/bundles/org.eclipse.equinox.p2.core/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs
index 327fbe678..14cc6924d 100644
--- a/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,346 +1,346 @@
-#Mon Aug 24 11:19:53 EDT 2009
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+#Tue Dec 22 00:34:34 CET 2009
+eclipse.preferences.version=1
+instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
+org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.compiler.problem.discouragedReference=error
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF
index d4e12693b..d9322015f 100644
--- a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF
@@ -97,8 +97,9 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ
org.eclipse.equinox.p2.core.spi
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
Bundle-Activator: org.eclipse.equinox.internal.p2.core.Activator
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)"
Service-Component: OSGI-INF/eventBus.xml, OSGI-INF/agentProvider.xml
diff --git a/bundles/org.eclipse.equinox.p2.core/build.properties b/bundles/org.eclipse.equinox.p2.core/build.properties
index 4f52e07f1..98b717479 100644
--- a/bundles/org.eclipse.equinox.p2.core/build.properties
+++ b/bundles/org.eclipse.equinox.p2.core/build.properties
@@ -16,3 +16,5 @@ bin.includes = META-INF/,\
OSGI-INF/
src.includes = about.html
source.. = src/
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java
index c633815c3..45f8a9d66 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java
@@ -159,7 +159,7 @@ public class Activator implements BundleActivator {
Activator.context = aContext;
URI defaultLocation = URIUtil.fromString(aContext.getProperty(PROP_CONFIG_DIR) + DEFAULT_AGENT_LOCATION + '/');
agentDataLocation = buildLocation(PROP_AGENT_DATA_AREA, defaultLocation, false, true);
- Dictionary locationProperties = new Hashtable();
+ Dictionary<String, Object> locationProperties = new Hashtable<String, Object>();
if (agentDataLocation != null) {
locationProperties.put("type", PROP_AGENT_DATA_AREA); //$NON-NLS-1$
agentLocationRegistration = aContext.registerService(IAgentLocation.SERVICE_NAME, agentDataLocation, locationProperties);
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java
index 8d086e55e..158e28177 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/DefaultAgentProvider.java
@@ -31,7 +31,7 @@ public class DefaultAgentProvider implements IProvisioningAgentProvider {
result.setBundleContext(context);
result.setLocation(location);
IAgentLocation agentLocation = (IAgentLocation) result.getService(IAgentLocation.SERVICE_NAME);
- Dictionary properties = new Hashtable(5);
+ Dictionary<String, Object> properties = new Hashtable<String, Object>(5);
if (agentLocation != null)
properties.put("locationURI", String.valueOf(agentLocation.getRootLocation())); //$NON-NLS-1$
//make the currently running system have a higher service ranking
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java
index dc2d49ef5..c0fd26504 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java
@@ -22,7 +22,7 @@ import org.osgi.framework.*;
*/
public class ProvisioningAgent implements IProvisioningAgent {
- private final Map agentServices = Collections.synchronizedMap(new HashMap());
+ private final Map<String, Object> agentServices = Collections.synchronizedMap(new HashMap<String, Object>());
private BundleContext context;
private boolean stopped = false;
private ServiceRegistration reg;
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java
index 930378462..f7ff68cd6 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/StringPool.java
@@ -23,7 +23,7 @@ import java.util.HashMap;
*/
public final class StringPool {
private int savings;
- private final HashMap map = new HashMap();
+ private final HashMap<String, String> map = new HashMap<String, String>();
/**
* Creates a new string pool.
@@ -41,11 +41,11 @@ public final class StringPool {
public String add(String string) {
if (string == null)
return string;
- Object result = map.get(string);
+ String result = map.get(string);
if (result != null) {
if (result != string)
savings += 44 + 2 * string.length();
- return (String) result;
+ return result;
}
//explicitly copy the string to trim excess baggage
String trim = new String(string.toCharArray());
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java
new file mode 100644
index 000000000..48797a222
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Cloudsmith Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cloudsmith Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.core.helpers;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Array;
+import java.util.*;
+
+/**
+ * Helper class that provides some useful support when dealing with collections.
+ */
+public class CollectionUtils {
+
+ /**
+ * A unmodifiable {@link List} implementation on top of an object array.
+ * @param <E> The element type.
+ */
+ private static class UnmodifiableArrayList<E> extends AbstractList<E> implements RandomAccess, java.io.Serializable {
+ private static final long serialVersionUID = 7435304230643855579L;
+ final E[] array;
+
+ UnmodifiableArrayList(E[] array) {
+ this.array = array;
+ }
+
+ public boolean contains(Object o) {
+ return indexOf(o) != -1;
+ }
+
+ public E get(int index) {
+ return array[index];
+ }
+
+ public int indexOf(Object o) {
+ int size = array.length;
+ if (o == null) {
+ for (int i = 0; i < size; i++)
+ if (array[i] == null)
+ return i;
+ } else {
+ for (int i = 0; i < size; i++)
+ if (o.equals(array[i]))
+ return i;
+ }
+ return -1;
+ }
+
+ public Iterator<E> iterator() {
+ return listIterator();
+ }
+
+ /**
+ * Rapid iterator, motivated by the fact that we don't need to check
+ * for concurrent modifications.
+ */
+ public ListIterator<E> listIterator() {
+ return new ListIterator<E>() {
+ private int index = 0;
+
+ public boolean hasNext() {
+ return index < array.length;
+ }
+
+ public E next() {
+ if (index >= array.length)
+ throw new NoSuchElementException();
+ return array[index++];
+ }
+
+ public boolean hasPrevious() {
+ return index > 0;
+ }
+
+ public E previous() {
+ if (--index < 0) {
+ ++index;
+ throw new NoSuchElementException();
+ }
+ return array[index];
+ }
+
+ public int nextIndex() {
+ return index;
+ }
+
+ public int previousIndex() {
+ return index - 1;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void set(E e) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void add(E e) {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ public int lastIndexOf(Object o) {
+ int idx = array.length;
+ if (o == null) {
+ while (--idx >= 0)
+ if (array[idx] == null)
+ return idx;
+ } else {
+ while (--idx >= 0)
+ if (o.equals(array[idx]))
+ return idx;
+ }
+ return -1;
+ }
+
+ public E set(int index, E element) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int size() {
+ return array.length;
+ }
+
+ public Object[] toArray() {
+ return array.clone();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T[] toArray(T[] a) {
+ int size = array.length;
+ if (a.length < size)
+ a = (T[]) Array.newInstance(a.getClass().getComponentType(), size);
+ System.arraycopy(this.array, 0, a, 0, size);
+ while (size < a.length)
+ a[size++] = null;
+ return a;
+ }
+ }
+
+ /**
+ * The emptyList() method was introduced in Java 1.5 so we need this here to be able to
+ * down compile to 1.4.
+ * @param <T> The type of the elements
+ * @return An empty list
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> List<T> emptyList() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * The emptySet() method was introduced in Java 1.5 so we need this here to be able to
+ * down compile to 1.4.
+ * @param <T> The type of the elements
+ * @return An empty set
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> Set<T> emptySet() {
+ return Collections.EMPTY_SET;
+ }
+
+ /**
+ * The emptyMap() method was introduced in Java 1.5 so we need this here to be able to
+ * down compile to 1.4.
+ * @param <T> The type of the elements
+ * @return An empty set
+ */
+ @SuppressWarnings("unchecked")
+ public static <K, V> Map<K, V> emptyMap() {
+ return Collections.EMPTY_MAP;
+ }
+
+ /**
+ * Returns an unmodifiable list that is backed by the <code>array</code>.
+ * @param <T> The list element type
+ * @param array The array of elements
+ * @return The unmodifiable list
+ */
+ public static <T> List<T> unmodifiableList(T[] array) {
+ return array == null || array.length == 0 ? CollectionUtils.<T> emptyList() : new UnmodifiableArrayList<T>(array);
+ }
+
+ /**
+ * Reads a property list using the {@link Properties#load(InputStream)} method. The
+ * properties are stored in a map.
+ * @param stream The stream to read from
+ * @return The resulting map
+ * @throws IOException propagated from the load method.
+ */
+ public static Map<String, String> loadProperties(InputStream stream) throws IOException {
+ Properties properties = new Properties();
+ properties.load(stream);
+ return toMap(properties);
+ }
+
+ /**
+ * Copies all elements from <code>properties</code> into a Map. The returned map might be unmodifiable
+ * @param properties
+ * @return The map containing all elements
+ */
+ public static Map<String, String> toMap(Properties properties) {
+ if (properties == null || properties.isEmpty())
+ return emptyMap();
+
+ Map<String, String> props = new HashMap<String, String>(properties.size());
+ putAll(properties, props);
+ return props;
+ }
+
+ /**
+ * Copies all elements from <code>properties</code> into the given <code>result</code>.
+ * @param properties
+ * @param result
+ */
+ public static void putAll(Properties properties, Map<String, String> result) {
+ for (Enumeration<Object> keys = properties.keys(); keys.hasMoreElements();) {
+ String key = (String) keys.nextElement();
+ result.put(key, properties.getProperty(key));
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java
index 96a9f9810..ded76dffc 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/FileUtils.java
@@ -21,10 +21,10 @@ public class FileUtils {
private static File[] untarFile(File source, File outputDir) throws IOException, TarException {
TarFile tarFile = new TarFile(source);
- List untarredFiles = new ArrayList();
+ List<File> untarredFiles = new ArrayList<File>();
try {
- for (Enumeration e = tarFile.entries(); e.hasMoreElements();) {
- TarEntry entry = (TarEntry) e.nextElement();
+ for (Enumeration<TarEntry> e = tarFile.entries(); e.hasMoreElements();) {
+ TarEntry entry = e.nextElement();
InputStream input = tarFile.getInputStream(entry);
try {
File outFile = new File(outputDir, entry.getName());
@@ -52,7 +52,7 @@ public class FileUtils {
} finally {
tarFile.close();
}
- return (File[]) untarredFiles.toArray(new File[untarredFiles.size()]);
+ return untarredFiles.toArray(new File[untarredFiles.size()]);
}
/**
@@ -107,7 +107,7 @@ public class FileUtils {
in.close();
throw new IOException(Messages.Util_Invalid_Zip_File_Format);
}
- ArrayList unzippedFiles = new ArrayList();
+ ArrayList<File> unzippedFiles = new ArrayList<File>();
do {
File outFile = new File(outputDir, ze.getName());
unzippedFiles.add(outFile);
@@ -131,7 +131,7 @@ public class FileUtils {
} while ((ze = in.getNextEntry()) != null);
in.close();
- return (File[]) unzippedFiles.toArray(new File[unzippedFiles.size()]);
+ return unzippedFiles.toArray(new File[unzippedFiles.size()]);
}
// Delete empty directories under dir, including dir itself.
@@ -243,8 +243,8 @@ public class FileUtils {
public static void zip(File[] inclusions, File[] exclusions, File destinationArchive, IPathComputer pathComputer) throws IOException {
FileOutputStream fileOutput = new FileOutputStream(destinationArchive);
ZipOutputStream output = new ZipOutputStream(fileOutput);
- HashSet exclusionSet = exclusions == null ? new HashSet() : new HashSet(Arrays.asList(exclusions));
- HashSet directoryEntries = new HashSet();
+ HashSet<File> exclusionSet = exclusions == null ? new HashSet<File>() : new HashSet<File>(Arrays.asList(exclusions));
+ HashSet<IPath> directoryEntries = new HashSet<IPath>();
try {
for (int i = 0; i < inclusions.length; i++) {
pathComputer.reset();
@@ -273,11 +273,11 @@ public class FileUtils {
* @param pathComputer - computer used to create the path of the files in the result.
* @throws IOException
*/
- public static void zip(ZipOutputStream output, File source, Set exclusions, IPathComputer pathComputer) throws IOException {
- zip(output, source, exclusions, pathComputer, new HashSet());
+ public static void zip(ZipOutputStream output, File source, Set<File> exclusions, IPathComputer pathComputer) throws IOException {
+ zip(output, source, exclusions, pathComputer, new HashSet<IPath>());
}
- public static void zip(ZipOutputStream output, File source, Set exclusions, IPathComputer pathComputer, Set directoryEntries) throws IOException {
+ public static void zip(ZipOutputStream output, File source, Set<File> exclusions, IPathComputer pathComputer, Set<IPath> directoryEntries) throws IOException {
if (exclusions.contains(source))
return;
if (source.isDirectory()) //if the file path is a URL then isDir and isFile are both false
@@ -286,7 +286,7 @@ public class FileUtils {
zipFile(output, source, pathComputer, directoryEntries);
}
- private static void zipDirectoryEntry(ZipOutputStream output, IPath entry, long time, Set directoryEntries) throws IOException {
+ private static void zipDirectoryEntry(ZipOutputStream output, IPath entry, long time, Set<IPath> directoryEntries) throws IOException {
entry = entry.addTrailingSeparator();
if (!directoryEntries.contains(entry)) {
//make sure parent entries are in the zip
@@ -314,7 +314,7 @@ public class FileUtils {
* Zip the contents of the given directory into the zip file represented by
* the given zip stream. Prepend the given prefix to the file paths.
*/
- private static void zipDir(ZipOutputStream output, File source, Set exclusions, IPathComputer pathComputer, Set directoryEntries) throws IOException {
+ private static void zipDir(ZipOutputStream output, File source, Set<File> exclusions, IPathComputer pathComputer, Set<IPath> directoryEntries) throws IOException {
File[] files = source.listFiles();
if (files.length == 0) {
zipDirectoryEntry(output, pathComputer.computePath(source), source.lastModified(), directoryEntries);
@@ -326,16 +326,16 @@ public class FileUtils {
// foo/bar.txt
// foo/something/bar2.txt
// foo/something/else/bar3.txt
- Arrays.sort(files, new Comparator() {
- public int compare(Object arg0, Object arg1) {
- Path a = new Path(((File) arg0).getAbsolutePath());
- Path b = new Path(((File) arg1).getAbsolutePath());
+ Arrays.sort(files, new Comparator<File>() {
+ public int compare(File arg0, File arg1) {
+ Path a = new Path(arg0.getAbsolutePath());
+ Path b = new Path(arg1.getAbsolutePath());
if (a.segmentCount() == b.segmentCount()) {
- if (((File) arg0).isDirectory() && ((File) arg1).isFile())
+ if (arg0.isDirectory() && arg1.isFile())
return 1;
- else if (((File) arg0).isDirectory() && ((File) arg1).isDirectory())
+ else if (arg0.isDirectory() && arg1.isDirectory())
return 0;
- else if (((File) arg0).isFile() && ((File) arg1).isDirectory())
+ else if (arg0.isFile() && arg1.isDirectory())
return -1;
else
return 0;
@@ -352,7 +352,7 @@ public class FileUtils {
* Add the given file to the zip file represented by the specified stream.
* Prepend the given prefix to the path of the file.
*/
- private static void zipFile(ZipOutputStream output, File source, IPathComputer pathComputer, Set directoryEntries) throws IOException {
+ private static void zipFile(ZipOutputStream output, File source, IPathComputer pathComputer, Set<IPath> directoryEntries) throws IOException {
boolean isManifest = false; //manifest files are special
InputStream input = new BufferedInputStream(new FileInputStream(source));
try {
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java
index cb3fd613a..d8da0bf58 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/LogHelper.java
@@ -39,7 +39,7 @@ public class LogHelper {
*/
private static FrameworkLogEntry getLog(IStatus status) {
Throwable t = status.getException();
- ArrayList childlist = new ArrayList();
+ ArrayList<FrameworkLogEntry> childlist = new ArrayList<FrameworkLogEntry>();
int stackCode = t instanceof CoreException ? 1 : 0;
// ensure a substatus inside a CoreException is properly logged
@@ -57,7 +57,7 @@ public class LogHelper {
}
}
- FrameworkLogEntry[] children = (FrameworkLogEntry[]) (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()]));
+ FrameworkLogEntry[] children = (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()]));
return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children);
}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java
index 442132bf6..56caeab6c 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java
@@ -26,11 +26,11 @@ import java.util.*;
* The class does not support default properties as they can be expressed by
* creating java.util.Properties hierarchies.
*/
-public class OrderedProperties extends Dictionary implements Map {
+public class OrderedProperties extends Dictionary<String, String> implements Map<String, String> {
- LinkedHashMap propertyMap = null;
+ LinkedHashMap<String, String> propertyMap = null;
- public static OrderedProperties unmodifiableProperties(Map properties) {
+ public static OrderedProperties unmodifiableProperties(Map<String, String> properties) {
return new UnmodifiableProperties(properties);
}
@@ -40,12 +40,12 @@ public class OrderedProperties extends Dictionary implements Map {
public OrderedProperties(int size) {
super();
- propertyMap = new LinkedHashMap(size);
+ propertyMap = new LinkedHashMap<String, String>(size);
}
public OrderedProperties(OrderedProperties properties) {
super();
- propertyMap = new LinkedHashMap(properties.size());
+ propertyMap = new LinkedHashMap<String, String>(properties.size());
putAll(properties);
}
@@ -67,11 +67,11 @@ public class OrderedProperties extends Dictionary implements Map {
}
public String getProperty(String key) {
- return (String) (propertyMap == null ? null : propertyMap.get(key));
+ return (propertyMap == null ? null : propertyMap.get(key));
}
public void putAll(OrderedProperties properties) {
- putAll((Map) properties);
+ putAll(properties);
}
/**
@@ -79,7 +79,7 @@ public class OrderedProperties extends Dictionary implements Map {
*/
private void init() {
if (propertyMap == null) {
- propertyMap = new LinkedHashMap();
+ propertyMap = new LinkedHashMap<String, String>();
}
}
@@ -95,9 +95,9 @@ public class OrderedProperties extends Dictionary implements Map {
propertyMap = null;
}
- public Object put(Object arg0, Object arg1) {
+ public String put(String key, String value) {
init();
- return propertyMap.put(arg0, arg1);
+ return propertyMap.put(key, value);
}
public boolean containsKey(Object key) {
@@ -108,29 +108,29 @@ public class OrderedProperties extends Dictionary implements Map {
return propertyMap != null ? propertyMap.containsValue(value) : false;
}
- public Set entrySet() {
- return propertyMap != null ? propertyMap.entrySet() : Collections.EMPTY_SET;
+ public Set<Map.Entry<String, String>> entrySet() {
+ return propertyMap != null ? propertyMap.entrySet() : CollectionUtils.<Map.Entry<String, String>> emptySet();
}
- public Object get(Object key) {
+ public String get(Object key) {
return propertyMap != null ? propertyMap.get(key) : null;
}
- public Set keySet() {
- return propertyMap != null ? propertyMap.keySet() : Collections.EMPTY_SET;
+ public Set<String> keySet() {
+ return propertyMap != null ? propertyMap.keySet() : CollectionUtils.<String> emptySet();
}
- public void putAll(Map arg0) {
+ public void putAll(Map<? extends String, ? extends String> arg0) {
init();
propertyMap.putAll(arg0);
}
- public Object remove(Object key) {
+ public String remove(Object key) {
return propertyMap != null ? propertyMap.remove(key) : null;
}
- public Collection values() {
- return propertyMap != null ? propertyMap.values() : Collections.EMPTY_LIST;
+ public Collection<String> values() {
+ return propertyMap != null ? propertyMap.values() : CollectionUtils.<String> emptyList();
}
public boolean equals(Object o) {
@@ -147,8 +147,8 @@ public class OrderedProperties extends Dictionary implements Map {
return rhs.propertyMap.equals(this.propertyMap);
}
if (this.propertyMap == null) {
- if (o instanceof Map)
- return ((Map) o).isEmpty();
+ if (o instanceof Map<?, ?>)
+ return ((Map<?, ?>) o).isEmpty();
return false;
}
return this.propertyMap.equals(o);
@@ -164,54 +164,37 @@ public class OrderedProperties extends Dictionary implements Map {
return sb.toString();
}
- private class ElementsEnum implements Enumeration {
+ private class StringsEnum implements Enumeration<String> {
- Iterator iterator = null;
+ private final Iterator<String> iterator;
- public ElementsEnum(OrderedProperties properties) {
- iterator = properties.propertyMap.values().iterator();
+ public StringsEnum(Collection<String> elems) {
+ this.iterator = elems.iterator();
}
public boolean hasMoreElements() {
return iterator.hasNext();
}
- public Object nextElement() {
+ public String nextElement() {
return iterator.next();
}
}
- public Enumeration elements() {
- return new ElementsEnum(this);
- }
-
- private class KeysEnum implements Enumeration {
-
- Iterator iterator = null;
-
- public KeysEnum(OrderedProperties properties) {
- iterator = properties.propertyMap.keySet().iterator();
- }
-
- public boolean hasMoreElements() {
- return iterator.hasNext();
- }
-
- public Object nextElement() {
- return iterator.next();
- }
+ public Enumeration<String> elements() {
+ return new StringsEnum(propertyMap.values());
}
- public Enumeration keys() {
- return new KeysEnum(this);
+ public Enumeration<String> keys() {
+ return new StringsEnum(propertyMap.keySet());
}
private static class UnmodifiableProperties extends OrderedProperties {
- UnmodifiableProperties(Map properties) {
+ UnmodifiableProperties(Map<String, String> properties) {
super();
- for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
+ for (Iterator<Map.Entry<String, String>> iter = properties.entrySet().iterator(); iter.hasNext();) {
+ Map.Entry<String, String> entry = iter.next();
super.put(entry.getKey(), entry.getValue());
}
}
@@ -220,15 +203,15 @@ public class OrderedProperties extends Dictionary implements Map {
throw new UnsupportedOperationException();
}
- public synchronized Object put(Object key, Object value) {
+ public synchronized String put(String key, String value) {
throw new UnsupportedOperationException();
}
- public synchronized Object remove(Object key) {
+ public synchronized String remove(Object key) {
throw new UnsupportedOperationException();
}
- public synchronized void putAll(Map t) {
+ public synchronized void putAll(Map<? extends String, ? extends String> t) {
throw new UnsupportedOperationException();
}
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java
index c1995c27f..2d6a9e557 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/StringHelper.java
@@ -26,7 +26,7 @@ public class StringHelper {
if (spec.length() > 0)
resultArr = new String[] {spec};
} else {
- List result = new ArrayList();
+ List<String> result = new ArrayList<String>();
while (splitIdx >= 0) {
String part = spec.substring(0, splitIdx).trim();
if (part.length() > 0)
@@ -37,7 +37,7 @@ public class StringHelper {
spec = spec.trim();
if (spec.length() > 0)
result.add(spec);
- resultArr = (String[]) result.toArray(new String[result.size()]);
+ resultArr = result.toArray(new String[result.size()]);
}
}
return resultArr;
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java
index 5500bc765..4b4971236 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/TarFile.java
@@ -70,13 +70,13 @@ public class TarFile {
*
* @return enumeration of all files in the archive
*/
- public Enumeration entries() {
- return new Enumeration() {
+ public Enumeration<TarEntry> entries() {
+ return new Enumeration<TarEntry>() {
public boolean hasMoreElements() {
return (curEntry != null);
}
- public Object nextElement() {
+ public TarEntry nextElement() {
TarEntry oldEntry = curEntry;
try {
curEntry = entryEnumerationStream.getNextEntry();
diff --git a/bundles/org.eclipse.equinox.p2.director.app/.classpath b/bundles/org.eclipse.equinox.p2.director.app/.classpath
index 75116d75c..834ea833e 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/.classpath
+++ b/bundles/org.eclipse.equinox.p2.director.app/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="bin_ant" path="src_ant"/>
diff --git a/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs
index 802d3818a..b2e21d59e 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.director.app/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Wed Oct 07 15:35:11 EDT 2009
+#Mon Dec 28 07:04:08 CET 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -8,17 +8,17 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -27,7 +27,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
@@ -90,7 +90,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enab
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF
index a70c8b478..60f0aac5d 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.director.app/META-INF/MANIFEST.MF
@@ -26,7 +26,8 @@ Import-Package: org.eclipse.equinox.app,
org.osgi.service.packageadmin
Bundle-Activator: org.eclipse.equinox.internal.p2.director.app.Activator
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)"
Export-Package: org.eclipse.equinox.internal.p2.director.app;x-internal:=true
diff --git a/bundles/org.eclipse.equinox.p2.director.app/build.properties b/bundles/org.eclipse.equinox.p2.director.app/build.properties
index fd5507d03..d80a7ff0d 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/build.properties
+++ b/bundles/org.eclipse.equinox.p2.director.app/build.properties
@@ -21,3 +21,5 @@ src.includes = about.html
jars.compile.order=.,ant_tasks/director-ant.jar
extra.ant_tasks/director-ant.jar = platform:/plugin/org.apache.ant
jars.extra.classpath = platform:/plugin/org.apache.ant/lib/ant.jar
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
index 14759ee99..127003367 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
@@ -92,7 +92,7 @@ public class Application implements IApplication {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Ambigous_Command, new Object[] {COMMAND_NAMES[cmd1], COMMAND_NAMES[cmd2]})));
}
- private ProfileChangeRequest buildProvisioningRequest(IProfile profile, IQueryResult roots, boolean install) {
+ private ProfileChangeRequest buildProvisioningRequest(IProfile profile, IQueryResult<IInstallableUnit> roots, boolean install) {
ProfileChangeRequest request = new ProfileChangeRequest(profile);
markRoots(request, roots);
if (install) {
@@ -120,7 +120,7 @@ public class Application implements IApplication {
}
private String getEnvironmentProperty() {
- Properties values = new Properties();
+ Map<String, String> values = new HashMap<String, String>();
if (os != null)
values.put("osgi.os", os); //$NON-NLS-1$
if (nl != null)
@@ -250,9 +250,9 @@ public class Application implements IApplication {
throw new RuntimeException(Messages.Missing_Engine);
}
- private void markRoots(ProfileChangeRequest request, IQueryResult roots) {
- for (Iterator iterator = roots.iterator(); iterator.hasNext();) {
- request.setInstallableUnitProfileProperty((IInstallableUnit) iterator.next(), IProfile.PROP_PROFILE_ROOT_IU, Boolean.TRUE.toString());
+ private void markRoots(ProfileChangeRequest request, IQueryResult<IInstallableUnit> roots) {
+ for (Iterator<IInstallableUnit> iterator = roots.iterator(); iterator.hasNext();) {
+ request.setInstallableUnitProfileProperty(iterator.next(), IProfile.PROP_PROFILE_ROOT_IU, Boolean.TRUE.toString());
}
}
@@ -403,7 +403,7 @@ public class Application implements IApplication {
IStatus operationStatus = Status.OK_STATUS;
InstallableUnitQuery query;
- IQueryResult roots;
+ IQueryResult<IInstallableUnit> roots;
try {
initializeRepositories(command == COMMAND_INSTALL);
switch (command) {
@@ -412,7 +412,7 @@ public class Application implements IApplication {
IProfile profile = initializeProfile();
query = new InstallableUnitQuery(root, version == null ? VersionRange.emptyRange : new VersionRange(version, true, version, true));
- roots = collectRootIUs(metadataRepositoryLocations, new PipedQuery(new IQuery[] {query, new LatestIUVersionQuery()}));
+ roots = collectRootIUs(metadataRepositoryLocations, new PipedQuery<IInstallableUnit>(query, new LatestIUVersionQuery<IInstallableUnit>()));
if (roots.isEmpty())
roots = profile.query(query, new NullProgressMonitor());
if (roots.isEmpty()) {
@@ -449,9 +449,9 @@ public class Application implements IApplication {
missingArgument("metadataRepository"); //$NON-NLS-1$
roots = collectRootIUs(metadataRepositoryLocations, query);
- Iterator unitIterator = roots.iterator();
+ Iterator<IInstallableUnit> unitIterator = roots.iterator();
while (unitIterator.hasNext()) {
- IInstallableUnit iu = (IInstallableUnit) unitIterator.next();
+ IInstallableUnit iu = unitIterator.next();
System.out.println(iu.getId());
}
break;
@@ -484,29 +484,30 @@ public class Application implements IApplication {
}
}
- class LocationQueryable implements IQueryable {
+ class LocationQueryable implements IQueryable<IInstallableUnit> {
private URI location;
public LocationQueryable(URI location) {
this.location = location;
}
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult<IInstallableUnit> query(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
return ProvisioningHelper.getInstallableUnits(location, query, monitor);
}
}
- private IQueryResult collectRootIUs(URI[] locations, IQuery query) {
+ private IQueryResult<IInstallableUnit> collectRootIUs(URI[] locations, IQuery<IInstallableUnit> query) {
IProgressMonitor nullMonitor = new NullProgressMonitor();
if (locations == null || locations.length == 0)
return ProvisioningHelper.getInstallableUnits((URI) null, query, nullMonitor);
- IQueryable[] locationQueryables = new IQueryable[locations.length];
+ @SuppressWarnings("unchecked")
+ IQueryable<IInstallableUnit>[] locationQueryables = new IQueryable[locations.length];
for (int i = 0; i < locations.length; i++) {
locationQueryables[i] = new LocationQueryable(locations[i]);
}
- return new CompoundQueryable(locationQueryables).query(query, nullMonitor);
+ return new CompoundQueryable<IInstallableUnit>(locationQueryables).query(query, nullMonitor);
}
private synchronized void setPackageAdmin(PackageAdmin service) {
@@ -537,14 +538,14 @@ public class Application implements IApplication {
Activator.getContext().ungetService(packageAdminRef);
}
- private String toString(Properties context) {
+ private String toString(Map<String, String> context) {
StringBuffer result = new StringBuffer();
- for (Enumeration iter = context.keys(); iter.hasMoreElements();) {
- String key = (String) iter.nextElement();
+ for (Iterator<String> iter = context.keySet().iterator(); iter.hasNext();) {
+ String key = iter.next();
result.append(key);
result.append('=');
result.append(context.get(key));
- if (iter.hasMoreElements())
+ if (iter.hasNext())
result.append(',');
}
return result.toString();
@@ -602,7 +603,7 @@ public class Application implements IApplication {
if (spec == null)
return null;
String[] urlSpecs = getArrayFromString(spec, ","); //$NON-NLS-1$
- ArrayList result = new ArrayList(urlSpecs.length);
+ ArrayList<URI> result = new ArrayList<URI>(urlSpecs.length);
for (int i = 0; i < urlSpecs.length; i++) {
try {
result.add(URIUtil.fromString(urlSpecs[i]));
@@ -612,7 +613,7 @@ public class Application implements IApplication {
}
if (result.size() == 0)
return null;
- return (URI[]) result.toArray(new URI[result.size()]);
+ return result.toArray(new URI[result.size()]);
}
/**
@@ -622,13 +623,13 @@ public class Application implements IApplication {
public static String[] getArrayFromString(String list, String separator) {
if (list == null || list.trim().equals("")) //$NON-NLS-1$
return new String[0];
- List result = new ArrayList();
+ List<String> result = new ArrayList<String>();
for (StringTokenizer tokens = new StringTokenizer(list, separator); tokens.hasMoreTokens();) {
String token = tokens.nextToken().trim();
if (!token.equals("")) //$NON-NLS-1$
result.add(token);
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
private void logFailure(IStatus status) {
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
index 8bab64db9..bfed367f8 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
@@ -16,6 +16,7 @@ import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
@@ -47,7 +48,7 @@ import org.osgi.service.packageadmin.PackageAdmin;
* p2 data location. See bug 268138 for related discussion.
*/
public class DirectorApplication implements IApplication {
- class LocationQueryable implements IQueryable {
+ class LocationQueryable implements IQueryable<IInstallableUnit> {
private URI location;
public LocationQueryable(URI location) {
@@ -55,7 +56,7 @@ public class DirectorApplication implements IApplication {
Assert.isNotNull(location);
}
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult<IInstallableUnit> query(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
return getInstallableUnits(location, query, monitor);
}
}
@@ -122,7 +123,7 @@ public class DirectorApplication implements IApplication {
public static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
- private static void getURIs(List uris, String spec) throws CoreException {
+ private static void getURIs(List<URI> uris, String spec) throws CoreException {
if (spec == null)
return;
String[] urlSpecs = StringHelper.getArrayFromString(spec, ',');
@@ -155,7 +156,7 @@ public class DirectorApplication implements IApplication {
return null;
}
- private static void parseIUsArgument(List vnames, String arg) {
+ private static void parseIUsArgument(List<IVersionedId> vnames, String arg) {
String[] roots = StringHelper.getArrayFromString(arg, ',');
for (int i = 0; i < roots.length; ++i)
vnames.add(VersionedId.parse(roots[i]));
@@ -175,11 +176,11 @@ public class DirectorApplication implements IApplication {
private URI[] artifactReposForRemoval;
private URI[] metadataReposForRemoval;
- private final List artifactRepositoryLocations = new ArrayList();
- private final List metadataRepositoryLocations = new ArrayList();
- private final List rootsToInstall = new ArrayList();
- private final List rootsToUninstall = new ArrayList();
- private final List rootsToList = new ArrayList();
+ private final List<URI> artifactRepositoryLocations = new ArrayList<URI>();
+ private final List<URI> metadataRepositoryLocations = new ArrayList<URI>();
+ private final List<IVersionedId> rootsToInstall = new ArrayList<IVersionedId>();
+ private final List<IVersionedId> rootsToUninstall = new ArrayList<IVersionedId>();
+ private final List<IVersionedId> rootsToList = new ArrayList<IVersionedId>();
private File bundlePool = null;
private File destination;
@@ -228,41 +229,42 @@ public class DirectorApplication implements IApplication {
}
}
- private IQueryResult collectRootIUs(IQuery query) {
+ private IQueryResult<IInstallableUnit> collectRootIUs(IQuery<IInstallableUnit> query) {
IProgressMonitor nullMonitor = new NullProgressMonitor();
int top = metadataRepositoryLocations.size();
if (top == 0)
return getInstallableUnits(null, query, nullMonitor);
- IQueryable[] locationQueryables = new IQueryable[top];
+ @SuppressWarnings("unchecked")
+ IQueryable<IInstallableUnit>[] locationQueryables = new IQueryable[top];
for (int i = 0; i < top; i++)
- locationQueryables[i] = new LocationQueryable((URI) metadataRepositoryLocations.get(i));
- return new CompoundQueryable(locationQueryables).query(query, nullMonitor);
+ locationQueryables[i] = new LocationQueryable(metadataRepositoryLocations.get(i));
+ return new CompoundQueryable<IInstallableUnit>(locationQueryables).query(query, nullMonitor);
}
- private IInstallableUnit[] collectRoots(IProfile profile, List rootNames, boolean forInstall) throws CoreException {
- ArrayList allRoots = new ArrayList();
+ private IInstallableUnit[] collectRoots(IProfile profile, List<IVersionedId> rootNames, boolean forInstall) throws CoreException {
+ ArrayList<IInstallableUnit> allRoots = new ArrayList<IInstallableUnit>();
int top = rootNames.size();
for (int i = 0; i < top; ++i) {
- IVersionedId rootName = (IVersionedId) rootNames.get(i);
+ IVersionedId rootName = rootNames.get(i);
Version v = rootName.getVersion();
- IQuery query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
- IQueryResult roots = null;
+ IQuery<IInstallableUnit> query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
+ IQueryResult<IInstallableUnit> roots = null;
if (forInstall)
- roots = collectRootIUs(new PipedQuery(new IQuery[] {query, new LatestIUVersionQuery()}));
+ roots = collectRootIUs(new PipedQuery<IInstallableUnit>(query, new LatestIUVersionQuery<IInstallableUnit>()));
if (roots == null || roots.isEmpty())
roots = profile.query(query, new NullProgressMonitor());
- Iterator itor = roots.iterator();
+ Iterator<IInstallableUnit> itor = roots.iterator();
if (!itor.hasNext())
throw new CoreException(new Status(IStatus.ERROR, org.eclipse.equinox.internal.p2.director.app.Activator.ID, NLS.bind(Messages.Missing_IU, rootName)));
do {
allRoots.add(itor.next());
} while (itor.hasNext());
}
- return (IInstallableUnit[]) allRoots.toArray(new IInstallableUnit[allRoots.size()]);
+ return allRoots.toArray(new IInstallableUnit[allRoots.size()]);
}
synchronized Bundle getBundle(String symbolicName) {
@@ -282,7 +284,7 @@ public class DirectorApplication implements IApplication {
}
private String getEnvironmentProperty() {
- HashMap values = new HashMap();
+ HashMap<String, String> values = new HashMap<String, String>();
if (os != null)
values.put("osgi.os", os); //$NON-NLS-1$
if (nl != null)
@@ -307,18 +309,18 @@ public class DirectorApplication implements IApplication {
if (flavor == null)
flavor = System.getProperty("eclipse.p2.configurationFlavor", FLAVOR_DEFAULT); //$NON-NLS-1$
- Properties props = new Properties();
- props.setProperty(IProfile.PROP_INSTALL_FOLDER, destination.toString());
+ Map<String, String> props = new HashMap<String, String>();
+ props.put(IProfile.PROP_INSTALL_FOLDER, destination.toString());
if (bundlePool == null)
- props.setProperty(IProfile.PROP_CACHE, sharedLocation == null ? destination.getAbsolutePath() : sharedLocation.getAbsolutePath());
+ props.put(IProfile.PROP_CACHE, sharedLocation == null ? destination.getAbsolutePath() : sharedLocation.getAbsolutePath());
else
- props.setProperty(IProfile.PROP_CACHE, bundlePool.getAbsolutePath());
+ props.put(IProfile.PROP_CACHE, bundlePool.getAbsolutePath());
if (roamingProfile)
- props.setProperty(IProfile.PROP_ROAMING, Boolean.TRUE.toString());
+ props.put(IProfile.PROP_ROAMING, Boolean.TRUE.toString());
String env = getEnvironmentProperty();
if (env != null)
- props.setProperty(IProfile.PROP_ENVIRONMENTS, env);
+ props.put(IProfile.PROP_ENVIRONMENTS, env);
if (profileProperties != null)
putProperties(profileProperties, props);
profile = profileRegistry.addProfile(profileId, props);
@@ -341,7 +343,7 @@ public class DirectorApplication implements IApplication {
boolean anyValid = false; // do we have any valid repos or did they all fail to load?
artifactReposForRemoval = new URI[artifactRepositoryLocations.size()];
for (int i = 0; i < artifactRepositoryLocations.size(); i++) {
- URI location = (URI) artifactRepositoryLocations.get(i);
+ URI location = artifactRepositoryLocations.get(i);
try {
if (!artifactManager.contains(location)) {
artifactManager.loadRepository(location, null);
@@ -369,7 +371,7 @@ public class DirectorApplication implements IApplication {
int top = metadataRepositoryLocations.size();
metadataReposForRemoval = new URI[top];
for (int i = 0; i < top; i++) {
- URI location = (URI) metadataRepositoryLocations.get(i);
+ URI location = metadataRepositoryLocations.get(i);
try {
if (!metadataManager.contains(location)) {
metadataManager.loadRepository(location, null);
@@ -462,27 +464,27 @@ public class DirectorApplication implements IApplication {
if (metadataRepositoryLocations.isEmpty())
missingArgument("metadataRepository"); //$NON-NLS-1$
- ArrayList allRoots = new ArrayList();
+ ArrayList<IInstallableUnit> allRoots = new ArrayList<IInstallableUnit>();
if (rootsToList.size() == 0) {
- Iterator roots = collectRootIUs(InstallableUnitQuery.ANY).iterator();
+ Iterator<IInstallableUnit> roots = collectRootIUs(InstallableUnitQuery.ANY).iterator();
while (roots.hasNext())
allRoots.add(roots.next());
} else {
- Iterator r = rootsToList.iterator();
+ Iterator<IVersionedId> r = rootsToList.iterator();
while (r.hasNext()) {
- IVersionedId rootName = (IVersionedId) r.next();
+ IVersionedId rootName = r.next();
Version v = rootName.getVersion();
- IQuery query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
- Iterator roots = collectRootIUs(query).iterator();
+ IQuery<IInstallableUnit> query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
+ Iterator<IInstallableUnit> roots = collectRootIUs(query).iterator();
while (roots.hasNext())
allRoots.add(roots.next());
}
}
Collections.sort(allRoots);
- Iterator i = allRoots.iterator();
+ Iterator<IInstallableUnit> i = allRoots.iterator();
while (i.hasNext()) {
- IInstallableUnit iu = (IInstallableUnit) i.next();
+ IInstallableUnit iu = i.next();
System.out.println(iu.getId() + '=' + iu.getVersion());
}
}
@@ -496,8 +498,8 @@ public class DirectorApplication implements IApplication {
boolean wasRoaming = Boolean.valueOf(profile.getProperty(IProfile.PROP_ROAMING)).booleanValue();
try {
updateRoamingProperties(profile);
- ProvisioningContext context = new ProvisioningContext((URI[]) metadataRepositoryLocations.toArray(new URI[metadataRepositoryLocations.size()]));
- context.setArtifactRepositories((URI[]) artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()]));
+ ProvisioningContext context = new ProvisioningContext(metadataRepositoryLocations.toArray(new URI[metadataRepositoryLocations.size()]));
+ context.setArtifactRepositories(artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()]));
ProfileChangeRequest request = buildProvisioningRequest(profile, installs, uninstalls);
printRequest(request);
planAndExecute(profile, context, request);
@@ -679,7 +681,7 @@ public class DirectorApplication implements IApplication {
* @param pairs a comma separated list of tag=value pairs
* @param properties the collection into which the pairs are put
*/
- private void putProperties(String pairs, Properties properties) {
+ private void putProperties(String pairs, Map<String, String> properties) {
String[] propPairs = StringHelper.getArrayFromString(pairs, ',');
for (int i = 0; i < propPairs.length; ++i) {
String propPair = propPairs[i];
@@ -755,8 +757,8 @@ public class DirectorApplication implements IApplication {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, Messages.Missing_profile));
IProvisioningPlan plan = planner.getDiffPlan(profile, targetProfile, new NullProgressMonitor());
- ProvisioningContext context = new ProvisioningContext((URI[]) metadataRepositoryLocations.toArray(new URI[metadataRepositoryLocations.size()]));
- context.setArtifactRepositories((URI[]) artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()]));
+ ProvisioningContext context = new ProvisioningContext(metadataRepositoryLocations.toArray(new URI[metadataRepositoryLocations.size()]));
+ context.setArtifactRepositories(artifactRepositoryLocations.toArray(new URI[artifactRepositoryLocations.size()]));
executePlan(context, plan);
}
@@ -777,8 +779,8 @@ public class DirectorApplication implements IApplication {
strm.print(' ');
}
- IQueryResult getInstallableUnits(URI location, IQuery query, IProgressMonitor monitor) {
- IQueryable queryable = null;
+ IQueryResult<IInstallableUnit> getInstallableUnits(URI location, IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
+ IQueryable<IInstallableUnit> queryable = null;
if (location == null) {
queryable = metadataManager;
} else {
@@ -790,7 +792,7 @@ public class DirectorApplication implements IApplication {
}
if (queryable != null)
return queryable.query(query, monitor);
- return Collector.EMPTY_COLLECTOR;
+ return Collector.emptyCollector();
}
private void deeplyPrint(CoreException ce, PrintStream strm, int level) {
@@ -859,16 +861,16 @@ public class DirectorApplication implements IApplication {
return run((String[]) context.getArguments().get("application.args")); //$NON-NLS-1$
}
- private String toString(Map context) {
+ private String toString(Map<String, String> context) {
StringBuffer result = new StringBuffer();
- Iterator entries = context.entrySet().iterator();
+ Iterator<Entry<String, String>> entries = context.entrySet().iterator();
while (entries.hasNext()) {
- Map.Entry entry = (Map.Entry) entries.next();
+ Entry<String, String> entry = entries.next();
if (result.length() > 0)
result.append(',');
- result.append((String) entry.getKey());
+ result.append(entry.getKey());
result.append('=');
- result.append((String) entry.getValue());
+ result.append(entry.getValue());
}
return result.toString();
}
@@ -891,9 +893,9 @@ public class DirectorApplication implements IApplication {
ProfileChangeRequest request = new ProfileChangeRequest(profile);
if (!destination.equals(new File(profile.getProperty(IProfile.PROP_INSTALL_FOLDER))))
- request.setProfileProperty(IProfile.PROP_INSTALL_FOLDER, destination);
+ request.setProfileProperty(IProfile.PROP_INSTALL_FOLDER, destination.getAbsolutePath());
if (!destination.equals(new File(profile.getProperty(IProfile.PROP_CACHE))))
- request.setProfileProperty(IProfile.PROP_CACHE, destination);
+ request.setProfileProperty(IProfile.PROP_CACHE, destination.getAbsolutePath());
if (request.getProfileProperties().size() == 0)
return;
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java b/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java
index ca48ca948..e3d1d56ae 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src_ant/org/eclipse/equinox/p2/director/app/ant/DirectorTask.java
@@ -48,7 +48,7 @@ public class DirectorTask extends Task {
}
private String[] getArguments() {
- List result = new ArrayList();
+ List<String> result = new ArrayList<String>();
if (roaming)
result.add("-roaming");
if (profile != null) {
@@ -106,7 +106,7 @@ public class DirectorTask extends Task {
result.add(Application.COMMAND_NAMES[Application.COMMAND_UNINSTALL]);
result.add(uninstallIU);
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
public void setArch(String value) {
diff --git a/bundles/org.eclipse.equinox.p2.director/.classpath b/bundles/org.eclipse.equinox.p2.director/.classpath
index f4025822f..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.director/.classpath
+++ b/bundles/org.eclipse.equinox.p2.director/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs
index b486accf6..89330506e 100644
--- a/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.director/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Sat Feb 28 12:14:19 CET 2009
+#Mon Dec 21 23:16:26 CET 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -8,23 +8,23 @@ org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
@@ -71,7 +71,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF
index 78a279d15..2f30c357c 100644
--- a/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.director/META-INF/MANIFEST.MF
@@ -38,8 +38,9 @@ Export-Package: org.eclipse.equinox.internal.p2.director;x-friends:="org.eclipse
org.eclipse.pde.core"
Bundle-Activator: org.eclipse.equinox.internal.p2.director.DirectorActivator
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.3.0,4.0.0)",
org.sat4j.core;bundle-version="2.1.0",
org.sat4j.pb;bundle-version="2.1.0",
diff --git a/bundles/org.eclipse.equinox.p2.director/build.properties b/bundles/org.eclipse.equinox.p2.director/build.properties
index 9334e284d..9ac550cbd 100644
--- a/bundles/org.eclipse.equinox.p2.director/build.properties
+++ b/bundles/org.eclipse.equinox.p2.director/build.properties
@@ -16,3 +16,5 @@ bin.includes = META-INF/,\
plugin.properties
src.includes = about.html
source.. = src/
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java
index 2feb2a82f..41460f283 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ApplicablePatchQuery.java
@@ -18,7 +18,7 @@ import org.eclipse.equinox.p2.metadata.IRequirement;
/**
* A query that accepts any patch that applies to a given installable unit.
*/
-public class ApplicablePatchQuery extends MatchQuery {
+public class ApplicablePatchQuery extends MatchQuery<IInstallableUnit> {
IInstallableUnit iu;
/**
@@ -30,7 +30,7 @@ public class ApplicablePatchQuery extends MatchQuery {
this.iu = iu;
}
- public boolean isMatch(Object candidate) {
+ public boolean isMatch(IInstallableUnit candidate) {
if (!(candidate instanceof IInstallableUnitPatch))
return false;
IInstallableUnitPatch patchIU = (IInstallableUnitPatch) candidate;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java
index bccf51be2..f22e580bc 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/AttachmentHelper.java
@@ -21,38 +21,36 @@ import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
public class AttachmentHelper {
private static final IInstallableUnitFragment[] NO_FRAGMENTS = new IInstallableUnitFragment[0];
- public static Collection attachFragments(Iterator toAttach, Map fragmentsToIUs) {
- Map fragmentBindings = new HashMap();
+ public static Collection<IInstallableUnit> attachFragments(Iterator<IInstallableUnit> toAttach, Map<IInstallableUnitFragment, List<IInstallableUnit>> fragmentsToIUs) {
+ Map<IInstallableUnit, IInstallableUnitFragment> fragmentBindings = new HashMap<IInstallableUnit, IInstallableUnitFragment>();
//Build a map inverse of the one provided in input (host --> List of fragments)
- Map iusToFragment = new HashMap(fragmentsToIUs.size());
- for (Iterator iterator = fragmentsToIUs.entrySet().iterator(); iterator.hasNext();) {
- Entry mapping = (Entry) iterator.next();
- IInstallableUnitFragment fragment = (IInstallableUnitFragment) mapping.getKey();
- List existingMatches = (List) mapping.getValue();
+ Map<IInstallableUnit, List<IInstallableUnitFragment>> iusToFragment = new HashMap<IInstallableUnit, List<IInstallableUnitFragment>>(fragmentsToIUs.size());
+ for (Iterator<Entry<IInstallableUnitFragment, List<IInstallableUnit>>> iterator = fragmentsToIUs.entrySet().iterator(); iterator.hasNext();) {
+ Entry<IInstallableUnitFragment, List<IInstallableUnit>> mapping = iterator.next();
+ IInstallableUnitFragment fragment = mapping.getKey();
+ List<IInstallableUnit> existingMatches = mapping.getValue();
- for (Iterator iterator2 = existingMatches.iterator(); iterator2.hasNext();) {
- Object host = iterator2.next();
- List potentialFragments = (List) iusToFragment.get(host);
+ for (Iterator<IInstallableUnit> iterator2 = existingMatches.iterator(); iterator2.hasNext();) {
+ IInstallableUnit host = iterator2.next();
+ List<IInstallableUnitFragment> potentialFragments = iusToFragment.get(host);
if (potentialFragments == null) {
- potentialFragments = new ArrayList();
+ potentialFragments = new ArrayList<IInstallableUnitFragment>();
iusToFragment.put(host, potentialFragments);
}
potentialFragments.add(fragment);
}
}
- for (Iterator iterator = iusToFragment.entrySet().iterator(); iterator.hasNext();) {
- Entry entry = (Entry) iterator.next();
- IInstallableUnit hostIU = (IInstallableUnit) entry.getKey();
- List potentialIUFragments = (List) entry.getValue();
- ArrayList applicableFragments = new ArrayList();
- for (Iterator iterator2 = potentialIUFragments.iterator(); iterator2.hasNext();) {
- IInstallableUnit dependentIU = (IInstallableUnitFragment) iterator2.next();
- if (hostIU.equals(dependentIU) || !FragmentQuery.isFragment(dependentIU))
+ for (Iterator<Entry<IInstallableUnit, List<IInstallableUnitFragment>>> iterator = iusToFragment.entrySet().iterator(); iterator.hasNext();) {
+ Entry<IInstallableUnit, List<IInstallableUnitFragment>> entry = iterator.next();
+ IInstallableUnit hostIU = entry.getKey();
+ List<IInstallableUnitFragment> potentialIUFragments = entry.getValue();
+ ArrayList<IInstallableUnitFragment> applicableFragments = new ArrayList<IInstallableUnitFragment>();
+ for (Iterator<IInstallableUnitFragment> iterator2 = potentialIUFragments.iterator(); iterator2.hasNext();) {
+ IInstallableUnitFragment potentialFragment = iterator2.next();
+ if (hostIU.equals(potentialFragment))
continue;
- IInstallableUnitFragment potentialFragment = (IInstallableUnitFragment) dependentIU;
-
// Check to make sure the host meets the requirements of the fragment
IRequirement reqsFromFragment[] = potentialFragment.getHost();
boolean match = true;
@@ -74,8 +72,8 @@ public class AttachmentHelper {
IInstallableUnitFragment theFragment = null;
int specificityLevel = 0;
- for (Iterator iterator4 = applicableFragments.iterator(); iterator4.hasNext();) {
- IInstallableUnitFragment fragment = (IInstallableUnitFragment) iterator4.next();
+ for (Iterator<IInstallableUnitFragment> iterator4 = applicableFragments.iterator(); iterator4.hasNext();) {
+ IInstallableUnitFragment fragment = iterator4.next();
if (fragment.getHost().length > specificityLevel) {
theFragment = fragment;
specificityLevel = fragment.getHost().length;
@@ -85,9 +83,9 @@ public class AttachmentHelper {
fragmentBindings.put(hostIU, theFragment);
}
//build the collection of resolved IUs
- Collection result = new HashSet();
+ Collection<IInstallableUnit> result = new HashSet<IInstallableUnit>();
while (toAttach.hasNext()) {
- IInstallableUnit iu = (IInstallableUnit) toAttach.next();
+ IInstallableUnit iu = toAttach.next();
if (iu == null)
continue;
//just return fragments as they are
@@ -96,7 +94,7 @@ public class AttachmentHelper {
continue;
}
//return a new IU that combines the IU with its bound fragments
- IInstallableUnitFragment fragment = (IInstallableUnitFragment) fragmentBindings.get(iu);
+ IInstallableUnitFragment fragment = fragmentBindings.get(iu);
IInstallableUnitFragment[] fragments;
if (fragment == null)
fragments = NO_FRAGMENTS;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java
index ecc502d68..5d42c3741 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Explanation.java
@@ -17,7 +17,7 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
import org.eclipse.osgi.util.NLS;
-public abstract class Explanation implements Comparable {
+public abstract class Explanation implements Comparable<Explanation> {
public static class PatchedHardRequirement extends Explanation {
public final IInstallableUnit iu;
@@ -197,8 +197,7 @@ public abstract class Explanation implements Comparable {
super();
}
- public int compareTo(Object arg0) {
- Explanation exp = (Explanation) arg0;
+ public int compareTo(Explanation exp) {
if (this.orderValue() == exp.orderValue()) {
return this.toString().compareTo(exp.toString());
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java
index b1042905e..51ec7853d 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java
@@ -21,83 +21,61 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit;
public class OperationGenerator {
private static final IInstallableUnit NULL_IU = MetadataFactory.createResolvedInstallableUnit(MetadataFactory.createInstallableUnit(new InstallableUnitDescription()), new IInstallableUnitFragment[0]);
- public InstallableUnitOperand[] generateOperation(Collection from_, Collection to_) {
- Collection intersection = new HashSet(from_);
+ public List<InstallableUnitOperand> generateOperation(Collection<IInstallableUnit> from_, Collection<IInstallableUnit> to_) {
+ Collection<IInstallableUnit> intersection = new HashSet<IInstallableUnit>(from_);
intersection.retainAll(to_);
- HashSet tmpFrom = new HashSet(from_);
- HashSet tmpTo = new HashSet(to_);
+ HashSet<IInstallableUnit> tmpFrom = new HashSet<IInstallableUnit>(from_);
+ HashSet<IInstallableUnit> tmpTo = new HashSet<IInstallableUnit>(to_);
tmpFrom.removeAll(intersection);
tmpTo.removeAll(intersection);
- List from = new ArrayList(tmpFrom);
+ List<IInstallableUnit> from = new ArrayList<IInstallableUnit>(tmpFrom);
Collections.sort(from);
- List to = new ArrayList(tmpTo);
+ List<IInstallableUnit> to = new ArrayList<IInstallableUnit>(tmpTo);
Collections.sort(to);
- ArrayList operations = new ArrayList();
+ ArrayList<InstallableUnitOperand> operations = new ArrayList<InstallableUnitOperand>();
generateUpdates(from, to, operations);
generateInstallUninstall(from, to, operations);
generateConfigurationChanges(to_, intersection, operations);
- InstallableUnitOperand[] ops = (InstallableUnitOperand[]) operations.toArray(new InstallableUnitOperand[operations.size()]);
- return ops;
+ return operations;
}
//This generates operations that are causing the IUs to be reconfigured.
- private void generateConfigurationChanges(Collection to_, Collection intersection, ArrayList operations) {
+ private void generateConfigurationChanges(Collection<IInstallableUnit> to_, Collection<IInstallableUnit> intersection, ArrayList<InstallableUnitOperand> operations) {
if (intersection.size() == 0)
return;
//We retain from each set the things that are the same.
//Note that despite the fact that they are the same, a different CU can be attached.
//The objects contained in the intersection are the one that were originally in the from collection.
- TreeSet to = new TreeSet(to_);
- for (Iterator iterator = intersection.iterator(); iterator.hasNext();) {
- IInstallableUnit fromIU = (IInstallableUnit) iterator.next();
- IInstallableUnit toIU = (IInstallableUnit) to.tailSet(fromIU).first();
+ TreeSet<IInstallableUnit> to = new TreeSet<IInstallableUnit>(to_);
+ for (Iterator<IInstallableUnit> iterator = intersection.iterator(); iterator.hasNext();) {
+ IInstallableUnit fromIU = iterator.next();
+ IInstallableUnit toIU = to.tailSet(fromIU).first();
generateConfigurationOperation(fromIU, toIU, operations);
}
}
- private void generateConfigurationOperation(IInstallableUnit fromIU, IInstallableUnit toIU, ArrayList operations) {
- IInstallableUnitFragment[] fromFragments = fromIU.getFragments();
- IInstallableUnitFragment[] toFragments = toIU.getFragments();
+ private void generateConfigurationOperation(IInstallableUnit fromIU, IInstallableUnit toIU, ArrayList<InstallableUnitOperand> operations) {
+ List<IInstallableUnitFragment> fromFragments = fromIU.getFragments();
+ List<IInstallableUnitFragment> toFragments = toIU.getFragments();
if (fromFragments == toFragments)
return;
//Check to see if the two arrays are equals independently of the order of the fragments
- boolean different = false;
- if (fromFragments != null && toFragments != null) {
- if (fromFragments.length != toFragments.length)
- different = true;
- else {
- for (int i = 0; i < fromFragments.length; i++) {
- boolean found = false;
- for (int j = 0; j < toFragments.length; j++) {
- if (fromFragments[i].equals(toFragments[j]))
- found = true;
- }
- if (!found) {
- different = true;
- break;
- }
- }
- }
- } else {
- //One of the two array is null
- different = true;
- }
- if (!different)
+ if (fromFragments.size() == toFragments.size() && fromFragments.containsAll(toFragments))
return;
operations.add(new InstallableUnitOperand(fromIU, toIU));
}
- private void generateInstallUninstall(List from, List to, ArrayList operations) {
+ private void generateInstallUninstall(List<IInstallableUnit> from, List<IInstallableUnit> to, ArrayList<InstallableUnitOperand> operations) {
int toIdx = 0;
int fromIdx = 0;
while (fromIdx != from.size() && toIdx != to.size()) {
- IInstallableUnit fromIU = (IInstallableUnit) from.get(fromIdx);
- IInstallableUnit toIU = (IInstallableUnit) to.get(toIdx);
+ IInstallableUnit fromIU = from.get(fromIdx);
+ IInstallableUnit toIU = to.get(toIdx);
int comparison = toIU.compareTo(fromIU);
if (comparison < 0) {
operations.add(createInstallOperation(toIU));
@@ -113,36 +91,36 @@ public class OperationGenerator {
}
if (fromIdx != from.size()) {
for (int i = fromIdx; i < from.size(); i++) {
- operations.add(createUninstallOperation((IInstallableUnit) from.get(i)));
+ operations.add(createUninstallOperation(from.get(i)));
}
}
if (toIdx != to.size()) {
for (int i = toIdx; i < to.size(); i++) {
- operations.add(createInstallOperation((IInstallableUnit) to.get(i)));
+ operations.add(createInstallOperation(to.get(i)));
}
}
}
- private void generateUpdates(List from, List to, ArrayList operations) {
- Set processed = new HashSet();
- Set removedFromTo = new HashSet();
-
+ private void generateUpdates(List<IInstallableUnit> from, List<IInstallableUnit> to, ArrayList<InstallableUnitOperand> operations) {
if (to.isEmpty() || from.isEmpty())
return;
- Map fromById = new HashMap();
- for (Iterator iterator = from.iterator(); iterator.hasNext();) {
- IInstallableUnit iuFrom = (IInstallableUnit) iterator.next();
- List ius = (List) fromById.get(iuFrom.getId());
+ Set<IInstallableUnit> processed = new HashSet<IInstallableUnit>();
+ Set<IInstallableUnit> removedFromTo = new HashSet<IInstallableUnit>();
+
+ Map<String, List<IInstallableUnit>> fromById = new HashMap<String, List<IInstallableUnit>>();
+ for (Iterator<IInstallableUnit> iterator = from.iterator(); iterator.hasNext();) {
+ IInstallableUnit iuFrom = iterator.next();
+ List<IInstallableUnit> ius = fromById.get(iuFrom.getId());
if (ius == null) {
- ius = new ArrayList();
+ ius = new ArrayList<IInstallableUnit>();
fromById.put(iuFrom.getId(), ius);
}
ius.add(iuFrom);
}
for (int toIdx = 0; toIdx < to.size(); toIdx++) {
- IInstallableUnit iuTo = (IInstallableUnit) to.get(toIdx);
+ IInstallableUnit iuTo = to.get(toIdx);
if (iuTo.getId().equals(next(to, toIdx).getId())) { //This handle the case where there are multiple versions of the same IU in the target. Eg we are trying to update from A 1.0.0 to A 1.1.1 and A 1.2.2
toIdx = skip(to, iuTo, toIdx) - 1;
//System.out.println("Can't update " + iuTo + " because another iu with same id is in the target state");
@@ -151,18 +129,18 @@ public class OperationGenerator {
if (iuTo.getUpdateDescriptor() == null)
continue;
- List fromIdIndexList = (List) fromById.get(iuTo.getUpdateDescriptor().getId());
+ List<IInstallableUnit> fromIdIndexList = fromById.get(iuTo.getUpdateDescriptor().getId());
if (fromIdIndexList == null)
continue;
//when the ui we update from is in the new state, skip (for example FROM is A, C, B & TO is C (update of
InstallableUnitQuery updateQuery = new InstallableUnitQuery(iuTo.getUpdateDescriptor().getId(), iuTo.getUpdateDescriptor().getRange());
- Iterator updates = updateQuery.perform(fromIdIndexList.iterator()).iterator();
+ Iterator<IInstallableUnit> updates = updateQuery.perform(fromIdIndexList.iterator()).iterator();
if (!updates.hasNext()) { //Nothing to update from.
continue;
}
- IInstallableUnit iuFrom = (IInstallableUnit) updates.next();
+ IInstallableUnit iuFrom = updates.next();
if (updates.hasNext()) { //There are multiple IUs to update from
//System.out.println("Can't update " + iuTo + " because there are multiple IUs to update from (" + toString(iusFrom) + ')');
continue;
@@ -194,17 +172,17 @@ public class OperationGenerator {
return new InstallableUnitOperand(from, to);
}
- private IInstallableUnit next(List l, int i) {
+ private IInstallableUnit next(List<IInstallableUnit> l, int i) {
i++;
if (i >= l.size())
return NULL_IU;
- return (IInstallableUnit) l.get(i);
+ return l.get(i);
}
- private int skip(List c, IInstallableUnit id, int idx) {
+ private int skip(List<IInstallableUnit> c, IInstallableUnit id, int idx) {
int i = idx;
for (; i < c.size(); i++) {
- if (!id.getId().equals(((IInstallableUnit) c.get(i)).getId()))
+ if (!id.getId().equals(c.get(i).getId()))
return i;
}
return i;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/PermissiveSlicer.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/PermissiveSlicer.java
index 45e305a8d..a81fa2635 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/PermissiveSlicer.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/PermissiveSlicer.java
@@ -22,7 +22,7 @@ public class PermissiveSlicer extends Slicer {
private boolean evalFilterTo;
private boolean onlyFilteredRequirements;
- public PermissiveSlicer(IQueryable input, Dictionary context, boolean includeOptionalDependencies, boolean everythingGreedy, boolean evalFilterTo, boolean considerOnlyStrictDependency, boolean onlyFilteredRequirements) {
+ public PermissiveSlicer(IQueryable<IInstallableUnit> input, Dictionary<? extends Object, ? extends Object> context, boolean includeOptionalDependencies, boolean everythingGreedy, boolean evalFilterTo, boolean considerOnlyStrictDependency, boolean onlyFilteredRequirements) {
super(input, context, true);
this.considerFilter = (context != null && context.size() > 1) ? true : false;
this.includeOptionalDependencies = includeOptionalDependencies;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
index 53b91ea0d..21ed85341 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
@@ -16,6 +16,7 @@ import java.util.*;
import java.util.Map.Entry;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
@@ -41,28 +42,28 @@ import org.sat4j.specs.*;
public class Projector {
static boolean DEBUG = Tracing.DEBUG_PLANNER_PROJECTOR;
private static boolean DEBUG_ENCODING = false;
- private IQueryable picker;
+ private IQueryable<IInstallableUnit> picker;
private QueryableArray patches;
- private Map noopVariables; //key IU, value AbstractVariable
- private List abstractVariables;
+ private Map<IInstallableUnit, AbstractVariable> noopVariables; //key IU, value AbstractVariable
+ private List<AbstractVariable> abstractVariables;
- private TwoTierMap slice; //The IUs that have been considered to be part of the problem
+ private Map<String, Map<Version, IInstallableUnit>> slice; //The IUs that have been considered to be part of the problem
- private Dictionary selectionContext;
+ private Dictionary<String, String> selectionContext;
- DependencyHelper dependencyHelper;
- private Collection solution;
- private Collection assumptions;
+ DependencyHelper<Object, Explanation> dependencyHelper;
+ private Collection<IInstallableUnit> solution;
+ private Collection<Object> assumptions;
private MultiStatus result;
- private Collection alreadyInstalledIUs;
- private IQueryable lastState;
+ private Collection<IInstallableUnit> alreadyInstalledIUs;
+ private IQueryable<IInstallableUnit> lastState;
private boolean considerMetaRequirements;
private IInstallableUnit entryPoint;
- private Map fragments = new HashMap();
+ private Map<IInstallableUnitFragment, Set<IInstallableUnit>> fragments = new HashMap<IInstallableUnitFragment, Set<IInstallableUnit>>();
static class AbstractVariable {
public String toString() {
@@ -74,7 +75,7 @@ public class Projector {
* Job for computing SAT failure explanation in the background.
*/
class ExplanationJob extends Job {
- private Set explanation;
+ private Set<Explanation> explanation;
public ExplanationJob() {
super(Messages.Planner_NoSolution);
@@ -91,7 +92,7 @@ public class Projector {
dependencyHelper.stopExplanation();
}
- public Set getExplanationResult() {
+ public Set<Explanation> getExplanationResult() {
return explanation;
}
@@ -107,7 +108,7 @@ public class Projector {
long stop = System.currentTimeMillis();
Tracing.debug("Explanation found: " + (stop - start)); //$NON-NLS-1$
Tracing.debug("Explanation:"); //$NON-NLS-1$
- for (Iterator i = explanation.iterator(); i.hasNext();) {
+ for (Iterator<Explanation> i = explanation.iterator(); i.hasNext();) {
Tracing.debug(i.next().toString());
}
}
@@ -117,7 +118,7 @@ public class Projector {
} finally {
//must never have a null result, because caller is waiting on result to be non-null
if (explanation == null)
- explanation = Collections.EMPTY_SET;
+ explanation = CollectionUtils.emptySet();
}
synchronized (this) {
ExplanationJob.this.notify();
@@ -127,14 +128,14 @@ public class Projector {
}
- public Projector(IQueryable q, Dictionary context, boolean considerMetaRequirements) {
+ public Projector(IQueryable<IInstallableUnit> q, Dictionary<String, String> context, boolean considerMetaRequirements) {
picker = q;
- noopVariables = new HashMap();
- slice = new TwoTierMap();
+ noopVariables = new HashMap<IInstallableUnit, AbstractVariable>();
+ slice = new HashMap<String, Map<Version, IInstallableUnit>>();
selectionContext = context;
- abstractVariables = new ArrayList();
+ abstractVariables = new ArrayList<AbstractVariable>();
result = new MultiStatus(DirectorActivator.PI_DIRECTOR, IStatus.OK, Messages.Planner_Problems_resolving_plan, null);
- assumptions = new ArrayList();
+ assumptions = new ArrayList<Object>();
this.considerMetaRequirements = considerMetaRequirements;
}
@@ -142,7 +143,7 @@ public class Projector {
return !lastState.query(new InstallableUnitQuery(iu), null).isEmpty();
}
- public void encode(IInstallableUnit entryPointIU, IInstallableUnit[] alreadyExistingRoots, IQueryable installedIUs, IInstallableUnit[] newRoots, IProgressMonitor monitor) {
+ public void encode(IInstallableUnit entryPointIU, IInstallableUnit[] alreadyExistingRoots, IQueryable<IInstallableUnit> installedIUs, IInstallableUnit[] newRoots, IProgressMonitor monitor) {
alreadyInstalledIUs = Arrays.asList(alreadyExistingRoots);
lastState = installedIUs;
this.entryPoint = entryPointIU;
@@ -159,12 +160,12 @@ public class Projector {
solver = SolverFactory.newEclipseP2();
}
solver.setTimeoutOnConflicts(1000);
- IQueryResult queryResult = picker.query(InstallableUnitQuery.ANY, null);
- dependencyHelper = new DependencyHelper(solver);
+ IQueryResult<IInstallableUnit> queryResult = picker.query(InstallableUnitQuery.ANY, null);
+ dependencyHelper = new DependencyHelper<Object, Explanation>(solver);
- Iterator iusToEncode = queryResult.iterator();
+ Iterator<IInstallableUnit> iusToEncode = queryResult.iterator();
if (DEBUG) {
- List iusToOrder = new ArrayList();
+ List<IInstallableUnit> iusToOrder = new ArrayList<IInstallableUnit>();
while (iusToEncode.hasNext()) {
iusToOrder.add(iusToEncode.next());
}
@@ -176,7 +177,7 @@ public class Projector {
result.merge(Status.CANCEL_STATUS);
throw new OperationCanceledException();
}
- IInstallableUnit iuToEncode = (IInstallableUnit) iusToEncode.next();
+ IInstallableUnit iuToEncode = iusToEncode.next();
if (iuToEncode != entryPointIU) {
processIU(iuToEncode, false);
}
@@ -203,24 +204,24 @@ public class Projector {
//Create an optimization function favoring the highest version of each IU
private void createOptimizationFunction(IInstallableUnit metaIu) {
- List weightedObjects = new ArrayList();
+ List<WeightedObject<? extends Object>> weightedObjects = new ArrayList<WeightedObject<? extends Object>>();
- Set s = slice.entrySet();
+ Set<Entry<String, Map<Version, IInstallableUnit>>> s = slice.entrySet();
final BigInteger POWER = BigInteger.valueOf(2);
BigInteger maxWeight = POWER;
- for (Iterator iterator = s.iterator(); iterator.hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
- HashMap conflictingEntries = (HashMap) entry.getValue();
+ for (Iterator<Entry<String, Map<Version, IInstallableUnit>>> iterator = s.iterator(); iterator.hasNext();) {
+ Entry<String, Map<Version, IInstallableUnit>> entry = iterator.next();
+ Map<Version, IInstallableUnit> conflictingEntries = entry.getValue();
if (conflictingEntries.size() == 1) {
continue;
}
- List toSort = new ArrayList(conflictingEntries.values());
+ List<IInstallableUnit> toSort = new ArrayList<IInstallableUnit>(conflictingEntries.values());
Collections.sort(toSort, Collections.reverseOrder());
BigInteger weight = POWER;
int count = toSort.size();
for (int i = 0; i < count; i++) {
- IInstallableUnit iu = (IInstallableUnit) toSort.get(i);
+ IInstallableUnit iu = toSort.get(i);
weightedObjects.add(WeightedObject.newWO(iu, isInstalled(iu) ? BigInteger.ONE : weight));
weight = weight.multiply(POWER);
}
@@ -231,7 +232,7 @@ public class Projector {
maxWeight = maxWeight.multiply(POWER);
// Weight the no-op variables beneath the abstract variables
- for (Iterator iterator = noopVariables.values().iterator(); iterator.hasNext();) {
+ for (Iterator<AbstractVariable> iterator = noopVariables.values().iterator(); iterator.hasNext();) {
weightedObjects.add(WeightedObject.newWO(iterator.next(), maxWeight));
}
@@ -239,7 +240,7 @@ public class Projector {
// Add the abstract variables
BigInteger abstractWeight = maxWeight.negate();
- for (Iterator iterator = abstractVariables.iterator(); iterator.hasNext();) {
+ for (Iterator<AbstractVariable> iterator = abstractVariables.iterator(); iterator.hasNext();) {
weightedObjects.add(WeightedObject.newWO(iterator.next(), abstractWeight));
}
@@ -247,14 +248,16 @@ public class Projector {
BigInteger optionalWeight = maxWeight.negate();
long countOptional = 1;
- List requestedPatches = new ArrayList();
- IRequirement[] reqs = metaIu.getRequiredCapabilities();
- for (int j = 0; j < reqs.length; j++) {
- if (reqs[j].getMin() > 0)
+ List<IInstallableUnit> requestedPatches = new ArrayList<IInstallableUnit>();
+ List<IRequirement> reqs = metaIu.getRequiredCapabilities();
+ int top = reqs.size();
+ for (int j = 0; j < top; j++) {
+ IRequirement req = reqs.get(j);
+ if (req.getMin() > 0)
continue;
- IQueryResult matches = picker.query(reqs[j].getMatches(), null);
- for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
- IInstallableUnit match = (IInstallableUnit) iterator.next();
+ IQueryResult<IInstallableUnit> matches = picker.query(req.getMatches(), null);
+ for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) {
+ IInstallableUnit match = iterator.next();
if (match instanceof IInstallableUnitPatch) {
requestedPatches.add(match);
countOptional = countOptional + 1;
@@ -265,7 +268,7 @@ public class Projector {
}
BigInteger patchWeight = maxWeight.multiply(POWER).multiply(BigInteger.valueOf(countOptional)).negate();
- for (Iterator iterator = requestedPatches.iterator(); iterator.hasNext();) {
+ for (Iterator<IInstallableUnit> iterator = requestedPatches.iterator(); iterator.hasNext();) {
weightedObjects.add(WeightedObject.newWO(iterator.next(), patchWeight));
}
if (!weightedObjects.isEmpty()) {
@@ -273,11 +276,11 @@ public class Projector {
}
}
- private void createObjectiveFunction(List weightedObjects) {
+ private void createObjectiveFunction(List<WeightedObject<? extends Object>> weightedObjects) {
if (DEBUG) {
StringBuffer b = new StringBuffer();
- for (Iterator i = weightedObjects.iterator(); i.hasNext();) {
- WeightedObject object = (WeightedObject) i.next();
+ for (Iterator<WeightedObject<? extends Object>> i = weightedObjects.iterator(); i.hasNext();) {
+ WeightedObject<? extends Object> object = i.next();
if (b.length() > 0)
b.append(", "); //$NON-NLS-1$
b.append(object.getWeight());
@@ -286,7 +289,9 @@ public class Projector {
}
Tracing.debug("objective function: " + b); //$NON-NLS-1$
}
- dependencyHelper.setObjectiveFunction((WeightedObject[]) weightedObjects.toArray(new WeightedObject[weightedObjects.size()]));
+ @SuppressWarnings("unchecked")
+ WeightedObject<Object>[] array = (WeightedObject<Object>[]) weightedObjects.toArray(new WeightedObject<?>[weightedObjects.size()]);
+ dependencyHelper.setObjectiveFunction(array);
}
private void createMustHave(IInstallableUnit iu, IInstallableUnit[] alreadyExistingRoots, IInstallableUnit[] newRoots) throws ContradictionException {
@@ -307,7 +312,7 @@ public class Projector {
// Check whether the requirement is applicable
private boolean isApplicable(IRequirement req) {
- IQuery filter = req.getFilter();
+ IQuery<Boolean> filter = req.getFilter();
if (filter == null)
return true;
if (filter instanceof LDAPQuery)
@@ -330,16 +335,16 @@ public class Projector {
}
}
- private void expandNegatedRequirement(IRequirement req, IInstallableUnit iu, List optionalAbstractRequirements, boolean isRootIu) throws ContradictionException {
+ private void expandNegatedRequirement(IRequirement req, IInstallableUnit iu, List<AbstractVariable> optionalAbstractRequirements, boolean isRootIu) throws ContradictionException {
if (!isApplicable(req))
return;
- List matches = getApplicableMatches(req);
+ List<IInstallableUnit> matches = getApplicableMatches(req);
if (matches.isEmpty()) {
return;
}
Explanation explanation;
if (isRootIu) {
- IInstallableUnit reqIu = (IInstallableUnit) matches.get(0);
+ IInstallableUnit reqIu = matches.get(0);
if (alreadyInstalledIUs.contains(reqIu)) {
explanation = new Explanation.IUInstalled(reqIu);
} else {
@@ -351,22 +356,22 @@ public class Projector {
createNegationImplication(iu, matches, explanation);
}
- private void expandRequirement(IRequirement req, IInstallableUnit iu, List optionalAbstractRequirements, boolean isRootIu) throws ContradictionException {
+ private void expandRequirement(IRequirement req, IInstallableUnit iu, List<AbstractVariable> optionalAbstractRequirements, boolean isRootIu) throws ContradictionException {
if (req.getMax() == 0) {
expandNegatedRequirement(req, iu, optionalAbstractRequirements, isRootIu);
return;
}
if (!isApplicable(req))
return;
- List matches = getApplicableMatches(req);
+ List<IInstallableUnit> matches = getApplicableMatches(req);
if (isHostRequirement(iu, req)) {
- rememberHostMatches(iu, matches);
+ rememberHostMatches((IInstallableUnitFragment) iu, matches);
}
if (req.getMin() > 0) {
if (matches.isEmpty()) {
missingRequirement(iu, req);
} else {
- IInstallableUnit reqIu = (IInstallableUnit) matches.get(0);
+ IInstallableUnit reqIu = matches.get(0);
Explanation explanation;
if (isRootIu) {
if (alreadyInstalledIUs.contains(reqIu)) {
@@ -388,13 +393,14 @@ public class Projector {
}
}
- private void expandRequirements(IRequirement[] reqs, IInstallableUnit iu, boolean isRootIu) throws ContradictionException {
- if (reqs.length == 0) {
+ private void expandRequirements(List<IRequirement> reqs, IInstallableUnit iu, boolean isRootIu) throws ContradictionException {
+ int top = reqs.size();
+ if (top == 0) {
return;
}
- List optionalAbstractRequirements = new ArrayList();
- for (int i = 0; i < reqs.length; i++) {
- expandRequirement(reqs[i], iu, optionalAbstractRequirements, isRootIu);
+ List<AbstractVariable> optionalAbstractRequirements = new ArrayList<AbstractVariable>();
+ for (int i = 0; i < top; i++) {
+ expandRequirement(reqs.get(i), iu, optionalAbstractRequirements, isRootIu);
}
createOptionalityExpression(iu, optionalAbstractRequirements);
}
@@ -402,13 +408,18 @@ public class Projector {
public void processIU(IInstallableUnit iu, boolean isRootIU) throws ContradictionException {
iu = iu.unresolved();
- slice.put(iu.getId(), iu.getVersion(), iu);
+ Map<Version, IInstallableUnit> iuSlice = slice.get(iu.getId());
+ if (iuSlice == null) {
+ iuSlice = new HashMap<Version, IInstallableUnit>();
+ slice.put(iu.getId(), iuSlice);
+ }
+ iuSlice.put(iu.getVersion(), iu);
if (!isApplicable(iu)) {
createNegation(iu, null);
return;
}
- IQueryResult applicablePatches = getApplicablePatches(iu);
+ IQueryResult<IInstallableUnit> applicablePatches = getApplicablePatches(iu);
expandLifeCycle(iu, isRootIU);
//No patches apply, normal code path
if (applicablePatches.isEmpty()) {
@@ -419,26 +430,33 @@ public class Projector {
}
}
- private IRequirement[] getRequiredCapabilities(IInstallableUnit iu) {
- if (considerMetaRequirements == false || iu.getMetaRequiredCapabilities().length == 0)
- return iu.getRequiredCapabilities();
- IRequirement[] aggregatedCapabilities = new IRequirement[iu.getRequiredCapabilities().length + iu.getMetaRequiredCapabilities().length];
- System.arraycopy(iu.getRequiredCapabilities(), 0, aggregatedCapabilities, 0, iu.getRequiredCapabilities().length);
- System.arraycopy(iu.getMetaRequiredCapabilities(), 0, aggregatedCapabilities, iu.getRequiredCapabilities().length, iu.getMetaRequiredCapabilities().length);
- return aggregatedCapabilities;
+ private List<IRequirement> getRequiredCapabilities(IInstallableUnit iu) {
+ List<IRequirement> rqs = iu.getRequiredCapabilities();
+ if (!considerMetaRequirements)
+ return rqs;
+
+ List<IRequirement> metaRqs = iu.getMetaRequiredCapabilities();
+ if (metaRqs.isEmpty())
+ return rqs;
+
+ ArrayList<IRequirement> aggregatedRqs = new ArrayList<IRequirement>(rqs.size() + metaRqs.size());
+ aggregatedRqs.addAll(rqs);
+ aggregatedRqs.addAll(metaRqs);
+ return aggregatedRqs;
}
static final class Pending {
- List matches;
+ List<IInstallableUnit> matches;
Explanation explanation;
Object left;
}
- private void expandRequirementsWithPatches(IInstallableUnit iu, IQueryResult applicablePatches, boolean isRootIu) throws ContradictionException {
+ private void expandRequirementsWithPatches(IInstallableUnit iu, IQueryResult<IInstallableUnit> applicablePatches, boolean isRootIu) throws ContradictionException {
//Unmodified dependencies
- Map unchangedRequirements = new HashMap(getRequiredCapabilities(iu).length);
- Map nonPatchedRequirements = new HashMap(getRequiredCapabilities(iu).length);
- for (Iterator iterator = applicablePatches.iterator(); iterator.hasNext();) {
+ List<IRequirement> iuRequirements = getRequiredCapabilities(iu);
+ Map<IRequirement, List<IInstallableUnitPatch>> unchangedRequirements = new HashMap<IRequirement, List<IInstallableUnitPatch>>(iuRequirements.size());
+ Map<IRequirement, Pending> nonPatchedRequirements = new HashMap<IRequirement, Pending>(iuRequirements.size());
+ for (Iterator<IInstallableUnit> iterator = applicablePatches.iterator(); iterator.hasNext();) {
IInstallableUnitPatch patch = (IInstallableUnitPatch) iterator.next();
IRequirement[][] reqs = mergeRequirements(iu, patch);
if (reqs.length == 0)
@@ -449,16 +467,16 @@ public class Projector {
// noop(IU)-> ~ABS
// IU -> (noop(IU) or ABS)
// Therefore we only need one optional requirement statement per IU
- List optionalAbstractRequirements = new ArrayList();
+ List<AbstractVariable> optionalAbstractRequirements = new ArrayList<AbstractVariable>();
for (int i = 0; i < reqs.length; i++) {
//The requirement is unchanged
if (reqs[i][0] == reqs[i][1]) {
if (!isApplicable(reqs[i][0]))
continue;
- List patchesAppliedElseWhere = (List) unchangedRequirements.get(reqs[i][0]);
+ List<IInstallableUnitPatch> patchesAppliedElseWhere = unchangedRequirements.get(reqs[i][0]);
if (patchesAppliedElseWhere == null) {
- patchesAppliedElseWhere = new ArrayList();
+ patchesAppliedElseWhere = new ArrayList<IInstallableUnitPatch>();
unchangedRequirements.put(reqs[i][0], patchesAppliedElseWhere);
}
patchesAppliedElseWhere.add(patch);
@@ -469,15 +487,15 @@ public class Projector {
//P1 -> (A -> D) equiv. (P1 & A) -> D
if (isApplicable(reqs[i][1])) {
IRequirement req = reqs[i][1];
- List matches = getApplicableMatches(req);
+ List<IInstallableUnit> matches = getApplicableMatches(req);
if (isHostRequirement(iu, req)) {
- rememberHostMatches(iu, matches);
+ rememberHostMatches((IInstallableUnitFragment) iu, matches);
}
if (req.getMin() > 0) {
if (matches.isEmpty()) {
missingRequirement(patch, req);
} else {
- IInstallableUnit reqIu = (IInstallableUnit) matches.get(0);
+ IInstallableUnit reqIu = matches.get(0);
Explanation explanation;
if (isRootIu) {
if (alreadyInstalledIUs.contains(reqIu)) {
@@ -505,22 +523,22 @@ public class Projector {
// Fix: if multiple patches apply to the same IU-req, we need to make sure we list each
// patch as an optional match
- Pending pending = (Pending) nonPatchedRequirements.get(req);
+ Pending pending = nonPatchedRequirements.get(req);
if (pending != null) {
pending.matches.add(patch);
continue;
}
- List matches = getApplicableMatches(req);
+ List<IInstallableUnit> matches = getApplicableMatches(req);
if (isHostRequirement(iu, req)) {
- rememberHostMatches(iu, matches);
+ rememberHostMatches((IInstallableUnitFragment) iu, matches);
}
if (req.getMin() > 0) {
if (matches.isEmpty()) {
dependencyHelper.implication(new Object[] {iu}).implies(patch).named(new Explanation.HardRequirement(iu, null));
} else {
matches.add(patch);
- IInstallableUnit reqIu = (IInstallableUnit) matches.get(0);///(IInstallableUnit) picker.query(new CapabilityQuery(req), new Collector(), null).iterator().next();
+ IInstallableUnit reqIu = matches.get(0);///(IInstallableUnit) picker.query(new CapabilityQuery(req), new Collector(), null).iterator().next();
Explanation explanation;
if (isRootIu) {
@@ -561,26 +579,26 @@ public class Projector {
}
// Fix: now create the pending non-patch requirements based on the full set of patches
- for (Iterator iterator = nonPatchedRequirements.values().iterator(); iterator.hasNext();) {
- Pending pending = (Pending) iterator.next();
+ for (Iterator<Pending> iterator = nonPatchedRequirements.values().iterator(); iterator.hasNext();) {
+ Pending pending = iterator.next();
createImplication(pending.left, pending.matches, pending.explanation);
}
- List optionalAbstractRequirements = new ArrayList();
- for (Iterator iterator = unchangedRequirements.entrySet().iterator(); iterator.hasNext();) {
- Entry entry = (Entry) iterator.next();
- List patchesApplied = (List) entry.getValue();
- Iterator allPatches = applicablePatches.iterator();
- List requiredPatches = new ArrayList();
+ List<AbstractVariable> optionalAbstractRequirements = new ArrayList<AbstractVariable>();
+ for (Iterator<Entry<IRequirement, List<IInstallableUnitPatch>>> iterator = unchangedRequirements.entrySet().iterator(); iterator.hasNext();) {
+ Entry<IRequirement, List<IInstallableUnitPatch>> entry = iterator.next();
+ List<IInstallableUnitPatch> patchesApplied = entry.getValue();
+ Iterator<IInstallableUnit> allPatches = applicablePatches.iterator();
+ List<IInstallableUnitPatch> requiredPatches = new ArrayList<IInstallableUnitPatch>();
while (allPatches.hasNext()) {
IInstallableUnitPatch patch = (IInstallableUnitPatch) allPatches.next();
if (!patchesApplied.contains(patch))
requiredPatches.add(patch);
}
- IRequirement req = (IRequirement) entry.getKey();
- List matches = getApplicableMatches(req);
+ IRequirement req = entry.getKey();
+ List<IInstallableUnit> matches = getApplicableMatches(req);
if (isHostRequirement(iu, req)) {
- rememberHostMatches(iu, matches);
+ rememberHostMatches((IInstallableUnitFragment) iu, matches);
}
if (req.getMin() > 0) {
if (matches.isEmpty()) {
@@ -592,7 +610,7 @@ public class Projector {
} else {
if (!requiredPatches.isEmpty())
matches.addAll(requiredPatches);
- IInstallableUnit reqIu = (IInstallableUnit) matches.get(0);//(IInstallableUnit) picker.query(new CapabilityQuery(req), new Collector(), null).iterator().next();
+ IInstallableUnit reqIu = matches.get(0);//(IInstallableUnit) picker.query(new CapabilityQuery(req), new Collector(), null).iterator().next();
Explanation explanation;
if (isRootIu) {
if (alreadyInstalledIUs.contains(reqIu)) {
@@ -625,7 +643,7 @@ public class Projector {
IRequirement req = patch.getLifeCycle();
if (req == null)
return;
- expandRequirement(req, iu, Collections.EMPTY_LIST, isRootIu);
+ expandRequirement(req, iu, CollectionUtils.<AbstractVariable> emptyList(), isRootIu);
}
private void missingRequirement(IInstallableUnit iu, IRequirement req) throws ContradictionException {
@@ -637,11 +655,11 @@ public class Projector {
* @param req
* @return a list of mandatory requirements if any, an empty list if req.isOptional().
*/
- private List getApplicableMatches(IRequirement req) {
- List target = new ArrayList();
- IQueryResult matches = picker.query(req.getMatches(), null);
- for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
- IInstallableUnit match = (IInstallableUnit) iterator.next();
+ private List<IInstallableUnit> getApplicableMatches(IRequirement req) {
+ List<IInstallableUnit> target = new ArrayList<IInstallableUnit>();
+ IQueryResult<IInstallableUnit> matches = picker.query(req.getMatches(), null);
+ for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) {
+ IInstallableUnit match = iterator.next();
if (isApplicable(match)) {
target.add(match);
}
@@ -653,17 +671,18 @@ public class Projector {
private IRequirement[][] mergeRequirements(IInstallableUnit iu, IInstallableUnitPatch patch) {
if (patch == null)
return null;
- IRequirementChange[] changes = patch.getRequirementsChange();
- IRequirement[] originalRequirements = new IRequirement[iu.getRequiredCapabilities().length];
- System.arraycopy(iu.getRequiredCapabilities(), 0, originalRequirements, 0, originalRequirements.length);
- List rrr = new ArrayList();
+ List<IRequirementChange> changes = patch.getRequirementsChange();
+ List<IRequirement> iuRequirements = iu.getRequiredCapabilities();
+ IRequirement[] originalRequirements = iuRequirements.toArray(new IRequirement[iuRequirements.size()]);
+ List<IRequirement[]> rrr = new ArrayList<IRequirement[]>();
boolean found = false;
- for (int i = 0; i < changes.length; i++) {
+ for (int i = 0; i < changes.size(); i++) {
+ IRequirementChange change = changes.get(i);
for (int j = 0; j < originalRequirements.length; j++) {
- if (originalRequirements[j] != null && changes[i].matches((IRequiredCapability) originalRequirements[j])) {
+ if (originalRequirements[j] != null && change.matches((IRequiredCapability) originalRequirements[j])) {
found = true;
- if (changes[i].newValue() != null)
- rrr.add(new IRequirement[] {originalRequirements[j], changes[i].newValue()});
+ if (change.newValue() != null)
+ rrr.add(new IRequirement[] {originalRequirements[j], change.newValue()});
else
// case where a requirement is removed
rrr.add(new IRequirement[] {originalRequirements[j], null});
@@ -671,15 +690,15 @@ public class Projector {
}
// break;
}
- if (!found && changes[i].applyOn() == null && changes[i].newValue() != null) //Case where a new requirement is added
- rrr.add(new IRequirement[] {null, changes[i].newValue()});
+ if (!found && change.applyOn() == null && change.newValue() != null) //Case where a new requirement is added
+ rrr.add(new IRequirement[] {null, change.newValue()});
}
//Add all the unmodified requirements to the result
for (int i = 0; i < originalRequirements.length; i++) {
if (originalRequirements[i] != null)
rrr.add(new IRequirement[] {originalRequirements[i], originalRequirements[i]});
}
- return (IRequirement[][]) rrr.toArray(new IRequirement[rrr.size()][]);
+ return rrr.toArray(new IRequirement[rrr.size()][]);
}
/**
@@ -691,12 +710,12 @@ public class Projector {
* @param optionalRequirements
* @throws ContradictionException
*/
- private void createOptionalityExpression(IInstallableUnit iu, List optionalRequirements) throws ContradictionException {
+ private void createOptionalityExpression(IInstallableUnit iu, List<AbstractVariable> optionalRequirements) throws ContradictionException {
if (optionalRequirements.isEmpty())
return;
AbstractVariable noop = getNoOperationVariable(iu);
- for (Iterator i = optionalRequirements.iterator(); i.hasNext();) {
- AbstractVariable abs = (AbstractVariable) i.next();
+ for (Iterator<AbstractVariable> i = optionalRequirements.iterator(); i.hasNext();) {
+ AbstractVariable abs = i.next();
createIncompatibleValues(abs, noop);
}
optionalRequirements.add(noop);
@@ -704,24 +723,24 @@ public class Projector {
}
//This will create as many implication as there is element in the right argument
- private void createNegationImplication(Object left, List right, Explanation name) throws ContradictionException {
+ private void createNegationImplication(Object left, List<?> right, Explanation name) throws ContradictionException {
if (DEBUG) {
Tracing.debug(name + ": " + left + "->" + right); //$NON-NLS-1$ //$NON-NLS-2$
}
- for (Iterator iterator = right.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = right.iterator(); iterator.hasNext();) {
dependencyHelper.implication(new Object[] {left}).impliesNot(iterator.next()).named(name);
}
}
- private void createImplication(Object left, List right, Explanation name) throws ContradictionException {
+ private void createImplication(Object left, List<?> right, Explanation name) throws ContradictionException {
if (DEBUG) {
Tracing.debug(name + ": " + left + "->" + right); //$NON-NLS-1$ //$NON-NLS-2$
}
dependencyHelper.implication(new Object[] {left}).implies(right.toArray()).named(name);
}
- private void createImplication(Object[] left, List right, Explanation name) throws ContradictionException {
+ private void createImplication(Object[] left, List<?> right, Explanation name) throws ContradictionException {
if (DEBUG) {
Tracing.debug(name + ": " + Arrays.asList(left) + "->" + right); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -729,9 +748,9 @@ public class Projector {
}
//Return IUPatches that are applicable for the given iu
- private IQueryResult getApplicablePatches(IInstallableUnit iu) {
+ private IQueryResult<IInstallableUnit> getApplicablePatches(IInstallableUnit iu) {
if (patches == null)
- patches = new QueryableArray((IInstallableUnit[]) picker.query(new PatchQuery(), null).toArray(IInstallableUnit.class));
+ patches = new QueryableArray(picker.query(new PatchQuery(), null).toArray(IInstallableUnit.class));
return patches.query(new ApplicablePatchQuery(iu), null);
}
@@ -739,18 +758,18 @@ public class Projector {
//Create constraints to deal with singleton
//When there is a mix of singleton and non singleton, several constraints are generated
private void createConstraintsForSingleton() throws ContradictionException {
- Set s = slice.entrySet();
- for (Iterator iterator = s.iterator(); iterator.hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
- HashMap conflictingEntries = (HashMap) entry.getValue();
+ Set<Entry<String, Map<Version, IInstallableUnit>>> s = slice.entrySet();
+ for (Iterator<Entry<String, Map<Version, IInstallableUnit>>> iterator = s.iterator(); iterator.hasNext();) {
+ Entry<String, Map<Version, IInstallableUnit>> entry = iterator.next();
+ Map<Version, IInstallableUnit> conflictingEntries = entry.getValue();
if (conflictingEntries.size() < 2)
continue;
- Collection conflictingVersions = conflictingEntries.values();
- List singletons = new ArrayList();
- List nonSingletons = new ArrayList();
- for (Iterator conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) conflictIterator.next();
+ Collection<IInstallableUnit> conflictingVersions = conflictingEntries.values();
+ List<IInstallableUnit> singletons = new ArrayList<IInstallableUnit>();
+ List<IInstallableUnit> nonSingletons = new ArrayList<IInstallableUnit>();
+ for (Iterator<IInstallableUnit> conflictIterator = conflictingVersions.iterator(); conflictIterator.hasNext();) {
+ IInstallableUnit iu = conflictIterator.next();
if (iu.isSingleton()) {
singletons.add(iu);
} else {
@@ -762,12 +781,12 @@ public class Projector {
IInstallableUnit[] singletonArray;
if (nonSingletons.isEmpty()) {
- singletonArray = (IInstallableUnit[]) singletons.toArray(new IInstallableUnit[singletons.size()]);
+ singletonArray = singletons.toArray(new IInstallableUnit[singletons.size()]);
createAtMostOne(singletonArray);
} else {
- singletonArray = (IInstallableUnit[]) singletons.toArray(new IInstallableUnit[singletons.size() + 1]);
- for (Iterator iterator2 = nonSingletons.iterator(); iterator2.hasNext();) {
- singletonArray[singletonArray.length - 1] = (IInstallableUnit) iterator2.next();
+ singletonArray = singletons.toArray(new IInstallableUnit[singletons.size() + 1]);
+ for (Iterator<IInstallableUnit> iterator2 = nonSingletons.iterator(); iterator2.hasNext();) {
+ singletonArray[singletonArray.length - 1] = iterator2.next();
createAtMostOne(singletonArray);
}
}
@@ -782,7 +801,7 @@ public class Projector {
}
Tracing.debug("At most 1 of " + b); //$NON-NLS-1$
}
- dependencyHelper.atMost(1, ius).named(new Explanation.Singleton(ius));
+ dependencyHelper.atMost(1, (Object[]) ius).named(new Explanation.Singleton(ius));
}
private void createIncompatibleValues(AbstractVariable v1, AbstractVariable v2) throws ContradictionException {
@@ -794,7 +813,7 @@ public class Projector {
}
Tracing.debug("At most 1 of " + b); //$NON-NLS-1$
}
- dependencyHelper.atMost(1, vars).named(Explanation.OPTIONAL_REQUIREMENT);
+ dependencyHelper.atMost(1, (Object[]) vars).named(Explanation.OPTIONAL_REQUIREMENT);
}
private AbstractVariable getAbstractVariable() {
@@ -804,7 +823,7 @@ public class Projector {
}
private AbstractVariable getNoOperationVariable(IInstallableUnit iu) {
- AbstractVariable v = (AbstractVariable) noopVariables.get(iu);
+ AbstractVariable v = noopVariables.get(iu);
if (v == null) {
v = new AbstractVariable();
noopVariables.put(iu, v);
@@ -849,9 +868,9 @@ public class Projector {
}
private void backToIU() {
- solution = new ArrayList();
- IVec sat4jSolution = dependencyHelper.getSolution();
- for (Iterator i = sat4jSolution.iterator(); i.hasNext();) {
+ solution = new ArrayList<IInstallableUnit>();
+ IVec<Object> sat4jSolution = dependencyHelper.getSolution();
+ for (Iterator<Object> i = sat4jSolution.iterator(); i.hasNext();) {
Object var = i.next();
if (var instanceof IInstallableUnit) {
IInstallableUnit iu = (IInstallableUnit) var;
@@ -862,23 +881,23 @@ public class Projector {
}
}
- private void printSolution(Collection state) {
- ArrayList l = new ArrayList(state);
+ private void printSolution(Collection<IInstallableUnit> state) {
+ ArrayList<IInstallableUnit> l = new ArrayList<IInstallableUnit>(state);
Collections.sort(l);
Tracing.debug("Solution:"); //$NON-NLS-1$
Tracing.debug("Numbers of IUs selected: " + l.size()); //$NON-NLS-1$
- for (Iterator iterator = l.iterator(); iterator.hasNext();) {
+ for (Iterator<IInstallableUnit> iterator = l.iterator(); iterator.hasNext();) {
Tracing.debug(iterator.next().toString());
}
}
- public Collection extractSolution() {
+ public Collection<IInstallableUnit> extractSolution() {
if (DEBUG)
printSolution(solution);
return solution;
}
- public Set getExplanation(IProgressMonitor monitor) {
+ public Set<Explanation> getExplanation(IProgressMonitor monitor) {
ExplanationJob job = new ExplanationJob();
job.schedule();
monitor.setTaskName(Messages.Planner_NoSolution);
@@ -906,16 +925,16 @@ public class Projector {
return job.getExplanationResult();
}
- public Map getFragmentAssociation() {
- Map resolvedFragments = new HashMap(fragments.size());
- for (Iterator iterator = fragments.entrySet().iterator(); iterator.hasNext();) {
- Entry fragment = (Entry) iterator.next();
+ public Map<IInstallableUnitFragment, List<IInstallableUnit>> getFragmentAssociation() {
+ Map<IInstallableUnitFragment, List<IInstallableUnit>> resolvedFragments = new HashMap<IInstallableUnitFragment, List<IInstallableUnit>>(fragments.size());
+ for (Iterator<Entry<IInstallableUnitFragment, Set<IInstallableUnit>>> iterator = fragments.entrySet().iterator(); iterator.hasNext();) {
+ Entry<IInstallableUnitFragment, Set<IInstallableUnit>> fragment = iterator.next();
if (!dependencyHelper.getBooleanValueFor(fragment.getKey()))
continue;
- Set potentialHosts = (Set) fragment.getValue();
- List resolvedHost = new ArrayList(potentialHosts.size());
- for (Iterator iterator2 = potentialHosts.iterator(); iterator2.hasNext();) {
- Object host = iterator2.next();
+ Set<IInstallableUnit> potentialHosts = fragment.getValue();
+ List<IInstallableUnit> resolvedHost = new ArrayList<IInstallableUnit>(potentialHosts.size());
+ for (Iterator<IInstallableUnit> iterator2 = potentialHosts.iterator(); iterator2.hasNext();) {
+ IInstallableUnit host = iterator2.next();
if (dependencyHelper.getBooleanValueFor(host))
resolvedHost.add(host);
}
@@ -925,10 +944,10 @@ public class Projector {
return resolvedFragments;
}
- private void rememberHostMatches(IInstallableUnit fragment, List matches) {
- Set existingMatches = (Set) fragments.get(fragment);
+ private void rememberHostMatches(IInstallableUnitFragment fragment, List<IInstallableUnit> matches) {
+ Set<IInstallableUnit> existingMatches = fragments.get(fragment);
if (existingMatches == null) {
- existingMatches = new HashSet();
+ existingMatches = new HashSet<IInstallableUnit>();
fragments.put(fragment, existingMatches);
existingMatches.addAll(matches);
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java
index a0ce70368..eade59c72 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java
@@ -20,7 +20,7 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
-public class QueryableArray implements IQueryable {
+public class QueryableArray implements IQueryable<IInstallableUnit> {
static class IUCapability {
final IInstallableUnit iu;
final IProvidedCapability capability;
@@ -31,24 +31,24 @@ public class QueryableArray implements IQueryable {
}
}
- private final List dataSet;
- private Map namedCapabilityIndex;
+ private final List<IInstallableUnit> dataSet;
+ private Map<String, List<IUCapability>> namedCapabilityIndex;
public QueryableArray(IInstallableUnit[] ius) {
dataSet = Arrays.asList(ius);
}
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult<IInstallableUnit> query(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
if (query instanceof IRequiredCapability)
- return queryCapability((IRequiredCapability) query, new Collector(), monitor);
+ return queryCapability((IRequiredCapability) query, new Collector<IInstallableUnit>(), monitor);
return query.perform(dataSet.iterator());
}
- private Collector queryCapability(IRequiredCapability query, Collector collector, IProgressMonitor monitor) {
+ private Collector<IInstallableUnit> queryCapability(IRequiredCapability query, Collector<IInstallableUnit> collector, IProgressMonitor monitor) {
generateNamedCapabilityIndex();
- Collection resultIUs = null;
- Collection matchingIUs = findMatchingIUs(query);
+ Collection<IInstallableUnit> resultIUs = null;
+ Collection<IInstallableUnit> matchingIUs = findMatchingIUs(query);
if (matchingIUs == null)
return collector;
if (resultIUs == null)
@@ -57,20 +57,20 @@ public class QueryableArray implements IQueryable {
resultIUs.retainAll(matchingIUs);
if (resultIUs != null)
- for (Iterator iterator = resultIUs.iterator(); iterator.hasNext();)
+ for (Iterator<IInstallableUnit> iterator = resultIUs.iterator(); iterator.hasNext();)
collector.accept(iterator.next());
return collector;
}
- private Collection findMatchingIUs(IRequiredCapability requiredCapability) {
- List iuCapabilities = (List) namedCapabilityIndex.get(requiredCapability.getName());
+ private Collection<IInstallableUnit> findMatchingIUs(IRequiredCapability requiredCapability) {
+ List<IUCapability> iuCapabilities = namedCapabilityIndex.get(requiredCapability.getName());
if (iuCapabilities == null)
return null;
- Set matchingIUs = new HashSet();
- for (Iterator iterator = iuCapabilities.iterator(); iterator.hasNext();) {
- IUCapability iuCapability = (IUCapability) iterator.next();
+ Set<IInstallableUnit> matchingIUs = new HashSet<IInstallableUnit>();
+ for (Iterator<IUCapability> iterator = iuCapabilities.iterator(); iterator.hasNext();) {
+ IUCapability iuCapability = iterator.next();
if (iuCapability.iu.satisfies(requiredCapability))
matchingIUs.add(iuCapability.iu);
}
@@ -81,19 +81,21 @@ public class QueryableArray implements IQueryable {
if (namedCapabilityIndex != null)
return;
- namedCapabilityIndex = new HashMap();
- for (Iterator iterator = dataSet.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
+ namedCapabilityIndex = new HashMap<String, List<IUCapability>>();
+ for (Iterator<IInstallableUnit> iterator = dataSet.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
- IProvidedCapability[] providedCapabilities = iu.getProvidedCapabilities();
- for (int i = 0; i < providedCapabilities.length; i++) {
- String name = providedCapabilities[i].getName();
- List iuCapabilities = (List) namedCapabilityIndex.get(name);
+ List<IProvidedCapability> providedCapabilities = iu.getProvidedCapabilities();
+ int top = providedCapabilities.size();
+ for (int i = 0; i < top; i++) {
+ IProvidedCapability pc = providedCapabilities.get(i);
+ String name = pc.getName();
+ List<IUCapability> iuCapabilities = namedCapabilityIndex.get(name);
if (iuCapabilities == null) {
- iuCapabilities = new ArrayList(5);
+ iuCapabilities = new ArrayList<IUCapability>(5);
namedCapabilityIndex.put(name, iuCapabilities);
}
- iuCapabilities.add(new IUCapability(iu, providedCapabilities[i]));
+ iuCapabilities.add(new IUCapability(iu, pc));
}
}
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
index 24556a20e..59a35f38b 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
@@ -46,39 +46,43 @@ public class SimplePlanner implements IPlanner {
private final IMetadataRepositoryManager repoManager;
private final IProfileRegistry profileRegistry;
- private ProvisioningPlan generateProvisioningPlan(Collection fromState, Collection toState, ProfileChangeRequest changeRequest, IProvisioningPlan installerPlan, ProvisioningContext context) {
- InstallableUnitOperand[] iuOperands = generateOperations(fromState, toState);
+ private ProvisioningPlan generateProvisioningPlan(Collection<IInstallableUnit> fromState, Collection<IInstallableUnit> toState, ProfileChangeRequest changeRequest, IProvisioningPlan installerPlan, ProvisioningContext context) {
+ List<InstallableUnitOperand> iuOperands = generateOperations(fromState, toState);
PropertyOperand[] propertyOperands = generatePropertyOperations(changeRequest);
- Operand[] operands = new Operand[iuOperands.length + propertyOperands.length];
- System.arraycopy(iuOperands, 0, operands, 0, iuOperands.length);
- System.arraycopy(propertyOperands, 0, operands, iuOperands.length, propertyOperands.length);
+ int iuOpsSize = iuOperands.size();
+ Operand[] operands = new Operand[iuOpsSize + propertyOperands.length];
+ for (int i = 0; i < iuOpsSize; ++i)
+ operands[i] = iuOperands.get(i);
+ System.arraycopy(propertyOperands, 0, operands, iuOpsSize, propertyOperands.length);
if (DEBUG) {
for (int i = 0; i < operands.length; i++) {
Tracing.debug(operands[i].toString());
}
}
- return new ProvisioningPlan(Status.OK_STATUS, operands, computeActualChangeRequest(toState, changeRequest), null, installerPlan, changeRequest.getProfile(), new QueryableArray((IInstallableUnit[]) toState.toArray(new IInstallableUnit[toState.size()])), context);
+ return new ProvisioningPlan(Status.OK_STATUS, operands, computeActualChangeRequest(toState, changeRequest), null, installerPlan, changeRequest.getProfile(), new QueryableArray(toState.toArray(new IInstallableUnit[toState.size()])), context);
}
- private Map[] buildDetailedErrors(ProfileChangeRequest changeRequest) {
+ private Map<IInstallableUnit, IStatus>[] buildDetailedErrors(ProfileChangeRequest changeRequest) {
IInstallableUnit[] added = changeRequest.getAddedInstallableUnits();
IInstallableUnit[] removed = changeRequest.getRemovedInstallableUnits();
- Map requestStatus = new HashMap(added.length + removed.length);
+ Map<IInstallableUnit, RequestStatus> requestStatus = new HashMap<IInstallableUnit, RequestStatus>(added.length + removed.length);
for (int i = 0; i < added.length; i++) {
requestStatus.put(added[i], new RequestStatus(added[i], RequestStatus.ADDED, IStatus.ERROR, null));
}
for (int i = 0; i < removed.length; i++) {
requestStatus.put(removed[i], new RequestStatus(removed[i], RequestStatus.REMOVED, IStatus.ERROR, null));
}
- return new Map[] {requestStatus, null};
+ @SuppressWarnings("unchecked")
+ Map<IInstallableUnit, IStatus>[] maps = new Map[] {requestStatus, null};
+ return maps;
}
- private Map[] computeActualChangeRequest(Collection toState, ProfileChangeRequest changeRequest) {
+ private Map<IInstallableUnit, IStatus>[] computeActualChangeRequest(Collection<IInstallableUnit> toState, ProfileChangeRequest changeRequest) {
IInstallableUnit[] added = changeRequest.getAddedInstallableUnits();
IInstallableUnit[] removed = changeRequest.getRemovedInstallableUnits();
- Map requestStatus = new HashMap(added.length + removed.length);
+ Map<IInstallableUnit, RequestStatus> requestStatus = new HashMap<IInstallableUnit, RequestStatus>(added.length + removed.length);
for (int i = 0; i < added.length; i++) {
if (toState.contains(added[i]))
requestStatus.put(added[i], new RequestStatus(added[i], RequestStatus.ADDED, IStatus.OK, null));
@@ -94,37 +98,35 @@ public class SimplePlanner implements IPlanner {
}
//Compute the side effect changes (e.g. things installed optionally going away)
- Iterator includedIUs = changeRequest.getProfile().query(new IUProfilePropertyQuery(INCLUSION_RULES, null), null).iterator();
- Map sideEffectStatus = new HashMap();
+ Iterator<IInstallableUnit> includedIUs = changeRequest.getProfile().query(new IUProfilePropertyQuery(INCLUSION_RULES, null), null).iterator();
+ Map<IInstallableUnit, RequestStatus> sideEffectStatus = new HashMap<IInstallableUnit, RequestStatus>();
while (includedIUs.hasNext()) {
- IInstallableUnit removal = (IInstallableUnit) includedIUs.next();
+ IInstallableUnit removal = includedIUs.next();
if (!toState.contains(removal) && !requestStatus.containsKey(removal)) {
sideEffectStatus.put(removal, new RequestStatus(removal, RequestStatus.REMOVED, IStatus.INFO, null));
}
}
- return new Map[] {requestStatus, sideEffectStatus};
+ @SuppressWarnings("unchecked")
+ Map<IInstallableUnit, IStatus>[] maps = new Map[] {requestStatus, sideEffectStatus};
+ return maps;
}
/**
* Converts a set containing a list of resolver explanations into a human-readable status object.
*/
- private IStatus convertExplanationToStatus(Set explanations) {
+ private IStatus convertExplanationToStatus(Set<Explanation> explanations) {
if (explanations == null)
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_Unsatisfied_Dependencies);
MultiStatus root = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, Messages.Director_Unsatisfied_Dependencies, null);
//try to find a more specific root message if possible
String specificMessage = null;
- for (Iterator it = explanations.iterator(); it.hasNext();) {
- final Object next = it.next();
- if (next instanceof Explanation) {
- root.add(((Explanation) next).toStatus());
- if (specificMessage == null && next instanceof Explanation.MissingIU)
- specificMessage = Messages.Explanation_rootMissing;
- else if (specificMessage == null && next instanceof Explanation.Singleton) {
- specificMessage = Messages.Explanation_rootSingleton;
- }
- } else
- root.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, next.toString()));
+ for (Iterator<Explanation> it = explanations.iterator(); it.hasNext();) {
+ final Explanation next = it.next();
+ root.add(next.toStatus());
+ if (specificMessage == null && next instanceof Explanation.MissingIU)
+ specificMessage = Messages.Explanation_rootMissing;
+ else if (specificMessage == null && next instanceof Explanation.Singleton)
+ specificMessage = Messages.Explanation_rootSingleton;
}
//use a more specific root message if available
if (specificMessage != null) {
@@ -137,56 +139,56 @@ public class SimplePlanner implements IPlanner {
private PropertyOperand[] generatePropertyOperations(ProfileChangeRequest profileChangeRequest) {
IProfile profile = profileChangeRequest.getProfile();
- List operands = new ArrayList();
+ List<PropertyOperand> operands = new ArrayList<PropertyOperand>();
// First deal with profile properties to remove. Only generate an operand if the property was there in the first place
String[] toRemove = profileChangeRequest.getPropertiesToRemove();
- Map existingProperties = profile.getProperties();
+ Map<String, String> existingProperties = profile.getProperties();
for (int i = 0; i < toRemove.length; i++) {
if (existingProperties.containsKey(toRemove[i]))
operands.add(new PropertyOperand(toRemove[i], existingProperties.get(toRemove[i]), null));
}
// Now deal with profile property changes/additions
- Map propertyChanges = profileChangeRequest.getPropertiesToAdd();
- Iterator iter = propertyChanges.entrySet().iterator();
+ Map<String, String> propertyChanges = profileChangeRequest.getPropertiesToAdd();
+ Iterator<Entry<String, String>> iter = propertyChanges.entrySet().iterator();
while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- operands.add(new PropertyOperand((String) entry.getKey(), existingProperties.get(entry.getKey()), entry.getValue()));
+ Entry<String, String> entry = iter.next();
+ operands.add(new PropertyOperand(entry.getKey(), existingProperties.get(entry.getKey()), entry.getValue()));
}
// Now deal with iu property changes/additions.
// TODO we aren't yet checking that the IU will exist in the final profile, will the engine do this?
- Map allIUPropertyChanges = profileChangeRequest.getInstallableUnitProfilePropertiesToAdd();
- iter = allIUPropertyChanges.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- IInstallableUnit iu = (IInstallableUnit) entry.getKey();
- Map iuPropertyChanges = (Map) entry.getValue();
- Iterator iuPropIter = iuPropertyChanges.entrySet().iterator();
+ Map<IInstallableUnit, Map<String, String>> allIUPropertyChanges = profileChangeRequest.getInstallableUnitProfilePropertiesToAdd();
+ Iterator<Entry<IInstallableUnit, Map<String, String>>> allIter = allIUPropertyChanges.entrySet().iterator();
+ while (allIter.hasNext()) {
+ Entry<IInstallableUnit, Map<String, String>> entry = allIter.next();
+ IInstallableUnit iu = entry.getKey();
+ Map<String, String> iuPropertyChanges = entry.getValue();
+ Iterator<Entry<String, String>> iuPropIter = iuPropertyChanges.entrySet().iterator();
while (iuPropIter.hasNext()) {
- Map.Entry entry2 = (Map.Entry) iuPropIter.next();
- Object oldValue = profile.getInstallableUnitProperty(iu, (String) entry2.getKey());
- operands.add(new InstallableUnitPropertyOperand(iu, (String) entry2.getKey(), oldValue, entry2.getValue()));
+ Entry<String, String> entry2 = iuPropIter.next();
+ Object oldValue = profile.getInstallableUnitProperty(iu, entry2.getKey());
+ operands.add(new InstallableUnitPropertyOperand(iu, entry2.getKey(), oldValue, entry2.getValue()));
}
}
// Now deal with iu property removals.
// TODO we could optimize by not generating property removals for IU's that aren't there or won't be there.
- Map allIUPropertyDeletions = profileChangeRequest.getInstallableUnitProfilePropertiesToRemove();
- iter = allIUPropertyDeletions.entrySet().iterator();
- while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- IInstallableUnit iu = (IInstallableUnit) entry.getKey();
- Map existingIUProperties = profile.getInstallableUnitProperties(iu);
- List iuPropertyRemovals = (List) entry.getValue();
- for (Iterator it = iuPropertyRemovals.iterator(); it.hasNext();) {
- String key = (String) it.next();
+ Map<IInstallableUnit, List<String>> allIUPropertyDeletions = profileChangeRequest.getInstallableUnitProfilePropertiesToRemove();
+ Iterator<Entry<IInstallableUnit, List<String>>> delItor = allIUPropertyDeletions.entrySet().iterator();
+ while (delItor.hasNext()) {
+ Entry<IInstallableUnit, List<String>> entry = delItor.next();
+ IInstallableUnit iu = entry.getKey();
+ Map<String, String> existingIUProperties = profile.getInstallableUnitProperties(iu);
+ List<String> iuPropertyRemovals = entry.getValue();
+ for (Iterator<String> it = iuPropertyRemovals.iterator(); it.hasNext();) {
+ String key = it.next();
if (existingIUProperties.containsKey(key))
operands.add(new InstallableUnitPropertyOperand(iu, key, existingIUProperties.get(key), null));
}
}
- return (PropertyOperand[]) operands.toArray(new PropertyOperand[operands.size()]);
+ return operands.toArray(new PropertyOperand[operands.size()]);
}
- private InstallableUnitOperand[] generateOperations(Collection fromState, Collection toState) {
+ private List<InstallableUnitOperand> generateOperations(Collection<IInstallableUnit> fromState, Collection<IInstallableUnit> toState) {
return new OperationGenerator().generateOperation(fromState, toState);
}
@@ -206,13 +208,13 @@ public class SimplePlanner implements IPlanner {
}
public static IInstallableUnit[] findPlannerMarkedIUs(final IProfile profile) {
- IQuery markerQuery = new IUProfilePropertyQuery(INCLUSION_RULES, null);
- return (IInstallableUnit[]) profile.query(markerQuery, null).toArray(IInstallableUnit.class);
+ IQuery<IInstallableUnit> markerQuery = new IUProfilePropertyQuery(INCLUSION_RULES, null);
+ return profile.query(markerQuery, null).toArray(IInstallableUnit.class);
}
- public static Dictionary createSelectionContext(Map properties) {
- Hashtable result = new Hashtable(properties);
- String environments = (String) properties.get(IProfile.PROP_ENVIRONMENTS);
+ public static Dictionary<String, String> createSelectionContext(Map<String, String> properties) {
+ Hashtable<String, String> result = new Hashtable<String, String>(properties);
+ String environments = properties.get(IProfile.PROP_ENVIRONMENTS);
if (environments == null)
return result;
for (StringTokenizer tokenizer = new StringTokenizer(environments, ","); tokenizer.hasMoreElements();) { //$NON-NLS-1$
@@ -226,7 +228,7 @@ public class SimplePlanner implements IPlanner {
}
private IInstallableUnit[] gatherAvailableInstallableUnits(IInstallableUnit[] additionalSource, URI[] repositories, ProvisioningContext context, IProgressMonitor monitor) {
- Map resultsMap = new HashMap();
+ Map<String, IInstallableUnit> resultsMap = new HashMap<String, IInstallableUnit>();
if (additionalSource != null) {
for (int i = 0; i < additionalSource.length; i++) {
String key = additionalSource[i].getId() + "_" + additionalSource[i].getVersion().toString(); //$NON-NLS-1$
@@ -234,8 +236,8 @@ public class SimplePlanner implements IPlanner {
}
}
if (context != null) {
- for (Iterator iter = context.getExtraIUs().iterator(); iter.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iter.next();
+ for (Iterator<IInstallableUnit> iter = context.getExtraIUs().iterator(); iter.hasNext();) {
+ IInstallableUnit iu = iter.next();
String key = iu.getId() + '_' + iu.getVersion().toString();
resultsMap.put(key, iu);
}
@@ -251,11 +253,11 @@ public class SimplePlanner implements IPlanner {
throw new OperationCanceledException();
IMetadataRepository repository = repoManager.loadRepository(repositories[i], sub.newChild(100));
- IQueryResult matches = repository.query(new InstallableUnitQuery(null, VersionRange.emptyRange), sub.newChild(100));
- for (Iterator it = matches.iterator(); it.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) it.next();
+ IQueryResult<IInstallableUnit> matches = repository.query(new InstallableUnitQuery(null, VersionRange.emptyRange), sub.newChild(100));
+ for (Iterator<IInstallableUnit> it = matches.iterator(); it.hasNext();) {
+ IInstallableUnit iu = it.next();
String key = iu.getId() + "_" + iu.getVersion().toString(); //$NON-NLS-1$
- IInstallableUnit currentIU = (IInstallableUnit) resultsMap.get(key);
+ IInstallableUnit currentIU = resultsMap.get(key);
if (currentIU == null || hasHigherFidelity(iu, currentIU))
resultsMap.put(key, iu);
}
@@ -264,8 +266,8 @@ public class SimplePlanner implements IPlanner {
}
}
sub.done();
- Collection results = resultsMap.values();
- return (IInstallableUnit[]) results.toArray(new IInstallableUnit[results.size()]);
+ Collection<IInstallableUnit> results = resultsMap.values();
+ return results.toArray(new IInstallableUnit[results.size()]);
}
private static boolean hasHigherFidelity(IInstallableUnit iu, IInstallableUnit currentIU) {
@@ -281,10 +283,10 @@ public class SimplePlanner implements IPlanner {
this.repoManager = repoManager;
}
- private boolean satisfyMetaRequirements(Map props) {
+ private boolean satisfyMetaRequirements(Map<String, String> props) {
if (props == null)
return true;
- if (props.get(CONSIDER_METAREQUIREMENTS) == null || "true".equalsIgnoreCase((String) props.get(CONSIDER_METAREQUIREMENTS))) //$NON-NLS-1$
+ if (props.get(CONSIDER_METAREQUIREMENTS) == null || "true".equalsIgnoreCase(props.get(CONSIDER_METAREQUIREMENTS))) //$NON-NLS-1$
return true;
return false;
}
@@ -303,20 +305,20 @@ public class SimplePlanner implements IPlanner {
Object[] updatedPlan = updatePlannerInfo(profileChangeRequest, context);
URI[] metadataRepositories = (context != null) ? context.getMetadataRepositories() : null;
- Dictionary newSelectionContext = createSelectionContext(profileChangeRequest.getProfileProperties());
+ Dictionary<String, String> newSelectionContext = createSelectionContext(profileChangeRequest.getProfileProperties());
- List extraIUs = new ArrayList(Arrays.asList(profileChangeRequest.getAddedInstallableUnits()));
+ List<IInstallableUnit> extraIUs = new ArrayList<IInstallableUnit>(Arrays.asList(profileChangeRequest.getAddedInstallableUnits()));
extraIUs.addAll(Arrays.asList(profileChangeRequest.getRemovedInstallableUnits()));
if (context == null || context.getProperty(INCLUDE_PROFILE_IUS) == null || context.getProperty(INCLUDE_PROFILE_IUS).equalsIgnoreCase(Boolean.TRUE.toString())) {
- Iterator itor = profile.available(InstallableUnitQuery.ANY, null).iterator();
+ Iterator<IInstallableUnit> itor = profile.available(InstallableUnitQuery.ANY, null).iterator();
while (itor.hasNext())
extraIUs.add(itor.next());
}
- IInstallableUnit[] availableIUs = gatherAvailableInstallableUnits((IInstallableUnit[]) extraIUs.toArray(new IInstallableUnit[extraIUs.size()]), metadataRepositories, context, sub.newChild(ExpandWork / 4));
+ IInstallableUnit[] availableIUs = gatherAvailableInstallableUnits(extraIUs.toArray(new IInstallableUnit[extraIUs.size()]), metadataRepositories, context, sub.newChild(ExpandWork / 4));
Slicer slicer = new Slicer(new QueryableArray(availableIUs), newSelectionContext, satisfyMetaRequirements(profileChangeRequest.getProfileProperties()));
- IQueryable slice = slicer.slice(new IInstallableUnit[] {(IInstallableUnit) updatedPlan[0]}, sub.newChild(ExpandWork / 4));
+ IQueryable<IInstallableUnit> slice = slicer.slice(new IInstallableUnit[] {(IInstallableUnit) updatedPlan[0]}, sub.newChild(ExpandWork / 4));
if (slice == null)
return new ProvisioningPlan(slicer.getStatus(), profile, null, context);
Projector projector = new Projector(slice, newSelectionContext, satisfyMetaRequirements(profileChangeRequest.getProfileProperties()));
@@ -330,7 +332,7 @@ public class SimplePlanner implements IPlanner {
return new ProvisioningPlan(s, profile, null, context);
//Extract the explanation
- Set explanation = projector.getExplanation(sub.newChild(ExpandWork / 4));
+ Set<Explanation> explanation = projector.getExplanation(sub.newChild(ExpandWork / 4));
IStatus explanationStatus = convertExplanationToStatus(explanation);
return new ProvisioningPlan(explanationStatus, new Operand[0], buildDetailedErrors(profileChangeRequest), new RequestStatus(null, RequestStatus.REMOVED, IStatus.ERROR, explanation), null, profile, null, context);
}
@@ -356,8 +358,8 @@ public class SimplePlanner implements IPlanner {
if (resolutionResult instanceof IProvisioningPlan)
return (ProvisioningPlan) resolutionResult;
- Collection newState = ((Projector) resolutionResult).extractSolution();
- Collection fullState = new ArrayList();
+ Collection<IInstallableUnit> newState = ((Projector) resolutionResult).extractSolution();
+ Collection<IInstallableUnit> fullState = new ArrayList<IInstallableUnit>();
fullState.addAll(newState);
newState = AttachmentHelper.attachFragments(newState.iterator(), ((Projector) resolutionResult).getFragmentAssociation());
@@ -373,60 +375,56 @@ public class SimplePlanner implements IPlanner {
}
private IProvisioningPlan generateAbsoluteProvisioningPlan(ProfileChangeRequest profileChangeRequest, ProvisioningContext context, IProgressMonitor monitor) {
- Set toState = profileChangeRequest.getProfile().query(InstallableUnitQuery.ANY, null).toSet();
- HashSet fromState = new HashSet(toState);
+ Set<IInstallableUnit> toState = profileChangeRequest.getProfile().query(InstallableUnitQuery.ANY, null).toSet();
+ HashSet<IInstallableUnit> fromState = new HashSet<IInstallableUnit>(toState);
toState.removeAll(Arrays.asList(profileChangeRequest.getRemovedInstallableUnits()));
toState.addAll(Arrays.asList(profileChangeRequest.getAddedInstallableUnits()));
- InstallableUnitOperand[] iuOperands = generateOperations(fromState, toState);
+ List<InstallableUnitOperand> iuOperands = generateOperations(fromState, toState);
PropertyOperand[] propertyOperands = generatePropertyOperations(profileChangeRequest);
- Operand[] operands = new Operand[iuOperands.length + propertyOperands.length];
- System.arraycopy(iuOperands, 0, operands, 0, iuOperands.length);
- System.arraycopy(propertyOperands, 0, operands, iuOperands.length, propertyOperands.length);
+ int iuOpsSize = iuOperands.size();
+ Operand[] operands = new Operand[iuOpsSize + propertyOperands.length];
+ for (int i = 0; i < iuOpsSize; ++i)
+ operands[i] = iuOperands.get(i);
+ System.arraycopy(propertyOperands, 0, operands, iuOpsSize, propertyOperands.length);
if (DEBUG) {
for (int i = 0; i < operands.length; i++) {
Tracing.debug(operands[i].toString());
}
}
- return new ProvisioningPlan(Status.OK_STATUS, operands, computeActualChangeRequest(toState, profileChangeRequest), null, null, profileChangeRequest.getProfile(), new QueryableArray((IInstallableUnit[]) toState.toArray(new IInstallableUnit[toState.size()])), context);
+ return new ProvisioningPlan(Status.OK_STATUS, operands, computeActualChangeRequest(toState, profileChangeRequest), null, null, profileChangeRequest.getProfile(), new QueryableArray(toState.toArray(new IInstallableUnit[toState.size()])), context);
}
//Verify that all the meta requirements necessary to perform the uninstallation (if necessary) and all t
- private Collection areMetaRequirementsSatisfied(IProfile oldProfile, Collection newProfile, IProvisioningPlan initialPlan) {
- Collection allMetaRequirements = extractMetaRequirements(newProfile, initialPlan);
- for (Iterator iterator = allMetaRequirements.iterator(); iterator.hasNext();) {
- IRequirement requirement = (IRequirement) iterator.next();
- if (oldProfile.query(new LimitQuery(requirement.getMatches(), 1), null).isEmpty())
+ private Collection<IRequirement> areMetaRequirementsSatisfied(IProfile oldProfile, Collection<IInstallableUnit> newProfile, IProvisioningPlan initialPlan) {
+ Collection<IRequirement> allMetaRequirements = extractMetaRequirements(newProfile, initialPlan);
+ for (Iterator<IRequirement> iterator = allMetaRequirements.iterator(); iterator.hasNext();) {
+ IRequirement requirement = iterator.next();
+ if (oldProfile.query(new LimitQuery<IInstallableUnit>(requirement.getMatches(), 1), null).isEmpty())
return allMetaRequirements;
}
return null;
}
//Return all the meta requirements for the list of IU specified and all the meta requirements listed necessary to satisfy the uninstallation
- private Collection extractMetaRequirements(Collection ius, IProvisioningPlan plan) {
- Set allMetaRequirements = new HashSet();
- for (Iterator iterator = ius.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
- IRequirement[] reqs = iu.getMetaRequiredCapabilities();
- for (int i = 0; i < reqs.length; i++) {
- allMetaRequirements.add(reqs[i]);
- }
+ private Collection<IRequirement> extractMetaRequirements(Collection<IInstallableUnit> ius, IProvisioningPlan plan) {
+ Set<IRequirement> allMetaRequirements = new HashSet<IRequirement>();
+ for (Iterator<IInstallableUnit> iterator = ius.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
+ allMetaRequirements.addAll(iu.getMetaRequiredCapabilities());
}
- IQueryResult queryResult = plan.getRemovals().query(InstallableUnitQuery.ANY, null);
- for (Iterator iterator = queryResult.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
- IRequirement[] reqs = iu.getMetaRequiredCapabilities();
- for (int i = 0; i < reqs.length; i++) {
- allMetaRequirements.add(reqs[i]);
- }
+ IQueryResult<IInstallableUnit> queryResult = plan.getRemovals().query(InstallableUnitQuery.ANY, null);
+ for (Iterator<IInstallableUnit> iterator = queryResult.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
+ allMetaRequirements.addAll(iu.getMetaRequiredCapabilities());
}
return allMetaRequirements;
}
- private ProvisioningPlan createInstallerPlan(IProfile profile, ProfileChangeRequest initialRequest, Collection unattachedState, Collection expectedState, ProvisioningPlan initialPlan, ProvisioningContext initialContext, IProgressMonitor monitor) {
+ private ProvisioningPlan createInstallerPlan(IProfile profile, ProfileChangeRequest initialRequest, Collection<IInstallableUnit> unattachedState, Collection<IInstallableUnit> expectedState, ProvisioningPlan initialPlan, ProvisioningContext initialContext, IProgressMonitor monitor) {
SubMonitor sub = SubMonitor.convert(monitor, ExpandWork);
try {
@@ -453,14 +451,14 @@ public class SimplePlanner implements IPlanner {
}
}
- private ProvisioningPlan createInstallerPlanForCohostedCaseFromExternalInstaller(IProfile profile, ProfileChangeRequest initialRequest, IProvisioningPlan initialPlan, Collection newState, ProvisioningContext initialContext, IProfile agentProfile, SubMonitor sub) {
+ private ProvisioningPlan createInstallerPlanForCohostedCaseFromExternalInstaller(IProfile profile, ProfileChangeRequest initialRequest, IProvisioningPlan initialPlan, Collection<IInstallableUnit> newState, ProvisioningContext initialContext, IProfile agentProfile, SubMonitor sub) {
ProvisioningPlan planForProfile = generatePlan(null, newState, initialRequest, initialContext);
return createInstallerPlanForExternalInstaller(profile, initialRequest, planForProfile, newState, initialContext, agentProfile, sub);
}
//Deal with the case where the agent profile is different than the one being provisioned
- private ProvisioningPlan createInstallerPlanForExternalInstaller(IProfile targetedProfile, ProfileChangeRequest initialRequest, ProvisioningPlan initialPlan, Collection expectedState, ProvisioningContext initialContext, IProfile agentProfile, SubMonitor sub) {
- Collection metaRequirements = areMetaRequirementsSatisfied(agentProfile, expectedState, initialPlan);
+ private ProvisioningPlan createInstallerPlanForExternalInstaller(IProfile targetedProfile, ProfileChangeRequest initialRequest, ProvisioningPlan initialPlan, Collection<IInstallableUnit> expectedState, ProvisioningContext initialContext, IProfile agentProfile, SubMonitor sub) {
+ Collection<IRequirement> metaRequirements = areMetaRequirementsSatisfied(agentProfile, expectedState, initialPlan);
if (metaRequirements == null)
return initialPlan;
@@ -484,8 +482,8 @@ public class SimplePlanner implements IPlanner {
//Deal with the case where the actions needs to be installed in the same profile than the one we are performing the initial request
//The expectedState represents the result of the initialRequest where the metaRequirements have been satisfied.
- private ProvisioningPlan createInstallerPlanForCohostedCase(IProfile profile, ProfileChangeRequest initialRequest, ProvisioningPlan initialPlan, Collection unattachedState, Collection expectedState, ProvisioningContext initialContext, SubMonitor monitor) {
- Collection metaRequirements = initialRequest.getRemovedInstallableUnits().length == 0 ? areMetaRequirementsSatisfied(profile, expectedState, initialPlan) : extractMetaRequirements(expectedState, initialPlan);
+ private ProvisioningPlan createInstallerPlanForCohostedCase(IProfile profile, ProfileChangeRequest initialRequest, ProvisioningPlan initialPlan, Collection<IInstallableUnit> unattachedState, Collection<IInstallableUnit> expectedState, ProvisioningContext initialContext, SubMonitor monitor) {
+ Collection<IRequirement> metaRequirements = initialRequest.getRemovedInstallableUnits().length == 0 ? areMetaRequirementsSatisfied(profile, expectedState, initialPlan) : extractMetaRequirements(expectedState, initialPlan);
if (metaRequirements == null || metaRequirements.isEmpty())
return initialPlan;
@@ -495,20 +493,20 @@ public class SimplePlanner implements IPlanner {
//Create an agent request from the initial request
ProfileChangeRequest agentRequest = new ProfileChangeRequest(profile);
- for (Iterator it = initialRequest.getPropertiesToAdd().entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- agentRequest.setProfileProperty((String) entry.getKey(), entry.getValue());
+ for (Iterator<Entry<String, String>> it = initialRequest.getPropertiesToAdd().entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ agentRequest.setProfileProperty(entry.getKey(), entry.getValue());
}
String[] removedProperties = initialRequest.getPropertiesToRemove();
for (int i = 0; i < removedProperties.length; i++) {
agentRequest.removeProfileProperty(removedProperties[i]);
}
- Map removedIUProperties = initialRequest.getInstallableUnitProfilePropertiesToRemove();
- for (Iterator iterator = removedIUProperties.entrySet().iterator(); iterator.hasNext();) {
- Entry entry = (Entry) iterator.next();
- ArrayList value = (ArrayList) entry.getValue();
- for (Iterator iterator2 = value.iterator(); iterator2.hasNext();) {
- agentRequest.removeInstallableUnitProfileProperty((IInstallableUnit) entry.getKey(), (String) iterator2.next());
+ Map<IInstallableUnit, List<String>> removedIUProperties = initialRequest.getInstallableUnitProfilePropertiesToRemove();
+ for (Iterator<Entry<IInstallableUnit, List<String>>> iterator = removedIUProperties.entrySet().iterator(); iterator.hasNext();) {
+ Entry<IInstallableUnit, List<String>> entry = iterator.next();
+ List<String> value = entry.getValue();
+ for (Iterator<String> iterator2 = value.iterator(); iterator2.hasNext();) {
+ agentRequest.removeInstallableUnitProfileProperty(entry.getKey(), iterator2.next());
}
}
@@ -517,7 +515,7 @@ public class SimplePlanner implements IPlanner {
agentRequest.addInstallableUnit(metaRequirementIU);
ProvisioningContext agentCtx = new ProvisioningContext(new URI[0]);
- ArrayList extraIUs = new ArrayList(unattachedState);
+ ArrayList<IInstallableUnit> extraIUs = new ArrayList<IInstallableUnit>(unattachedState);
agentCtx.setExtraIUs(extraIUs);
Object agentSolution = getSolutionFor(agentRequest, agentCtx, monitor.newChild(3));
if (agentSolution instanceof IProvisioningPlan && ((IProvisioningPlan) agentSolution).getStatus().getSeverity() == IStatus.ERROR) {
@@ -527,7 +525,7 @@ public class SimplePlanner implements IPlanner {
}
//Compute the installer plan. It is the difference between what is currently in the profile and the solution we just computed
- Collection agentState = ((Projector) agentSolution).extractSolution();
+ Collection<IInstallableUnit> agentState = ((Projector) agentSolution).extractSolution();
agentState.remove(metaRequirementIU); //Remove the fake IU
agentState = AttachmentHelper.attachFragments(agentState.iterator(), ((Projector) agentSolution).getFragmentAssociation());
@@ -538,8 +536,8 @@ public class SimplePlanner implements IPlanner {
LogHelper.log(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, "The resolution of the previous state contained in profile " + initialRequest.getProfile().getProfileId() + " version " + initialRequest.getProfile().getTimestamp() + " failed.")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
return (ProvisioningPlan) initialSolution;
}
- Iterator profileState = initialRequest.getProfile().query(InstallableUnitQuery.ANY, null).iterator();
- Collection initialState = AttachmentHelper.attachFragments(profileState, ((Projector) initialSolution).getFragmentAssociation());
+ Iterator<IInstallableUnit> profileState = initialRequest.getProfile().query(InstallableUnitQuery.ANY, null).iterator();
+ Collection<IInstallableUnit> initialState = AttachmentHelper.attachFragments(profileState, ((Projector) initialSolution).getFragmentAssociation());
IProvisioningPlan agentPlan = generateProvisioningPlan(initialState, agentState, initialRequest, null, initialContext);
@@ -548,7 +546,7 @@ public class SimplePlanner implements IPlanner {
}
//Compute the set of operands based on the solution obtained previously
- private ProvisioningPlan generatePlan(Projector newSolution, Collection newState, ProfileChangeRequest request, ProvisioningContext context) {
+ private ProvisioningPlan generatePlan(Projector newSolution, Collection<IInstallableUnit> newState, ProfileChangeRequest request, ProvisioningContext context) {
//Compute the attachment of the new state if not provided
if (newState == null) {
newState = newSolution.extractSolution();
@@ -562,8 +560,8 @@ public class SimplePlanner implements IPlanner {
LogHelper.log(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, "The resolution of the previous state contained in profile " + request.getProfile().getProfileId() + " version " + request.getProfile().getTimestamp() + " failed.")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
return (ProvisioningPlan) initialSolution;
}
- Iterator profileState = request.getProfile().query(InstallableUnitQuery.ANY, null).iterator();
- Collection initialState = AttachmentHelper.attachFragments(profileState, ((Projector) initialSolution).getFragmentAssociation());
+ Iterator<IInstallableUnit> profileState = request.getProfile().query(InstallableUnitQuery.ANY, null).iterator();
+ Collection<IInstallableUnit> initialState = AttachmentHelper.attachFragments(profileState, ((Projector) initialSolution).getFragmentAssociation());
//Generate the plan
return generateProvisioningPlan(initialState, newState, request, null, context);
@@ -573,22 +571,22 @@ public class SimplePlanner implements IPlanner {
ProvisioningContext noRepoContext = new ProvisioningContext(new URI[0]);
noRepoContext.setArtifactRepositories(new URI[0]);
noRepoContext.setProperty(INCLUDE_PROFILE_IUS, Boolean.FALSE.toString());
- noRepoContext.setExtraIUs(new ArrayList(request.getProfile().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).unmodifiableSet()));
+ noRepoContext.setExtraIUs(new ArrayList<IInstallableUnit>(request.getProfile().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).unmodifiableSet()));
return noRepoContext;
}
private IInstallableUnit getPreviousIUForMetaRequirements(IProfile profile, String iuId, IProgressMonitor monitor) {
- IQueryResult c = profile.query(new InstallableUnitQuery(iuId), monitor);
+ IQueryResult<IInstallableUnit> c = profile.query(new InstallableUnitQuery(iuId), monitor);
if (c.isEmpty())
return null;
- return (IInstallableUnit) c.iterator().next();
+ return c.iterator().next();
}
private String getActionGatheringIUId(IProfile profile) {
return ID_IU_FOR_ACTIONS + '.' + profile.getProfileId();
}
- private IInstallableUnit createIUForMetaRequirements(IProfile profile, Collection metaRequirements) {
+ private IInstallableUnit createIUForMetaRequirements(IProfile profile, Collection<IRequirement> metaRequirements) {
InstallableUnitDescription description = new InstallableUnitDescription();
String id = getActionGatheringIUId(profile);
description.setId(id);
@@ -596,7 +594,7 @@ public class SimplePlanner implements IPlanner {
description.setVersion(version);
description.addRequiredCapabilities(metaRequirements);
- ArrayList providedCapabilities = new ArrayList();
+ ArrayList<IProvidedCapability> providedCapabilities = new ArrayList<IProvidedCapability>();
IProvidedCapability providedCapability = MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, id, version);
providedCapabilities.add(providedCapability);
description.addProvidedCapabilities(providedCapabilities);
@@ -605,12 +603,12 @@ public class SimplePlanner implements IPlanner {
return actionsIU;
}
- private IInstallableUnit createIURepresentingTheProfile(ArrayList allRequirements) {
+ private IInstallableUnit createIURepresentingTheProfile(ArrayList<IRequirement> allRequirements) {
InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription();
String time = Long.toString(System.currentTimeMillis());
iud.setId(time);
iud.setVersion(Version.createOSGi(0, 0, 0, time));
- iud.setRequiredCapabilities((IRequirement[]) allRequirements.toArray(new IRequirement[allRequirements.size()]));
+ iud.setRequiredCapabilities(allRequirements.toArray(new IRequirement[allRequirements.size()]));
return MetadataFactory.createInstallableUnit(iud);
}
@@ -618,20 +616,20 @@ public class SimplePlanner implements IPlanner {
//It returns at index 0 a meta IU representing everything that needs to be installed
//It returns at index 1 all the IUs that are in the profile after the removal have been done, but before the addition have been done
private Object[] updatePlannerInfo(ProfileChangeRequest profileChangeRequest, ProvisioningContext context) {
- IQueryResult alreadyInstalled = profileChangeRequest.getProfile().query(new IUProfilePropertyQuery(INCLUSION_RULES, null), null);
+ IQueryResult<IInstallableUnit> alreadyInstalled = profileChangeRequest.getProfile().query(new IUProfilePropertyQuery(INCLUSION_RULES, null), null);
IInstallableUnit[] added = profileChangeRequest.getAddedInstallableUnits();
IInstallableUnit[] removed = profileChangeRequest.getRemovedInstallableUnits();
- for (Iterator iterator = profileChangeRequest.getInstallableUnitProfilePropertiesToRemove().entrySet().iterator(); iterator.hasNext();) {
- Map.Entry object = (Map.Entry) iterator.next();
- if (((List) object.getValue()).contains(INCLUSION_RULES))
- profileChangeRequest.setInstallableUnitProfileProperty((IInstallableUnit) object.getKey(), INCLUSION_RULES, PlannerHelper.createStrictInclusionRule((IInstallableUnit) object.getKey()));
+ for (Iterator<Entry<IInstallableUnit, List<String>>> iterator = profileChangeRequest.getInstallableUnitProfilePropertiesToRemove().entrySet().iterator(); iterator.hasNext();) {
+ Entry<IInstallableUnit, List<String>> object = iterator.next();
+ if (object.getValue().contains(INCLUSION_RULES))
+ profileChangeRequest.setInstallableUnitProfileProperty(object.getKey(), INCLUSION_RULES, PlannerHelper.createStrictInclusionRule(object.getKey()));
}
//Remove the iu properties associated to the ius removed and the iu properties being removed as well
if (removed.length != 0) {
- for (Iterator iterator = alreadyInstalled.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
+ for (Iterator<IInstallableUnit> iterator = alreadyInstalled.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
for (int i = 0; i < removed.length; i++) {
if (iu.equals(removed[i])) {
profileChangeRequest.removeInstallableUnitProfileProperty(removed[i], INCLUSION_RULES);
@@ -641,15 +639,15 @@ public class SimplePlanner implements IPlanner {
}
}
}
- ArrayList gatheredRequirements = new ArrayList();
+ ArrayList<IRequirement> gatheredRequirements = new ArrayList<IRequirement>();
//Process all the IUs being added
- Map iuPropertiesToAdd = profileChangeRequest.getInstallableUnitProfilePropertiesToAdd();
+ Map<IInstallableUnit, Map<String, String>> iuPropertiesToAdd = profileChangeRequest.getInstallableUnitProfilePropertiesToAdd();
for (int i = 0; i < added.length; i++) {
- Map propertiesForIU = (Map) iuPropertiesToAdd.get(added[i]);
+ Map<String, String> propertiesForIU = iuPropertiesToAdd.get(added[i]);
IRequirement profileRequirement = null;
if (propertiesForIU != null) {
- profileRequirement = createRequirement(added[i], (String) propertiesForIU.get(INCLUSION_RULES));
+ profileRequirement = createRequirement(added[i], propertiesForIU.get(INCLUSION_RULES));
}
if (profileRequirement == null) {
profileChangeRequest.setInstallableUnitProfileProperty(added[i], INCLUSION_RULES, PlannerHelper.createStrictInclusionRule(added[i]));
@@ -659,13 +657,13 @@ public class SimplePlanner implements IPlanner {
}
//Process the IUs that were already there
- for (Iterator iterator = alreadyInstalled.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
- Map propertiesForIU = (Map) iuPropertiesToAdd.get(iu);
+ for (Iterator<IInstallableUnit> iterator = alreadyInstalled.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
+ Map<String, String> propertiesForIU = iuPropertiesToAdd.get(iu);
IRequirement profileRequirement = null;
//Test if the value has changed
if (propertiesForIU != null) {
- profileRequirement = createRequirement(iu, (String) propertiesForIU.get(INCLUSION_RULES));
+ profileRequirement = createRequirement(iu, propertiesForIU.get(INCLUSION_RULES));
}
if (profileRequirement == null) {
profileRequirement = createRequirement(iu, profileChangeRequest.getProfile().getInstallableUnitProperty(iu, INCLUSION_RULES));
@@ -676,7 +674,7 @@ public class SimplePlanner implements IPlanner {
//Now add any other requirement that we need to see satisfied
if (context != null && context.getAdditionalRequirements() != null)
gatheredRequirements.addAll(context.getAdditionalRequirements());
- return new Object[] {createIURepresentingTheProfile(gatheredRequirements), (IInstallableUnit[]) alreadyInstalled.toArray(IInstallableUnit.class)};
+ return new Object[] {createIURepresentingTheProfile(gatheredRequirements), alreadyInstalled.toArray(IInstallableUnit.class)};
}
private IRequirement createRequirement(IInstallableUnit iu, String rule) {
@@ -700,7 +698,7 @@ public class SimplePlanner implements IPlanner {
}
public IInstallableUnit[] updatesFor(IInstallableUnit toUpdate, ProvisioningContext context, IProgressMonitor monitor) {
- Map resultsMap = new HashMap();
+ Map<String, IInstallableUnit> resultsMap = new HashMap<String, IInstallableUnit>();
URI[] repositories = context.getMetadataRepositories();
if (repositories == null)
@@ -712,11 +710,11 @@ public class SimplePlanner implements IPlanner {
if (sub.isCanceled())
throw new OperationCanceledException();
IMetadataRepository repository = repoManager.loadRepository(repositories[i], sub.newChild(100));
- IQueryResult matches = repository.query(new UpdateQuery(toUpdate), sub.newChild(100));
- for (Iterator it = matches.iterator(); it.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) it.next();
+ IQueryResult<IInstallableUnit> matches = repository.query(new UpdateQuery(toUpdate), sub.newChild(100));
+ for (Iterator<IInstallableUnit> it = matches.iterator(); it.hasNext();) {
+ IInstallableUnit iu = it.next();
String key = iu.getId() + "_" + iu.getVersion().toString(); //$NON-NLS-1$
- IInstallableUnit currentIU = (IInstallableUnit) resultsMap.get(key);
+ IInstallableUnit currentIU = resultsMap.get(key);
if (currentIU == null || hasHigherFidelity(iu, currentIU))
resultsMap.put(key, iu);
}
@@ -725,8 +723,8 @@ public class SimplePlanner implements IPlanner {
}
}
sub.done();
- Collection results = resultsMap.values();
- return (IInstallableUnit[]) results.toArray(new IInstallableUnit[results.size()]);
+ Collection<IInstallableUnit> results = resultsMap.values();
+ return results.toArray(new IInstallableUnit[results.size()]);
}
//helper class to trick the resolver to believe that everything is optional
@@ -737,11 +735,11 @@ public class SimplePlanner implements IPlanner {
profile = p;
}
- public IQueryResult available(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult<IInstallableUnit> available(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
return profile.available(query, monitor);
}
- public Map getInstallableUnitProperties(IInstallableUnit iu) {
+ public Map<String, String> getInstallableUnitProperties(IInstallableUnit iu) {
return profile.getInstallableUnitProperties(iu);
}
@@ -755,7 +753,7 @@ public class SimplePlanner implements IPlanner {
return profile.getProfileId();
}
- public Map getProperties() {
+ public Map<String, String> getProperties() {
return profile.getProperties();
}
@@ -767,7 +765,7 @@ public class SimplePlanner implements IPlanner {
return profile.getTimestamp();
}
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult<IInstallableUnit> query(IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
return profile.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
index e22e2535d..f70141e4e 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
@@ -15,8 +15,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnitPatch;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IRequirementChange;
+import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
@@ -27,26 +26,26 @@ import org.osgi.framework.InvalidSyntaxException;
public class Slicer {
private static boolean DEBUG = false;
- private IQueryable possibilites;
+ private IQueryable<IInstallableUnit> possibilites;
- private LinkedList toProcess;
- private Set considered; //IUs to add to the slice
- private TwoTierMap slice; //The IUs that have been considered to be part of the problem
+ private LinkedList<IInstallableUnit> toProcess;
+ private Set<IInstallableUnit> considered; //IUs to add to the slice
+ private Map<String, Map<Version, IInstallableUnit>> slice; //The IUs that have been considered to be part of the problem
- protected Dictionary selectionContext;
+ protected Dictionary<? extends Object, ? extends Object> selectionContext;
private MultiStatus result;
private boolean considerMetaRequirements = false;
- public Slicer(IQueryable input, Dictionary context, boolean considerMetaRequirements) {
+ public Slicer(IQueryable<IInstallableUnit> input, Dictionary<? extends Object, ? extends Object> context, boolean considerMetaRequirements) {
possibilites = input;
- slice = new TwoTierMap();
+ slice = new HashMap<String, Map<Version, IInstallableUnit>>();
selectionContext = context;
result = new MultiStatus(DirectorActivator.PI_DIRECTOR, IStatus.OK, Messages.Planner_Problems_resolving_plan, null);
this.considerMetaRequirements = considerMetaRequirements;
}
- public IQueryable slice(IInstallableUnit[] ius, IProgressMonitor monitor) {
+ public IQueryable<IInstallableUnit> slice(IInstallableUnit[] ius, IProgressMonitor monitor) {
try {
long start = 0;
if (DEBUG) {
@@ -55,14 +54,14 @@ public class Slicer {
}
validateInput(ius);
- considered = new HashSet(Arrays.asList(ius));
- toProcess = new LinkedList(considered);
+ considered = new HashSet<IInstallableUnit>(Arrays.asList(ius));
+ toProcess = new LinkedList<IInstallableUnit>(considered);
while (!toProcess.isEmpty()) {
if (monitor.isCanceled()) {
result.merge(Status.CANCEL_STATUS);
throw new OperationCanceledException();
}
- processIU((IInstallableUnit) toProcess.removeFirst());
+ processIU(toProcess.removeFirst());
}
if (DEBUG) {
long stop = System.currentTimeMillis();
@@ -75,7 +74,7 @@ public class Slicer {
LogHelper.log(result);
if (result.getSeverity() == IStatus.ERROR)
return null;
- return new QueryableArray((IInstallableUnit[]) considered.toArray(new IInstallableUnit[considered.size()]));
+ return new QueryableArray(considered.toArray(new IInstallableUnit[considered.size()]));
}
public MultiStatus getStatus() {
@@ -92,7 +91,7 @@ public class Slicer {
// Check whether the requirement is applicable
protected boolean isApplicable(IRequirement req) {
- IQuery filter = req.getFilter();
+ IQuery<Boolean> filter = req.getFilter();
if (filter == null)
return true;
if (filter instanceof LDAPQuery)
@@ -118,24 +117,31 @@ public class Slicer {
protected void processIU(IInstallableUnit iu) {
iu = iu.unresolved();
- slice.put(iu.getId(), iu.getVersion(), iu);
+ Map<Version, IInstallableUnit> iuSlice = slice.get(iu.getId());
+ if (iuSlice == null) {
+ iuSlice = new HashMap<Version, IInstallableUnit>();
+ slice.put(iu.getId(), iuSlice);
+ }
+ iuSlice.put(iu.getVersion(), iu);
if (!isApplicable(iu)) {
return;
}
- IRequirement[] reqs = getRequiredCapabilities(iu);
- if (reqs.length == 0) {
+ List<IRequirement> reqs = getRequiredCapabilities(iu);
+ int reqsCount = reqs.size();
+ if (reqsCount == 0) {
return;
}
- for (int i = 0; i < reqs.length; i++) {
- if (!isApplicable(reqs[i]))
+ for (int i = 0; i < reqsCount; i++) {
+ IRequirement req = reqs.get(i);
+ if (!isApplicable(req))
continue;
- if (!isGreedy(reqs[i])) {
+ if (!isGreedy(req)) {
continue;
}
- expandRequirement(iu, reqs[i]);
+ expandRequirement(iu, req);
}
}
@@ -143,38 +149,45 @@ public class Slicer {
return req.isGreedy();
}
- private IRequirement[] getRequiredCapabilities(IInstallableUnit iu) {
+ private List<IRequirement> getRequiredCapabilities(IInstallableUnit iu) {
+ List<IRequirement> iuRequirements = iu.getRequiredCapabilities();
+ int initialRequirementCount = iuRequirements.size();
if (!(iu instanceof IInstallableUnitPatch)) {
- if (iu.getMetaRequiredCapabilities().length == 0 || considerMetaRequirements == false)
- return iu.getRequiredCapabilities();
- IRequirement[] aggregatedCapabilities = new IRequirement[iu.getRequiredCapabilities().length + iu.getMetaRequiredCapabilities().length];
- System.arraycopy(iu.getRequiredCapabilities(), 0, aggregatedCapabilities, 0, iu.getRequiredCapabilities().length);
- System.arraycopy(iu.getMetaRequiredCapabilities(), 0, aggregatedCapabilities, iu.getRequiredCapabilities().length, iu.getMetaRequiredCapabilities().length);
+ if (!considerMetaRequirements)
+ return iuRequirements;
+
+ List<IRequirement> iuMetaRequirements = iu.getMetaRequiredCapabilities();
+ int metaSize = iuMetaRequirements.size();
+ if (metaSize == 0)
+ return iuRequirements;
+
+ ArrayList<IRequirement> aggregatedCapabilities = new ArrayList<IRequirement>(initialRequirementCount + metaSize);
+ aggregatedCapabilities.addAll(iuRequirements);
+ aggregatedCapabilities.addAll(iuMetaRequirements);
return aggregatedCapabilities;
}
- IRequirement[] aggregatedCapabilities;
+
IInstallableUnitPatch patchIU = (IInstallableUnitPatch) iu;
- IRequirementChange[] changes = patchIU.getRequirementsChange();
- int initialRequirementCount = iu.getRequiredCapabilities().length;
- aggregatedCapabilities = new IRequirement[initialRequirementCount + changes.length];
- System.arraycopy(iu.getRequiredCapabilities(), 0, aggregatedCapabilities, 0, initialRequirementCount);
- for (int i = 0; i < changes.length; i++) {
- aggregatedCapabilities[initialRequirementCount++] = changes[i].newValue();
- }
+ List<IRequirementChange> changes = patchIU.getRequirementsChange();
+ ArrayList<IRequirement> aggregatedCapabilities = new ArrayList<IRequirement>(initialRequirementCount + changes.size());
+ aggregatedCapabilities.addAll(iuRequirements);
+ for (int i = 0; i < changes.size(); i++)
+ aggregatedCapabilities.add(changes.get(i).newValue());
return aggregatedCapabilities;
}
private void expandRequirement(IInstallableUnit iu, IRequirement req) {
if (req.getMax() == 0)
return;
- IQueryResult matches = possibilites.query(req.getMatches(), null);
+ IQueryResult<IInstallableUnit> matches = possibilites.query(req.getMatches(), null);
int validMatches = 0;
- for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
- IInstallableUnit match = (IInstallableUnit) iterator.next();
+ for (Iterator<IInstallableUnit> iterator = matches.iterator(); iterator.hasNext();) {
+ IInstallableUnit match = iterator.next();
if (!isApplicable(match))
continue;
validMatches++;
- if (!slice.containsKey(match.getId(), match.getVersion()))
+ Map<Version, IInstallableUnit> iuSlice = slice.get(match.getId());
+ if (iuSlice == null || !iuSlice.containsKey(match.getVersion()))
consider(match);
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/TwoTierMap.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/TwoTierMap.java
deleted file mode 100644
index 84ba95c06..000000000
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/TwoTierMap.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.director;
-
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.util.*;
-
-/**
- * The purpose of this class is to provide a two-tier map.
- * MapOf(key1 => MapOf(key2 => value)).
- * Even though this class implements Map the behavior of
- * the methods aren't exactly the same as that of a real
- * Map - especially, entrySet(), keySet() etc. works off
- * the outer map while values() returns all the values of
- * all the inner maps.
- */
-public class TwoTierMap implements Map, Serializable {
-
- private static final long serialVersionUID = 362497720873186265L;
-
- private Map outerMap;
- private int policy;
-
- public static final int POLICY_NONE = 0, POLICY_BOTH_MAPS_PRESERVE_ORDERING = 1 << 0, POLICY_INNER_MAP_PRESERVE_EXISTING = 1 << 1, POLICY_INNER_MAP_SORTED_ASCENDING = 1 << 2, POLICY_INNER_MAP_SORTED_DESCENDING = 1 << 3, POLICY_INNER_MAP_ENSURE_SINGLETON = 1 << 4;
-
- private static final int POLICY_INNER_MAP_SORTED_MASK = POLICY_INNER_MAP_SORTED_ASCENDING | POLICY_INNER_MAP_SORTED_DESCENDING;
-
- public TwoTierMap() {
- this(8, POLICY_NONE);
- }
-
- public TwoTierMap(int initialCapacity) {
- this(initialCapacity, POLICY_NONE);
- }
-
- /**
- * Creates a two-tier map with the specified
- * initialCapacity and policy. The policy determines
- * whether the outer map is ordered, inner map is
- * sorted, clobber values of inner map etc.
- */
- public TwoTierMap(int initialCapacity, int policy) {
- this.policy = policy;
- this.outerMap = shouldUseOrderedMap() ? new LinkedHashMap(initialCapacity) : new HashMap(initialCapacity);
- }
-
- /**
- * Insert the value with key key1 into the inner map
- * that is obtained from the outer map with key key2.
- * If you have set POLICY_INNER_MAP_PRESERVE_EXISTING
- * at the time of creating this, it will not overwrite
- * if there is already a non-null value at key2.
- * The other POLICY_INNER_MAP_* policies determine
- * what kind of inner map is created.
- * @param key1 The key for outer map.
- * @param key2 The key for inner map.
- * @param value The value.
- * @return Existing value if any, otherwise null.
- */
- public Object put(Object key1, Object key2, Object value) {
- Map innerMap = (Map) this.outerMap.get(key1);
- if (innerMap == null) {
- if (shouldUseSingletonInnerMap()) {
- this.outerMap.put(key1, Collections.singletonMap(key2, value));
- return null;
- }
- innerMap = createInnerMap();
- this.outerMap.put(key1, innerMap);
- }
- // It is faster to check for already existing entry
- // this way instead of containsKey() check. Of course,
- // this will prevent us from recognizing a null entry,
- // which I think shouldn't be a problem.
- Object existing = innerMap.put(key2, value);
- if (existing != null && shouldPreserveExisting()) {
- innerMap.put(key2, existing);
- }
- return existing;
- }
-
- /**
- * Get the object stored in the inner map using key2
- * as key where the inner map is obtained from the
- * outer map using key1.
- * @param key1 The key for outer map.
- * @param key2 The key for inner map.
- * @return The object for key2 in inner map for key1
- * in the outer map.
- */
- public Object get(Object key1, Object key2) {
- if (key1 == null || key2 == null)
- return getAll(key1);
- Map innerMap = (Map) this.outerMap.get(key1);
- Object value = innerMap == null ? null : innerMap.get(key2);
- return value;
- }
-
- /**
- * Get all the values in the inner map for key1 in
- * the outer map.
- * @param key1 The key for outer map.
- * @return Collection of values in the inner map.
- */
- public Collection getAll(Object key1) {
- if (key1 == null)
- // return all
- return values();
- Map innerMap = (Map) this.outerMap.get(key1);
- return innerMap == null ? Collections.EMPTY_LIST : Collections.unmodifiableCollection(innerMap.values());
-
- }
-
- public Object remove(Object key1, Object key2) {
- if (key1 == null || key2 == null)
- return removeAll(key1);
- Map innerMap = (Map) this.outerMap.get(key1);
- if (innerMap == null)
- return null;
- if (shouldUseSingletonInnerMap()) {
- Object result = innerMap.get(key2);
- if (result != null) {
- this.outerMap.remove(key1);
- }
- return result;
- }
- Object result = innerMap.remove(key2);
- if (result != null && innerMap.isEmpty()) {
- this.outerMap.remove(key1);
- }
- return result;
- }
-
- public Collection removeAll(Object key1) {
- if (key1 == null)
- return Collections.EMPTY_LIST;
- Map innerMap = (Map) this.outerMap.remove(key1);
- return innerMap == null ? Collections.EMPTY_LIST : innerMap.values();
- }
-
- /**
- * Determine whether there exists a valid object for
- * key2 in the inner map for key1 in the outer map.
- * @param key1 The key for outer map.
- * @param key2 The key for inner map.
- * @return true if a non-null object exists; otherwise
- * false.
- */
- public boolean containsKey(Object key1, Object key2) {
- if (key1 == null)
- return false;
- if (key2 == null)
- return containsKey(key1);
- return get(key1, key2) != null;
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#clear()
- */
- public void clear() {
- this.outerMap.clear();
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#containsKey(java.lang.Object)
- */
- public boolean containsKey(Object key) {
- return this.outerMap.containsKey(key);
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#containsValue(java.lang.Object)
- */
- public boolean containsValue(Object value) {
- for (Iterator it = entrySet().iterator(); it.hasNext();) {
- Map.Entry entry = (Map.Entry) it.next();
- Map innerMap = (Map) entry.getValue();
- if (innerMap.containsValue(value))
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#size()
- */
- public int size() {
- return this.outerMap.size();
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#isEmpty()
- */
- public boolean isEmpty() {
- return this.size() == 0;
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#entrySet()
- */
- public Set entrySet() {
- return Collections.unmodifiableSet(this.outerMap.entrySet());
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#values()
- */
- public Collection values() {
- ArrayList result = new ArrayList(size());
- for (Iterator it = this.outerMap.keySet().iterator(); it.hasNext();) {
- Object key = it.next();
- // A null key will cause infinite recursion!
- if (key != null) {
- result.addAll(getAll(key));
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#get(java.lang.Object)
- */
- public Object get(Object key) {
- if (key instanceof Object[]) {
- Object[] keys = (Object[]) key;
- return get(keys[0], keys[1]);
- } else
- return getAll(key);
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#keySet()
- */
- public Set keySet() {
- return Collections.unmodifiableSet(this.outerMap.keySet());
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#put(java.lang.Object, java.lang.Object)
- */
- public Object put(Object key, Object value) {
- if (key instanceof Object[]) {
- Object[] keys = (Object[]) key;
- return put(keys[0], keys[1], value);
- }
- throw new IllegalArgumentException("First arg should be an array!"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#putAll(java.util.Map)
- */
- public void putAll(Map t) {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see java.util.Map#remove(java.lang.Object)
- */
- public Object remove(Object key) {
- if (key instanceof Object[]) {
- Object[] keys = (Object[]) key;
- return remove(keys[0], keys[1]);
- } else
- return removeAll(key);
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- if (this.outerMap.isEmpty()) {
- sb.append(" (Empty)"); //$NON-NLS-1$
- } else {
- for (Iterator it = this.outerMap.entrySet().iterator(); it.hasNext();) {
- Map.Entry entry = (Map.Entry) it.next();
- sb.append(" ").append(entry.getKey()) //$NON-NLS-1$
- .append(" = ") //$NON-NLS-1$
- .append(entry.getValue()).append('\n');
- }
- sb.setLength(sb.length() - 1);
- }
- return sb.toString();
- }
-
- public void dump(PrintStream ps) {
- if (ps == null) {
- ps = System.out;
- }
- ps.println(this.toString());
- }
-
- private Map createInnerMap() {
- Map innerMap;
- if (shouldUseSortedInnerMap()) {
- innerMap = new TreeMap(new ValueComparator(shouldSortInAscendingOrder()));
- } else if (shouldUseOrderedMap()) {
- innerMap = new LinkedHashMap(2);
- } else {
- innerMap = new HashMap(2);
- }
- return innerMap;
- }
-
- private boolean shouldPreserveExisting() {
- return (this.policy & POLICY_INNER_MAP_PRESERVE_EXISTING) == POLICY_INNER_MAP_PRESERVE_EXISTING;
- }
-
- private boolean shouldUseOrderedMap() {
- return (this.policy & POLICY_BOTH_MAPS_PRESERVE_ORDERING) == POLICY_BOTH_MAPS_PRESERVE_ORDERING;
- }
-
- private boolean shouldUseSortedInnerMap() {
- return (this.policy & POLICY_INNER_MAP_SORTED_MASK) != 0;
- }
-
- private boolean shouldSortInAscendingOrder() {
- return (this.policy & POLICY_INNER_MAP_SORTED_MASK) == POLICY_INNER_MAP_SORTED_ASCENDING;
- }
-
- private boolean shouldUseSingletonInnerMap() {
- return (this.policy & POLICY_INNER_MAP_ENSURE_SINGLETON) == POLICY_INNER_MAP_ENSURE_SINGLETON;
- }
-
- private static class ValueComparator implements Comparator, Serializable {
- private static final long serialVersionUID = 362497720873186266L;
- private boolean ascending;
-
- public ValueComparator(boolean ascending) {
- this.ascending = ascending;
- }
-
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- try {
- if (o1 instanceof Comparable) {
- int cmp = ((Comparable) o1).compareTo(o2);
- return this.ascending ? cmp : (0 - cmp);
- }
- } catch (Exception e) {
- // Ignore
- }
- return 1;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
index c348551d5..c6f9cc4cc 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
@@ -31,12 +31,12 @@ public class FormerState {
}
private static void synchronizeAllIUProperties(ProfileChangeRequest request, IProfile current, IProfile target) {
- Set currentIUset = current.query(InstallableUnitQuery.ANY, null).unmodifiableSet();
- Iterator targetIUs = target.query(InstallableUnitQuery.ANY, null).iterator();
- List iusToAdd = new ArrayList();
- List iusToUpdate = new ArrayList();
+ Set<IInstallableUnit> currentIUset = current.query(InstallableUnitQuery.ANY, null).unmodifiableSet();
+ Iterator<IInstallableUnit> targetIUs = target.query(InstallableUnitQuery.ANY, null).iterator();
+ List<IInstallableUnit> iusToAdd = new ArrayList<IInstallableUnit>();
+ List<IInstallableUnit> iusToUpdate = new ArrayList<IInstallableUnit>();
while (targetIUs.hasNext()) {
- Object nxt = targetIUs.next();
+ IInstallableUnit nxt = targetIUs.next();
if (currentIUset.contains(nxt))
iusToUpdate.add(nxt);
else
@@ -44,35 +44,31 @@ public class FormerState {
}
//additions
- for (Iterator iterator = iusToAdd.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
- for (Iterator it = target.getInstallableUnitProperties(iu).entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- request.setInstallableUnitProfileProperty(iu, key, value);
+ for (Iterator<IInstallableUnit> iterator = iusToAdd.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
+ for (Iterator<Entry<String, String>> it = target.getInstallableUnitProperties(iu).entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ request.setInstallableUnitProfileProperty(iu, entry.getKey(), entry.getValue());
}
}
// updates
- for (Iterator iterator = iusToUpdate.iterator(); iterator.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) iterator.next();
- Map propertiesToSet = new HashMap(target.getInstallableUnitProperties(iu));
- for (Iterator it = current.getInstallableUnitProperties(iu).entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String key = (String) entry.getKey();
- String newValue = (String) propertiesToSet.get(key);
+ for (Iterator<IInstallableUnit> iterator = iusToUpdate.iterator(); iterator.hasNext();) {
+ IInstallableUnit iu = iterator.next();
+ Map<String, String> propertiesToSet = new HashMap<String, String>(target.getInstallableUnitProperties(iu));
+ for (Iterator<Entry<String, String>> it = current.getInstallableUnitProperties(iu).entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ String key = entry.getKey();
+ String newValue = propertiesToSet.get(key);
if (newValue == null) {
request.removeInstallableUnitProfileProperty(iu, key);
} else if (newValue.equals(entry.getValue()))
propertiesToSet.remove(key);
}
- for (Iterator it = propertiesToSet.entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- request.setInstallableUnitProfileProperty(iu, key, value);
+ for (Iterator<Entry<String, String>> it = propertiesToSet.entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ request.setInstallableUnitProfileProperty(iu, entry.getKey(), entry.getValue());
}
}
}
@@ -82,34 +78,32 @@ public class FormerState {
IInstallableUnit[] targetPlannerMarkedIUs = SimplePlanner.findPlannerMarkedIUs(target);
//additions
- List markedIUsToAdd = new ArrayList(Arrays.asList(targetPlannerMarkedIUs));
+ List<IInstallableUnit> markedIUsToAdd = new ArrayList<IInstallableUnit>(Arrays.asList(targetPlannerMarkedIUs));
markedIUsToAdd.removeAll(Arrays.asList(currentPlannerMarkedIUs));
- request.addInstallableUnits((IInstallableUnit[]) markedIUsToAdd.toArray(new IInstallableUnit[markedIUsToAdd.size()]));
+ request.addInstallableUnits(markedIUsToAdd);
// removes
- List markedIUsToRemove = new ArrayList(Arrays.asList(currentPlannerMarkedIUs));
+ List<IInstallableUnit> markedIUsToRemove = new ArrayList<IInstallableUnit>(Arrays.asList(currentPlannerMarkedIUs));
markedIUsToRemove.removeAll(Arrays.asList(targetPlannerMarkedIUs));
- request.removeInstallableUnits((IInstallableUnit[]) markedIUsToRemove.toArray(new IInstallableUnit[markedIUsToRemove.size()]));
+ request.removeInstallableUnits(markedIUsToRemove);
}
private static void synchronizeProfileProperties(ProfileChangeRequest request, IProfile current, IProfile target) {
- Map profilePropertiesToSet = new HashMap(target.getProperties());
- for (Iterator it = current.getProperties().entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String key = (String) entry.getKey();
+ Map<String, String> profilePropertiesToSet = new HashMap<String, String>(target.getProperties());
+ for (Iterator<Entry<String, String>> it = current.getProperties().entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ String key = entry.getKey();
- String newValue = (String) profilePropertiesToSet.get(key);
+ String newValue = profilePropertiesToSet.get(key);
if (newValue == null) {
request.removeProfileProperty(key);
} else if (newValue.equals(entry.getValue()))
profilePropertiesToSet.remove(key);
}
- for (Iterator it = profilePropertiesToSet.entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- request.setProfileProperty(key, value);
+ for (Iterator<Entry<String, String>> it = profilePropertiesToSet.entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ request.setProfileProperty(entry.getKey(), entry.getValue());
}
}
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/ProfileChangeRequest.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/ProfileChangeRequest.java
index 59e22ee61..326ac1f51 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/ProfileChangeRequest.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/ProfileChangeRequest.java
@@ -11,6 +11,7 @@
package org.eclipse.equinox.internal.provisional.p2.director;
import java.util.*;
+import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.director.*;
import org.eclipse.equinox.p2.engine.IProfile;
@@ -21,12 +22,12 @@ import org.eclipse.equinox.p2.metadata.query.IQueryResult;
public class ProfileChangeRequest implements Cloneable {
private final IProfile profile;
- private ArrayList iusToRemove = null; // list of ius to remove
- private ArrayList iusToAdd = null; // list of ius to add
- private ArrayList propertiesToRemove = null; // list of keys for properties to be removed
- private HashMap propertiesToAdd = null; // map of key->value for properties to be added
- private HashMap iuPropertiesToAdd = null; // map iu->map of key->value pairs for properties to be added for an iu
- private HashMap iuPropertiesToRemove = null; // map of iu->list of property keys to be removed for an iu
+ private ArrayList<IInstallableUnit> iusToRemove = null; // list of ius to remove
+ private ArrayList<IInstallableUnit> iusToAdd = null; // list of ius to add
+ private ArrayList<String> propertiesToRemove = null; // list of keys for properties to be removed
+ private HashMap<String, String> propertiesToAdd = null; // map of key->value for properties to be added
+ private HashMap<IInstallableUnit, Map<String, String>> iuPropertiesToAdd = null; // map iu->map of key->value pairs for properties to be added for an iu
+ private HashMap<IInstallableUnit, List<String>> iuPropertiesToRemove = null; // map of iu->list of property keys to be removed for an iu
private boolean isAbsolute = false; //Indicate whether or not the request is an absolute one
public static ProfileChangeRequest createByProfileId(String profileId) {
@@ -49,10 +50,10 @@ public class ProfileChangeRequest implements Cloneable {
return profile;
}
- public Map getProfileProperties() {
- Map result = new HashMap(profile.getProperties());
+ public Map<String, String> getProfileProperties() {
+ Map<String, String> result = new HashMap<String, String>(profile.getProperties());
if (propertiesToRemove != null) {
- for (Iterator it = propertiesToRemove.iterator(); it.hasNext();) {
+ for (Iterator<String> it = propertiesToRemove.iterator(); it.hasNext();) {
result.remove(it.next());
}
}
@@ -64,13 +65,18 @@ public class ProfileChangeRequest implements Cloneable {
public void addInstallableUnit(IInstallableUnit toInstall) {
if (iusToAdd == null)
- iusToAdd = new ArrayList();
+ iusToAdd = new ArrayList<IInstallableUnit>();
iusToAdd.add(toInstall);
}
- public void addInstallableUnits(IQueryResult toInstall) {
- for (Iterator itor = toInstall.iterator(); itor.hasNext();)
- addInstallableUnit((IInstallableUnit) itor.next());
+ public void addInstallableUnits(Collection<IInstallableUnit> toInstall) {
+ for (Iterator<IInstallableUnit> itor = toInstall.iterator(); itor.hasNext();)
+ addInstallableUnit(itor.next());
+ }
+
+ public void addInstallableUnits(IQueryResult<IInstallableUnit> toInstall) {
+ for (Iterator<IInstallableUnit> itor = toInstall.iterator(); itor.hasNext();)
+ addInstallableUnit(itor.next());
}
public void addInstallableUnits(IInstallableUnit[] toInstall) {
@@ -80,7 +86,7 @@ public class ProfileChangeRequest implements Cloneable {
public void removeInstallableUnit(IInstallableUnit toUninstall) {
if (iusToRemove == null)
- iusToRemove = new ArrayList();
+ iusToRemove = new ArrayList<IInstallableUnit>();
iusToRemove.add(toUninstall);
}
@@ -89,29 +95,34 @@ public class ProfileChangeRequest implements Cloneable {
removeInstallableUnit(toUninstall[i]);
}
- public void removeInstallableUnits(IQueryResult toUninstall) {
- for (Iterator itor = toUninstall.iterator(); itor.hasNext();)
- removeInstallableUnit((IInstallableUnit) itor.next());
+ public void removeInstallableUnits(Collection<IInstallableUnit> toUninstall) {
+ for (Iterator<IInstallableUnit> itor = toUninstall.iterator(); itor.hasNext();)
+ removeInstallableUnit(itor.next());
+ }
+
+ public void removeInstallableUnits(IQueryResult<IInstallableUnit> toUninstall) {
+ for (Iterator<IInstallableUnit> itor = toUninstall.iterator(); itor.hasNext();)
+ removeInstallableUnit(itor.next());
}
- public void setProfileProperty(String key, Object value) {
+ public void setProfileProperty(String key, String value) {
if (propertiesToAdd == null)
- propertiesToAdd = new HashMap();
+ propertiesToAdd = new HashMap<String, String>();
propertiesToAdd.put(key, value);
}
public void removeProfileProperty(String key) {
if (propertiesToRemove == null)
- propertiesToRemove = new ArrayList(1);
+ propertiesToRemove = new ArrayList<String>(1);
propertiesToRemove.add(key);
}
- public void setInstallableUnitProfileProperty(IInstallableUnit iu, String key, Object value) {
+ public void setInstallableUnitProfileProperty(IInstallableUnit iu, String key, String value) {
if (iuPropertiesToAdd == null)
- iuPropertiesToAdd = new HashMap();
- Map properties = (Map) iuPropertiesToAdd.get(iu);
+ iuPropertiesToAdd = new HashMap<IInstallableUnit, Map<String, String>>();
+ Map<String, String> properties = iuPropertiesToAdd.get(iu);
if (properties == null) {
- properties = new HashMap();
+ properties = new HashMap<String, String>();
iuPropertiesToAdd.put(iu, properties);
}
properties.put(key, value);
@@ -119,10 +130,10 @@ public class ProfileChangeRequest implements Cloneable {
public void removeInstallableUnitProfileProperty(IInstallableUnit iu, String key) {
if (iuPropertiesToRemove == null)
- iuPropertiesToRemove = new HashMap();
- List keys = (List) iuPropertiesToRemove.get(iu);
+ iuPropertiesToRemove = new HashMap<IInstallableUnit, List<String>>();
+ List<String> keys = iuPropertiesToRemove.get(iu);
if (keys == null) {
- keys = new ArrayList();
+ keys = new ArrayList<String>();
iuPropertiesToRemove.put(iu, keys);
}
keys.add(key);
@@ -131,64 +142,50 @@ public class ProfileChangeRequest implements Cloneable {
public IInstallableUnit[] getRemovedInstallableUnits() {
if (iusToRemove == null)
return new IInstallableUnit[0];
- return (IInstallableUnit[]) iusToRemove.toArray(new IInstallableUnit[iusToRemove.size()]);
+ return iusToRemove.toArray(new IInstallableUnit[iusToRemove.size()]);
}
public IInstallableUnit[] getAddedInstallableUnits() {
if (iusToAdd == null)
return new IInstallableUnit[0];
- return (IInstallableUnit[]) iusToAdd.toArray(new IInstallableUnit[iusToAdd.size()]);
+ return iusToAdd.toArray(new IInstallableUnit[iusToAdd.size()]);
}
// String [key, key, key] names of properties to remove
public String[] getPropertiesToRemove() {
if (propertiesToRemove == null)
return new String[0];
- return (String[]) propertiesToRemove.toArray(new String[propertiesToRemove.size()]);
+ return propertiesToRemove.toArray(new String[propertiesToRemove.size()]);
}
// map of key value pairs
- public Map getPropertiesToAdd() {
+ public Map<String, String> getPropertiesToAdd() {
if (propertiesToAdd == null)
- return Collections.EMPTY_MAP;
+ return CollectionUtils.emptyMap();
return propertiesToAdd;
}
// map of iu->list of property keys to be removed for an iu
- public Map getInstallableUnitProfilePropertiesToRemove() {
+ public Map<IInstallableUnit, List<String>> getInstallableUnitProfilePropertiesToRemove() {
if (iuPropertiesToRemove == null)
- return Collections.EMPTY_MAP;
+ return CollectionUtils.emptyMap();
return iuPropertiesToRemove;
}
// TODO This can be represented and returned in whatever way makes most sense for planner/engine
// map iu->map of key->value pairs for properties to be added for an iu
- public Map getInstallableUnitProfilePropertiesToAdd() {
+ public Map<IInstallableUnit, Map<String, String>> getInstallableUnitProfilePropertiesToAdd() {
if (iuPropertiesToAdd == null)
- return Collections.EMPTY_MAP;
+ return CollectionUtils.emptyMap();
return iuPropertiesToAdd;
}
public void setInstallableUnitInclusionRules(IInstallableUnit iu, String value) {
- if (iuPropertiesToAdd == null)
- iuPropertiesToAdd = new HashMap();
- Map properties = (Map) iuPropertiesToAdd.get(iu);
- if (properties == null) {
- properties = new HashMap();
- iuPropertiesToAdd.put(iu, properties);
- }
- properties.put(SimplePlanner.INCLUSION_RULES, value);
+ setInstallableUnitProfileProperty(iu, SimplePlanner.INCLUSION_RULES, value);
}
public void removeInstallableUnitInclusionRules(IInstallableUnit iu) {
- if (iuPropertiesToRemove == null)
- iuPropertiesToRemove = new HashMap();
- List keys = (List) iuPropertiesToRemove.get(iu);
- if (keys == null) {
- keys = new ArrayList();
- iuPropertiesToRemove.put(iu, keys);
- }
- keys.add(SimplePlanner.INCLUSION_RULES);
+ removeInstallableUnitProfileProperty(iu, SimplePlanner.INCLUSION_RULES);
}
public void setAbsoluteMode(boolean absolute) {
@@ -199,32 +196,33 @@ public class ProfileChangeRequest implements Cloneable {
return isAbsolute;
}
+ @SuppressWarnings("unchecked")
public Object clone() {
ProfileChangeRequest result = new ProfileChangeRequest(profile);
- result.iusToRemove = iusToRemove == null ? null : (ArrayList) iusToRemove.clone();
- result.iusToAdd = iusToAdd == null ? null : (ArrayList) iusToAdd.clone();
- result.propertiesToRemove = propertiesToRemove == null ? null : (ArrayList) propertiesToRemove.clone();
- result.propertiesToAdd = propertiesToAdd == null ? null : (HashMap) propertiesToAdd.clone();
- result.iuPropertiesToAdd = iuPropertiesToAdd == null ? null : (HashMap) iuPropertiesToAdd.clone();
- result.iuPropertiesToRemove = iuPropertiesToRemove == null ? null : (HashMap) iuPropertiesToRemove.clone();
+ result.iusToRemove = iusToRemove == null ? null : (ArrayList<IInstallableUnit>) iusToRemove.clone();
+ result.iusToAdd = iusToAdd == null ? null : (ArrayList<IInstallableUnit>) iusToAdd.clone();
+ result.propertiesToRemove = propertiesToRemove == null ? null : (ArrayList<String>) propertiesToRemove.clone();
+ result.propertiesToAdd = propertiesToAdd == null ? null : (HashMap<String, String>) propertiesToAdd.clone();
+ result.iuPropertiesToAdd = iuPropertiesToAdd == null ? null : (HashMap<IInstallableUnit, Map<String, String>>) iuPropertiesToAdd.clone();
+ result.iuPropertiesToRemove = iuPropertiesToRemove == null ? null : (HashMap<IInstallableUnit, List<String>>) iuPropertiesToRemove.clone();
return result;
}
public String toString() {
StringBuffer result = new StringBuffer(1000);
- result.append("==Profile change request for ");
+ result.append("==Profile change request for "); //$NON-NLS-1$
result.append(profile.getProfileId());
result.append('\n');
- result.append("==Additions==");
+ result.append("==Additions=="); //$NON-NLS-1$
result.append('\n');
- for (Iterator iterator = iusToAdd.iterator(); iterator.hasNext();) {
+ for (Iterator<IInstallableUnit> iterator = iusToAdd.iterator(); iterator.hasNext();) {
result.append('\t');
result.append(iterator.next());
result.append('\n');
}
- result.append("==Removals==");
+ result.append("==Removals=="); //$NON-NLS-1$
result.append('\n');
- for (Iterator iterator = iusToRemove.iterator(); iterator.hasNext();) {
+ for (Iterator<IInstallableUnit> iterator = iusToRemove.iterator(); iterator.hasNext();) {
result.append('\t');
result.append(iterator.next());
result.append('\n');
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/RequestStatus.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/RequestStatus.java
index aae66f0e1..b1f6796b7 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/RequestStatus.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/provisional/p2/director/RequestStatus.java
@@ -23,21 +23,21 @@ public class RequestStatus extends Status {
private byte initialRequestType;
private IInstallableUnit iu;
- private Set explanation;
+ private Set<Explanation> explanation;
private Explanation detailedExplanation;
- private Set conflictingRootIUs;
- private Set conflictingInstalledIUs;
+ private Set<IInstallableUnit> conflictingRootIUs;
+ private Set<IInstallableUnit> conflictingInstalledIUs;
- public RequestStatus(IInstallableUnit iu, byte initialRequesType, int severity, Set explanation) {
+ public RequestStatus(IInstallableUnit iu, byte initialRequesType, int severity, Set<Explanation> explanation) {
super(severity, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.RequestStatus_message, iu));
this.iu = iu;
this.initialRequestType = initialRequesType;
this.explanation = explanation;
- conflictingRootIUs = new HashSet();
- conflictingInstalledIUs = new HashSet();
+ conflictingRootIUs = new HashSet<IInstallableUnit>();
+ conflictingInstalledIUs = new HashSet<IInstallableUnit>();
if (explanation != null) {
- Iterator iterator = explanation.iterator();
- Object o = null;
+ Iterator<Explanation> iterator = explanation.iterator();
+ Explanation o = null;
while (iterator.hasNext() && ((o = iterator.next()) instanceof Explanation.IUToInstall)) {
conflictingRootIUs.add(((IUToInstall) o).iu);
}
@@ -47,7 +47,7 @@ public class RequestStatus extends Status {
conflictingInstalledIUs.add(((IUInstalled) o).iu);
}
}
- detailedExplanation = (Explanation) o;
+ detailedExplanation = o;
}
}
@@ -61,18 +61,18 @@ public class RequestStatus extends Status {
//Return the already installed roots with which this IU is in conflict
//Return an empty set if there is no conflict
- public Set getConflictsWithInstalledRoots() {
+ public Set<IInstallableUnit> getConflictsWithInstalledRoots() {
return conflictingRootIUs;
}
//Return the already installed roots with which this IU is in conflict
//Return an empty set if there is no conflict
- public Set getConflictsWithAnyRoots() {
+ public Set<IInstallableUnit> getConflictsWithAnyRoots() {
return conflictingInstalledIUs;
}
//Return an explanation as to why this IU can not be resolved.
- public Set getExplanations() {
+ public Set<Explanation> getExplanations() {
//To start with, this does not have to return the most specific explanation. If it simply returns an global explanation it is good enough.
return explanation;
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/.classpath b/bundles/org.eclipse.equinox.p2.directorywatcher/.classpath
index 6f3b481ac..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/.classpath
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.directorywatcher/.settings/org.eclipse.jdt.core.prefs
index b94ca9b4f..40e23ea57 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/.settings/org.eclipse.jdt.core.prefs
@@ -1,329 +1,329 @@
-#Thu Oct 09 08:15:15 EDT 2008
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+#Wed Dec 23 00:33:28 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
+org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.compiler.problem.discouragedReference=error
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=800
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF
index caa1ac7be..3c59fea54 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF
@@ -26,8 +26,9 @@ Import-Package: org.eclipse.equinox.internal.p2.artifact.repository.simple,
org.eclipse.osgi.util,
org.osgi.framework;version="1.4.0",
org.osgi.service.packageadmin;version="1.2.0"
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
Export-Package: org.eclipse.equinox.internal.provisional.p2.directorywatcher;x-friends:="org.eclipse.equinox.p2.reconciler.dropins,org.eclipse.equinox.p2.extensionlocation"
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.3.0,4.0)"
Bundle-Activator: org.eclipse.equinox.internal.provisional.p2.directorywatcher.Activator
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/build.properties b/bundles/org.eclipse.equinox.p2.directorywatcher/build.properties
index dc77b9c16..ca5030900 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/build.properties
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/build.properties
@@ -15,3 +15,5 @@ bin.includes = META-INF/,\
about.html,\
plugin.properties
src.includes = about.html
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
index 962404da7..f5ee63a7c 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
@@ -14,8 +14,9 @@ import java.io.OutputStream;
import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
-import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.MappedCollectionIterator;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.CompoundQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.FlatteningIterator;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
@@ -26,10 +27,10 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
private static final String NULL = ""; //$NON-NLS-1$
private IArtifactRepository innerRepo;
- private Set descriptorsToAdd = new HashSet();
- private Map artifactMap = new HashMap();
- private Set descriptorsToRemove = new HashSet();
- private Map propertyChanges = new HashMap();
+ private Set<IArtifactDescriptor> descriptorsToAdd = new HashSet<IArtifactDescriptor>();
+ private Map<IArtifactKey, List<IArtifactDescriptor>> artifactMap = new HashMap<IArtifactKey, List<IArtifactDescriptor>>();
+ private Set<IArtifactDescriptor> descriptorsToRemove = new HashSet<IArtifactDescriptor>();
+ private Map<String, String> propertyChanges = new HashMap<String, String>();
protected CachingArtifactRepository(IArtifactRepository innerRepo) {
this.innerRepo = innerRepo;
@@ -42,23 +43,23 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
private void saveRemovals() {
- for (Iterator i = descriptorsToRemove.iterator(); i.hasNext();)
- innerRepo.removeDescriptor((IArtifactDescriptor) i.next());
+ for (Iterator<IArtifactDescriptor> i = descriptorsToRemove.iterator(); i.hasNext();)
+ innerRepo.removeDescriptor(i.next());
descriptorsToRemove.clear();
}
private void saveAdditions() {
if (descriptorsToAdd.isEmpty())
return;
- innerRepo.addDescriptors((IArtifactDescriptor[]) descriptorsToAdd.toArray(new IArtifactDescriptor[descriptorsToAdd.size()]));
+ innerRepo.addDescriptors(descriptorsToAdd.toArray(new IArtifactDescriptor[descriptorsToAdd.size()]));
descriptorsToAdd.clear();
artifactMap.clear();
}
private void savePropertyChanges() {
- for (Iterator i = propertyChanges.keySet().iterator(); i.hasNext();) {
- String key = (String) i.next();
- String value = (String) propertyChanges.get(key);
+ for (Iterator<String> i = propertyChanges.keySet().iterator(); i.hasNext();) {
+ String key = i.next();
+ String value = propertyChanges.get(key);
innerRepo.setProperty(key, value == NULL ? null : value);
}
propertyChanges.clear();
@@ -66,9 +67,9 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
private void mapDescriptor(IArtifactDescriptor descriptor) {
IArtifactKey key = descriptor.getArtifactKey();
- Collection descriptors = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> descriptors = artifactMap.get(key);
if (descriptors == null) {
- descriptors = new ArrayList();
+ descriptors = new ArrayList<IArtifactDescriptor>();
artifactMap.put(key, descriptors);
}
descriptors.add(descriptor);
@@ -76,7 +77,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
private void unmapDescriptor(IArtifactDescriptor descriptor) {
IArtifactKey key = descriptor.getArtifactKey();
- Collection descriptors = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> descriptors = artifactMap.get(key);
if (descriptors == null) {
// we do not have the descriptor locally so remember it to be removed from
// the inner repo on save.
@@ -104,11 +105,12 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
- Collection result = (Collection) artifactMap.get(key);
+ List<IArtifactDescriptor> result = artifactMap.get(key);
if (result == null)
return innerRepo.getArtifactDescriptors(key);
+ result = new ArrayList<IArtifactDescriptor>(result);
result.addAll(Arrays.asList(innerRepo.getArtifactDescriptors(key)));
- return (IArtifactDescriptor[]) result.toArray(new IArtifactDescriptor[result.size()]);
+ return result.toArray(new IArtifactDescriptor[result.size()]);
}
public synchronized boolean contains(IArtifactDescriptor descriptor) {
@@ -136,7 +138,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
public synchronized void removeAll() {
- IArtifactDescriptor[] toRemove = (IArtifactDescriptor[]) descriptorsToAdd.toArray(new IArtifactDescriptor[descriptorsToAdd.size()]);
+ IArtifactDescriptor[] toRemove = descriptorsToAdd.toArray(new IArtifactDescriptor[descriptorsToAdd.size()]);
for (int i = 0; i < toRemove.length; i++)
doRemoveArtifact(toRemove[i]);
}
@@ -177,7 +179,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
return innerRepo.getName();
}
- public Map getProperties() {
+ public Map<String, String> getProperties() {
// TODO need to combine the local and inner properties
return innerRepo.getProperties();
}
@@ -207,7 +209,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
public String setProperty(String key, String value) {
- String result = (String) getProperties().get(key);
+ String result = getProperties().get(key);
propertyChanges.put(key, value == null ? NULL : value);
return result;
}
@@ -216,6 +218,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
innerRepo.setProvider(provider);
}
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return innerRepo.getAdapter(adapter);
}
@@ -236,23 +239,29 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
return innerRepo.createArtifactDescriptor(key);
}
- public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
- if (monitor != null && monitor.isCanceled())
- return Collector.EMPTY_COLLECTOR;
+ public IQueryable<IArtifactDescriptor> descriptorQueryable() {
+ final Collection<List<IArtifactDescriptor>> descs = artifactMap.values();
+ IQueryable<IArtifactDescriptor> cached = new IQueryable<IArtifactDescriptor>() {
+ public IQueryResult<IArtifactDescriptor> query(IQuery<IArtifactDescriptor> query, IProgressMonitor monitor) {
+ return query.perform(new FlatteningIterator<IArtifactDescriptor>(descs.iterator()));
+ }
+ };
- final boolean excludeKeys = Boolean.TRUE.equals(query.getProperty(IArtifactRepository.QUERY_EXCLUDE_KEYS));
- final boolean excludeDescriptors = Boolean.TRUE.equals(query.getProperty(IArtifactRepository.QUERY_EXCLUDE_DESCRIPTORS));
- if (excludeKeys && excludeDescriptors)
- return Collector.EMPTY_COLLECTOR;
+ @SuppressWarnings("unchecked")
+ CompoundQueryable<IArtifactDescriptor> compound = new CompoundQueryable<IArtifactDescriptor>(new IQueryable[] {cached, innerRepo.descriptorQueryable()});
+ return compound;
+ }
- IQueryable cached = new IQueryable() {
- public IQueryResult query(IQuery query, IProgressMonitor monitor) {
- Iterator i = !excludeDescriptors ? new MappedCollectionIterator(artifactMap, !excludeKeys) : artifactMap.keySet().iterator();
- return query.perform(i);
+ public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
+ final Iterator<IArtifactKey> keyIterator = artifactMap.keySet().iterator();
+ IQueryable<IArtifactKey> cached = new IQueryable<IArtifactKey>() {
+ public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> q, IProgressMonitor mon) {
+ return q.perform(keyIterator);
}
};
- CompoundQueryable compound = new CompoundQueryable(new IQueryable[] {cached, innerRepo});
+ @SuppressWarnings("unchecked")
+ CompoundQueryable<IArtifactKey> compound = new CompoundQueryable<IArtifactKey>(new IQueryable[] {cached, innerRepo});
return compound.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/DirectoryWatcher.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/DirectoryWatcher.java
index dea2d358d..11ed47fd6 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/DirectoryWatcher.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/DirectoryWatcher.java
@@ -62,14 +62,14 @@ public class DirectoryWatcher {
final File[] directories;
long poll = 2000;
- private Set listeners = new HashSet();
- private HashSet scannedFiles = new HashSet();
- private HashSet removals;
- private Set pendingDeletions;
+ private Set<DirectoryChangeListener> listeners = new HashSet<DirectoryChangeListener>();
+ private HashSet<File> scannedFiles = new HashSet<File>();
+ private HashSet<File> removals;
+ private Set<File> pendingDeletions;
private WatcherThread watcher;
- public DirectoryWatcher(Dictionary properties, BundleContext context) {
- String dir = (String) properties.get(DIR);
+ public DirectoryWatcher(Map<String, String> properties, BundleContext context) {
+ String dir = properties.get(DIR);
if (dir == null)
dir = "./load"; //$NON-NLS-1$
@@ -131,10 +131,10 @@ public class DirectoryWatcher {
private void startPoll() {
removals = scannedFiles;
- scannedFiles = new HashSet();
- pendingDeletions = new HashSet();
- for (Iterator i = listeners.iterator(); i.hasNext();)
- ((DirectoryChangeListener) i.next()).startPoll();
+ scannedFiles = new HashSet<File>();
+ pendingDeletions = new HashSet<File>();
+ for (Iterator<DirectoryChangeListener> i = listeners.iterator(); i.hasNext();)
+ i.next().startPoll();
}
private void scanDirectories() {
@@ -155,8 +155,8 @@ public class DirectoryWatcher {
// removed at the end. Then notify all the listeners as needed.
scannedFiles.add(file);
removals.remove(file);
- for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
- DirectoryChangeListener listener = (DirectoryChangeListener) iterator.next();
+ for (Iterator<DirectoryChangeListener> iterator = listeners.iterator(); iterator.hasNext();) {
+ DirectoryChangeListener listener = iterator.next();
if (isInterested(listener, file))
processFile(file, listener);
}
@@ -168,8 +168,8 @@ public class DirectoryWatcher {
private void stopPoll() {
notifyRemovals();
removals = scannedFiles;
- for (Iterator i = listeners.iterator(); i.hasNext();)
- ((DirectoryChangeListener) i.next()).stopPoll();
+ for (Iterator<DirectoryChangeListener> i = listeners.iterator(); i.hasNext();)
+ i.next().stopPoll();
processPendingDeletions();
}
@@ -181,11 +181,11 @@ public class DirectoryWatcher {
* Notify the listeners of the files that have been deleted or marked for deletion.
*/
private void notifyRemovals() {
- Set removed = removals;
- for (Iterator i = listeners.iterator(); i.hasNext();) {
- DirectoryChangeListener listener = (DirectoryChangeListener) i.next();
- for (Iterator j = removed.iterator(); j.hasNext();) {
- File file = (File) j.next();
+ Set<File> removed = removals;
+ for (Iterator<DirectoryChangeListener> i = listeners.iterator(); i.hasNext();) {
+ DirectoryChangeListener listener = i.next();
+ for (Iterator<File> j = removed.iterator(); j.hasNext();) {
+ File file = j.next();
if (isInterested(listener, file))
listener.removed(file);
}
@@ -213,8 +213,8 @@ public class DirectoryWatcher {
* Try to remove the files that have been marked for deletion.
*/
private void processPendingDeletions() {
- for (Iterator iterator = pendingDeletions.iterator(); iterator.hasNext();) {
- File file = (File) iterator.next();
+ for (Iterator<File> iterator = pendingDeletions.iterator(); iterator.hasNext();) {
+ File file = iterator.next();
if (!file.exists() || file.delete())
iterator.remove();
new File(file.getPath() + DEL_EXT).delete();
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
index 05a6bf948..8e1fba54c 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/EntryAdvice.java
@@ -12,8 +12,8 @@ package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
import java.io.File;
import java.net.URI;
+import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
@@ -27,8 +27,8 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
* only one entry at a time and that entry is the the only entry being published.
*/
public class EntryAdvice implements IPropertyAdvice {
- private Properties metadataProps = new Properties();
- private Properties artifactProps = new Properties();
+ private Map<String, String> metadataProps = new HashMap<String, String>();
+ private Map<String, String> artifactProps = new HashMap<String, String>();
public boolean isApplicable(String configSpec, boolean includeDefault, String id, Version version) {
return true;
@@ -42,27 +42,23 @@ public class EntryAdvice implements IPropertyAdvice {
if (reference == null)
artifactProps.remove(RepositoryListener.ARTIFACT_REFERENCE);
else
- artifactProps.setProperty(RepositoryListener.ARTIFACT_REFERENCE, reference.toString());
+ artifactProps.put(RepositoryListener.ARTIFACT_REFERENCE, reference.toString());
if (location.isDirectory())
- artifactProps.setProperty(RepositoryListener.ARTIFACT_FOLDER, Boolean.TRUE.toString());
+ artifactProps.put(RepositoryListener.ARTIFACT_FOLDER, Boolean.TRUE.toString());
else
artifactProps.remove(RepositoryListener.ARTIFACT_FOLDER);
- artifactProps.setProperty(RepositoryListener.FILE_NAME, location.getAbsolutePath());
- metadataProps.setProperty(RepositoryListener.FILE_NAME, location.getAbsolutePath());
- metadataProps.setProperty(RepositoryListener.FILE_LAST_MODIFIED, Long.toString(timestamp));
+ artifactProps.put(RepositoryListener.FILE_NAME, location.getAbsolutePath());
+ metadataProps.put(RepositoryListener.FILE_NAME, location.getAbsolutePath());
+ metadataProps.put(RepositoryListener.FILE_LAST_MODIFIED, Long.toString(timestamp));
if (linkFile != null)
- metadataProps.setProperty(Site.PROP_LINK_FILE, linkFile);
+ metadataProps.put(Site.PROP_LINK_FILE, linkFile);
}
- public Map getInstructions(File location) {
- return null;
- }
-
- public Properties getArtifactProperties(IInstallableUnit iu, IArtifactDescriptor descriptor) {
+ public Map<String, String> getArtifactProperties(IInstallableUnit iu, IArtifactDescriptor descriptor) {
return artifactProps;
}
- public Properties getInstallableUnitProperties(InstallableUnitDescription iu) {
+ public Map<String, String> getInstallableUnitProperties(InstallableUnitDescription iu) {
return metadataProps;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index 2c7bc4a7c..c657c45b0 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -41,8 +41,8 @@ public class RepositoryListener extends DirectoryChangeListener {
private final CachingArtifactRepository artifactRepository;
// at any point in time currentFiles is the list of files/dirs that the watcher has seen and
// believes to be on disk.
- private final Map currentFiles = new HashMap();
- private final Collection polledSeenFiles = new HashSet();
+ private final Map<File, Long> currentFiles = new HashMap<File, Long>();
+ private final Collection<File> polledSeenFiles = new HashSet<File>();
private EntryAdvice advice = new EntryAdvice();
private PublisherInfo info;
@@ -89,7 +89,7 @@ public class RepositoryListener extends DirectoryChangeListener {
}
try {
String name = repositoryName;
- Map properties = new HashMap(1);
+ Map<String, String> properties = new HashMap<String, String>(1);
if (hidden) {
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
name = "artifact listener " + repositoryName; //$NON-NLS-1$
@@ -114,7 +114,7 @@ public class RepositoryListener extends DirectoryChangeListener {
}
try {
String name = repositoryName;
- Map properties = new HashMap(1);
+ Map<String, String> properties = new HashMap<String, String>(1);
if (hidden) {
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
name = "metadata listener " + repositoryName; //$NON-NLS-1$
@@ -163,7 +163,7 @@ public class RepositoryListener extends DirectoryChangeListener {
}
private boolean processFeature(File file, boolean isAddition) {
- String link = (String) metadataRepository.getProperties().get(Site.PROP_LINK_FILE);
+ String link = metadataRepository.getProperties().get(Site.PROP_LINK_FILE);
advice.setProperties(file, file.lastModified(), file.toURI(), link);
return publish(new FeaturesAction(new File[] {file}), isAddition);
}
@@ -178,7 +178,7 @@ public class RepositoryListener extends DirectoryChangeListener {
}
public Long getSeenFile(File file) {
- Long lastSeen = (Long) currentFiles.get(file);
+ Long lastSeen = currentFiles.get(file);
if (lastSeen != null)
polledSeenFiles.add(file);
return lastSeen;
@@ -191,7 +191,7 @@ public class RepositoryListener extends DirectoryChangeListener {
}
public void stopPoll() {
- final Set filesToRemove = new HashSet(currentFiles.keySet());
+ final Set<File> filesToRemove = new HashSet<File>(currentFiles.keySet());
filesToRemove.removeAll(polledSeenFiles);
polledSeenFiles.clear();
@@ -204,20 +204,17 @@ public class RepositoryListener extends DirectoryChangeListener {
/**
* Flush all the pending changes to the metadata repository.
*/
- private void synchronizeMetadataRepository(final Collection removedFiles) {
+ private void synchronizeMetadataRepository(final Collection<File> removedFiles) {
if (metadataRepository == null)
return;
- final Collection changes = iusToChange.getIUs(null, null);
+ final Collection<IInstallableUnit> changes = iusToChange.getIUs(null, null);
// first remove any IUs that have changed or that are associated with removed files
if (!removedFiles.isEmpty() || !changes.isEmpty()) {
- metadataRepository.removeInstallableUnits((IInstallableUnit[]) changes.toArray(new IInstallableUnit[changes.size()]), null);
+ metadataRepository.removeInstallableUnits(changes.toArray(new IInstallableUnit[changes.size()]), null);
// create a query that will identify all ius related to removed files
- IMatchQuery removeQuery = new MatchQuery() {
- public boolean isMatch(Object candidate) {
- if (!(candidate instanceof IInstallableUnit))
- return false;
- IInstallableUnit iu = (IInstallableUnit) candidate;
+ IMatchQuery<IInstallableUnit> removeQuery = new MatchQuery<IInstallableUnit>() {
+ public boolean isMatch(IInstallableUnit iu) {
String filename = iu.getProperty(FILE_NAME);
if (filename == null) {
String message = NLS.bind(Messages.filename_missing, "installable unit", iu.getId()); //$NON-NLS-1$
@@ -228,14 +225,14 @@ public class RepositoryListener extends DirectoryChangeListener {
return removedFiles.contains(iuFile);
}
};
- IQueryResult toRemove = metadataRepository.query(removeQuery, null);
- metadataRepository.removeInstallableUnits((IInstallableUnit[]) toRemove.toArray(IInstallableUnit.class), null);
+ IQueryResult<IInstallableUnit> toRemove = metadataRepository.query(removeQuery, null);
+ metadataRepository.removeInstallableUnits(toRemove.toArray(IInstallableUnit.class), null);
}
// Then add all the new IUs as well as the new copies of the ones that have changed
- Collection additions = iusToAdd.getIUs(null, null);
+ Collection<IInstallableUnit> additions = iusToAdd.getIUs(null, null);
additions.addAll(changes);
if (!additions.isEmpty())
- metadataRepository.addInstallableUnits((IInstallableUnit[]) additions.toArray(new IInstallableUnit[additions.size()]));
+ metadataRepository.addInstallableUnits(additions.toArray(new IInstallableUnit[additions.size()]));
}
/**
@@ -243,12 +240,12 @@ public class RepositoryListener extends DirectoryChangeListener {
* descriptors related to any file that has been removed and flush the repo
* to ensure that all the additions and removals have been completed.
*/
- private void synchronizeArtifactRepository(final Collection removedFiles) {
+ private void synchronizeArtifactRepository(final Collection<File> removedFiles) {
if (artifactRepository == null)
return;
if (!removedFiles.isEmpty()) {
- IQueryResult descriptors = artifactRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
- for (Iterator iterator = descriptors.iterator(); iterator.hasNext();) {
+ IQueryResult<IArtifactDescriptor> descriptors = artifactRepository.descriptorQueryable().query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ for (Iterator<IArtifactDescriptor> iterator = descriptors.iterator(); iterator.hasNext();) {
SimpleArtifactDescriptor descriptor = (SimpleArtifactDescriptor) iterator.next();
String filename = descriptor.getRepositoryProperty(FILE_NAME);
if (filename == null) {
@@ -271,9 +268,9 @@ public class RepositoryListener extends DirectoryChangeListener {
private void synchronizeCurrentFiles() {
currentFiles.clear();
if (metadataRepository != null) {
- IQueryResult ius = metadataRepository.query(InstallableUnitQuery.ANY, null);
- for (Iterator it = ius.iterator(); it.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) it.next();
+ IQueryResult<IInstallableUnit> ius = metadataRepository.query(InstallableUnitQuery.ANY, null);
+ for (Iterator<IInstallableUnit> it = ius.iterator(); it.hasNext();) {
+ IInstallableUnit iu = it.next();
String filename = iu.getProperty(FILE_NAME);
if (filename == null) {
String message = NLS.bind(Messages.filename_missing, "installable unit", iu.getId()); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.engine/.classpath b/bundles/org.eclipse.equinox.p2.engine/.classpath
index 2fbb7a23e..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.engine/.classpath
+++ b/bundles/org.eclipse.equinox.p2.engine/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs
index c98c987a2..3bc330a7d 100644
--- a/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.engine/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Fri Feb 22 09:19:01 EST 2008
+#Mon Dec 21 23:51:30 CET 2009
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
@@ -8,24 +8,24 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
@@ -72,7 +72,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
index 7e7dcba8b..3920af54a 100644
--- a/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.engine/META-INF/MANIFEST.MF
@@ -56,7 +56,8 @@ Import-Package: javax.xml.parsers,
Bundle-Activator: org.eclipse.equinox.internal.p2.engine.EngineActivator
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: org.eclipse.equinox.p2.metadata.repository
-Bundle-RequiredExecutionEnvironment: J2SE-1.4,
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
CDC-1.1/Foundation-1.1
Require-Bundle: org.eclipse.equinox.common,
org.eclipse.equinox.registry,
diff --git a/bundles/org.eclipse.equinox.p2.engine/build.properties b/bundles/org.eclipse.equinox.p2.engine/build.properties
index f55cc8399..c83017ced 100644
--- a/bundles/org.eclipse.equinox.p2.engine/build.properties
+++ b/bundles/org.eclipse.equinox.p2.engine/build.properties
@@ -19,3 +19,5 @@ bin.includes = META-INF/,\
src.includes = about.html,\
schema/
source.. = src/
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ActionManager.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ActionManager.java
index 7235ef15a..fdc23b04d 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ActionManager.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ActionManager.java
@@ -34,7 +34,7 @@ public class ActionManager implements IRegistryChangeListener {
*/
public static final String SERVICE_NAME = ActionManager.class.getName();
- private HashMap actionMap;
+ private HashMap<String, IConfigurationElement> actionMap;
private TouchpointManager touchpointManager;
public ActionManager() {
@@ -62,7 +62,7 @@ public class ActionManager implements IRegistryChangeListener {
}
public ProvisioningAction getAction(String actionId, VersionRange versionRange) {
- IConfigurationElement actionElement = (IConfigurationElement) getActionMap().get(actionId);
+ IConfigurationElement actionElement = getActionMap().get(actionId);
if (actionElement != null && actionElement.isValid()) {
try {
ProvisioningAction action = (ProvisioningAction) actionElement.createExecutableExtension(ATTRIBUTE_CLASS);
@@ -85,12 +85,12 @@ public class ActionManager implements IRegistryChangeListener {
return null;
}
- private synchronized Map getActionMap() {
+ private synchronized Map<String, IConfigurationElement> getActionMap() {
if (actionMap != null)
return actionMap;
IExtensionPoint point = RegistryFactory.getRegistry().getExtensionPoint(EngineActivator.ID, PT_ACTIONS);
IExtension[] extensions = point.getExtensions();
- actionMap = new HashMap(extensions.length);
+ actionMap = new HashMap<String, IConfigurationElement>(extensions.length);
for (int i = 0; i < extensions.length; i++) {
try {
IConfigurationElement[] elements = extensions[i].getConfigurationElements();
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DebugHelper.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DebugHelper.java
index 2eccc8150..ec9ebd502 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DebugHelper.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DebugHelper.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine;
-
import java.io.File;
import java.util.*;
import java.util.Map.Entry;
@@ -54,8 +53,8 @@ public class DebugHelper {
System.out.println(buffer.toString());
}
- public static String formatArray(Object[] array, boolean toString, boolean newLines) {
- if (array == null || array.length == 0)
+ public static String formatArray(List<? extends Object> array, boolean toString, boolean newLines) {
+ if (array == null || array.size() == 0)
return "[]"; //$NON-NLS-1$
StringBuffer buffer = new StringBuffer();
@@ -63,11 +62,11 @@ public class DebugHelper {
int i = 0;
for (;;) {
if (toString)
- buffer.append(array[i].toString());
+ buffer.append(array.get(i).toString());
else
- buffer.append(array[i].getClass().getName());
+ buffer.append(array.get(i).getClass().getName());
i++;
- if (i == array.length)
+ if (i == array.size())
break;
buffer.append(',');
if (newLines)
@@ -101,7 +100,7 @@ public class DebugHelper {
operandStrings[i] = operands[i].toString();
}
}
- return DebugHelper.formatArray(operandStrings, true, true);
+ return DebugHelper.formatArray(Arrays.asList(operandStrings), true, true);
}
public static String formatInstallableUnitOperand(InstallableUnitOperand iuOperand) {
@@ -118,19 +117,19 @@ public class DebugHelper {
public static String formatPhaseSet(PhaseSet phaseSet) {
StringBuffer buffer = new StringBuffer(phaseSet.getClass().getName());
- buffer.append(DebugHelper.formatArray(phaseSet.getPhases(), false, false));
+ buffer.append(DebugHelper.formatArray(Arrays.asList(phaseSet.getPhases()), false, false));
return buffer.toString();
}
public static String formatContext(ProvisioningContext context) {
StringBuffer buffer = new StringBuffer();
- buffer.append("{artifactRepos=" + DebugHelper.formatArray(context.getArtifactRepositories(), true, false)); //$NON-NLS-1$
- buffer.append(", metadataRepos=" + DebugHelper.formatArray(context.getMetadataRepositories(), true, false)); //$NON-NLS-1$
+ buffer.append("{artifactRepos=" + DebugHelper.formatArray(Arrays.asList(context.getArtifactRepositories()), true, false)); //$NON-NLS-1$
+ buffer.append(", metadataRepos=" + DebugHelper.formatArray(Arrays.asList(context.getMetadataRepositories()), true, false)); //$NON-NLS-1$
buffer.append(", properties=" + context.getProperties() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
return buffer.toString();
}
- public static String formatAction(ProvisioningAction action, Map parameters) {
+ public static String formatAction(ProvisioningAction action, Map<String, Object> parameters) {
StringBuffer buffer = new StringBuffer();
buffer.append(action.getClass().getName());
if (action instanceof ParameterizedProvisioningAction) {
@@ -143,16 +142,16 @@ public class DebugHelper {
return buffer.toString();
}
- public static String formatParameters(Map parameters) {
- Iterator it = parameters.entrySet().iterator();
+ public static String formatParameters(Map<String, ? extends Object> parameters) {
+ Iterator<? extends Entry<String, ? extends Object>> it = parameters.entrySet().iterator();
if (!it.hasNext())
return "{}"; //$NON-NLS-1$
StringBuffer buffer = new StringBuffer();
buffer.append('{');
for (;;) {
- Entry e = (Entry) it.next();
- String key = (String) e.getKey();
+ Entry<String, ? extends Object> e = it.next();
+ String key = e.getKey();
buffer.append(key);
buffer.append('=');
Object value = e.getValue();
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java
index 98b2cb6ba..ddecadf63 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java
@@ -21,21 +21,18 @@ import org.eclipse.equinox.p2.repository.artifact.*;
public class DownloadManager {
private ProvisioningContext provContext = null;
- ArrayList requestsToProcess = new ArrayList();
+ ArrayList<IArtifactRequest> requestsToProcess = new ArrayList<IArtifactRequest>();
private static final String FILE_PROTOCOL = "file"; //$NON-NLS-1$
/**
- * This Comparator sorts the repositories such that ┤local┤ repositories are first
+ * This Comparator sorts the repositories such that ´┐Żlocal´┐Ż repositories are first
*/
- private static final Comparator LOCAL_FIRST_COMPARATOR = new Comparator() {
+ private static final Comparator<URI> LOCAL_FIRST_COMPARATOR = new Comparator<URI>() {
- public int compare(Object arg0, Object arg1) {
- Assert.isTrue(arg0 instanceof URI);
- Assert.isTrue(arg1 instanceof URI);
-
- String protocol0 = ((URI) arg0).getScheme();
- String protocol1 = ((URI) arg1).getScheme();
+ public int compare(URI arg0, URI arg1) {
+ String protocol0 = arg0.getScheme();
+ String protocol1 = arg1.getScheme();
if (FILE_PROTOCOL.equals(protocol0) && !FILE_PROTOCOL.equals(protocol1))
return -1;
@@ -68,8 +65,8 @@ public class DownloadManager {
}
private void filterUnfetched() {
- for (Iterator iterator = requestsToProcess.iterator(); iterator.hasNext();) {
- IArtifactRequest request = (IArtifactRequest) iterator.next();
+ for (Iterator<IArtifactRequest> iterator = requestsToProcess.iterator(); iterator.hasNext();) {
+ IArtifactRequest request = iterator.next();
if (request.getResult() != null && request.getResult().isOK()) {
iterator.remove();
}
@@ -117,13 +114,13 @@ public class DownloadManager {
}
private IArtifactRequest[] getRequestsForRepository(IArtifactRepository repository) {
- ArrayList applicable = new ArrayList();
- for (Iterator it = requestsToProcess.iterator(); it.hasNext();) {
- IArtifactRequest request = (IArtifactRequest) it.next();
+ ArrayList<IArtifactRequest> applicable = new ArrayList<IArtifactRequest>();
+ for (Iterator<IArtifactRequest> it = requestsToProcess.iterator(); it.hasNext();) {
+ IArtifactRequest request = it.next();
if (repository.contains(request.getArtifactKey()))
applicable.add(request);
}
- return (IArtifactRequest[]) applicable.toArray(new IArtifactRequest[applicable.size()]);
+ return applicable.toArray(new IArtifactRequest[applicable.size()]);
}
// private void notifyFetched() {
@@ -139,8 +136,8 @@ public class DownloadManager {
return Status.OK_STATUS;
MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null);
- for (Iterator iterator = requestsToProcess.iterator(); iterator.hasNext();) {
- IStatus failed = ((IArtifactRequest) iterator.next()).getResult();
+ for (Iterator<IArtifactRequest> iterator = requestsToProcess.iterator(); iterator.hasNext();) {
+ IStatus failed = iterator.next().getResult();
if (failed != null && !failed.isOK())
result.add(failed);
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineSession.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineSession.java
index a67e0e2c4..aad0d1d27 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineSession.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineSession.java
@@ -29,28 +29,28 @@ public class EngineSession {
private static class ActionsRecord {
Operand operand;
- List actions = new ArrayList();
+ List<ProvisioningAction> actions = new ArrayList<ProvisioningAction>();
ActionsRecord(Operand operand) {
this.operand = operand;
}
}
- private List phaseActionRecordsPairs = new ArrayList();
+ private List<Object[]> phaseActionRecordsPairs = new ArrayList<Object[]>();
private Phase currentPhase;
boolean currentPhaseActive;
- private List currentActionRecords;
+ private List<ActionsRecord> currentActionRecords;
private ActionsRecord currentRecord;
private IProfile profile;
private ProvisioningContext context;
- private final HashMap sessionServices = new HashMap();
+ private final HashMap<String, Object> sessionServices = new HashMap<String, Object>();
- private Set touchpoints = new HashSet();
+ private Set<Touchpoint> touchpoints = new HashSet<Touchpoint>();
private final IProvisioningAgent agent;
@@ -93,8 +93,8 @@ public class EngineSession {
IStatus prepare(IProgressMonitor monitor) {
monitor.subTask(Messages.preparing);
MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null);
- for (Iterator iterator = touchpoints.iterator(); iterator.hasNext();) {
- Touchpoint touchpoint = (Touchpoint) iterator.next();
+ for (Iterator<Touchpoint> iterator = touchpoints.iterator(); iterator.hasNext();) {
+ Touchpoint touchpoint = iterator.next();
try {
status.add(touchpoint.prepare(profile));
} catch (RuntimeException e) {
@@ -119,8 +119,8 @@ public class EngineSession {
monitor.subTask(Messages.committing);
MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null);
phaseActionRecordsPairs.clear();
- for (Iterator iterator = touchpoints.iterator(); iterator.hasNext();) {
- Touchpoint touchpoint = (Touchpoint) iterator.next();
+ for (Iterator<Touchpoint> iterator = touchpoints.iterator(); iterator.hasNext();) {
+ Touchpoint touchpoint = iterator.next();
try {
IStatus result = touchpoint.commit(profile);
if (!result.isOK())
@@ -171,10 +171,11 @@ public class EngineSession {
}
currentPhase = null;
- for (ListIterator it = phaseActionRecordsPairs.listIterator(phaseActionRecordsPairs.size()); it.hasPrevious();) {
- Object[] pair = (Object[]) it.previous();
+ for (ListIterator<Object[]> it = phaseActionRecordsPairs.listIterator(phaseActionRecordsPairs.size()); it.hasPrevious();) {
+ Object[] pair = it.previous();
Phase phase = (Phase) pair[0];
- List actionRecords = (List) pair[1];
+ @SuppressWarnings("unchecked")
+ List<ActionsRecord> actionRecords = (List<ActionsRecord>) pair[1];
try {
final IStatus result = rollBackPhase(phase, actionRecords);
if (!result.isOK())
@@ -190,8 +191,8 @@ public class EngineSession {
}
phaseActionRecordsPairs.clear();
- for (Iterator iterator = touchpoints.iterator(); iterator.hasNext();) {
- Touchpoint touchpoint = (Touchpoint) iterator.next();
+ for (Iterator<Touchpoint> iterator = touchpoints.iterator(); iterator.hasNext();) {
+ Touchpoint touchpoint = iterator.next();
try {
IStatus result = touchpoint.rollback(profile);
if (!result.isOK())
@@ -214,7 +215,7 @@ public class EngineSession {
return status;
}
- private IStatus rollBackPhase(Phase phase, List actionRecords) {
+ private IStatus rollBackPhase(Phase phase, List<ActionsRecord> actionRecords) {
MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null);
try {
phase.actionManager = (ActionManager) agent.getService(ActionManager.SERVICE_NAME);
@@ -222,9 +223,9 @@ public class EngineSession {
if (!currentPhaseActive)
phase.prePerform(result, this, new NullProgressMonitor());
- for (ListIterator it = actionRecords.listIterator(actionRecords.size()); it.hasPrevious();) {
- ActionsRecord record = (ActionsRecord) it.previous();
- ProvisioningAction[] actions = (ProvisioningAction[]) record.actions.toArray(new ProvisioningAction[record.actions.size()]);
+ for (ListIterator<ActionsRecord> it = actionRecords.listIterator(actionRecords.size()); it.hasPrevious();) {
+ ActionsRecord record = it.previous();
+ ProvisioningAction[] actions = record.actions.toArray(new ProvisioningAction[record.actions.size()]);
try {
phase.undo(result, this, profile, record.operand, actions, context);
} catch (RuntimeException e) {
@@ -264,7 +265,7 @@ public class EngineSession {
throw new IllegalArgumentException(Messages.not_current_phase);
currentPhaseActive = true;
- currentActionRecords = new ArrayList();
+ currentActionRecords = new ArrayList<ActionsRecord>();
}
void recordPhaseEnd(Phase phase) {
@@ -318,7 +319,7 @@ public class EngineSession {
debugOperandEnd(operand);
}
- void recordActionExecute(ProvisioningAction action, Map parameters) {
+ void recordActionExecute(ProvisioningAction action, Map<String, Object> parameters) {
if (action == null)
throw new IllegalArgumentException(Messages.null_action);
@@ -332,7 +333,7 @@ public class EngineSession {
debugActionExecute(action, parameters);
}
- public void recordActionUndo(ProvisioningAction action, Map parameters) {
+ public void recordActionUndo(ProvisioningAction action, Map<String, Object> parameters) {
if (DebugHelper.DEBUG_ENGINE_SESSION)
debugActionUndo(action, parameters);
}
@@ -391,11 +392,11 @@ public class EngineSession {
DebugHelper.debug(ENGINE_SESSION, "Ending processing of operand: " + operand.toString()); //$NON-NLS-1$
}
- private static void debugActionExecute(ProvisioningAction action, Map parameters) {
+ private static void debugActionExecute(ProvisioningAction action, Map<String, Object> parameters) {
DebugHelper.debug(ENGINE_SESSION, "Executing action: " + DebugHelper.formatAction(action, parameters)); //$NON-NLS-1$
}
- private static void debugActionUndo(ProvisioningAction action, Map parameters) {
+ private static void debugActionUndo(ProvisioningAction action, Map<String, Object> parameters) {
DebugHelper.debug(ENGINE_SESSION, "Undoing action: " + DebugHelper.formatAction(action, parameters)); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java
index 46788b780..d8b5b1bfe 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java
@@ -13,6 +13,7 @@ package org.eclipse.equinox.internal.p2.engine;
import java.util.*;
import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.provisional.p2.metadata.ITouchpointData;
import org.eclipse.equinox.internal.provisional.p2.metadata.ITouchpointInstruction;
import org.eclipse.equinox.p2.engine.*;
@@ -33,12 +34,12 @@ public abstract class InstallableUnitPhase extends Phase {
this(phaseId, weight, false);
}
- protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map parameters) {
+ protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map<String, Object> parameters) {
parameters.put(PARM_INSTALL_FOLDER, profile.getProperty(IProfile.PROP_INSTALL_FOLDER));
return super.initializePhase(monitor, profile, parameters);
}
- protected IStatus initializeOperand(IProfile profile, Operand operand, Map parameters, IProgressMonitor monitor) {
+ protected IStatus initializeOperand(IProfile profile, Operand operand, Map<String, Object> parameters, IProgressMonitor monitor) {
InstallableUnitOperand iuOperand = (InstallableUnitOperand) operand;
MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null);
mergeStatus(status, initializeOperand(profile, iuOperand, parameters, monitor));
@@ -53,11 +54,11 @@ public abstract class InstallableUnitPhase extends Phase {
return status;
}
- protected IStatus initializeOperand(IProfile profile, InstallableUnitOperand operand, Map parameters, IProgressMonitor monitor) {
+ protected IStatus initializeOperand(IProfile profile, InstallableUnitOperand operand, Map<String, Object> parameters, IProgressMonitor monitor) {
return Status.OK_STATUS;
}
- protected IStatus completeOperand(IProfile profile, Operand operand, Map parameters, IProgressMonitor monitor) {
+ protected IStatus completeOperand(IProfile profile, Operand operand, Map<String, Object> parameters, IProgressMonitor monitor) {
InstallableUnitOperand iuOperand = (InstallableUnitOperand) operand;
MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null);
@@ -66,11 +67,11 @@ public abstract class InstallableUnitPhase extends Phase {
return status;
}
- protected IStatus completeOperand(IProfile profile, InstallableUnitOperand operand, Map parameters, IProgressMonitor monitor) {
+ protected IStatus completeOperand(IProfile profile, InstallableUnitOperand operand, Map<String, Object> parameters, IProgressMonitor monitor) {
return Status.OK_STATUS;
}
- final protected ProvisioningAction[] getActions(Operand operand) {
+ final protected List<ProvisioningAction> getActions(Operand operand) {
if (!(operand instanceof InstallableUnitOperand))
return null;
@@ -78,7 +79,7 @@ public abstract class InstallableUnitPhase extends Phase {
return getActions(iuOperand);
}
- protected abstract ProvisioningAction[] getActions(InstallableUnitOperand operand);
+ protected abstract List<ProvisioningAction> getActions(InstallableUnitOperand operand);
final public boolean isApplicable(Operand operand) {
if (!(operand instanceof InstallableUnitOperand))
@@ -92,32 +93,32 @@ public abstract class InstallableUnitPhase extends Phase {
return true;
}
- protected final ProvisioningAction[] getActions(IInstallableUnit unit, String key) {
- ITouchpointInstruction[] instructions = getInstructions(unit, key);
- if (instructions == null || instructions.length == 0)
+ protected final List<ProvisioningAction> getActions(IInstallableUnit unit, String key) {
+ List<ITouchpointInstruction> instructions = getInstructions(unit, key);
+ int instrSize = instructions.size();
+ if (instrSize == 0)
return null;
- List actions = new ArrayList();
+ List<ProvisioningAction> actions = new ArrayList<ProvisioningAction>();
InstructionParser instructionParser = new InstructionParser(getActionManager());
- for (int i = 0; i < instructions.length; i++) {
- actions.addAll(Arrays.asList(instructionParser.parseActions(instructions[i], unit.getTouchpointType())));
+ for (int i = 0; i < instrSize; i++) {
+ actions.addAll(instructionParser.parseActions(instructions.get(i), unit.getTouchpointType()));
}
- return (ProvisioningAction[]) actions.toArray(new ProvisioningAction[actions.size()]);
+ return actions;
}
- private final static ITouchpointInstruction[] getInstructions(IInstallableUnit unit, String key) {
- ITouchpointData[] data = unit.getTouchpointData();
- if (data == null)
- return null;
+ private final static List<ITouchpointInstruction> getInstructions(IInstallableUnit unit, String key) {
+ List<ITouchpointData> data = unit.getTouchpointData();
+ int dataSize = data.size();
+ if (dataSize == 0)
+ return CollectionUtils.emptyList();
- ArrayList matches = new ArrayList(data.length);
- for (int i = 0; i < data.length; i++) {
- ITouchpointInstruction instructions = data[i].getInstruction(key);
+ ArrayList<ITouchpointInstruction> matches = new ArrayList<ITouchpointInstruction>(dataSize);
+ for (int i = 0; i < dataSize; i++) {
+ ITouchpointInstruction instructions = data.get(i).getInstruction(key);
if (instructions != null)
matches.add(instructions);
}
-
- ITouchpointInstruction[] result = (ITouchpointInstruction[]) matches.toArray(new ITouchpointInstruction[matches.size()]);
- return result;
+ return matches;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java
index e9967b1ca..ed5a93c57 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java
@@ -12,6 +12,7 @@ package org.eclipse.equinox.internal.p2.engine;
import java.util.*;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.p2.engine.MissingAction;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
@@ -38,22 +39,21 @@ public class InstructionParser {
this.actionManager = actionManager;
}
- public ProvisioningAction[] parseActions(ITouchpointInstruction instruction, ITouchpointType touchpointType) {
- List actions = new ArrayList();
- Map importMap = parseImportAttribute(instruction.getImportAttribute());
+ public List<ProvisioningAction> parseActions(ITouchpointInstruction instruction, ITouchpointType touchpointType) {
+ List<ProvisioningAction> actions = new ArrayList<ProvisioningAction>();
+ Map<String, ActionEntry> importMap = parseImportAttribute(instruction.getImportAttribute());
StringTokenizer tokenizer = new StringTokenizer(instruction.getBody(), ";"); //$NON-NLS-1$
while (tokenizer.hasMoreTokens()) {
actions.add(parseAction(tokenizer.nextToken(), importMap, touchpointType));
}
-
- return (ProvisioningAction[]) actions.toArray(new ProvisioningAction[actions.size()]);
+ return actions;
}
- private Map parseImportAttribute(String importAttribute) {
+ private Map<String, ActionEntry> parseImportAttribute(String importAttribute) {
if (importAttribute == null)
- return Collections.EMPTY_MAP;
+ return CollectionUtils.emptyMap();
- Map result = new HashMap();
+ Map<String, ActionEntry> result = new HashMap<String, ActionEntry>();
StringTokenizer tokenizer = new StringTokenizer(importAttribute, ","); //$NON-NLS-1$
while (tokenizer.hasMoreTokens()) {
StringTokenizer actionTokenizer = new StringTokenizer(tokenizer.nextToken(), ";"); //$NON-NLS-1$
@@ -72,7 +72,7 @@ public class InstructionParser {
return result;
}
- private ProvisioningAction parseAction(String statement, Map qualifier, ITouchpointType touchpointType) {
+ private ProvisioningAction parseAction(String statement, Map<String, ActionEntry> qualifier, ITouchpointType touchpointType) {
int openBracket = statement.indexOf('(');
int closeBracket = statement.lastIndexOf(')');
if (openBracket == -1 || closeBracket == -1 || openBracket > closeBracket)
@@ -84,10 +84,10 @@ public class InstructionParser {
String nameValuePairs = statement.substring(openBracket + 1, closeBracket);
if (nameValuePairs.length() == 0)
- return new ParameterizedProvisioningAction(action, Collections.EMPTY_MAP, statement);
+ return new ParameterizedProvisioningAction(action, CollectionUtils.<String, String> emptyMap(), statement);
StringTokenizer tokenizer = new StringTokenizer(nameValuePairs, ","); //$NON-NLS-1$
- Map parameters = new HashMap();
+ Map<String, String> parameters = new HashMap<String, String>();
while (tokenizer.hasMoreTokens()) {
String nameValuePair = tokenizer.nextToken();
int colonIndex = nameValuePair.indexOf(":"); //$NON-NLS-1$
@@ -100,9 +100,9 @@ public class InstructionParser {
return new ParameterizedProvisioningAction(action, parameters, statement);
}
- private ProvisioningAction lookupAction(String actionId, Map importMap, ITouchpointType touchpointType) {
+ private ProvisioningAction lookupAction(String actionId, Map<String, ActionEntry> importMap, ITouchpointType touchpointType) {
VersionRange versionRange = null;
- ActionEntry actionEntry = (ActionEntry) importMap.get(actionId);
+ ActionEntry actionEntry = importMap.get(actionId);
if (actionEntry != null) {
actionId = actionEntry.actionId;
versionRange = actionEntry.versionRange;
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java
index 17c82673d..ce4ff7d44 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ParameterizedProvisioningAction.java
@@ -19,10 +19,10 @@ import org.eclipse.equinox.p2.engine.spi.Touchpoint;
public class ParameterizedProvisioningAction extends ProvisioningAction {
private ProvisioningAction action;
- private Map actionParameters;
+ private Map<String, String> actionParameters;
private String actionText;
- public ParameterizedProvisioningAction(ProvisioningAction action, Map actionParameters, String actionText) {
+ public ParameterizedProvisioningAction(ProvisioningAction action, Map<String, String> actionParameters, String actionText) {
if (action == null || actionParameters == null)
throw new IllegalArgumentException(Messages.ParameterizedProvisioningAction_action_or_parameters_null);
this.action = action;
@@ -30,28 +30,28 @@ public class ParameterizedProvisioningAction extends ProvisioningAction {
this.actionText = actionText;
}
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
parameters = processActionParameters(parameters);
return action.execute(parameters);
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
parameters = processActionParameters(parameters);
return action.undo(parameters);
}
- private Map processActionParameters(Map parameters) {
- Map result = new HashMap(parameters);
- for (Iterator it = actionParameters.entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String name = (String) entry.getKey();
- String value = processVariables((String) entry.getValue(), parameters);
+ private Map<String, Object> processActionParameters(Map<String, Object> parameters) {
+ Map<String, Object> result = new HashMap<String, Object>(parameters);
+ for (Iterator<Entry<String, String>> it = actionParameters.entrySet().ite