Browse Source

Useless casts

master
Gintas Grigelionis 6 years ago
parent
commit
58e7645a97
2 changed files with 5 additions and 6 deletions
  1. +4
    -4
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  2. +1
    -2
      src/main/org/apache/tools/ant/types/selectors/SelectSelector.java

+ 4
- 4
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -875,13 +875,13 @@ public final class IntrospectionHelper {
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
public Method getElementMethod(final String elementName) throws BuildException { public Method getElementMethod(final String elementName) throws BuildException {
final Object creator = nestedCreators.get(elementName);
final NestedCreator creator = nestedCreators.get(elementName);
if (creator == null) { if (creator == null) {
throw new UnsupportedElementException("Class " throw new UnsupportedElementException("Class "
+ bean.getName() + " doesn't support the nested \"" + bean.getName() + " doesn't support the nested \""
+ elementName + "\" element.", elementName); + elementName + "\" element.", elementName);
} }
return ((NestedCreator) creator).method;
return creator.method;
} }


/** /**
@@ -896,13 +896,13 @@ public final class IntrospectionHelper {
* @since Ant 1.6.3 * @since Ant 1.6.3
*/ */
public Method getAttributeMethod(final String attributeName) throws BuildException { public Method getAttributeMethod(final String attributeName) throws BuildException {
final Object setter = attributeSetters.get(attributeName);
final AttributeSetter setter = attributeSetters.get(attributeName);
if (setter == null) { if (setter == null) {
throw new UnsupportedAttributeException("Class " throw new UnsupportedAttributeException("Class "
+ bean.getName() + " doesn't support the \"" + bean.getName() + " doesn't support the \""
+ attributeName + "\" attribute.", attributeName); + attributeName + "\" attribute.", attributeName);
} }
return ((AttributeSetter) setter).method;
return setter.method;
} }


/** /**


+ 1
- 2
src/main/org/apache/tools/ant/types/selectors/SelectSelector.java View File

@@ -66,8 +66,7 @@ public class SelectSelector extends BaseSelectorContainer {
* referenced Selector. * referenced Selector.
*/ */
private SelectSelector getRef() { private SelectSelector getRef() {
Object o = getCheckedRef(this.getClass(), "SelectSelector");
return (SelectSelector) o;
return getCheckedRef(this.getClass(), "SelectSelector");
} }


/** /**


Loading…
Cancel
Save