title: Unnecessary boxing inspection reported by IDE
body: <h2>Unnecessary boxing inspection reported by IDE</h2>
  
  <p>I was recently checking out some code that was posted on Oracle tutorials regarding Swing#JTable. There were a few warning messages that were returned by IntelIJ regarding the boxing of primitive variables inside the multidimensional array holding the Table data.</p>
  
  <hr>
  
  <p><strong>Here is the array found which is taken from <a href="http://docs.oracle.com/javase/tutorial/uiswing/examples/components/SimpleTableDemoProject/src/components/SimpleTableDemo.java" rel="noreferrer">docs.oracle.com</a>:</strong></p>
  
  <pre><code>Object[][] data = {
              {"Kathy", "Smith",
                      "Snowboarding", new Integer(5), new Boolean(false)},
              {"John", "Doe",
                      "Rowing", new Integer(3), new Boolean(true)},
              {"Sue", "Black",
                      "Knitting", new Integer(2), new Boolean(false)},
              {"Jane", "White",
                      "Speed reading", new Integer(20), new Boolean(true)},
              {"Joe", "Brown",
                      "Pool", new Integer(10), new Boolean(false)}
      };
  </code></pre>
  
  <hr>
  
  <p><strong>All the wrapped variables were receiving this message:</strong></p>
  
  <blockquote>
    <p>"Unnecessary boxing 'new Integer(5)' 
    Reports "boxing", e.g. wrapping of primitive values in objects. Boxing is unnecessary under Java 5 and newer, and can be safely removed.
    This inspection only reports if the project or module is configured to use a language level of 5.0 or higher."</p>
  </blockquote>
  
  <hr>
  
  <p>I know the concept of boxing and unboxing in Java, my question would be as to why it's <em>'irrelevant'</em> in newer version of Java as I've seen many developers discuss it or use it recently.</p>
  
  <p>Also, since boxing is not required what should 'new Integer(5)' be replaced with?</p>