title: SONAR complaining about Make the enclosing method "static" or remove this set
body: <p>I have the following piece of code in my program and I am running SonarQube 5 for code quality check on it after integrating it with Maven.</p>
  
  <p>However, Sonar is asking to Make the enclosing method "static" or remove this set. the method is setApplicationContext. </p>
  
  <p>How to remove this error? Why this error is coming?</p>
  
  <pre><code>public class SharedContext implements ApplicationContextAware {
  public static final String REPORT_ENGINE_FACTORY = "reportEngineFactory";
  private static ApplicationContext applicationContext;
  
  public void setApplicationContext(ApplicationContext applicationContext)
          throws BeansException {
      SharedContext.applicationContext = applicationContext;
  }
  
  public static ApplicationContext getApplicationContext() {
      return applicationContext;
  }
  
  public Object getBean(String name) {
      return applicationContext.getBean(name);
  } }
  </code></pre>