code: protected Class<?> resolveClass(ObjectStreamClass osClass)
              throws IOException, ClassNotFoundException {
          // fastpath: obtain cached value
          Class<?> cls = osClass.forClass();
          if (cls == null) {
              // slowpath: resolve the class
              String className = osClass.getName();
  
              // if it is primitive class, for example, long.class
              cls = PRIMITIVE_CLASSES.get(className);
  
              if (cls == null) {
                  // not primitive class
                  // Use the first non-null ClassLoader on the stack. If null, use
                  // the system class loader
                  cls = Class.forName(className, true, callerClassLoader);
              }
          }
          return cls;
      }
docs: Loads the Java class corresponding to the class descriptor {@code
  osClass} that has just been read from the source stream.
  
  @param osClass
  an ObjectStreamClass read from the source stream.
  @return a Class corresponding to the descriptor {@code osClass}.
  @throws ClassNotFoundException
  if the class for an object cannot be found.
  @throws IOException
  if an I/O error occurs while creating the class.
  @see ObjectOutputStream#annotateClass(Class)