Menu

#35 Root annotation ignored

v1.0 (example)
open
nobody
validation (2)
5
2014-03-17
2014-03-14
Marko Matic
No

In simple-xml-2.7.1 root annotation on top of the class is ignored in some cases.

example:

XML:

<h1>Server Error (500)</h1>

Will be parsed into class (with empty list):

@Root(name="Auctions")
public class Auctions {
    private Auctions(){
        mAuctions = new ArrayList<Auction>();
    }

    @ElementList(entry="Auction", inline=true, required=false)
    private ArrayList<Auction> mAuctions;

    public ArrayList<Auction> getAuctions() {
        return mAuctions;
    }
}

But, Serializer.read should throw exception. Shouldn't it?

Related

Bugs: #41

Discussion

  • Marko Matic

    Marko Matic - 2014-03-14

    XML example in issue is:

    \

    Server Error (500)\

    without "\" signs.

     
  • philipp

    philipp - 2014-03-17

    Maybe similar to bug [#33].

     

    Related

    Bugs: #33


Log in to post a comment.