I am getting this prompt from Sonar: Instance methods should not write to \"static\" fields
I\'m not quite sure what I need to change to fix this is
In fact this method:
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SemaMonitorProxy.applicationContext = applicationContext;
}
is an instance method writing to a static field:
private static ApplicationContext applicationContext
You cannot make the above method static. So the only solution would be to remove the static keyword from the applicationContext
declaration.
private ApplicationContext applicationContext