title: Snakeyaml : properties with generics extended maps
body: <p>It's about snakeyaml 1.11 and yaml.</p>
  
  <p>When I dump a bean with a property with an extended generic map, snakeyaml crash.</p>
  
  <p>Here is an extended generic map :</p>
  
  <pre><code>  public static class MyStupidHash&lt;T&gt; extends java.util.HashMap&lt;String, T&gt;
    {    
    }
  </code></pre>
  
  <p>Here is a bean with properties snakeyam can't dump :</p>
  
  <pre><code>  public class FactoryOfStupid
    {
      public MyStupidHash&lt;Integer&gt; getStupid()
      {
        return new MyStupidHash&lt;Integer&gt;();
      }
    }
  </code></pre>
  
  <p>When I dump a FactoryOfStupid object with snakeyaml, I get :</p>
  
  <pre><code>java.lang.ArrayIndexOutOfBoundsException: 1
      at org.yaml.snakeyaml.representer.Representer.checkGlobalTag(Representer.java:204)
      at org.yaml.snakeyaml.representer.Representer.representJavaBeanProperty(Representer.java:144)
      at org.yaml.snakeyaml.representer.Representer.representJavaBean(Representer.java:83)
      at org.yaml.snakeyaml.representer.Representer$RepresentJavaBean.representData(Representer.java:49)
      at org.yaml.snakeyaml.representer.BaseRepresenter.representData(BaseRepresenter.java:109)
      at org.yaml.snakeyaml.representer.BaseRepresenter.represent(BaseRepresenter.java:65)
      at org.yaml.snakeyaml.Yaml.dumpAll(Yaml.java:270)
      at org.yaml.snakeyaml.Yaml.dumpAll(Yaml.java:261)
      at org.yaml.snakeyaml.Yaml.dumpAll(Yaml.java:233)
      at org.yaml.snakeyaml.Yaml.dump(Yaml.java:209)
  </code></pre>
  
  <p>Here is all the junit test :</p>
  
  <pre><code>/*
   */
  package unitaire;
  
  import java.util.HashMap;
  import org.junit.*;
  import org.yaml.snakeyaml.DumperOptions;
  import org.yaml.snakeyaml.Yaml;
  
  /**
   *
   * @author herve
   */
  public class YamlRepresenterUnitTest
  {  
    public YamlRepresenterUnitTest()
    {
    }
  
    @BeforeClass
    public static void setUpClass() throws Exception
    {
    }
  
    @AfterClass
    public static void tearDownClass() throws Exception
    {
    }
  
    @Before
    public void setUp()
    {
    }
  
    @After
    public void tearDown()
    {
    }
  
    @Test
    public void onMyStupidHash() throws Exception
    {
      MyStupidHash&lt;Integer&gt; shash;
      Yaml yaml;
      String txt;
      DumperOptions options;
      FactoryOfStupid fact;
  
      fact = new FactoryOfStupid();
      shash = fact.getStupid();
      shash.put("toto", new Integer(10));
      options = new DumperOptions();
      options.setAllowReadOnlyProperties(true);
      yaml = new Yaml(options);
      txt = yaml.dump(fact);
  System.out.println("txt="+txt);
    }
  
    public static class MyStupidHash&lt;T&gt; extends java.util.HashMap&lt;String, T&gt;
    {    
    }
  
    public class FactoryOfStupid
    {
      public MyStupidHash&lt;Integer&gt; getStupid()
      {
        return new MyStupidHash&lt;Integer&gt;();
      }
    }
  }
  </code></pre>
  
  <p>Is there a miraculous option in snakeyaml for dump this sort of things ?</p>
  
  <p>Thanks.</p>