title: Spring MVC similar setters
body: <p>I have two classes with a <code>String title</code> field. They have similar setters called <code>setTitle()</code>. When I use them as object parameters in a POST request, the field values rewrite to new values in Foo and Bar. Foo populates in <code>Controller</code> before request.</p>
  
  <pre><code>public class Foo{
    // ...
    String title;
  
    public void setTitle(String title){
      this.title=title;
      // ...
    }
  
  public class Bar {
    // ...
    String title;
  
    public void setTitle(String title){
      this.title=title;
      // ...
    }
  }
  
  @ModelAttribute 
  public void populateFoo(Model model){
    Foo foo = Foo.getFromDb() 
  
    model.addAttribute(foo);
  }
  
  @RequestMapping
  public String somePost(Foo foo, Bar bar, ...){
    Bar newBar = new Bar();
    newBar.setTitle(bar.getTitle());
  }
  </code></pre>
  
  <p>When I'm invoking <code>setTitle()</code> on <code>newBar</code>, method <code>setTitle()</code> on <code>Foo</code> also invoked.</p>