diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java | 38 |
1 files changed, 19 insertions, 19 deletions
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())); |