Java commons-lang3 EqualBuilder中的配对交换错误?

Java commons-lang3 EqualBuilder中的配对交换错误?,java,apache-commons-lang3,Java,Apache Commons Lang3,以下是org.apache.commons.lang3.builder.EqualsBuilder的部分源代码。pair和swappedPair之间有什么区别?为什么不swappedPair=Pair.of(Pair.getRight(),Pair.getLeft()) 这看起来像一只虫子。事实上,我几乎可以肯定这是一只虫子。捕捉得好,它一定是一只虫子。已针对当前GitHub存储库提出了它。根据合并的情况,它应该在即将发布的版本中修复。 static Pair<IDKey, IDK

以下是
org.apache.commons.lang3.builder.EqualsBuilder
的部分源代码。
pair
swappedPair
之间有什么区别?为什么不
swappedPair=Pair.of(Pair.getRight(),Pair.getLeft())


这看起来像一只虫子。事实上,我几乎可以肯定这是一只虫子。捕捉得好,它一定是一只虫子。已针对当前GitHub存储库提出了它。根据合并的情况,它应该在即将发布的版本中修复。
    static Pair<IDKey, IDKey> getRegisterPair(final Object lhs, final Object rhs) {
        final IDKey left = new IDKey(lhs);
        final IDKey right = new IDKey(rhs);
        return Pair.of(left, right);
    }

    /**
     * <p>
     * Returns <code>true</code> if the registry contains the given object pair.
     * Used by the reflection methods to avoid infinite loops.
     * Objects might be swapped therefore a check is needed if the object pair
     * is registered in given or swapped order.
     * </p>
     *
     * @param lhs <code>this</code> object to lookup in registry
     * @param rhs the other object to lookup on registry
     * @return boolean <code>true</code> if the registry contains the given object.
     * @since 3.0
     */
    static boolean isRegistered(final Object lhs, final Object rhs) {
        final Set<Pair<IDKey, IDKey>> registry = getRegistry();
        final Pair<IDKey, IDKey> pair = getRegisterPair(lhs, rhs);
        final Pair<IDKey, IDKey> swappedPair = Pair.of(pair.getLeft(), pair.getRight());

        return registry != null
                && (registry.contains(pair) || registry.contains(swappedPair));
    }