#vulnerable code 
                                public WriteBucket disableSearch() {
        httpOnly(client.getTransport(), Constants.FL_SCHEMA_SEARCH);
        if (existingPrecommitHooks != null) {
            synchronized (existingPrecommitHooks) {
                existingPrecommitHooks.remove(NamedErlangFunction.SEARCH_PRECOMMIT_HOOK);
                for (NamedFunction f : existingPrecommitHooks) {
                    builder.addPrecommitHook(f);
                }
            }
        }
        builder.search(false);
        return this;
    } 
                            #location 11 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public WriteBucket disableSearch() {
        httpOnly(client.getTransport(), Constants.FL_SCHEMA_SEARCH);
        if (precommitHooks != null) {
            precommitHooks.remove(NamedErlangFunction.SEARCH_PRECOMMIT_HOOK);
        }
        builder.search(false);
        return this;
    }