Summary: | ClassCastException from Custom Task | ||
---|---|---|---|
Product: | Ant | Reporter: | Shawn Price <shawn.price> |
Component: | Other | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | shawn.price |
Priority: | P2 | Keywords: | ErrorMessage |
Version: | 1.6.2 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 2000 |
Description
Shawn Price
2004-12-09 18:55:21 UTC
The internals of Copy was changed from ant 1.5 to ant 1.6 to allow a file to be copied to multiple locations. It now stores the a String[] in fileCopyMap. You need to do: String[] destinationFiles = (String[])fileCopyMap.get(sourceFile) for (int i = 0; i < destinationFiles.length; i++) { String destinationFile = destinationFiles[i]; ... If you want to use the custom task in both ant 1.5 and ant 1.6 you need to check the type: Object dFiles = fileCopyMap.get(sourceFile) if (dFiles instanceof String) { ... 1.5 code } else { ... 1.6 code } Sorry about the inconvience. Marking this as an *WONTFIX*, as there is not much that can be done to fix this. |