Create a duplicate of the given resource. A duplicate is a an independent copy of the resource that has the same name and the same behaviour. It does not necessarily have the same concrete class as the original, but if the original resource implements any of the following interface
(Resource res)
| 589 | * constructing the duplicate. |
| 590 | */ |
| 591 | public static Resource duplicate(Resource res) |
| 592 | throws ResourceInstantiationException { |
| 593 | DuplicationContext ctx = new DuplicationContext(); |
| 594 | try { |
| 595 | return duplicate(res, ctx); |
| 596 | } finally { |
| 597 | // de-activate the context |
| 598 | ctx.active = false; |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | private static long dupIndex = 0; |
| 603 |
no test coverage detected