title: Spring: Accessing field from final method returning null
body: <p>So I came across a very weird bug in my project. I had the following two classes</p>
  
  <pre><code>@Component
  @Scope("prototype")
  public abstract class World {
      String name;
  
      public World(String name) {
            this.name = name;
      }
  
      final void print() {
            System.out.println(name);
      }
  }
  
  @Component
  @Scope("prototype")
  public class Hello extends World {
  
      public Hello(String name) {
            super(name);
      }
  }
  </code></pre>
  
  <p>When I instantiate an object using <code>context.getBean(Hello.class, "foo")</code>, I get back a Hello class bean. But when I <code>hello.print()</code>, it printed <code>null</code>.</p>
  
  <p>Removing the final modifier resolved the issue. Whats going on here? Is spring having any limitations with final methods?</p>