title: Error converting JSON string to map in Java using Jackson
body: <p>I have this little piece of code, and I'm trying to convert a JSON string to a map.</p>
  
  <pre><code>String json = "[{'code':':)','img':'&lt;img src=/faccine/sorriso.gif&gt;'}]";
  ObjectMapper mapper = new ObjectMapper();
  Map&lt;String,String&gt; userData = mapper.readValue(json,new TypeReference&lt;HashMap&lt;String,String&gt;&gt;() { });
  </code></pre>
  
  <p>But it returns the following error:</p>
  
  <pre><code>org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.HashMap out of START_ARRAY token
   at [Source: java.io.StringReader@1b1756a4; line: 1, column: 1]
      at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
      at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:198)
      at org.codehaus.jackson.map.deser.MapDeserializer.deserialize(MapDeserializer.java:151)
      at org.codehaus.jackson.map.deser.MapDeserializer.deserialize(MapDeserializer.java:25)
      at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2131)
      at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1402)
      at CodeSnippet_19.run(CodeSnippet_19.java:13)
      at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain1.eval(ScrapbookMain1.java:20)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.evalLoop(ScrapbookMain.java:54)
      at org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain.main(ScrapbookMain.java:35)
  </code></pre>
  
  <p>What am I doing wrong?</p>