Attachments are only structurally different if one step has an inline attachment
and the other step either has no inline attachment or the inline attachment is
different.
172015
boolean attachmentsAreStructurallyDifferent( List<AttachmentModel> firstAttachments, List<AttachmentModel> otherAttachments ) {
        if( firstAttachments.size() != otherAttachments.size() ) {
            return true;
        }

        for( int i = 0; i < firstAttachments.size(); i++ ) {
            if( attachmentIsStructurallyDifferent( firstAttachments.get( i ), otherAttachments.get( i ) ) ) {
                return true;
            }
        }
        return false;
    }
923762
public boolean isInstanceDependencyChainAcyclic() {

		final AbstractJobVertex[] allVertices = this.getAllJobVertices();
		final Set<AbstractJobVertex> alreadyVisited = new HashSet<AbstractJobVertex>();

		for (AbstractJobVertex vertex : allVertices) {

			if (alreadyVisited.contains(vertex)) {
				continue;
			}

			AbstractJobVertex vertexToShareInstancesWith = vertex.getVertexToShareInstancesWith();
			if (vertexToShareInstancesWith != null) {

				final Set<AbstractJobVertex> cycleMap = new HashSet<AbstractJobVertex>();

				while (vertexToShareInstancesWith != null) {

					if (cycleMap.contains(vertexToShareInstancesWith)) {
						return false;
					} else {
						alreadyVisited.add(vertexToShareInstancesWith);
						cycleMap.add(vertexToShareInstancesWith);
						vertexToShareInstancesWith = vertexToShareInstancesWith.getVertexToShareInstancesWith();
					}
				}
			}
		}

		return true;
	}
197629
function difference(template, override) {
    var ret = {};
    for (var name in template) {
        if (name in override) {
            if (isObject(override[name])) {
                var diff = difference(template[name], override[name]);
                if (!_.isEmpty(diff)) {
                    ret[name] = diff;
                }
            } else if (!_.isEqual(template[name], override[name])) {
                ret[name] = override[name];
            }
        }
    }
    return ret;
}
1355575
public static DifferenceEvaluator ignorePrologDifferences() {
        return new DifferenceEvaluator() {
            @Override
            public ComparisonResult evaluate(Comparison comparison, ComparisonResult orig) {
                return belongsToProlog(comparison, true)
                    || isSequenceOfRootElement(comparison)
                    ? ComparisonResult.EQUAL : orig;
            }
        };
    }
757866
private static boolean envelopeContainsEnvelope_(Envelope2D env_a,
			Envelope2D env_b, double tolerance, ProgressTracker progress_tracker) {
		if (!envelopeInfContainsEnvelope_(env_a, env_b, tolerance))
			return false;

		if (env_a.getHeight() <= tolerance && env_a.getWidth() <= tolerance) {
			Point2D pt_a = env_a.getCenter();
			return pointWithinEnvelope_(pt_a, env_b, tolerance,
					progress_tracker);
		}

		if (env_b.getHeight() <= tolerance && env_b.getWidth() <= tolerance) {
			Point2D pt_b = env_b.getCenter();
			return pointWithinEnvelope_(pt_b, env_a, tolerance,
					progress_tracker);
		}

		if (env_a.getHeight() <= tolerance || env_a.getWidth() <= tolerance)
			return envelopeInfContainsEnvelope_(env_a, env_b, tolerance); // treat
																			// env_b
																			// as
																			// line

		// treat env_a as area

		if (env_b.getHeight() <= tolerance || env_b.getWidth() <= tolerance) {// treat
																				// env_b
																				// as
																				// line

			Envelope2D env_a_deflated = new Envelope2D();
			env_a_deflated.setCoords(env_a);
			env_a_deflated.inflate(-tolerance, -tolerance);

			if (env_a_deflated.containsExclusive(env_b))
				return true;

			Envelope2D env_inter = new Envelope2D();
			env_inter.setCoords(env_a_deflated);
			env_inter.intersect(env_b);

			if (env_inter.isEmpty()
					|| (env_inter.getHeight() <= tolerance && env_inter
							.getWidth() <= tolerance))
				return false;

			return true;
		}

		return envelopeInfContainsEnvelope_(env_a, env_b, tolerance);
	}
