本文整理汇总了Java中javax.annotation.meta.When.NEVER属性的典型用法代码示例。如果您正苦于以下问题:Java When.NEVER属性的具体用法?Java When.NEVER怎么用?Java When.NEVER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.annotation.meta.When
的用法示例。
在下文中一共展示了When.NEVER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: backwardsValueConflictsWithSource
/**
* Determine whether given backwards FlowValue conflicts with given source.
*
* @param backwardsFlowValue
* a backwards FlowValue
* @param source
* SourceSinkInfo object representing a source reached by the
* backwards flow value
* @param typeQualifierValue
* TypeQualifierValue being checked
* @param isIdentity TODO
* @return true if backwards value conflicts with source, false if not
*/
public static boolean backwardsValueConflictsWithSource(FlowValue backwardsFlowValue, SourceSinkInfo source,
TypeQualifierValue typeQualifierValue, boolean isIdentity) {
When sourceWhen = source.getWhen();
if (typeQualifierValue.isStrictQualifier() && !isIdentity) {
// strict checking
return (backwardsFlowValue == ALWAYS && sourceWhen != When.ALWAYS)
|| (backwardsFlowValue == NEVER && sourceWhen != When.NEVER);
} else {
// NOT strict checking
return (backwardsFlowValue == ALWAYS && (sourceWhen == When.NEVER || sourceWhen == When.MAYBE))
|| (backwardsFlowValue == NEVER && (sourceWhen == When.ALWAYS || sourceWhen == When.MAYBE));
}
}
示例2: checkLimit
@CheckReturnValue(when = When.NEVER)
public int checkLimit(final int limit) {
if (limit > capacity) {
throw new IndexOutOfBoundsException(String.format("limit is beyond capacity (l=%d; c=%d)"
, limit, capacity));
}
return limit;
}
示例3: checkIndex
@CheckReturnValue(when = When.NEVER)
int checkIndex(final int index) {
if (index >= capacity) {
throw new IndexOutOfBoundsException(String.format("index is beyond bound (i=%d; b=%d)"
, index, capacity - 1));
}
return index;
}
示例4: paramNonnullNever
public void paramNonnullNever (@Nonnull (when = When.NEVER) final String s)
{}
示例5: OperandFromEndSubstitutionSource
private OperandFromEndSubstitutionSource(@Nonnegative(when = When.NEVER) int operandIndex) {
this.operandIndex = operandIndex;
}
示例6: paramNonnullNever
void paramNonnullNever (@Nonnull (when = When.NEVER) String s);