title: @SuppressWarnings("serial")
body: <p>I have a question because I'm getting a little confused (or maybe I'm not noticing something obvious). Let's say that I've got some source code that contains a lot of classes which contain a great number of static fields defined like this one:</p>
  
  <pre><code>public final class ConverterTYPE  {
      private final static HashMap&lt;String, Byte&gt; STRING_MAP = new HashMap&lt;String, Byte&gt;() {
          {
              put("A", new Byte((byte)12));
              put("B", new Byte((byte)13));
          }
      };
  
  }
  </code></pre>
  
  <p>As we all know, static fields are not going to be serialized.</p>
  
  <p>However, Java (and Eclipse) complains that "The serializable class  does not declare a static final serialVersionUID field of type long". Why can't they notice that static is not going to be serialized?</p>
  
  <p>And the next question: would it be a right solution to this issue to use <code>@SuppressWarnings("serial")</code> to get rid of all such warnings?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>None of my classes implements Serializable interface (or none of their superclasses). And Eclipse is pointing at <code>HashMap&lt;String, Byte&gt;</code> with its warnings. Why doesn't it detect that it's static field?</p>