javapathfinder / jpf-core

JPF is an extensible software analysis framework for Java bytecode. jpf-core is the basis for all JPF projects; you always need to install it. It contains the basic VM and model checking infrastructure, and can be used to check for concurrency defects like deadlocks, and unhandled exceptions like NullPointerExceptions and AssertionErrors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`java.lang.ThreadLocal.withInitial` method missing

alexchang8 opened this issue · comments

The static method java.lang.ThreadLocal.withInitial (added in JDK 1.8) is currently missing. This can be fixed by adding

  public static <S> ThreadLocal<S> withInitial(Supplier<? extends S> supplier) {
    return new SuppliedThreadLocal<>(supplier);
  }

to ThreadLocal here

static final class SuppliedThreadLocal<E> extends ThreadLocal<E> {
// we need to preserve the modifiers since this might introduce races (supplier could be shared)

Can you please add this together with a unit test and make a pull request?

Can I work on this Issue?

To my knowledge, Alex is not currently working on this, so please go ahead.

Hello @cyrille-artho can you assign me this task so that I can start working on it

Thanks I'll do my best

Hey @cyrille-artho created pull request please look into it