#vulnerable code 
                                int getNegative(int target) {
        int negative;
        do {
            negative = negatives[negpos];
            negpos = (negpos + 1) % negatives.length;
        } while (target == negative);
        return negative;
    } 
                            #location 5 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                Model(Matrix wi,
          Matrix wo,
          Args args,
          int seed) {
        hidden_ = new Vector(args.dim);
        output_ = new Vector(wo.m_);
        grad_ = new Vector(args.dim);
        random = new Random(seed);
        wi_ = wi;
        wo_ = wo;
        args_ = args;
        isz_ = wi.m_;
        osz_ = wo.m_;
        hsz_ = args.dim;
        negpos = 0;
        loss_ = 0.0f;
        nexamples_ = 1;
    }