Examples of errors detected by the V6033 diagnostic


V6033. An item with the same key has already been added.


SonarJava

V6033 [CWE-462] An item with the same key 'JavaPunctuator.PLUSEQU' has already been added. Check lines: 104, 100. KindMaps.java 104


private final Map<JavaPunctuator, Tree.Kind> assignmentOperators =
  Maps.newEnumMap(JavaPunctuator.class);

public KindMaps() {
  ....
  assignmentOperators.put(JavaPunctuator.PLUSEQU, Tree.Kind.PLUS_ASSIGNMENT);
  ....
  assignmentOperators.put(JavaPunctuator.PLUSEQU, Tree.Kind.PLUS_ASSIGNMENT);
  ....
}

Bouncy Castle

V6033 [CWE-462] An item with the same key 'PKCSObjectIdentifiers.pbeWithSHAAnd3_KeyTripleDES_CBC' has already been added. Check lines: 50, 49. PKCS12PBEUtils.java 50


class PKCS12PBEUtils
{
  ....
  private static Set desAlgs = new HashSet();

  static
  {
    ....
    desAlgs.add(PKCSObjectIdentifiers.pbeWithSHAAnd3_KeyTripleDES_CBC);
    desAlgs.add(PKCSObjectIdentifiers.pbeWithSHAAnd3_KeyTripleDES_CBC);
  }
  ....
}

Bouncy Castle

V6033 [CWE-462] An item with the same key 'RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_256' has already been added. Check lines: 43, 41. DefaultAlgorithmNameFinder.java 43


public class DefaultAlgorithmNameFinder
    implements AlgorithmNameFinder
{
    private final static Map algorithms = new HashMap();

    static
    {
      ....
      algorithms.put(....id_tc26_signwithdigest_gost_3410_12_256,   // <=
                     "GOST3411WITHGOST3410-2012-256");
      algorithms.put(....id_tc26_signwithdigest_gost_3410_12_512,
                     "GOST3411WITHGOST3410-2012-512");
      algorithms.put(....id_tc26_signwithdigest_gost_3410_12_256,   // <=
                     "GOST3411WITHECGOST3410-2012-256");
      algorithms.put(....id_tc26_signwithdigest_gost_3410_12_512,
                     "GOST3411WITHECGOST3410-2012-512");
      ....
    }
}

Similar errors can be found in some other places:

  • V6033 [CWE-462] An item with the same key 'RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_256' has already been added. Check lines: 45, 41. DefaultAlgorithmNameFinder.java 45
  • V6033 [CWE-462] An item with the same key 'RosstandartObjectIdentifiers.id_tc26_signwithdigest_gost_3410_12_256' has already been added. Check lines: 47, 41. DefaultAlgorithmNameFinder.java 47
  • V6033 [CWE-462] An item with the same key 'badCertId.value' has already been added. Check lines: 63, 56. CMCFailInfo.java 63
  • And 10 additional diagnostic messages.


Bugs Found

Checked Projects
343
Collected Errors
12 850