156051
static NodeDifference diff(ProductPartitionNode originalNode,
      ProductPartitionNode newNode, Comparator<ProductDimension> dimensionComparator) {
    NodeDifference nodeDifference;
    if (originalNode == null && newNode == null) {
      nodeDifference = NodeDifference.NONE;
    } else if (originalNode == null) {
      nodeDifference = NodeDifference.NEW_NODE;
    } else if (newNode == null) {
      nodeDifference = NodeDifference.REMOVED_NODE;
    } else if (dimensionComparator.compare(originalNode.getDimension(), newNode.getDimension())
        != 0) {
      throw new IllegalArgumentException(
          "Original node and new node are not for the same product dimension");
    } else if (originalNode.isUnit() != newNode.isUnit()) {
      nodeDifference = NodeDifference.PARTITION_TYPE_CHANGE;
    } else if (originalNode.isExcludedUnit() != newNode.isExcludedUnit()) {
      nodeDifference = NodeDifference.EXCLUDED_UNIT_CHANGE;
    } else if (!originalNode.isExcludedUnit() && originalNode.isUnit() && newNode.isUnit()) {
      // Both nodes are non-excluded units - the only possible differences
      // left are from the bid, tracking URL template, or custom parameters.
      nodeDifference = NodeDifference.NONE;
      if (!Objects.equals(originalNode.getBid(), newNode.getBid())) {
        nodeDifference = NodeDifference.BIDDABLE_UNIT_CHANGE;
      }
      if (!Objects.equals(
          originalNode.getTrackingUrlTemplate(), newNode.getTrackingUrlTemplate())) {
        nodeDifference = NodeDifference.BIDDABLE_UNIT_CHANGE;
      }
      if (!Objects.equals(originalNode.getCustomParameters(), newNode.getCustomParameters())) {
        nodeDifference = NodeDifference.BIDDABLE_UNIT_CHANGE;
      }
    } else {
      nodeDifference = NodeDifference.NONE;
    }
    return nodeDifference;
  }
1228285
function findAttachmentParts(struct, attachments) {
        attachments = attachments || [];
        for (let i = 0, len = struct.length, r; i < len; ++i) {
            if (Array.isArray(struct[i])) {
                findAttachmentParts(struct[i], attachments);
            } else {
                if (struct[i].disposition && ['INLINE', 'ATTACHMENT'].indexOf(toUpper(struct[i].disposition.type)) > -1) {
                    attachments.push(struct[i]);
                }
            }
        }
        return attachments;
    }
1034337
function isEmptyBeforeStep(step) {
        return step.keyword.trim() === 'Before' && step.name === undefined && step.embeddings === undefined;
    }
330179
private boolean isSameStructure(INode source, INode target) {
        boolean result = false;
        if (null != source && null != target) {
            if (source.getChildrenList() != null && target.getChildrenList() != null) {
                int sourceChildren = source.getChildrenList().size();
                int targetChildren = target.getChildrenList().size();
                if (sourceChildren == 0 && targetChildren == 0) {
                    result = true;
                } else if (sourceChildren > 0 && targetChildren > 0) {
                    result = true;
                }
            } else if (source.getChildrenList() == null && target.getChildrenList() == null) {
                result = true;
            }
        } else if (null == source && null == target) {
            result = true;
        }
        return result;
    }
