Skip to content

Commit bbdb9a9

Browse files
committed
Fix stackoverflow on .type(String)
1 parent 2b2e5be commit bbdb9a9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/com/redislabs/modules/rejson/JReJSON.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public void set(String key, Object object, ExistenceModifier flag, Path path) {
279279
* @return the Java class of the requested object
280280
*/
281281
public Class<?> type(String key) {
282-
return type(key);
282+
return type(key, Path.ROOT_PATH);
283283
}
284284

285285
/**

src/test/java/com/redislabs/modules/rejson/ClientTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public void delException() throws Exception {
162162
@Test
163163
public void typeChecksShouldSucceed() throws Exception {
164164
client.set( "foobar", new FooBarObject(), Path.ROOT_PATH);
165+
assertSame(Object.class, client.type( "foobar"));
165166
assertSame(Object.class, client.type( "foobar", Path.ROOT_PATH));
166167
assertSame(String.class, client.type( "foobar", new Path(".foo")));
167168
}

0 commit comments

Comments
 (0)