Spring : Is this member variable thread-safe?

Viewed 1371
@Service    
public class InfoService {
    private Info currentInfo;

    public void initInfo(String data) {
        currentInfo = new Info(data);
    }

    //blarblar...
}

If this is not thread-safe, my service methods should be changed to hold "currentInfo" as its parameter. I don't want to make duplicate parameter code, so I make it as member variable of service. Of course, this code works perfectly on me, but I worry about this can be thread-danger.

"currentInfo" can be thread-danger?

1 Answers
Related