1195787
@SuppressWarnings("PMD.SimplifyBooleanReturns")
    private boolean differentAttributes(Method m1, Method m2) {
        if (m1.getAnnotationEntries().length > 0 || m2.getAnnotationEntries().length > 0) {
            return true;
        }
        int access1 = m1.getAccessFlags()
                & (Const.ACC_PRIVATE | Const.ACC_PROTECTED | Const.ACC_PUBLIC | Const.ACC_FINAL);
        int access2 = m2.getAccessFlags()
                & (Const.ACC_PRIVATE | Const.ACC_PROTECTED | Const.ACC_PUBLIC | Const.ACC_FINAL);


        m1.getAnnotationEntries();
        if (access1 != access2) {
            return true;
        }
        if (!thrownExceptions(m1).equals(thrownExceptions(m2))) {
            return false;
        }
        return false;
    }
820711
private static boolean relate(Point point_a, Envelope envelope_b,
			SpatialReference sr, int relation, ProgressTracker progress_tracker) {
		if (point_a.isEmpty() || envelope_b.isEmpty()) {
			if (relation == Relation.disjoint)
				return true; // Always true

			return false; // Always false
		}

		Point2D pt_a = point_a.getXY();
		Envelope2D env_b = new Envelope2D(), env_merged = new Envelope2D();
		envelope_b.queryEnvelope2D(env_b);
		env_merged.setCoords(pt_a);
		env_merged.merge(env_b);

		double tolerance = InternalUtils.calculateToleranceFromGeometry(sr,
				env_merged, false);

		switch (relation) {
		case Relation.disjoint:
			return pointDisjointEnvelope_(pt_a, env_b, tolerance,
					progress_tracker);

		case Relation.within:
			return pointWithinEnvelope_(pt_a, env_b, tolerance,
					progress_tracker);

		case Relation.contains:
			return pointContainsEnvelope_(pt_a, env_b, tolerance,
					progress_tracker);

		case Relation.equals:
			return pointEqualsEnvelope_(pt_a, env_b, tolerance,
					progress_tracker);

		case Relation.touches:
			return pointTouchesEnvelope_(pt_a, env_b, tolerance,
					progress_tracker);

		default:
			break; // warning fix
		}

		return false;
	}
67484
private void validateDepDefinitionUniqueness(final List<FlowTriggerDependency> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final FlowTriggerDependency dep : dependencies) {
      final Map<String, String> props = dep.getProps();
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format
          ("duplicate dependency config %s found, dependency config should be unique",
              dep.getName()));
    }
  }
502487
private boolean namesAreEqual(Dependency dependency, Dependency nextDependency) {
        return dependency.getName() != null && dependency.getName().equals(nextDependency.getName());
    }
426978
private DifferenceEngineContract getDifferenceEngine() {
        if (differenceEngine == null) {
            if (
                XMLUnit.getIgnoreAttributeOrder()
                &&
                (!usesUnknownElementQualifier()
                 || XMLUnit.getCompareUnmatched())
                ) {
                return new NewDifferenceEngine(this, matchTrackerDelegate);
            }
            return new DifferenceEngine(this, matchTrackerDelegate);
        }
        return differenceEngine;
    }
801404
public boolean isEquivalentTo(Semver version) {
        // Get versions without build
        Semver sem1 = this.getBuild() == null ? this : new Semver(this.getValue().replace("+" + this.getBuild(), ""));
        Semver sem2 = version.getBuild() == null ? version : new Semver(version.getValue().replace("+" + version.getBuild(), ""));
        // Compare those new versions
        return sem1.isEqualTo(sem2);
    }
870877
protected function maybeShiftAttachment() {

		if ( ! in_the_loop() || 'attachment' !== get_post_type() ) {
			return;
		}

		if ( in_array( $this->name, [ 'entry', 'post', 'entry/archive', 'entry/single' ] ) ) {

			remove_filter( 'the_content', 'prepend_attachment' );

		} elseif ( 'embed' === $this->name ) {

			remove_filter( 'the_content',       'prepend_attachment'          );
			remove_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' );
		}
	}
162430
private boolean isStereoBond(IBond bond) {
        return bond.getStereo() != IBond.Stereo.NONE && bond.getStereo() != (IBond.Stereo) CDKConstants.UNSET
                && bond.getStereo() != IBond.Stereo.E_Z_BY_COORDINATES;
    }