<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to bugs</title><link>https://sourceforge.net/p/simple/bugs/</link><description>Recent changes to bugs</description><atom:link href="https://sourceforge.net/p/simple/bugs/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 14 Jan 2016 15:57:06 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/simple/bugs/feed.rss" rel="self" type="application/rss+xml"/><item><title>#42 Exception during deserialization after upgrading to new java version</title><link>https://sourceforge.net/p/simple/bugs/42/?limit=25#00c0</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I made more tests and it seems to fix the bug the DetailScanner.methods(Class) should be changed as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;   private void methods(Class type) {
      Method[] list = type.getDeclaredMethods();

      for(Method method : list) {
         if (!method.isBridge()) {  // FIX
            MethodDetail detail = new MethodDetail(method);
            methods.add(detail);
         }
      }
   }
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Piotr</dc:creator><pubDate>Thu, 14 Jan 2016 15:57:06 -0000</pubDate><guid>https://sourceforge.net5900aea94fea687144f9044ae0d43e536255b0ec</guid></item><item><title>#42 Exception during deserialization after upgrading to new java version</title><link>https://sourceforge.net/p/simple/bugs/42/?limit=25#6618</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;To filter out bridge methods the java.lang.reflect.Method.isBridge() can be used.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Piotr</dc:creator><pubDate>Thu, 14 Jan 2016 14:57:06 -0000</pubDate><guid>https://sourceforge.net8348df50f24c6ffb9354aa96eaab6cb40391e6b4</guid></item><item><title>Exception during deserialization after upgrading to new java version</title><link>https://sourceforge.net/p/simple/bugs/42/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;After upgrading java on my workstation I am observing one of these two exceptions during xml deserialization:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
&lt;/pre&gt;&lt;/div&gt;


&lt;div class="codehilite"&gt;&lt;pre&gt;org.simpleframework.xml.core.MethodException: Method types do not match for value in class java.lang.String
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I investigated the problem and found out that this exception is thrown, because of java bug fix JDK-6695379 introduced in version 1.7.0_80 (Oracle Corporation). With this fix java compiler copies annotations to bridge methods. Therefore method MethodScanner.build(MethodPart, MethodPart) throws an exception, because cannot match get() and set() types. Or the ClassCastException is thrown, because the bridge with wrong data type is chosen.&lt;/p&gt;
&lt;p&gt;I am attaching an example program demonstrating this problem. To test it, run the SerializationUtilsTest.testDeserializeXml test on Oracle java version 1.7.0_79 (the test should pass) and on Oracle java version 1.7.0_80 or higher (the test should fail).&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Piotr</dc:creator><pubDate>Thu, 14 Jan 2016 14:55:54 -0000</pubDate><guid>https://sourceforge.net206a33fc4df42ef6da0e63967b6a20923d01b19a</guid></item><item><title>#41 Transform ignores the name specified in the Root tag.</title><link>https://sourceforge.net/p/simple/bugs/41/?limit=100#2c20</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Maybe related to bug &lt;a class="alink" href="/p/simple/bugs/35/"&gt;[#35]&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philipp</dc:creator><pubDate>Thu, 10 Dec 2015 21:10:23 -0000</pubDate><guid>https://sourceforge.net66511d98af6df925220c2e0f5599d3aaeaee7db2</guid></item><item><title>Transform ignores the name specified in the Root tag.</title><link>https://sourceforge.net/p/simple/bugs/41/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;If you create a class with a tag Root(name=xxx) and that class has a Transform registered, the serialization to XML will ignore the name specified in the tag Root and will just use the name of the class. This ony happens if the class is the root tag of the XML, because if you use it as an attribute or element in another class, it will take the name specified there.&lt;br/&gt;
See attached poject to play with the bug&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Phyambre</dc:creator><pubDate>Sun, 04 Oct 2015 14:28:59 -0000</pubDate><guid>https://sourceforge.net73e5fd2dc65ee732347d3d0c33c15398cf9c987d</guid></item><item><title>#40 Converter and Transformer violate contract of ElementUnion during deserialization</title><link>https://sourceforge.net/p/simple/bugs/40/?limit=25#2b90</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Note, I have a problem showing the XML, but it is correct: inside the tag x there is a tag b as expected. Anyway, you can try it in the code.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Phyambre</dc:creator><pubDate>Tue, 22 Sep 2015 14:38:33 -0000</pubDate><guid>https://sourceforge.net5e0e9052e5f505d4cdfb2c02b2155511431150b4</guid></item><item><title>Converter and Transformer violate contract of ElementUnion during deserialization</title><link>https://sourceforge.net/p/simple/bugs/40/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Let us imagine 3 classes: &lt;em&gt;A&lt;/em&gt;, &lt;em&gt;B&lt;/em&gt; extends &lt;em&gt;A&lt;/em&gt;, and &lt;em&gt;C&lt;/em&gt; extends &lt;em&gt;A&lt;/em&gt;, all representing tags without attributes or inner elements. And now a fouth class &lt;em&gt;X&lt;/em&gt; containg the ElementUnion:&lt;/p&gt;
&lt;p&gt;@ElementUnion({&lt;br/&gt;
    @Element(name="b", type=B.class, required=false),&lt;br/&gt;
    @Element(name="c", type=C.class, required=false)&lt;br/&gt;
})&lt;br/&gt;
protected A a;&lt;/p&gt;
&lt;p&gt;It seems clear that if the inner tag of &lt;em&gt;X&lt;/em&gt; tag is &lt;em&gt;b&lt;/em&gt;, the attribute &lt;em&gt;a&lt;/em&gt; should be an instance of &lt;em&gt;B&lt;/em&gt;. For example, for the code:&lt;/p&gt;
&lt;p&gt;X x = new X(new B());&lt;br/&gt;
Object retrievedObject = null;&lt;br/&gt;
serializer.write(x, tmpFile);&lt;br/&gt;
System.out.println("Written Object: " + x);&lt;br/&gt;
retrievedObject = serializer.read(X.class, tmpFile);&lt;br/&gt;
System.out.println("Retrieved Object: " + retrievedObject);&lt;/p&gt;
&lt;p&gt;The expected output is:&lt;br/&gt;
Written Object: X &lt;span&gt;[a=B []&lt;/span&gt;]&lt;br/&gt;
Retrieved Object: X &lt;span&gt;[a=B []&lt;/span&gt;]&lt;/p&gt;
&lt;p&gt;The problem seems to happen due deserialization, because the XML file seems correct:&lt;br/&gt;
&amp;lt;x&amp;gt;&lt;br/&gt;
   &lt;b&gt;&lt;/b&gt;&lt;br/&gt;
