Throws an exception if the specified duplication context is null or not active. This is to ensure that the Factory helper methods that take a DuplicationContext parameter can only be called in the context of a #duplicate(Resource) call. @param ctx the context to check. @throws NullPointerEx
(DuplicationContext ctx)
| 799 | * active. |
| 800 | */ |
| 801 | protected static void checkDuplicationContext(DuplicationContext ctx) { |
| 802 | if(ctx == null) { |
| 803 | throw new NullPointerException("No DuplicationContext provided"); |
| 804 | } |
| 805 | if(!ctx.active) { |
| 806 | throw new IllegalStateException( |
| 807 | new Throwable().getStackTrace()[1].getMethodName() |
| 808 | + " helper method called outside an active duplicate call"); |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | /** Create a new FeatureMap. */ |
| 813 | public static FeatureMap newFeatureMap() { |
no outgoing calls
no test coverage detected