From d37d3178577f8b553e2f8acb9a226b702c970c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicklas=20K=C3=B6rtge?= Date: Wed, 20 Nov 2024 10:56:25 +0100 Subject: [PATCH] Feature/fix dependency updates and remove jetbrains annotations (#191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix plugin config, remove jetbrains annotations Signed-off-by: Nicklas Körtge * fix sonar api version, so it works with the latest sonarqube and update plugin config Signed-off-by: Nicklas Körtge --------- Signed-off-by: Nicklas Körtge --- .../ibm/engine/detection/DetectionStore.java | 8 ++--- .../detection/DetectionStoreWithHook.java | 4 +-- .../com/ibm/engine/detection/Finding.java | 3 +- .../ibm/engine/detection/MethodMatcher.java | 7 ++--- .../engine/executive/DetectionExecutive.java | 10 +++--- .../language/java/JavaDetectionEngine.java | 4 +-- .../language/java/JavaLanguageSupport.java | 9 +++--- .../java/JavaLanguageTranslation.java | 26 +++++++++++----- .../engine/language/java/JavaScanContext.java | 5 ++- .../python/PythonDetectionEngine.java | 11 +++---- .../python/PythonLanguageSupport.java | 22 ++++++------- .../python/PythonLanguageTranslation.java | 25 +++++++-------- .../language/python/PythonScanContext.java | 7 ++--- .../language/python/PythonSemantic.java | 2 +- .../main/java/com/ibm/engine/model/Curve.java | 4 +-- .../main/java/com/ibm/engine/model/Mode.java | 5 ++- .../java/com/ibm/engine/model/Padding.java | 5 ++- .../java/com/ibm/engine/model/Protocol.java | 7 +++-- .../context/AlgorithmParameterContext.java | 4 +-- .../model/context/DetectionContext.java | 3 +- .../model/context/KeyAgreementContext.java | 7 +++-- .../context/KeyDerivationFunctionContext.java | 6 ++-- .../engine/model/context/ProtocolContext.java | 7 +++-- .../model/factory/AlgorithmFactory.java | 3 +- .../factory/AlgorithmParameterFactory.java | 3 +- .../model/factory/CipherSuiteFactory.java | 3 +- .../engine/model/factory/CurveFactory.java | 3 +- .../ibm/engine/model/factory/ModeFactory.java | 4 +-- .../engine/model/factory/PaddingFactory.java | 4 +-- .../factory/ParameterIdentifierFactory.java | 3 +- .../builder/DetectionRuleBuilderImpl.java | 17 +++++----- .../main/java/com/ibm/enricher/Enricher.java | 7 +++-- .../ibm/enricher/algorithm/AESEnricher.java | 8 ++--- .../ibm/enricher/algorithm/DESEnricher.java | 4 +-- .../ibm/enricher/algorithm/DHEnricher.java | 3 +- .../ibm/enricher/algorithm/DSAEnricher.java | 4 +-- .../enricher/algorithm/PBKDF2Enricher.java | 4 +-- .../ibm/enricher/algorithm/RSAEnricher.java | 10 +++--- .../enricher/algorithm/RSAoaepEnricher.java | 4 +-- .../enricher/algorithm/RSAssaPSSEnricher.java | 4 +-- .../ibm/enricher/algorithm/SHA2Enricher.java | 6 ++-- .../ibm/enricher/algorithm/SHA3Enricher.java | 3 +- .../enricher/algorithm/SignatureEnricher.java | 9 +++--- .../algorithm/TagOrDigestEnricher.java | 4 +-- java/pom.xml | 15 +++++---- java/rule-graph/parse.py | 2 +- .../java/com/ibm/plugin/JavaAggregator.java | 2 -- .../com/ibm/plugin/JavaCheckRegistrar.java | 7 ++--- .../java/com/ibm/plugin/JavaRuleList.java | 10 +++--- .../ibm/plugin/rules/JavaInventoryRule.java | 6 ++-- .../ibm/plugin/rules/JavaNoMD5UseRule.java | 4 +-- .../detection/JavaBaseDetectionRule.java | 6 ++-- .../bc/BouncyCastleDetectionRules.java | 18 ++++++++--- .../bc/aeadcipher/BcAEADCipherEngine.java | 5 +-- .../bc/aeadcipher/BcAEADCipherInit.java | 2 -- .../bc/aeadcipher/BcCCMBlockCipher.java | 2 -- .../bc/aeadcipher/BcChaCha20Poly1305.java | 2 -- .../bc/aeadcipher/BcEAXBlockCipher.java | 2 -- .../bc/aeadcipher/BcGCMBlockCipher.java | 2 -- .../bc/aeadcipher/BcGCMSIVBlockCipher.java | 2 -- .../bc/aeadcipher/BcKCCMBlockCipher.java | 2 -- .../bc/aeadcipher/BcKGCMBlockCipher.java | 2 -- .../bc/aeadcipher/BcOCBBlockCipher.java | 2 -- .../BcAsymCipherEngine.java | 6 +--- .../BcAsymCipherInit.java | 2 -- .../BcAsymmetricBlockCipher.java | 3 -- .../BcBufferedAsymmetricBlockCipher.java | 2 -- .../BcISO9796d1Encoding.java | 3 -- .../asymmetricblockcipher/BcOAEPEncoding.java | 3 -- .../BcPKCS1Encoding.java | 3 -- .../bc/basicagreement/BcBasicAgreement.java | 5 +-- .../basicagreement/BcBasicAgreementInit.java | 2 -- .../bc/blockcipher/BcBlockCipher.java | 5 --- .../bc/blockcipher/BcBlockCipherEngine.java | 3 -- .../bc/blockcipher/BcBlockCipherInit.java | 2 -- .../BcBlockCipherPadding.java | 5 +-- .../BcBufferedBlockCipher.java | 7 ++--- .../BcBufferedBlockCipherInit.java | 2 -- .../bc/cipherparameters/BcAEADParameters.java | 2 -- .../bc/cipherparameters/BcCCMParameters.java | 2 -- .../BcCramerShoupParameters.java | 2 -- .../bc/cipherparameters/BcGMSSParameters.java | 2 -- .../bc/cipherparameters/BcIESParameters.java | 2 -- .../bc/cipherparameters/BcKeyParameter.java | 2 -- .../BcNTRUEncryptionParameters.java | 2 -- .../BcNTRUSigningPrivateKeyParameters.java | 2 -- .../BcNTRUSigningPublicKeyParameters.java | 2 -- .../bc/cipherparameters/BcParametersWith.java | 2 -- .../cipherparameters/BcSABERParameters.java | 2 -- .../BcDerivationFunction.java | 7 ++--- .../rules/detection/bc/digest/BcDigests.java | 3 -- .../plugin/rules/detection/bc/dsa/BcDSA.java | 5 +-- .../rules/detection/bc/dsa/BcDSAInit.java | 2 -- .../BcEncapsulatedSecretExtractor.java | 7 ++--- .../BcEncapsulatedSecretGenerator.java | 7 ++--- .../plugin/rules/detection/bc/mac/BcMac.java | 7 ++--- .../rules/detection/bc/mac/BcMacInit.java | 2 -- .../bc/messagesigner/BcMessageSigner.java | 7 ++--- .../bc/messagesigner/BcMessageSignerInit.java | 2 -- .../BcStateAwareMessageSigner.java | 7 ++--- .../rules/detection/bc/other/BcIESEngine.java | 2 -- .../detection/bc/other/BcIESEngineInit.java | 2 -- .../rules/detection/bc/other/BcSM2Engine.java | 2 -- .../detection/bc/other/BcSM2EngineInit.java | 2 -- .../bc/pbe/BcPBEParametersGenerator.java | 5 +-- .../bc/signer/BcDSADigestSigner.java | 2 -- .../detection/bc/signer/BcGenericSigner.java | 2 -- .../bc/signer/BcISO9796d2PSSSigner.java | 2 -- .../bc/signer/BcISO9796d2Signer.java | 2 -- .../detection/bc/signer/BcPQCSigner.java | 5 +-- .../detection/bc/signer/BcPSSSigner.java | 2 -- .../bc/signer/BcRSADigestSigner.java | 2 -- .../detection/bc/signer/BcSM2Signer.java | 2 -- .../rules/detection/bc/signer/BcSigner.java | 2 -- .../detection/bc/signer/BcSignerInit.java | 2 -- .../detection/bc/signer/BcSimpleSigner.java | 5 +-- .../detection/bc/signer/BcX931Signer.java | 2 -- .../bc/streamcipher/BcStreamCipherEngine.java | 5 +-- .../bc/streamcipher/BcStreamCipherInit.java | 2 -- .../detection/bc/wrapper/BcWrapperEngine.java | 7 ++--- .../detection/bc/wrapper/BcWrapperInit.java | 2 -- ...lgorithmParameterGeneratorGetInstance.java | 2 -- .../JcaAlgorithmParameterGeneratorInit.java | 2 -- .../JcaAlgorithmParameterSpec.java | 2 -- .../algorithmspec/JcaDHGenParameterSpec.java | 2 -- .../jca/algorithmspec/JcaDHParameterSpec.java | 2 -- .../algorithmspec/JcaECGenParameterSpec.java | 2 -- .../jca/algorithmspec/JcaECParameterSpec.java | 2 -- .../algorithmspec/JcaMGF1ParameterSpec.java | 2 -- .../algorithmspec/JcaPSSParameterSpec.java | 2 -- .../jca/cipher/JcaCipherGetInstance.java | 2 -- .../detection/jca/cipher/JcaCipherInit.java | 2 -- .../detection/jca/cipher/JcaCipherWrap.java | 2 -- .../rules/detection/jca/digest/JcaDigest.java | 2 -- .../digest/JcaMessageDigestGetInstance.java | 2 -- .../JcaKeyAgreementGenerateSecret.java | 2 -- .../JcaKeyAgreementGetInstance.java | 2 -- .../jca/keyagreement/JcaKeyAgreementInit.java | 2 -- .../jca/keyfactory/JcaKeyFactoryGenerate.java | 2 -- .../keyfactory/JcaKeyFactoryGetInstance.java | 2 -- .../JcaSecretKeyFactoryGenerateSecret.java | 2 -- .../JcaSecretKeyFactoryGetInstance.java | 2 -- .../JcaSecretKeyFactoryTranslateKey.java | 2 -- .../JcaKeyGeneratorGetInstance.java | 2 -- .../jca/keygenerator/JcaKeyGeneratorInit.java | 2 -- .../JcaKeyPairGeneratorGetInstance.java | 2 -- .../JcaKeyPairGeneratorInitialize.java | 2 -- .../detection/jca/keyspec/JcaDESKeySpec.java | 2 -- .../jca/keyspec/JcaDESedeKeySpec.java | 2 -- .../jca/keyspec/JcaDHPrivateKeySpec.java | 2 -- .../jca/keyspec/JcaDSAPrivateKeySpec.java | 2 -- .../jca/keyspec/JcaECPrivateKeySpec.java | 2 -- .../detection/jca/keyspec/JcaKeySpec.java | 2 -- .../detection/jca/keyspec/JcaPBEKeySpec.java | 2 -- .../jca/keyspec/JcaSecretKeySpec.java | 2 -- .../detection/jca/mac/JcaMacGetInstance.java | 2 -- .../jca/parameterspec/JcaDHParameterSpec.java | 2 -- .../jca/parameterspec/JcaParameterSpec.java | 2 -- .../jca/signature/JcaSignatureAction.java | 2 -- .../signature/JcaSignatureGetInstance.java | 2 -- .../signature/JcaSignatureSetParameter.java | 2 -- .../random/SecureRandomGetInstance.java | 2 -- .../rules/detection/ssl/SSLContext.java | 2 -- .../ssl/SSLParametersSetProtocols.java | 2 -- ...SSLServerSocketSetEnabledCipherSuites.java | 2 -- .../SSLServerSocketSetEnabledProtocols.java | 2 -- .../rules/detection/ssl/SSLSetParameters.java | 2 -- .../translation/JavaTranslationProcess.java | 3 +- .../JavaAbstractLibraryTranslator.java | 31 ++++++++++--------- ...vaAlgorithmParameterContextTranslator.java | 27 ++++++++-------- .../contexts/JavaCipherContextTranslator.java | 22 +++++++------ .../contexts/JavaDigestContextTranslator.java | 20 ++++++------ .../JavaKeyAgreementContextTranslator.java | 18 +++++------ .../contexts/JavaKeyContextTranslator.java | 20 ++++++------ .../contexts/JavaMacContextTranslator.java | 21 ++++++------- .../contexts/JavaPRNGContextTranslator.java | 13 ++++---- .../JavaProtocolContextTranslator.java | 13 ++++---- .../JavaSecretKeyContextTranslator.java | 18 +++++------ .../JavaSignatureContextTranslator.java | 20 ++++++------ .../test/java/com/ibm/plugin/TestBase.java | 3 +- ...atchingExactTypesExceptParametersTest.java | 14 +++++---- .../DetectionRuleMatchingExactTypesTest.java | 14 +++++---- .../detection/DetectionWithSubRuleTest.java | 5 ++- .../bc/aeadcipher/BcAEADCipherEngineTest.java | 7 ++--- .../bc/aeadcipher/BcCCMBlockCipherTest.java | 12 +++---- .../bc/aeadcipher/BcChaCha20Poly1305Test.java | 6 ++-- .../bc/aeadcipher/BcEAXBlockCipherTest.java | 6 ++-- .../bc/aeadcipher/BcGCMBlockCipherTest.java | 6 ++-- .../aeadcipher/BcGCMSIVBlockCipherTest.java | 6 ++-- .../bc/aeadcipher/BcKCCMBlockCipherTest.java | 6 ++-- .../bc/aeadcipher/BcKGCMBlockCipherTest.java | 6 ++-- .../bc/aeadcipher/BcOCBBlockCipherTest.java | 6 ++-- .../BcAsymmetricBlockCipherTest.java | 6 ++-- .../BcBufferedAsymmetricBlockCipherTest.java | 6 ++-- .../BcISO9796d1EncodingTest.java | 6 ++-- .../BcOAEPEncodingTest.java | 6 ++-- .../BcPKCS1EncodingTest.java | 6 ++-- .../BcECDHBasicAgreementTest.java | 6 ++-- .../bc/blockcipher/BcCBCBlockCipherTest.java | 6 ++-- .../BcG3413CFBBlockCipherTest.java | 6 ++-- .../BcCTSBlockCipherTest.java | 6 ++-- .../BcDefaultBufferedBlockCipherTest.java | 6 ++-- .../BcNISTCTSBlockCipherTest.java | 7 ++--- ...dBufferedBlockCipherCustomPaddingTest.java | 6 ++-- .../BcPaddedBufferedBlockCipherTest.java | 6 ++-- .../BcAEADParametersTest.java | 6 ++-- .../cipherparameters/BcCCMParametersTest.java | 6 ++-- .../BcCramerShoupParametersTest.java | 6 ++-- .../BcGMSSParametersTest.java | 6 ++-- .../cipherparameters/BcIESParametersTest.java | 6 ++-- .../cipherparameters/BcKeyParametersTest.java | 6 ++-- .../BcNTRUParametersTest.java | 6 ++-- .../BcParametersWithTest.java | 6 ++-- .../BcSABERParametersTest.java | 6 ++-- .../BcHKDFBytesGeneratorTest.java | 6 ++-- .../BcHandshakeKDFFunctionTest.java | 6 ++-- .../BcKDFCounterBytesGeneratorTest.java | 6 ++-- .../BcMGF1BytesGeneratorTest.java | 6 ++-- .../rules/detection/bc/dsa/BcDSATest.java | 6 ++-- .../BcBIKEKEMExtractorTest.java | 6 ++-- .../BcECIESKEMExtractorTest.java | 6 ++-- .../BcECIESKEMGeneratorTest.java | 6 ++-- .../BcKyberKEMGeneratorTest.java | 6 ++-- .../BcRSAKEMExtractorTest.java | 6 ++-- .../BcRSAKEMGeneratorTest.java | 6 ++-- .../detection/bc/mac/BcBlake3MacTest.java | 6 ++-- .../bc/mac/BcBlockCipherMacTest.java | 6 ++-- .../bc/mac/BcCBCBlockCipherMacTest.java | 6 ++-- .../bc/mac/BcCFBBlockCipherMacTest.java | 6 ++-- .../rules/detection/bc/mac/BcCMACTest.java | 6 ++-- .../rules/detection/bc/mac/BcDSTUMACTest.java | 6 ++-- .../rules/detection/bc/mac/BcGMACTest.java | 6 ++-- .../detection/bc/mac/BcGOST28147MacTest.java | 6 ++-- .../rules/detection/bc/mac/BcHMACTest.java | 6 ++-- .../bc/mac/BcISO9797Alg3MacTest.java | 6 ++-- .../rules/detection/bc/mac/BcKGMACTest.java | 6 ++-- .../rules/detection/bc/mac/BcKMACTest.java | 6 ++-- .../detection/bc/mac/BcPoly1305Test.java | 6 ++-- .../detection/bc/mac/BcSipHash128Test.java | 6 ++-- .../detection/bc/mac/BcSkeinMacTest.java | 6 ++-- .../rules/detection/bc/mac/BcVMPCMacTest.java | 6 ++-- .../detection/bc/mac/BcZuc256MacTest.java | 6 ++-- .../detection/bc/other/BcIESEngineTest.java | 6 ++-- .../detection/bc/other/BcSM2EngineTest.java | 6 ++-- .../BcOpenSSLPBEParametersGeneratorTest.java | 6 ++-- .../pbe/BcPKCS5S1ParametersGeneratorTest.java | 6 ++-- .../bc/signer/BcDSADigestSignerTest.java | 6 ++-- .../signer/BcDigestingMessageSignerTest.java | 6 ++-- ...cDigestingStateAwareMessageSignerTest.java | 6 ++-- .../bc/signer/BcEd25519ctxSignerTest.java | 6 ++-- .../bc/signer/BcGenericSignerTest.java | 6 ++-- .../bc/signer/BcISO9796d2PSSSignerTest.java | 6 ++-- .../bc/signer/BcISO9796d2SignerTest.java | 6 ++-- .../detection/bc/signer/BcPSSSignerTest.java | 6 ++-- .../bc/signer/BcRSADigestSignerTest.java | 6 ++-- .../detection/bc/signer/BcSM2SignerTest.java | 6 ++-- .../detection/bc/signer/BcX931SignerTest.java | 6 ++-- .../bc/streamcipher/BcChaChaEngineTest.java | 6 ++-- .../bc/wrapper/BcAESWrapEngineTest.java | 6 ++-- .../bc/wrapper/BcDSTU7624WrapEngineTest.java | 6 ++-- .../bc/wrapper/BcRFC3394WrapEngineTest.java | 6 ++-- ...ithmParameterGeneratorGetInstanceTest.java | 6 ++-- ...caAlgorithmParameterGeneratorInitTest.java | 6 ++-- .../JcaDHGenParameterSpecTest.java | 6 ++-- ...yAgreementGenerateSecretAlgorithmTest.java | 6 ++-- ...KeyAgreementGenerateSecretKeySizeTest.java | 6 ++-- .../JcaKeyAgreementGenerateSecretTest.java | 6 ++-- .../JcaKeyAgreementGetInstanceTest.java | 6 ++-- .../keyagreement/JcaKeyAgreementInitTest.java | 6 ++-- .../ssl/SSLContextGetInstanceTest.java | 6 ++-- .../ssl/SSLParametersSetProtocolsTest.java | 6 ++-- ...erverSocketSetEnabledCipherSuitesTest.java | 6 ++-- ...SLServerSocketSetEnabledProtocolsTest.java | 6 ++-- .../DuplicateDependingFindingsTest.java | 6 ++-- .../issues/DuplicateDependingRules2Test.java | 8 ++--- .../issues/DuplicateDependingRulesTest.java | 6 ++-- .../DuplicateParameterFindingsTest.java | 6 ++-- .../DuplicateParametersFinding2Test.java | 8 ++--- .../ibm/plugin/rules/issues/Issue16Test.java | 6 ++-- .../NextParameterDependingRulesTest.java | 6 ++-- .../ParameterValuesNotCapturedTest.java | 6 ++-- .../issues/StackOverFlowAssignmentTest.java | 6 ++-- .../ResolveDoubleSymbolReferenceTest.java | 6 +++- .../plugin/utils/GenerateAssertsHelper.java | 6 ++-- .../main/java/com/ibm/mapper/ITranslator.java | 3 +- .../bc/BcBufferedBlockCipherMapper.java | 6 ++-- .../mapper/mapper/bc/BcSignatureMapper.java | 6 ++-- .../ibm/mapper/mapper/jca/JcaCurveMapper.java | 9 +++--- .../ibm/mapper/mapper/jca/JcaPRNGMapper.java | 8 ++--- .../mapper/mapper/pyca/PycaCipherMapper.java | 8 ++--- .../mapper/mapper/pyca/PycaDigestMapper.java | 8 ++--- .../ibm/mapper/mapper/pyca/PycaMacMapper.java | 14 +++++---- .../ssl/AuthenticationAlgorithmMapper.java | 9 +++--- .../mapper/mapper/ssl/CipherSuiteMapper.java | 8 ++--- .../mapper/ssl/EncryptionAlgorithmMapper.java | 9 +++--- .../mapper/ssl/HashAlgorithmMapper.java | 9 +++--- .../ssl/KeyExchangeAlgorithmMapper.java | 9 +++--- .../mapper/mapper/ssl/SSLVersionMapper.java | 9 +++--- .../java/com/ibm/mapper/model/Algorithm.java | 5 ++- .../com/ibm/mapper/model/CipherSuite.java | 3 +- .../java/com/ibm/mapper/model/IPrimitive.java | 2 -- .../main/java/com/ibm/mapper/model/Key.java | 3 +- .../java/com/ibm/mapper/model/Property.java | 3 +- .../java/com/ibm/mapper/model/Protocol.java | 6 ++-- .../java/com/ibm/mapper/model/Unknown.java | 10 +++--- .../com/ibm/mapper/model/algorithms/AES.java | 15 +++++---- .../ibm/mapper/model/algorithms/ANSIX931.java | 4 +-- .../ibm/mapper/model/algorithms/ANSIX942.java | 4 +-- .../ibm/mapper/model/algorithms/ANSIX963.java | 6 ++-- .../com/ibm/mapper/model/algorithms/Aria.java | 11 +++---- .../ibm/mapper/model/algorithms/Blowfish.java | 11 +++---- .../com/ibm/mapper/model/algorithms/CMAC.java | 5 ++- .../ibm/mapper/model/algorithms/Camellia.java | 11 +++---- .../ibm/mapper/model/algorithms/ChaCha20.java | 9 +++--- .../model/algorithms/ChaCha20Poly1305.java | 3 +- .../com/ibm/mapper/model/algorithms/DES.java | 17 +++++----- .../ibm/mapper/model/algorithms/DESede.java | 13 ++++---- .../com/ibm/mapper/model/algorithms/DH.java | 7 ++--- .../com/ibm/mapper/model/algorithms/DSA.java | 9 +++--- .../com/ibm/mapper/model/algorithms/DSS.java | 4 +-- .../ibm/mapper/model/algorithms/ECCPWD.java | 4 +-- .../com/ibm/mapper/model/algorithms/ECDH.java | 3 +- .../ibm/mapper/model/algorithms/ECDSA.java | 9 +++--- .../ibm/mapper/model/algorithms/Ed25519.java | 4 +-- .../ibm/mapper/model/algorithms/Ed448.java | 4 +-- .../ibm/mapper/model/algorithms/EdDSA.java | 5 ++- .../ibm/mapper/model/algorithms/Fernet.java | 9 ++++-- .../com/ibm/mapper/model/algorithms/HC.java | 3 +- .../com/ibm/mapper/model/algorithms/HKDF.java | 3 +- .../com/ibm/mapper/model/algorithms/HMAC.java | 3 +- .../com/ibm/mapper/model/algorithms/IDEA.java | 7 ++--- .../ibm/mapper/model/algorithms/ISAAC.java | 3 +- .../ibm/mapper/model/algorithms/Kerberos.java | 6 ++-- .../com/ibm/mapper/model/algorithms/LEA.java | 11 +++---- .../com/ibm/mapper/model/algorithms/LMS.java | 3 +- .../ibm/mapper/model/algorithms/PBKDF1.java | 3 +- .../com/ibm/mapper/model/algorithms/PSK.java | 4 +-- .../com/ibm/mapper/model/algorithms/RC2.java | 11 +++---- .../com/ibm/mapper/model/algorithms/RC4.java | 11 +++---- .../com/ibm/mapper/model/algorithms/RSA.java | 9 +++--- .../mapper/model/algorithms/RSAssaPSS.java | 4 +-- .../com/ibm/mapper/model/algorithms/SEED.java | 9 +++--- .../com/ibm/mapper/model/algorithms/SM2.java | 3 +- .../com/ibm/mapper/model/algorithms/SM4.java | 7 ++--- .../com/ibm/mapper/model/algorithms/SRP.java | 4 +-- .../ibm/mapper/model/algorithms/Salsa20.java | 3 +- .../ibm/mapper/model/algorithms/Scrypt.java | 4 +-- .../ibm/mapper/model/algorithms/Skipjack.java | 9 +++--- .../mapper/model/algorithms/TripleDES.java | 15 +++++---- .../ibm/mapper/model/algorithms/X25519.java | 4 +-- .../com/ibm/mapper/model/algorithms/X448.java | 4 +-- .../mapper/model/algorithms/ascon/Ascon.java | 7 ++--- .../model/algorithms/ascon/Ascon128.java | 4 +-- .../model/algorithms/ascon/Ascon128a.java | 4 +-- .../model/algorithms/ascon/Ascon80pq.java | 4 +-- .../model/algorithms/ascon/AsconHash.java | 4 +-- .../model/algorithms/ascon/AsconXof.java | 4 +-- .../model/algorithms/elephant/Delirium.java | 4 +-- .../model/algorithms/elephant/Dumbo.java | 4 +-- .../model/algorithms/elephant/Elephant.java | 5 ++- .../model/algorithms/elephant/Jumbo.java | 4 +-- .../model/algorithms/gost/GOST28147.java | 7 ++--- .../model/algorithms/gost/GOSTR34122015.java | 7 ++--- .../mapper/model/algorithms/grain/Grain.java | 5 ++- .../mapper/model/algorithms/isap/Isap.java | 5 ++- .../model/algorithms/isap/IsapA128.java | 4 +-- .../model/algorithms/isap/IsapA128a.java | 4 +-- .../model/algorithms/isap/IsapK128.java | 4 +-- .../model/algorithms/isap/IsapK128a.java | 4 +-- .../model/algorithms/ntru/NTRUSign.java | 4 +-- .../ibm/mapper/model/algorithms/tea/TEA.java | 9 +++--- .../ibm/mapper/model/algorithms/tea/XTEA.java | 9 +++--- .../mapper/model/algorithms/vmpc/VMPC.java | 4 +-- .../mapper/model/algorithms/vmpc/VMPCMAC.java | 4 +-- .../collections/AbstractAssetCollection.java | 24 +++++++------- .../model/collections/AssetCollection.java | 3 +- .../collections/CipherSuiteCollection.java | 3 +- .../model/collections/IAssetCollection.java | 2 -- .../collections/IdentifierCollection.java | 5 ++- .../collections/MergeableCollection.java | 3 +- .../mapper/model/curves/Brainpoolp256r1.java | 4 +-- .../mapper/model/curves/Brainpoolp384r1.java | 4 +-- .../mapper/model/curves/Brainpoolp512r1.java | 4 +-- .../ibm/mapper/model/curves/Curve25519.java | 4 +-- .../com/ibm/mapper/model/curves/Curve448.java | 4 +-- .../ibm/mapper/model/curves/Edwards25519.java | 4 +-- .../ibm/mapper/model/curves/Edwards448.java | 4 +-- .../ibm/mapper/model/curves/Secp192r1.java | 4 +-- .../ibm/mapper/model/curves/Secp224r1.java | 4 +-- .../ibm/mapper/model/curves/Secp256k1.java | 4 +-- .../ibm/mapper/model/curves/Secp256r1.java | 4 +-- .../ibm/mapper/model/curves/Secp384r1.java | 4 +-- .../ibm/mapper/model/curves/Secp521r1.java | 4 +-- .../ibm/mapper/model/curves/Sect163k1.java | 4 +-- .../ibm/mapper/model/curves/Sect163r2.java | 4 +-- .../ibm/mapper/model/curves/Sect233k1.java | 4 +-- .../ibm/mapper/model/curves/Sect233r1.java | 4 +-- .../ibm/mapper/model/curves/Sect283k1.java | 4 +-- .../ibm/mapper/model/curves/Sect283r1.java | 4 +-- .../ibm/mapper/model/curves/Sect409k1.java | 4 +-- .../ibm/mapper/model/curves/Sect409r1.java | 4 +-- .../ibm/mapper/model/curves/Sect571k1.java | 4 +-- .../ibm/mapper/model/curves/Sect571r1.java | 4 +-- .../model/functionality/Functionality.java | 2 -- .../java/com/ibm/mapper/model/mode/CBC.java | 4 +-- .../java/com/ibm/mapper/model/mode/CCM.java | 6 ++-- .../java/com/ibm/mapper/model/mode/CFB.java | 6 ++-- .../java/com/ibm/mapper/model/mode/CNT.java | 4 +-- .../java/com/ibm/mapper/model/mode/CTR.java | 4 +-- .../java/com/ibm/mapper/model/mode/CTS.java | 4 +-- .../java/com/ibm/mapper/model/mode/EAX.java | 4 +-- .../java/com/ibm/mapper/model/mode/ECB.java | 4 +-- .../java/com/ibm/mapper/model/mode/GCM.java | 4 +-- .../com/ibm/mapper/model/mode/GCMSIV.java | 4 +-- .../java/com/ibm/mapper/model/mode/GMAC.java | 4 +-- .../java/com/ibm/mapper/model/mode/KW.java | 4 +-- .../java/com/ibm/mapper/model/mode/KWP.java | 4 +-- .../java/com/ibm/mapper/model/mode/MGM.java | 4 +-- .../java/com/ibm/mapper/model/mode/OCB.java | 6 ++-- .../java/com/ibm/mapper/model/mode/OFB.java | 6 ++-- .../java/com/ibm/mapper/model/mode/PCBC.java | 4 +-- .../java/com/ibm/mapper/model/mode/SIV.java | 4 +-- .../java/com/ibm/mapper/model/mode/XTS.java | 4 +-- .../ibm/mapper/model/padding/ANSIX923.java | 4 +-- .../ibm/mapper/model/padding/ISO10126.java | 4 +-- .../com/ibm/mapper/model/padding/ISO7816.java | 4 +-- .../mapper/model/padding/ISO9796Padding.java | 4 +-- .../com/ibm/mapper/model/padding/PKCS1.java | 4 +-- .../com/ibm/mapper/model/padding/PKCS5.java | 4 +-- .../com/ibm/mapper/model/padding/PKCS7.java | 4 +-- .../com/ibm/mapper/model/padding/TBC.java | 4 +-- .../com/ibm/mapper/model/padding/Zero.java | 4 +-- .../com/ibm/mapper/model/protocol/TLS.java | 3 +- .../reorganizer/UsualPerformActions.java | 3 +- .../builder/ReorganizerRuleBuilder.java | 3 +- .../builder/AlgorithmComponentBuilder.java | 21 ++++++------- .../builder/ProtocolComponentBuilder.java | 21 ++++++++----- ...RelatedCryptoMaterialComponentBuilder.java | 5 ++- .../ibm/output/cyclondx/builder/Utils.java | 7 ++--- pom.xml | 20 +----------- .../java/com/ibm/plugin/PythonAggregator.java | 2 -- .../com/ibm/plugin/PythonCheckRegistrar.java | 3 +- .../java/com/ibm/plugin/PythonRuleList.java | 10 +++--- .../ibm/plugin/rules/PythonInventoryRule.java | 8 ++--- .../ibm/plugin/rules/PythonNoMD5UseRule.java | 8 ++--- .../detection/PythonBaseDetectionRule.java | 6 ++-- .../plugin/rules/detection/aead/PycaAEAD.java | 2 -- .../plugin/rules/detection/aead/PycaAES.java | 9 ++---- .../rules/detection/asymmetric/PycaDSA.java | 2 -- .../asymmetric/PycaDiffieHellman.java | 2 -- .../asymmetric/PycaEllipticCurve.java | 2 -- .../rules/detection/asymmetric/PycaRSA.java | 2 -- .../rules/detection/asymmetric/PycaSign.java | 2 -- .../rules/detection/fernet/PycaFernet.java | 5 +-- .../plugin/rules/detection/hash/PycaHash.java | 5 +-- .../plugin/rules/detection/kdf/PycaKDF.java | 2 -- .../keyagreement/PycaKeyAgreement.java | 2 -- .../plugin/rules/detection/mac/PycaMAC.java | 2 -- .../rules/detection/padding/PycaPadding.java | 6 ++-- .../rules/detection/symmetric/PycaCipher.java | 5 +-- .../detection/wrapping/PycaWrapping.java | 2 -- .../rules/resolve/ResolveAliasImport.java | 2 -- .../rules/resolve/ResolveImportedStruct.java | 2 -- .../resolve/ResolveInnerFunctionCall.java | 2 -- .../resolve/ResolveNameTypeAndValues.java | 2 -- .../rules/resolve/ResolveScopeValues.java | 2 -- .../rules/resolve/ResolveValuesWithHooks.java | 2 -- .../translation/PythonTranslationProcess.java | 13 ++++---- .../translator/PythonTranslator.java | 3 +- .../contexts/PycaCipherContextTranslator.java | 12 +++---- .../contexts/PycaDigestContextTranslator.java | 12 +++---- .../PycaKeyAgreementContextTranslator.java | 12 +++---- .../PycaKeyDerivationContextTranslator.java | 12 +++---- .../contexts/PycaMacContextTranslator.java | 12 +++---- .../PycaPrivateKeyContextTranslator.java | 20 ++++++------ .../PycaPublicKeyContextTranslator.java | 12 +++---- .../contexts/PycaSecretContextTranslator.java | 12 +++---- .../PycaSecretKeyContextTranslator.java | 12 +++---- .../PycaSignatureContextTranslator.java | 12 +++---- .../test/java/com/ibm/plugin/TestBase.java | 3 +- .../rules/resolve/ResolveAliasImportTest.java | 5 ++- .../resolve/ResolveImportedStructTest.java | 5 ++- .../resolve/ResolveInnerFunctionCallTest.java | 5 ++- .../resolve/ResolveNameTypeAndValuesTest.java | 5 ++- .../rules/resolve/ResolveScopeValuesTest.java | 5 ++- .../resolve/ResolveValuesWithHooksTest.java | 5 ++- .../plugin/utils/GenerateAssertsHelper.java | 14 ++++----- .../ibm/rules/IReportableDetectionRule.java | 4 +-- .../java/com/ibm/rules/InventoryRule.java | 7 ++--- .../rules/NoMD5UseForMessageDigestRule.java | 7 ++--- .../com/ibm/rules/issue/IssueCreator.java | 6 ++-- .../java/com/ibm/plugin/Configuration.java | 5 ++- 492 files changed, 1207 insertions(+), 1576 deletions(-) diff --git a/engine/src/main/java/com/ibm/engine/detection/DetectionStore.java b/engine/src/main/java/com/ibm/engine/detection/DetectionStore.java index c8e7034a..9f99fe65 100644 --- a/engine/src/main/java/com/ibm/engine/detection/DetectionStore.java +++ b/engine/src/main/java/com/ibm/engine/detection/DetectionStore.java @@ -45,7 +45,6 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; public class DetectionStore implements IHookDetectionObserver { protected final int level; @@ -120,7 +119,6 @@ public Optional> getActionValue() { * @return a list of all detection values in the order they were added to the store. */ @Nonnull - @Unmodifiable public List> getDetectionValues() { if (actionValue == null) { return detectionValues.values().stream().flatMap(List::stream).toList(); @@ -142,7 +140,7 @@ public List> getDetectionValues() { * inputs. */ public void detectionValuesForEachParameter( - @Nonnull BiConsumer>> consumer) { + @Nonnull BiConsumer>> consumer) { this.detectionValues.forEach( (k, v) -> consumer.accept( @@ -159,7 +157,6 @@ public void detectionValuesForEachParameter( * @return an immutable and non-null list of all the children stores */ @Nonnull - @Unmodifiable public List> getChildren() { return children.values().stream().flatMap(List::stream).toList(); } @@ -170,7 +167,6 @@ public List> getChildren() { * @return the eventual child detection stores, whose detection rule relates to the method */ @Nonnull - @Unmodifiable public List> getChildrenForMethod() { return Optional.ofNullable(this.children.get(-1)).orElse(List.of()); } @@ -186,7 +182,7 @@ public List> getChildrenForMethod() { * on these inputs. */ public void childrenForEachParameter( - @Nonnull BiConsumer>> consumer) { + @Nonnull BiConsumer>> consumer) { for (Map.Entry>> entry : this.children.entrySet()) { if (entry.getKey() == -1) { diff --git a/engine/src/main/java/com/ibm/engine/detection/DetectionStoreWithHook.java b/engine/src/main/java/com/ibm/engine/detection/DetectionStoreWithHook.java index eedb75d9..b63bde3b 100644 --- a/engine/src/main/java/com/ibm/engine/detection/DetectionStoreWithHook.java +++ b/engine/src/main/java/com/ibm/engine/detection/DetectionStoreWithHook.java @@ -87,13 +87,13 @@ private void onHookInvocation( if (hook instanceof MethodInvocationHookWithParameterResolvement - methodInvocationHookWithParameterResolvement) { + methodInvocationHookWithParameterResolvement) { handleMethodInvocationHookWithParameterResolvement( invocationTree, methodInvocationHookWithParameterResolvement, isSuccessive); } else if (hook instanceof MethodInvocationHookWithReturnResolvement - methodInvocationHookWithReturnResolvement) { + methodInvocationHookWithReturnResolvement) { handleMethodInvocationHookWithReturnResolvement( methodInvocationHookWithReturnResolvement, isSuccessive); } else if (hook instanceof EnumHook enumHook) { diff --git a/engine/src/main/java/com/ibm/engine/detection/Finding.java b/engine/src/main/java/com/ibm/engine/detection/Finding.java index 7a81eac9..86496ef6 100644 --- a/engine/src/main/java/com/ibm/engine/detection/Finding.java +++ b/engine/src/main/java/com/ibm/engine/detection/Finding.java @@ -23,7 +23,6 @@ import com.ibm.engine.rule.IBundle; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public record Finding(@Nonnull DetectionStore detectionStore) { @@ -58,7 +57,7 @@ public int hashCode() { + calculateHashCodeForChildren(detectionStore.getChildren()); } - private int calculateHashCodeForChildren(@NotNull List> children) { + private int calculateHashCodeForChildren(@Nonnull List> children) { return children.stream() .map( store -> diff --git a/engine/src/main/java/com/ibm/engine/detection/MethodMatcher.java b/engine/src/main/java/com/ibm/engine/detection/MethodMatcher.java index 4f0fbd78..b9ebc90a 100644 --- a/engine/src/main/java/com/ibm/engine/detection/MethodMatcher.java +++ b/engine/src/main/java/com/ibm/engine/detection/MethodMatcher.java @@ -26,7 +26,6 @@ import java.util.function.Function; import java.util.function.Predicate; import javax.annotation.Nonnull; -import org.jetbrains.annotations.TestOnly; import org.sonarsource.analyzer.commons.collections.SetUtils; public final class MethodMatcher { @@ -175,17 +174,17 @@ public boolean match( && this.parameterTypes.test(param); } - @TestOnly + @Nonnull public List getInvokedObjectTypeStringsSerializable() { return this.invokedObjectTypeStringsSerializable; } - @TestOnly + @Nonnull public List getMethodNamesSerializable() { return this.methodNamesSerializable; } - @TestOnly + @Nonnull public List getParameterTypesSerializable() { return this.parameterTypesSerializable; } diff --git a/engine/src/main/java/com/ibm/engine/executive/DetectionExecutive.java b/engine/src/main/java/com/ibm/engine/executive/DetectionExecutive.java index 6747a12f..6ce06bc3 100644 --- a/engine/src/main/java/com/ibm/engine/executive/DetectionExecutive.java +++ b/engine/src/main/java/com/ibm/engine/executive/DetectionExecutive.java @@ -21,12 +21,15 @@ import com.ibm.common.IDomainEvent; import com.ibm.common.IObserver; -import com.ibm.engine.detection.*; +import com.ibm.engine.detection.DetectionStore; +import com.ibm.engine.detection.Finding; +import com.ibm.engine.detection.Handler; import com.ibm.engine.language.IScanContext; import com.ibm.engine.rule.IDetectionRule; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; public class DetectionExecutive implements IStatusReporting, IDomainEvent> { @@ -81,7 +84,6 @@ public void addAdditionalExpectedRuleVisits(int number) { } @Nonnull - @Unmodifiable private List> getRootStoresWithValue( @Nonnull DetectionStore detectionStore) { if (!detectionStore.getDetectionValues().isEmpty() diff --git a/engine/src/main/java/com/ibm/engine/language/java/JavaDetectionEngine.java b/engine/src/main/java/com/ibm/engine/language/java/JavaDetectionEngine.java index 7ccd5ccd..9e512424 100644 --- a/engine/src/main/java/com/ibm/engine/language/java/JavaDetectionEngine.java +++ b/engine/src/main/java/com/ibm/engine/language/java/JavaDetectionEngine.java @@ -431,7 +431,7 @@ private void createAMethodHook( if (this.detectionStore instanceof final DetectionStoreWithHook - detectionStoreWithHook) { + detectionStoreWithHook) { detectionStoreWithHook.onSuccessiveHook(methodInvocationHookWithReturnResolvement); } else { if (handler.addHookToHookRepository(methodInvocationHookWithReturnResolvement)) { @@ -449,7 +449,7 @@ private void createAMethodHook( if (this.detectionStore instanceof final DetectionStoreWithHook - detectionStoreWithHook) { + detectionStoreWithHook) { detectionStoreWithHook.onSuccessiveHook(methodInvocationHookWithParameterResolvement); } else { if (handler.addHookToHookRepository(methodInvocationHookWithParameterResolvement)) { diff --git a/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageSupport.java b/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageSupport.java index cc9fb94b..e7d04193 100644 --- a/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageSupport.java +++ b/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageSupport.java @@ -36,7 +36,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.java.model.ExpressionUtils; @@ -66,7 +65,7 @@ public ILanguageTranslation translation() { @Nonnull @Override - public @NotNull DetectionExecutive + public DetectionExecutive createDetectionExecutive( @Nonnull Tree tree, @Nonnull IDetectionRule detectionRule, @@ -76,7 +75,7 @@ public ILanguageTranslation translation() { @Nonnull @Override - public @NotNull IDetectionEngine createDetectionEngineInstance( + public IDetectionEngine createDetectionEngineInstance( @Nonnull DetectionStore detectionStore) { @@ -85,13 +84,13 @@ public ILanguageTranslation translation() { @Nonnull @Override - public @NotNull IBaseMethodVisitorFactory getBaseMethodVisitorFactory() { + public IBaseMethodVisitorFactory getBaseMethodVisitorFactory() { return JavaBaseMethodVisitor::new; } @Nonnull @Override - public @NotNull Optional getEnclosingMethod(@Nonnull Tree expression) { + public Optional getEnclosingMethod(@Nonnull Tree expression) { if (expression instanceof ExpressionTree expressionTree) { return Optional.ofNullable(ExpressionUtils.getEnclosingMethod(expressionTree)); } diff --git a/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageTranslation.java b/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageTranslation.java index 065239bd..3f0e8293 100644 --- a/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageTranslation.java +++ b/engine/src/main/java/com/ibm/engine/language/java/JavaLanguageTranslation.java @@ -22,13 +22,23 @@ import com.ibm.engine.detection.IType; import com.ibm.engine.detection.MatchContext; import com.ibm.engine.language.ILanguageTranslation; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.java.model.ExpressionUtils; -import org.sonar.plugins.java.api.tree.*; +import org.sonar.plugins.java.api.tree.Arguments; +import org.sonar.plugins.java.api.tree.ClassTree; +import org.sonar.plugins.java.api.tree.ExpressionTree; +import org.sonar.plugins.java.api.tree.IdentifierTree; +import org.sonar.plugins.java.api.tree.MemberSelectExpressionTree; +import org.sonar.plugins.java.api.tree.MethodInvocationTree; +import org.sonar.plugins.java.api.tree.NewClassTree; +import org.sonar.plugins.java.api.tree.Tree; public class JavaLanguageTranslation implements ILanguageTranslation { @Nonnull @@ -126,7 +136,7 @@ public Optional getInvokedObjectTypeString( @Nonnull @Override - public @NotNull Optional getMethodReturnTypeString( + public Optional getMethodReturnTypeString( @Nonnull MatchContext matchContext, @Nonnull Tree methodInvocation) { if (methodInvocation instanceof MethodInvocationTree methodInvocationTree) { return Optional.of(methodInvocationTree.methodSymbol()) @@ -146,7 +156,7 @@ public Optional getInvokedObjectTypeString( @Nonnull @Override - public @NotNull List getMethodParameterTypes( + public List getMethodParameterTypes( @Nonnull MatchContext matchContext, @Nonnull Tree methodInvocation) { Arguments arguments; if (methodInvocation instanceof MethodInvocationTree methodInvocationTree) { @@ -203,7 +213,7 @@ public Optional getInvokedObjectTypeString( @Nonnull @Override - public @NotNull Optional resolveIdentifierAsString( + public Optional resolveIdentifierAsString( @Nonnull MatchContext matchContext, @Nonnull Tree identifier) { if (identifier instanceof IdentifierTree identifierTree) { return Optional.of(identifierTree.identifierToken().text()); @@ -213,7 +223,7 @@ public Optional getInvokedObjectTypeString( @Nonnull @Override - public @NotNull Optional getEnumIdentifierName( + public Optional getEnumIdentifierName( @Nonnull MatchContext matchContext, @Nonnull Tree enumIdentifier) { if (enumIdentifier instanceof IdentifierTree identifierTree) { return Optional.of(identifierTree.name()); @@ -223,7 +233,7 @@ public Optional getInvokedObjectTypeString( @Nonnull @Override - public @NotNull Optional getEnumClassName( + public Optional getEnumClassName( @Nonnull MatchContext matchContext, @Nonnull Tree enumClass) { if (enumClass instanceof ClassTree classTree) { IdentifierTree enumClassIdentifier = classTree.simpleName(); diff --git a/engine/src/main/java/com/ibm/engine/language/java/JavaScanContext.java b/engine/src/main/java/com/ibm/engine/language/java/JavaScanContext.java index b53e37c3..f1d19a87 100644 --- a/engine/src/main/java/com/ibm/engine/language/java/JavaScanContext.java +++ b/engine/src/main/java/com/ibm/engine/language/java/JavaScanContext.java @@ -21,7 +21,6 @@ import com.ibm.engine.language.IScanContext; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.sonar.api.batch.fs.InputFile; import org.sonar.plugins.java.api.JavaCheck; import org.sonar.plugins.java.api.JavaFileScannerContext; @@ -37,13 +36,13 @@ public void reportIssue( @Nonnull @Override - public @NotNull InputFile getInputFile() { + public InputFile getInputFile() { return this.javaFileScannerContext.getInputFile(); } @Nonnull @Override - public @NotNull String getFilePath() { + public String getFilePath() { return this.javaFileScannerContext.getInputFile().uri().getPath(); } } diff --git a/engine/src/main/java/com/ibm/engine/language/python/PythonDetectionEngine.java b/engine/src/main/java/com/ibm/engine/language/python/PythonDetectionEngine.java index a75f39cb..3d2af251 100644 --- a/engine/src/main/java/com/ibm/engine/language/python/PythonDetectionEngine.java +++ b/engine/src/main/java/com/ibm/engine/language/python/PythonDetectionEngine.java @@ -31,7 +31,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; import org.sonar.plugins.python.api.symbols.Symbol; @@ -128,9 +127,9 @@ public Tree extractArgumentFromMethodCaller( } @Override - public @NotNull List> resolveValuesInInnerScope( - @NotNull Class clazz, - @NotNull Tree expression, + public @Nonnull List> resolveValuesInInnerScope( + @Nonnull Class clazz, + @Nonnull Tree expression, @Nullable IValueFactory valueFactory) { if (expression instanceof Expression expressionTree) { return PythonSemantic.resolveValues( @@ -194,7 +193,7 @@ private void createAMethodHook( if (this.detectionStore instanceof final DetectionStoreWithHook - detectionStoreWithHook) { + detectionStoreWithHook) { detectionStoreWithHook.onSuccessiveHook(methodInvocationHookWithReturnResolvement); } else { handler.addHookToHookRepository(methodInvocationHookWithReturnResolvement); @@ -211,7 +210,7 @@ private void createAMethodHook( if (this.detectionStore instanceof final DetectionStoreWithHook - detectionStoreWithHook) { + detectionStoreWithHook) { detectionStoreWithHook.onSuccessiveHook(methodInvocationHookWithParameterResolvement); } else { handler.addHookToHookRepository(methodInvocationHookWithParameterResolvement); diff --git a/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageSupport.java b/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageSupport.java index ae46a339..38569a2f 100644 --- a/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageSupport.java +++ b/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageSupport.java @@ -37,7 +37,6 @@ import java.util.LinkedList; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; import org.sonar.plugins.python.api.symbols.Symbol; @@ -62,28 +61,29 @@ public ILanguageTranslation translation() { } @Override - public @NotNull DetectionExecutive + public @Nonnull DetectionExecutive createDetectionExecutive( - @NotNull Tree tree, - @NotNull IDetectionRule detectionRule, - @NotNull IScanContext scanContext) { + @Nonnull Tree tree, + @Nonnull IDetectionRule detectionRule, + @Nonnull IScanContext scanContext) { return new DetectionExecutive<>(tree, detectionRule, scanContext, this.handler); } @Override - public @NotNull IDetectionEngine createDetectionEngineInstance( - @NotNull DetectionStore + public @Nonnull IDetectionEngine createDetectionEngineInstance( + @Nonnull + DetectionStore detectionStore) { return new PythonDetectionEngine(detectionStore, this.handler); } @Override - public @NotNull IBaseMethodVisitorFactory getBaseMethodVisitorFactory() { + public @Nonnull IBaseMethodVisitorFactory getBaseMethodVisitorFactory() { return PythonBaseMethodVisitor::new; } @Override - public @NotNull Optional getEnclosingMethod(@NotNull Tree expression) { + public @Nonnull Optional getEnclosingMethod(@Nonnull Tree expression) { // In Python, there isn't necessarily an enclosing method: we return it if it exists, // otherwise we return the highest level root node corresponding to all the content of the // current file. @@ -98,7 +98,7 @@ public ILanguageTranslation translation() { } @Override - public MethodMatcher createMethodMatcherBasedOn(@NotNull Tree methodDefinition) { + public MethodMatcher createMethodMatcherBasedOn(@Nonnull Tree methodDefinition) { if (methodDefinition instanceof FunctionDef functionDefTree) { // The `invocationObjectName` consists of the filename + the class(es). We use // `fullyQualifiedName`, here that basically is `invocationObjectName` + the function @@ -135,7 +135,7 @@ public MethodMatcher createMethodMatcherBasedOn(@NotNull Tree methodDefini @Override public EnumMatcher createSimpleEnumMatcherFor( - @NotNull Tree enumIdentifier, @Nonnull MatchContext matchContext) { + @Nonnull Tree enumIdentifier, @Nonnull MatchContext matchContext) { Optional enumIdentifierName = translation().getEnumIdentifierName(matchContext, enumIdentifier); return enumIdentifierName.>map(EnumMatcher::new).orElse(null); diff --git a/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageTranslation.java b/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageTranslation.java index 4231692e..f534cf78 100644 --- a/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageTranslation.java +++ b/engine/src/main/java/com/ibm/engine/language/python/PythonLanguageTranslation.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.sonar.plugins.python.api.symbols.Symbol; import org.sonar.plugins.python.api.tree.*; @@ -35,7 +34,7 @@ public class PythonLanguageTranslation implements ILanguageTranslation { @Nonnull @Override public Optional getMethodName( - @Nonnull MatchContext matchContext, @NotNull Tree methodInvocation) { + @Nonnull MatchContext matchContext, @Nonnull Tree methodInvocation) { if (methodInvocation instanceof CallExpression callExpression) { // We use "name" and not "fullyQualifiedName" to make it like in the Java implementation Symbol methodInvocationSymbol = callExpression.calleeSymbol(); @@ -53,7 +52,7 @@ public Optional getMethodName( @Nonnull @Override public Optional getInvokedObjectTypeString( - @Nonnull MatchContext matchContext, @NotNull Tree methodInvocation) { + @Nonnull MatchContext matchContext, @Nonnull Tree methodInvocation) { // This method should return the type of the *invoked object* (or qualifier): for a method // invocation `X25519PrivateKey.generate()`, it should return // `cryptography.hazmat.primitives.asymmetric.X25519PrivateKey`, and for @@ -73,16 +72,16 @@ public Optional getInvokedObjectTypeString( } @Override - public @NotNull Optional getMethodReturnTypeString( - @Nonnull MatchContext matchContext, @NotNull Tree methodInvocation) { + public @Nonnull Optional getMethodReturnTypeString( + @Nonnull MatchContext matchContext, @Nonnull Tree methodInvocation) { // TODO: This does not take the subscriptionIndex into account, so it will return an IType // accepting the type of all return PythonSemantic.resolveTreeType(methodInvocation); } @Override - public @NotNull List getMethodParameterTypes( - @Nonnull MatchContext matchContext, @NotNull Tree methodInvocation) { + public @Nonnull List getMethodParameterTypes( + @Nonnull MatchContext matchContext, @Nonnull Tree methodInvocation) { if (methodInvocation instanceof CallExpression callExpression) { List arguments = callExpression.arguments(); if (!arguments.isEmpty()) { @@ -101,8 +100,8 @@ public Optional getInvokedObjectTypeString( } @Override - public @NotNull Optional resolveIdentifierAsString( - @Nonnull MatchContext matchContext, @NotNull Tree name) { + public @Nonnull Optional resolveIdentifierAsString( + @Nonnull MatchContext matchContext, @Nonnull Tree name) { if (name instanceof Name nameTree) { return Optional.of(nameTree.name()); } @@ -110,15 +109,15 @@ public Optional getInvokedObjectTypeString( } @Override - public @NotNull Optional getEnumIdentifierName( - @Nonnull MatchContext matchContext, @NotNull Tree enumIdentifier) { + public @Nonnull Optional getEnumIdentifierName( + @Nonnull MatchContext matchContext, @Nonnull Tree enumIdentifier) { // TODO: Implement enums in the Python case? return Optional.empty(); } @Override - public @NotNull Optional getEnumClassName( - @Nonnull MatchContext matchContext, @NotNull Tree enumClass) { + public @Nonnull Optional getEnumClassName( + @Nonnull MatchContext matchContext, @Nonnull Tree enumClass) { // TODO: Implement enums in the Python case? return Optional.empty(); } diff --git a/engine/src/main/java/com/ibm/engine/language/python/PythonScanContext.java b/engine/src/main/java/com/ibm/engine/language/python/PythonScanContext.java index 8e94842c..ff489b96 100644 --- a/engine/src/main/java/com/ibm/engine/language/python/PythonScanContext.java +++ b/engine/src/main/java/com/ibm/engine/language/python/PythonScanContext.java @@ -21,7 +21,6 @@ import com.ibm.engine.language.IScanContext; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.sonar.api.batch.fs.InputFile; import org.sonar.plugins.python.api.IssueLocation; import org.sonar.plugins.python.api.PythonCheck; @@ -34,14 +33,14 @@ public record PythonScanContext(@Nonnull PythonVisitorContext pythonVisitorConte @Override public void reportIssue( - @NotNull PythonCheck currentRule, @NotNull Tree tree, @NotNull String message) { + @Nonnull PythonCheck currentRule, @Nonnull Tree tree, @Nonnull String message) { PreciseIssue newIssue = new PreciseIssue(currentRule, IssueLocation.preciseLocation(tree, message)); pythonVisitorContext.addIssue(newIssue); } @Override - public @NotNull InputFile getInputFile() { + public @Nonnull InputFile getInputFile() { // There is no trivial way to get the InputFile from the `pythonVisitorContext`. // Using `.pythonFile()` does not return the correct format, and there doesn't // seem to be a converter. @@ -49,7 +48,7 @@ public void reportIssue( } @Override - public @NotNull String getFilePath() { + public @Nonnull String getFilePath() { return pythonVisitorContext.pythonFile().uri().getPath(); } } diff --git a/engine/src/main/java/com/ibm/engine/language/python/PythonSemantic.java b/engine/src/main/java/com/ibm/engine/language/python/PythonSemantic.java index 3c6ba165..680d299b 100644 --- a/engine/src/main/java/com/ibm/engine/language/python/PythonSemantic.java +++ b/engine/src/main/java/com/ibm/engine/language/python/PythonSemantic.java @@ -520,7 +520,7 @@ private static List> resolveValues( if (usageNameTree.parent() instanceof org.sonar.plugins.python.api.tree.Parameter - parameterTree + parameterTree && !argsMappingList.isEmpty()) { Argument argument = argsMappingList.pollLast().get(parameterTree); if (argument instanceof RegularArgument regularArgument) { diff --git a/engine/src/main/java/com/ibm/engine/model/Curve.java b/engine/src/main/java/com/ibm/engine/model/Curve.java index 68197969..8c3c494c 100644 --- a/engine/src/main/java/com/ibm/engine/model/Curve.java +++ b/engine/src/main/java/com/ibm/engine/model/Curve.java @@ -20,7 +20,6 @@ package com.ibm.engine.model; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Curve extends AbstractValue { @Nonnull private final String value; @@ -36,7 +35,8 @@ public String get() { return value; } - @NotNull @Override + @Nonnull + @Override public T getLocation() { return this.location; } diff --git a/engine/src/main/java/com/ibm/engine/model/Mode.java b/engine/src/main/java/com/ibm/engine/model/Mode.java index 7243380d..8ac47897 100644 --- a/engine/src/main/java/com/ibm/engine/model/Mode.java +++ b/engine/src/main/java/com/ibm/engine/model/Mode.java @@ -20,7 +20,6 @@ package com.ibm.engine.model; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Mode extends AbstractValue { @@ -38,12 +37,12 @@ public String getValue() { } @Override - public @NotNull T getLocation() { + public @Nonnull T getLocation() { return this.location; } @Override - public @NotNull String asString() { + public @Nonnull String asString() { return this.value; } diff --git a/engine/src/main/java/com/ibm/engine/model/Padding.java b/engine/src/main/java/com/ibm/engine/model/Padding.java index 397b84e9..f4519069 100644 --- a/engine/src/main/java/com/ibm/engine/model/Padding.java +++ b/engine/src/main/java/com/ibm/engine/model/Padding.java @@ -20,7 +20,6 @@ package com.ibm.engine.model; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Padding extends AbstractValue { @Nonnull private final String value; @@ -32,7 +31,7 @@ public Padding(@Nonnull String value, @Nonnull T location) { } @Override - public @NotNull T getLocation() { + public @Nonnull T getLocation() { return this.location; } @@ -42,7 +41,7 @@ public String toString() { } @Override - public @NotNull String asString() { + public @Nonnull String asString() { return this.value; } diff --git a/engine/src/main/java/com/ibm/engine/model/Protocol.java b/engine/src/main/java/com/ibm/engine/model/Protocol.java index 9fbbb832..a9adc6d0 100644 --- a/engine/src/main/java/com/ibm/engine/model/Protocol.java +++ b/engine/src/main/java/com/ibm/engine/model/Protocol.java @@ -20,7 +20,6 @@ package com.ibm.engine.model; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Protocol extends AbstractValue { @@ -32,12 +31,14 @@ public Protocol(@Nonnull String value, @Nonnull T location) { this.value = value; } - @NotNull @Override + @Nonnull + @Override public T getLocation() { return this.location; } - @NotNull @Override + @Nonnull + @Override public String asString() { return this.value; } diff --git a/engine/src/main/java/com/ibm/engine/model/context/AlgorithmParameterContext.java b/engine/src/main/java/com/ibm/engine/model/context/AlgorithmParameterContext.java index 05349549..1a50eea7 100644 --- a/engine/src/main/java/com/ibm/engine/model/context/AlgorithmParameterContext.java +++ b/engine/src/main/java/com/ibm/engine/model/context/AlgorithmParameterContext.java @@ -22,7 +22,6 @@ import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class AlgorithmParameterContext extends DetectionContext { @@ -34,7 +33,8 @@ public AlgorithmParameterContext(@Nonnull Map properties) { super(properties); } - @NotNull @Override + @Nonnull + @Override public Class type() { return AlgorithmParameterContext.class; } diff --git a/engine/src/main/java/com/ibm/engine/model/context/DetectionContext.java b/engine/src/main/java/com/ibm/engine/model/context/DetectionContext.java index bfe8b2ea..0560c372 100644 --- a/engine/src/main/java/com/ibm/engine/model/context/DetectionContext.java +++ b/engine/src/main/java/com/ibm/engine/model/context/DetectionContext.java @@ -23,10 +23,9 @@ import java.util.Optional; import java.util.stream.Collectors; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; public abstract class DetectionContext implements IDetectionContext { - @Unmodifiable @Nonnull private final Map properties; + @Nonnull private final Map properties; protected DetectionContext(@Nonnull Map properties) { this.properties = properties; diff --git a/engine/src/main/java/com/ibm/engine/model/context/KeyAgreementContext.java b/engine/src/main/java/com/ibm/engine/model/context/KeyAgreementContext.java index c221bcdd..8fcdc151 100644 --- a/engine/src/main/java/com/ibm/engine/model/context/KeyAgreementContext.java +++ b/engine/src/main/java/com/ibm/engine/model/context/KeyAgreementContext.java @@ -21,7 +21,7 @@ import java.util.HashMap; import java.util.Map; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class KeyAgreementContext extends DetectionContext { @@ -29,11 +29,12 @@ public KeyAgreementContext() { super(new HashMap<>()); } - public KeyAgreementContext(@NotNull Map properties) { + public KeyAgreementContext(@Nonnull Map properties) { super(properties); } - @NotNull @Override + @Nonnull + @Override public Class type() { return KeyAgreementContext.class; } diff --git a/engine/src/main/java/com/ibm/engine/model/context/KeyDerivationFunctionContext.java b/engine/src/main/java/com/ibm/engine/model/context/KeyDerivationFunctionContext.java index a23a6a46..a04705d6 100644 --- a/engine/src/main/java/com/ibm/engine/model/context/KeyDerivationFunctionContext.java +++ b/engine/src/main/java/com/ibm/engine/model/context/KeyDerivationFunctionContext.java @@ -21,7 +21,7 @@ import java.util.HashMap; import java.util.Map; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class KeyDerivationFunctionContext extends DetectionContext implements IDetectionContext { @@ -29,12 +29,12 @@ public KeyDerivationFunctionContext() { super(new HashMap<>()); } - public KeyDerivationFunctionContext(@NotNull Map properties) { + public KeyDerivationFunctionContext(@Nonnull Map properties) { super(properties); } @Override - public @NotNull Class type() { + public @Nonnull Class type() { return KeyDerivationFunctionContext.class; } } diff --git a/engine/src/main/java/com/ibm/engine/model/context/ProtocolContext.java b/engine/src/main/java/com/ibm/engine/model/context/ProtocolContext.java index 76565687..4fe3c1b2 100644 --- a/engine/src/main/java/com/ibm/engine/model/context/ProtocolContext.java +++ b/engine/src/main/java/com/ibm/engine/model/context/ProtocolContext.java @@ -20,7 +20,6 @@ package com.ibm.engine.model.context; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class ProtocolContext implements IDetectionContext, ISupportKind { @@ -39,12 +38,14 @@ public ProtocolContext() { this.kind = ProtocolContext.Kind.NONE; } - @NotNull @Override + @Nonnull + @Override public Class type() { return ProtocolContext.class; } - @NotNull @Override + @Nonnull + @Override public Kind kind() { return this.kind; } diff --git a/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmFactory.java index 1de49b68..81237c0b 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmFactory.java @@ -25,7 +25,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; public class AlgorithmFactory implements IValueFactory { @Nullable private final String constant; @@ -40,7 +39,7 @@ public AlgorithmFactory(@Nonnull String constant) { @Nonnull @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (constant != null) { return Optional.of(new Algorithm<>(constant, objectTResolvedValue.tree())); } diff --git a/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmParameterFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmParameterFactory.java index ac90424b..ed7469cf 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmParameterFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/AlgorithmParameterFactory.java @@ -24,7 +24,6 @@ import com.ibm.engine.model.IValue; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class AlgorithmParameterFactory implements IValueFactory { @@ -36,7 +35,7 @@ public AlgorithmParameterFactory(@Nonnull AlgorithmParameter.Kind kind) { @Nonnull @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (objectTResolvedValue.value() instanceof String str) { return Optional.of( new AlgorithmParameter<>(str, this.kind, objectTResolvedValue.tree())); diff --git a/engine/src/main/java/com/ibm/engine/model/factory/CipherSuiteFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/CipherSuiteFactory.java index 2154f4a4..1764669d 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/CipherSuiteFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/CipherSuiteFactory.java @@ -25,7 +25,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; public class CipherSuiteFactory implements IValueFactory { @@ -41,7 +40,7 @@ public CipherSuiteFactory(@Nonnull String constant) { @Nonnull @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (constant != null) { return Optional.of(new CipherSuite<>(constant, objectTResolvedValue.tree())); } diff --git a/engine/src/main/java/com/ibm/engine/model/factory/CurveFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/CurveFactory.java index 5adee7f1..b8477288 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/CurveFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/CurveFactory.java @@ -24,13 +24,12 @@ import com.ibm.engine.model.IValue; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class CurveFactory implements IValueFactory { @Nonnull @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (objectTResolvedValue.value() instanceof String str) { return Optional.of(new Curve<>(str, objectTResolvedValue.tree())); } diff --git a/engine/src/main/java/com/ibm/engine/model/factory/ModeFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/ModeFactory.java index 32640730..8125be0d 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/ModeFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/ModeFactory.java @@ -23,12 +23,12 @@ import com.ibm.engine.model.IValue; import com.ibm.engine.model.Mode; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class ModeFactory implements IValueFactory { @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (objectTResolvedValue.value() instanceof String s) { return Optional.of(new Mode<>(s, objectTResolvedValue.tree())); } diff --git a/engine/src/main/java/com/ibm/engine/model/factory/PaddingFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/PaddingFactory.java index 00cdcad4..a6a182be 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/PaddingFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/PaddingFactory.java @@ -23,8 +23,8 @@ import com.ibm.engine.model.IValue; import com.ibm.engine.model.Padding; import java.util.Optional; +import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; public class PaddingFactory implements IValueFactory { @Nullable private final String constant; @@ -38,7 +38,7 @@ public PaddingFactory(@Nullable String constant) { } @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (constant != null) { return Optional.of(new Padding<>(constant, objectTResolvedValue.tree())); } diff --git a/engine/src/main/java/com/ibm/engine/model/factory/ParameterIdentifierFactory.java b/engine/src/main/java/com/ibm/engine/model/factory/ParameterIdentifierFactory.java index e3cc6331..0f218aac 100644 --- a/engine/src/main/java/com/ibm/engine/model/factory/ParameterIdentifierFactory.java +++ b/engine/src/main/java/com/ibm/engine/model/factory/ParameterIdentifierFactory.java @@ -24,12 +24,11 @@ import com.ibm.engine.model.ParameterIdentifier; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class ParameterIdentifierFactory implements IValueFactory { @Nonnull @Override - public Optional> apply(@NotNull ResolvedValue objectTResolvedValue) { + public Optional> apply(@Nonnull ResolvedValue objectTResolvedValue) { if (objectTResolvedValue.value() instanceof String str) { return Optional.of(new ParameterIdentifier<>(str, objectTResolvedValue.tree())); } else if (objectTResolvedValue.value() instanceof Integer number) { diff --git a/engine/src/main/java/com/ibm/engine/rule/builder/DetectionRuleBuilderImpl.java b/engine/src/main/java/com/ibm/engine/rule/builder/DetectionRuleBuilderImpl.java index 20668238..70e358b1 100644 --- a/engine/src/main/java/com/ibm/engine/rule/builder/DetectionRuleBuilderImpl.java +++ b/engine/src/main/java/com/ibm/engine/rule/builder/DetectionRuleBuilderImpl.java @@ -28,7 +28,6 @@ import java.util.List; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; final class DetectionRuleBuilderImpl implements IDetectionRule.TypeBuilder, @@ -244,9 +243,10 @@ public IDetectionRule.ParametersFactoryBuilder withMethodParameter(@Nonnull S bundle); } - @NotNull @Override + @Nonnull + @Override public IDetectionRule.ParametersFactoryBuilder withMethodParameterMatchExactType( - @NotNull String type) { + @Nonnull String type) { checkDetectionParameterState(); this.buildingNewDetectionParameter = false; this.capturedParameterScope = CapturedParameterScope.SOME; @@ -270,7 +270,8 @@ public IDetectionRule.ParametersFactoryBuilder withMethodParameterMatchExactT bundle); } - @NotNull @Override + @Nonnull + @Override public IDetectionRule.FinalDetectionRuleBuilder withoutParameters() { capturedParameterScope = CapturedParameterScope.NONE; return new DetectionRuleBuilderImpl<>( @@ -291,7 +292,8 @@ public IDetectionRule.FinalDetectionRuleBuilder withoutParameters() { bundle); } - @NotNull @Override + @Nonnull + @Override public IDetectionRule.FinalDetectionRuleBuilder withAnyParameters() { capturedParameterScope = CapturedParameterScope.ANY; return new DetectionRuleBuilderImpl<>( @@ -406,9 +408,10 @@ public IDetectionRule.PositionBuilder shouldBeDetectedAs( bundle); } - @NotNull @Override + @Nonnull + @Override public IDetectionRule.InvokedObjectDependingDetectionRules inBundle( - @NotNull IBundle bundle) { + @Nonnull IBundle bundle) { this.bundle = bundle; return new DetectionRuleBuilderImpl<>( objectTypes, diff --git a/enricher/src/main/java/com/ibm/enricher/Enricher.java b/enricher/src/main/java/com/ibm/enricher/Enricher.java index a83e3783..e5f7920d 100644 --- a/enricher/src/main/java/com/ibm/enricher/Enricher.java +++ b/enricher/src/main/java/com/ibm/enricher/Enricher.java @@ -37,7 +37,6 @@ import java.util.Collection; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * This enricher instance operates on a language-agnostic level, meaning it will enrich the given @@ -56,7 +55,8 @@ public static Collection enrich(@Nonnull final Collection nodes) { return nodes.stream().map(Enricher::enrichTree).toList(); } - @NotNull private static INode enrichTree(@Nonnull INode node) { + @Nonnull + private static INode enrichTree(@Nonnull INode node) { final Enricher enricher = new Enricher(); final INode enriched = enricher.enrich(node); @@ -97,7 +97,8 @@ public static Collection enrich(@Nonnull final Collection nodes) { * * @param node The node to enrich */ - @NotNull @Override + @Nonnull + @Override public INode enrich(@Nonnull INode node) { for (final IEnricher enricher : enrichers) { node = enricher.enrich(node); diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/AESEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/AESEnricher.java index 3f103498..d3ec8734 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/AESEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/AESEnricher.java @@ -31,7 +31,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; public class AESEnricher implements IEnricher, IEnrichWithDefaultKeySize { private static final String BASE_OID = "2.16.840.1.101.3.4.1"; @@ -52,8 +51,9 @@ public class AESEnricher implements IEnricher, IEnrichWithDefaultKeySize { 192, 2, 256, 4); - @NotNull @Override - public INode enrich(@NotNull INode node) { + @Nonnull + @Override + public INode enrich(@Nonnull INode node) { if (node instanceof AES aes) { return enrich(aes); } @@ -61,7 +61,7 @@ public INode enrich(@NotNull INode node) { } @Nonnull - private INode enrich(@NotNull AES aes) { + private INode enrich(@Nonnull AES aes) { @Nullable KeyLength keyLength = aes.getKeyLength().orElse(null); @Nullable final Mode mode = aes.getMode().orElse(null); this.applyDefaultKeySizeForJca(aes, 128); diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/DESEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/DESEnricher.java index 8036854d..c8f3f8f8 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/DESEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/DESEnricher.java @@ -22,11 +22,11 @@ import com.ibm.enricher.IEnricher; import com.ibm.mapper.model.INode; import com.ibm.mapper.model.algorithms.DES; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class DESEnricher implements IEnricher, IEnrichWithDefaultKeySize { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof DES des) { this.applyDefaultKeySizeForJca(des, 56); return des; diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/DHEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/DHEnricher.java index 779a7584..90f54113 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/DHEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/DHEnricher.java @@ -23,12 +23,11 @@ import com.ibm.mapper.model.INode; import com.ibm.mapper.model.algorithms.DH; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class DHEnricher implements IEnricher, IEnrichWithDefaultKeySize { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof DH dh) { return enrich(dh); } diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/DSAEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/DSAEnricher.java index 4bde658c..050cbb8b 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/DSAEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/DSAEnricher.java @@ -22,11 +22,11 @@ import com.ibm.enricher.IEnricher; import com.ibm.mapper.model.INode; import com.ibm.mapper.model.algorithms.DSA; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class DSAEnricher implements IEnricher, IEnrichWithDefaultKeySize { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof DSA dsa) { this.applyDefaultKeySizeForJca(dsa, 2048); return dsa; diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/PBKDF2Enricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/PBKDF2Enricher.java index 95c9638e..45029fe1 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/PBKDF2Enricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/PBKDF2Enricher.java @@ -25,12 +25,12 @@ import com.ibm.mapper.model.Oid; import com.ibm.mapper.model.algorithms.PBKDF2; import com.ibm.mapper.model.algorithms.SHA; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class PBKDF2Enricher implements IEnricher { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof PBKDF2 pbkdf2) { pbkdf2.hasChildOfType(Mac.class) .ifPresent( diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/RSAEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/RSAEnricher.java index c01a69d5..8444f16b 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/RSAEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/RSAEnricher.java @@ -22,19 +22,21 @@ import com.ibm.enricher.IEnricher; import com.ibm.mapper.model.INode; import com.ibm.mapper.model.algorithms.RSA; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class RSAEnricher implements IEnricher, IEnrichWithDefaultKeySize { - @NotNull @Override - public INode enrich(@NotNull INode node) { + @Nonnull + @Override + public INode enrich(@Nonnull INode node) { if (node instanceof RSA rsa) { return enrich(rsa); } return node; } - @NotNull private RSA enrich(@NotNull RSA rsa) { + @Nonnull + private RSA enrich(@Nonnull RSA rsa) { this.applyDefaultKeySizeForJca(rsa, 2048); return rsa; } diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/RSAoaepEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/RSAoaepEnricher.java index fd24e051..56cf23bd 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/RSAoaepEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/RSAoaepEnricher.java @@ -26,12 +26,12 @@ import com.ibm.mapper.model.algorithms.RSA; import com.ibm.mapper.model.padding.OAEP; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class RSAoaepEnricher implements IEnricher { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof RSA rsa) { final Optional padding = rsa.hasChildOfType(Padding.class); if (padding.isEmpty()) { diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/RSAssaPSSEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/RSAssaPSSEnricher.java index 850c9b0b..3972653c 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/RSAssaPSSEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/RSAssaPSSEnricher.java @@ -23,11 +23,11 @@ import com.ibm.mapper.model.INode; import com.ibm.mapper.model.Oid; import com.ibm.mapper.model.algorithms.RSAssaPSS; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class RSAssaPSSEnricher implements IEnricher { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof RSAssaPSS rsaSsaPSS) { rsaSsaPSS.put(new Oid("1.2.840.113549.1.1.10", rsaSsaPSS.getDetectionContext())); return rsaSsaPSS; diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/SHA2Enricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/SHA2Enricher.java index 1777fb5a..88993cdf 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/SHA2Enricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/SHA2Enricher.java @@ -30,11 +30,11 @@ import java.util.function.Supplier; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class SHA2Enricher implements IEnricher { - @NotNull @Override - public INode enrich(@NotNull INode node) { + @Nonnull + @Override + public INode enrich(@Nonnull INode node) { if (node instanceof SHA2 sha2) { return enrich(sha2); } diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/SHA3Enricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/SHA3Enricher.java index 96bfe08e..c886c08a 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/SHA3Enricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/SHA3Enricher.java @@ -25,12 +25,11 @@ import com.ibm.mapper.model.Oid; import com.ibm.mapper.model.algorithms.SHA3; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class SHA3Enricher implements IEnricher { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof SHA3 sha3) { return enrich(sha3); } diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/SignatureEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/SignatureEnricher.java index c4ff83cd..63f7a34c 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/SignatureEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/SignatureEnricher.java @@ -35,12 +35,11 @@ import com.ibm.mapper.model.algorithms.SHA3; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class SignatureEnricher implements IEnricher { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node.is(Signature.class)) { if (node instanceof DSA dsa) { return enrichDSA(dsa); @@ -57,7 +56,7 @@ public class SignatureEnricher implements IEnricher { @SuppressWarnings("java:S3776") @Nonnull - private Signature enrichRSA(@NotNull RSA rsa) { + private Signature enrichRSA(@Nonnull RSA rsa) { Optional possibleDigest = rsa.hasChildOfType(MessageDigest.class); if (possibleDigest.isEmpty()) { return rsa; @@ -183,7 +182,7 @@ private Signature enrichRSA(@NotNull RSA rsa) { } @Nonnull - private Signature enrichECDSA(@NotNull ECDSA ecdsa) { + private Signature enrichECDSA(@Nonnull ECDSA ecdsa) { Optional possibleDigest = ecdsa.hasChildOfType(MessageDigest.class); if (possibleDigest.isEmpty()) { return ecdsa; @@ -257,7 +256,7 @@ private Signature enrichECDSA(@NotNull ECDSA ecdsa) { } @Nonnull - private Signature enrichDSA(@NotNull DSA dsa) { + private Signature enrichDSA(@Nonnull DSA dsa) { Optional possibleDigest = dsa.hasChildOfType(MessageDigest.class); if (possibleDigest.isEmpty()) { return dsa; diff --git a/enricher/src/main/java/com/ibm/enricher/algorithm/TagOrDigestEnricher.java b/enricher/src/main/java/com/ibm/enricher/algorithm/TagOrDigestEnricher.java index 430e761b..605c30fb 100644 --- a/enricher/src/main/java/com/ibm/enricher/algorithm/TagOrDigestEnricher.java +++ b/enricher/src/main/java/com/ibm/enricher/algorithm/TagOrDigestEnricher.java @@ -27,12 +27,12 @@ import com.ibm.mapper.model.MessageDigest; import com.ibm.mapper.model.functionality.Digest; import com.ibm.mapper.model.functionality.Tag; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class TagOrDigestEnricher implements IEnricher { @Override - public @NotNull INode enrich(@NotNull INode node) { + public @Nonnull INode enrich(@Nonnull INode node) { if (node instanceof IAsset asset) { if (node.is(Mac.class)) { node.put(new Tag(asset.getDetectionContext())); diff --git a/java/pom.xml b/java/pom.xml index 9ccca306..915ee27f 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -40,11 +40,20 @@ 2.0.0-SNAPSHOT compile + + com.ibm + rules + 2.0.0-SNAPSHOT + compile + + + org.bouncycastle bcpkix-jdk18on 1.79 + test com.google.guava @@ -52,11 +61,5 @@ 33.3.1-jre test - - com.ibm - rules - 2.0.0-SNAPSHOT - compile - \ No newline at end of file diff --git a/java/rule-graph/parse.py b/java/rule-graph/parse.py index 85c4a5ac..ed2c9538 100644 --- a/java/rule-graph/parse.py +++ b/java/rule-graph/parse.py @@ -1,5 +1,5 @@ -import os import json +import os import shutil from pyvis.network import Network diff --git a/java/src/main/java/com/ibm/plugin/JavaAggregator.java b/java/src/main/java/com/ibm/plugin/JavaAggregator.java index c3a142f5..396e42f3 100644 --- a/java/src/main/java/com/ibm/plugin/JavaAggregator.java +++ b/java/src/main/java/com/ibm/plugin/JavaAggregator.java @@ -27,7 +27,6 @@ import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.JavaCheck; import org.sonar.plugins.java.api.JavaFileScannerContext; import org.sonar.plugins.java.api.semantic.Symbol; @@ -49,7 +48,6 @@ public static void addNodes(@Nonnull List newNodes) { } @Nonnull - @Unmodifiable public static List getDetectedNodes() { return Collections.unmodifiableList(detectedNodes); } diff --git a/java/src/main/java/com/ibm/plugin/JavaCheckRegistrar.java b/java/src/main/java/com/ibm/plugin/JavaCheckRegistrar.java index 4fd2bc4e..16146f28 100644 --- a/java/src/main/java/com/ibm/plugin/JavaCheckRegistrar.java +++ b/java/src/main/java/com/ibm/plugin/JavaCheckRegistrar.java @@ -20,8 +20,7 @@ package com.ibm.plugin; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.CheckRegistrar; import org.sonar.plugins.java.api.JavaCheck; import org.sonarsource.api.sonarlint.SonarLintSide; @@ -37,12 +36,12 @@ public void register(RegistrarContext registrarContext) { } /** Lists all the main checks provided by the java-translation */ - public static @NotNull @Unmodifiable List> checkClasses() { + public static @Nonnull List> checkClasses() { return JavaRuleList.getJavaChecks(); } /** Lists all the test checks provided by the java-translation */ - public static @NotNull @Unmodifiable List> testCheckClasses() { + public static @Nonnull List> testCheckClasses() { return JavaRuleList.getJavaTestChecks(); } } diff --git a/java/src/main/java/com/ibm/plugin/JavaRuleList.java b/java/src/main/java/com/ibm/plugin/JavaRuleList.java index 2d9eca2c..eb7d5020 100644 --- a/java/src/main/java/com/ibm/plugin/JavaRuleList.java +++ b/java/src/main/java/com/ibm/plugin/JavaRuleList.java @@ -24,16 +24,14 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; -import org.jetbrains.annotations.UnmodifiableView; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.JavaCheck; public final class JavaRuleList { private JavaRuleList() {} - public static @NotNull @UnmodifiableView List> getChecks() { + public static @Nonnull List> getChecks() { List> checks = new ArrayList<>(); checks.addAll(getJavaChecks()); checks.addAll(getJavaTestChecks()); @@ -41,12 +39,12 @@ private JavaRuleList() {} } /** These rules are going to target MAIN code only */ - public static @NotNull @Unmodifiable List> getJavaChecks() { + public static @Nonnull List> getJavaChecks() { return List.of(JavaInventoryRule.class, JavaNoMD5UseRule.class); } /** These rules are going to target TEST code only */ - public static @NotNull @Unmodifiable List> getJavaTestChecks() { + public static @Nonnull List> getJavaTestChecks() { return List.of(); } } diff --git a/java/src/main/java/com/ibm/plugin/rules/JavaInventoryRule.java b/java/src/main/java/com/ibm/plugin/rules/JavaInventoryRule.java index 27f1248f..cc6b1bd7 100644 --- a/java/src/main/java/com/ibm/plugin/rules/JavaInventoryRule.java +++ b/java/src/main/java/com/ibm/plugin/rules/JavaInventoryRule.java @@ -28,10 +28,8 @@ import com.ibm.rules.issue.Issue; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; -import org.jetbrains.annotations.VisibleForTesting; import org.sonar.check.Rule; +import org.sonar.java.annotations.VisibleForTesting; import org.sonar.plugins.java.api.tree.Tree; @Rule(key = "Inventory") @@ -49,7 +47,7 @@ protected JavaInventoryRule(@Nonnull List> detectionRules) @Override @Nonnull public List> report( - @Nonnull Tree markerTree, @NotNull @Unmodifiable List translatedNodes) { + @Nonnull Tree markerTree, @Nonnull List translatedNodes) { return new InventoryRule().report(markerTree, translatedNodes); } } diff --git a/java/src/main/java/com/ibm/plugin/rules/JavaNoMD5UseRule.java b/java/src/main/java/com/ibm/plugin/rules/JavaNoMD5UseRule.java index 7136ec87..cb427350 100644 --- a/java/src/main/java/com/ibm/plugin/rules/JavaNoMD5UseRule.java +++ b/java/src/main/java/com/ibm/plugin/rules/JavaNoMD5UseRule.java @@ -25,8 +25,6 @@ import com.ibm.rules.issue.Issue; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.check.Rule; import org.sonar.plugins.java.api.tree.Tree; @@ -36,7 +34,7 @@ public class JavaNoMD5UseRule extends JavaBaseDetectionRule { @Override @Nonnull public List> report( - @Nonnull Tree markerTree, @NotNull @Unmodifiable List translatedNodes) { + @Nonnull Tree markerTree, @Nonnull List translatedNodes) { return new NoMD5UseForMessageDigestRule().report(markerTree, translatedNodes); } } diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/JavaBaseDetectionRule.java b/java/src/main/java/com/ibm/plugin/rules/detection/JavaBaseDetectionRule.java index 9c0aa763..0d450e85 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/JavaBaseDetectionRule.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/JavaBaseDetectionRule.java @@ -34,8 +34,6 @@ import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.IssuableSubscriptionVisitor; import org.sonar.plugins.java.api.JavaCheck; import org.sonar.plugins.java.api.JavaFileScannerContext; @@ -116,8 +114,8 @@ public void update(@Nonnull Finding> report( - @Nonnull Tree markerTree, @NotNull @Unmodifiable List translatedNodes) { + public List> report( + @Nonnull Tree markerTree, @Nonnull List translatedNodes) { // override by higher level rule, to report an issue return Collections.emptyList(); } diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/BouncyCastleDetectionRules.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/BouncyCastleDetectionRules.java index 20af6755..025ae277 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/BouncyCastleDetectionRules.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/BouncyCastleDetectionRules.java @@ -20,10 +20,20 @@ package com.ibm.plugin.rules.detection.bc; import com.ibm.engine.rule.IDetectionRule; -import com.ibm.plugin.rules.detection.bc.aeadcipher.*; -import com.ibm.plugin.rules.detection.bc.asymmetricblockcipher.*; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcAEADCipherEngine; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcCCMBlockCipher; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcChaCha20Poly1305; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcEAXBlockCipher; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcGCMBlockCipher; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcGCMSIVBlockCipher; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcKCCMBlockCipher; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcKGCMBlockCipher; +import com.ibm.plugin.rules.detection.bc.aeadcipher.BcOCBBlockCipher; +import com.ibm.plugin.rules.detection.bc.asymmetricblockcipher.BcAsymmetricBlockCipher; +import com.ibm.plugin.rules.detection.bc.asymmetricblockcipher.BcBufferedAsymmetricBlockCipher; import com.ibm.plugin.rules.detection.bc.basicagreement.BcBasicAgreement; -import com.ibm.plugin.rules.detection.bc.blockcipher.*; +import com.ibm.plugin.rules.detection.bc.blockcipher.BcBlockCipher; +import com.ibm.plugin.rules.detection.bc.blockcipher.BcBlockCipherEngine; import com.ibm.plugin.rules.detection.bc.bufferedblockcipher.BcBufferedBlockCipher; import com.ibm.plugin.rules.detection.bc.derivationfunction.BcDerivationFunction; import com.ibm.plugin.rules.detection.bc.dsa.BcDSA; @@ -34,7 +44,7 @@ import com.ibm.plugin.rules.detection.bc.other.BcSM2Engine; import com.ibm.plugin.rules.detection.bc.pbe.BcPBEParametersGenerator; import com.ibm.plugin.rules.detection.bc.signer.BcSigner; -import com.ibm.plugin.rules.detection.bc.streamcipher.*; +import com.ibm.plugin.rules.detection.bc.streamcipher.BcStreamCipherEngine; import com.ibm.plugin.rules.detection.bc.wrapper.BcWrapperEngine; import java.util.List; import java.util.stream.Stream; diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngine.java index d4f5dc25..31e22791 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngine.java @@ -30,8 +30,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcAEADCipherEngine { @@ -54,7 +52,7 @@ private BcAEADCipherEngine() { // Because these AEAD engines are not used as engines for other classes, we assume that they are // only used alone. It is then safe to add them "init" as depending detection rule. - private static @NotNull List> constructors() { + private static @Nonnull List> constructors() { List> constructorsList = new LinkedList<>(); for (Map.Entry entry : infoMap.entrySet()) { @@ -96,7 +94,6 @@ private BcAEADCipherEngine() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return constructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherInit.java index 9d0f7184..bbee5c36 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcAEADCipherInit { @@ -49,7 +48,6 @@ private BcAEADCipherInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipher.java index 355fd44a..b4e849d4 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcCCMBlockCipher { @@ -68,7 +67,6 @@ private BcCCMBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(NEW_INSTANCE_1, CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305.java index 81bae533..becf5f3d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcChaCha20Poly1305 { @@ -65,7 +64,6 @@ private BcChaCha20Poly1305() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipher.java index ea3ec370..9703b944 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcEAXBlockCipher { @@ -53,7 +52,6 @@ private BcEAXBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipher.java index 90873e18..d4a6b673 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcGCMBlockCipher { @@ -100,7 +99,6 @@ private BcGCMBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(NEW_INSTANCE_1, NEW_INSTANCE_2, CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipher.java index 1be82d37..06f6d031 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcGCMSIVBlockCipher { @@ -80,7 +79,6 @@ private BcGCMSIVBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2, CONSTRUCTOR_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipher.java index 41480b68..8258c35e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcKCCMBlockCipher { @@ -69,7 +68,6 @@ private BcKCCMBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipher.java index 61441255..c14c431f 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcKGCMBlockCipher { @@ -53,7 +52,6 @@ private BcKGCMBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipher.java index c1c80765..4a17462b 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipher.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcOCBBlockCipher { @@ -56,7 +55,6 @@ private BcOCBBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcAEADCipherInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherEngine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherEngine.java index 5e5bd1da..b9f16067 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherEngine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherEngine.java @@ -29,8 +29,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcAsymCipherEngine { @@ -48,7 +46,7 @@ private BcAsymCipherEngine() { "RSABlindingEngine", "RSAEngine"); - private static @NotNull List> constructors( + private static @Nonnull List> constructors( @Nullable IDetectionContext detectionValueContext) { List> constructorsList = new LinkedList<>(); IDetectionContext context = @@ -71,13 +69,11 @@ private BcAsymCipherEngine() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return rules(null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext detectionValueContext) { diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherInit.java index 3b78b1e4..d3c20a81 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymCipherInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcAsymCipherInit { @@ -49,7 +48,6 @@ private BcAsymCipherInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipher.java index 59541a28..5d51679a 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipher.java @@ -25,7 +25,6 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcAsymmetricBlockCipher { @@ -34,13 +33,11 @@ private BcAsymmetricBlockCipher() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return rules(null, null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext encodingDetectionValueContext, diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipher.java index 31ba8753..87fc2f1e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipher.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBufferedAsymmetricBlockCipher { @@ -65,7 +64,6 @@ private BcBufferedAsymmetricBlockCipher() { .inBundle(() -> "Bc") .withDependingDetectionRules(List.of(INIT)); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1Encoding.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1Encoding.java index c0fe1b08..70afa0fa 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1Encoding.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1Encoding.java @@ -29,7 +29,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcISO9796d1Encoding { @@ -62,13 +61,11 @@ private static final List> constructors( return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return rules(null, null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext encodingDetectionValueContext, diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncoding.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncoding.java index 5e06c952..f2366ab4 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncoding.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncoding.java @@ -33,7 +33,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcOAEPEncoding { @@ -117,13 +116,11 @@ private static final List> constructors( return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return rules(null, null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext encodingDetectionValueContext, diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1Encoding.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1Encoding.java index b2cc85e2..d4a907c7 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1Encoding.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1Encoding.java @@ -31,7 +31,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcPKCS1Encoding { @@ -93,13 +92,11 @@ private static final List> constructors( return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return rules(null, null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext encodingDetectionValueContext, diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreement.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreement.java index d1cbe3c9..fdd0ef32 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreement.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreement.java @@ -28,8 +28,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBasicAgreement { @@ -48,7 +46,7 @@ private BcBasicAgreement() { "MQVBasicAgreement", "XDHBasicAgreement"); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (String agreement : basicAgreements) { @@ -67,7 +65,6 @@ private BcBasicAgreement() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return simpleConstructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreementInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreementInit.java index ec48c705..ff0baf4d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreementInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcBasicAgreementInit.java @@ -25,7 +25,6 @@ import com.ibm.plugin.rules.detection.bc.cipherparameters.BcCipherParameters; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBasicAgreementInit { @@ -45,7 +44,6 @@ private BcBasicAgreementInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipher.java index 187eabd8..194c35cb 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipher.java @@ -32,7 +32,6 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBlockCipher { @@ -200,21 +199,18 @@ private static final List> specialConstructors( return constructorsList; } - @Unmodifiable @Nonnull // Rules defined in this file (classes finishing with BlockCipher) public static List> rules() { return rules(null); } - @Unmodifiable @Nonnull // All BlockCipher rules including all the engines public static List> all() { return all(null); } - @Unmodifiable @Nonnull // Rules defined in this file (classes finishing with BlockCipher) public static List> rules( @@ -226,7 +222,6 @@ public static List> rules( .toList(); } - @Unmodifiable @Nonnull // All BlockCipher rules including all the engines public static List> all( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherEngine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherEngine.java index 70e2ebd4..ef343899 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherEngine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherEngine.java @@ -31,7 +31,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBlockCipherEngine { @@ -131,13 +130,11 @@ private static final List> simpleConstructors( return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return rules(null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext detectionValueContext) { diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherInit.java index b08c6ac6..9e895681 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcBlockCipherInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBlockCipherInit { @@ -49,7 +48,6 @@ private BcBlockCipherInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipherpadding/BcBlockCipherPadding.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipherpadding/BcBlockCipherPadding.java index 7a3fa24a..4c5ef9ec 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipherpadding/BcBlockCipherPadding.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/blockcipherpadding/BcBlockCipherPadding.java @@ -27,8 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBlockCipherPadding { @@ -45,7 +43,7 @@ private BcBlockCipherPadding() { "X923Padding", "ZeroBytePadding"); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (String padding : paddings) { @@ -63,7 +61,6 @@ private BcBlockCipherPadding() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return simpleConstructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipher.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipher.java index babe90c3..5f395bc9 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipher.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipher.java @@ -31,8 +31,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBufferedBlockCipher { @@ -53,7 +51,7 @@ private BcBufferedBlockCipher() { infoMap.putKey("PaddedBlockCipher").putType(typePrefix + "modes."); } - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (Map.Entry entry : infoMap.entrySet()) { String blockCipher = entry.getKey(); @@ -74,7 +72,7 @@ private BcBufferedBlockCipher() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -123,7 +121,6 @@ private BcBufferedBlockCipher() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipherInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipherInit.java index c43cc9fb..047f8e5b 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipherInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcBufferedBlockCipherInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcBufferedBlockCipherInit { @@ -49,7 +48,6 @@ private BcBufferedBlockCipherInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParameters.java index ba7a5aaf..61464a1c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParameters.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcAEADParameters { @@ -68,7 +67,6 @@ private BcAEADParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParameters.java index 80e384bc..6e27e6e0 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParameters.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcCCMParameters { @@ -52,7 +51,6 @@ private BcCCMParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParameters.java index af519c29..5baa52e8 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParameters.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcCramerShoupParameters { @@ -84,7 +83,6 @@ private BcCramerShoupParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(BASE_CONSTRUCTOR, PRIVATE_KEY_CONSTRUCTOR, PUBLIC_KEY_CONSTRUCTOR); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParameters.java index a54cb87d..a356c5d2 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParameters.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcGMSSParameters { @@ -158,7 +157,6 @@ private BcGMSSParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParameters.java index 348bc05a..42312e14 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParameters.java @@ -29,7 +29,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcIESParameters { @@ -69,7 +68,6 @@ private BcIESParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_IES, CONSTRUCTOR_IES_WITH_CIPHER_PARAMETERS); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParameter.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParameter.java index 56d5f5b8..f3c5b06a 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParameter.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParameter.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcKeyParameter { @@ -51,7 +50,6 @@ private BcKeyParameter() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUEncryptionParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUEncryptionParameters.java index 851f0c9a..fc838bf7 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUEncryptionParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUEncryptionParameters.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcNTRUEncryptionParameters { @@ -205,7 +204,6 @@ private BcNTRUEncryptionParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPrivateKeyParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPrivateKeyParameters.java index 4b6df9ff..50645c09 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPrivateKeyParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPrivateKeyParameters.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcNTRUSigningPrivateKeyParameters { @@ -137,7 +136,6 @@ private BcNTRUSigningPrivateKeyParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPublicKeyParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPublicKeyParameters.java index 130a60db..a7d7c93c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPublicKeyParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUSigningPublicKeyParameters.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcNTRUSigningPublicKeyParameters { @@ -127,7 +126,6 @@ private BcNTRUSigningPublicKeyParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWith.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWith.java index bd6ad9d3..7e0fa570 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWith.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWith.java @@ -26,7 +26,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcParametersWith { @@ -160,7 +159,6 @@ private BcParametersWith() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParameters.java index 08e880f6..5793d81b 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParameters.java @@ -29,7 +29,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSABERParameters { @@ -93,7 +92,6 @@ private BcSABERParameters() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcDerivationFunction.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcDerivationFunction.java index a218e550..b4c1688b 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcDerivationFunction.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcDerivationFunction.java @@ -32,8 +32,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcDerivationFunction { @@ -83,7 +81,7 @@ private BcDerivationFunction() { macDerivationFunctionMap.putKey("KDFFeedbackBytesGenerator"); } - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); @@ -123,7 +121,7 @@ private BcDerivationFunction() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -143,7 +141,6 @@ private BcDerivationFunction() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/digest/BcDigests.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/digest/BcDigests.java index c0ce74bf..5d59fc35 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/digest/BcDigests.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/digest/BcDigests.java @@ -33,7 +33,6 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcDigests { @@ -167,13 +166,11 @@ private static final List> otherConstructors( return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return rules(null); } - @Unmodifiable @Nonnull public static List> rules( @Nullable IDetectionContext detectionValueContext) { diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSA.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSA.java index a983416a..49c5a4ae 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSA.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSA.java @@ -27,8 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcDSA { @@ -47,7 +45,7 @@ private BcDSA() { "ECNRSigner", "GOST3410Signer"); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (String dsa : dsas) { @@ -66,7 +64,6 @@ private BcDSA() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return simpleConstructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSAInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSAInit.java index c79a847c..189c433d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSAInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSAInit.java @@ -26,7 +26,6 @@ import com.ibm.plugin.rules.detection.bc.cipherparameters.BcCipherParameters; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcDSAInit { @@ -48,7 +47,6 @@ private BcDSAInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretExtractor.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretExtractor.java index a39620bb..2b4b366d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretExtractor.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretExtractor.java @@ -32,8 +32,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcEncapsulatedSecretExtractor { @@ -58,7 +56,7 @@ private BcEncapsulatedSecretExtractor() { infoMap.putKey("SNTRUPrimeKEMExtractor").putType("org.bouncycastle.pqc.crypto.ntruprime."); } - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (Map.Entry entry : infoMap.entrySet()) { @@ -80,7 +78,7 @@ private BcEncapsulatedSecretExtractor() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -139,7 +137,6 @@ private BcEncapsulatedSecretExtractor() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretGenerator.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretGenerator.java index 546c56d9..7599e471 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretGenerator.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcEncapsulatedSecretGenerator.java @@ -32,8 +32,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcEncapsulatedSecretGenerator { @@ -58,7 +56,7 @@ private BcEncapsulatedSecretGenerator() { infoMap.putKey("SNTRUPrimeKEMGenerator").putType("org.bouncycastle.pqc.crypto.ntruprime."); } - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (Map.Entry entry : infoMap.entrySet()) { @@ -79,7 +77,7 @@ private BcEncapsulatedSecretGenerator() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -136,7 +134,6 @@ private BcEncapsulatedSecretGenerator() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMac.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMac.java index aadffc57..a77298bb 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMac.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMac.java @@ -38,8 +38,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcMac { @@ -112,7 +110,7 @@ private BcMac() { "Zuc128Mac" // just an empty constructor ); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (String macClass : constructorBlockCipher) { @@ -229,7 +227,7 @@ private BcMac() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -393,7 +391,6 @@ private BcMac() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMacInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMacInit.java index a9a663c3..8dc89ba9 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMacInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/mac/BcMacInit.java @@ -25,7 +25,6 @@ import com.ibm.plugin.rules.detection.bc.cipherparameters.BcCipherParameters; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcMacInit { @@ -44,7 +43,6 @@ private BcMacInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSigner.java index d9fcd95a..9baf585b 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSigner.java @@ -31,8 +31,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcMessageSigner { @@ -65,7 +63,7 @@ private BcMessageSigner() { .putType("org.bouncycastle.pqc.crypto.sphincsplus."); } - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (Map.Entry entry : infoMap.entrySet()) { @@ -86,7 +84,7 @@ private BcMessageSigner() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -110,7 +108,6 @@ private BcMessageSigner() { return constructorsList; } - @Unmodifiable @Nonnull // Includes StateAwareMessageSigner rules public static List> rules() { diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSignerInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSignerInit.java index 1dcf2c35..56376ce1 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSignerInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcMessageSignerInit.java @@ -26,7 +26,6 @@ import com.ibm.plugin.rules.detection.bc.cipherparameters.BcCipherParameters; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcMessageSignerInit { @@ -48,7 +47,6 @@ private BcMessageSignerInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcStateAwareMessageSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcStateAwareMessageSigner.java index 75c325d2..3f89915c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcStateAwareMessageSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/messagesigner/BcStateAwareMessageSigner.java @@ -30,8 +30,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcStateAwareMessageSigner { @@ -49,7 +47,7 @@ private BcStateAwareMessageSigner() { infoMap.putKey("XMSSSigner").putType("org.bouncycastle.pqc.crypto.xmss."); } - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (Map.Entry entry : infoMap.entrySet()) { @@ -69,7 +67,7 @@ private BcStateAwareMessageSigner() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -88,7 +86,6 @@ private BcStateAwareMessageSigner() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngine.java index 652d4fb5..48ed02fe 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngine.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcIESEngine { @@ -76,7 +75,6 @@ private BcIESEngine() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcIESEngineInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineInit.java index 3da97888..fe0d4b8c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcIESEngineInit { @@ -82,7 +81,6 @@ private BcIESEngineInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2, CONSTRUCTOR_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2Engine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2Engine.java index f9b27f21..a8a42563 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2Engine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2Engine.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSM2Engine { @@ -86,7 +85,6 @@ private BcSM2Engine() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSM2EngineInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2, CONSTRUCTOR_3, CONSTRUCTOR_4); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineInit.java index 9bf5b013..3abdfc7d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSM2EngineInit { @@ -49,7 +48,6 @@ private BcSM2EngineInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/pbe/BcPBEParametersGenerator.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/pbe/BcPBEParametersGenerator.java index ef5a1c6e..9d4b8ef8 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/pbe/BcPBEParametersGenerator.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/pbe/BcPBEParametersGenerator.java @@ -29,8 +29,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcPBEParametersGenerator { @@ -50,7 +48,7 @@ private BcPBEParametersGenerator() { "PKCS5S1ParametersGenerator", "PKCS5S2ParametersGenerator"); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); /* Constructor without argument */ @@ -104,7 +102,6 @@ private BcPBEParametersGenerator() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return simpleConstructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSigner.java index af9509a9..afcd4d60 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSigner.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.dsa.BcDSA; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcDSADigestSigner { @@ -67,7 +66,6 @@ private BcDSADigestSigner() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSigner.java index 64121c38..efb5be5a 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSigner.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcGenericSigner { @@ -58,7 +57,6 @@ private BcGenericSigner() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSigner.java index a2d86b7e..4e8012eb 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSigner.java @@ -29,7 +29,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcISO9796d2PSSSigner { @@ -75,7 +74,6 @@ private BcISO9796d2PSSSigner() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2Signer.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2Signer.java index 94ec35a1..9851230e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2Signer.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2Signer.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcISO9796d2Signer { @@ -67,7 +66,6 @@ private BcISO9796d2Signer() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPQCSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPQCSigner.java index a307877e..b1091bc0 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPQCSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPQCSigner.java @@ -29,8 +29,6 @@ import java.util.LinkedList; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcPQCSigner { @@ -39,7 +37,7 @@ private BcPQCSigner() { // nothing } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -75,7 +73,6 @@ private BcPQCSigner() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return specialConstructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSigner.java index 656c9465..0fa4bd0e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSigner.java @@ -33,7 +33,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcPSSSigner { @@ -172,7 +171,6 @@ private BcPSSSigner() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSigner.java index f83b5dcb..e7c7ff29 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSigner.java @@ -26,7 +26,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcRSADigestSigner { @@ -62,7 +61,6 @@ private BcRSADigestSigner() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2Signer.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2Signer.java index 0d34bd40..9e4307b3 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2Signer.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2Signer.java @@ -26,7 +26,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSM2Signer { @@ -84,7 +83,6 @@ private BcSM2Signer() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2, CONSTRUCTOR_3, CONSTRUCTOR_4); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSigner.java index 620d2114..037be703 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSigner.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSigner { @@ -31,7 +30,6 @@ private BcSigner() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSignerInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSignerInit.java index 4577692a..ea46778e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSignerInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSignerInit.java @@ -26,7 +26,6 @@ import com.ibm.plugin.rules.detection.bc.cipherparameters.BcCipherParameters; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSignerInit { @@ -48,7 +47,6 @@ private BcSignerInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSimpleSigner.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSimpleSigner.java index 36aeb615..92b3b7ce 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSimpleSigner.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcSimpleSigner.java @@ -27,8 +27,6 @@ import java.util.LinkedList; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcSimpleSigner { @@ -45,7 +43,7 @@ private BcSimpleSigner() { "Ed448Signer" /* standard algorithm */, "Ed448phSigner" /* prehashed variant */); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (String signer : simpleSigners) { @@ -64,7 +62,6 @@ private BcSimpleSigner() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return simpleConstructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcX931Signer.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcX931Signer.java index 001665aa..ba73624f 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcX931Signer.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/signer/BcX931Signer.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.bc.digest.BcDigests; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcX931Signer { @@ -67,7 +66,6 @@ private BcX931Signer() { .inBundle(() -> "Bc") .withDependingDetectionRules(BcSignerInit.rules()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1, CONSTRUCTOR_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherEngine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherEngine.java index 5c37053b..889e807d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherEngine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherEngine.java @@ -28,8 +28,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcStreamCipherEngine { @@ -60,7 +58,7 @@ private BcStreamCipherEngine() { "Zuc128Engine", "Zuc256Engine"); - private static @NotNull List> constructors() { + private static @Nonnull List> constructors() { List> constructorsList = new LinkedList<>(); for (String engine : engines) { @@ -80,7 +78,6 @@ private BcStreamCipherEngine() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return constructors(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherInit.java index 2d39ea42..f14cf89e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcStreamCipherInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcStreamCipherInit { @@ -49,7 +48,6 @@ private BcStreamCipherInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperEngine.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperEngine.java index c4c8d097..208e4d77 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperEngine.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperEngine.java @@ -32,8 +32,6 @@ import java.util.Map; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcWrapperEngine { @@ -55,7 +53,7 @@ private BcWrapperEngine() { "RC2WrapEngine", "SEEDWrapEngine"); - private static @NotNull List> simpleConstructors() { + private static @Nonnull List> simpleConstructors() { List> constructorsList = new LinkedList<>(); for (String engine : engines) { @@ -76,7 +74,7 @@ private BcWrapperEngine() { return constructorsList; } - private static @NotNull List> specialConstructors() { + private static @Nonnull List> specialConstructors() { List> constructorsList = new LinkedList<>(); constructorsList.add( @@ -132,7 +130,6 @@ private BcWrapperEngine() { return constructorsList; } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(simpleConstructors().stream(), specialConstructors().stream()) diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperInit.java index 8c67997a..f54146ef 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/bc/wrapper/BcWrapperInit.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class BcWrapperInit { @@ -49,7 +48,6 @@ private BcWrapperInit() { .inBundle(() -> "Bc") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(CONSTRUCTOR_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstance.java index 835d6a33..97affbb6 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstance.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaAlgorithmParameterGeneratorGetInstance { @@ -70,7 +69,6 @@ private JcaAlgorithmParameterGeneratorGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(PARAMETER_GENERATOR_1, PARAMETER_GENERATOR_2, PARAMETER_GENERATOR_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInit.java index 87ef247f..48ae7e7b 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInit.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.jca.algorithmspec.JcaAlgorithmParameterSpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaAlgorithmParameterGeneratorInit { @@ -81,7 +80,6 @@ private JcaAlgorithmParameterGeneratorInit() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(PARAMETER_INIT_1, PARAMETER_INIT_2, PARAMETER_INIT_3, PARAMETER_INIT_4); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaAlgorithmParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaAlgorithmParameterSpec.java index 17d4e332..6bd86e7c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaAlgorithmParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaAlgorithmParameterSpec.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaAlgorithmParameterSpec { @@ -32,7 +31,6 @@ private JcaAlgorithmParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpec.java index 8a917b36..e345c7c5 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpec.java @@ -26,7 +26,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDHGenParameterSpec { @@ -47,7 +46,6 @@ private JcaDHGenParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DH_GEN_PARAMETER_SPEC); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHParameterSpec.java index efff8813..6b35bea5 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHParameterSpec.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDHParameterSpec { @@ -62,7 +61,6 @@ private JcaDHParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DH_PARAMETER_SPEC1, DH_PARAMETER_SPEC2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECGenParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECGenParameterSpec.java index 21d5bec2..0195c2bf 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECGenParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECGenParameterSpec.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -47,7 +46,6 @@ private JcaECGenParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(EC_GEN_PARAMETER_SPEC2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECParameterSpec.java index 2bea84ae..80f1847e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaECParameterSpec.java @@ -30,7 +30,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaECParameterSpec { @@ -147,7 +146,6 @@ private JcaECParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(EC_PARAMETER_SPEC); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaMGF1ParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaMGF1ParameterSpec.java index fb1a1654..95cdf887 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaMGF1ParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaMGF1ParameterSpec.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaMGF1ParameterSpec { @@ -47,7 +46,6 @@ private JcaMGF1ParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(MGF1_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaPSSParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaPSSParameterSpec.java index 7ae88b78..a0eced8e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaPSSParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaPSSParameterSpec.java @@ -29,7 +29,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; // https://docs.oracle.com/javase/8/docs/api/java/security/spec/PSSParameterSpec.html @@ -69,7 +68,6 @@ private JcaPSSParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(PSS_1, PSS_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherGetInstance.java index 720974fc..897ec4a2 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherGetInstance.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -87,7 +86,6 @@ private JcaCipherGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(CIPHER_GET_INSTANCE_1, CIPHER_GET_INSTANCE_2, CIPHER_GET_INSTANCE_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherInit.java index 07f010b7..4612d0cd 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherInit.java @@ -31,7 +31,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaCipherInit { @@ -152,7 +151,6 @@ private JcaCipherInit() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherWrap.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherWrap.java index cff90d7e..ab58459e 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherWrap.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/cipher/JcaCipherWrap.java @@ -30,7 +30,6 @@ import com.ibm.plugin.rules.detection.jca.keyspec.JcaKeySpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaCipherWrap { @@ -50,7 +49,6 @@ private JcaCipherWrap() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(CIPHER_WRAP_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaDigest.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaDigest.java index eff37e87..4ad56d81 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaDigest.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaDigest.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDigest { @@ -32,7 +31,6 @@ private JcaDigest() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(JcaMessageDigestGetInstance.rules().stream()).flatMap(i -> i).toList(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaMessageDigestGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaMessageDigestGetInstance.java index d3b1f2ef..f1b47f16 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaMessageDigestGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/digest/JcaMessageDigestGetInstance.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaMessageDigestGetInstance { @@ -47,7 +46,6 @@ private JcaMessageDigestGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DIGEST_GET_INSTANCE_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecret.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecret.java index bf277c55..ae16e401 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecret.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecret.java @@ -31,7 +31,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -64,7 +63,6 @@ private JcaKeyAgreementGenerateSecret() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATE_SECRET_1, GENERATE_SECRET_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstance.java index d0cf4059..5abb7941 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstance.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -84,7 +83,6 @@ private JcaKeyAgreementGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(KEY_AGREEMENT1, KEY_AGREEMENT2, KEY_AGREEMENT3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInit.java index a4b7ebd2..0fc3b910 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInit.java @@ -28,7 +28,6 @@ import com.ibm.plugin.rules.detection.jca.algorithmspec.JcaAlgorithmParameterSpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -84,7 +83,6 @@ private JcaKeyAgreementInit() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(KEY_AGREEMENT1, KEY_AGREEMENT2, KEY_AGREEMENT3, KEY_AGREEMENT4); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGenerate.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGenerate.java index 97fda669..5d6d8637 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGenerate.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGenerate.java @@ -31,7 +31,6 @@ import com.ibm.plugin.rules.detection.jca.keyspec.JcaKeySpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeyFactoryGenerate { @@ -64,7 +63,6 @@ private JcaKeyFactoryGenerate() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATE_PRIVATE, GENERATE_PUBLIC); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGetInstance.java index 4c241ec4..3f65180a 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaKeyFactoryGetInstance.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeyFactoryGetInstance { @@ -71,7 +70,6 @@ private JcaKeyFactoryGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(KEY_FACTORY_1, KEY_FACTORY_2, KEY_FACTORY_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGenerateSecret.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGenerateSecret.java index 231cd60d..c3d0f772 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGenerateSecret.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGenerateSecret.java @@ -30,7 +30,6 @@ import com.ibm.plugin.rules.detection.jca.keyspec.JcaKeySpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSecretKeyFactoryGenerateSecret { @@ -51,7 +50,6 @@ private JcaSecretKeyFactoryGenerateSecret() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATE_SECRET_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGetInstance.java index 2b7d7346..ef9c8271 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryGetInstance.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSecretKeyFactoryGetInstance { @@ -85,7 +84,6 @@ private JcaSecretKeyFactoryGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SECRET_KEY_FACTORY_1, SECRET_KEY_FACTORY_2, SECRET_KEY_FACTORY_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryTranslateKey.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryTranslateKey.java index f6f1448e..6420c6cc 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryTranslateKey.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyfactory/JcaSecretKeyFactoryTranslateKey.java @@ -26,7 +26,6 @@ import com.ibm.plugin.rules.detection.jca.keyspec.JcaSecretKeySpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSecretKeyFactoryTranslateKey { @@ -46,7 +45,6 @@ private JcaSecretKeyFactoryTranslateKey() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TRANSLATE_KEY_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorGetInstance.java index 63a48346..bafd71e3 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorGetInstance.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeyGeneratorGetInstance { @@ -72,7 +71,6 @@ private JcaKeyGeneratorGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(KEY_GENERATOR_1, KEY_GENERATOR_2, KEY_GENERATOR_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorInit.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorInit.java index df583863..89c1f86c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorInit.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyGeneratorInit.java @@ -28,7 +28,6 @@ import com.ibm.plugin.rules.detection.jca.parameterspec.JcaParameterSpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeyGeneratorInit { @@ -83,7 +82,6 @@ private JcaKeyGeneratorInit() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorGetInstance.java index 3d83d4fe..d20299e9 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorGetInstance.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeyPairGeneratorGetInstance { @@ -71,7 +70,6 @@ private JcaKeyPairGeneratorGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(KEY_PAIR_GENERATOR_1, KEY_PAIR_GENERATOR_2, KEY_PAIR_GENERATOR_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorInitialize.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorInitialize.java index 192c5c9b..6aa43a5c 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorInitialize.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keygenerator/JcaKeyPairGeneratorInitialize.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.jca.algorithmspec.JcaAlgorithmParameterSpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeyPairGeneratorInitialize { @@ -82,7 +81,6 @@ private JcaKeyPairGeneratorInitialize() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(KEY_PAIR_INIT_1, KEY_PAIR_INIT_2, KEY_PAIR_INIT_3, KEY_PAIR_INIT_4); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESKeySpec.java index 8cba374b..afad2970 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESKeySpec.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDESKeySpec { @@ -60,7 +59,6 @@ private JcaDESKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DES_KEY_SPEC_1, DES_KEY_SPEC_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESedeKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESedeKeySpec.java index d1ac0d80..7aeeb96f 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESedeKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDESedeKeySpec.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDESedeKeySpec { @@ -60,7 +59,6 @@ private JcaDESedeKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DESede_KEY_SPEC_1, DESede_KEY_SPEC_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDHPrivateKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDHPrivateKeySpec.java index d4e5b828..9a46f0de 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDHPrivateKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDHPrivateKeySpec.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDHPrivateKeySpec { @@ -49,7 +48,6 @@ private JcaDHPrivateKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DH_PRIVATE_KEY_SPEC); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDSAPrivateKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDSAPrivateKeySpec.java index 47e37b1b..f443d480 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDSAPrivateKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaDSAPrivateKeySpec.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDSAPrivateKeySpec { @@ -51,7 +50,6 @@ private JcaDSAPrivateKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DSA_PRIVATE_KEY_SPEC); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaECPrivateKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaECPrivateKeySpec.java index 9067717a..6f340643 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaECPrivateKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaECPrivateKeySpec.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.jca.algorithmspec.JcaECGenParameterSpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaECPrivateKeySpec { @@ -48,7 +47,6 @@ private JcaECPrivateKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(EC_PRIVATE_KEY_SPEC); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaKeySpec.java index c10f842a..da209c90 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaKeySpec.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaKeySpec { @@ -31,7 +30,6 @@ private JcaKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of( diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaPBEKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaPBEKeySpec.java index 818969eb..a34a9f04 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaPBEKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaPBEKeySpec.java @@ -31,7 +31,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -81,7 +80,6 @@ private JcaPBEKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(PBE_KEY_SPEC_1, PBE_KEY_SPEC_2, PBE_KEY_SPEC_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaSecretKeySpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaSecretKeySpec.java index 25458e6a..1adb9a08 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaSecretKeySpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/keyspec/JcaSecretKeySpec.java @@ -30,7 +30,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSecretKeySpec { @@ -53,7 +52,6 @@ private JcaSecretKeySpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SECRET_KEY_SPEC_1); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/mac/JcaMacGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/mac/JcaMacGetInstance.java index f3953eab..8dd2ac8d 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/mac/JcaMacGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/mac/JcaMacGetInstance.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaMacGetInstance { @@ -72,7 +71,6 @@ private JcaMacGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(MAC_GET_INSTANCE_1, MAC_GET_INSTANCE_2, MAC_GET_INSTANCE_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaDHParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaDHParameterSpec.java index c299f125..6e506a0a 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaDHParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaDHParameterSpec.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaDHParameterSpec { @@ -62,7 +61,6 @@ private JcaDHParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(DH_PARAMETER_SPEC_1, DH_PARAMETER_SPEC_2); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaParameterSpec.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaParameterSpec.java index d408e3d5..4b710ac7 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaParameterSpec.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/parameterspec/JcaParameterSpec.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaParameterSpec { @@ -32,7 +31,6 @@ private JcaParameterSpec() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return Stream.of(JcaDHParameterSpec.rules().stream()).flatMap(i -> i).toList(); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureAction.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureAction.java index 91620c77..7840f3a2 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureAction.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureAction.java @@ -26,7 +26,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSignatureAction { @@ -57,7 +56,6 @@ private JcaSignatureAction() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SIGN, VERIFY); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureGetInstance.java index 04186702..ca50a828 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureGetInstance.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.stream.Stream; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSignatureGetInstance { @@ -84,7 +83,6 @@ private JcaSignatureGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SIGNATURE_1, SIGNATURE_2, SIGNATURE_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureSetParameter.java b/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureSetParameter.java index 23d887fd..13aaf2fb 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureSetParameter.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/jca/signature/JcaSignatureSetParameter.java @@ -25,7 +25,6 @@ import com.ibm.plugin.rules.detection.jca.algorithmspec.JcaAlgorithmParameterSpec; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class JcaSignatureSetParameter { @@ -45,7 +44,6 @@ private JcaSignatureSetParameter() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SIGNATURE_SET_PARAMETER); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/random/SecureRandomGetInstance.java b/java/src/main/java/com/ibm/plugin/rules/detection/random/SecureRandomGetInstance.java index 91c2dc46..3a554f72 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/random/SecureRandomGetInstance.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/random/SecureRandomGetInstance.java @@ -27,7 +27,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; /** @@ -122,7 +121,6 @@ private SecureRandomGetInstance() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SECURE_RANDOM_1, SECURE_RANDOM_2, SECURE_RANDOM_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLContext.java b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLContext.java index 65918f96..0dcb3352 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLContext.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLContext.java @@ -25,7 +25,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -70,7 +69,6 @@ private SSLContext() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SSLContext_1, SSLContext_2, SSLContext_3); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocols.java b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocols.java index 8c125939..4a987cb7 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocols.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocols.java @@ -25,7 +25,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class SSLParametersSetProtocols { @@ -45,7 +44,6 @@ private SSLParametersSetProtocols() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SSL_SET_PROTOCOLS); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuites.java b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuites.java index e5381005..e61f5054 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuites.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuites.java @@ -25,7 +25,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class SSLServerSocketSetEnabledCipherSuites { @@ -45,7 +44,6 @@ private SSLServerSocketSetEnabledCipherSuites() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SSL_CIPHER_SUITES); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocols.java b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocols.java index 71f3de69..3635f2f7 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocols.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocols.java @@ -25,7 +25,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class SSLServerSocketSetEnabledProtocols { @@ -45,7 +44,6 @@ private SSLServerSocketSetEnabledProtocols() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SSL_PROTOCOLS); diff --git a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLSetParameters.java b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLSetParameters.java index d8959bab..69abc974 100644 --- a/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLSetParameters.java +++ b/java/src/main/java/com/ibm/plugin/rules/detection/ssl/SSLSetParameters.java @@ -24,7 +24,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.tree.Tree; public final class SSLSetParameters { @@ -44,7 +43,6 @@ private SSLSetParameters() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(SSL_PARAMETERS); diff --git a/java/src/main/java/com/ibm/plugin/translation/JavaTranslationProcess.java b/java/src/main/java/com/ibm/plugin/translation/JavaTranslationProcess.java index dc2a64f8..d55f3b82 100644 --- a/java/src/main/java/com/ibm/plugin/translation/JavaTranslationProcess.java +++ b/java/src/main/java/com/ibm/plugin/translation/JavaTranslationProcess.java @@ -30,7 +30,6 @@ import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.java.api.JavaCheck; import org.sonar.plugins.java.api.JavaFileScannerContext; import org.sonar.plugins.java.api.semantic.Symbol; @@ -45,7 +44,7 @@ public JavaTranslationProcess(@Nonnull List reorganizerRules) @Override @Nonnull - public @Unmodifiable List initiate( + public List initiate( @Nonnull DetectionStore rootDetectionStore) { diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAbstractLibraryTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAbstractLibraryTranslator.java index 52b54aaf..ba134e5f 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAbstractLibraryTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAbstractLibraryTranslator.java @@ -27,17 +27,18 @@ import com.ibm.mapper.model.Unknown; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public abstract class JavaAbstractLibraryTranslator implements IContextTranslation { - @NotNull @Override + @Nonnull + @Override public Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { return switch (bundleIdentifier.getIdentifier()) { case "Jca" -> translateJCA(value, detectionContext, detectionLocation); case "Bc" -> translateBC(value, detectionContext, detectionLocation); @@ -45,13 +46,15 @@ public Optional translate( }; } - @NotNull protected abstract Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation); + @Nonnull + protected abstract Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation); - @NotNull protected abstract Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation); + @Nonnull + protected abstract Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation); } diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAlgorithmParameterContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAlgorithmParameterContextTranslator.java index 3ca0264c..9a4ebef3 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAlgorithmParameterContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaAlgorithmParameterContextTranslator.java @@ -30,16 +30,16 @@ import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaAlgorithmParameterContextTranslator extends JavaAbstractLibraryTranslator { @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm) { JcaAlgorithmMapper jcaAlgorithmMapper = new JcaAlgorithmMapper(); return jcaAlgorithmMapper.parse(value.asString(), detectionLocation).map(a -> a); @@ -47,17 +47,18 @@ public final class JavaAlgorithmParameterContextTranslator extends JavaAbstractL return translateCommon(value, detectionContext, detectionLocation); } - @NotNull protected Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + @Nonnull + protected Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { return translateCommon(value, detectionContext, detectionLocation); } - private @NotNull Optional translateCommon( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + private @Nonnull Optional translateCommon( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof KeySize keySize) { KeyLength keyLength = new KeyLength(keySize.getValue(), detectionLocation); return Optional.of(keyLength); diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaCipherContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaCipherContextTranslator.java index 064aad6c..f94c7298 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaCipherContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaCipherContextTranslator.java @@ -52,16 +52,17 @@ import com.ibm.mapper.utils.DetectionLocation; import com.ibm.mapper.utils.Utils; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaCipherContextTranslator extends JavaAbstractLibraryTranslator { @Override - @NotNull public Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + @Nonnull + public Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm) { JcaAlgorithmMapper jcaAlgorithmMapper = new JcaAlgorithmMapper(); return jcaAlgorithmMapper.parse(value.asString(), detectionLocation).map(a -> a); @@ -81,14 +82,15 @@ public final class JavaCipherContextTranslator extends JavaAbstractLibraryTransl } @Override - @NotNull public Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + @Nonnull + public Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof OperationMode operationMode && detectionContext instanceof DetectionContext context) { - String kind = context.get("kind").map(k -> k).orElse(""); + String kind = context.get("kind").orElse(""); return switch (kind) { case "ENCRYPTION_STATUS" -> { BcOperationModeEncryptionMapper bcCipherOperationModeMapper = diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaDigestContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaDigestContextTranslator.java index cb7d3e5d..9ce169a8 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaDigestContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaDigestContextTranslator.java @@ -35,16 +35,16 @@ import com.ibm.mapper.utils.DetectionLocation; import java.util.List; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaDigestContextTranslator extends JavaAbstractLibraryTranslator { @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm) { JcaMessageDigestMapper messageDigestMapper = new JcaMessageDigestMapper(); return messageDigestMapper @@ -59,10 +59,10 @@ public final class JavaDigestContextTranslator extends JavaAbstractLibraryTransl } @Override - protected @NotNull Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof ValueAction && detectionContext instanceof DetectionContext context) { String kind = context.get("kind").map(k -> k).orElse(""); switch (kind) { @@ -84,7 +84,7 @@ public final class JavaDigestContextTranslator extends JavaAbstractLibraryTransl return bcDigestsMapper.parse(value.asString(), detectionLocation).map(f -> f); } } - } else if (value instanceof com.ibm.engine.model.DigestSize digestSize) { + } else if (value instanceof com.ibm.engine.model.DigestSize digestSize) { return Optional.of(new DigestSize(digestSize.getValue(), detectionLocation)); } return Optional.empty(); diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyAgreementContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyAgreementContextTranslator.java index f3528cb9..94610227 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyAgreementContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyAgreementContextTranslator.java @@ -30,16 +30,16 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaKeyAgreementContextTranslator extends JavaAbstractLibraryTranslator { @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm algorithm) { final JcaAlgorithmMapper jcaAlgorithmMapper = new JcaAlgorithmMapper(); return jcaAlgorithmMapper @@ -57,10 +57,10 @@ public final class JavaKeyAgreementContextTranslator extends JavaAbstractLibrary } @Override - protected @NotNull Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof KeySize keySize) { KeyLength keyLength = new KeyLength(keySize.getValue(), detectionLocation); return Optional.of(keyLength); diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyContextTranslator.java index 0868136a..58068b14 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaKeyContextTranslator.java @@ -46,16 +46,16 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaKeyContextTranslator extends JavaAbstractLibraryTranslator { @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm algorithm) { JcaAlgorithmMapper jcaAlgorithmMapper = new JcaAlgorithmMapper(); return jcaAlgorithmMapper @@ -93,13 +93,13 @@ public final class JavaKeyContextTranslator extends JavaAbstractLibraryTranslato } @Override - protected @NotNull Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof ValueAction valueAction && detectionContext instanceof DetectionContext context) { - String kind = context.get("kind").map(k -> k).orElse(""); + String kind = context.get("kind").orElse(""); switch (kind) { case "DH": BcAgreementMapper bcAgreementMapper = new BcAgreementMapper(); diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaMacContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaMacContextTranslator.java index 3cc4c53d..7b413688 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaMacContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaMacContextTranslator.java @@ -32,19 +32,16 @@ import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaMacContextTranslator extends JavaAbstractLibraryTranslator { - private static final Logger LOGGER = LoggerFactory.getLogger(JavaMacContextTranslator.class); @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof com.ibm.engine.model.Algorithm) { JcaMacMapper jcaMacMapper = new JcaMacMapper(); return jcaMacMapper.parse(value.asString(), detectionLocation).map(a -> a); @@ -61,10 +58,10 @@ public final class JavaMacContextTranslator extends JavaAbstractLibraryTranslato } @Override - protected @NotNull Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof ValueAction valueAction) { BcMacMapper bcMacMapper = new BcMacMapper(); return bcMacMapper.parse(valueAction.asString(), detectionLocation).map(f -> f); diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaPRNGContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaPRNGContextTranslator.java index cf726e91..8ac0dd92 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaPRNGContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaPRNGContextTranslator.java @@ -30,17 +30,18 @@ import com.ibm.mapper.model.Seed; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaPRNGContextTranslator implements IContextTranslation { - @NotNull @Override + @Nonnull + @Override public Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (!bundleIdentifier.getIdentifier().equals("Random")) { return Optional.empty(); } diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaProtocolContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaProtocolContextTranslator.java index e03cef87..1dc6c0ce 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaProtocolContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaProtocolContextTranslator.java @@ -33,17 +33,18 @@ import com.ibm.mapper.model.protocol.TLS; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaProtocolContextTranslator implements IContextTranslation { - @NotNull @Override + @Nonnull + @Override public Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (!bundleIdentifier.getIdentifier().equals("SSL")) { return Optional.empty(); } diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSecretKeyContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSecretKeyContextTranslator.java index 6a805b72..fc5de021 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSecretKeyContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSecretKeyContextTranslator.java @@ -34,16 +34,16 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaSecretKeyContextTranslator extends JavaAbstractLibraryTranslator { @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm algorithm) { JcaAlgorithmMapper jcaAlgorithmMapper = new JcaAlgorithmMapper(); return jcaAlgorithmMapper @@ -67,10 +67,10 @@ public final class JavaSecretKeyContextTranslator extends JavaAbstractLibraryTra } @Override - protected @NotNull Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { return Optional.empty(); } } diff --git a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSignatureContextTranslator.java b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSignatureContextTranslator.java index a3e76dd4..14594c22 100644 --- a/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSignatureContextTranslator.java +++ b/java/src/main/java/com/ibm/plugin/translation/translator/contexts/JavaSignatureContextTranslator.java @@ -37,16 +37,16 @@ import com.ibm.mapper.model.functionality.Verify; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.java.api.tree.Tree; public final class JavaSignatureContextTranslator extends JavaAbstractLibraryTranslator { @Override - protected @NotNull Optional translateJCA( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateJCA( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof com.ibm.engine.model.Algorithm) { final JcaAlgorithmMapper jcaAlgorithmMapper = new JcaAlgorithmMapper(); return jcaAlgorithmMapper.parse(value.asString(), detectionLocation).map(a -> a); @@ -62,13 +62,13 @@ public final class JavaSignatureContextTranslator extends JavaAbstractLibraryTra } @Override - protected @NotNull Optional translateBC( - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + protected @Nonnull Optional translateBC( + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof ValueAction valueAction && detectionContext instanceof DetectionContext context) { - String kind = context.get("kind").map(k -> k).orElse(""); + final String kind = context.get("kind").orElse(""); switch (kind) { case "DSA": BcDsaMapper bcDSAMapper = new BcDsaMapper(); diff --git a/java/src/test/java/com/ibm/plugin/TestBase.java b/java/src/test/java/com/ibm/plugin/TestBase.java index c3eefe15..e3ef54c2 100644 --- a/java/src/test/java/com/ibm/plugin/TestBase.java +++ b/java/src/test/java/com/ibm/plugin/TestBase.java @@ -33,7 +33,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.BeforeEach; import org.slf4j.event.Level; import org.sonar.api.testfixtures.log.LogTesterJUnit5; @@ -50,7 +49,7 @@ public abstract class TestBase extends JavaInventoryRule { private int findingId = 0; - public TestBase(@NotNull List> detectionRules) { + public TestBase(@Nonnull List> detectionRules) { super(detectionRules); } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesExceptParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesExceptParametersTest.java index c0cce7fe..9d051d59 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesExceptParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesExceptParametersTest.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.check.Rule; import org.sonar.java.checks.verifier.CheckVerifier; @@ -54,12 +53,14 @@ public DetectionRuleMatchingExactTypesExceptParametersTest() { tree -> Optional.of( new IAction<>() { - @NotNull @Override + @Nonnull + @Override public Tree getLocation() { return tree; } - @NotNull @Override + @Nonnull + @Override public String asString() { return "chooseShape"; } @@ -68,7 +69,8 @@ public String asString() { "com.ibm.example.DetectionRuleMatchingExactTypesExceptParametersTestFile$Shape") .buildForContext( new IDetectionContext() { - @NotNull @Override + @Nonnull + @Override public Class type() { return IDetectionContext.class; } @@ -80,8 +82,8 @@ public Class type() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesTest.java index 1a728c5b..8e91ef98 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/DetectionRuleMatchingExactTypesTest.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.check.Rule; import org.sonar.java.checks.verifier.CheckVerifier; @@ -54,12 +53,14 @@ public DetectionRuleMatchingExactTypesTest() { objectTreeResolvedValue -> { final IValue testValue = new IValue<>() { - @NotNull @Override + @Nonnull + @Override public Tree getLocation() { return objectTreeResolvedValue.tree(); } - @NotNull @Override + @Nonnull + @Override public String asString() { return "value"; } @@ -68,7 +69,8 @@ public String asString() { }) .buildForContext( new IDetectionContext() { - @NotNull @Override + @Nonnull + @Override public Class type() { return IDetectionContext.class; } @@ -80,8 +82,8 @@ public Class type() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/DetectionWithSubRuleTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/DetectionWithSubRuleTest.java index e214af09..316833e0 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/DetectionWithSubRuleTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/DetectionWithSubRuleTest.java @@ -27,7 +27,6 @@ import com.ibm.plugin.rules.detection.jca.cipher.JcaCipherGetInstance; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.check.Rule; @@ -47,8 +46,8 @@ public DetectionWithSubRuleTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngineTest.java index bf44c685..3b24a03d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcAEADCipherEngineTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { String algorithmName = findingId == 0 ? "AsconEngine" : "Grain128AEADEngine"; String translatedAlgorithmName = findingId == 0 ? "Ascon-128" : "Grain-128AEAD"; @@ -97,7 +97,6 @@ public void asserts( // AuthenticatedEncryption INode authenticatedEncryptionNode = nodes.get(0); assertThat(authenticatedEncryptionNode.getKind()).isEqualTo(AuthenticatedEncryption.class); - // assertThat(authenticatedEncryptionNode.getChildren()).hasSize(findingId == 0 ? 2 : 1); assertThat(authenticatedEncryptionNode.asString()).isEqualTo(translatedAlgorithmName); // Encrypt under AuthenticatedEncryption diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipherTest.java index 12046718..2b074e8b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcCCMBlockCipherTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,12 +58,10 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { - /** - * Optimally, we shouldn't have these direct detections of engines, as they appear in the - * depending detection rules - */ + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { + // Optimally, we shouldn't have these direct detections of engines, as they appear in the + // depending detection rules if (findingId == 0 || findingId == 2) { return; } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305Test.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305Test.java index 2c54480b..3fc6374d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305Test.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcChaCha20Poly1305Test.java @@ -38,7 +38,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -60,8 +60,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipherTest.java index bdc24cbc..d9696dd3 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcEAXBlockCipherTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipherTest.java index 10633e99..26133cf3 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMBlockCipherTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipherTest.java index de017918..b69b0f91 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcGCMSIVBlockCipherTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipherTest.java index bd34138c..c4825c7a 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKCCMBlockCipherTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipherTest.java index c9662b6a..ac2c5d1b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcKGCMBlockCipherTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipherTest.java index 01ea811a..55933623 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/aeadcipher/BcOCBBlockCipherTest.java @@ -37,7 +37,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipherTest.java index 503c11df..fb2ec319 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcAsymmetricBlockCipherTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipherTest.java index 076acc5b..4753a050 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcBufferedAsymmetricBlockCipherTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1EncodingTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1EncodingTest.java index 04122212..89f62cda 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1EncodingTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcISO9796d1EncodingTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncodingTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncodingTest.java index 386bec7a..43c56f3d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncodingTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcOAEPEncodingTest.java @@ -24,7 +24,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -47,8 +47,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // TODO: } } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1EncodingTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1EncodingTest.java index e4f83da1..a32b5a6d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1EncodingTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/asymmetricblockcipher/BcPKCS1EncodingTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcECDHBasicAgreementTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcECDHBasicAgreementTest.java index 662d3e35..6983891a 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcECDHBasicAgreementTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/basicagreement/BcECDHBasicAgreementTest.java @@ -24,7 +24,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -46,8 +46,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // TODO: } } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcCBCBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcCBCBlockCipherTest.java index 5516ba55..56008bb7 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcCBCBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcCBCBlockCipherTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Optimally, we shouldn't have these direct detections of engines, as they appear in * the depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcG3413CFBBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcG3413CFBBlockCipherTest.java index c3d0d318..05859103 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcG3413CFBBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/blockcipher/BcG3413CFBBlockCipherTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcCTSBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcCTSBlockCipherTest.java index f271be9c..cb10b302 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcCTSBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcCTSBlockCipherTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcDefaultBufferedBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcDefaultBufferedBlockCipherTest.java index 4696efda..98554710 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcDefaultBufferedBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcDefaultBufferedBlockCipherTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcNISTCTSBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcNISTCTSBlockCipherTest.java index 24321a61..8ce4b55b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcNISTCTSBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcNISTCTSBlockCipherTest.java @@ -20,7 +20,6 @@ package com.ibm.plugin.rules.detection.bc.bufferedblockcipher; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertThat; import com.ibm.engine.detection.DetectionStore; import com.ibm.engine.model.IValue; @@ -34,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherCustomPaddingTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherCustomPaddingTest.java index 01039378..0b45ebe9 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherCustomPaddingTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherCustomPaddingTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherTest.java index dd8e97e9..d76376c5 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/bufferedblockcipher/BcPaddedBufferedBlockCipherTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParametersTest.java index 6a0cf178..bd58fb10 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcAEADParametersTest.java @@ -37,7 +37,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParametersTest.java index 73307eb1..b4b2fc9d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCCMParametersTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParametersTest.java index 065668b9..2c686c0e 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcCramerShoupParametersTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParametersTest.java index d7f48098..160d7b7e 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcGMSSParametersTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParametersTest.java index 5661a4f4..1c9221bc 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcIESParametersTest.java @@ -37,7 +37,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParametersTest.java index 58ac0001..7a480844 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcKeyParametersTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUParametersTest.java index 4ba31fb3..3d2e4179 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcNTRUParametersTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWithTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWithTest.java index b3bfcd03..9eddd850 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWithTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcParametersWithTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParametersTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParametersTest.java index 9a7cf5eb..04ce2094 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParametersTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/cipherparameters/BcSABERParametersTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHKDFBytesGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHKDFBytesGeneratorTest.java index ef069887..66d22961 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHKDFBytesGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHKDFBytesGeneratorTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHandshakeKDFFunctionTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHandshakeKDFFunctionTest.java index 71445b0d..bb80cb91 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHandshakeKDFFunctionTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcHandshakeKDFFunctionTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcKDFCounterBytesGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcKDFCounterBytesGeneratorTest.java index c6047a6d..7bcbb8b1 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcKDFCounterBytesGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcKDFCounterBytesGeneratorTest.java @@ -39,7 +39,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -61,8 +61,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcMGF1BytesGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcMGF1BytesGeneratorTest.java index 5a858294..a211f802 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcMGF1BytesGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/derivationfunction/BcMGF1BytesGeneratorTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSATest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSATest.java index 31599412..1ed61381 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSATest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/dsa/BcDSATest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcBIKEKEMExtractorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcBIKEKEMExtractorTest.java index c3c4a313..0d66bbf6 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcBIKEKEMExtractorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcBIKEKEMExtractorTest.java @@ -31,7 +31,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMExtractorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMExtractorTest.java index 9f996425..6d4d57be 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMExtractorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMExtractorTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMGeneratorTest.java index a9a1bb09..58a086d4 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcECIESKEMGeneratorTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcKyberKEMGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcKyberKEMGeneratorTest.java index 505d35d3..f65979c1 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcKyberKEMGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcKyberKEMGeneratorTest.java @@ -31,7 +31,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMExtractorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMExtractorTest.java index 3807b769..7884c318 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMExtractorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMExtractorTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMGeneratorTest.java index bb8a586c..209e6762 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/encapsulatedsecret/BcRSAKEMGeneratorTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlake3MacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlake3MacTest.java index 164cb261..e9e57100 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlake3MacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlake3MacTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlockCipherMacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlockCipherMacTest.java index e31cccef..cdb18724 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlockCipherMacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcBlockCipherMacTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCBCBlockCipherMacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCBCBlockCipherMacTest.java index 7acb9802..1087888d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCBCBlockCipherMacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCBCBlockCipherMacTest.java @@ -39,7 +39,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -60,8 +60,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCFBBlockCipherMacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCFBBlockCipherMacTest.java index ce7db5ee..812f50c7 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCFBBlockCipherMacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCFBBlockCipherMacTest.java @@ -37,7 +37,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCMACTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCMACTest.java index 5575e3e1..daf3596e 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCMACTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcCMACTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcDSTUMACTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcDSTUMACTest.java index 94ac1228..da03c00b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcDSTUMACTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcDSTUMACTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGMACTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGMACTest.java index d3e51baa..215b2eb6 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGMACTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGMACTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGOST28147MacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGOST28147MacTest.java index 9dddb397..926763f3 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGOST28147MacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcGOST28147MacTest.java @@ -31,7 +31,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -52,8 +52,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcHMACTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcHMACTest.java index ef777903..aba7ce5a 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcHMACTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcHMACTest.java @@ -37,7 +37,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcISO9797Alg3MacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcISO9797Alg3MacTest.java index a690c288..c4815d10 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcISO9797Alg3MacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcISO9797Alg3MacTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKGMACTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKGMACTest.java index 63b496e6..a16d4a90 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKGMACTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKGMACTest.java @@ -37,7 +37,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKMACTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKMACTest.java index 60f90fd4..1eac6f1f 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKMACTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcKMACTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcPoly1305Test.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcPoly1305Test.java index cbeb779e..a4fa7986 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcPoly1305Test.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcPoly1305Test.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSipHash128Test.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSipHash128Test.java index e1b10ab1..6cda120f 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSipHash128Test.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSipHash128Test.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSkeinMacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSkeinMacTest.java index cebfc17c..3b88f849 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSkeinMacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcSkeinMacTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcVMPCMacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcVMPCMacTest.java index dd3e3009..62dde2c5 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcVMPCMacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcVMPCMacTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcZuc256MacTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcZuc256MacTest.java index 5139a027..a06e9487 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcZuc256MacTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/mac/BcZuc256MacTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineTest.java index 13e8440e..5f5dbe65 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcIESEngineTest.java @@ -43,7 +43,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -64,8 +64,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 0 || findingId == 1 || findingId == 2) { return; } diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineTest.java index e48512c8..e451c90f 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/other/BcSM2EngineTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // This first finding comes from JCA and is covered in another test if (findingId == 0) { return; diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcOpenSSLPBEParametersGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcOpenSSLPBEParametersGeneratorTest.java index 588a87e9..0941fc44 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcOpenSSLPBEParametersGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcOpenSSLPBEParametersGeneratorTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcPKCS5S1ParametersGeneratorTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcPKCS5S1ParametersGeneratorTest.java index 0f10e469..954270a1 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcPKCS5S1ParametersGeneratorTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/pbe/BcPKCS5S1ParametersGeneratorTest.java @@ -36,7 +36,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -58,8 +58,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSignerTest.java index 268fb1e0..a8f0495d 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDSADigestSignerTest.java @@ -38,7 +38,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingMessageSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingMessageSignerTest.java index 23663351..f245c9a9 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingMessageSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingMessageSignerTest.java @@ -40,7 +40,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -62,8 +62,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingStateAwareMessageSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingStateAwareMessageSignerTest.java index b9d0386f..6059f824 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingStateAwareMessageSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcDigestingStateAwareMessageSignerTest.java @@ -39,7 +39,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -61,8 +61,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcEd25519ctxSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcEd25519ctxSignerTest.java index 6bccc2ae..971bc6b1 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcEd25519ctxSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcEd25519ctxSignerTest.java @@ -38,7 +38,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSignerTest.java index ae368f30..c7af8a18 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcGenericSignerTest.java @@ -40,7 +40,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -61,8 +61,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSignerTest.java index 0c8c5e4b..c35d9bd5 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2PSSSignerTest.java @@ -43,7 +43,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -65,8 +65,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 0 || findingId == 1) { return; diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2SignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2SignerTest.java index 105290a1..f9cb34ad 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2SignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcISO9796d2SignerTest.java @@ -41,7 +41,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -62,8 +62,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSignerTest.java index b9e3efe8..7490e5ea 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcPSSSignerTest.java @@ -41,7 +41,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -62,8 +62,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSignerTest.java index 0aec9491..1d5a849b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcRSADigestSignerTest.java @@ -38,7 +38,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2SignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2SignerTest.java index 997cfd99..71aefa40 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2SignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcSM2SignerTest.java @@ -38,7 +38,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -59,8 +59,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcX931SignerTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcX931SignerTest.java index 7390995d..d8208243 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcX931SignerTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/signer/BcX931SignerTest.java @@ -41,7 +41,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -62,8 +62,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcChaChaEngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcChaChaEngineTest.java index 3552ef30..aa8c1355 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcChaChaEngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/streamcipher/BcChaChaEngineTest.java @@ -32,7 +32,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcAESWrapEngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcAESWrapEngineTest.java index 27caf24b..561bb96e 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcAESWrapEngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcAESWrapEngineTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcDSTU7624WrapEngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcDSTU7624WrapEngineTest.java index 33885f6c..1b9f2906 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcDSTU7624WrapEngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcDSTU7624WrapEngineTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcRFC3394WrapEngineTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcRFC3394WrapEngineTest.java index f60466c3..c5e4dbe4 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcRFC3394WrapEngineTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/bc/wrapper/BcRFC3394WrapEngineTest.java @@ -35,7 +35,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * Optimally, we shouldn't have these direct detections of engines, as they appear in the * depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstanceTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstanceTest.java index 15c4e6cf..db7110c0 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstanceTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorGetInstanceTest.java @@ -30,7 +30,7 @@ import com.ibm.mapper.model.algorithms.DH; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -52,8 +52,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInitTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInitTest.java index 6879e3d4..336c2bd4 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInitTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmparametergenerator/JcaAlgorithmParameterGeneratorInitTest.java @@ -32,7 +32,7 @@ import com.ibm.mapper.model.PublicKeyEncryption; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpecTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpecTest.java index 215ee3d8..a826603c 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpecTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/algorithmspec/JcaDHGenParameterSpecTest.java @@ -32,7 +32,7 @@ import com.ibm.mapper.model.algorithms.DH; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretAlgorithmTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretAlgorithmTest.java index 20cb31e4..c5b1a059 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretAlgorithmTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretAlgorithmTest.java @@ -35,7 +35,7 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretKeySizeTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretKeySizeTest.java index 6ddf2386..aa98d9a8 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretKeySizeTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretKeySizeTest.java @@ -32,7 +32,7 @@ import com.ibm.mapper.model.Oid; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -54,8 +54,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretTest.java index b0644d19..34e82b8f 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGenerateSecretTest.java @@ -30,7 +30,7 @@ import com.ibm.mapper.model.Oid; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -52,8 +52,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstanceTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstanceTest.java index e682a3a8..34e89c20 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstanceTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementGetInstanceTest.java @@ -29,7 +29,7 @@ import com.ibm.mapper.model.KeyLength; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -51,8 +51,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInitTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInitTest.java index 69d2f8ae..6a7107fa 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInitTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/jca/keyagreement/JcaKeyAgreementInitTest.java @@ -31,7 +31,7 @@ import com.ibm.mapper.model.KeyLength; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -53,8 +53,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLContextGetInstanceTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLContextGetInstanceTest.java index c999898f..9f83a8bf 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLContextGetInstanceTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLContextGetInstanceTest.java @@ -30,7 +30,7 @@ import com.ibm.mapper.model.protocol.TLS; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocolsTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocolsTest.java index 4336318f..b181163c 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocolsTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLParametersSetProtocolsTest.java @@ -30,7 +30,7 @@ import com.ibm.mapper.model.protocol.TLS; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -55,8 +55,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuitesTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuitesTest.java index 676a1ebb..d69ca16f 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuitesTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledCipherSuitesTest.java @@ -31,7 +31,7 @@ import com.ibm.mapper.model.protocol.TLS; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -57,8 +57,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocolsTest.java b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocolsTest.java index bf2d0dab..e95b9e4b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocolsTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/detection/ssl/SSLServerSocketSetEnabledProtocolsTest.java @@ -30,7 +30,7 @@ import com.ibm.mapper.model.protocol.TLS; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingFindingsTest.java b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingFindingsTest.java index 54966508..e4307d73 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingFindingsTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingFindingsTest.java @@ -33,7 +33,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; @@ -69,8 +69,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 0) { return; } diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRules2Test.java b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRules2Test.java index 3ed4d6c4..065a6524 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRules2Test.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRules2Test.java @@ -36,7 +36,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -48,7 +47,8 @@ class DuplicateDependingRules2Test extends TestBase { static IDetectionContext detectionContext = new IDetectionContext() { - @NotNull @Override + @Nonnull + @Override public Class type() { return IDetectionContext.class; } @@ -86,8 +86,8 @@ public DuplicateDependingRules2Test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRulesTest.java b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRulesTest.java index 99b7d968..bbd511d2 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRulesTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateDependingRulesTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; @@ -75,8 +75,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 0) { return; } diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParameterFindingsTest.java b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParameterFindingsTest.java index 5a2343c1..3ad9a830 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParameterFindingsTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParameterFindingsTest.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -66,8 +66,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 0) { return; } diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParametersFinding2Test.java b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParametersFinding2Test.java index 061262c0..a990331b 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParametersFinding2Test.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/DuplicateParametersFinding2Test.java @@ -34,7 +34,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -46,7 +45,8 @@ class DuplicateParametersFinding2Test extends TestBase { static IDetectionContext detectionContext = new IDetectionContext() { - @NotNull @Override + @Nonnull + @Override public Class type() { return IDetectionContext.class; } @@ -98,8 +98,8 @@ public DuplicateParametersFinding2Test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /* * Detection Store */ diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/Issue16Test.java b/java/src/test/java/com/ibm/plugin/rules/issues/Issue16Test.java index 0c326806..b8bbffbe 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/Issue16Test.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/Issue16Test.java @@ -34,7 +34,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -56,8 +56,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 0) { /* * Detection Store diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/NextParameterDependingRulesTest.java b/java/src/test/java/com/ibm/plugin/rules/issues/NextParameterDependingRulesTest.java index 23ba8ec8..275db310 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/NextParameterDependingRulesTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/NextParameterDependingRulesTest.java @@ -29,7 +29,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -61,8 +61,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { if (findingId == 1 || findingId == 3) { // Detections of AES alone (not interesting) return; diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/ParameterValuesNotCapturedTest.java b/java/src/test/java/com/ibm/plugin/rules/issues/ParameterValuesNotCapturedTest.java index 2f260cd7..96144190 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/ParameterValuesNotCapturedTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/ParameterValuesNotCapturedTest.java @@ -31,7 +31,7 @@ import com.ibm.plugin.TestBase; import com.ibm.plugin.rules.detection.bc.BouncyCastleJars; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; @@ -64,8 +64,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { /** * TODO: Optimally, we shouldn't have these direct detections of engines, as they appear in * the depending detection rules diff --git a/java/src/test/java/com/ibm/plugin/rules/issues/StackOverFlowAssignmentTest.java b/java/src/test/java/com/ibm/plugin/rules/issues/StackOverFlowAssignmentTest.java index d8c7cfbf..ba5d97ff 100644 --- a/java/src/test/java/com/ibm/plugin/rules/issues/StackOverFlowAssignmentTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/issues/StackOverFlowAssignmentTest.java @@ -23,7 +23,7 @@ import com.ibm.mapper.model.INode; import com.ibm.plugin.TestBase; import java.util.List; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.junit.jupiter.api.Test; import org.sonar.java.checks.verifier.CheckVerifier; import org.sonar.plugins.java.api.JavaCheck; @@ -43,8 +43,8 @@ void test() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing // this test is successful if not stack overflow exception is town } diff --git a/java/src/test/java/com/ibm/plugin/rules/resolve/ResolveDoubleSymbolReferenceTest.java b/java/src/test/java/com/ibm/plugin/rules/resolve/ResolveDoubleSymbolReferenceTest.java index 2acdd0d2..a71e8e90 100644 --- a/java/src/test/java/com/ibm/plugin/rules/resolve/ResolveDoubleSymbolReferenceTest.java +++ b/java/src/test/java/com/ibm/plugin/rules/resolve/ResolveDoubleSymbolReferenceTest.java @@ -22,7 +22,11 @@ import static org.assertj.core.api.Assertions.assertThat; import com.ibm.engine.detection.DetectionStore; -import com.ibm.engine.model.*; +import com.ibm.engine.model.Algorithm; +import com.ibm.engine.model.CipherAction; +import com.ibm.engine.model.IValue; +import com.ibm.engine.model.KeySize; +import com.ibm.engine.model.OperationMode; import com.ibm.engine.model.context.CipherContext; import com.ibm.engine.model.context.SecretKeyContext; import com.ibm.mapper.model.INode; diff --git a/java/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java b/java/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java index df712049..95fb647a 100644 --- a/java/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java +++ b/java/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java @@ -32,7 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.plugins.java.api.JavaCheck; @@ -60,8 +60,8 @@ public class GenerateAssertsHelper { * @param translationRoots - The list of root nodes of translation trees */ public static void generate( - @NotNull DetectionStore detectionStore, - @NotNull List translationRoots) { + @Nonnull DetectionStore detectionStore, + @Nonnull List translationRoots) { // Create a directories if they do not yet exist try { Files.createDirectories(Paths.get(filePath)); diff --git a/mapper/src/main/java/com/ibm/mapper/ITranslator.java b/mapper/src/main/java/com/ibm/mapper/ITranslator.java index 572a8728..05abe5b0 100644 --- a/mapper/src/main/java/com/ibm/mapper/ITranslator.java +++ b/mapper/src/main/java/com/ibm/mapper/ITranslator.java @@ -34,7 +34,6 @@ import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; public abstract class ITranslator { @@ -189,7 +188,7 @@ private void translateAndAppend( private void append( @Nonnull List parentNodes, @Nonnull List newNodesCollection) { - @Unmodifiable + final List copyParentNodes = List.copyOf(parentNodes); // copy of references for (INode parentNode : copyParentNodes) { newNodesCollection.forEach( diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcBufferedBlockCipherMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcBufferedBlockCipherMapper.java index 63b55a9f..63af3c4b 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcBufferedBlockCipherMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcBufferedBlockCipherMapper.java @@ -62,9 +62,9 @@ private Optional map( Utils.unknownWithPadding( new PKCS7(detectionLocation), BlockCipher.class)); case "BufferedBlockCipher", - "DefaultBufferedBlockCipher", - "PaddedBlockCipher", - "PaddedBufferedBlockCipher" -> + "DefaultBufferedBlockCipher", + "PaddedBlockCipher", + "PaddedBufferedBlockCipher" -> Optional.of(Utils.unknown(BlockCipher.class, detectionLocation)); default -> { Mode mode = new Mode(blockCipherString, detectionLocation); diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcSignatureMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcSignatureMapper.java index 6354bfcb..d5e7083e 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcSignatureMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/bc/BcSignatureMapper.java @@ -55,9 +55,9 @@ private Optional map( @Nonnull String signerString, @Nonnull DetectionLocation detectionLocation) { return switch (signerString) { case "DigestingMessageSigner", - "DigestingStateAwareMessageSigner", - "GenericSigner", - "DSADigestSigner" -> + "DigestingStateAwareMessageSigner", + "GenericSigner", + "DSADigestSigner" -> Optional.of( new Algorithm(ITranslator.UNKNOWN, Signature.class, detectionLocation)); case "Ed25519ctxSigner" -> Optional.of(new Ed25519(detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaCurveMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaCurveMapper.java index a6129434..6eacf143 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaCurveMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaCurveMapper.java @@ -31,14 +31,15 @@ import com.ibm.mapper.model.curves.Secp521r1; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class JcaCurveMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaPRNGMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaPRNGMapper.java index 171b67ca..83daa75a 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaPRNGMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/jca/JcaPRNGMapper.java @@ -44,10 +44,10 @@ public Optional parse( return switch (str.toUpperCase().trim()) { case "NATIVEPRNG", - "DRBG", - "NATIVEPRNGBLOCKING", - "NATIVEPRNGNONBLOCKING", - "WINDOWS-PRNG" -> + "DRBG", + "NATIVEPRNGBLOCKING", + "NATIVEPRNGNONBLOCKING", + "WINDOWS-PRNG" -> Optional.empty(); // todo default -> Optional.empty(); }; diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaCipherMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaCipherMapper.java index 2d4d727e..6c7ad44a 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaCipherMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaCipherMapper.java @@ -36,14 +36,14 @@ import com.ibm.mapper.model.algorithms.cast.CAST128; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class PycaCipherMapper implements IMapper { @Override - public @NotNull Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional parse( + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaDigestMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaDigestMapper.java index 39a24994..fb8d4fba 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaDigestMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaDigestMapper.java @@ -32,13 +32,13 @@ import com.ibm.mapper.model.algorithms.shake.SHAKE; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class PycaDigestMapper implements IMapper { @Override - public @NotNull Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional parse( + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaMacMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaMacMapper.java index 6e1e54d2..90e4b145 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaMacMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/pyca/PycaMacMapper.java @@ -26,6 +26,7 @@ import com.ibm.mapper.model.algorithms.Blowfish; import com.ibm.mapper.model.algorithms.Camellia; import com.ibm.mapper.model.algorithms.ChaCha20; +import com.ibm.mapper.model.algorithms.Fernet; import com.ibm.mapper.model.algorithms.IDEA; import com.ibm.mapper.model.algorithms.MD5; import com.ibm.mapper.model.algorithms.Poly1305; @@ -40,17 +41,18 @@ import com.ibm.mapper.model.algorithms.TripleDES; import com.ibm.mapper.model.algorithms.blake.BLAKE2b; import com.ibm.mapper.model.algorithms.blake.BLAKE2s; +import com.ibm.mapper.model.algorithms.cast.CAST128; import com.ibm.mapper.model.algorithms.shake.SHAKE; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public class PycaMacMapper implements IMapper { @Override - public @NotNull Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional parse( + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } @@ -63,7 +65,7 @@ public class PycaMacMapper implements IMapper { Optional.of(new Camellia(Mac.class, new Camellia(detectionLocation))); case "TRIPLEDES" -> Optional.of(new TripleDES(Mac.class, new TripleDES(detectionLocation))); - case "CAST5" -> Optional.empty(); // TODO: create algorithm object + case "CAST5" -> Optional.of(new CAST128(Mac.class, new CAST128(detectionLocation))); case "SEED" -> Optional.of(new SEED(Mac.class, new SEED(detectionLocation))); case "SM4" -> Optional.of(new SM4(Mac.class, new SM4(detectionLocation))); case "BLOWFISH" -> @@ -72,7 +74,7 @@ public class PycaMacMapper implements IMapper { case "CHACHA20" -> Optional.of(new ChaCha20(Mac.class, new ChaCha20(detectionLocation))); case "ARC4" -> Optional.of(new RC4(Mac.class, new RC4(detectionLocation))); - case "FERNET" -> Optional.empty(); // TODO: create algorithm object + case "FERNET" -> Optional.of(new Fernet(Mac.class, new Fernet(detectionLocation))); case "RSA" -> Optional.of(new RSA(Mac.class, detectionLocation)); case "SHA1" -> Optional.of(new SHA(Mac.class, new SHA(detectionLocation))); case "SHA512_224" -> diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/AuthenticationAlgorithmMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/AuthenticationAlgorithmMapper.java index 100dea27..3d61c525 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/AuthenticationAlgorithmMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/AuthenticationAlgorithmMapper.java @@ -32,15 +32,16 @@ import com.ibm.mapper.model.algorithms.gost.GOSTR341012; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; // authentication mechanism during the handshake. public final class AuthenticationAlgorithmMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/CipherSuiteMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/CipherSuiteMapper.java index d87b61c7..7c1992d3 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/CipherSuiteMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/CipherSuiteMapper.java @@ -35,14 +35,14 @@ import java.util.List; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nullable; public final class CipherSuiteMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/EncryptionAlgorithmMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/EncryptionAlgorithmMapper.java index 0862704f..02b433d3 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/EncryptionAlgorithmMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/EncryptionAlgorithmMapper.java @@ -42,14 +42,15 @@ import com.ibm.mapper.model.mode.MGM; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class EncryptionAlgorithmMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/HashAlgorithmMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/HashAlgorithmMapper.java index c063a36d..abad5b32 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/HashAlgorithmMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/HashAlgorithmMapper.java @@ -28,14 +28,15 @@ import com.ibm.mapper.model.algorithms.gost.GOSTR341112; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class HashAlgorithmMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/KeyExchangeAlgorithmMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/KeyExchangeAlgorithmMapper.java index 455dd4d5..f93b9b6f 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/KeyExchangeAlgorithmMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/KeyExchangeAlgorithmMapper.java @@ -32,14 +32,15 @@ import com.ibm.mapper.model.algorithms.gost.GOSTR341112; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class KeyExchangeAlgorithmMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/SSLVersionMapper.java b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/SSLVersionMapper.java index 6d818232..7c4a9e40 100644 --- a/mapper/src/main/java/com/ibm/mapper/mapper/ssl/SSLVersionMapper.java +++ b/mapper/src/main/java/com/ibm/mapper/mapper/ssl/SSLVersionMapper.java @@ -25,13 +25,14 @@ import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; public final class SSLVersionMapper implements IMapper { - @NotNull @Override + @Nonnull + @Override public Optional parse( - @Nullable String str, @NotNull DetectionLocation detectionLocation) { + @Nullable String str, @Nonnull DetectionLocation detectionLocation) { if (str == null) { return Optional.empty(); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/Algorithm.java b/mapper/src/main/java/com/ibm/mapper/model/Algorithm.java index 0ea1a214..094b8725 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/Algorithm.java +++ b/mapper/src/main/java/com/ibm/mapper/model/Algorithm.java @@ -25,7 +25,6 @@ import java.util.Objects; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Algorithm implements IAlgorithm { @Nonnull protected final Map, INode> children; @@ -73,7 +72,7 @@ public int hashCode() { } @Nonnull - public @NotNull String getName() { + public String getName() { return name; } @@ -101,7 +100,7 @@ public Optional hasChildOfType(@Nonnull Class nodeType) } @Override - public void removeChildOfType(@NotNull Class nodeType) { + public void removeChildOfType(@Nonnull Class nodeType) { this.children.remove(nodeType); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/CipherSuite.java b/mapper/src/main/java/com/ibm/mapper/model/CipherSuite.java index b6efa980..97179ea6 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/CipherSuite.java +++ b/mapper/src/main/java/com/ibm/mapper/model/CipherSuite.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public final class CipherSuite implements IAsset { @Nonnull private final Map, INode> children; @@ -120,7 +119,7 @@ public Optional hasChildOfType(@Nonnull Class nodeType) } @Override - public void removeChildOfType(@NotNull Class nodeType) { + public void removeChildOfType(@Nonnull Class nodeType) { this.children.remove(nodeType); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/IPrimitive.java b/mapper/src/main/java/com/ibm/mapper/model/IPrimitive.java index 374d8cc3..de9dfa79 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/IPrimitive.java +++ b/mapper/src/main/java/com/ibm/mapper/model/IPrimitive.java @@ -21,12 +21,10 @@ import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; public interface IPrimitive extends IAlgorithm { @Nonnull - @Unmodifiable static List> getKinds() { return List.of( AuthenticatedEncryption.class, diff --git a/mapper/src/main/java/com/ibm/mapper/model/Key.java b/mapper/src/main/java/com/ibm/mapper/model/Key.java index 861e64b6..9927ecd5 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/Key.java +++ b/mapper/src/main/java/com/ibm/mapper/model/Key.java @@ -25,7 +25,6 @@ import java.util.Objects; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Key implements IAsset { @Nonnull protected final Map, INode> children; @@ -117,7 +116,7 @@ public Optional hasChildOfType(@Nonnull Class nodeType) } @Override - public void removeChildOfType(@NotNull Class nodeType) { + public void removeChildOfType(@Nonnull Class nodeType) { this.children.remove(nodeType); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/Property.java b/mapper/src/main/java/com/ibm/mapper/model/Property.java index 1cb7f4cd..5fcae679 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/Property.java +++ b/mapper/src/main/java/com/ibm/mapper/model/Property.java @@ -25,7 +25,6 @@ import java.util.Objects; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public abstract class Property implements IProperty { @Nonnull protected final Class type; @@ -89,7 +88,7 @@ public Optional hasChildOfType(@Nonnull Class nodeType) } @Override - public void removeChildOfType(@NotNull Class nodeType) { + public void removeChildOfType(@Nonnull Class nodeType) { this.children.remove(nodeType); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/Protocol.java b/mapper/src/main/java/com/ibm/mapper/model/Protocol.java index f9d6e52b..8ea41ed9 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/Protocol.java +++ b/mapper/src/main/java/com/ibm/mapper/model/Protocol.java @@ -24,7 +24,6 @@ import java.util.Map; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Protocol implements IAsset { @Nonnull protected final Map, INode> children; @@ -89,7 +88,8 @@ public String asString() { return type; } - @NotNull @Override + @Nonnull + @Override public DetectionLocation getDetectionContext() { return detectionLocation; } @@ -106,7 +106,7 @@ public Optional hasChildOfType(@Nonnull Class nodeType) } @Override - public void removeChildOfType(@NotNull Class nodeType) { + public void removeChildOfType(@Nonnull Class nodeType) { this.children.remove(nodeType); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/Unknown.java b/mapper/src/main/java/com/ibm/mapper/model/Unknown.java index feee332f..1ad7966d 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/Unknown.java +++ b/mapper/src/main/java/com/ibm/mapper/model/Unknown.java @@ -21,7 +21,6 @@ import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public final class Unknown extends Property implements IPrimitive { @@ -46,7 +45,8 @@ public int hashCode() { return detectionLocation.hashCode(); } - @NotNull @Override + @Nonnull + @Override public String asString() { return "Unknown"; } @@ -57,7 +57,8 @@ public String toString() { return this.asString(); } - @NotNull @Override + @Nonnull + @Override public INode deepCopy() { Unknown copy = new Unknown(this); for (INode child : this.children.values()) { @@ -66,7 +67,8 @@ public INode deepCopy() { return copy; } - @NotNull @Override + @Nonnull + @Override public String getName() { return this.asString(); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/AES.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/AES.java index 47c304f6..e619cf37 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/AES.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/AES.java @@ -31,7 +31,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -58,7 +57,7 @@ public final class AES extends Algorithm private static final String NAME = "AES"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { final StringBuilder sb = new StringBuilder(this.name); this.hasChildOfType(KeyLength.class).ifPresent(k -> sb.append(k.asString())); this.hasChildOfType(Mode.class).ifPresent(m -> sb.append("-").append(m.asString())); @@ -66,21 +65,21 @@ public final class AES extends Algorithm return sb.toString(); } - public AES(@NotNull DetectionLocation detectionLocation) { + public AES(@Nonnull DetectionLocation detectionLocation) { this(BlockCipher.class, detectionLocation); } - public AES(int keyLength, @NotNull DetectionLocation detectionLocation) { + public AES(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public AES(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public AES(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } - public AES(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public AES(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -90,7 +89,7 @@ public AES( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -103,7 +102,7 @@ public AES(@Nonnull final Class asKind, @Nonnull AES aes) public AES( @Nonnull final Class asKind, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { super(NAME, asKind, detectionLocation); this.put(new BlockSize(128, detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX931.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX931.java index 9fecfd34..68f0baab 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX931.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX931.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -46,7 +46,7 @@ public final class ANSIX931 extends Algorithm implements Signature { private static final String NAME = "ANSI X9.31"; - public ANSIX931(@NotNull DetectionLocation detectionLocation) { + public ANSIX931(@Nonnull DetectionLocation detectionLocation) { super(NAME, Signature.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX942.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX942.java index b4907894..af145109 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX942.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX942.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.KeyDerivationFunction; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -46,7 +46,7 @@ public final class ANSIX942 extends Algorithm implements KeyDerivationFunction { private static final String NAME = "ANSI X9.42"; - public ANSIX942(@NotNull DetectionLocation detectionLocation) { + public ANSIX942(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyDerivationFunction.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX963.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX963.java index 7fbf51b7..4e7d02f7 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX963.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ANSIX963.java @@ -23,7 +23,7 @@ import com.ibm.mapper.model.KeyDerivationFunction; import com.ibm.mapper.model.MessageDigest; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,11 +47,11 @@ public final class ANSIX963 extends Algorithm implements KeyDerivationFunction { private static final String NAME = "ANSI X9.63"; - public ANSIX963(@NotNull DetectionLocation detectionLocation) { + public ANSIX963(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyDerivationFunction.class, detectionLocation); } - public ANSIX963(@NotNull MessageDigest messageDigest) { + public ANSIX963(@Nonnull MessageDigest messageDigest) { this(messageDigest.getDetectionContext()); this.put(messageDigest); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Aria.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Aria.java index 5d97dab8..c8a7fe06 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Aria.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Aria.java @@ -29,7 +29,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -52,16 +51,16 @@ public final class Aria extends Algorithm implements BlockCipher, AuthenticatedEncryption, KeyWrap { private static final String NAME = "Aria"; - public Aria(@NotNull DetectionLocation detectionLocation) { + public Aria(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); } - public Aria(int keyLength, @NotNull DetectionLocation detectionLocation) { + public Aria(int keyLength, @Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public Aria(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public Aria(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -71,14 +70,14 @@ public Aria( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public Aria(@Nonnull final Class asKind, @NotNull Aria aria) { + public Aria(@Nonnull final Class asKind, @Nonnull Aria aria) { super(aria, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Blowfish.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Blowfish.java index fa1f9009..cb0e5471 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Blowfish.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Blowfish.java @@ -29,7 +29,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -52,17 +51,17 @@ public final class Blowfish extends Algorithm implements BlockCipher, AuthenticatedEncryption, Mac { private static final String NAME = "Blowfish"; - public Blowfish(@NotNull DetectionLocation detectionLocation) { + public Blowfish(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); } - public Blowfish(int keyLength, @NotNull DetectionLocation detectionLocation) { + public Blowfish(int keyLength, @Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } public Blowfish( - int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -72,14 +71,14 @@ public Blowfish( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public Blowfish(@Nonnull final Class asKind, @NotNull Blowfish blowfish) { + public Blowfish(@Nonnull final Class asKind, @Nonnull Blowfish blowfish) { super(blowfish, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/CMAC.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/CMAC.java index d6f2c1b1..86be6443 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/CMAC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/CMAC.java @@ -26,7 +26,6 @@ import com.ibm.mapper.model.Mac; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -49,7 +48,7 @@ public final class CMAC extends Algorithm implements Mac { private static final String NAME = "CMAC"; - public CMAC(@NotNull DetectionLocation detectionLocation) { + public CMAC(@Nonnull DetectionLocation detectionLocation) { super(NAME, Mac.class, detectionLocation); } @@ -59,7 +58,7 @@ public CMAC(@Nonnull Cipher cipher) { } @Override - public @NotNull String asString() { + public @Nonnull String asString() { return this.hasChildOfType(BlockCipher.class) .map(node -> ((IAlgorithm) node).getName() + "-" + this.name) .orElse(this.name); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Camellia.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Camellia.java index 1161e233..15b07b2c 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Camellia.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Camellia.java @@ -30,23 +30,22 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public final class Camellia extends Algorithm implements BlockCipher, AuthenticatedEncryption, KeyWrap, Mac { private static final String NAME = "Camellia"; - public Camellia(@NotNull DetectionLocation detectionLocation) { + public Camellia(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); } - public Camellia(int keyLength, @NotNull DetectionLocation detectionLocation) { + public Camellia(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } public Camellia( - int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -56,14 +55,14 @@ public Camellia( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public Camellia(@Nonnull final Class asKind, @NotNull Camellia camellia) { + public Camellia(@Nonnull final Class asKind, @Nonnull Camellia camellia) { super(camellia, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20.java index 0a85a07b..15d4d260 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -51,7 +50,7 @@ public final class ChaCha20 extends Algorithm implements StreamCipher { private static final String NAME = "ChaCha20"; - public ChaCha20(@NotNull DetectionLocation detectionLocation) { + public ChaCha20(@Nonnull DetectionLocation detectionLocation) { super(NAME, StreamCipher.class, detectionLocation); } @@ -65,19 +64,19 @@ public String asString() { .orElse(this.name); } - public ChaCha20(int keyLength, @NotNull DetectionLocation detectionLocation) { + public ChaCha20(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } public ChaCha20( - int keyLength, @Nonnull Padding padding, @NotNull DetectionLocation detectionLocation) { + int keyLength, @Nonnull Padding padding, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(padding); } - public ChaCha20(@Nonnull final Class asKind, @NotNull ChaCha20 chaCha20) { + public ChaCha20(@Nonnull final Class asKind, @Nonnull ChaCha20 chaCha20) { super(chaCha20, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20Poly1305.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20Poly1305.java index a199adab..b1b347f9 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20Poly1305.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ChaCha20Poly1305.java @@ -23,12 +23,11 @@ import com.ibm.mapper.model.AuthenticatedEncryption; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public final class ChaCha20Poly1305 extends Algorithm implements AuthenticatedEncryption { @Override - public @NotNull String asString() { + public @Nonnull String asString() { return "ChaCha20Poly1305"; } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DES.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DES.java index f5f1dfea..ff0373c6 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DES.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DES.java @@ -29,7 +29,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -54,7 +53,7 @@ public final class DES extends Algorithm implements BlockCipher, Mac { private static final String NAME = "DES"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { final StringBuilder sb = new StringBuilder(this.name); this.hasChildOfType(KeyLength.class).ifPresent(k -> sb.append(k.asString())); this.hasChildOfType(Mode.class).ifPresent(m -> sb.append("-").append(m.asString())); @@ -62,24 +61,24 @@ public final class DES extends Algorithm implements BlockCipher, Mac { return sb.toString(); } - public DES(@NotNull DetectionLocation detectionLocation) { + public DES(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new KeyLength(56, detectionLocation)); this.put(new BlockSize(64, detectionLocation)); } - public DES(int keyLength, @NotNull DetectionLocation detectionLocation) { + public DES(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public DES(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public DES(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); } - public DES(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public DES(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } @@ -88,7 +87,7 @@ public DES( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -98,13 +97,13 @@ public DES( public DES( @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); this.put(padding); } - public DES(@Nonnull final Class asKind, @NotNull DES des) { + public DES(@Nonnull final Class asKind, @Nonnull DES des) { super(des, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DESede.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DESede.java index aac8dc73..b692d28f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DESede.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DESede.java @@ -30,7 +30,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -58,7 +57,7 @@ public final class DESede extends Algorithm implements BlockCipher, KeyWrap, Mac private static final String NAME = "DESede"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { final StringBuilder sb = new StringBuilder(this.name); this.hasChildOfType(KeyLength.class).ifPresent(k -> sb.append(k.asString())); this.hasChildOfType(Mode.class).ifPresent(m -> sb.append("-").append(m.asString())); @@ -66,17 +65,17 @@ public final class DESede extends Algorithm implements BlockCipher, KeyWrap, Mac return sb.toString(); } - public DESede(@NotNull DetectionLocation detectionLocation) { + public DESede(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); } - public DESede(int keyLength, @NotNull DetectionLocation detectionLocation) { + public DESede(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public DESede(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public DESede(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -86,14 +85,14 @@ public DESede( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public DESede(@Nonnull final Class asKind, @NotNull DESede desEde) { + public DESede(@Nonnull final Class asKind, @Nonnull DESede desEde) { super(desEde, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DH.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DH.java index f3ce548c..c37b39d4 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DH.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DH.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -53,7 +52,7 @@ public final class DH extends Algorithm implements Signature, KeyAgreement, Publ private static final String NAME = "DH"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { final StringBuilder sb = new StringBuilder(this.name); if (this.is(PublicKeyEncryption.class)) { this.hasChildOfType(KeyLength.class) @@ -62,13 +61,13 @@ public final class DH extends Algorithm implements Signature, KeyAgreement, Publ return sb.toString(); } - public DH(@NotNull DetectionLocation detectionLocation) { + public DH(@Nonnull DetectionLocation detectionLocation) { this(PublicKeyEncryption.class, detectionLocation); } public DH( @Nonnull final Class asKind, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { super(NAME, asKind, detectionLocation); this.put(new Oid("1.2.840.113549.1.3.1", detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSA.java index 68285501..5d385ef8 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSA.java @@ -24,24 +24,25 @@ import com.ibm.mapper.model.Oid; import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class DSA extends Algorithm implements Signature { private static final String NAME = "DSA"; + @Nonnull @Override - public @NotNull String asString() { + public String asString() { return this.hasChildOfType(MessageDigest.class) .map(node -> node.asString() + "with" + this.name) .orElse(this.name); } - public DSA(@NotNull DetectionLocation detectionLocation) { + public DSA(@Nonnull DetectionLocation detectionLocation) { super(NAME, Signature.class, detectionLocation); this.put(new Oid("1.2.840.10040.4.1", detectionLocation)); } - public DSA(@NotNull MessageDigest messageDigest) { + public DSA(@Nonnull MessageDigest messageDigest) { this(messageDigest.getDetectionContext()); this.put(messageDigest); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSS.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSS.java index aff7fa99..fa48818f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSS.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/DSS.java @@ -20,7 +20,7 @@ package com.ibm.mapper.model.algorithms; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * The National Institute of Standards and Technology (NIST) proposed DSA for use in their Digital @@ -32,7 +32,7 @@ */ public final class DSS extends DSA { - public DSS(@NotNull DetectionLocation detectionLocation) { + public DSS(@Nonnull DetectionLocation detectionLocation) { super(detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECCPWD.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECCPWD.java index 30bebc5f..7d93c654 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECCPWD.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECCPWD.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.KeyAgreement; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public final class ECCPWD extends Algorithm implements KeyAgreement { private static final String NAME = "ECCPWD"; - public ECCPWD(@NotNull DetectionLocation detectionLocation) { + public ECCPWD(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDH.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDH.java index f87ab5e6..0d745ea2 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDH.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDH.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.Oid; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -48,7 +47,7 @@ public final class ECDH extends Algorithm implements KeyAgreement { private static final String NAME = "ECDH"; - public ECDH(@NotNull DetectionLocation detectionLocation) { + public ECDH(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); this.put(new Oid("1.3.132.1.12", detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDSA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDSA.java index 1d36a161..fe1b65cb 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDSA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ECDSA.java @@ -24,7 +24,7 @@ import com.ibm.mapper.model.MessageDigest; import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,19 +47,20 @@ public final class ECDSA extends Algorithm implements Signature { private static final String NAME = "ECDSA"; + @Nonnull @Override - public @NotNull String asString() { + public String asString() { return this.hasChildOfType(MessageDigest.class) .map(node -> node.asString() + "with" + this.name) .orElse(this.name); } - public ECDSA(@NotNull DetectionLocation detectionLocation) { + public ECDSA(@Nonnull DetectionLocation detectionLocation) { super(NAME, Signature.class, detectionLocation); } public ECDSA( - @NotNull EllipticCurve ellipticCurve, @NotNull DetectionLocation detectionLocation) { + @Nonnull EllipticCurve ellipticCurve, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(ellipticCurve); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed25519.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed25519.java index c00a6464..432ab82e 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed25519.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed25519.java @@ -23,7 +23,7 @@ import com.ibm.mapper.model.Signature; import com.ibm.mapper.model.curves.Edwards25519; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -46,7 +46,7 @@ public final class Ed25519 extends EdDSA implements Signature { private static final String NAME = "Ed25519"; - public Ed25519(@NotNull DetectionLocation detectionLocation) { + public Ed25519(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new Edwards25519(detectionLocation)); this.put(new SHA2(512, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed448.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed448.java index 4bc66c45..f93b3297 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed448.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Ed448.java @@ -24,7 +24,7 @@ import com.ibm.mapper.model.algorithms.shake.SHAKE; import com.ibm.mapper.model.curves.Edwards448; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,7 +47,7 @@ public final class Ed448 extends EdDSA implements Signature { private static final String NAME = "Ed448"; - public Ed448(@NotNull DetectionLocation detectionLocation) { + public Ed448(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new Edwards448(detectionLocation)); this.put(new SHAKE(256, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/EdDSA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/EdDSA.java index f232cb55..ee3dbb17 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/EdDSA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/EdDSA.java @@ -23,16 +23,15 @@ import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class EdDSA extends Algorithm implements Signature { private static final String NAME = "EdDSA"; - protected EdDSA(@Nonnull String name, @NotNull DetectionLocation detectionLocation) { + protected EdDSA(@Nonnull String name, @Nonnull DetectionLocation detectionLocation) { super(name, Signature.class, detectionLocation); } - public EdDSA(@NotNull DetectionLocation detectionLocation) { + public EdDSA(@Nonnull DetectionLocation detectionLocation) { this(NAME, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Fernet.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Fernet.java index b3c1d6c3..5e550c57 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Fernet.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Fernet.java @@ -21,10 +21,11 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.AuthenticatedEncryption; +import com.ibm.mapper.model.IPrimitive; import com.ibm.mapper.model.mode.CBC; import com.ibm.mapper.model.padding.PKCS7; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,7 +48,7 @@ public final class Fernet extends Algorithm implements AuthenticatedEncryption { private static final String NAME = "Fernet"; - public Fernet(@NotNull DetectionLocation detectionLocation) { + public Fernet(@Nonnull DetectionLocation detectionLocation) { super(NAME, AuthenticatedEncryption.class, detectionLocation); this.put( new AES( @@ -57,4 +58,8 @@ public Fernet(@NotNull DetectionLocation detectionLocation) { detectionLocation)); this.put(new HMAC(new SHA2(256, detectionLocation))); } + + public Fernet(@Nonnull final Class asKind, @Nonnull Fernet fernet) { + super(fernet, asKind); + } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/HC.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/HC.java index 53e9c97f..949159de 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/HC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/HC.java @@ -26,7 +26,6 @@ import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -65,7 +64,7 @@ public HC(int keyLength, @Nonnull DetectionLocation detectionLocation) { this.put(new InitializationVectorLength(keyLength, detectionLocation)); } - public HC(@Nonnull final Class asKind, @NotNull HC hc) { + public HC(@Nonnull final Class asKind, @Nonnull HC hc) { super(hc, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/HKDF.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/HKDF.java index b44819cd..ed2e1a8a 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/HKDF.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/HKDF.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.MessageDigest; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -60,7 +59,7 @@ public HKDF(@Nonnull MessageDigest messageDigest) { } @Override - public @NotNull String asString() { + public @Nonnull String asString() { return this.hasChildOfType(MessageDigest.class) .map(digest -> this.name + "-" + ((IAlgorithm) digest).getName()) .orElse(this.name); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/HMAC.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/HMAC.java index c1197f69..14484bf2 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/HMAC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/HMAC.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.MessageDigest; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -58,7 +57,7 @@ public HMAC(@Nonnull MessageDigest messageDigest) { } @Override - public @NotNull String asString() { + public @Nonnull String asString() { return this.hasChildOfType(MessageDigest.class) .map(digest -> this.name + "-" + ((IAlgorithm) digest).getName()) .orElse(this.name); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/IDEA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/IDEA.java index ae6ebdf0..48a74181 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/IDEA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/IDEA.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -49,16 +48,16 @@ public final class IDEA extends Algorithm implements BlockCipher { private static final String NAME = "IDEA"; - public IDEA(@NotNull DetectionLocation detectionLocation) { + public IDEA(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); } - public IDEA(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public IDEA(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } - public IDEA(@Nonnull final Class asKind, @NotNull IDEA idea) { + public IDEA(@Nonnull final Class asKind, @Nonnull IDEA idea) { super(idea, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ISAAC.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ISAAC.java index 23f576e1..4e390cdd 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ISAAC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ISAAC.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -53,7 +52,7 @@ public ISAAC(@Nonnull DetectionLocation detectionLocation) { super(NAME, StreamCipher.class, detectionLocation); } - public ISAAC(@Nonnull final Class asKind, @NotNull ISAAC isaac) { + public ISAAC(@Nonnull final Class asKind, @Nonnull ISAAC isaac) { super(isaac, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Kerberos.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Kerberos.java index f04775a4..d44d4ab4 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Kerberos.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Kerberos.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.KeyAgreement; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,11 +45,11 @@ public final class Kerberos extends Algorithm implements KeyAgreement { private static final String NAME = "KRB"; - public Kerberos(@NotNull DetectionLocation detectionLocation) { + public Kerberos(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); } - public Kerberos(int version, @NotNull DetectionLocation detectionLocation) { + public Kerberos(int version, @Nonnull DetectionLocation detectionLocation) { super(NAME + version, KeyAgreement.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/LEA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/LEA.java index 6e7132e7..7c0fef15 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/LEA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/LEA.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -52,17 +51,17 @@ public final class LEA extends Algorithm implements BlockCipher { private static final String NAME = "LEA"; - public LEA(@NotNull DetectionLocation detectionLocation) { + public LEA(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(128, detectionLocation)); } - public LEA(int keyLength, @NotNull DetectionLocation detectionLocation) { + public LEA(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public LEA(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public LEA(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -72,14 +71,14 @@ public LEA( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public LEA(@Nonnull final Class asKind, @NotNull LEA lea) { + public LEA(@Nonnull final Class asKind, @Nonnull LEA lea) { super(lea, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/LMS.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/LMS.java index 1f8d5e2a..cfac39f7 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/LMS.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/LMS.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -51,7 +50,7 @@ public final class LMS extends Algorithm implements Signature, MessageDigest { private static final String NAME = "LMS"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { return this.hasChildOfType(MessageDigest.class) .map(node -> node.asString() + "with" + this.name) .orElse(this.name); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/PBKDF1.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/PBKDF1.java index 65569641..e2f952f1 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/PBKDF1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/PBKDF1.java @@ -27,7 +27,6 @@ import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -51,7 +50,7 @@ public final class PBKDF1 extends Algorithm implements PasswordBasedKeyDerivatio private static final String NAME = "PBKDF1"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { final StringBuilder sb = new StringBuilder(this.name + "-"); final Optional mac = this.hasChildOfType(Mac.class); if (mac.isPresent()) { diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/PSK.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/PSK.java index a6f4ca3c..6c2d09e4 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/PSK.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/PSK.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.KeyAgreement; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public final class PSK extends Algorithm implements KeyAgreement { private static final String NAME = "PSK"; - public PSK(@NotNull DetectionLocation detectionLocation) { + public PSK(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC2.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC2.java index ac2314be..d2e3522f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC2.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC2.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -52,16 +51,16 @@ public final class RC2 extends Algorithm implements BlockCipher, KeyWrap { private static final String NAME = "RC2"; // ARC2 - public RC2(@NotNull DetectionLocation detectionLocation) { + public RC2(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); } - public RC2(int keyLength, @NotNull DetectionLocation detectionLocation) { + public RC2(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public RC2(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public RC2(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -71,14 +70,14 @@ public RC2( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public RC2(@Nonnull final Class asKind, @NotNull RC2 rc2) { + public RC2(@Nonnull final Class asKind, @Nonnull RC2 rc2) { super(rc2, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC4.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC4.java index ffb55f4a..d2c17a79 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC4.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RC4.java @@ -27,7 +27,6 @@ import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -52,16 +51,16 @@ public final class RC4 extends Algorithm implements StreamCipher { private static final String NAME = "RC4"; - public RC4(@NotNull DetectionLocation detectionLocation) { + public RC4(@Nonnull DetectionLocation detectionLocation) { super(NAME, StreamCipher.class, detectionLocation); } - public RC4(int keyLength, @NotNull DetectionLocation detectionLocation) { + public RC4(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } - public RC4(int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public RC4(int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -71,14 +70,14 @@ public RC4( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public RC4(@Nonnull final Class asKind, @NotNull RC4 rc4) { + public RC4(@Nonnull final Class asKind, @Nonnull RC4 rc4) { super(rc4, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSA.java index 6bc6ff3b..f1b20965 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSA.java @@ -33,7 +33,6 @@ import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -58,7 +57,7 @@ public final class RSA extends Algorithm implements KeyAgreement, Signature, Pub private static final String OID = "1.2.840.113549.1.1.1"; @Override - public @NotNull String asString() { + public @Nonnull String asString() { if (this.is(Signature.class)) { return this.hasChildOfType(MessageDigest.class) .map(node -> node.asString() + "with" + this.name) @@ -74,7 +73,7 @@ public final class RSA extends Algorithm implements KeyAgreement, Signature, Pub return this.name; } - public RSA(@NotNull DetectionLocation detectionLocation) { + public RSA(@Nonnull DetectionLocation detectionLocation) { super(NAME, PublicKeyEncryption.class, detectionLocation); this.put(new Oid(OID, detectionLocation)); } @@ -87,12 +86,12 @@ public RSA(int keyLength, @Nonnull DetectionLocation detectionLocation) { public RSA( @Nonnull final Class asKind, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { super(NAME, asKind, detectionLocation); this.put(new Oid(OID, detectionLocation)); } - public RSA(@Nonnull final Class asKind, @NotNull RSA rsa) { + public RSA(@Nonnull final Class asKind, @Nonnull RSA rsa) { super(rsa, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSAssaPSS.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSAssaPSS.java index c40edb11..e602ca30 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSAssaPSS.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/RSAssaPSS.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.ProbabilisticSignatureScheme; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -44,7 +44,7 @@ */ public final class RSAssaPSS extends Algorithm implements ProbabilisticSignatureScheme { - public RSAssaPSS(@NotNull DetectionLocation detectionLocation) { + public RSAssaPSS(@Nonnull DetectionLocation detectionLocation) { super("RSASSA-PSS", ProbabilisticSignatureScheme.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SEED.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SEED.java index 147d893d..3be73e78 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SEED.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SEED.java @@ -29,7 +29,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -53,13 +52,13 @@ public final class SEED extends Algorithm implements BlockCipher, KeyWrap { private static final String NAME = "SEED"; - public SEED(@NotNull DetectionLocation detectionLocation) { + public SEED(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(128, detectionLocation)); this.put(new KeyLength(128, detectionLocation)); } - public SEED(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public SEED(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } @@ -67,13 +66,13 @@ public SEED(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { public SEED( @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); this.put(padding); } - public SEED(@Nonnull final Class asKind, @NotNull SEED seed) { + public SEED(@Nonnull final Class asKind, @Nonnull SEED seed) { super(seed, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM2.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM2.java index 9e5d2e0f..ff4cbbd6 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM2.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM2.java @@ -26,7 +26,6 @@ import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -50,7 +49,7 @@ public final class SM2 extends Algorithm implements Signature, PublicKeyEncrypti private static final String NAME = "SM2"; - public SM2(@NotNull DetectionLocation detectionLocation) { + public SM2(@Nonnull DetectionLocation detectionLocation) { super(NAME, Signature.class, detectionLocation); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM4.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM4.java index ec2b0703..4e25a9c2 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM4.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SM4.java @@ -27,7 +27,6 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -50,16 +49,16 @@ public final class SM4 extends Algorithm implements BlockCipher, AuthenticatedEncryption, Mac { private static final String NAME = "SM4"; - public SM4(@NotNull DetectionLocation detectionLocation) { + public SM4(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); } - public SM4(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public SM4(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } - public SM4(@Nonnull final Class asKind, @NotNull SM4 sm4) { + public SM4(@Nonnull final Class asKind, @Nonnull SM4 sm4) { super(sm4, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SRP.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SRP.java index 56ed7480..02a2b957 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/SRP.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/SRP.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.KeyAgreement; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public final class SRP extends Algorithm implements KeyAgreement { private static final String NAME = "SRP"; - public SRP(@NotNull DetectionLocation detectionLocation) { + public SRP(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Salsa20.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Salsa20.java index f2a4faa3..e6a19a1b 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Salsa20.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Salsa20.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -58,7 +57,7 @@ public Salsa20(int keyLength, @Nonnull DetectionLocation detectionLocation) { this.put(new KeyLength(keyLength, detectionLocation)); } - public Salsa20(@Nonnull final Class asKind, @NotNull Salsa20 salsa20) { + public Salsa20(@Nonnull final Class asKind, @Nonnull Salsa20 salsa20) { super(salsa20, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Scrypt.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Scrypt.java index 3db9118e..b36d1f18 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Scrypt.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Scrypt.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.PasswordBasedKeyDerivationFunction; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public final class Scrypt extends Algorithm implements PasswordBasedKeyDerivationFunction { private static final String NAME = "SCRYPT"; - public Scrypt(@NotNull DetectionLocation detectionLocation) { + public Scrypt(@Nonnull DetectionLocation detectionLocation) { super(NAME, PasswordBasedKeyDerivationFunction.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Skipjack.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Skipjack.java index e0282704..2aa8b1b5 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/Skipjack.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/Skipjack.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -52,13 +51,13 @@ public final class Skipjack extends Algorithm implements BlockCipher { private static final String NAME = "Skipjack"; - public Skipjack(@NotNull DetectionLocation detectionLocation) { + public Skipjack(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); this.put(new KeyLength(80, detectionLocation)); } - public Skipjack(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public Skipjack(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } @@ -66,13 +65,13 @@ public Skipjack(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation public Skipjack( @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); this.put(padding); } - public Skipjack(@Nonnull final Class asKind, @NotNull Skipjack skipjack) { + public Skipjack(@Nonnull final Class asKind, @Nonnull Skipjack skipjack) { super(skipjack, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/TripleDES.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/TripleDES.java index 37ffaf33..6869b8c2 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/TripleDES.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/TripleDES.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -51,18 +50,18 @@ public final class TripleDES extends Algorithm implements BlockCipher { private static final String NAME = "3DES"; - public TripleDES(@NotNull DetectionLocation detectionLocation) { + public TripleDES(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); } - public TripleDES(int keyLength, @NotNull DetectionLocation detectionLocation) { + public TripleDES(int keyLength, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); } public TripleDES( - int keyLength, @Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + int keyLength, @Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); @@ -72,14 +71,14 @@ public TripleDES( int keyLength, @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(new KeyLength(keyLength, detectionLocation)); this.put(mode); this.put(padding); } - public TripleDES(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public TripleDES(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } @@ -87,14 +86,14 @@ public TripleDES(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocatio public TripleDES( @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); this.put(padding); } public TripleDES( - @Nonnull final Class asKind, @NotNull TripleDES tripleDES) { + @Nonnull final Class asKind, @Nonnull TripleDES tripleDES) { super(tripleDES, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/X25519.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/X25519.java index 52e9b25c..560b40d1 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/X25519.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/X25519.java @@ -24,7 +24,7 @@ import com.ibm.mapper.model.Oid; import com.ibm.mapper.model.curves.Curve25519; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,7 +47,7 @@ public final class X25519 extends Algorithm implements KeyAgreement { private static final String NAME = "x25519"; - public X25519(@NotNull DetectionLocation detectionLocation) { + public X25519(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); this.put(new Curve25519(detectionLocation)); this.put(new Oid("1.3.101.110", detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/X448.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/X448.java index f0a7f040..14f8ccfe 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/X448.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/X448.java @@ -24,7 +24,7 @@ import com.ibm.mapper.model.Oid; import com.ibm.mapper.model.curves.Curve448; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,7 +47,7 @@ public final class X448 extends Algorithm implements KeyAgreement { private static final String NAME = "x448"; - public X448(@NotNull DetectionLocation detectionLocation) { + public X448(@Nonnull DetectionLocation detectionLocation) { super(NAME, KeyAgreement.class, detectionLocation); this.put(new Curve448(detectionLocation)); this.put(new Oid("1.3.101.111", detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon.java index b657ce70..fdeb4e43 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.IPrimitive; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -49,20 +48,20 @@ public class Ascon extends Algorithm implements BlockCipher { private static final String NAME = "Ascon"; - public Ascon(@NotNull DetectionLocation detectionLocation) { + public Ascon(@Nonnull DetectionLocation detectionLocation) { this(NAME, AuthenticatedEncryption.class, detectionLocation); } public Ascon( @Nonnull final Class asKind, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(NAME, asKind, detectionLocation); } protected Ascon( @Nonnull String name, @Nonnull final Class asKind, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { super(name, asKind, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128.java index ec894299..ed5e8e4b 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128.java @@ -25,7 +25,7 @@ import com.ibm.mapper.model.NonceLength; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -48,7 +48,7 @@ public final class Ascon128 extends Ascon implements AuthenticatedEncryption { private static final String NAME = "Ascon-128"; - public Ascon128(@NotNull DetectionLocation detectionLocation) { + public Ascon128(@Nonnull DetectionLocation detectionLocation) { super(NAME, AuthenticatedEncryption.class, detectionLocation); this.put(new KeyLength(128, detectionLocation)); this.put(new NonceLength(128, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128a.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128a.java index b88fdddb..1c630754 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128a.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon128a.java @@ -25,7 +25,7 @@ import com.ibm.mapper.model.NonceLength; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -48,7 +48,7 @@ public final class Ascon128a extends Ascon implements AuthenticatedEncryption { private static final String NAME = "Ascon-128a"; - public Ascon128a(@NotNull DetectionLocation detectionLocation) { + public Ascon128a(@Nonnull DetectionLocation detectionLocation) { super(NAME, AuthenticatedEncryption.class, detectionLocation); this.put(new KeyLength(128, detectionLocation)); this.put(new NonceLength(128, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon80pq.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon80pq.java index 2ab77f5f..90a593da 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon80pq.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/Ascon80pq.java @@ -25,7 +25,7 @@ import com.ibm.mapper.model.NonceLength; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -48,7 +48,7 @@ public final class Ascon80pq extends Ascon implements AuthenticatedEncryption { private static final String NAME = "Ascon-80pq"; - public Ascon80pq(@NotNull DetectionLocation detectionLocation) { + public Ascon80pq(@Nonnull DetectionLocation detectionLocation) { super(NAME, AuthenticatedEncryption.class, detectionLocation); this.put(new KeyLength(160, detectionLocation)); this.put(new NonceLength(128, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconHash.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconHash.java index 43d13e20..1ad4df5b 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconHash.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconHash.java @@ -23,7 +23,7 @@ import com.ibm.mapper.model.DigestSize; import com.ibm.mapper.model.MessageDigest; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -46,7 +46,7 @@ public final class AsconHash extends Ascon implements MessageDigest { private static final String NAME = "Ascon-Hash"; - public AsconHash(@NotNull DetectionLocation detectionLocation) { + public AsconHash(@Nonnull DetectionLocation detectionLocation) { super(NAME, MessageDigest.class, detectionLocation); this.put(new DigestSize(256, detectionLocation)); this.put(new BlockSize(64, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconXof.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconXof.java index 8bb0a8f4..bf14e115 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconXof.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ascon/AsconXof.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.ExtendableOutputFunction; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public final class AsconXof extends Ascon implements ExtendableOutputFunction { private static final String NAME = "Ascon-Xof"; - public AsconXof(@NotNull DetectionLocation detectionLocation) { + public AsconXof(@Nonnull DetectionLocation detectionLocation) { super(NAME, ExtendableOutputFunction.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Delirium.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Delirium.java index 8ad13926..585a1c4e 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Delirium.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Delirium.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public class Delirium extends Elephant { private static final String NAME = "Delirium"; - public Delirium(@NotNull DetectionLocation detectionLocation) { + public Delirium(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(200, detectionLocation)); this.put(new TagLength(128, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Dumbo.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Dumbo.java index 60e5561f..e2aca16b 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Dumbo.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Dumbo.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public class Dumbo extends Elephant { private static final String NAME = "Dumbo"; - public Dumbo(@NotNull DetectionLocation detectionLocation) { + public Dumbo(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(160, detectionLocation)); this.put(new TagLength(64, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Elephant.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Elephant.java index 27388e5d..5169205f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Elephant.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Elephant.java @@ -25,7 +25,6 @@ import com.ibm.mapper.model.NonceLength; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -49,11 +48,11 @@ public class Elephant extends Algorithm implements AuthenticatedEncryption { private static final String NAME = "Elephant"; - public Elephant(@NotNull DetectionLocation detectionLocation) { + public Elephant(@Nonnull DetectionLocation detectionLocation) { this(NAME, detectionLocation); } - protected Elephant(@Nonnull String name, @NotNull DetectionLocation detectionLocation) { + protected Elephant(@Nonnull String name, @Nonnull DetectionLocation detectionLocation) { super(name, AuthenticatedEncryption.class, detectionLocation); this.put(new KeyLength(128, detectionLocation)); this.put(new NonceLength(96, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Jumbo.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Jumbo.java index 2348c892..6b79762d 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Jumbo.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/elephant/Jumbo.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -45,7 +45,7 @@ public class Jumbo extends Elephant { private static final String NAME = "Jumbo"; // Elephant-Spongent-π[176] - public Jumbo(@NotNull DetectionLocation detectionLocation) { + public Jumbo(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(176, detectionLocation)); this.put(new TagLength(64, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOST28147.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOST28147.java index c56f3b06..2263c734 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOST28147.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOST28147.java @@ -30,7 +30,6 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -58,19 +57,19 @@ public final class GOST28147 extends Algorithm private static final String NAME = "GOST28147"; - public GOST28147(@NotNull DetectionLocation detectionLocation) { + public GOST28147(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); this.put(new KeyLength(256, detectionLocation)); } - public GOST28147(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public GOST28147(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } public GOST28147( - @Nonnull final Class asKind, @NotNull GOST28147 gost28147) { + @Nonnull final Class asKind, @Nonnull GOST28147 gost28147) { super(gost28147, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOSTR34122015.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOSTR34122015.java index 0b4fd852..2e3d039c 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOSTR34122015.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/gost/GOSTR34122015.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -51,20 +50,20 @@ public final class GOSTR34122015 extends Algorithm implements BlockCipher, AuthenticatedEncryption { private static final String NAME = "GOSTR34122015"; - public GOSTR34122015(@NotNull DetectionLocation detectionLocation) { + public GOSTR34122015(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(128, detectionLocation)); this.put(new KeyLength(256, detectionLocation)); } - public GOSTR34122015(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public GOSTR34122015(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } public GOSTR34122015( @Nonnull final Class asKind, - @NotNull GOSTR34122015 gostr34122015) { + @Nonnull GOSTR34122015 gostr34122015) { super(gostr34122015, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/grain/Grain.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/grain/Grain.java index 76b7a8c2..6d9c606e 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/grain/Grain.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/grain/Grain.java @@ -24,19 +24,18 @@ import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class Grain extends Algorithm implements StreamCipher { private static final String NAME = "Grain"; - public Grain(@NotNull DetectionLocation detectionLocation) { + public Grain(@Nonnull DetectionLocation detectionLocation) { this(NAME, StreamCipher.class, detectionLocation); } protected Grain( @Nonnull String name, @Nonnull final Class asKind, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { super(name, asKind, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/Isap.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/Isap.java index 26c6a754..270f20d2 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/Isap.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/Isap.java @@ -27,7 +27,6 @@ import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -51,7 +50,7 @@ public class Isap extends Algorithm implements AuthenticatedEncryption { private static final String NAME = "Isap"; - public Isap(@NotNull DetectionLocation detectionLocation) { + public Isap(@Nonnull DetectionLocation detectionLocation) { this(NAME, detectionLocation); } @@ -59,7 +58,7 @@ public Isap(@Nonnull final Class asKind, @Nonnull Isap isa super(isap, asKind); } - protected Isap(@Nonnull String name, @NotNull DetectionLocation detectionLocation) { + protected Isap(@Nonnull String name, @Nonnull DetectionLocation detectionLocation) { super(name, AuthenticatedEncryption.class, detectionLocation); this.put(new KeyLength(128, detectionLocation)); this.put(new NonceLength(128, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128.java index 4dbe7542..3837b852 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128.java @@ -22,12 +22,12 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.InitializationVectorLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class IsapA128 extends Isap { private static final String NAME = "Isap-A-128"; - public IsapA128(@NotNull DetectionLocation detectionLocation) { + public IsapA128(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(64, detectionLocation)); this.put(new InitializationVectorLength(192, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128a.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128a.java index f2fce62e..f5d9ee90 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128a.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapA128a.java @@ -22,12 +22,12 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.InitializationVectorLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class IsapA128a extends Isap { private static final String NAME = "Isap-A-128a"; - public IsapA128a(@NotNull DetectionLocation detectionLocation) { + public IsapA128a(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(64, detectionLocation)); this.put(new InitializationVectorLength(192, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128.java index 4ea6d953..5693a4a7 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128.java @@ -22,12 +22,12 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.InitializationVectorLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class IsapK128 extends Isap { private static final String NAME = "Isap-K-128"; - public IsapK128(@NotNull DetectionLocation detectionLocation) { + public IsapK128(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(144, detectionLocation)); this.put(new InitializationVectorLength(272, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128a.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128a.java index d2fcc862..30c51ff6 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128a.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/isap/IsapK128a.java @@ -22,12 +22,12 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.InitializationVectorLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class IsapK128a extends Isap { private static final String NAME = "Isap-K-128a"; - public IsapK128a(@NotNull DetectionLocation detectionLocation) { + public IsapK128a(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); this.put(new BlockSize(144, detectionLocation)); this.put(new InitializationVectorLength(272, detectionLocation)); diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ntru/NTRUSign.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ntru/NTRUSign.java index ba3d6621..83119e6a 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/ntru/NTRUSign.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/ntru/NTRUSign.java @@ -22,12 +22,12 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.Signature; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class NTRUSign extends Algorithm implements Signature { private static final String NAME = "NTRUSign"; - public NTRUSign(@NotNull DetectionLocation detectionLocation) { + public NTRUSign(@Nonnull DetectionLocation detectionLocation) { super(NAME, Signature.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/TEA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/TEA.java index f778c4aa..0fbb08b7 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/TEA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/TEA.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -53,13 +52,13 @@ public final class TEA extends Algorithm implements BlockCipher { private static final String NAME = "TEA"; - public TEA(@NotNull DetectionLocation detectionLocation) { + public TEA(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); this.put(new KeyLength(128, detectionLocation)); } - public TEA(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public TEA(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } @@ -67,13 +66,13 @@ public TEA(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { public TEA( @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); this.put(padding); } - public TEA(@Nonnull final Class asKind, @NotNull TEA tea) { + public TEA(@Nonnull final Class asKind, @Nonnull TEA tea) { super(tea, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/XTEA.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/XTEA.java index 10fdcc7d..492fa98f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/XTEA.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/tea/XTEA.java @@ -28,7 +28,6 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * @@ -54,13 +53,13 @@ public final class XTEA extends Algorithm implements BlockCipher { private static final String NAME = "XTEA"; - public XTEA(@NotNull DetectionLocation detectionLocation) { + public XTEA(@Nonnull DetectionLocation detectionLocation) { super(NAME, BlockCipher.class, detectionLocation); this.put(new BlockSize(64, detectionLocation)); this.put(new KeyLength(128, detectionLocation)); } - public XTEA(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { + public XTEA(@Nonnull Mode mode, @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); } @@ -68,13 +67,13 @@ public XTEA(@Nonnull Mode mode, @NotNull DetectionLocation detectionLocation) { public XTEA( @Nonnull Mode mode, @Nonnull Padding padding, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { this(detectionLocation); this.put(mode); this.put(padding); } - public XTEA(@Nonnull final Class asKind, @NotNull XTEA xtea) { + public XTEA(@Nonnull final Class asKind, @Nonnull XTEA xtea) { super(xtea, asKind); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPC.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPC.java index 29632736..84ed30aa 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPC.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.StreamCipher; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -47,7 +47,7 @@ public class VMPC extends Algorithm implements StreamCipher { private static final String NAME = "VMPC"; - public VMPC(@NotNull DetectionLocation detectionLocation) { + public VMPC(@Nonnull DetectionLocation detectionLocation) { super(NAME, StreamCipher.class, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPCMAC.java b/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPCMAC.java index 26f2e750..b880b55f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPCMAC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/algorithms/vmpc/VMPCMAC.java @@ -22,7 +22,7 @@ import com.ibm.mapper.model.Algorithm; import com.ibm.mapper.model.Mac; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; /** * @@ -46,7 +46,7 @@ public final class VMPCMAC extends Algorithm implements Mac { private static final String NAME = "VMPC-MAC"; - public VMPCMAC(@NotNull DetectionLocation detectionLocation) { + public VMPCMAC(@Nonnull DetectionLocation detectionLocation) { super(NAME, Mac.class, detectionLocation); this.put(new VMPC(detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/collections/AbstractAssetCollection.java b/mapper/src/main/java/com/ibm/mapper/model/collections/AbstractAssetCollection.java index 421fd60b..35ba12ee 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/collections/AbstractAssetCollection.java +++ b/mapper/src/main/java/com/ibm/mapper/model/collections/AbstractAssetCollection.java @@ -26,8 +26,6 @@ import java.util.Map; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; public abstract class AbstractAssetCollection implements IAssetCollection { @Nonnull protected final Map, INode> children; @@ -41,14 +39,14 @@ protected AbstractAssetCollection( this.kind = kind; } - @NotNull @Unmodifiable + @Nonnull @Override public List getCollection() { return Collections.unmodifiableList(collection); } @Override - public void put(@NotNull INode child) { + public void put(@Nonnull INode child) { this.children.put(child.getKind(), child); } @@ -57,22 +55,25 @@ public boolean hasChildren() { return !this.children.isEmpty(); } - @NotNull @Override + @Nonnull + @Override public Map, INode> getChildren() { return this.children; } @Override - public boolean is(@NotNull Class type) { + public boolean is(@Nonnull Class type) { return this.getKind().equals(type); } - @NotNull @Override + @Nonnull + @Override public Class getKind() { return this.kind; } - @NotNull @Override + @Nonnull + @Override public String asString() { final StringBuilder sb = new StringBuilder("["); for (int i = 0; i < this.collection.size(); i++) { @@ -84,13 +85,14 @@ public String asString() { return sb.append("]").toString(); } - @NotNull @Override - public Optional hasChildOfType(@NotNull Class nodeType) { + @Nonnull + @Override + public Optional hasChildOfType(@Nonnull Class nodeType) { return Optional.ofNullable(children.get(nodeType)); } @Override - public void removeChildOfType(@NotNull Class nodeType) { + public void removeChildOfType(@Nonnull Class nodeType) { this.children.remove(nodeType); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/collections/AssetCollection.java b/mapper/src/main/java/com/ibm/mapper/model/collections/AssetCollection.java index e99ff20f..9dd90c08 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/collections/AssetCollection.java +++ b/mapper/src/main/java/com/ibm/mapper/model/collections/AssetCollection.java @@ -22,11 +22,10 @@ import com.ibm.mapper.model.INode; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class AssetCollection extends AbstractAssetCollection { - public AssetCollection(@NotNull List collection) { + public AssetCollection(@Nonnull List collection) { super(collection, AssetCollection.class); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/collections/CipherSuiteCollection.java b/mapper/src/main/java/com/ibm/mapper/model/collections/CipherSuiteCollection.java index 0d8c0708..23280901 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/collections/CipherSuiteCollection.java +++ b/mapper/src/main/java/com/ibm/mapper/model/collections/CipherSuiteCollection.java @@ -23,11 +23,10 @@ import com.ibm.mapper.model.INode; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class CipherSuiteCollection extends AbstractAssetCollection { - public CipherSuiteCollection(@NotNull List collection) { + public CipherSuiteCollection(@Nonnull List collection) { super(collection, CipherSuiteCollection.class); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/collections/IAssetCollection.java b/mapper/src/main/java/com/ibm/mapper/model/collections/IAssetCollection.java index 09380a1d..ee21a5c0 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/collections/IAssetCollection.java +++ b/mapper/src/main/java/com/ibm/mapper/model/collections/IAssetCollection.java @@ -22,11 +22,9 @@ import com.ibm.mapper.model.INode; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; public interface IAssetCollection extends INode { @Nonnull - @Unmodifiable List getCollection(); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/collections/IdentifierCollection.java b/mapper/src/main/java/com/ibm/mapper/model/collections/IdentifierCollection.java index c6cd6fb2..c0bc4c59 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/collections/IdentifierCollection.java +++ b/mapper/src/main/java/com/ibm/mapper/model/collections/IdentifierCollection.java @@ -23,15 +23,14 @@ import com.ibm.mapper.model.Identifier; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public class IdentifierCollection extends AbstractAssetCollection { - public IdentifierCollection(@NotNull List collection) { + public IdentifierCollection(@Nonnull List collection) { super(collection, IdentifierCollection.class); } - private IdentifierCollection(@NotNull IdentifierCollection identifierCollection) { + private IdentifierCollection(@Nonnull IdentifierCollection identifierCollection) { super(identifierCollection.collection, identifierCollection.kind); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/collections/MergeableCollection.java b/mapper/src/main/java/com/ibm/mapper/model/collections/MergeableCollection.java index 2e0c22c0..9e929755 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/collections/MergeableCollection.java +++ b/mapper/src/main/java/com/ibm/mapper/model/collections/MergeableCollection.java @@ -22,7 +22,6 @@ import com.ibm.mapper.model.INode; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; /** * This is a special collection of INode: when multiple {@code MergeableCollection} are appended to @@ -35,7 +34,7 @@ // TODO: handle this in the output layer public class MergeableCollection extends AbstractAssetCollection { - public MergeableCollection(@NotNull List collection) { + public MergeableCollection(@Nonnull List collection) { super(collection, MergeableCollection.class); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp256r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp256r1.java index 7842540f..7eab0662 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp256r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp256r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Brainpoolp256r1 extends EllipticCurve { - public Brainpoolp256r1(@NotNull DetectionLocation detectionLocation) { + public Brainpoolp256r1(@Nonnull DetectionLocation detectionLocation) { super("Brainpoolp256r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp384r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp384r1.java index bfda422c..552c47a9 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp384r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp384r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Brainpoolp384r1 extends EllipticCurve { - public Brainpoolp384r1(@NotNull DetectionLocation detectionLocation) { + public Brainpoolp384r1(@Nonnull DetectionLocation detectionLocation) { super("Brainpoolp384r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp512r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp512r1.java index 2038fb05..4dd4f070 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp512r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Brainpoolp512r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Brainpoolp512r1 extends EllipticCurve { - public Brainpoolp512r1(@NotNull DetectionLocation detectionLocation) { + public Brainpoolp512r1(@Nonnull DetectionLocation detectionLocation) { super("Brainpoolp512r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Curve25519.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Curve25519.java index ca85449e..a7798e2a 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Curve25519.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Curve25519.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Curve25519 extends EllipticCurve { - public Curve25519(@NotNull DetectionLocation detectionLocation) { + public Curve25519(@Nonnull DetectionLocation detectionLocation) { super("Curve25519", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Curve448.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Curve448.java index a7f6e8fc..9119a650 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Curve448.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Curve448.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Curve448 extends EllipticCurve { - public Curve448(@NotNull DetectionLocation detectionLocation) { + public Curve448(@Nonnull DetectionLocation detectionLocation) { super("Curve448", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards25519.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards25519.java index 456d12fc..33a63850 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards25519.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards25519.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Edwards25519 extends EllipticCurve { - public Edwards25519(@NotNull DetectionLocation detectionLocation) { + public Edwards25519(@Nonnull DetectionLocation detectionLocation) { super("Edwards25519", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards448.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards448.java index 5d2fb749..abe5abd1 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards448.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Edwards448.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Edwards448 extends EllipticCurve { - public Edwards448(@NotNull DetectionLocation detectionLocation) { + public Edwards448(@Nonnull DetectionLocation detectionLocation) { super("Edwards448", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp192r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp192r1.java index 87d22433..ff2ba80c 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp192r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp192r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Secp192r1 extends EllipticCurve { - public Secp192r1(@NotNull DetectionLocation detectionLocation) { + public Secp192r1(@Nonnull DetectionLocation detectionLocation) { super("secp192r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp224r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp224r1.java index b5b98a3f..79e120e4 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp224r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp224r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Secp224r1 extends EllipticCurve { - public Secp224r1(@NotNull DetectionLocation detectionLocation) { + public Secp224r1(@Nonnull DetectionLocation detectionLocation) { super("secp224r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256k1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256k1.java index edc9240b..29976417 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256k1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256k1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Secp256k1 extends EllipticCurve { - public Secp256k1(@NotNull DetectionLocation detectionLocation) { + public Secp256k1(@Nonnull DetectionLocation detectionLocation) { super("secp256k1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256r1.java index c47f22dd..3c1ac163 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp256r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Secp256r1 extends EllipticCurve { - public Secp256r1(@NotNull DetectionLocation detectionLocation) { + public Secp256r1(@Nonnull DetectionLocation detectionLocation) { super("secp256r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp384r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp384r1.java index 8838c803..f07d16e3 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp384r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp384r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Secp384r1 extends EllipticCurve { - public Secp384r1(@NotNull DetectionLocation detectionLocation) { + public Secp384r1(@Nonnull DetectionLocation detectionLocation) { super("secp384r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp521r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp521r1.java index 4e74f4f2..264153c6 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Secp521r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Secp521r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Secp521r1 extends EllipticCurve { - public Secp521r1(@NotNull DetectionLocation detectionLocation) { + public Secp521r1(@Nonnull DetectionLocation detectionLocation) { super("secp521r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163k1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163k1.java index a0974dbc..86283a13 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163k1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163k1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect163k1 extends EllipticCurve { - public Sect163k1(@NotNull DetectionLocation detectionLocation) { + public Sect163k1(@Nonnull DetectionLocation detectionLocation) { super("sect163k1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163r2.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163r2.java index ee9b7b2a..06f4734d 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163r2.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect163r2.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect163r2 extends EllipticCurve { - public Sect163r2(@NotNull DetectionLocation detectionLocation) { + public Sect163r2(@Nonnull DetectionLocation detectionLocation) { super("sect163r2", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233k1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233k1.java index 61b7c4c9..b8c6551c 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233k1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233k1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect233k1 extends EllipticCurve { - public Sect233k1(@NotNull DetectionLocation detectionLocation) { + public Sect233k1(@Nonnull DetectionLocation detectionLocation) { super("sect233k1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233r1.java index ea5328f9..23b0dc29 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect233r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect233r1 extends EllipticCurve { - public Sect233r1(@NotNull DetectionLocation detectionLocation) { + public Sect233r1(@Nonnull DetectionLocation detectionLocation) { super("sect233r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283k1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283k1.java index 498500f0..25e8d240 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283k1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283k1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect283k1 extends EllipticCurve { - public Sect283k1(@NotNull DetectionLocation detectionLocation) { + public Sect283k1(@Nonnull DetectionLocation detectionLocation) { super("sect283k1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283r1.java index 1490d082..834940b5 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect283r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect283r1 extends EllipticCurve { - public Sect283r1(@NotNull DetectionLocation detectionLocation) { + public Sect283r1(@Nonnull DetectionLocation detectionLocation) { super("sect283r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409k1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409k1.java index 15c89e25..58749452 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409k1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409k1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect409k1 extends EllipticCurve { - public Sect409k1(@NotNull DetectionLocation detectionLocation) { + public Sect409k1(@Nonnull DetectionLocation detectionLocation) { super("sect409k1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409r1.java index 9f0dd697..30e96521 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect409r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect409r1 extends EllipticCurve { - public Sect409r1(@NotNull DetectionLocation detectionLocation) { + public Sect409r1(@Nonnull DetectionLocation detectionLocation) { super("sect409r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571k1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571k1.java index c86faa85..7eaf2668 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571k1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571k1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect571k1 extends EllipticCurve { - public Sect571k1(@NotNull DetectionLocation detectionLocation) { + public Sect571k1(@Nonnull DetectionLocation detectionLocation) { super("sect571k1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571r1.java b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571r1.java index bbd6e367..00fdc3c1 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571r1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/curves/Sect571r1.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.EllipticCurve; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Sect571r1 extends EllipticCurve { - public Sect571r1(@NotNull DetectionLocation detectionLocation) { + public Sect571r1(@Nonnull DetectionLocation detectionLocation) { super("sect571r1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/functionality/Functionality.java b/mapper/src/main/java/com/ibm/mapper/model/functionality/Functionality.java index fa1bf92a..07124bed 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/functionality/Functionality.java +++ b/mapper/src/main/java/com/ibm/mapper/model/functionality/Functionality.java @@ -24,7 +24,6 @@ import com.ibm.mapper.utils.DetectionLocation; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; public abstract class Functionality extends Property { @@ -44,7 +43,6 @@ public String asString() { return type.getSimpleName().toUpperCase(); } - @Unmodifiable @Nonnull public static List> getKinds() { return List.of( diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/CBC.java b/mapper/src/main/java/com/ibm/mapper/model/mode/CBC.java index 896bd3ce..e0b0f62d 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/CBC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/CBC.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class CBC extends Mode { - public CBC(@NotNull DetectionLocation detectionLocation) { + public CBC(@Nonnull DetectionLocation detectionLocation) { super("CBC", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/CCM.java b/mapper/src/main/java/com/ibm/mapper/model/mode/CCM.java index 24388580..7718d582 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/CCM.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/CCM.java @@ -22,15 +22,15 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.model.TagLength; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class CCM extends Mode { - public CCM(@NotNull DetectionLocation detectionLocation) { + public CCM(@Nonnull DetectionLocation detectionLocation) { super("CCM", detectionLocation); } - public CCM(int tagLength, @NotNull DetectionLocation detectionLocation) { + public CCM(int tagLength, @Nonnull DetectionLocation detectionLocation) { super("CCM", detectionLocation); this.put(new TagLength(tagLength, detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/CFB.java b/mapper/src/main/java/com/ibm/mapper/model/mode/CFB.java index 22fa6735..3952ee27 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/CFB.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/CFB.java @@ -21,7 +21,7 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class CFB extends Mode { @@ -30,7 +30,7 @@ public final class CFB extends Mode { * CFB/OFB with no specified value defaults to the block size of the algorithm. * (i.e. AES is 128; Blowfish, DES, DESede, and RC2 are 64.) */ - public CFB(@NotNull DetectionLocation detectionLocation) { + public CFB(@Nonnull DetectionLocation detectionLocation) { super("CFB", detectionLocation); } @@ -41,7 +41,7 @@ public CFB(@NotNull DetectionLocation detectionLocation) { * of s is sometimes incorporated into the name of the mode, e.g., the 1-bit CFB mode, * the 8-bit CFB mode, the 64-bit CFB mode, or the 128-bit CFB mode. */ - public CFB(int s, @NotNull DetectionLocation detectionLocation) { + public CFB(int s, @Nonnull DetectionLocation detectionLocation) { super("CFB" + s, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/CNT.java b/mapper/src/main/java/com/ibm/mapper/model/mode/CNT.java index 500b7e9b..efb7c919 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/CNT.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/CNT.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class CNT extends Mode { - public CNT(@NotNull DetectionLocation detectionLocation) { + public CNT(@Nonnull DetectionLocation detectionLocation) { super("CNT", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/CTR.java b/mapper/src/main/java/com/ibm/mapper/model/mode/CTR.java index e2ed729e..7241d34a 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/CTR.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/CTR.java @@ -21,14 +21,14 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class CTR extends Mode { // https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR) private static final String NAME = "CTR"; // ICM, SIC - public CTR(@NotNull DetectionLocation detectionLocation) { + public CTR(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/CTS.java b/mapper/src/main/java/com/ibm/mapper/model/mode/CTS.java index 11fdac53..a73950ce 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/CTS.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/CTS.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class CTS extends Mode { - public CTS(@NotNull DetectionLocation detectionLocation) { + public CTS(@Nonnull DetectionLocation detectionLocation) { super("CTS", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/EAX.java b/mapper/src/main/java/com/ibm/mapper/model/mode/EAX.java index 8f74969c..0ec15352 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/EAX.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/EAX.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class EAX extends Mode { - public EAX(@NotNull DetectionLocation detectionLocation) { + public EAX(@Nonnull DetectionLocation detectionLocation) { super("EAX", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/ECB.java b/mapper/src/main/java/com/ibm/mapper/model/mode/ECB.java index d76a6b82..088218b5 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/ECB.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/ECB.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class ECB extends Mode { - public ECB(@NotNull DetectionLocation detectionLocation) { + public ECB(@Nonnull DetectionLocation detectionLocation) { super("ECB", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/GCM.java b/mapper/src/main/java/com/ibm/mapper/model/mode/GCM.java index 5df34e39..a9164776 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/GCM.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/GCM.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class GCM extends Mode { - public GCM(@NotNull DetectionLocation detectionLocation) { + public GCM(@Nonnull DetectionLocation detectionLocation) { super("GCM", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/GCMSIV.java b/mapper/src/main/java/com/ibm/mapper/model/mode/GCMSIV.java index 81618566..a9c0b892 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/GCMSIV.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/GCMSIV.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class GCMSIV extends Mode { - public GCMSIV(@NotNull DetectionLocation detectionLocation) { + public GCMSIV(@Nonnull DetectionLocation detectionLocation) { super("GCM-SIV", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/GMAC.java b/mapper/src/main/java/com/ibm/mapper/model/mode/GMAC.java index 19af816b..d72d6f35 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/GMAC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/GMAC.java @@ -21,12 +21,12 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class GMAC extends Mode { // https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf - public GMAC(@NotNull DetectionLocation detectionLocation) { + public GMAC(@Nonnull DetectionLocation detectionLocation) { super("GMAC", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/KW.java b/mapper/src/main/java/com/ibm/mapper/model/mode/KW.java index e0bbecf5..60e1ef4b 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/KW.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/KW.java @@ -21,12 +21,12 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; // Key wrap public final class KW extends Mode { - public KW(@NotNull DetectionLocation detectionLocation) { + public KW(@Nonnull DetectionLocation detectionLocation) { super("WRAP", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/KWP.java b/mapper/src/main/java/com/ibm/mapper/model/mode/KWP.java index 4da37a86..0fa08773 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/KWP.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/KWP.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; // Key wrap pad, warppad public final class KWP extends Mode { - public KWP(@NotNull DetectionLocation detectionLocation) { + public KWP(@Nonnull DetectionLocation detectionLocation) { super("WRAP-PAD", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/MGM.java b/mapper/src/main/java/com/ibm/mapper/model/mode/MGM.java index 820a022e..d3544f9f 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/MGM.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/MGM.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class MGM extends Mode { - public MGM(@NotNull DetectionLocation detectionLocation) { + public MGM(@Nonnull DetectionLocation detectionLocation) { super("MGM", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/OCB.java b/mapper/src/main/java/com/ibm/mapper/model/mode/OCB.java index c899c0b9..7e0cce64 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/OCB.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/OCB.java @@ -22,15 +22,15 @@ import com.ibm.mapper.model.BlockSize; import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class OCB extends Mode { - public OCB(@NotNull DetectionLocation detectionLocation) { + public OCB(@Nonnull DetectionLocation detectionLocation) { super("OCB", detectionLocation); } - public OCB(int blockSize, @NotNull DetectionLocation detectionLocation) { + public OCB(int blockSize, @Nonnull DetectionLocation detectionLocation) { super("OCB", detectionLocation); this.put(new BlockSize(blockSize, detectionLocation)); } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/OFB.java b/mapper/src/main/java/com/ibm/mapper/model/mode/OFB.java index 5795ba19..9d777bbb 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/OFB.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/OFB.java @@ -21,7 +21,7 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class OFB extends Mode { @@ -30,11 +30,11 @@ public final class OFB extends Mode { * CFB/OFB with no specified value defaults to the block size of the algorithm. * (i.e. AES is 128; Blowfish, DES, DESede, and RC2 are 64.) */ - public OFB(@NotNull DetectionLocation detectionLocation) { + public OFB(@Nonnull DetectionLocation detectionLocation) { super("OFB", detectionLocation); } - public OFB(int s, @NotNull DetectionLocation detectionLocation) { + public OFB(int s, @Nonnull DetectionLocation detectionLocation) { super("OFB-" + s, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/PCBC.java b/mapper/src/main/java/com/ibm/mapper/model/mode/PCBC.java index 5e6f516e..d0e70658 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/PCBC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/PCBC.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class PCBC extends Mode { - public PCBC(@NotNull DetectionLocation detectionLocation) { + public PCBC(@Nonnull DetectionLocation detectionLocation) { super("PCBC", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/SIV.java b/mapper/src/main/java/com/ibm/mapper/model/mode/SIV.java index 5af3bff0..4df8739c 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/SIV.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/SIV.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class SIV extends Mode { - public SIV(@NotNull DetectionLocation detectionLocation) { + public SIV(@Nonnull DetectionLocation detectionLocation) { super("SIV", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/mode/XTS.java b/mapper/src/main/java/com/ibm/mapper/model/mode/XTS.java index 5011452d..796a26f8 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/mode/XTS.java +++ b/mapper/src/main/java/com/ibm/mapper/model/mode/XTS.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Mode; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class XTS extends Mode { - public XTS(@NotNull DetectionLocation detectionLocation) { + public XTS(@Nonnull DetectionLocation detectionLocation) { super("XTS", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/ANSIX923.java b/mapper/src/main/java/com/ibm/mapper/model/padding/ANSIX923.java index cc4b3bc4..4dec6b3d 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/ANSIX923.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/ANSIX923.java @@ -21,13 +21,13 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class ANSIX923 extends Padding { private static final String NAME = "ANSI X9.23"; // ANSIX923, X9.23 - public ANSIX923(@NotNull DetectionLocation detectionLocation) { + public ANSIX923(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/ISO10126.java b/mapper/src/main/java/com/ibm/mapper/model/padding/ISO10126.java index 732a65e2..9d7181e8 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/ISO10126.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/ISO10126.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class ISO10126 extends Padding { - public ISO10126(@NotNull DetectionLocation detectionLocation) { + public ISO10126(@Nonnull DetectionLocation detectionLocation) { super("ISO 10126", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/ISO7816.java b/mapper/src/main/java/com/ibm/mapper/model/padding/ISO7816.java index 67348cfe..4a0cb34b 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/ISO7816.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/ISO7816.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class ISO7816 extends Padding { - public ISO7816(@NotNull DetectionLocation detectionLocation) { + public ISO7816(@Nonnull DetectionLocation detectionLocation) { super("ISO 7816", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/ISO9796Padding.java b/mapper/src/main/java/com/ibm/mapper/model/padding/ISO9796Padding.java index 0aa91da8..71aaf3d1 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/ISO9796Padding.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/ISO9796Padding.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class ISO9796Padding extends Padding { - public ISO9796Padding(@NotNull DetectionLocation detectionLocation) { + public ISO9796Padding(@Nonnull DetectionLocation detectionLocation) { super("ISO 9796", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS1.java b/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS1.java index 9dce4d8a..547f6121 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS1.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS1.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class PKCS1 extends Padding { - public PKCS1(@NotNull DetectionLocation detectionLocation) { + public PKCS1(@Nonnull DetectionLocation detectionLocation) { super("PKCS1", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS5.java b/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS5.java index cb8f1f30..116d1b6a 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS5.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS5.java @@ -21,11 +21,11 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class PKCS5 extends Padding { - public PKCS5(@NotNull DetectionLocation detectionLocation) { + public PKCS5(@Nonnull DetectionLocation detectionLocation) { super("PKCS5", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS7.java b/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS7.java index 18dc0d97..68091ed8 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS7.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/PKCS7.java @@ -21,10 +21,10 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class PKCS7 extends Padding { - public PKCS7(@NotNull DetectionLocation detectionLocation) { + public PKCS7(@Nonnull DetectionLocation detectionLocation) { super("PKCS7", detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/TBC.java b/mapper/src/main/java/com/ibm/mapper/model/padding/TBC.java index 22e314c3..30a12c4a 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/TBC.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/TBC.java @@ -21,13 +21,13 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class TBC extends Padding { private static final String NAME = "TBC"; // Trailing Bit Complement - public TBC(@NotNull DetectionLocation detectionLocation) { + public TBC(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/padding/Zero.java b/mapper/src/main/java/com/ibm/mapper/model/padding/Zero.java index 75a103c0..242be5ae 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/padding/Zero.java +++ b/mapper/src/main/java/com/ibm/mapper/model/padding/Zero.java @@ -21,14 +21,14 @@ import com.ibm.mapper.model.Padding; import com.ibm.mapper.utils.DetectionLocation; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public final class Zero extends Padding { private static final String NAME = "Zero"; // "Zero Padding", "Null Padding", "Zero Byte Padding" - public Zero(@NotNull DetectionLocation detectionLocation) { + public Zero(@Nonnull DetectionLocation detectionLocation) { super(NAME, detectionLocation); } } diff --git a/mapper/src/main/java/com/ibm/mapper/model/protocol/TLS.java b/mapper/src/main/java/com/ibm/mapper/model/protocol/TLS.java index c0986100..2c7a0699 100644 --- a/mapper/src/main/java/com/ibm/mapper/model/protocol/TLS.java +++ b/mapper/src/main/java/com/ibm/mapper/model/protocol/TLS.java @@ -26,11 +26,10 @@ import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public final class TLS extends Protocol { - public TLS(@NotNull DetectionLocation detectionLocation) { + public TLS(@Nonnull DetectionLocation detectionLocation) { super(new Protocol("TLS", detectionLocation), TLS.class); } diff --git a/mapper/src/main/java/com/ibm/mapper/reorganizer/UsualPerformActions.java b/mapper/src/main/java/com/ibm/mapper/reorganizer/UsualPerformActions.java index 3456229d..9b824589 100644 --- a/mapper/src/main/java/com/ibm/mapper/reorganizer/UsualPerformActions.java +++ b/mapper/src/main/java/com/ibm/mapper/reorganizer/UsualPerformActions.java @@ -28,7 +28,6 @@ import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; /** * This class contains public static {@code Function3} implementing usual reorganization actions, @@ -122,7 +121,7 @@ public static IFunctionPerformReorganization performReplacingNode( @Nonnull private static List replaceNode( @Nonnull INode newNode, - @NotNull INode originalNode, + @Nonnull INode originalNode, @Nullable INode parent, @Nonnull List roots) { // Add all the children to the new node diff --git a/mapper/src/main/java/com/ibm/mapper/reorganizer/builder/ReorganizerRuleBuilder.java b/mapper/src/main/java/com/ibm/mapper/reorganizer/builder/ReorganizerRuleBuilder.java index c76e64af..a5e1c401 100644 --- a/mapper/src/main/java/com/ibm/mapper/reorganizer/builder/ReorganizerRuleBuilder.java +++ b/mapper/src/main/java/com/ibm/mapper/reorganizer/builder/ReorganizerRuleBuilder.java @@ -22,7 +22,6 @@ import com.ibm.mapper.reorganizer.IReorganizerRule; import com.ibm.mapper.reorganizer.IReorganizerRule.KindBuilder; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; public final class ReorganizerRuleBuilder implements IReorganizerRule.IReorganizerRuleBuilder { @@ -32,7 +31,7 @@ public final class ReorganizerRuleBuilder implements IReorganizerRule.IReorganiz } @Override - public @NotNull KindBuilder createReorganizerRule(@NotNull String ruleName) { + public @Nonnull KindBuilder createReorganizerRule(@Nonnull String ruleName) { return new ReorganizerRuleBuilderImpl(ruleName); } } diff --git a/output/src/main/java/com/ibm/output/cyclondx/builder/AlgorithmComponentBuilder.java b/output/src/main/java/com/ibm/output/cyclondx/builder/AlgorithmComponentBuilder.java index 32376f46..9baa5cb5 100644 --- a/output/src/main/java/com/ibm/output/cyclondx/builder/AlgorithmComponentBuilder.java +++ b/output/src/main/java/com/ibm/output/cyclondx/builder/AlgorithmComponentBuilder.java @@ -64,7 +64,6 @@ import org.cyclonedx.model.component.crypto.enums.CryptoFunction; import org.cyclonedx.model.component.crypto.enums.Primitive; import org.cyclonedx.model.component.evidence.Occurrence; -import org.jetbrains.annotations.NotNull; public class AlgorithmComponentBuilder implements IAlgorithmComponentBuilder { @Nonnull private final Component component; @@ -109,7 +108,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder algorithm(@Nullable INode algorithm) { + public @Nonnull IAlgorithmComponentBuilder algorithm(@Nullable INode algorithm) { this.algorithm = algorithm; return new AlgorithmComponentBuilder( component, @@ -123,7 +122,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder parameterSetIdentifier( + public @Nonnull IAlgorithmComponentBuilder parameterSetIdentifier( @Nullable INode parameterSetIdentifier) { return new AlgorithmComponentBuilder( component, @@ -137,7 +136,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder mode(@Nullable INode mode) { + public @Nonnull IAlgorithmComponentBuilder mode(@Nullable INode mode) { if (mode == null) { return new AlgorithmComponentBuilder( component, @@ -165,7 +164,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder primitive(@Nullable INode primitive) { + public @Nonnull IAlgorithmComponentBuilder primitive(@Nullable INode primitive) { if (primitive == null) { return new AlgorithmComponentBuilder( component, @@ -221,7 +220,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder padding(@Nullable INode padding) { + public @Nonnull IAlgorithmComponentBuilder padding(@Nullable INode padding) { if (padding == null) { return new AlgorithmComponentBuilder( component, @@ -250,7 +249,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder curve(@Nullable INode curve) { + public @Nonnull IAlgorithmComponentBuilder curve(@Nullable INode curve) { this.curve = curve; if (curve instanceof EllipticCurve ellipticCurve) { this.algorithmProperties.setCurve(ellipticCurve.asString()); @@ -267,7 +266,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder cryptoFunctions(@Nullable INode... cryptoFunctions) { + public @Nonnull IAlgorithmComponentBuilder cryptoFunctions(@Nullable INode... cryptoFunctions) { if (cryptoFunctions == null || cryptoFunctions.length == 0) { return new AlgorithmComponentBuilder( component, @@ -327,7 +326,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder occurrences(@Nullable Occurrence... occurrences) { + public @Nonnull IAlgorithmComponentBuilder occurrences(@Nullable Occurrence... occurrences) { if (occurrences == null) { return new AlgorithmComponentBuilder( component, @@ -356,7 +355,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull IAlgorithmComponentBuilder oid(@Nullable INode oid) { + public @Nonnull IAlgorithmComponentBuilder oid(@Nullable INode oid) { if (oid instanceof Oid oid1) { this.cryptoProperties.setOid(oid1.getValue()); } @@ -372,7 +371,7 @@ public static IAlgorithmComponentBuilder create() { } @Override - public @NotNull Component build() { + public @Nonnull Component build() { if (parameterSetIdentifier != null) { this.algorithmProperties.setParameterSetIdentifier(parameterSetIdentifier.asString()); diff --git a/output/src/main/java/com/ibm/output/cyclondx/builder/ProtocolComponentBuilder.java b/output/src/main/java/com/ibm/output/cyclondx/builder/ProtocolComponentBuilder.java index e60eec6c..c1028cc6 100644 --- a/output/src/main/java/com/ibm/output/cyclondx/builder/ProtocolComponentBuilder.java +++ b/output/src/main/java/com/ibm/output/cyclondx/builder/ProtocolComponentBuilder.java @@ -31,6 +31,7 @@ import java.util.UUID; import java.util.function.BiFunction; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.cyclonedx.model.Component; import org.cyclonedx.model.Evidence; import org.cyclonedx.model.component.crypto.CryptoProperties; @@ -38,8 +39,6 @@ import org.cyclonedx.model.component.crypto.enums.AssetType; import org.cyclonedx.model.component.crypto.enums.ProtocolType; import org.cyclonedx.model.component.evidence.Occurrence; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class ProtocolComponentBuilder implements IProtocolComponentBuilder { @Nonnull private final Component component; @@ -72,7 +71,8 @@ public static IProtocolComponentBuilder create( return new ProtocolComponentBuilder(algorithmComponentBuilder); } - @NotNull @Override + @Nonnull + @Override public IProtocolComponentBuilder name(@Nullable Protocol name) { if (name == null) { return new ProtocolComponentBuilder( @@ -84,7 +84,8 @@ public IProtocolComponentBuilder name(@Nullable Protocol name) { component, cryptoProperties, protocolProperties, algorithmComponentBuilder); } - @NotNull @Override + @Nonnull + @Override public IProtocolComponentBuilder type(@Nullable Protocol type) { if (type == null) { protocolProperties.setType(ProtocolType.UNKNOWN); @@ -102,7 +103,8 @@ public IProtocolComponentBuilder type(@Nullable Protocol type) { component, cryptoProperties, protocolProperties, algorithmComponentBuilder); } - @NotNull @Override + @Nonnull + @Override public IProtocolComponentBuilder version(@Nullable INode version) { if (version == null) { return new ProtocolComponentBuilder( @@ -113,7 +115,8 @@ public IProtocolComponentBuilder version(@Nullable INode version) { component, cryptoProperties, protocolProperties, algorithmComponentBuilder); } - @NotNull @Override + @Nonnull + @Override public IProtocolComponentBuilder cipherSuites(@Nullable INode node) { if (node == null) { return new ProtocolComponentBuilder( @@ -164,7 +167,8 @@ public IProtocolComponentBuilder cipherSuites(@Nullable INode node) { component, cryptoProperties, protocolProperties, algorithmComponentBuilder); } - @NotNull @Override + @Nonnull + @Override public IProtocolComponentBuilder occurrences(@Nullable Occurrence... occurrences) { if (occurrences == null) { return new ProtocolComponentBuilder( @@ -177,7 +181,8 @@ public IProtocolComponentBuilder occurrences(@Nullable Occurrence... occurrences component, cryptoProperties, protocolProperties, algorithmComponentBuilder); } - @NotNull @Override + @Nonnull + @Override public Component build() { this.cryptoProperties.setAssetType(AssetType.PROTOCOL); this.cryptoProperties.setProtocolProperties(protocolProperties); diff --git a/output/src/main/java/com/ibm/output/cyclondx/builder/RelatedCryptoMaterialComponentBuilder.java b/output/src/main/java/com/ibm/output/cyclondx/builder/RelatedCryptoMaterialComponentBuilder.java index d9950ee8..9be97f9c 100644 --- a/output/src/main/java/com/ibm/output/cyclondx/builder/RelatedCryptoMaterialComponentBuilder.java +++ b/output/src/main/java/com/ibm/output/cyclondx/builder/RelatedCryptoMaterialComponentBuilder.java @@ -40,7 +40,6 @@ import org.cyclonedx.model.component.crypto.enums.AssetType; import org.cyclonedx.model.component.crypto.enums.RelatedCryptoMaterialType; import org.cyclonedx.model.component.evidence.Occurrence; -import org.jetbrains.annotations.NotNull; public class RelatedCryptoMaterialComponentBuilder implements IRelatedCryptoMaterialComponentBuilder { @@ -164,7 +163,7 @@ public IRelatedCryptoMaterialComponentBuilder size(@Nullable INode size) { } @Override - public @NotNull IRelatedCryptoMaterialComponentBuilder occurrences( + public @Nonnull IRelatedCryptoMaterialComponentBuilder occurrences( @Nullable Occurrence... occurrences) { if (occurrences == null) { return new RelatedCryptoMaterialComponentBuilder( @@ -178,7 +177,7 @@ public IRelatedCryptoMaterialComponentBuilder size(@Nullable INode size) { } @Override - public @NotNull Component build() { + public @Nonnull Component build() { this.cryptoProperties.setAssetType(AssetType.RELATED_CRYPTO_MATERIAL); this.cryptoProperties.setRelatedCryptoMaterialProperties(relatedCryptoMaterialProperties); diff --git a/output/src/main/java/com/ibm/output/cyclondx/builder/Utils.java b/output/src/main/java/com/ibm/output/cyclondx/builder/Utils.java index 42adbfc9..54214db5 100644 --- a/output/src/main/java/com/ibm/output/cyclondx/builder/Utils.java +++ b/output/src/main/java/com/ibm/output/cyclondx/builder/Utils.java @@ -28,7 +28,6 @@ import javax.annotation.Nonnull; import org.cyclonedx.model.component.crypto.enums.Mode; import org.cyclonedx.model.component.crypto.enums.Padding; -import org.jetbrains.annotations.NotNull; public final class Utils { @@ -36,19 +35,19 @@ private Utils() { // nothing } - public static @NotNull Optional parseStringToMode(@Nonnull String string) { + public static @Nonnull Optional parseStringToMode(@Nonnull String string) { return Arrays.stream(org.cyclonedx.model.component.crypto.enums.Mode.values()) .filter(k -> k.name().equalsIgnoreCase(string)) .findFirst(); } - public static @NotNull Optional parseStringToPadding(@Nonnull String string) { + public static @Nonnull Optional parseStringToPadding(@Nonnull String string) { return Arrays.stream(org.cyclonedx.model.component.crypto.enums.Padding.values()) .filter(k -> k.name().equalsIgnoreCase(string)) .findFirst(); } - public static @NotNull Predicate distinctByKey( + public static @Nonnull Predicate distinctByKey( @Nonnull Function keyExtractor) { Map map = new ConcurrentHashMap<>(); return t -> map.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; diff --git a/pom.xml b/pom.xml index 1aa7a500..72c31359 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 10.7.0.96327 9.14.0.375 - 10.14.0.2599 + 10.13.0.2560 8.6.0.37351 4.23.0.17664 @@ -64,24 +64,12 @@ - - org.jetbrains - annotations - 26.0.1 - compile - - org.sonarsource.api.plugin sonar-plugin-api ${sonar.plugin.api.version} provided - - com.google.code.findbugs - jsr305 - 3.0.2 - org.apache.commons commons-lang3 @@ -141,12 +129,6 @@ 3.26.3 test - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - 2.18.1 - compile - diff --git a/python/src/main/java/com/ibm/plugin/PythonAggregator.java b/python/src/main/java/com/ibm/plugin/PythonAggregator.java index 88297cfd..532e726c 100644 --- a/python/src/main/java/com/ibm/plugin/PythonAggregator.java +++ b/python/src/main/java/com/ibm/plugin/PythonAggregator.java @@ -27,7 +27,6 @@ import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; import org.sonar.plugins.python.api.symbols.Symbol; @@ -50,7 +49,6 @@ private PythonAggregator() { } @Nonnull - @Unmodifiable public static List getDetectedNodes() { return Collections.unmodifiableList(detectedNodes); } diff --git a/python/src/main/java/com/ibm/plugin/PythonCheckRegistrar.java b/python/src/main/java/com/ibm/plugin/PythonCheckRegistrar.java index 5d121f62..5533171a 100644 --- a/python/src/main/java/com/ibm/plugin/PythonCheckRegistrar.java +++ b/python/src/main/java/com/ibm/plugin/PythonCheckRegistrar.java @@ -32,9 +32,8 @@ public String repositoryKey() { return PythonScannerRuleDefinition.REPOSITORY_KEY; } - @SuppressWarnings({"rawtypes"}) @Override - public List checkClasses() { + public List> checkClasses() { // Creating a new list is necessary to return a type // List from the type List> return new ArrayList<>(PythonRuleList.getPythonChecks()); diff --git a/python/src/main/java/com/ibm/plugin/PythonRuleList.java b/python/src/main/java/com/ibm/plugin/PythonRuleList.java index 4e2624ef..35441d2f 100644 --- a/python/src/main/java/com/ibm/plugin/PythonRuleList.java +++ b/python/src/main/java/com/ibm/plugin/PythonRuleList.java @@ -24,16 +24,14 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; -import org.jetbrains.annotations.UnmodifiableView; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.PythonCheck; public final class PythonRuleList { private PythonRuleList() {} - public static @NotNull @UnmodifiableView List> getChecks() { + public static @Nonnull List> getChecks() { List> checks = new ArrayList<>(); checks.addAll(getPythonChecks()); checks.addAll(getPythonTestChecks()); @@ -41,12 +39,12 @@ private PythonRuleList() {} } /** These rules are going to target MAIN code only */ - public static @NotNull @Unmodifiable List> getPythonChecks() { + public static @Nonnull List> getPythonChecks() { return List.of(PythonInventoryRule.class, PythonNoMD5UseRule.class); } /** These rules are going to target TEST code only */ - public static @Unmodifiable List> getPythonTestChecks() { + public static List> getPythonTestChecks() { return List.of(); } } diff --git a/python/src/main/java/com/ibm/plugin/rules/PythonInventoryRule.java b/python/src/main/java/com/ibm/plugin/rules/PythonInventoryRule.java index c77103fd..a95e7bf1 100644 --- a/python/src/main/java/com/ibm/plugin/rules/PythonInventoryRule.java +++ b/python/src/main/java/com/ibm/plugin/rules/PythonInventoryRule.java @@ -28,10 +28,8 @@ import com.ibm.rules.issue.Issue; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; -import org.jetbrains.annotations.VisibleForTesting; import org.sonar.check.Rule; +import org.sonar.java.annotations.VisibleForTesting; import org.sonar.plugins.python.api.tree.Tree; @Rule(key = "Inventory") @@ -47,8 +45,8 @@ protected PythonInventoryRule(@Nonnull List> detectionRules } @Override - public @NotNull List> report( - @NotNull Tree markerTree, @NotNull @Unmodifiable List translatedNodes) { + public @Nonnull List> report( + @Nonnull Tree markerTree, @Nonnull List translatedNodes) { return new InventoryRule().report(markerTree, translatedNodes); } } diff --git a/python/src/main/java/com/ibm/plugin/rules/PythonNoMD5UseRule.java b/python/src/main/java/com/ibm/plugin/rules/PythonNoMD5UseRule.java index 6e53a7ef..4bf1e0f9 100644 --- a/python/src/main/java/com/ibm/plugin/rules/PythonNoMD5UseRule.java +++ b/python/src/main/java/com/ibm/plugin/rules/PythonNoMD5UseRule.java @@ -24,17 +24,17 @@ import com.ibm.rules.NoMD5UseForMessageDigestRule; import com.ibm.rules.issue.Issue; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; +import javax.annotation.Nonnull; import org.sonar.check.Rule; import org.sonar.plugins.python.api.tree.Tree; @Rule(key = "PythonNoMD5use") public final class PythonNoMD5UseRule extends PythonBaseDetectionRule { + @Nonnull @Override - public @NotNull List> report( - @NotNull Tree markerTree, @NotNull @Unmodifiable List translatedNodes) { + public List> report( + @Nonnull Tree markerTree, @Nonnull List translatedNodes) { return new NoMD5UseForMessageDigestRule().report(markerTree, translatedNodes); } } diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/PythonBaseDetectionRule.java b/python/src/main/java/com/ibm/plugin/rules/detection/PythonBaseDetectionRule.java index 315a418e..e3dfd349 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/PythonBaseDetectionRule.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/PythonBaseDetectionRule.java @@ -34,8 +34,6 @@ import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorCheck; import org.sonar.plugins.python.api.PythonVisitorContext; @@ -106,8 +104,8 @@ public void update(@Nonnull Finding> report( - @Nonnull Tree markerTree, @NotNull @Unmodifiable List translatedNodes) { + public List> report( + @Nonnull Tree markerTree, @Nonnull List translatedNodes) { // override by higher level rule, to report an issue return Collections.emptyList(); } diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAEAD.java b/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAEAD.java index 5e2f6fa1..e114049b 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAEAD.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAEAD.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -79,7 +78,6 @@ private PycaAEAD() { .withDependingDetectionRules( List.of(ENCRYPT_CHACHA20POLY1305, DECRYPT_CHACHA20POLY1305)); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_CHACHA20POLY1305); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAES.java b/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAES.java index f119a7ab..b9cf0910 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAES.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/aead/PycaAES.java @@ -32,8 +32,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -48,7 +46,7 @@ private PycaAES() { private static final String AEAD_TYPE_PREFIX = "cryptography.hazmat.primitives.ciphers.aead."; - private static @NotNull IDetectionRule encryptAES(String aesAlgorithm) { + private static @Nonnull IDetectionRule encryptAES(String aesAlgorithm) { return new DetectionRuleBuilder() .createDetectionRule() .forObjectTypes(AEAD_TYPE_PREFIX + aesAlgorithm) @@ -61,7 +59,7 @@ private PycaAES() { .withoutDependingDetectionRules(); } - private static @NotNull IDetectionRule decryptAES(String aesAlgorithm) { + private static @Nonnull IDetectionRule decryptAES(String aesAlgorithm) { return new DetectionRuleBuilder() .createDetectionRule() .forObjectTypes(AEAD_TYPE_PREFIX + aesAlgorithm) @@ -74,7 +72,7 @@ private PycaAES() { .withoutDependingDetectionRules(); } - private static @NotNull List> generationRulesAES() { + private static @Nonnull List> generationRulesAES() { LinkedList> rules = new LinkedList<>(); for (String aesAlgorithm : aesAlgorithms) { rules.add( @@ -94,7 +92,6 @@ private PycaAES() { return rules; } - @Unmodifiable @Nonnull public static List> rules() { return generationRulesAES(); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDSA.java b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDSA.java index 170a4f8a..c0265550 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDSA.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDSA.java @@ -36,7 +36,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -98,7 +97,6 @@ private PycaDSA() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_DSA, PUBLIC_NUMBERS_DSA, PRIVATE_NUMBERS_DSA); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDiffieHellman.java b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDiffieHellman.java index 55d61538..0f21fc89 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDiffieHellman.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaDiffieHellman.java @@ -32,7 +32,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -95,7 +94,6 @@ private PycaDiffieHellman() { .inBundle(() -> "CryptographyDiffieHellman") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_DH, PUBLIC_NUMBERS_DH, PRIVATE_NUMBERS_DH); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaEllipticCurve.java b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaEllipticCurve.java index 45b06a19..ae15731d 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaEllipticCurve.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaEllipticCurve.java @@ -37,7 +37,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -143,7 +142,6 @@ private PycaEllipticCurve() { .inBundle(() -> "Pyca") .withDependingDetectionRules(List.of(PRIVATE_NUMBERS_EC)); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_EC, DERIVATION_EC, PUBLIC_NUMBERS_EC); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaRSA.java b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaRSA.java index c5e9c18b..1156f822 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaRSA.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaRSA.java @@ -40,7 +40,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -188,7 +187,6 @@ private PycaRSA() { .inBundle(() -> "Pyca") .withDependingDetectionRules(List.of(SIGN_RSA /*, VERIFY_RSA*/, DECRYPT_RSA)); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_RSA, PUBLIC_NUMBERS_RSA, PRIVATE_NUMBERS_RSA); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaSign.java b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaSign.java index 0e4586c6..6fbb7f31 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaSign.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/asymmetric/PycaSign.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -61,7 +60,6 @@ private PycaSign() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(SIGN_ED25519, SIGN_ED448); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/fernet/PycaFernet.java b/python/src/main/java/com/ibm/plugin/rules/detection/fernet/PycaFernet.java index c6e162eb..64f90095 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/fernet/PycaFernet.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/fernet/PycaFernet.java @@ -31,8 +31,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -42,7 +40,7 @@ private PycaFernet() { // private } - private static @NotNull List> encryptDecryptFernet() { + private static @Nonnull List> encryptDecryptFernet() { List methodNames = List.of("encrypt", "encrypt_at_time", "decrypt", "decrypt_at_time"); List objectNames = List.of("Fernet", "MultiFernet"); @@ -80,7 +78,6 @@ private PycaFernet() { .inBundle(() -> "Pyca") .withDependingDetectionRules(encryptDecryptFernet()); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_FERNET); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/hash/PycaHash.java b/python/src/main/java/com/ibm/plugin/rules/detection/hash/PycaHash.java index 26f6a0c1..be7c2543 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/hash/PycaHash.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/hash/PycaHash.java @@ -27,8 +27,6 @@ import java.util.LinkedList; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -59,7 +57,7 @@ private PycaHash() { "BLAKE2s", "SM3"); - private static @NotNull List> hashesRules() { + private static @Nonnull List> hashesRules() { LinkedList> rules = new LinkedList<>(); for (final String hash : PycaHash.hashes) { rules.add( @@ -87,7 +85,6 @@ private PycaHash() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { final List> hashAndPrehashRules = new LinkedList<>(hashesRules()); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/kdf/PycaKDF.java b/python/src/main/java/com/ibm/plugin/rules/detection/kdf/PycaKDF.java index bd904261..fa00618f 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/kdf/PycaKDF.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/kdf/PycaKDF.java @@ -34,7 +34,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -206,7 +205,6 @@ private PycaKDF() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of( diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/keyagreement/PycaKeyAgreement.java b/python/src/main/java/com/ibm/plugin/rules/detection/keyagreement/PycaKeyAgreement.java index 75081b64..aa014c9f 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/keyagreement/PycaKeyAgreement.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/keyagreement/PycaKeyAgreement.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -60,7 +59,6 @@ private PycaKeyAgreement() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(GENERATION_X25519, GENERATION_X448); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/mac/PycaMAC.java b/python/src/main/java/com/ibm/plugin/rules/detection/mac/PycaMAC.java index e8ec37a2..0dc6e35a 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/mac/PycaMAC.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/mac/PycaMAC.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -75,7 +74,6 @@ private PycaMAC() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(NEW_CMAC, NEW_HMAC, NEW_POLY1305); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/padding/PycaPadding.java b/python/src/main/java/com/ibm/plugin/rules/detection/padding/PycaPadding.java index 3204d86b..eb46c6b1 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/padding/PycaPadding.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/padding/PycaPadding.java @@ -31,8 +31,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -44,7 +42,7 @@ private PycaPadding() { private static final List paddings = Arrays.asList("PKCS7", "ANSIX923"); - private static @NotNull List> newPadding() { + private static @Nonnull List> newPadding() { final LinkedList> rules = new LinkedList<>(); for (String padding : paddings) { @@ -87,7 +85,7 @@ private PycaPadding() { // It should be better to only detect Padding when it actually gets implied (i.e. there is // `padder.update` function call). However, it does not bring much, and creates problems // because the type handler may not distinguish an `encryptor.update` from `padder.update`. - @Unmodifiable + @Nonnull public static List> rules() { return newPadding(); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/symmetric/PycaCipher.java b/python/src/main/java/com/ibm/plugin/rules/detection/symmetric/PycaCipher.java index dff5bf4d..68dd2bbb 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/symmetric/PycaCipher.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/symmetric/PycaCipher.java @@ -31,8 +31,6 @@ import java.util.LinkedList; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings({"java:S2386", "java:S1192"}) @@ -81,7 +79,7 @@ private PycaCipher() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - private static @NotNull List> followingNewCipherRules() { + private static @Nonnull List> followingNewCipherRules() { final List> encryptionRules = new LinkedList<>(List.of(DECRYPT_CIPHER, ENCRYPT_CIPHER)); encryptionRules.addAll(PycaPadding.rules()); @@ -103,7 +101,6 @@ private PycaCipher() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(NEW_CIPHER); diff --git a/python/src/main/java/com/ibm/plugin/rules/detection/wrapping/PycaWrapping.java b/python/src/main/java/com/ibm/plugin/rules/detection/wrapping/PycaWrapping.java index 026a7da7..2915def7 100644 --- a/python/src/main/java/com/ibm/plugin/rules/detection/wrapping/PycaWrapping.java +++ b/python/src/main/java/com/ibm/plugin/rules/detection/wrapping/PycaWrapping.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -59,7 +58,6 @@ private PycaWrapping() { .inBundle(() -> "Pyca") .withoutDependingDetectionRules(); - @Unmodifiable @Nonnull public static List> rules() { return List.of(AES_KEY_WRAP, AES_KEY_WRAP_WITH_PADDING); diff --git a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveAliasImport.java b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveAliasImport.java index 773938a8..0718f4f9 100644 --- a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveAliasImport.java +++ b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveAliasImport.java @@ -26,7 +26,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -49,7 +48,6 @@ private ResolveAliasImport() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TEST_1); diff --git a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveImportedStruct.java b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveImportedStruct.java index 8d578090..47ddead9 100644 --- a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveImportedStruct.java +++ b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveImportedStruct.java @@ -26,7 +26,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -49,7 +48,6 @@ private ResolveImportedStruct() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TEST_1); diff --git a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCall.java b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCall.java index 88c4383a..69bd7a85 100644 --- a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCall.java +++ b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCall.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -51,7 +50,6 @@ private ResolveInnerFunctionCall() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TEST_1); diff --git a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValues.java b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValues.java index b7259a81..f67a917c 100644 --- a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValues.java +++ b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValues.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -109,7 +108,6 @@ private ResolveNameTypeAndValues() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TEST_1, TEST_2, TEST_3, TEST_4, TEST_5, TEST_6); diff --git a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveScopeValues.java b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveScopeValues.java index de4c31dc..3a892f46 100644 --- a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveScopeValues.java +++ b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveScopeValues.java @@ -26,7 +26,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -49,7 +48,6 @@ private ResolveScopeValues() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TEST_1); diff --git a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooks.java b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooks.java index e2d3306d..c1d735b7 100644 --- a/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooks.java +++ b/python/src/main/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooks.java @@ -28,7 +28,6 @@ import com.ibm.engine.rule.builder.DetectionRuleBuilder; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1192") @@ -51,7 +50,6 @@ private ResolveValuesWithHooks() { // nothing } - @Unmodifiable @Nonnull public static List> rules() { return List.of(TEST_1); diff --git a/python/src/main/java/com/ibm/plugin/translation/PythonTranslationProcess.java b/python/src/main/java/com/ibm/plugin/translation/PythonTranslationProcess.java index cb165365..b3b9feb2 100644 --- a/python/src/main/java/com/ibm/plugin/translation/PythonTranslationProcess.java +++ b/python/src/main/java/com/ibm/plugin/translation/PythonTranslationProcess.java @@ -29,8 +29,7 @@ import com.ibm.plugin.translation.translator.PythonTranslator; import java.util.Collections; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; import org.sonar.plugins.python.api.symbols.Symbol; @@ -39,13 +38,15 @@ public final class PythonTranslationProcess extends ITranslationProcess { - public PythonTranslationProcess(@NotNull List reorganizerRules) { + public PythonTranslationProcess(@Nonnull List reorganizerRules) { super(reorganizerRules); } - @NotNull @Override - public @Unmodifiable List initiate( - @NotNull DetectionStore + @Nonnull + @Override + public List initiate( + @Nonnull + DetectionStore rootDetectionStore) { // 1. Translate final PythonTranslator pythonTranslator = new PythonTranslator(); diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/PythonTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/PythonTranslator.java index e0bc33bf..993efa7f 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/PythonTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/PythonTranslator.java @@ -49,7 +49,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; import org.sonar.plugins.python.api.symbols.Symbol; @@ -141,7 +140,7 @@ public Optional translate( */ @Override protected @Nullable DetectionLocation getDetectionContextFrom( - @NotNull Tree location, @NotNull IBundle bundle, @NotNull String filePath) { + @Nonnull Tree location, @Nonnull IBundle bundle, @Nonnull String filePath) { Token firstToken = location.firstToken(); Token lastToken = location.lastToken(); if (firstToken != null && lastToken != null) { diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaCipherContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaCipherContextTranslator.java index 8c2d56f9..ee1707e3 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaCipherContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaCipherContextTranslator.java @@ -53,18 +53,18 @@ import com.ibm.mapper.model.padding.PKCS7; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1301") public final class PycaCipherContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { final PycaCipherMapper pycaCipherMapper = new PycaCipherMapper(); if (value instanceof com.ibm.engine.model.Algorithm && detectionContext instanceof DetectionContext context) { diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaDigestContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaDigestContextTranslator.java index 5a4ad4d9..d91705c5 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaDigestContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaDigestContextTranslator.java @@ -29,18 +29,18 @@ import com.ibm.mapper.model.functionality.Digest; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1301") public final class PycaDigestContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof ValueAction) { final PycaDigestMapper pycaDigestMapper = new PycaDigestMapper(); return pycaDigestMapper diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyAgreementContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyAgreementContextTranslator.java index b0c65fd7..5aa65372 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyAgreementContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyAgreementContextTranslator.java @@ -35,17 +35,17 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; public class PycaKeyAgreementContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm algorithm) { return Optional.of(algorithm) .map( diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyDerivationContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyDerivationContextTranslator.java index c6fdaad6..5438c7eb 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyDerivationContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaKeyDerivationContextTranslator.java @@ -44,17 +44,17 @@ import com.ibm.mapper.model.mode.CTR; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; public class PycaKeyDerivationContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof Algorithm algorithm && detectionContext instanceof DetectionContext context) { // hash algorithm diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaMacContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaMacContextTranslator.java index 1fbb00c5..5bfabe93 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaMacContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaMacContextTranslator.java @@ -34,18 +34,18 @@ import com.ibm.mapper.model.algorithms.Poly1305; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1301") public final class PycaMacContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof com.ibm.engine.model.Algorithm algorithm && detectionContext instanceof DetectionContext context) { diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPrivateKeyContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPrivateKeyContextTranslator.java index fbf815c8..f4c28561 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPrivateKeyContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPrivateKeyContextTranslator.java @@ -59,19 +59,19 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1301") public final class PycaPrivateKeyContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof KeyAction && detectionContext instanceof DetectionContext context) { return getPrivateKey(context, null, detectionLocation); @@ -127,10 +127,10 @@ public final class PycaPrivateKeyContextTranslator implements IContextTranslatio return Optional.empty(); } - private static @NotNull Optional getPrivateKey( - @NotNull DetectionContext context, + private static @Nonnull Optional getPrivateKey( + @Nonnull DetectionContext context, @Nullable Integer keySize, - @NotNull DetectionLocation detectionLocation) { + @Nonnull DetectionLocation detectionLocation) { return context.get("algorithm") .map( str -> diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPublicKeyContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPublicKeyContextTranslator.java index cd58dd25..08ced972 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPublicKeyContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaPublicKeyContextTranslator.java @@ -33,18 +33,18 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1301") public final class PycaPublicKeyContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof KeyAction && detectionContext instanceof DetectionContext context) { return context.get("algorithm") diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretContextTranslator.java index 17e96b94..fb684259 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretContextTranslator.java @@ -31,16 +31,16 @@ import com.ibm.mapper.model.functionality.KeyGeneration; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; public final class PycaSecretContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof KeyAction && detectionContext instanceof DetectionContext context) { // action is always "generate" diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretKeyContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretKeyContextTranslator.java index 71911b22..e97d09ae 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretKeyContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSecretKeyContextTranslator.java @@ -39,17 +39,17 @@ import com.ibm.mapper.model.mode.SIV; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; public final class PycaSecretKeyContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof KeySize keySize && detectionContext instanceof DetectionContext context && context.get("kind").map(k -> k.equals("AEAD")).orElse(false)) { diff --git a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSignatureContextTranslator.java b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSignatureContextTranslator.java index d60e68ed..ddd9dddd 100644 --- a/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSignatureContextTranslator.java +++ b/python/src/main/java/com/ibm/plugin/translation/translator/contexts/PycaSignatureContextTranslator.java @@ -38,18 +38,18 @@ import com.ibm.mapper.model.functionality.Verify; import com.ibm.mapper.utils.DetectionLocation; import java.util.Optional; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.sonar.plugins.python.api.tree.Tree; @SuppressWarnings("java:S1301") public final class PycaSignatureContextTranslator implements IContextTranslation { @Override - public @NotNull Optional translate( - @NotNull IBundle bundleIdentifier, - @NotNull IValue value, - @NotNull IDetectionContext detectionContext, - @NotNull DetectionLocation detectionLocation) { + public @Nonnull Optional translate( + @Nonnull IBundle bundleIdentifier, + @Nonnull IValue value, + @Nonnull IDetectionContext detectionContext, + @Nonnull DetectionLocation detectionLocation) { if (value instanceof com.ibm.engine.model.Algorithm algorithm) { return switch (algorithm.asString().toUpperCase().trim()) { case "EC" -> diff --git a/python/src/test/java/com/ibm/plugin/TestBase.java b/python/src/test/java/com/ibm/plugin/TestBase.java index fcb9b18c..fe65cd03 100644 --- a/python/src/test/java/com/ibm/plugin/TestBase.java +++ b/python/src/test/java/com/ibm/plugin/TestBase.java @@ -31,7 +31,6 @@ import java.util.Optional; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.slf4j.event.Level; import org.sonar.api.testfixtures.log.LogTesterJUnit5; @@ -48,7 +47,7 @@ public abstract class TestBase extends PythonInventoryRule { private int findingId = 0; - public TestBase(@NotNull List> detectionRules) { + public TestBase(@Nonnull List> detectionRules) { super(detectionRules); } diff --git a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveAliasImportTest.java b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveAliasImportTest.java index cacf31f5..6cebf9af 100644 --- a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveAliasImportTest.java +++ b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveAliasImportTest.java @@ -26,7 +26,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; @@ -48,8 +47,8 @@ public ResolveAliasImportTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveImportedStructTest.java b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveImportedStructTest.java index d1259748..3833fff3 100644 --- a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveImportedStructTest.java +++ b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveImportedStructTest.java @@ -26,7 +26,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.sonar.plugins.python.api.PythonCheck; @@ -49,8 +48,8 @@ public ResolveImportedStructTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCallTest.java b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCallTest.java index 8b794e3e..f47a3739 100644 --- a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCallTest.java +++ b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveInnerFunctionCallTest.java @@ -26,7 +26,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; @@ -48,8 +47,8 @@ public ResolveInnerFunctionCallTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValuesTest.java b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValuesTest.java index 9b900332..23add375 100644 --- a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValuesTest.java +++ b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveNameTypeAndValuesTest.java @@ -26,7 +26,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; @@ -47,8 +46,8 @@ public ResolveNameTypeAndValuesTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothingÒ } diff --git a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveScopeValuesTest.java b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveScopeValuesTest.java index 50a2509d..f202c9b5 100644 --- a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveScopeValuesTest.java +++ b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveScopeValuesTest.java @@ -26,7 +26,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; @@ -47,8 +46,8 @@ public ResolveScopeValuesTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooksTest.java b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooksTest.java index 526a8a5a..68633953 100644 --- a/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooksTest.java +++ b/python/src/test/java/com/ibm/plugin/rules/resolve/ResolveValuesWithHooksTest.java @@ -26,7 +26,6 @@ import com.ibm.plugin.TestBase; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.sonar.plugins.python.api.PythonCheck; import org.sonar.plugins.python.api.PythonVisitorContext; @@ -47,8 +46,8 @@ public ResolveValuesWithHooksTest() { @Override public void asserts( int findingId, - @NotNull DetectionStore detectionStore, - @NotNull List nodes) { + @Nonnull DetectionStore detectionStore, + @Nonnull List nodes) { // nothing } diff --git a/python/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java b/python/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java index 1a04ed20..dc04f0c5 100644 --- a/python/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java +++ b/python/src/test/java/com/ibm/plugin/utils/GenerateAssertsHelper.java @@ -32,7 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.plugins.python.api.PythonCheck; @@ -60,8 +60,8 @@ public class GenerateAssertsHelper { * @param translationRoots - The list of root nodes of translation trees */ public static void generate( - @NotNull DetectionStore detectionStore, - @NotNull List translationRoots) { + @Nonnull DetectionStore detectionStore, + @Nonnull List translationRoots) { // Create a directories if they do not yet exist try { Files.createDirectories(Paths.get(filePath)); @@ -103,8 +103,8 @@ public static void generate( } private static void generateDetectionStoreAssertions( - @NotNull FileWriter writer, - @NotNull DetectionStore detectionStore, + @Nonnull FileWriter writer, + @Nonnull DetectionStore detectionStore, String detectionStoreVarName) throws IOException { writer.write( @@ -178,7 +178,7 @@ private static void generateDetectionStoreAssertions( } private static void generateNodeAssertions( - @NotNull FileWriter writer, @NotNull List nodes) throws IOException { + @Nonnull FileWriter writer, @Nonnull List nodes) throws IOException { writer.write( String.format( "assertThat(%s).hasSize(%d);%n%n", @@ -199,7 +199,7 @@ private static void generateNodeAssertions( private static void generateNodeAssertionsRecursive( FileWriter writer, - @NotNull INode node, + @Nonnull INode node, String previousNodeVarName, int index, String previousTitle) diff --git a/rules/src/main/java/com/ibm/rules/IReportableDetectionRule.java b/rules/src/main/java/com/ibm/rules/IReportableDetectionRule.java index eb3978e2..60485e05 100644 --- a/rules/src/main/java/com/ibm/rules/IReportableDetectionRule.java +++ b/rules/src/main/java/com/ibm/rules/IReportableDetectionRule.java @@ -23,11 +23,9 @@ import com.ibm.rules.issue.Issue; import java.util.List; import javax.annotation.Nonnull; -import org.jetbrains.annotations.Unmodifiable; public interface IReportableDetectionRule { @Nonnull - List> report( - @Nonnull T markerTree, @Nonnull @Unmodifiable List translatedNodes); + List> report(@Nonnull T markerTree, @Nonnull List translatedNodes); } diff --git a/rules/src/main/java/com/ibm/rules/InventoryRule.java b/rules/src/main/java/com/ibm/rules/InventoryRule.java index afec5815..c77942da 100644 --- a/rules/src/main/java/com/ibm/rules/InventoryRule.java +++ b/rules/src/main/java/com/ibm/rules/InventoryRule.java @@ -26,14 +26,13 @@ import com.ibm.rules.issue.Issue; import com.ibm.rules.issue.IssueCreator; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; +import javax.annotation.Nonnull; public final class InventoryRule implements IReportableDetectionRule { @Override - public @NotNull List> report( - @NotNull T markerTree, @NotNull @Unmodifiable List translatedNodes) { + public @Nonnull List> report( + @Nonnull T markerTree, @Nonnull List translatedNodes) { return IssueCreator.using(markerTree, translatedNodes) .matchesCondition( (node, parent) -> { diff --git a/rules/src/main/java/com/ibm/rules/NoMD5UseForMessageDigestRule.java b/rules/src/main/java/com/ibm/rules/NoMD5UseForMessageDigestRule.java index cc6d7363..075ebcaa 100644 --- a/rules/src/main/java/com/ibm/rules/NoMD5UseForMessageDigestRule.java +++ b/rules/src/main/java/com/ibm/rules/NoMD5UseForMessageDigestRule.java @@ -25,8 +25,7 @@ import com.ibm.rules.issue.Issue; import com.ibm.rules.issue.IssueCreator; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; +import javax.annotation.Nonnull; /** * While MD5 is still used in some applications, it is no longer considered secure for cryptographic @@ -44,8 +43,8 @@ */ public final class NoMD5UseForMessageDigestRule implements IReportableDetectionRule { @Override - public @NotNull List> report( - @NotNull T markerTree, @NotNull @Unmodifiable List translatedNodes) { + public @Nonnull List> report( + @Nonnull T markerTree, @Nonnull List translatedNodes) { return IssueCreator.using(markerTree, translatedNodes) .matchesCondition( (node, parent) -> { diff --git a/rules/src/main/java/com/ibm/rules/issue/IssueCreator.java b/rules/src/main/java/com/ibm/rules/issue/IssueCreator.java index 9d4aa4f0..98b9f062 100644 --- a/rules/src/main/java/com/ibm/rules/issue/IssueCreator.java +++ b/rules/src/main/java/com/ibm/rules/issue/IssueCreator.java @@ -28,10 +28,9 @@ import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.jetbrains.annotations.Unmodifiable; public final class IssueCreator { - @Nonnull @Unmodifiable private final List nodes; + @Nonnull private final List nodes; @Nonnull private final T markedTree; @Nonnull private final Set matchedNodes; @Nullable private final INode matchedParentNode; @@ -55,8 +54,7 @@ private IssueCreator( } @Nonnull - public static IssueCreator using( - @Nonnull T markedTree, @Nonnull @Unmodifiable List nodes) { + public static IssueCreator using(@Nonnull T markedTree, @Nonnull List nodes) { return new IssueCreator<>(nodes, markedTree); } diff --git a/sonar-cryptography-plugin/src/main/java/com/ibm/plugin/Configuration.java b/sonar-cryptography-plugin/src/main/java/com/ibm/plugin/Configuration.java index c3e86655..7e08b793 100644 --- a/sonar-cryptography-plugin/src/main/java/com/ibm/plugin/Configuration.java +++ b/sonar-cryptography-plugin/src/main/java/com/ibm/plugin/Configuration.java @@ -20,8 +20,7 @@ package com.ibm.plugin; import java.util.List; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Unmodifiable; +import javax.annotation.Nonnull; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.resources.Qualifiers; @@ -29,7 +28,7 @@ public final class Configuration { private Configuration() {} - public static @NotNull @Unmodifiable List getPropertyDefinitions() { + public static @Nonnull List getPropertyDefinitions() { return List.of( PropertyDefinition.builder(Constants.CBOM_OUTPUT_NAME) .onQualifiers(Qualifiers.PROJECT)