Skip to content

Commit 445ab1f

Browse files
committed
Allow non-string map keys.
1 parent b932c9b commit 445ab1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gremlin-server/scripts/empty-sample-secure.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
def addItUp(int x, int y) { x + y }
3232

3333
// an init script that returns a Map allows explicit setting of global bindings.
34-
def Map<String, Object> globals = [:]
34+
def Map<Object, Object> globals = [:]
3535

3636
// defines a sample LifeCycleHook that prints some output to the Gremlin Server console.
3737
// note that the name of the key in the "global" map is unimportant. As this script,
@@ -44,7 +44,7 @@ globals << ([hook : [
4444
onShutDown: { LifeCycleHook.Context ctx ->
4545
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
4646
}
47-
] as LifeCycleHook] as Map<String, Object>)
47+
] as LifeCycleHook] as Map<Object, Object>)
4848

4949
// define the default TraversalSource to bind queries to - this one will be named "g".
5050
// ReferenceElementStrategy converts all graph elements (vertices/edges/vertex properties)
@@ -55,4 +55,4 @@ globals << ([hook : [
5555
//
5656
// must use an instance of ReferenceElementStrategy as Groovy shorthands won't work with
5757
// secure script execution.
58-
globals << ([g : traversal().withEmbedded(graph).withStrategies(ReferenceElementStrategy.instance())] as Map<String, Object>)
58+
globals << ([g : traversal().withEmbedded(graph).withStrategies(ReferenceElementStrategy.instance())] as Map<Object, Object>)

0 commit comments

Comments
 (0)