code: private void verifyAndInit(ObjectStreamClass loadedStreamClass)
              throws InvalidClassException {
  
          Class<?> localClass = loadedStreamClass.forClass();
          ObjectStreamClass localStreamClass = ObjectStreamClass
                  .lookupStreamClass(localClass);
  
          if (loadedStreamClass.getSerialVersionUID() != localStreamClass
                  .getSerialVersionUID()) {
            // java.io.Serializable javadoc states "..., the requirement for
            // matching serialVersionUID values is waived for array classes."
            boolean isArray = loadedStreamClass.getName().startsWith("[");
            if (!isArray) {
              throw new InvalidClassException(loadedStreamClass.getName(),
                      "Incompatible class (SUID): " + loadedStreamClass +
                              " but expected " + localStreamClass);
            }
          }
  
          String loadedClassBaseName = getBaseName(loadedStreamClass.getName());
          String localClassBaseName = getBaseName(localStreamClass.getName());
  
          if (!loadedClassBaseName.equals(localClassBaseName)) {
              throw new InvalidClassException(loadedStreamClass.getName(),
                      String.format("Incompatible class (base name): %s but expected %s",
                              loadedClassBaseName, localClassBaseName));
          }
  
          loadedStreamClass.initPrivateFields(localStreamClass);
      }
docs: Verify if the SUID & the base name for descriptor
  <code>loadedStreamClass</code>matches
  the SUID & the base name of the corresponding loaded class and
  init private fields.
  
  @param loadedStreamClass
  An ObjectStreamClass that was loaded from the stream.
  
  @throws InvalidClassException
  If the SUID of the stream class does not match the VM class