CPD Results

The following document contains the results of PMD's CPD 6.49.0.

Duplications

File Project Line
org/jaxen/dom4j/DocumentNavigator.java jaxen 100
org/jaxen/jdom/DocumentNavigator.java jaxen 96
private static class Singleton
    {
        /** Singleton instance.
         */
        private static DocumentNavigator instance = new DocumentNavigator();
    }

    /** Retrieve the singleton instance of this <code>DocumentNavigator</code>.
     */
    public static Navigator getInstance()
    {
        return Singleton.instance;
    }

    public boolean isElement(Object obj)
    {
        return obj instanceof Element;
    }

    public boolean isComment(Object obj)
    {
        return obj instanceof Comment;
    }

    public boolean isText(Object obj)
    {
        return ( obj instanceof Text 
                 ||
                 obj instanceof CDATA );
    }

    public boolean isAttribute(Object obj)
    {
        return obj instanceof Attribute;
    }

    public boolean isProcessingInstruction(Object obj)
    {
        return obj instanceof ProcessingInstruction;
    }

    public boolean isDocument(Object obj)
    {
        return obj instanceof Document;
    }

    public boolean isNamespace(Object obj)
    {
        return obj instanceof Namespace;
File Project Line
org/jaxen/expr/DefaultEqualityExpr.java jaxen 108
org/jaxen/expr/DefaultRelationalExpr.java jaxen 118
private Boolean evaluateSetSet( List lhsSet, List rhsSet, Navigator nav )
    {
      /* If both objects to be compared are node-sets, then the comparison will be 
       * true if and only if there is a node in the first node-set and a node in 
       * the second node-set such that the result of performing the comparison on 
       * the string-values of the two nodes is true */
      if( setIsEmpty( lhsSet ) || setIsEmpty( rhsSet ) ) {
            return Boolean.FALSE;
      }
    
    for( Iterator lhsIterator = lhsSet.iterator(); lhsIterator.hasNext(); )
      {
      Object lhs = lhsIterator.next();
      
      for( Iterator rhsIterator = rhsSet.iterator(); rhsIterator.hasNext(); )
        {
        Object rhs = rhsIterator.next();
        
        if( evaluateObjectObject( lhs, rhs, nav ) )
          {
          return Boolean.TRUE;
          }
        }
      }
    
    return Boolean.FALSE;
    }
  
  private boolean evaluateObjectObject( Object lhs, Object rhs, Navigator nav )
    {
    if( eitherIsBoolean( lhs, rhs ) )