CPD Results
The following document contains the results of PMD's CPD 7.17.0.
Duplications
| File |
Project |
Line |
| org/jaxen/dom4j/DocumentNavigator.java |
jaxen |
92 |
| org/jaxen/jdom/DocumentNavigator.java |
jaxen |
87 |
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 |
100 |
| org/jaxen/expr/DefaultRelationalExpr.java |
jaxen |
110 |
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 ) ) |
| File |
Project |
Line |
| org/jaxen/expr/PredicateSet.java |
jaxen |
169 |
| org/jaxen/expr/PredicateSet.java |
jaxen |
244 |
final int nodes2FilterSize = nodes2Filter.size();
List<Object> filteredNodes = new ArrayList<Object>(nodes2FilterSize);
// Set up a context with a list to hold each node
Context predContext = new Context(support);
List<Object> tempList = new ArrayList<Object>(1);
predContext.setNodeSet(tempList);
// loop through the current nodes to filter and add to the
// filtered nodes list if the predicate succeeds
for (int i = 0; i < nodes2FilterSize; ++i) {
Object contextNode = nodes2Filter.get(i);
tempList.clear();
tempList.add(contextNode);
predContext.setNodeSet(tempList);
predContext.setPosition(i + 1);
predContext.setSize(nodes2FilterSize);
Object predResult = pred.evaluate(predContext); |