Removes all relations involving a temporal extended proposition
definition.

@param def
a {@link TemporalExtendedPropositionDefinition}.
@return <code>true</code> if all such relations were removed,
<code>false</code> otherwise.
965929
public boolean removeAllRelations(TemporalExtendedPropositionDefinition def) {
        for (Iterator<List<TemporalExtendedPropositionDefinition>> itr = this.defPairsMap.keySet().iterator(); itr.hasNext();) {
            List<TemporalExtendedPropositionDefinition> pair = itr.next();
            if (pair.get(0) == def || pair.get(1) == def) {
                itr.remove();
            }
        }
        return true;
    }
1331696
protected void removePreviousRelation(Relation<?> relation) {
    if(keep) {
      return;
    }
    boolean first = true;
    for(It<Index> it = relation.getHierarchy().iterDescendants(relation).filter(Index.class); it.valid(); it.advance()) {
      if(first) {
        Logging.getLogger(getClass()).statistics("Index statistics when removing initial data relation.");
        first = false;
      }
      it.get().logStatistics();
    }
    ResultUtil.removeRecursive(relation.getHierarchy(), relation);
  }
471172
public OperationFuture<AntiAffinityPolicy> delete(AntiAffinityPolicy policyRef) {
        client.deleteAntiAffinityPolicy(findByRef(policyRef).getId());

        return new OperationFuture<>(
            policyRef,
            new NoWaitingJobFuture()
        );
    }
215176
@Override
    public Temporal addTo(Temporal temporal) {
        validateChrono(temporal);
        if (months == 0) {
            if (years != 0) {
                temporal = temporal.plus(years, YEARS);
            }
        } else {
            long monthRange = monthRange();
            if (monthRange > 0) {
                temporal = temporal.plus(years * monthRange + months, MONTHS);
            } else {
                if (years != 0) {
                    temporal = temporal.plus(years, YEARS);
                }
                temporal = temporal.plus(months, MONTHS);
            }
        }
        if (days != 0) {
            temporal = temporal.plus(days, DAYS);
        }
        return temporal;
    }
794944
private boolean isExtends(final EClass cls, EGenericType st) {
        final EClass cls2 = (EClass) st.getEClassifier();
        return cls2.isInterface() && cls.isInterface() || !cls2.isInterface() && !cls.isInterface();
    }
737013
private void decomposeInIIFE(NodeTraversal t, Node classNode) {
    // converts
    // `class X extends something {}`
    // to
    // `(function() { return class X extends something {}; })()`
    Node functionBody = IR.block();
    Node function = IR.function(IR.name(""), IR.paramList(), functionBody);
    Node call = NodeUtil.newCallNode(function);
    classNode.replaceWith(call);
    functionBody.addChildToBack(IR.returnNode(classNode));
    call.useSourceInfoIfMissingFromForTree(classNode);
    // NOTE: extractExtends() will end up reporting the change for the new function, so we only
    //     need to report the change to the enclosing scope
    t.reportCodeChange(call);
    // Now do the extends expression extraction within the IIFE
    extractExtends(t, classNode);
  }
20977
public static <T extends Object & Comparable<? super T>> boolean hasRelation(SortedSet<T> a, int allow, SortedSet<T> b) {
        if (allow < NONE || allow > ANY) {
            throw new IllegalArgumentException("Relation " + allow + " out of range");
        }
        
        // extract filter conditions
        // these are the ALLOWED conditions Set
        
        boolean anb = (allow & A_NOT_B) != 0;
        boolean ab = (allow & A_AND_B) != 0;
        boolean bna = (allow & B_NOT_A) != 0;
        
        // quick check on sizes
        switch(allow) {
            case CONTAINS: if (a.size() < b.size()) return false; break;
            case ISCONTAINED: if (a.size() > b.size()) return false; break;
            case EQUALS: if (a.size() != b.size()) return false; break;
        }
        
        // check for null sets
        if (a.size() == 0) {
            if (b.size() == 0) return true;
            return bna;
        } else if (b.size() == 0) {
            return anb;
        }
        
        // pick up first strings, and start comparing
        Iterator<? extends T> ait = a.iterator();
        Iterator<? extends T> bit = b.iterator();
        
        T aa = ait.next();
        T bb = bit.next();
        
        while (true) {
            int comp = aa.compareTo(bb);
            if (comp == 0) {
                if (!ab) return false;
                if (!ait.hasNext()) {
                    if (!bit.hasNext()) return true;
                    return bna;
                } else if (!bit.hasNext()) {
                    return anb;
                }
                aa = ait.next();
                bb = bit.next();
            } else if (comp < 0) {
                if (!anb) return false;
                if (!ait.hasNext()) {
                    return bna;
                }
                aa = ait.next(); 
            } else  {
                if (!bna) return false;
                if (!bit.hasNext()) {
                    return anb;
                }
                bb = bit.next();
            }
        }
    }
