title: XStream, Aliasing and "DuplicateFieldException"
body: <p>I'm trying to write an app so that it is able to read this kind of XML and create an entire object based on it;</p>
  
  <pre><code>&lt;actor id="id273211" PGFVersion="0.19" GSCVersion="0.10.4"&gt;
    &lt;attributes&gt;
      &lt;text id="name"&gt;Actor 1b&lt;/text&gt;
      &lt;point id="position"&gt;
        &lt;real id="x"&gt;0&lt;/real&gt;
        &lt;real id="y"&gt;0&lt;/real&gt;
      &lt;/point&gt;
    &lt;/attributes&gt;
  &lt;/actor&gt;
  </code></pre>
  
  <p>My problem is I'm aliasing members of the class Point as "real" and it gives an exception.</p>
  
  <p>What I have now is;</p>
  
  <pre><code>@XStreamAlias("actor")
  public class Actor {
  
      @XStreamAsAttribute
      String id = "",PGFVersion = "", GSCVersion = "";
      Attributes attributes = new Attributes();
  }
  
  
  public class Attributes {
  
      public Text text = new Text("name", "Actor 1");
      public Point point = new Point();
  
  }
  
  
  @XStreamConverter(value=ToAttributedValueConverter.class, strings={"value"})
  @XStreamAlias("text")
  public class Text {
  
      @XStreamAsAttribute
      String id;
  
      String value;
  
      public Text(String text, String value) {
          this.id = text;
          this.value = value;
      }
  
  
  public class Point {
       @XStreamAlias("real")
       public Real x = new Real("x", "11");
       @XStreamAlias("real") 
       public Real y = new Real("y", "21");
       @XStreamAsAttribute
       public String id = "position";
  
  }
  </code></pre>
  
  <p>And my Test.java:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
  
      XStream xstream = new XStream();
  
      Actor actor2 = new Actor();
  
      xstream.processAnnotations(Text.class);
      xstream.processAnnotations(Real.class);
      xstream.processAnnotations(Point.class);
      xstream.processAnnotations(Actor.class);
  
      String xml = xstream.toXML(actor2);
  
      System.out.println(xml);
  
  }
  </code></pre>
  
  <p>This outputs XML perfectly, as follows:</p>
  
  <pre><code>&lt;actor id="" PGFVersion="" GSCVersion=""&gt;
    &lt;attributes&gt;
      &lt;text id="name"&gt;Actor 1&lt;/text&gt;
      &lt;point id="position"&gt;
        &lt;real id="x"&gt;11&lt;/real&gt;
        &lt;real id="y"&gt;21&lt;/real&gt;
      &lt;/point&gt;
    &lt;/attributes&gt;
  &lt;/actor&gt;
  </code></pre>
  
  <p>But when I try to import it using:</p>
  
  <pre><code>String xml = xstream.toXML(actor2);
  
  Actor actorNew = (Actor)xstream.fromXML(xml);
  System.out.println(xml);
  </code></pre>
  
  <p>It gives an exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$DuplicateFieldException:
    Duplicate field y
    ---- Debugging information ---- field               : y class               : projectmerger1.Point required-type       : projectmerger1.Point
    converter-type      :
    com.thoughtworks.xstream.converters.reflection.ReflectionConverter
    path                : /projectmerger1.Actor/attributes/point/real[2]
    line number         : 6 class[1]            :
    projectmerger1.Attributes class[2]            : projectmerger1.Actor</p>
    
    <h2>version             : 1.4.6</h2>
  </blockquote>
  
  <p>Is this a wrong setup as a whole or can I continue using it with some tweaks? </p>