mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inference] Failure contract inference improved
GitOrigin-RevId: 687b4c909c1d2ae67d519ec71899d52fa3e29434
This commit is contained in:
committed by
intellij-monorepo-bot
parent
23e19832d4
commit
b4c69a9cec
+3
-2
@@ -52,7 +52,7 @@ public class ClassDataIndexer implements VirtualFileGist.GistCalculator<Map<HMem
|
||||
static final BinaryOperator<Equations> MERGER =
|
||||
(eq1, eq2) -> eq1.equals(eq2) ? eq1 : new Equations(Collections.emptyList(), false);
|
||||
|
||||
private static final int VERSION = 15; // change when inference algorithm changes
|
||||
private static final int VERSION = 16; // change when inference algorithm changes
|
||||
private static final int VERSION_MODIFIER = HardCodedPurity.AGGRESSIVE_HARDCODED_PURITY ? 1 : 0;
|
||||
private static final int FINAL_VERSION = VERSION * 2 + VERSION_MODIFIER;
|
||||
private static final VirtualFileGist<Map<HMember, Equations>> ourGist = GistManager.getInstance().newVirtualFileGist(
|
||||
@@ -491,7 +491,8 @@ public class ClassDataIndexer implements VirtualFileGist.GistCalculator<Map<HMem
|
||||
if (!throwEquation.result.equals(Value.Top)) {
|
||||
result.add(throwEquation);
|
||||
}
|
||||
shouldInferNonTrivialFailingContracts = !inThrowAnalysis.myHasNonTrivialReturn;
|
||||
shouldInferNonTrivialFailingContracts = !inThrowAnalysis.myHasNonTrivialReturn &&
|
||||
richControlFlow.controlFlow.errorTransitions.isEmpty();
|
||||
}
|
||||
|
||||
boolean withCycle = !richControlFlow.dfsTree.back.isEmpty();
|
||||
|
||||
+95
-9
@@ -19,6 +19,7 @@ import java.util.*;
|
||||
|
||||
import static com.intellij.codeInspection.bytecodeAnalysis.AbstractValues.*;
|
||||
import static com.intellij.codeInspection.bytecodeAnalysis.Direction.Out;
|
||||
import static com.intellij.codeInspection.bytecodeAnalysis.Direction.Throw;
|
||||
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
abstract class ContractAnalysis extends Analysis<Result> {
|
||||
@@ -63,7 +64,7 @@ abstract class ContractAnalysis extends Analysis<Result> {
|
||||
pendingPush(createStartState());
|
||||
int steps = 0;
|
||||
while (pendingTop > 0 && earlyResult == null) {
|
||||
steps ++;
|
||||
steps++;
|
||||
TooComplexException.check(method, steps);
|
||||
if (steps % 128 == 0) {
|
||||
ProgressManager.checkCanceled();
|
||||
@@ -198,7 +199,7 @@ abstract class ContractAnalysis extends Analysis<Result> {
|
||||
|
||||
abstract boolean handleReturn(Frame<BasicValue> frame, int opcode, boolean unsure) throws AnalyzerException;
|
||||
|
||||
private void pendingPush(State st) {
|
||||
void pendingPush(State st) {
|
||||
TooComplexException.check(method, pendingTop);
|
||||
pending.set(pendingTop++, st);
|
||||
}
|
||||
@@ -310,6 +311,9 @@ class InOutAnalysis extends ContractAnalysis {
|
||||
class InThrowAnalysis extends ContractAnalysis {
|
||||
private BasicValue myReturnValue;
|
||||
boolean myHasNonTrivialReturn;
|
||||
private Map<State, Set<EKey>> myThrowKeys = new HashMap<>();
|
||||
private final List<State> myNextStates = new ArrayList<>();
|
||||
private Set<EKey> myFinalThrowKeys;
|
||||
|
||||
protected InThrowAnalysis(RichControlFlow richControlFlow,
|
||||
Direction direction,
|
||||
@@ -319,6 +323,69 @@ class InThrowAnalysis extends ContractAnalysis {
|
||||
super(richControlFlow, direction, resultOrigins, stable, pending);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull Equation analyze() throws AnalyzerException {
|
||||
Equation equation = super.analyze();
|
||||
if (equation.result == Value.Top && myThrowKeys != null && myFinalThrowKeys != null && !myFinalThrowKeys.isEmpty()) {
|
||||
for (Set<EKey> value : myThrowKeys.values()) {
|
||||
updateFinalKeys(value);
|
||||
}
|
||||
return mkEquation(new Pending(new Component[]{new Component(Value.Top, myFinalThrowKeys)}));
|
||||
}
|
||||
return equation;
|
||||
}
|
||||
|
||||
@Override
|
||||
void pendingPush(State st) {
|
||||
super.pendingPush(st);
|
||||
myNextStates.add(st);
|
||||
}
|
||||
|
||||
@Override
|
||||
void processState(State state) throws AnalyzerException {
|
||||
myNextStates.clear();
|
||||
super.processState(state);
|
||||
updateThrowPaths(state);
|
||||
}
|
||||
|
||||
private void updateThrowPaths(State state) {
|
||||
Set<EKey> throwKeys = interpreter.throwKeys;
|
||||
interpreter.throwKeys = null;
|
||||
if (myThrowKeys == null) return;
|
||||
Set<EKey> prevKeys = myThrowKeys.remove(state);
|
||||
if (myNextStates.isEmpty()) {
|
||||
updateFinalKeys(prevKeys);
|
||||
return;
|
||||
}
|
||||
if (prevKeys == null || prevKeys.isEmpty()) {
|
||||
prevKeys = throwKeys != null ? throwKeys : Collections.emptySet();
|
||||
} else {
|
||||
if (throwKeys != null && !throwKeys.isEmpty()) {
|
||||
prevKeys = new HashSet<>(prevKeys);
|
||||
prevKeys.addAll(throwKeys);
|
||||
if (prevKeys.size() > 32) {
|
||||
myThrowKeys = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (State next : myNextStates) {
|
||||
myThrowKeys.put(next, prevKeys);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateFinalKeys(Set<EKey> prevKeys) {
|
||||
if (myFinalThrowKeys == null) {
|
||||
myFinalThrowKeys = new HashSet<>(prevKeys);
|
||||
} else {
|
||||
if (myFinalThrowKeys.isEmpty()) {
|
||||
myThrowKeys = null;
|
||||
return;
|
||||
}
|
||||
myFinalThrowKeys.retainAll(prevKeys);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean handleReturn(Frame<BasicValue> frame, int opcode, boolean unsure) {
|
||||
Result subResult;
|
||||
@@ -364,6 +431,7 @@ class InOutInterpreter extends BasicInterpreter {
|
||||
final InsnList insns;
|
||||
final boolean[] resultOrigins;
|
||||
final boolean nullAnalysis;
|
||||
Set<EKey> throwKeys = null;
|
||||
|
||||
boolean deReferenced;
|
||||
|
||||
@@ -383,7 +451,7 @@ class InOutInterpreter extends BasicInterpreter {
|
||||
@Override
|
||||
public BasicValue newOperation(AbstractInsnNode insn) throws AnalyzerException {
|
||||
boolean propagate = resultOrigins[insns.indexOf(insn)];
|
||||
if (propagate) {
|
||||
if (propagate || isThrowAnalysis()) {
|
||||
switch (insn.getOpcode()) {
|
||||
case ICONST_0:
|
||||
return FalseValue;
|
||||
@@ -491,7 +559,6 @@ class InOutInterpreter extends BasicInterpreter {
|
||||
|
||||
@Override
|
||||
public BasicValue naryOperation(AbstractInsnNode insn, List<? extends BasicValue> values) throws AnalyzerException {
|
||||
boolean propagate = resultOrigins[insns.indexOf(insn)];
|
||||
int opCode = insn.getOpcode();
|
||||
int shift = opCode == INVOKESTATIC ? 0 : 1;
|
||||
|
||||
@@ -505,7 +572,8 @@ class InOutInterpreter extends BasicInterpreter {
|
||||
}
|
||||
}
|
||||
|
||||
if (propagate) {
|
||||
boolean propagate = resultOrigins[insns.indexOf(insn)];
|
||||
if (propagate || isThrowAnalysis()) {
|
||||
switch (opCode) {
|
||||
case INVOKESTATIC:
|
||||
case INVOKESPECIAL:
|
||||
@@ -516,18 +584,32 @@ class InOutInterpreter extends BasicInterpreter {
|
||||
Member method = new Member(mNode.owner, mNode.name, mNode.desc);
|
||||
Type retType = Type.getReturnType(mNode.desc);
|
||||
boolean isRefRetType = retType.getSort() == Type.OBJECT || retType.getSort() == Type.ARRAY;
|
||||
if (!Type.VOID_TYPE.equals(retType)) {
|
||||
if (propagate && !Type.VOID_TYPE.equals(retType) || isThrowAnalysis()) {
|
||||
if (direction != null) {
|
||||
HashSet<EKey> keys = new HashSet<>();
|
||||
for (int i = shift; i < values.size(); i++) {
|
||||
if (values.get(i) instanceof ParamValue) {
|
||||
keys.add(new EKey(method, direction.withIndex(i - shift), stable));
|
||||
Direction direction = null;
|
||||
BasicValue value = values.get(i);
|
||||
if (value instanceof ParamValue) {
|
||||
direction = this.direction.withIndex(i - shift);
|
||||
}
|
||||
else {
|
||||
Value constant = Value.fromBasicValue(value);
|
||||
if (constant != null) {
|
||||
direction = this.direction.withValue(i - shift, constant);
|
||||
}
|
||||
}
|
||||
if (direction != null) {
|
||||
keys.add(new EKey(method, direction, stable));
|
||||
}
|
||||
}
|
||||
if (isRefRetType) {
|
||||
keys.add(new EKey(method, Out, stable));
|
||||
keys.add(new EKey(method, isThrowAnalysis() ? Throw : Out, stable));
|
||||
}
|
||||
if (!keys.isEmpty()) {
|
||||
if (isThrowAnalysis()) {
|
||||
throwKeys = keys;
|
||||
}
|
||||
return new CallResultValue(retType, keys);
|
||||
}
|
||||
}
|
||||
@@ -550,4 +632,8 @@ class InOutInterpreter extends BasicInterpreter {
|
||||
}
|
||||
return super.naryOperation(insn, values);
|
||||
}
|
||||
|
||||
private boolean isThrowAnalysis() {
|
||||
return direction instanceof Direction.InThrow || direction == Throw;
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,10 @@ final class Component {
|
||||
public Component copy() {
|
||||
return new Component(value, ids.clone());
|
||||
}
|
||||
|
||||
public boolean isSuperStateOf(Component other) {
|
||||
return other.value == value && Arrays.asList(other.ids).containsAll(Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
final class Equation {
|
||||
|
||||
+17
-1
@@ -127,7 +127,9 @@ public abstract class Direction {
|
||||
this.inValue = inValue;
|
||||
}
|
||||
|
||||
abstract ParamValueBasedDirection withIndex(int paramIndex);
|
||||
abstract @NotNull ParamValueBasedDirection withIndex(int paramIndex);
|
||||
|
||||
abstract @NotNull ParamValueBasedDirection withValue(int paramIndex, @NotNull Value inValue);
|
||||
}
|
||||
|
||||
static final class InOut extends ParamValueBasedDirection {
|
||||
@@ -136,10 +138,17 @@ public abstract class Direction {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
InOut withIndex(int paramIndex) {
|
||||
return new InOut(paramIndex, inValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
ParamValueBasedDirection withValue(int paramIndex, @NotNull Value inValue) {
|
||||
return new InOut(paramIndex, inValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
int asInt() {
|
||||
return super.asInt() + IN_OUT_OFFSET + inValue.ordinal();
|
||||
@@ -157,10 +166,17 @@ public abstract class Direction {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
InThrow withIndex(int paramIndex) {
|
||||
return new InThrow(paramIndex, inValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
ParamValueBasedDirection withValue(int paramIndex, @NotNull Value inValue) {
|
||||
return new InThrow(paramIndex, inValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
int asInt() {
|
||||
return super.asInt() + IN_THROW_OFFSET + inValue.ordinal();
|
||||
|
||||
+30
-5
@@ -22,6 +22,7 @@ import com.intellij.psi.search.ProjectScope;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ConcurrentFactoryMap;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.Stack;
|
||||
@@ -116,6 +117,9 @@ public class ProjectBytecodeAnalysis {
|
||||
}
|
||||
else if (listOwner instanceof PsiParameter) {
|
||||
ParameterAnnotations parameterAnnotations = loadParameterAnnotations(primaryKey);
|
||||
if (hasFailContract((PsiParameter)listOwner, parameterAnnotations)) {
|
||||
return PsiAnnotation.EMPTY_ARRAY;
|
||||
}
|
||||
return toPsi(parameterAnnotations);
|
||||
}
|
||||
else if (listOwner instanceof PsiField && listOwner.hasModifierProperty(PsiModifier.STATIC)) {
|
||||
@@ -138,6 +142,24 @@ public class ProjectBytecodeAnalysis {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasFailContract(PsiParameter listOwner, ParameterAnnotations parameterAnnotations) {
|
||||
if (!parameterAnnotations.notNull) return false;
|
||||
PsiMethod method = ObjectUtils.tryCast(listOwner.getDeclarationScope(), PsiMethod.class);
|
||||
if (method == null) return false;
|
||||
int index = method.getParameterList().getParameterIndex(listOwner);
|
||||
PsiAnnotation anno = findInferredAnnotation(method, JavaMethodContractUtil.ORG_JETBRAINS_ANNOTATIONS_CONTRACT);
|
||||
if (anno == null) return false;
|
||||
for (StandardMethodContract contract : JavaMethodContractUtil.parseContracts(method, anno)) {
|
||||
if (contract.getReturnValue().isFail()) {
|
||||
ValueConstraint constraint = contract.getParameterConstraint(index);
|
||||
if (constraint == ValueConstraint.NULL_VALUE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts inferred method annotations to Psi annotations
|
||||
*
|
||||
@@ -295,7 +317,8 @@ public class ProjectBytecodeAnalysis {
|
||||
EKey failureKey = key.withDirection(Throw);
|
||||
Solver failureSolver = new Solver(new ELattice<>(Value.Fail, Value.Top), Value.Top);
|
||||
collectEquations(Collections.singletonList(failureKey), failureSolver);
|
||||
if (failureSolver.solve().get(failureKey) == Value.Fail) {
|
||||
Map<EKey, Value> failureData = failureSolver.solve();
|
||||
if (failureData.get(failureKey.mkStable()) == Value.Fail || failureData.get(failureKey.mkUnstable()) == Value.Fail) {
|
||||
// Always failing method
|
||||
result.contractsValues.put(key, StreamEx.constant("_", arity).joining(",", "\"", "->fail\""));
|
||||
}
|
||||
@@ -447,12 +470,14 @@ public class ProjectBytecodeAnalysis {
|
||||
for (Map.Entry<EKey, Value> entry : solution.entrySet()) {
|
||||
// NB: keys from Psi are always stable, so we need to stabilize keys from equations
|
||||
Value value = entry.getValue();
|
||||
if (value == Value.Top || value == Value.Bot ||
|
||||
(value == Value.Fail && !methodAnnotations.mutates.isPure())) {
|
||||
continue;
|
||||
}
|
||||
if (value == Value.Top || value == Value.Bot) continue;
|
||||
EKey key = entry.getKey().mkStable();
|
||||
Direction direction = key.getDirection();
|
||||
if (value == Value.Fail && direction instanceof ParamValueBasedDirection &&
|
||||
((ParamValueBasedDirection)direction).inValue == Value.Null && !methodAnnotations.mutates.isPure()) {
|
||||
// Impure methods with "null->fail" contract are just assumed to have `@NotNull` annotation on the corresponding parameter
|
||||
continue;
|
||||
}
|
||||
EKey baseKey = key.mkBase();
|
||||
if (!methodKey.equals(baseKey)) {
|
||||
continue;
|
||||
|
||||
+8
-3
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.bytecodeAnalysis;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.DfaUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -64,10 +65,14 @@ class ResultUtil {
|
||||
assert r1 instanceof Pending && r2 instanceof Pending;
|
||||
Pending pending1 = (Pending)r1;
|
||||
Pending pending2 = (Pending)r2;
|
||||
List<Component> left = Arrays.asList(pending1.delta);
|
||||
List<Component> right = Arrays.asList(pending2.delta);
|
||||
if (left.containsAll(right)) return pending1;
|
||||
if (right.containsAll(left)) return pending2;
|
||||
Set<Component> sum = new HashSet<>();
|
||||
sum.addAll(Arrays.asList(pending1.delta));
|
||||
sum.addAll(Arrays.asList(pending2.delta));
|
||||
return new Pending(sum);
|
||||
sum.addAll(left);
|
||||
sum.addAll(right);
|
||||
return new Pending(DfaUtil.upwardsAntichain(sum, (l, r) -> r.isSuperStateOf(l)));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -4,7 +4,9 @@ package com.intellij.codeInspection.bytecodeAnalysis;
|
||||
import com.intellij.codeInspection.bytecodeAnalysis.asm.ASMUtils;
|
||||
import com.intellij.codeInspection.dataFlow.ContractReturnValue;
|
||||
import com.intellij.codeInspection.dataFlow.StandardMethodContract;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,6 +21,22 @@ enum Value implements Result {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
static @Nullable Value fromBasicValue(BasicValue value) {
|
||||
if (value == AbstractValues.TrueValue) {
|
||||
return True;
|
||||
}
|
||||
if (value == AbstractValues.FalseValue) {
|
||||
return False;
|
||||
}
|
||||
if (value == AbstractValues.NullValue) {
|
||||
return Null;
|
||||
}
|
||||
if (value instanceof AbstractValues.NotNullValue) {
|
||||
return NotNull;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
ContractReturnValue toReturnValue() {
|
||||
switch (this) {
|
||||
case False: return ContractReturnValue.returnFalse();
|
||||
|
||||
+5
-16
@@ -3,7 +3,6 @@
|
||||
package com.intellij.codeInspection.dataFlow;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.instructions.Instruction;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
@@ -102,7 +101,7 @@ class StateQueue {
|
||||
}
|
||||
|
||||
if (memoryStates.size() > 1 && joinInstructions.contains(instruction)) {
|
||||
memoryStates = squash(memoryStates);
|
||||
squash(memoryStates);
|
||||
}
|
||||
|
||||
if (memoryStates.size() > 1 && joinInstructions.contains(instruction)) {
|
||||
@@ -121,7 +120,7 @@ class StateQueue {
|
||||
beforeSize = memoryStates.size();
|
||||
if (beforeSize == 1) break;
|
||||
// If some states were merged it's possible that they could be further squashed
|
||||
memoryStates = squash(memoryStates);
|
||||
squash(memoryStates);
|
||||
if (memoryStates.size() == beforeSize || memoryStates.size() == 1) break;
|
||||
}
|
||||
}
|
||||
@@ -131,21 +130,11 @@ class StateQueue {
|
||||
return ContainerUtil.map(memoryStates, state1 -> new DfaInstructionState(instruction, state1));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<DfaMemoryStateImpl> squash(List<DfaMemoryStateImpl> states) {
|
||||
List<DfaMemoryStateImpl> result = new ArrayList<>(states);
|
||||
for (Iterator<DfaMemoryStateImpl> iterator = result.iterator(); iterator.hasNext(); ) {
|
||||
DfaMemoryStateImpl left = iterator.next();
|
||||
for (DfaMemoryStateImpl right : result) {
|
||||
ProgressManager.checkCanceled();
|
||||
if (right != left && right.isSuperStateOf(left)) {
|
||||
iterator.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return DfaUtil.upwardsAntichain(states, (l, r) -> r.isSuperStateOf(l));
|
||||
}
|
||||
|
||||
|
||||
static List<DfaMemoryStateImpl> mergeGroup(List<DfaMemoryStateImpl> group) {
|
||||
if (group.size() < 2) {
|
||||
return group;
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfReferenceType;
|
||||
import com.intellij.codeInspection.dataFlow.types.DfTypes;
|
||||
import com.intellij.codeInspection.dataFlow.value.*;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.controlFlow.DefUseUtil;
|
||||
import com.intellij.psi.impl.source.resolve.JavaResolveUtil;
|
||||
@@ -24,6 +25,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static com.intellij.psi.CommonClassNames.JAVA_UTIL_COLLECTIONS;
|
||||
@@ -410,4 +412,24 @@ public final class DfaUtil {
|
||||
return value instanceof Double && ((Double)value).isNaN() ||
|
||||
value instanceof Float && ((Float)value).isNaN();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param poset input poset (mutable)
|
||||
* @param predicate non-strict partial order over the input poset
|
||||
* @param <T> type of poset elements
|
||||
* @return the longest strong upwards antichain contained in the poset (input poset object with some elements removed)
|
||||
*/
|
||||
public static <T, C extends Collection<T>> C upwardsAntichain(@NotNull C poset, @NotNull BiPredicate<T, T> predicate) {
|
||||
for (Iterator<T> iterator = poset.iterator(); iterator.hasNext(); ) {
|
||||
T left = iterator.next();
|
||||
for (T right : poset) {
|
||||
ProgressManager.checkCanceled();
|
||||
if (right != left && predicate.test(left, right)) {
|
||||
iterator.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return poset;
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -493,6 +493,7 @@
|
||||
</item>
|
||||
<item name='java.io.InputStream void reset()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -1017,11 +1018,13 @@
|
||||
</item>
|
||||
<item name='java.io.Reader void mark(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.io.Reader void reset()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+6
-3
@@ -3820,9 +3820,6 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.lang.System void checkKey(java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='java.lang.System void setProperties(java.util.Properties) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
@@ -3847,6 +3844,7 @@
|
||||
</item>
|
||||
<item name='java.lang.Thread java.lang.Object clone()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -3873,6 +3871,11 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.lang.Thread void destroy()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.lang.Thread void setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
|
||||
+5
@@ -803,6 +803,11 @@
|
||||
<item name='java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle rebind()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle reinvokerTarget()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle setVarargs(java.lang.invoke.MemberName)'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
|
||||
+10
@@ -1116,6 +1116,16 @@
|
||||
<item name='java.net.URLConnection int readBytes(int[], int, java.io.InputStream) 2'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='java.net.URLConnection java.io.InputStream getInputStream()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.net.URLConnection java.io.OutputStream getOutputStream()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.net.URLConnection java.lang.String getContentEncoding()'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
|
||||
+13
@@ -61,16 +61,19 @@
|
||||
</item>
|
||||
<item name='java.sql.Date int getHours()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Date int getMinutes()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Date int getSeconds()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -85,16 +88,19 @@
|
||||
</item>
|
||||
<item name='java.sql.Date void setHours(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Date void setMinutes(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Date void setSeconds(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -215,21 +221,25 @@
|
||||
</item>
|
||||
<item name='java.sql.Time int getDate()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Time int getDay()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Time int getMonth()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Time int getYear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -250,11 +260,13 @@
|
||||
</item>
|
||||
<item name='java.sql.Time void setDate(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.sql.Time void setMonth(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -265,6 +277,7 @@
|
||||
</item>
|
||||
<item name='java.sql.Time void setYear(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+47
@@ -47,6 +47,7 @@
|
||||
</item>
|
||||
<item name='java.util.AbstractList E remove(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -1464,11 +1465,13 @@
|
||||
</item>
|
||||
<item name='java.util.Calendar int getWeekYear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.Calendar int getWeeksInWeekYear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -1555,6 +1558,7 @@
|
||||
</item>
|
||||
<item name='java.util.Calendar void setWeekDate(int, int, int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_,_,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -2403,6 +2407,7 @@
|
||||
</item>
|
||||
<item name='java.util.Collections.EmptyEnumeration E nextElement()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -2421,6 +2426,7 @@
|
||||
</item>
|
||||
<item name='java.util.Collections.EmptyIterator E next()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -2439,11 +2445,13 @@
|
||||
</item>
|
||||
<item name='java.util.Collections.EmptyIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.Collections.EmptyList E get(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -2520,6 +2528,7 @@
|
||||
</item>
|
||||
<item name='java.util.Collections.EmptyListIterator E previous()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -3062,11 +3071,13 @@
|
||||
</item>
|
||||
<item name='java.util.Collections.UnmodifiableCollection void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.Collections.UnmodifiableList E remove(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -3159,6 +3170,7 @@
|
||||
</item>
|
||||
<item name='java.util.Collections.UnmodifiableMap void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -5225,6 +5237,16 @@
|
||||
<val name="mutates" val=""this""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap K firstKey()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap K lastKey()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap SubMap()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
@@ -5236,15 +5258,40 @@
|
||||
</annotation>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.Comparator<? super K> comparator()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.Set<java.util.Map.Entry<K,V>> entrySet()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> headMap(K)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> headMap(K) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> subMap(K, K)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_,_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> subMap(K, K) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> subMap(K, K) 1'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> tailMap(K)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.TreeMap.SubMap java.util.SortedMap<K,V> tailMap(K) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
|
||||
+40
@@ -1,7 +1,47 @@
|
||||
<root>
|
||||
<item name='java.util.concurrent.TimeUnit long convert(long, java.util.concurrent.TimeUnit)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_,_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long convert(long, java.util.concurrent.TimeUnit) 1'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toDays(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toHours(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toMicros(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toMillis(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toMinutes(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toNanos(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long toSeconds(long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.TimeUnit long x(long, long, long)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
|
||||
+6
@@ -10,6 +10,7 @@
|
||||
</item>
|
||||
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean isHeldExclusively()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -35,16 +36,19 @@
|
||||
</item>
|
||||
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean tryAcquire(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean tryRelease(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean tryReleaseShared(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -53,6 +57,7 @@
|
||||
</item>
|
||||
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer int tryAcquireShared(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -295,6 +300,7 @@
|
||||
</item>
|
||||
<item name='java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock java.util.concurrent.locks.Condition newCondition()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+2
-15
@@ -1191,11 +1191,13 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.CursorableLinkedList.Cursor int nextIndex()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.CursorableLinkedList.Cursor int previousIndex()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -1599,39 +1601,24 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKey(java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKeyAndValue(java.lang.Object, java.lang.Object)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_,null->fail;null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 1'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkNonNullComparable(java.lang.Object, int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkNonNullComparable(java.lang.Object, int) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkValue(java.lang.Object)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void checkValue(java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.DoubleOrderedMap void copyColor(org.apache.commons.collections.DoubleOrderedMap.Node, org.apache.commons.collections.DoubleOrderedMap.Node, int) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
|
||||
-15
@@ -502,39 +502,24 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKey(java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKeyAndValue(java.lang.Object, java.lang.Object)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_,null->fail;null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 1'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkNonNullComparable(java.lang.Object, int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkNonNullComparable(java.lang.Object, int) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkValue(java.lang.Object)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkValue(java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void copyColor(org.apache.commons.collections.bidimap.TreeBidiMap.Node, org.apache.commons.collections.bidimap.TreeBidiMap.Node, int) 0'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
|
||||
-9
@@ -436,27 +436,18 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Closure[]) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Predicate[])'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Predicate[]) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Transformer[])'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Transformer[]) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.functors.IdentityPredicate IdentityPredicate(java.lang.Object)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
|
||||
+9
@@ -26,21 +26,25 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object getKey()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object getValue()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object next()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object previous()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -64,6 +68,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -163,6 +168,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.ArrayIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -415,6 +421,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.FilterListIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -538,6 +545,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.ListIteratorWrapper void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -620,6 +628,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.iterators.ObjectArrayIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+3
@@ -390,6 +390,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.list.FixedSizeList java.lang.Object remove(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -432,6 +433,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.list.FixedSizeList void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -454,6 +456,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.list.FixedSizeList.FixedSizeListIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+7
-3
@@ -909,6 +909,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.FixedSizeMap void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -978,6 +979,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.FixedSizeSortedMap void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -1418,11 +1420,13 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.LinkedMap.LinkedMapList java.lang.Object remove(int)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.LinkedMap.LinkedMapList void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -1774,9 +1778,6 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.MultiKeyMap void checkKey(java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.MultiKeyMap void putAll(java.util.Map) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
@@ -2106,6 +2107,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.SingletonMap void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -2135,6 +2137,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.SingletonMap.SingletonMapIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -2166,6 +2169,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.collections.map.SingletonMap.SingletonValues void clear()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+4
-30
@@ -4445,72 +4445,52 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[])'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[]) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[], java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[], java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection, java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection, java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[])'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[]) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[], java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[], java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String, java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String, java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notEmpty(java.util.Collection) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
@@ -4529,18 +4509,12 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notNull(java.lang.Object) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notNull(java.lang.Object, java.lang.String)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""null,_->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.Validate void notNull(java.lang.Object, java.lang.String) 0'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.WordUtils WordUtils()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
|
||||
+1
@@ -1169,6 +1169,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.text.StrTokenizer void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+1
@@ -349,6 +349,7 @@
|
||||
</item>
|
||||
<item name='org.apache.commons.lang.time.DateUtils.DateIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+6
@@ -535,6 +535,7 @@
|
||||
</item>
|
||||
<item name='org.apache.velocity.runtime.directive.Scope void stop()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -571,6 +572,11 @@
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.velocity.runtime.directive.Stop boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val val=""_,_,_->fail""/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name='org.apache.velocity.runtime.directive.Stop boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 1'>
|
||||
<annotation name='org.jetbrains.annotations.Nullable'/>
|
||||
</item>
|
||||
|
||||
+2
@@ -203,6 +203,7 @@
|
||||
</item>
|
||||
<item name='org.apache.velocity.runtime.log.RuntimeLoggerLog boolean getShowStackTraces()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
@@ -233,6 +234,7 @@
|
||||
</item>
|
||||
<item name='org.apache.velocity.runtime.log.RuntimeLoggerLog org.apache.velocity.runtime.log.LogChute getLogChute()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
+1
@@ -9,6 +9,7 @@
|
||||
</item>
|
||||
<item name='org.apache.velocity.util.ArrayIterator void remove()'>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="value" val=""->fail""/>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
|
||||
BIN
Binary file not shown.
@@ -13,6 +13,25 @@ import java.nio.file.Files;
|
||||
*/
|
||||
@SuppressWarnings({"unused", "IOResourceOpenedButNotSafelyClosed"})
|
||||
public class Test01 {
|
||||
@ExpectContract("true,_->fail")
|
||||
static void checkNegate(boolean val, String s1) {
|
||||
check(!val, s1, null);
|
||||
}
|
||||
|
||||
@ExpectContract("false,_->fail")
|
||||
static void check1(boolean val, String s1) {
|
||||
check(val, s1, null);
|
||||
}
|
||||
|
||||
@ExpectContract("false,_,_->fail")
|
||||
static void check(boolean val, String s1, String s2) {
|
||||
if (!val) {
|
||||
throw new RuntimeException(createMessage(s1, s2));
|
||||
}
|
||||
}
|
||||
|
||||
native static String createMessage(String s1, String s2);
|
||||
|
||||
@ExpectNotNull
|
||||
@ExpectContract(pure = true)
|
||||
public static MySupplier methodReference(@ExpectNotNull String s) {
|
||||
|
||||
Reference in New Issue
Block a user