&amp;lt;/x&amp;gt;&lt;/p&gt;
&lt;p&gt;However if &lt;em&gt;A&lt;/em&gt; is a class (not an interface) and &lt;em&gt;A&lt;/em&gt; has a converter, then the output is (independently of whether B has also a converter or not):&lt;br/&gt;
Written Object: X &lt;span&gt;[a=B []&lt;/span&gt;]&lt;br/&gt;
Retrieved Object: X &lt;span&gt;[a=A []&lt;/span&gt;]&lt;br/&gt;
Which is wrong, because the attribute a should only be of type &lt;em&gt;B&lt;/em&gt; or &lt;em&gt;C&lt;/em&gt; according to the type attriubute of the annotation ElementUnion. This does not happen with interfaces because they cannot be instantiated.&lt;/p&gt;
&lt;p&gt;In addition, if there are no converters, but we set matchers, the output becomes:&lt;br/&gt;
Written Object: X &lt;span&gt;[a=B []&lt;/span&gt;]&lt;br/&gt;
Retrieved Object: X &lt;span&gt;[a=null]&lt;/span&gt;&lt;br/&gt;
Which should also be wrong, although it does not violate the contract.&lt;/p&gt;
&lt;p&gt;I attach a sample code so you can play with it and see the results.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Phyambre</dc:creator><pubDate>Tue, 22 Sep 2015 14:37:10 -0000</pubDate><guid>https://sourceforge.net0ac5f8645cb6f8022ac6c44228233dbf57058347</guid></item><item><title>ContainerServer and Server are missing from the maven repository</title><link>https://sourceforge.net/p/simple/bugs/39/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Can you recreate the jars on the maven repository for 6.0.1 with all the classes? ContainerServer and Server are missing.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andre Francois</dc:creator><pubDate>Wed, 15 Jul 2015 05:18:26 -0000</pubDate><guid>https://sourceforge.net5cc9f2a8cff05d299c3c295ce5709b717067a1ad</guid></item><item><title>#38 StackOverflowError (recursion) during Exception serialization (PrefixResolver.resolvePrefix/getPrefix)</title><link>https://sourceforge.net/p/simple/bugs/38/?limit=25#afd6</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Friendly reminder&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philipp</dc:creator><pubDate>Sun, 15 Mar 2015 23:07:04 -0000</pubDate><guid>https://sourceforge.netc9e7b38747737998528d149377bbacb23fa6c1b7</guid></item><item><title>StackOverflowError (recursion) during Exception serialization (PrefixResolver.resolvePrefix/getPrefix)</title><link>https://sourceforge.net/p/simple/bugs/38/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the great work. I'm using SimpleXML massively in my project. I'm getting a recursive exception when trying to serialize a n &lt;code&gt;Exception&lt;/code&gt; object:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="kr"&gt;thread&lt;/span&gt; &lt;span class="s"&gt;"main"&lt;/span&gt; &lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StackOverflowError&lt;/span&gt;
  &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;resolvePrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;183&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getPrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;resolvePrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;183&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getPrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;at&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simpleframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xml&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;resolvePrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PrefixResolver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;183&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;continues&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This code reproduces the exception:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;MainClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;SomeClass&lt;/span&gt; &lt;span class="n"&gt;someClass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;SomeClass&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;someClass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exception&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;StringWriter&lt;/span&gt; &lt;span class="n"&gt;stringWriter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;StringWriter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Persister&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;someClass&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stringWriter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stringWriter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;&amp;lt;&amp;lt; Bam!&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt; &lt;span class="n"&gt;SomeClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;private&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Related on StackOverflow:&lt;br /&gt;
&lt;a href="http://stackoverflow.com/questions/9676138/simple-xml-framework-weird-error/27620194#27620194" rel="nofollow"&gt;http://stackoverflow.com/questions/9676138/simple-xml-framework-weird-error/27620194#27620194&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Philipp</dc:creator><pubDate>Tue, 23 Dec 2014 12:25:46 -0000</pubDate><guid>https://sourceforge.netd5a2ce921bf87c3cc34bda9c83904b4b649e7c0c</guid></item></channel></rss>