Consider the following scenario.
public synchronized String getData(){
return getInfo();
}
private String getInfo(){
// operation here should synchronized
return "Synchronize Info";
}
If some one by pass the flow of this operation. System may become unstable, if Java compiler force to make getInfo
synchronized
that kind of issues won't be there. But Java compiler doesn't force to do so. Now developer should responsible for make getInfo
synchronized
or not. Why Java doesn't force to make getInfo
synchronized
?