int (@NotNull MatchedValue o) { if (o == this) return 0; int diff = o.getMatchingDegree() - getMatchingDegree(); if (diff != 0) return diff; diff = getTypeWeight(o.value) - getTypeWeight(value); if (diff != 0) return diff; if (value instanceof ActionWrapper && o.value instanceof ActionWrapper) { ActionWrapper value1 = (ActionWrapper)value; ActionWrapper value2 = (ActionWrapper)o.value; int compared = value1.compareWeights(value2); if (compared != 0) return compared; } diff = StringUtil.notNullize(getValueText()).length() - StringUtil.notNullize(o.getValueText()).length(); if (diff != 0) return diff; if (value instanceof OptionDescription && o.value instanceof OptionDescription) { OptionDescription value1 = (OptionDescription)value; OptionDescription value2 = (OptionDescription)o.value; diff = value1.compareTo(value2); if (diff != 0) return diff; } return o.hashCode() - hashCode(); }