예제 #1
0
 @Override
 boolean evolve(Format newFormatParam, Evolver evolver) {
   if (!(newFormatParam instanceof ProxiedFormat)) {
     evolver.addEvolveError(
         this, newFormatParam, null, "A proxied class may not be changed to a different type");
     return false;
   }
   ProxiedFormat newFormat = (ProxiedFormat) newFormatParam;
   if (!evolver.evolveFormat(proxyFormat)) {
     return false;
   }
   Format newProxyFormat = proxyFormat.getLatestVersion();
   if (!newProxyFormat.getClassName().equals(newFormat.getProxyClassName())) {
     evolver.addEvolveError(
         this,
         newFormat,
         null,
         "The proxy class for this type has been changed from: "
             + newProxyFormat.getClassName()
             + " to: "
             + newFormat.getProxyClassName());
     return false;
   }
   if (newProxyFormat != proxyFormat) {
     evolver.useEvolvedFormat(this, this, newFormat);
   } else {
     evolver.useOldFormat(this, newFormat);
   }
   return true;
 }
  @Override
  boolean evolve(Format newFormat, Evolver evolver) {

    /*
     * When the class name of the component changes, we need a new format
     * that references it.  Otherwise, don't propogate changes from
     * components upward to their arrays.
     */
    Format latest = componentFormat.getLatestVersion();
    if (latest != componentFormat
        && !latest.getClassName().equals(componentFormat.getClassName())) {
      evolver.useEvolvedFormat(this, newFormat, newFormat);
    } else {
      evolver.useOldFormat(this, newFormat);
    }
    return true;
  }