Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
Examples of errors detected by the V601…

Examples of errors detected by the V6016 diagnostic

V6016. Suspicious access to element by a constant index inside a loop.


Bouncy Castle

V6016 Suspicious access to element of 'fp.p' object by a constant index inside a loop. ECPointTest.java 281


/**
 * Calls <code>implTestAllPoints()</code> for the small literature curves,
 * both for <code>Fp</code> and <code>F2m</code>.
 */
public void testAllPoints()
{
  for (int i = 0; i < fp.p.length; i++)
  {
    implTestAllPoints(fp.p[0], fp.infinity);
  }

  for (int i = 0; i < f2m.p.length; i++)
  {
    implTestAllPoints(f2m.p[0], f2m.infinity);
  }
}

Similar errors can be found in some other places:

  • V6016 Suspicious access to element of 'f2m.p' object by a constant index inside a loop. ECPointTest.java 286

Apache Dubbo

V6016 Suspicious access to element of 'types' object by a constant index inside a loop. RpcUtils.java(153)


public static Class<?>[] getParameterTypes(Invocation invocation) {
  if ($INVOKE.equals(invocation.getMethodName())
            && invocation.getArguments() != null
            && invocation.getArguments().length > 1
            && invocation.getArguments()[1] instanceof String[]) {
    String[] types = (String[]) invocation.getArguments()[1];
    if (types == null) {
      return new Class<?>[0];
    }
    Class<?>[] parameterTypes = new Class<?>[types.length];
    for (int i = 0; i < types.length; i++) {
      parameterTypes[i] = ReflectUtils.forName(types[0]);      // <=
    }
    return parameterTypes;
  }
  return invocation.getParameterTypes();
}

Apache Solr

V6016 Suspicious access to element of 'list' object by a constant index inside a loop. AscEvaluator.java 56


public Object doWork(Object value) throws IOException {
  ....
  List<?> list = (List<?>) value;
  // Validate all of same type and are comparable
  Object checkingObject = list.get(0);
  for (int idx = 0; idx < list.size(); ++idx) {
    Object item = list.get(0);                         // <=

    if (null == item) {
      throw new IOException(....);
    } else if (!(item instanceof Comparable<?>)) {
      throw new IOException(....);
    } else if (!item.getClass()
                    .getCanonicalName()
                    .equals(checkingObject.getClass()
                                          .getCanonicalName())) {
       throw new IOException(....);
    }
  }
  ....
}

close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam