title: How can the generic Map for the font attributes be specified?
body: <p>I have this method which jdk1.6 complains (no error just warning) about the generic type parameterizing is not used in the Map and ...:</p>
  
  <pre><code>public static Font getStrikethroughFont(String name, int properties, int size)
      {
          Font font = new Font(name, properties, size); 
  
          Map  attributes = font.getAttributes(); 
          attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON); 
          Font newFont = new Font(attributes); 
          return newFont;             
      }
  </code></pre>
  
  <p>Then I changed to the following:</p>
  
  <pre><code>public static Font getStrikethroughFont2(String name, int properties, int size)
      {
          Font font = new Font(name, properties, size); 
  
          Map&lt;TextAttribute, ?&gt;  attributes = font.getAttributes(); 
          attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON); 
          Font newFont = new Font(attributes); 
          return newFont;             
      }
  </code></pre>
  
  <p>but the </p>
  
  <pre><code>attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON); 
  </code></pre>
  
  <p>statement is not valid anymore.</p>
  
  <p><code>TextAttribute.STRIKETHROUGH_ON</code> is a Boolean.</p>
  
  <p>How can I use Generic Type feature in above method? I have looked at the Core Java book but didn't find an answer. Anybody can help me?</p>