Matches the major, minor and micro parts of this version to the other version

@param other The other version, can be <code>null</code> in which case this returns true.
@return
197233
public boolean matchesToMicros(LibertyVersion other) {
        if (other == null) {
            return true;
        }
        return this.major == other.major && this.minor == other.minor && this.micro == other.micro;
    }
344225
public boolean match( Artifact artifact )
        throws InvalidVersionSpecificationException
    {
        for ( Pattern pattern : patterns )
        {
            if ( pattern.match( artifact ) )
            {
                for ( Pattern ignorePattern : ignorePatterns )
                {
                    if ( ignorePattern.match( artifact ) )
                    {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    }
152576
public int compare(Version other) {
        if (other == null) throw new NullPointerException("other version is null");
        if (this._version < other._version) return -1;
        if (this._version > other._version) return 1;
        if (this._revision < other._revision) return -1;
        if (this._revision > other._revision) return 1;
        if (this._subrevision < other._subrevision) return -1;
        if (this._subrevision > other._subrevision) return 1;
        return 0;
    }
799466
def match(other)
      other = other.type if other.instance_of? AnnotatedArgType
      return true if other.instance_of? WildQuery
      return false unless other.instance_of? MethodType
      return false unless @ret.match(other.ret)
      if @block == nil
        return false unless other.block == nil
      else
        return false if other.block == nil
        return false unless @block.match(other.block)
      end
      # Check arg matches; logic is similar to pre_cond
      states = [[0,0]] # [position in self, position in other]
      until states.empty?
        s_arg, o_arg = states.pop
        return true if s_arg == @args.size && o_arg == other.args.size # everything matches
        next if s_arg >= @args.size # match not possible, not enough args in self
        if @args[s_arg].instance_of? DotsQuery then
          if o_arg == other.args.size
            # no args left in other, skip ...
            states << [s_arg+1, o_arg]
          else
            states << [s_arg+1, o_arg+1] # match, no more matches to ...
            states << [s_arg, o_arg+1]   # match, more matches to ... coming
          end
        else
          next if o_arg == other.args.size # match not possible, not enough args in other
          s_arg_t = @args[s_arg]
          s_arg_t = s_arg_t.type if s_arg_t.instance_of? AnnotatedArgType
          o_arg_t = other.args[o_arg]
          o_arg_t = o_arg_t.type if o_arg_t.instance_of? AnnotatedArgType
          next unless s_arg_t.match(o_arg_t)
          states << [s_arg+1, o_arg+1]
        end
      end
      return false
    end
805480
def matches_pattern(self, other):
        
        properties = self._message_properties()
        ismatch = False
        if isinstance(other, Message) and self.code == other.code:
            for prop in properties:
                for key, prop_val in prop.items():
                    if hasattr(other, key):
                        key_val = getattr(other, key)
                        ismatch = self._test_match(prop_val, key_val)
                    else:
                        ismatch = False
                    if not ismatch:
                        break
                if not ismatch:
                    break
        return ismatch
1346518
public boolean isGreaterThan(Semver version) {
        // Compare the main part
        if (this.getMajor() > version.getMajor()) return true;
        else if (this.getMajor() < version.getMajor()) return false;

        int otherMinor = version.getMinor() != null ? version.getMinor() : 0;
        if (this.getMinor() != null && this.getMinor() > otherMinor) return true;
        else if (this.getMinor() != null && this.getMinor() < otherMinor) return false;

        int otherPatch = version.getPatch() != null ? version.getPatch() : 0;
        if (this.getPatch() != null && this.getPatch() > otherPatch) return true;
        else if (this.getPatch() != null && this.getPatch() < otherPatch) return false;

        // Let's take a look at the suffix
        String[] tokens1 = this.getSuffixTokens();
        String[] tokens2 = version.getSuffixTokens();

        // If one of the versions has no suffix, it's greater!
        if (tokens1.length == 0 && tokens2.length > 0) return true;
        if (tokens2.length == 0 && tokens1.length > 0) return false;

        // Let's see if one of suffixes is greater than the other
        int i = 0;
        while (i < tokens1.length && i < tokens2.length) {
            int cmp;
            try {
                // Trying to resolve the suffix part with an integer
                int t1 = Integer.valueOf(tokens1[i]);
                int t2 = Integer.valueOf(tokens2[i]);
                cmp = t1 - t2;
            } catch (NumberFormatException e) {
                // Else, do a string comparison
                cmp = tokens1[i].compareToIgnoreCase(tokens2[i]);
            }
            if (cmp < 0) return false;
            else if (cmp > 0) return true;
            i++;
        }

        // If one of the versions has some remaining suffixes, it's greater
        return tokens1.length > tokens2.length;
    }
720038
public boolean versionGreaterOrEqual(int major, int minor, int patch) {
    if (this.majorVersion > major) {
      return true;
    }

    if (this.majorVersion < major) {
      return false;
    }

    /*
     * Major versions are equal, compare minor versions
     */
    if (this.minorVersion > minor) {
      return true;
    }
    if (this.minorVersion < minor) {
      return false;
    }

    //Minor versions are equal, compare patch version.
    return this.patchVersion >= patch;
  }
668502
public Tags merge(Tags other) {
    // Dereference "other" first as a null pointer check so we cannot risk returning null later.
    if (other.isEmpty()) {
      return this;
    }
    if (this.isEmpty()) {
      return other;
    }
    SortedMap<String, SortedSet<Object>> merged = new TreeMap<String, SortedSet<Object>>();
    for (Map.Entry<String, SortedSet<Object>> e : map.entrySet()) {
      SortedSet<Object> otherValues = other.map.get(e.getKey());
      if (otherValues == null || e.getValue().containsAll(otherValues)) {
        // Our values are a superset of the values in the other map, so just use them.
        merged.put(e.getKey(), e.getValue());
      } else if (otherValues.containsAll(e.getValue())) {
        // The other map's values are a superset of ours, so just use them.
        merged.put(e.getKey(), otherValues);
      } else {
        // Values exist in both maps and neither is a superset, so we really must merge.
        SortedSet<Object> mergedValues = new TreeSet<Object>(e.getValue());
        mergedValues.addAll(otherValues);
        merged.put(e.getKey(), Collections.unmodifiableSortedSet(mergedValues));
      }
    }
    for (Map.Entry<String, SortedSet<Object>> e : other.map.entrySet()) {
      // Finally add those values that were only in the other map.
      if (!map.containsKey(e.getKey())) {
        merged.put(e.getKey(), e.getValue());
      }
    }
    return new Tags(Collections.unmodifiableSortedMap(merged));
  }
203238
public boolean match(MimeType other) {
	if (this == other) return true;
	if (type != null && other.type != null && !type.equals(other.type)) return false;
	if (subtype != null && other.subtype != null && !subtype.equals(other.subtype)) return false;
	return true;
    }
302262
public boolean canMergeRemainderFilter(FilteringScore<S> other) {
        if (this == other || (!hasAnyMatches() && !other.hasAnyMatches())) {
            return true;
        }

        return isIndexClustered() == other.isIndexClustered()
            && isIndexUnique() == other.isIndexUnique()
            && getIndexPropertyCount() == other.getIndexPropertyCount()
            && getArrangementScore() == other.getArrangementScore()
            && getPreferenceScore().equals(other.getPreferenceScore())
            && shouldReverseRange() == other.shouldReverseRange()
            // List comparisons assume identical ordering, but this is
            // not strictly required. Since the different scores likely
            // originated from the same complex filter, the ordering
            // likely matches. A set equality test is not needed.
            && getIdentityFilters().equals(other.getIdentityFilters())
            && getRangeStartFilters().equals(other.getRangeStartFilters())
            && getRangeEndFilters().equals(other.getRangeEndFilters());
    }
461178
def matches(self, other):
        
        if not isinstance(other, Failure):
            return False
        if self.exc_info is None or other.exc_info is None:
            return self._matches(other)
        else:
            return self == other
449795
public boolean isSameAs( PlanNode other ) {
        if (other == null) return false;
        if (this.getType() != other.getType()) return false;
        if (!ObjectUtil.isEqualWithNulls(this.nodeProperties, other.nodeProperties)) return false;
        if (!this.getSelectors().equals(other.getSelectors())) return false;
        if (this.getChildCount() != other.getChildCount()) return false;
        Iterator<PlanNode> thisChildren = this.getChildren().iterator();
        Iterator<PlanNode> thatChildren = other.getChildren().iterator();
        while (thisChildren.hasNext() && thatChildren.hasNext()) {
            if (!thisChildren.next().isSameAs(thatChildren.next())) return false;
        }
        return true;
    }
1259903
public final boolean matchEncoding(final EnhancedMimeType other) {
        return match(other) && Objects.equals(getEncoding(), other.getEncoding());

    }
402222
public final boolean overlaps(HString other) {
      if (other == null) {
         return false;
      }
      return (document() != null && other.document() != null) &&
                (document() == other.document()) &&
                super.overlaps(other);
   }
895988
public boolean matches(T other) {
    if (matchAny) {
      return true;
    } else if (other == null) {
      return negation ? value != null : value == null;
    } else {
      if (value instanceof byte[]) {
        boolean equal = Arrays.equals((byte[]) value, (byte[]) other);
        return negation ? !equal : equal;
      }
      return negation ? !Objects.equals(value, other) : Objects.equals(value, other);
    }
440185
public static Version.Field getMostSpecificMatchingField(Version v1, Version v2) {
        if (v1.getMajor() != v2.getMajor()) {
            return null;
        }

        if (v1.getMinor() != v2.getMinor()) {
            return Version.Field.MAJOR;
        }

        if (v1.getPatch() != v2.getPatch()) {
            return Version.Field.MINOR;
        }

        final Integer l1 = v1.getLocal();
        final Integer l2 = v2.getLocal();
        if (l1 != l2 && (l1 == null || l2 == null || !l1.equals(l2))) {
            return Version.Field.PATCH;
        }

        return Version.Field.LOCAL;
    }
738958
@Override
  public int compareTo(VersionInfo other) {
    if (this.timestamp == other.timestamp) {
      return 0;
    }
    if (this.timestamp < other.timestamp) {
      return 1;
    }
    return -1;
  }