mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make "use bounded wildcards" inspection off by default, enable in our project profile instead
This commit is contained in:
+1
@@ -158,6 +158,7 @@
|
||||
<inspection_tool class="BeforeOrAfterIsPublicVoidNoArg" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="BindingAnnotationWithoutInject" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="BoundedWildcard" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="BpmnConfigDomInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="BuildoutUnresolvedPartInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
|
||||
@@ -2281,7 +2281,7 @@
|
||||
key="assert.message.not.string.display.name" groupBundle="messages.InspectionsBundle" groupKey="group.names.code.style.issues"
|
||||
enabledByDefault="false" level="WARNING" implementationClass="com.siyeh.ig.style.AssertMessageNotStringInspection"/>
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="BoundedWildcard" bundle="com.siyeh.InspectionGadgetsBundle" key="bounded.wildcard.display.name"
|
||||
groupBundle="messages.InspectionsBundle" groupKey="group.names.code.style.issues" enabledByDefault="true"
|
||||
groupBundle="messages.InspectionsBundle" groupKey="group.names.code.style.issues" enabledByDefault="false"
|
||||
level="WARNING" implementationClass="com.siyeh.ig.style.BoundedWildcardInspection"/>
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="CallToStringConcatCanBeReplacedByOperator" bundle="com.siyeh.InspectionGadgetsBundle"
|
||||
key="call.to.string.concat.can.be.replaced.by.operator.display.name" groupBundle="messages.InspectionsBundle"
|
||||
|
||||
@@ -308,6 +308,9 @@ public class BoundedWildcardInspection extends AbstractBaseJavaLocalInspectionTo
|
||||
else {
|
||||
boolean canBeSuperT = isPassedToMethodWhichAlreadyAcceptsQuestionT(ref, superT, method);
|
||||
boolean canBeExtendsT = isPassedToMethodWhichAlreadyAcceptsQuestionT(ref, extendsT, method);
|
||||
if (canBeExtendsT && canBeSuperT) {
|
||||
return true; // ignore e.g. recursive call
|
||||
}
|
||||
// otherwise it can be just "foo(Object)" to which anything can be passed - not very interesting
|
||||
if (canBeSuperT != canBeExtendsT || v[0] != Variance.NOVARIANT) {
|
||||
if (canBeSuperT && (v[0] == Variance.NOVARIANT || v[0] == Variance.CONTRAVARIANT)) {
|
||||
@@ -319,6 +322,7 @@ public class BoundedWildcardInspection extends AbstractBaseJavaLocalInspectionTo
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// some strange usage. do not highlight
|
||||
v[0] = Variance.INVARIANT;
|
||||
}
|
||||
|
||||
@@ -113,6 +113,15 @@ public class Simple<T> {
|
||||
//buffer.append(" [...]\n");
|
||||
}
|
||||
}
|
||||
///////// recursive 2
|
||||
public static boolean isBackpointerReference(Object expression, Processor<<warning descr="Can generalize to '? super Number'">Number</warning>> numberCond) {
|
||||
if (expression instanceof Number) {
|
||||
final String contents = expression.toString();
|
||||
return isBackpointerReference(contents, numberCond);
|
||||
}
|
||||
return expression instanceof Number && numberCond.process((Number)expression);
|
||||
}
|
||||
|
||||
|
||||
///////// can't deduce anything - too general
|
||||
private static String findNonCodeAnnotation(Collection<String> annotationNames, Map<Collection<String>, String> map ) {
|
||||
|
||||
Reference in New Issue
Block a user