Skip to content
Permalink
Browse files
Awkward method name
  • Loading branch information
AlanBateman committed Mar 4, 2021
1 parent 0ab3df8 commit f8e8314d28671e7dbc771bc7e664e6bd2e81b0b4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
@@ -816,7 +816,7 @@ public interface Builder {
* to disallow the thread from setting the values of thread-local variables.
* @return this builder
*/
Builder noInheritInheritableThreadLocals();
Builder noInheritThreadLocals();

/**
* Sets the uncaught exception handler.
@@ -1008,7 +1008,7 @@ public Builder noThreadLocals() {
}

@Override
public Builder noInheritInheritableThreadLocals() {
public Builder noInheritThreadLocals() {
characteristics |= Thread.NO_INHERIT_THREAD_LOCALS;
return this;
}
@@ -639,7 +639,7 @@ HandshakeStatus finishHandshake() {
new HandshakeCompletedEvent((SSLSocket)transport, conSession);
Thread.builder()
.virtual()
.noInheritInheritableThreadLocals()
.noInheritThreadLocals()
.name("HandshakeCompletedNotify-Thread")
.task(new NotifyHandshake(sslConfig.handshakeListeners, hce))
.start();
@@ -565,27 +565,27 @@ public void testInheritedThreadLocals2() throws Exception {
}

public void testInheritedThreadLocals3() throws Exception {
Thread.Builder builder = Thread.builder().noInheritInheritableThreadLocals();
Thread.Builder builder = Thread.builder().noThreadLocals();
testNoInheritedThreadLocals(builder);
}

public void testInheritedThreadLocals4() throws Exception {
Thread.Builder builder = Thread.builder().virtual().noInheritInheritableThreadLocals();
Thread.Builder builder = Thread.builder().virtual().noThreadLocals();
testNoInheritedThreadLocals(builder);
}

public void testInheritedThreadLocals5() throws Exception {
Thread.Builder builder = Thread.builder()
.noThreadLocals()
.noInheritInheritableThreadLocals();
.noThreadLocals();
testNoInheritedThreadLocals(builder);
}

public void testInheritedThreadLocals6() throws Exception {
Thread.Builder builder = Thread.builder()
.virtual()
.noThreadLocals()
.noInheritInheritableThreadLocals();
.noThreadLocals();
}

// test null parameters
@@ -30,7 +30,7 @@
class TestHelper {

static final int NO_THREAD_LOCALS = 1 << 1;
static final int NO_INHERIT_INHERITABLE_THREAD_LOCALS = 1 << 2;
static final int NO_INHERIT_THREAD_LOCALS = 1 << 2;

interface ThrowingRunnable {
void run() throws Exception;
@@ -55,8 +55,8 @@ private static void run(String name, int characteristics, ThrowingRunnable task)
builder.name(name);
if ((characteristics & NO_THREAD_LOCALS) != 0)
builder.noThreadLocals();
if ((characteristics & NO_INHERIT_INHERITABLE_THREAD_LOCALS) != 0)
builder.noInheritInheritableThreadLocals();
if ((characteristics & NO_INHERIT_THREAD_LOCALS) != 0)
builder.noInheritThreadLocals();
Thread thread = builder.start();
thread.join();
Exception e = exc.get();
@@ -1160,7 +1160,7 @@ public void testContextClassLoader6() throws Exception {
TestHelper.runInVirtualThread(() -> {
ClassLoader loader = new ClassLoader() { };
Thread.currentThread().setContextClassLoader(loader);
int characteristics = TestHelper.NO_INHERIT_INHERITABLE_THREAD_LOCALS;
int characteristics = TestHelper.NO_INHERIT_THREAD_LOCALS;
TestHelper.runInVirtualThread(characteristics, () -> {
Thread t = Thread.currentThread();
assertTrue(t.getContextClassLoader() == null);
@@ -143,7 +143,7 @@ public void testInheritedThreadLocal4() throws Exception {
var obj = new Object();
INHERITED_LOCAL.set(obj);
try {
int characteristics = TestHelper.NO_INHERIT_INHERITABLE_THREAD_LOCALS;
int characteristics = TestHelper.NO_INHERIT_THREAD_LOCALS;
TestHelper.runInVirtualThread(characteristics, () -> {
assertTrue(INHERITED_LOCAL.get() == null);
});
@@ -158,7 +158,7 @@ public void testInheritedThreadLocal5() throws Exception {
TestHelper.runInVirtualThread(() -> {
var obj = new Object();
INHERITED_LOCAL.set(obj);
int characteristics = TestHelper.NO_INHERIT_INHERITABLE_THREAD_LOCALS;
int characteristics = TestHelper.NO_INHERIT_THREAD_LOCALS;
TestHelper.runInVirtualThread(characteristics, () -> {
assertTrue(INHERITED_LOCAL.get() == null);
});

0 comments on commit f8e8314

Please sign in to comment.