private void compareValueType(
      CompareContext context, String id, ModelNode current, ModelNode legacy) {
    ModelNode currentValueType = current.get(VALUE_TYPE);
    ModelNode legacyValueType = legacy.get(VALUE_TYPE);
    if (!currentValueType.isDefined() && !legacyValueType.isDefined()) {
      return;
    }
    if (isType(legacyValueType) || isType(currentValueType)) {
      if (!currentValueType.equals(legacyValueType)) {
        context.println(
            "Different 'value-type' for "
                + id
                + ". Current: "
                + current.get(VALUE_TYPE)
                + "; legacy: "
                + legacy.get(VALUE_TYPE));
      }
    } else {
      Map<String, ModelNode> legacyValueTypes = createMapIndexedByKey(legacyValueType);
      Map<String, ModelNode> currentValueTypes = createMapIndexedByKey(currentValueType);

      compareKeySetsAndRemoveMissing(
          context, "value-type for " + id, currentValueTypes, legacyValueTypes);
      for (Map.Entry<String, ModelNode> entry : currentValueTypes.entrySet()) {
        ModelNode currentEntry = entry.getValue();
        ModelNode legacyEntry = legacyValueTypes.get(entry.getKey());
        compareAttributeOrOperationParameter(
            context,
            "value-type key '" + entry.getKey() + "' for " + id,
            currentEntry,
            legacyEntry);
      }
    }
  }
 private void compareType(CompareContext context, String id, ModelNode current, ModelNode legacy) {
   if (!current.get(TYPE).equals(legacy.get(TYPE))) {
     context.println(
         "Different 'type' for "
             + id
             + ". Current: "
             + current.get(TYPE)
             + "; legacy: "
             + legacy.get(TYPE));
   }
 }
 private void compareAlternatives(
     CompareContext context, String id, ModelNode current, ModelNode legacy) {
   if (!current.get(ALTERNATIVES).equals(legacy.get(ALTERNATIVES))) {
     context.println(
         "Different 'alternatives' for "
             + id
             + ". Current: "
             + current.get(ALTERNATIVES)
             + "; legacy: "
             + legacy.get(ALTERNATIVES));
   }
 }
 private void compareDeprecated(
     CompareContext context, String id, ModelNode current, ModelNode legacy) {
   if (!current.get(DEPRECATED).equals(legacy.get(DEPRECATED))) {
     context.println(
         "Different 'deprecated' for "
             + id
             + ". Current: "
             + current.get(DEPRECATED)
             + "; legacy: "
             + legacy.get(DEPRECATED));
   }
 }
 private void compareDefault(
     CompareContext context, String id, ModelNode current, ModelNode legacy) {
   if (!current.get(DEFAULT).equals(legacy.get(DEFAULT))) {
     context.println(
         "Different 'default' for "
             + id
             + ". Current: "
             + current.get(DEFAULT)
             + "; legacy: "
             + legacy.get(DEFAULT));
   }
 }
 private void compareExpressionsAllowed(
     CompareContext context, String id, ModelNode current, ModelNode legacy) {
   boolean currentNillable = current.get(EXPRESSIONS_ALLOWED).asBoolean(false);
   boolean legacyNillable = legacy.get(EXPRESSIONS_ALLOWED).asBoolean(false);
   if (currentNillable != legacyNillable) {
     context.println(
         "Different 'expressions-allowed' for "
             + id
             + ". Current: "
             + currentNillable
             + "; legacy: "
             + legacyNillable);
   }
 }
 private void compareNillable(
     CompareContext context, String id, ModelNode current, ModelNode legacy) {
   boolean currentNillable = current.get(NILLABLE).asBoolean(false);
   boolean legacyNillable = legacy.get(NILLABLE).asBoolean(false);
   if (currentNillable != legacyNillable) {
     context.println(
         "Different 'nillable' for "
             + id
             + ". Current: "
             + currentNillable
             + "; legacy: "
             + legacyNillable);
   }
 }
  private void compareSetsAndRemoveMissing(
      CompareContext context, String type, Set<String> currentSet, Set<String> legacySet) {
    Set<String> extraInLegacy = getMissingNames(context, legacySet, currentSet);
    Set<String> extraInCurrent = getMissingNames(context, currentSet, legacySet);

    if (extraInLegacy.size() > 0 || extraInCurrent.size() > 0) {
      context.println(
          "Missing "
              + type
              + " in current: "
              + extraInLegacy
              + "; missing in legacy "
              + extraInCurrent);
      if (extraInCurrent.size() > 0) {
        currentSet.removeAll(extraInCurrent);
      }
      if (extraInLegacy.size() > 0) {
        legacySet.removeAll(extraInLegacy);
      }
    }
  }