title: Spring LDAP ODM - Entry class should be declared final Warning
body: <p>I have a mapped <code>Entry</code> ("entity") using Spring LDAP ODM. When I run unit tests with this class, I get a warning in the console upon initialization:</p>
  
  <pre><code>Mar 9, 2012 2:32:40 PM org.springframework.ldap.odm.core.impl.ObjectMetaData &lt;init&gt;
  WARNING: The Entry class Superhero should be declared final
  </code></pre>
  
  <p>The mapped class looks like this:</p>
  
  <pre><code>@Entry(objectClasses = {"batman", "superman", "spiderman", "dontworryaboutthese"})
  public class Superhero {
      @Id
      @JsonIgnore
      private Name dn;
      ...
  </code></pre>
  
  <p>I can't find anything relevant via Google search regarding this warning. Here's the Spring code that logs it:</p>
  
  <pre><code>public ObjectMetaData(Class&lt;?&gt; clazz) {
      if (LOG.isDebugEnabled()) {
          LOG.debug(String.format("Extracting metadata from %1$s", clazz));
      }
  
      // Get object class metadata - the @Entity annotation
      Entry entity = (Entry)clazz.getAnnotation(Entry.class);
      if (entity != null) {
          // Default objectclass name to the class name unless it's specified
          // in @Entity(name={objectclass1, objectclass2});
          String[] localObjectClasses = entity.objectClasses();
          if (localObjectClasses != null &amp;&amp; localObjectClasses.length &gt; 0 &amp;&amp; localObjectClasses[0].length() &gt; 0) {
              for (String localObjectClass:localObjectClasses) {
                  objectClasses.add(new CaseIgnoreString(localObjectClass));
              }
          } else {
              objectClasses.add(new CaseIgnoreString(clazz.getSimpleName()));
          }
      } else {
          throw new MetaDataException(String.format("Class %1$s must have a class level %2$s annotation", clazz,
                  Entry.class));
      }
  
      // Check the class is final
      if (!Modifier.isFinal(clazz.getModifiers())) {
          LOG.warn(String.format("The Entry class %1$s should be declared final", clazz.getSimpleName()));
      }
      ...
  </code></pre>
  
  <p>Any insight would be appreciated. I understand that declaring a class as final means it can't be extended, but why would Spring ODM care?</p>