1337599
public static boolean isAbstract(TypeRef  typeRef) {
        DefinitionRepository repository =  DefinitionRepository.getRepository();
        TypeDef def = repository.getDefinition(typeRef);
        if (def == null && typeRef instanceof ClassRef) {
            def = ((ClassRef)typeRef).getDefinition();
        }
        return def != null ? def.isAbstract() : false;
    }
167742
@Override
	public void removeByCPDefinitionId(long CPDefinitionId) {
		for (CPDefinitionGroupedEntry cpDefinitionGroupedEntry : findByCPDefinitionId(
				CPDefinitionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionGroupedEntry);
		}
	}
1186480
boolean isDeferred(Env<AttrContext> env, JCExpression expr) {
        DeferredChecker dc = new DeferredChecker(env);
        dc.scan(expr);
        return dc.result.isPoly();
    }
183995
@Override
    public void visit(SliceDefinition def) throws ProtempaException {
        LOGGER.log(Level.FINER, "Creating rule for {0}", def);
        try {
            Set<TemporalExtendedPropositionDefinition> epdsC = def
                    .getTemporalExtendedPropositionDefinitions();
            if (!epdsC.isEmpty()) {
                TemporalExtendedPropositionDefinition[] epds = epdsC
                        .toArray(new TemporalExtendedPropositionDefinition[epdsC.size()]);
                Rule rule = new Rule("SLICE_" + def.getId());

                Pattern sourceP = new Pattern(2, 1, TEMP_PROP_OT, "");
                for (int i = 0; i < epds.length; i++) {
                    GetMatchesPredicateExpression matchesPredicateExpression = new GetMatchesPredicateExpression(epds[i], this.cache);
                    Constraint c = new PredicateConstraint(
                            matchesPredicateExpression);
                    sourceP.addConstraint(c);
                }

                Pattern resultP = new Pattern(1, 1, ARRAY_LIST_OT, "result");
                resultP.setSource(new Collect(sourceP, new Pattern(1, 1,
                        ARRAY_LIST_OT, "result")));
                int len;
                int minInd = def.getMinIndex();
                int maxInd = def.getMaxIndex();
                if (maxInd < 0) {
                    len = Math.abs(minInd);
                } else {
                    len = maxInd;
                }
                resultP.addConstraint(new PredicateConstraint(
                        new CollectionSizeExpression(len)));
                rule.addPattern(resultP);
                rule.setConsequence(new SliceConsequence(def,
                        this.derivationsBuilder));
                rule.setSalience(MINUS_TWO_SALIENCE);
                this.ruleToAbstractionDefinition.put(rule, def);
                rules.add(rule);
            }
        } catch (InvalidRuleException e) {
            throw new AssertionError(e.getClass().getName() + ": "
                    + e.getMessage());
        }
    }
916462
private boolean removeKunderaProxies(EntityMetadata metadata, Object entity, List<RelationHolder> relationHolders)
    {
        boolean proxyRemoved = false;

        for (Relation relation : metadata.getRelations())
        {
            if (relation != null && relation.isUnary())
            {
                Object relationObject = PropertyAccessorHelper.getObject(entity, relation.getProperty());
                if (relationObject != null && ProxyHelper.isKunderaProxy(relationObject))
                {
                    EntityMetadata relMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                            relation.getTargetEntity());
                    Method idAccessorMethod = relMetadata.getReadIdentifierMethod();
                    Object foreignKey = null;
                    try
                    {
                        foreignKey = idAccessorMethod.invoke(relationObject, new Object[] {});
                    }
                    catch (IllegalArgumentException e)
                    {
                        log.error("Error while Fetching relationship value of {}, Caused by {}.",
                                metadata.getEntityClazz(), e);
                    }
                    catch (IllegalAccessException e)
                    {
                        log.error("Error while Fetching relationship value of {}, Caused by {}.",
                                metadata.getEntityClazz(), e);
                    }
                    catch (InvocationTargetException e)
                    {
                        log.error("Error while Fetching relationship value of {}, Caused by {}.",
                                metadata.getEntityClazz(), e);
                    }

                    if (foreignKey != null)
                    {
                        relationObject = null;
                        PropertyAccessorHelper.set(entity, relation.getProperty(), relationObject);
                        relationHolders
                                .add(new RelationHolder(relation.getJoinColumnName(kunderaMetadata), foreignKey));
                        proxyRemoved = true;
                    }
                }
            }
        }
        return proxyRemoved;
    }
