Skip to content

Commit 1170f63

Browse files
authored
Make sure that Context.unwrap always returns a raw context (#5971)
Even when the instance was created by duplicating a duplicated context. Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 4350abd commit 1170f63

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vertx-core/src/test/java/io/vertx/tests/context/ContextTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ private void checkDuplicate(ContextInternal ctx, ContextInternal duplicated) thr
481481
assertSame(ctx.deployment(), duplicated.deployment());
482482
assertSame(ctx.classLoader(), duplicated.classLoader());
483483
assertSame(ctx.owner(), duplicated.owner());
484+
// Check that unwrap always returns a raw context, even when it was created by duplicating a duplicate
485+
assertTrue(!ctx.isDuplicate() && duplicated.isDuplicate() && ctx == duplicated.unwrap());
484486
Object shared = new Object();
485487
Object local = new Object();
486488
ctx.put("key", shared);

0 commit comments

Comments
 (0)