MCPcopy Create free account
hub / github.com/GateNLP/gate-core / checkDuplicationContext

Method checkDuplicationContext

src/main/java/gate/Factory.java:801–810  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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() {

Callers 2

duplicateMethod · 0.95
defaultDuplicateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected