You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2018/02/17 17:26:08 UTC
[3/6] ant git commit: move cast back after type compatibility check
move cast back after type compatibility check
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/e8117b6d
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/e8117b6d
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/e8117b6d
Branch: refs/heads/master
Commit: e8117b6d3c38e54ac8758d8da8e886639af4fb1b
Parents: e041e2a
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Feb 17 16:50:47 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Feb 17 16:50:47 2018 +0100
----------------------------------------------------------------------
.../ant/types/selectors/modifiedselector/ModifiedSelector.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/e8117b6d/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java b/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
index 3592041..f3b33e2 100644
--- a/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
@@ -404,13 +404,12 @@ public class ModifiedSelector extends BaseExtendSelector
clazz = Class.forName(classname);
}
- @SuppressWarnings("unchecked")
- T rv = (T) clazz.newInstance();
+ Object rv = clazz.newInstance();
if (!type.isInstance(rv)) {
throw new BuildException("Specified class (%s) %s", classname, msg);
}
- return rv;
+ return (T) rv;
} catch (ClassNotFoundException e) {
throw new BuildException("Specified class (%s) not found.", classname);
} catch (Exception e) {