| Summary: | unable to move artifacts when repo already exists on fileshare | ||
|---|---|---|---|
| Product: | [Technology] CBI | Reporter: | David Samuelsson <david.samuelsson.se> |
| Component: | CBI p2 Repository Aggregator | Assignee: | Filip Hrbek <filip.hrbek> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | denisp, filip.hrbek, thomas |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
David Samuelsson
same problem manifested in headless. Looking at the source code of org.eclipse.b3.aggregator.engine.MirrorGenerator the problem is obvious.
On line 466 the first file is moved to the aggregate directory. On line 467, an exception is thrown.
oldLocation.renameTo(newLocation);
throw ExceptionUtils.fromMessage("Unable to move %s to %s", oldLocation.getAbsolutePath(), newLocation.getAbsolutePath());
But it is not checking the return value of renameTo. Instead, it should be like this:
if (!oldLocation.renameTo(newLocation)) {
throw ExceptionUtils.fromMessage("Unable to move %s to %s", oldLocation.getAbsolutePath(), newLocation.getAbsolutePath());
}
There are 2 other places in this class that use the correct pattern. Its just this one that is missing the test for the return condition.
Fixed sometime prior to revision 1499. [Bookkeeping change only. Moving bugs to the new "home" of aggregator, CBI. No change to assignee for resolved and verified bugs.] |