Skip to content

Commit

Permalink
Merge pull request #224 from Sanne/AvoidTypeCachePollutions2
Browse files Browse the repository at this point in the history
Additional type pollution fix
  • Loading branch information
dmlloyd committed Sep 26, 2023
2 parents cde3a19 + b393d44 commit 30094c3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public static Context getOrCreateDuplicatedContext(Context context) {
* @see #getOrCreateDuplicatedContext(Context)
*/
public static Context getOrCreateDuplicatedContext(Vertx vertx) {
Vertx actual = Assert.checkNotNullParam("vertx", vertx);
Context context = actual.getOrCreateContext(); // Creates an event loop context if none
//Intentionally avoid to reassign the return from checkNotNullParam
//as it will trigger JDK-8180450
Assert.checkNotNullParam("vertx", vertx);
Context context = vertx.getOrCreateContext(); // Creates an event loop context if none
if (isDuplicatedContext(context)) { // Also checks that the context is not null
return context;
} else {
Expand Down

0 comments on commit 30094c3

Please sign in to comment.