#vulnerable code 
                                public WriteBucket enableForSearch() {
        httpOnly(client.getTransport(), Constants.FL_SCHEMA_SEARCH);
        builder.addPrecommitHook(NamedErlangFunction.SEARCH_PRECOMMIT_HOOK).search(true);
        return this;
    } 
                            #location 3 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public WriteBucket enableForSearch() {
        httpOnly(client.getTransport(), Constants.FL_SCHEMA_SEARCH);
        addPrecommitHook(NamedErlangFunction.SEARCH_PRECOMMIT_HOOK);
        builder.search(true);
        return this;
    }