29217
private boolean forbidUseOfSuperInFixtureMethod(MethodCallExpression expr) {
    Method currMethod = resources.getCurrentMethod();
    Expression target = expr.getObjectExpression();

    if (currMethod instanceof FixtureMethod
        && target instanceof VariableExpression
        && ((VariableExpression)target).isSuperExpression()
        && currMethod.getName().equals(expr.getMethodAsString())) {
      resources.getErrorReporter().error(expr,
          "A base class fixture method should not be called explicitly " +
              "because it is always invoked automatically by the framework");
      return true;
    }

    return false;
  }
587951
@Override
	public void removeByCPDefinitionId(long CPDefinitionId) {
		for (CPDefinitionLocalization cpDefinitionLocalization : findByCPDefinitionId(
				CPDefinitionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionLocalization);
		}
	}
960470
@SuppressWarnings("unchecked")
	public static <T> TreeDef.Parented<TreeNode<T>> treeDef() {
		return (TreeDef.Parented<TreeNode<T>>) TREE_DEF;
	}
1228298
@Override
    public void remove(Iterable<? extends Statement> statements) throws RepositoryException {
        Iterator <? extends Statement> iter = statements.iterator();
        while(iter.hasNext()){
            Statement st = iter.next();
            getClient().sendRemove(null, st.getSubject(), st.getPredicate(), st.getObject());
        }
    }
1356646
@Override
    public void visit(SequentialTemporalPatternDefinition def) throws ProtempaException {
        LOGGER.log(Level.FINER, "Creating rule for {0}", def);
        try {
            TemporalExtendedPropositionDefinition lhs = def.getFirstTemporalExtendedPropositionDefinition();
            if (lhs != null) {
                Rule rule = new Rule("SEQ_TP_" + def.getId());
                Pattern sourceP = new Pattern(2, TEMP_PROP_OT);
                GetMatchesPredicateExpression matchesPredicateExpression = new GetMatchesPredicateExpression(lhs, this.cache);
                sourceP.addConstraint(new PredicateConstraint(
                        matchesPredicateExpression));
                SubsequentTemporalExtendedPropositionDefinition[] relatedTemporalExtendedPropositionDefinitions = def.getSubsequentTemporalExtendedPropositionDefinitions();
                for (int i = 0; i < relatedTemporalExtendedPropositionDefinitions.length; i++) {
                    SubsequentTemporalExtendedPropositionDefinition rtepd
                            = relatedTemporalExtendedPropositionDefinitions[i];
                    GetMatchesPredicateExpression matchesPredicateExpression1 = new GetMatchesPredicateExpression(
                            rtepd.getRelatedTemporalExtendedPropositionDefinition(), this.cache);
                    Constraint c = new PredicateConstraint(
                            matchesPredicateExpression1);
                    sourceP.addConstraint(c);
                }

                Pattern resultP = new Pattern(1, 1, ARRAY_LIST_OT, "result");
                resultP.setSource(new Collect(sourceP, new Pattern(1, 1,
                        ARRAY_LIST_OT, "result")));
                resultP.addConstraint(new PredicateConstraint(
                        new CollectionSizeExpression(1)));
                rule.addPattern(resultP);
                rule.setConsequence(new SequentialTemporalPatternConsequence(def,
                        this.derivationsBuilder));
                rule.setSalience(MINUS_TWO_SALIENCE);
                this.ruleToAbstractionDefinition.put(rule, def);
                rules.add(rule);
                ABSTRACTION_COMBINER.toRules(def, rules, this.derivationsBuilder);
            }
        } catch (InvalidRuleException e) {
            throw new AssertionError(e.getClass().getName() + ": "
                    + e.getMessage());
        }
    }