ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1557985 - in /ant/ivy/core/trunk: src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/event/ src/java/org/apache/ivy/core/report/ src/java/org/apache/ivy/core/resolve/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/c...
Date Tue, 14 Jan 2014 09:02:20 GMT
Author: jlboudart
Date: Tue Jan 14 09:02:20 2014
New Revision: 1557985

URL: http://svn.apache.org/r1557985
Log:
Remove unnecessary cast

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/EventManager.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ResolveReport.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ExecutionEnvironmentProfileProvider.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderElement.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/FSManifestIterable.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RelativeURLRepository.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegatingHandler.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/ParseUtil.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java Tue Jan 14 09:02:20
2014
@@ -198,7 +198,7 @@ public final class IvyPatternHelper {
                 sb = new StringBuffer();
             }
             String var = m.group(1);
-            String val = (String) variables.getVariable(var);
+            String val = variables.getVariable(var);
             if (val != null) {
                 int index = substituting.indexOf(var);
                 if (index != -1) {
@@ -385,7 +385,7 @@ public final class IvyPatternHelper {
         StringBuffer sb = new StringBuffer();
         while (m.find()) {
             String var = m.group(1);
-            String val = (String) params.getVariable(var);
+            String val = params.getVariable(var);
             if (val != null) {
                 int index = substituting.indexOf(var);
                 if (index != -1) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/EventManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/EventManager.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/EventManager.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/EventManager.java Tue Jan 14 09:02:20
2014
@@ -43,7 +43,7 @@ public class EventManager implements Tra
 
     public void removeIvyListener(IvyListener listener) {
         listeners.remove(IvyListener.class, listener);
-        IvyListener[] listeners = (IvyListener[]) this.listeners.getListeners(IvyListener.class);
+        IvyListener[] listeners = this.listeners.getListeners(IvyListener.class);
         for (int i = 0; i < listeners.length; i++) {
             if (listeners[i] instanceof FilteredIvyListener) {
                 if (listener.equals(((FilteredIvyListener) listeners[i]).getIvyListener()))
{

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java
Tue Jan 14 09:02:20 2014
@@ -220,7 +220,7 @@ public class ConfigurationResolveReport 
                 downloaded.add(node);
             }
         }
-        return (IvyNode[]) downloaded.toArray(new IvyNode[downloaded.size()]);
+        return downloaded.toArray(new IvyNode[downloaded.size()]);
     }
 
     public ArtifactDownloadReport[] getDownloadReports(ModuleRevisionId mrid) {
@@ -353,7 +353,7 @@ public class ConfigurationResolveReport 
         Collection<ArtifactDownloadReport> adrs = new ArrayList<ArtifactDownloadReport>(
                 Arrays.asList(allFailedReports));
         for (Iterator<ArtifactDownloadReport> iterator = adrs.iterator(); iterator.hasNext();)
{
-            ArtifactDownloadReport adr = (ArtifactDownloadReport) iterator.next();
+            ArtifactDownloadReport adr = iterator.next();
 
             if (adr.getArtifact().getExtraAttribute("ivy:merged") != null) {
                 iterator.remove();

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ResolveReport.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ResolveReport.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ResolveReport.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/report/ResolveReport.java Tue Jan 14 09:02:20
2014
@@ -340,7 +340,7 @@ public class ResolveReport {
         for (int i = 0; i < allConfs.length; i++) {
             gatherExtendingConfs(extendingConfs, allConfs[i], extended);
         }
-        return (String[]) extendingConfs.toArray(new String[extendingConfs.size()]);
+        return extendingConfs.toArray(new String[extendingConfs.size()]);
     }
 
     private boolean gatherExtendingConfs(Set<String> extendingConfs, String conf, String
extended) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Tue Jan 14 09:02:20
2014
@@ -698,7 +698,7 @@ public class IvyNode implements Comparab
     }
 
     private Collection findPath(ModuleId from, IvyNode node, List path) {
-        IvyNode parent = (IvyNode) node.getDirectCallerFor(from);
+        IvyNode parent = node.getDirectCallerFor(from);
         if (parent == null) {
             throw new IllegalArgumentException("no path from " + from + " to " + getId()
+ " found");
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java Tue Jan 14
09:02:20 2014
@@ -73,8 +73,7 @@ public class IvyNodeCallers {
             if (prevDepConfs != null) {
                 Set newDepConfs = new HashSet(Arrays.asList(prevDepConfs));
                 newDepConfs.addAll(Arrays.asList(dependencyConfs));
-                confs.put(callerConf,
-                    (String[]) newDepConfs.toArray(new String[newDepConfs.size()]));
+                confs.put(callerConf, newDepConfs.toArray(new String[newDepConfs.size()]));
             } else {
                 confs.put(callerConf, dependencyConfs);
             }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Tue Jan 14 09:02:20
2014
@@ -1492,7 +1492,7 @@ public class IvySettings implements Sort
      */
     private void validateAll(Collection values) {
         for (Iterator iterator = values.iterator(); iterator.hasNext();) {
-            Object object = (Object) iterator.next();
+            Object object = iterator.next();
             if (object instanceof Validatable) {
                 ((Validatable) object).validate();
             }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java Tue Jan
14 09:02:20 2014
@@ -283,7 +283,7 @@ public class XmlSettingsParser extends D
 
     private void versionMatchersStarted(String qName, Map attributes) {
         anyConfiguratorStarted(qName);
-        if ("true".equals((String) attributes.get("usedefaults"))) {
+        if ("true".equals(attributes.get("usedefaults"))) {
             ivy.configureDefaultVersionMatcher();
         }
     }
@@ -390,7 +390,7 @@ public class XmlSettingsParser extends D
     }
 
     private void includeStarted(Map attributes) throws IOException, ParseException {
-        final IvyVariableContainer variables = (IvyVariableContainer) ivy.getVariableContainer();
+        final IvyVariableContainer variables = ivy.getVariableContainer();
         ivy.setVariableContainer(new IvyVariableContainerWrapper(variables));
         try {
             String propFilePath = (String) attributes.get("file");

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/ModuleInSort.java Tue Jan 14 09:02:20
2014
@@ -117,8 +117,7 @@ class ModuleInSort {
                 loopElements.add(stackEl);
             }
             elemOfLoop.add(this.module.getModuleRevisionId());
-            ModuleRevisionId[] mrids = (ModuleRevisionId[]) elemOfLoop
-                    .toArray(new ModuleRevisionId[elemOfLoop.size()]);
+            ModuleRevisionId[] mrids = elemOfLoop.toArray(new ModuleRevisionId[elemOfLoop.size()]);
             depStrategy.handleCircularDependency(mrids);
             return true;
         } else {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java Tue Jan 14 09:02:20
2014
@@ -83,7 +83,7 @@ public class SortEngine {
                 (int) (list.size() * adjustFactor + nulls.size()));
         // attempt to adjust the size to avoid too much list resizing
         for (int i = 0; i < list.size(); i++) {
-            ModuleDescriptor md = (ModuleDescriptor) list.get(i);
+            ModuleDescriptor md = list.get(i);
             List<IvyNode> n = dependenciesMap.get(md);
             ret.addAll(n);
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ExecutionEnvironmentProfileProvider.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ExecutionEnvironmentProfileProvider.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ExecutionEnvironmentProfileProvider.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ExecutionEnvironmentProfileProvider.java
Tue Jan 14 09:02:20 2014
@@ -54,7 +54,7 @@ public class ExecutionEnvironmentProfile
     }
 
     public ExecutionEnvironmentProfile getProfile(String profile) {
-        return (ExecutionEnvironmentProfile) profileList.get(profile);
+        return profileList.get(profile);
     }
 
     public static Map<String, ExecutionEnvironmentProfile> loadDefaultProfileList()
@@ -93,8 +93,7 @@ public class ExecutionEnvironmentProfile
         // load the package for the extended profile
         String extendedProfileName = props.getProperty(name + ".extends");
         if (extendedProfileName != null) {
-            ExecutionEnvironmentProfile extendedProfile = (ExecutionEnvironmentProfile) profiles
-                    .get(extendedProfileName);
+            ExecutionEnvironmentProfile extendedProfile = profiles.get(extendedProfileName);
             if (extendedProfile == null) {
                 // not loaded yet, so load it now
                 extendedProfile = loadProfile(props, profiles, extendedProfileName);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderElement.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderElement.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderElement.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestHeaderElement.java Tue Jan
14 09:02:20 2014
@@ -91,22 +91,22 @@ public class ManifestHeaderElement {
         String string = "";
         Iterator<String> itValues = values.iterator();
         while (itValues.hasNext()) {
-            string = string.concat((String) itValues.next());
+            string = string.concat(itValues.next());
             if (itValues.hasNext()) {
                 string = string.concat(";");
             }
         }
         for (Entry<String, String> directive : directives.entrySet()) {
             string = string.concat(";");
-            string = string.concat((String) directive.getKey());
+            string = string.concat(directive.getKey());
             string = string.concat(":=");
-            string = string.concat((String) directive.getValue());
+            string = string.concat(directive.getValue());
         }
         for (Entry<String, String> attribute : attributes.entrySet()) {
             string = string.concat(";");
-            string = string.concat((String) attribute.getKey());
+            string = string.concat(attribute.getKey());
             string = string.concat("=");
-            string = string.concat((String) attribute.getValue());
+            string = string.concat(attribute.getValue());
         }
         return string;
     }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestParser.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/ManifestParser.java Tue Jan 14 09:02:20
2014
@@ -160,7 +160,7 @@ public class ManifestParser {
         ManifestHeaderValue exportElements = new ManifestHeaderValue(
                 mainAttributes.getValue(EXPORT_PACKAGE));
         for (ManifestHeaderElement exportElement : exportElements.getElements()) {
-            String vExport = (String) exportElement.getAttributes().get(ATTR_VERSION);
+            String vExport = exportElement.getAttributes().get(ATTR_VERSION);
             Version v = null;
             try {
                 v = versionOf(vExport);
@@ -171,7 +171,7 @@ public class ManifestParser {
 
             for (String name : exportElement.getValues()) {
                 ExportPackage export = new ExportPackage(name, v);
-                String uses = (String) exportElement.getDirectives().get(ATTR_USE);
+                String uses = exportElement.getDirectives().get(ATTR_USE);
                 if (uses != null) {
                     String[] split = uses.trim().split(",");
                     for (int i = 0; i < split.length; i++) {
@@ -190,11 +190,11 @@ public class ManifestParser {
             bundleInfo.setSource(true);
             ManifestHeaderValue eclipseSourceBundleValue = new ManifestHeaderValue(
                     eclipseSourceBundle);
-            ManifestHeaderElement element = (ManifestHeaderElement) eclipseSourceBundleValue
-                    .getElements().iterator().next();
-            String symbolicNameTarget = (String) element.getValues().iterator().next();
+            ManifestHeaderElement element = eclipseSourceBundleValue.getElements().iterator()
+                    .next();
+            String symbolicNameTarget = element.getValues().iterator().next();
             bundleInfo.setSymbolicNameTarget(symbolicNameTarget);
-            String v = (String) element.getAttributes().get(ATTR_VERSION);
+            String v = element.getAttributes().get(ATTR_VERSION);
             if (v != null) {
                 bundleInfo.setVersionTarget(new Version(v));
             }
@@ -233,7 +233,7 @@ public class ManifestParser {
             String headerName, String type) throws ParseException {
         ManifestHeaderValue elements = new ManifestHeaderValue(mainAttributes.getValue(headerName));
         for (ManifestHeaderElement element : elements.getElements()) {
-            String attVersion = (String) element.getAttributes().get(ATTR_VERSION);
+            String attVersion = element.getAttributes().get(ATTR_VERSION);
             Version version = null;
             try {
                 version = versionOf(attVersion);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java Tue Jan 14 09:02:20
2014
@@ -174,8 +174,7 @@ public class OBRXMLParser {
                         RequirementAdapter.adapt(bundleInfo, child.requirement);
                     } catch (UnsupportedFilterException e) {
                         throw new SAXParseException("Unsupported requirement filter: "
-                                + ((RequireHandler) child).filter + " (" + e.getMessage()
+ ")",
-                                getLocator());
+                                + child.filter + " (" + e.getMessage() + ")", getLocator());
                     } catch (ParseException e) {
                         throw new SAXParseException(
                                 "Error in the requirement filter on the bundle: " + e.getMessage(),

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java Tue Jan 14 09:02:20
2014
@@ -447,7 +447,7 @@ public class P2MetadataParser implements
             addChild(new ProvidedHandler(), new ChildElementHandler<ProvidedHandler>()
{
                 public void childHanlded(ProvidedHandler child) {
                     if (child.namespace.equals("org.eclipse.equinox.p2.eclipse.type")) {
-                        eclipseType = ((ProvidedHandler) child).name;
+                        eclipseType = child.name;
                     } else {
                         String type = namespace2Type(child.namespace);
                         if (type == null) {
@@ -521,12 +521,11 @@ public class P2MetadataParser implements
                 public void childHanlded(RequiredHandler child) {
                     String name = child.name;
                     VersionRange range = child.range;
-                    String type = namespace2Type(((RequiredHandler) child).namespace);
+                    String type = namespace2Type(child.namespace);
                     if (type == null) {
                         if (logLevel >= Message.MSG_DEBUG) {
-                            Message.debug("Unsupported required capability "
-                                    + ((RequiredHandler) child).namespace + " " + name +
" "
-                                    + range);
+                            Message.debug("Unsupported required capability " + child.namespace
+                                    + " " + name + " " + range);
                         }
                     } else {
                         String resolution = child.optional ? "optional" : null;

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java Tue Jan
14 09:02:20 2014
@@ -389,7 +389,7 @@ public abstract class AbstractOSGiResolv
                 Iterator<ModuleDescriptor> itModules = entry.getValue().iterator();
                 boolean moduleMatchRev = false;
                 while (!moduleMatchRev && itModules.hasNext()) {
-                    ModuleDescriptor md = (ModuleDescriptor) itModules.next();
+                    ModuleDescriptor md = itModules.next();
                     moduleMatchRev = rev.equals(md.getRevision());
                 }
                 if (moduleMatchRev) {
@@ -404,7 +404,7 @@ public abstract class AbstractOSGiResolv
     public Map[] listTokenValues(String[] tokens, Map criteria) {
         Set<String> tokenSet = new HashSet<String>(Arrays.asList(tokens));
         Set<Map<String, String>> listTokenValues = listTokenValues(tokenSet,
criteria);
-        return (Map[]) listTokenValues.toArray(new Map[listTokenValues.size()]);
+        return listTokenValues.toArray(new Map[listTokenValues.size()]);
     }
 
     private Set<Map<String, String>> listTokenValues(Set<String> tokens,

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/FSManifestIterable.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/FSManifestIterable.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/FSManifestIterable.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/FSManifestIterable.java Tue Jan 14
09:02:20 2014
@@ -99,7 +99,7 @@ public class FSManifestIterable extends 
     }
 
     protected InputStream getInputStream(File f) throws FileNotFoundException {
-        return new FileInputStream((File) f);
+        return new FileInputStream(f);
     }
 
     protected List<File> listBundleFiles(File dir) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RelativeURLRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RelativeURLRepository.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RelativeURLRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RelativeURLRepository.java Tue Jan
14 09:02:20 2014
@@ -46,7 +46,7 @@ public class RelativeURLRepository exten
 
     public Resource getResource(String source) throws IOException {
         source = encode(source);
-        Resource res = (Resource) resourcesCache.get(source);
+        Resource res = resourcesCache.get(source);
         if (res == null) {
             URI uri;
             try {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java Tue
Jan 14 09:02:20 2014
@@ -46,7 +46,7 @@ public class RepositoryManifestIterable 
     }
 
     protected URI buildBundleURI(String location) throws IOException {
-        Resource resource = repo.getResource((String) location);
+        Resource resource = repo.getResource(location);
         // We have a resource to transform into an URI, let's use some heuristics
         try {
             return new URI(resource.getName());
@@ -56,15 +56,15 @@ public class RepositoryManifestIterable 
     }
 
     protected InputStream getInputStream(String f) throws IOException {
-        return repo.getResource((String) f).openStream();
+        return repo.getResource(f).openStream();
     }
 
     protected List<String> listBundleFiles(String dir) throws IOException {
-        return asList(ResolverHelper.listAll(repo, (String) dir));
+        return asList(ResolverHelper.listAll(repo, dir));
     }
 
     protected List<String> listDirs(String dir) throws IOException {
-        return asList(ResolverHelper.listAll(repo, (String) dir));
+        return asList(ResolverHelper.listAll(repo, dir));
     }
 
     private List<String> asList(String[] array) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegatingHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegatingHandler.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegatingHandler.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/DelegatingHandler.java Tue Jan 14
09:02:20 2014
@@ -214,7 +214,7 @@ public class DelegatingHandler extends D
                     return;
                 }
                 // time now to delegate for a new element
-                delegate = (DelegatingHandler) saxHandlerMapping.get(localName);
+                delegate = saxHandlerMapping.get(localName);
                 if (delegate != null) {
                     skipOnError(new SkipOnErrorCallback() {
                         public void call() throws SAXException {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/ParseUtil.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/ParseUtil.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/ParseUtil.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/util/ParseUtil.java Tue Jan 14 09:02:20
2014
@@ -77,6 +77,6 @@ public class ParseUtil {
             list.add(sb.toString().trim());
         }
 
-        return (String[]) list.toArray(new String[list.size()]);
+        return list.toArray(new String[list.size()]);
     }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportParser.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/report/XmlReportParser.java Tue Jan
14 09:02:20 2014
@@ -120,8 +120,7 @@ public class XmlReportParser {
                     if (skip) {
                         return;
                     }
-                    MetadataArtifactDownloadReport madr = (MetadataArtifactDownloadReport)
metadataReports
-                            .get(mrid);
+                    MetadataArtifactDownloadReport madr = metadataReports.get(mrid);
                     if (madr != null) {
                         madr.setDownloadStatus(DownloadStatus.fromString(attributes
                                 .getValue("status")));
@@ -172,7 +171,7 @@ public class XmlReportParser {
                     if (skip) {
                         return;
                     }
-                    ArtifactDownloadReport aReport = (ArtifactDownloadReport) revisionArtifacts
+                    ArtifactDownloadReport aReport = revisionArtifacts
                             .get(revisionArtifacts.size() - 1);
 
                     if (ArtifactOrigin.isUnknown(attributes.getValue("location"))) {
@@ -299,22 +298,21 @@ public class XmlReportParser {
     }
 
     public Artifact[] getArtifacts() {
-        return (Artifact[]) parser.getArtifacts().toArray(
-            new Artifact[parser.getArtifacts().size()]);
+        return parser.getArtifacts().toArray(new Artifact[parser.getArtifacts().size()]);
     }
 
     public ArtifactDownloadReport[] getArtifactReports() {
-        return (ArtifactDownloadReport[]) parser.getArtifactReports().toArray(
+        return parser.getArtifactReports().toArray(
             new ArtifactDownloadReport[parser.getArtifactReports().size()]);
     }
 
     public ModuleRevisionId[] getDependencyRevisionIds() {
-        return (ModuleRevisionId[]) parser.getModuleRevisionIds().toArray(
+        return parser.getModuleRevisionIds().toArray(
             new ModuleRevisionId[parser.getModuleRevisionIds().size()]);
     }
 
     public ModuleRevisionId[] getRealDependencyRevisionIds() {
-        return (ModuleRevisionId[]) parser.getRealModuleRevisionIds().toArray(
+        return parser.getRealModuleRevisionIds().toArray(
             new ModuleRevisionId[parser.getRealModuleRevisionIds().size()]);
     }
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/ChecksumHelper.java Tue Jan 14 09:02:20
2014
@@ -154,9 +154,9 @@ public final class ChecksumHelper {
             ch = (byte) (ch >>> 4); // shift the bits down
             ch = (byte) (ch & 0x0F); // must do this is high order bit is on!
 
-            out.append(CHARS[(int) ch]); // convert the nibble to a String Character
+            out.append(CHARS[ch]); // convert the nibble to a String Character
             ch = (byte) (in[i] & 0x0F); // Strip off low nibble
-            out.append(CHARS[(int) ch]); // convert the nibble to a String Character
+            out.append(CHARS[ch]); // convert the nibble to a String Character
         }
         // CheckStyle:MagicNumber ON
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java Tue Jan 14 09:02:20
2014
@@ -72,7 +72,7 @@ public final class FilterHelper {
         }
         Collection ret = new ArrayList(col);
         for (Iterator iter = ret.iterator(); iter.hasNext();) {
-            Object element = (Object) iter.next();
+            Object element = iter.next();
             if (!filter.accept(element)) {
                 iter.remove();
             }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java Tue Jan 14
09:02:20 2014
@@ -373,8 +373,8 @@ public class HttpClientHandler extends A
                 throws CredentialsNotAvailableException {
             String realm = scheme.getRealm();
 
-            org.apache.ivy.util.Credentials c = (org.apache.ivy.util.Credentials) CredentialsStore.INSTANCE
-                    .getCredentials(realm, host);
+            org.apache.ivy.util.Credentials c = CredentialsStore.INSTANCE.getCredentials(realm,
+                host);
             if (c != null) {
                 return createCredentials(c.getUserName(), c.getPasswd());
             }

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java Tue Jan 14 09:02:20 2014
@@ -49,13 +49,13 @@ public class IvyTaskTest extends TestCas
             settings.getDefaultCache());
         // The next test doesn't always works on windows (mix C: and c: drive)
         assertEquals(new File("test/repositories/ivysettings.xml").getAbsolutePath().toUpperCase(),
-            new File((String) settings.getVariables().getVariable("ivy.settings.file"))
-                    .getAbsolutePath().toUpperCase());
+            new File(settings.getVariables().getVariable("ivy.settings.file")).getAbsolutePath()
+                    .toUpperCase());
         assertEquals(new File("test/repositories/ivysettings.xml").toURI().toURL().toExternalForm()
-                .toUpperCase(),
-            ((String) settings.getVariables().getVariable("ivy.settings.url")).toUpperCase());
-        assertEquals(new File("test/repositories").getAbsolutePath().toUpperCase(),
-            ((String) settings.getVariables().getVariable("ivy.settings.dir")).toUpperCase());
+                .toUpperCase(), settings.getVariables().getVariable("ivy.settings.url")
+                .toUpperCase());
+        assertEquals(new File("test/repositories").getAbsolutePath().toUpperCase(), settings
+                .getVariables().getVariable("ivy.settings.dir").toUpperCase());
         assertEquals("myvalue", settings.getVariables().getVariable("myproperty"));
     }
 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java?rev=1557985&r1=1557984&r2=1557985&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/osgi/updatesite/UpdateSiteLoaderTest.java
Tue Jan 14 09:02:20 2014
@@ -84,8 +84,7 @@ public class UpdateSiteLoaderTest extend
 
         // check that the url of the artifact is correctly resolved
         String path = new File("test/test-p2/ivyde-repo/").toURI().toURL().toExternalForm();
-        ModuleDescriptor md = ((ModuleDescriptorWrapper) site.getModules().next())
-                .getModuleDescriptor();
+        ModuleDescriptor md = site.getModules().next().getModuleDescriptor();
         assertTrue(md.getAllArtifacts()[0].getUrl().toExternalForm().startsWith(path));
     }
 }



Mime
View raw message