desertsyao commited on
Commit
ef4d042
·
verified ·
1 Parent(s): a71c374

Upload folder using huggingface_hub

Browse files
input_validation_codebert_v1/best_metrics.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "loss": 0.6111653279247028,
3
+ "accuracy": 0.9051094890510949,
4
+ "macro_f1": 0.9009730330831249,
5
+ "labels": [
6
+ "input_validation",
7
+ "unrelated"
8
+ ],
9
+ "precision": [
10
+ 0.8571428571428571,
11
+ 0.9382716049382716
12
+ ],
13
+ "recall": [
14
+ 0.9056603773584906,
15
+ 0.9047619047619048
16
+ ],
17
+ "f1": [
18
+ 0.8807339449541285,
19
+ 0.9212121212121213
20
+ ],
21
+ "support": [
22
+ 53,
23
+ 84
24
+ ],
25
+ "confusion_matrix": [
26
+ [
27
+ 48,
28
+ 5
29
+ ],
30
+ [
31
+ 8,
32
+ 76
33
+ ]
34
+ ],
35
+ "classification_report": " precision recall f1-score support\n\ninput_validation 0.86 0.91 0.88 53\n unrelated 0.94 0.90 0.92 84\n\n accuracy 0.91 137\n macro avg 0.90 0.91 0.90 137\n weighted avg 0.91 0.91 0.91 137\n"
36
+ }
input_validation_codebert_v1/best_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8f43286da9b474b7dd376e05415ffbdf862db385bfc7b4201805e1c8e90b693
3
+ size 498751644
input_validation_codebert_v1/best_validation_errors.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset_index,text,true_label,predicted_label,correct,error_type,probability_input_validation,probability_unrelated
2
+ 17,@Override public OAuth2TokenValidatorResult validate(T token) { Collection<OAuth2Error> errors = new ArrayList<>(); for (OAuth2TokenValidator<T> validator : this.tokenValidators) { errors.addAll(validator.validate(token).getErrors()); } return OAuth2TokenValidatorResult.failure(errors); },unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981728792190552,0.0018270574510097504
3
+ 21,"public void validateSignatureAgainstProfile() throws WSSecurityException { Signature sig = getSignature(); if (sig != null) { SAMLSignatureProfileValidator validator = new SAMLSignatureProfileValidator(); try { validator.validate(sig); } catch (SignatureException ex) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, ""empty"", new Object[] {""SAML signature validation failed""}); } } }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980600476264954,0.0019399269949644804
4
+ 31,"private final static Pattern MAX_AGE_PATTERN = Pattern.compile(""^\\-?[0-9]+$"");",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0008087989408522844,0.9991912245750427
5
+ 39,"public static byte[] decodeFromFile(String filename) throws java.io.IOException { byte[] decodedData = null; Base64.InputStream bis = null; try { Path file = Paths.get(filename); byte[] buffer; int length = 0; int numBytes; if (Files.size(file) > Integer.MAX_VALUE) { throw new java.io.IOException(""File is too big for this convenience method ("" + Files.size(file) + "" bytes).""); } buffer = new byte[(int) Files.size(file)];",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004972864990122616,0.9995026588439941
6
+ 44,"protected PathResource getFileResource(final Path file, final String path, final Path symlinkBase, String normalizedFile) throws IOException { if (this.caseSensitive) { if (symlinkBase != null) { String relative = symlinkBase.relativize(file.normalize()).toString(); String fileResolved = file.toRealPath().toString(); String symlinkBaseResolved = symlinkBase.toRealPath().toString(); if (!fileResolved.startsWith(symlinkBaseResolved)) { log.tracef(""Rejected path resource %s from path resource manager with base %s, as the case did not match actual case of %s"", path, base, normalizedFile); return null; } String compare = fileResolved.substring(symlinkBaseResolved.length()); if(compare.startsWith(fileSystem.getSeparator())) { compare = compare.substring(fileSystem.getSeparator().length()); } if(relative.startsWith(fileSystem.getSeparator())) { relative = relative.substring(fileSystem.getSeparator().length()); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004937829216942191,0.9995062351226807
7
+ 45,"public CachingResourceManager(final int metadataCacheSize, final long maxFileSize, final DirectBufferCache dataCache, final ResourceManager underlyingResourceManager, final int maxAge) { this.maxFileSize = maxFileSize; this.underlyingResourceManager = underlyingResourceManager; this.dataCache = dataCache; if(maxAge > 0 || maxAge == MAX_AGE_NO_CACHING || maxAge == MAX_AGE_NO_EXPIRY) { this.maxAge = maxAge; } else { UndertowLogger.ROOT_LOGGER.wrongCacheTTLValue(maxAge, MAX_AGE_NO_CACHING); this.maxAge = MAX_AGE_NO_CACHING; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004814083513338119,0.999518632888794
8
+ 64,"String sanitize(String outString, String contentTypeId);",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980699419975281,0.0019300220301374793
9
+ 65,"public static String canonicalize(final String path) { return canonicalize(path, false); }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9938609600067139,0.006139026023447514
10
+ 66,"private static long asLong(final String value) throws ResourceIOException { try { return Long.parseLong(value); } catch (final NumberFormatException ex) { throw new ResourceIOException(""Invalid cache header format""); } }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.000490382662974298,0.9995095729827881
11
+ 69,"public static Document makeEmptyXmlDocument(String rootElementName) { Document document = null; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.newDocument(); } catch (Exception e) { Debug.logError(e, MODULE); } if (document == null) { return null; } if (rootElementName != null) { Element rootElement = document.createElement(rootElementName); document.appendChild(rootElement); } return document; }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981703758239746,0.0018295582849532366
12
+ 80,"@SuppressWarnings(""removal"") public DefaultOAuth2UserService() { RestTemplate restTemplate = new RestTemplate(); restTemplate.setErrorHandler(new OAuth2ErrorResponseErrorHandler()); this.restOperations = restTemplate; }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980118274688721,0.0019881611224263906
13
+ 101,public List<ResultMapping> resolveWithConstructor() { if (constructorResultMappings.isEmpty()) { return constructorResultMappings; } final List<ConstructorMetaInfo> matchingConstructorCandidates = retrieveConstructorCandidates( constructorResultMappings.size()); if (matchingConstructorCandidates.isEmpty()) { return constructorResultMappings; } final Set<String> constructorArgsByName = constructorResultMappings.stream().map(ResultMapping::getProperty) .filter(Objects::nonNull).collect(Collectors.toCollection(LinkedHashSet::new)); final boolean allMappingsHavePropertyNames = verifyPropertyNaming(constructorArgsByName);,unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9877303242683411,0.012269685976207256
14
+ 109,"private void parseSelectKeyNodes(String parentId, List<XNode> list, Class<?> parameterTypeClass, LanguageDriver langDriver, String skRequiredDatabaseId) { for (XNode nodeToHandle : list) { String id = parentId + SelectKeyGenerator.SELECT_KEY_SUFFIX; String databaseId = nodeToHandle.getStringAttribute(""databaseId""); if (databaseIdMatchesCurrent(id, databaseId, skRequiredDatabaseId)) { parseSelectKeyNode(id, nodeToHandle, parameterTypeClass, langDriver, databaseId); } } }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980114698410034,0.0019884801004081964
input_validation_codebert_v1/best_validation_predictions.csv ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset_index,text,true_label,predicted_label,correct,error_type,probability_input_validation,probability_unrelated
2
+ 0,"RangerServiceDefValidator validator = validatorFactory.getServiceDefValidator(svcStore); validator.validate(serviceDef, Action.CREATE);",input_validation,input_validation,True,,0.9981499910354614,0.0018500614678487182
3
+ 1,"@Override protected void verifyTrust( X509Certificate[] certs, boolean enableRevocation, Collection<Pattern> subjectCertConstraints ) throws WSSecurityException { if (certs.length == 1 && !enableRevocation) { String issuerString = certs[0].getIssuerX500Principal().getName(); BigInteger issuerSerial = certs[0].getSerialNumber(); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ISSUER_SERIAL); cryptoType.setIssuerSerial(issuerString, issuerSerial); X509Certificate[] foundCerts = getX509Certificates(cryptoType); if (foundCerts != null && foundCerts.length > 0 && foundCerts[0] != null && foundCerts[0].equals(certs[0])) { try { certs[0].checkValidity(); } catch (CertificateExpiredException | CertificateNotYetValidException e) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILED_CHECK, e, ""invalidCert"" ); } LOG.debug( ""Direct trust for certificate with {}"", certs[0].getSubjectX500Principal().getName() ); return; } } X509Certificate[] x509certs = certs; String issuerString = certs[0].getIssuerX500Principal().getName(); try { if (certs.length == 1) { byte[] keyIdentifierBytes = BouncyCastleUtils.getAuthorityKeyIdentifierBytes(certs[0]); X509Certificate[] foundCerts = getX509CertificatesFromKeyIdentifier(keyIdentifierBytes); if (foundCerts == null || foundCerts.length < 1) { String subjectString = certs[0].getSubjectX500Principal().getName(); LOG.debug( ""No certs found in keystore for issuer {} of certificate for {}"", issuerString, subjectString ); throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, ""certpath"", new Object[] {""No trusted certs found""} ); } x509certs = new X509Certificate[foundCerts.length + 1]; x509certs[0] = certs[0]; System.arraycopy(foundCerts, 0, x509certs, 1, foundCerts.length); } } catch (NoSuchAlgorithmException | CertificateException ex) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, ""certpath""); } LOG.debug( ""Preparing to validate certificate path for issuer {}"", issuerString ); try { List<X509Certificate> certList = Arrays.asList(x509certs); CertPath path = getCertificateFactory().generateCertPath(certList); Set<TrustAnchor> set = new HashSet<>(); if (truststore != null) { addTrustAnchors(set, truststore); } if (keystore != null && (truststore == null || loadCACerts)) { addTrustAnchors(set, keystore); } String provider = getCryptoProvider(); CertPathValidator validator = null; if (provider == null || provider.length() == 0) { validator = CertPathValidator.getInstance(""PKIX""); } else { validator = CertPathValidator.getInstance(""PKIX"", provider); } PKIXParameters param = createPKIXParameters(set, enableRevocation); validator.validate(path, param); } catch (NoSuchProviderException | NoSuchAlgorithmException | CertificateException | InvalidAlgorithmParameterException | java.security.cert.CertPathValidatorException | KeyStoreException e) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, e, ""certpath"" ); } if (!matchesSubjectDnPattern(certs[0], subjectCertConstraints)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } }",unrelated,unrelated,True,,0.0004829519602935761,0.9995170831680298
4
+ 2,"public RangerRole createRole(@QueryParam(""serviceName"") String serviceName, RangerRole role, @DefaultValue(""false"") @QueryParam(""createNonExistUserGroup"") Boolean createNonExistUserGroup) { LOG.debug(""==> createRole({})"", role); RangerRole ret; try { RangerRoleValidator validator = validatorFactory.getRangerRoleValidator(roleStore); validator.validate(role, RangerValidator.Action.CREATE);",input_validation,input_validation,True,,0.9981729984283447,0.001827010652050376
5
+ 3,"private static Converter<AssertionToken, Saml2ResponseValidatorResult> createAssertionValidator(String errorCode, Converter<AssertionToken, SAML20AssertionValidator> validatorConverter, Converter<AssertionToken, ValidationContext> contextConverter) { return (assertionToken) -> { Assertion assertion = assertionToken.assertion; SAML20AssertionValidator validator = validatorConverter.convert(assertionToken); ValidationContext context = contextConverter.convert(assertionToken); Response response = (Response) Objects.requireNonNull(assertion.getParent()); try { ValidationResult result = validator.validate(assertion, context); if (result == ValidationResult.VALID) { return Saml2ResponseValidatorResult.success(); } } catch (Exception ex) { String message = String.format(""Invalid assertion [%s] for SAML response [%s]: %s"", assertion.getID(), response.getID(), ex.getMessage()); return Saml2ResponseValidatorResult.failure(new Saml2Error(errorCode, message)); } String message = String.format(""Invalid assertion [%s] for SAML response [%s]: %s"", assertion.getID(), response.getID(), context.getValidationFailureMessages()); return Saml2ResponseValidatorResult.failure(new Saml2Error(errorCode, message)); }; }",unrelated,unrelated,True,,0.0005315858870744705,0.9994683861732483
6
+ 4,"try { RangerSecurityZoneValidator validator = validatorFactory.getSecurityZoneValidator(svcStore, securityZoneStore); validator.validate(securityZone, RangerValidator.Action.UPDATE);",input_validation,input_validation,True,,0.998155415058136,0.0018445890164002776
7
+ 5,"try { RangerRoleValidator validator = validatorFactory.getRangerRoleValidator(roleStore); validator.validate(roleId, RangerRoleValidator.Action.DELETE);",input_validation,input_validation,True,,0.9981595873832703,0.0018404638394713402
8
+ 6,"SchemaIdValidator validator = schemaContext.getSchemaRegistryConfig().getSchemaIdValidator(); if (validator != null) { if (!validator.validate(id, rootSchema, schemaLocation, result, schemaContext)) { SchemaLocation idSchemaLocation = schemaLocation.append(schemaContext.getDialect().getIdKeyword()); Error error = Error.builder() .messageKey(KeywordType.ID.getValue()).keyword(KeywordType.ID.getValue()) .instanceLocation(idSchemaLocation.getFragment()) .arguments(id, schemaContext.getDialect().getIdKeyword(), idSchemaLocation) .schemaLocation(idSchemaLocation) .schemaNode(schemaNode) .messageFormatter(args -> schemaContext.getSchemaRegistryConfig().getMessageSource().getMessage( KeywordType.ID.getValue(), schemaContext.getSchemaRegistryConfig().getLocale(), args)) .build(); throw new InvalidSchemaException(error); } }",input_validation,input_validation,True,,0.9981677532196045,0.001832181471399963
9
+ 7,"RangerServiceValidator validator = validatorFactory.getServiceValidator(svcStore); validator.validate(id, Action.DELETE);",input_validation,input_validation,True,,0.9981465339660645,0.0018534634727984667
10
+ 8,"public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { SecurityContextToken sct = new SecurityContextToken(elem); Validator validator = data.getValidator(new QName(elem.getNamespaceURI(), elem.getLocalName())); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.SCT, sct); if (validator != null) { Credential credential = new Credential(); credential.setSecurityContextToken(sct); Credential returnedCredential = validator.validate(credential, data); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); String tokenId = sct.getID(); if (tokenId.length() != 0) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } result.put(WSSecurityEngineResult.TAG_SECRET, returnedCredential.getSecretKey()); } else { String id = sct.getID(); id = XMLUtils.getIDFromReference(id); byte[] secret = null; try { secret = getSecret(data.getCallbackHandler(), sct.getIdentifier()); } catch (WSSecurityException ex) { secret = getSecret(data.getCallbackHandler(), id); } if (secret == null || secret.length == 0) { secret = getSecret(data.getCallbackHandler(), id); } result.put(WSSecurityEngineResult.TAG_ID, sct.getID()); result.put(WSSecurityEngineResult.TAG_SECRET, secret); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result); }",unrelated,unrelated,True,,0.0005050601903349161,0.9994949102401733
11
+ 9,"@DELETE @Path(""/zones/{id}"") public void deleteSecurityZone(@PathParam(""id"") Long zoneId) { LOG.debug(""==> deleteSecurityZone(id={})"", zoneId); if (zoneId != null && zoneId.equals(RangerSecurityZone.RANGER_UNZONED_SECURITY_ZONE_ID)) { throw restErrorUtil.createRESTException(""Cannot delete unzoned zone""); }",input_validation,input_validation,True,,0.9980939030647278,0.0019061029888689518
12
+ 10,"RangerServiceDefValidator validator = validatorFactory.getServiceDefValidator(svcStore); validator.validate(id, Action.DELETE);",input_validation,input_validation,True,,0.9981465339660645,0.001853507594205439
13
+ 11,"@Override public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, ""token cannot be null""); return this.validator.validate(token); }",unrelated,unrelated,True,,0.46549755334854126,0.5345024466514587
14
+ 12,"protected void verifyTrust( X509Certificate[] certs, boolean enableRevocation, Collection<Pattern> subjectCertConstraints ) throws WSSecurityException { if (certs.length == 1 && !enableRevocation) { String issuerString = certs[0].getIssuerX500Principal().getName(); BigInteger issuerSerial = certs[0].getSerialNumber(); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ISSUER_SERIAL); cryptoType.setIssuerSerial(issuerString, issuerSerial); X509Certificate[] foundCerts = getX509Certificates(cryptoType); if (foundCerts != null && foundCerts.length > 0 && foundCerts[0] != null && foundCerts[0].equals(certs[0])) { LOG.debug( ""Direct trust for certificate with {}"", certs[0].getSubjectX500Principal().getName() ); return; } } String issuerString = certs[0].getIssuerX500Principal().getName(); X509Certificate[] foundCerts = new X509Certificate[0]; if (certs.length == 1) { CryptoType cryptoType = new CryptoType(CryptoType.TYPE.SUBJECT_DN); cryptoType.setSubjectDN(issuerString); foundCerts = getX509Certificates(cryptoType); if (foundCerts == null || foundCerts.length < 1) { String subjectString = certs[0].getSubjectX500Principal().getName(); LOG.debug( ""No certs found in keystore for issuer {} of certificate for {}"", issuerString, subjectString ); throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, ""certpath"", new Object[] {""No trusted certs found""} ); } } LOG.debug( ""Preparing to validate certificate path for issuer {}"", issuerString ); try { Set<TrustAnchor> set = new HashSet<>(); if (trustedCerts != null) { for (X509Certificate cert : trustedCerts) { TrustAnchor anchor = new TrustAnchor(cert, null); set.add(anchor); } } String provider = getCryptoProvider(); CertPathValidator validator = null; if (provider == null || provider.length() == 0) { validator = CertPathValidator.getInstance(""PKIX""); } else { validator = CertPathValidator.getInstance(""PKIX"", provider); } PKIXParameters param = new PKIXParameters(set); param.setRevocationEnabled(enableRevocation); if (foundCerts.length > 0) { X509Certificate[] x509certs = new X509Certificate[foundCerts.length + 1]; x509certs[0] = certs[0]; System.arraycopy(foundCerts, 0, x509certs, 1, foundCerts.length); List<X509Certificate> certList = Arrays.asList(x509certs); CertPath path = getCertificateFactory().generateCertPath(certList); validator.validate(path, param); } else { List<X509Certificate> certList = Arrays.asList(certs); CertPath path = getCertificateFactory().generateCertPath(certList); validator.validate(path, param); } } catch (java.security.NoSuchProviderException | NoSuchAlgorithmException | java.security.cert.CertificateException | java.security.InvalidAlgorithmParameterException | java.security.cert.CertPathValidatorException e) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, e, ""certpath"", new Object[] {e.getMessage()} ); } if (!matchesSubjectDnPattern(certs[0], subjectCertConstraints)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } }",unrelated,unrelated,True,,0.0004822474147658795,0.9995177984237671
15
+ 13,"public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { String id = elem.getAttributeNS(WSConstants.WSU_NS, ""Id""); if (id.length() != 0) { Element foundElement = data.getWsDocInfo().getTokenElement(id); if (elem.equals(foundElement)) { WSSecurityEngineResult result = data.getWsDocInfo().getResult(id); return java.util.Collections.singletonList(result); } else if (foundElement != null) { throw new WSSecurityException( WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, ""duplicateError"" ); } } BinarySecurity token = createSecurityToken(elem, data); X509Certificate[] certs = null; Validator validator = data.getValidator(new QName(elem.getNamespaceURI(), elem.getLocalName())); if (data.getSigVerCrypto() == null) { certs = getCertificatesTokenReference(token, data.getDecCrypto()); } else { certs = getCertificatesTokenReference(token, data.getSigVerCrypto()); } WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.BST, token, certs); data.getWsDocInfo().addTokenElement(elem); if (id.length() != 0) { result.put(WSSecurityEngineResult.TAG_ID, id); } if (validator != null) { Credential credential = new Credential(); credential.setBinarySecurityToken(token); credential.setCertificates(certs); Credential returnedCredential = validator.validate(credential, data); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); result.put(WSSecurityEngineResult.TAG_SECRET, returnedCredential.getSecretKey()); if (returnedCredential.getTransformedToken() != null) { result.put( WSSecurityEngineResult.TAG_TRANSFORMED_TOKEN, returnedCredential.getTransformedToken() ); if (credential.getPrincipal() != null) { result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal()); } else { SAMLTokenPrincipalImpl samlPrincipal = new SAMLTokenPrincipalImpl(credential.getTransformedToken()); result.put(WSSecurityEngineResult.TAG_PRINCIPAL, samlPrincipal); } } else if (credential.getPrincipal() != null) { result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal()); } else if (certs != null && certs.length > 0 && certs[0] != null) { result.put(WSSecurityEngineResult.TAG_PRINCIPAL, certs[0].getSubjectX500Principal()); } result.put(WSSecurityEngineResult.TAG_SUBJECT, credential.getSubject()); if (credential.getDelegationCredential() != null) { result.put(WSSecurityEngineResult.TAG_DELEGATION_CREDENTIAL, credential.getDelegationCredential()); } } data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result); }",unrelated,unrelated,True,,0.0005093958461657166,0.9994906187057495
16
+ 14,"private Credential handleUsernameToken( Element token, Validator validator, RequestData data ) throws WSSecurityException { boolean allowNamespaceQualifiedPasswordTypes = data.isAllowNamespaceQualifiedPasswordTypes(); int utTTL = data.getUtTTL(); int futureTimeToLive = data.getUtFutureTTL(); UsernameToken ut = new UsernameToken(token, allowNamespaceQualifiedPasswordTypes, data.getBSPEnforcer()); if (!ut.verifyCreated(utTTL, futureTimeToLive)) { throw new WSSecurityException(WSSecurityException.ErrorCode.MESSAGE_EXPIRED); } ReplayCache replayCache = data.getNonceReplayCache(); if (replayCache != null && ut.getNonce() != null) { if (replayCache.contains(ut.getNonce())) { throw new WSSecurityException( WSSecurityException.ErrorCode.INVALID_SECURITY, ""badUsernameToken"", new Object[] {""A replay attack has been detected""} ); } Instant created = ut.getCreatedDate(); if (created == null || utTTL <= 0) { replayCache.add(ut.getNonce()); } else { replayCache.add(ut.getNonce(), Instant.now().plusSeconds(utTTL)); } } Credential credential = new Credential(); credential.setUsernametoken(ut); if (validator != null) { return validator.validate(credential, data); } return credential; }",unrelated,unrelated,True,,0.0005942349671386182,0.9994057416915894
17
+ 15,"public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug(""Found Timestamp list element""); Timestamp timestamp = new Timestamp(elem, data.getBSPEnforcer()); Credential credential = new Credential(); credential.setTimestamp(timestamp); WSSecurityEngineResult result = new WSSecurityEngineResult(WSConstants.TS, timestamp); String tokenId = timestamp.getID(); if (tokenId.length() != 0) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } Validator validator = data.getValidator(WSConstants.TIMESTAMP); if (validator != null) { validator.validate(credential, data); result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); } data.getWsDocInfo().addTokenElement(elem); data.getWsDocInfo().addResult(result); return java.util.Collections.singletonList(result); }",unrelated,unrelated,True,,0.0005989952478557825,0.9994009733200073
18
+ 16,"RangerSecurityZoneValidator validator = validatorFactory.getSecurityZoneValidator(svcStore, securityZoneStore); validator.validate(zoneName, RangerValidator.Action.DELETE); securityZoneStore.deleteSecurityZoneByName(zoneName);",input_validation,input_validation,True,,0.9981600642204285,0.0018399347318336368
19
+ 17,@Override public OAuth2TokenValidatorResult validate(T token) { Collection<OAuth2Error> errors = new ArrayList<>(); for (OAuth2TokenValidator<T> validator : this.tokenValidators) { errors.addAll(validator.validate(token).getErrors()); } return OAuth2TokenValidatorResult.failure(errors); },unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981728792190552,0.0018270574510097504
20
+ 18,"public Credential handleSAMLToken( SamlAssertionWrapper samlAssertion, RequestData data, Validator validator ) throws WSSecurityException { samlAssertion.parseSubject( new WSSSAMLKeyInfoProcessor(data), data.getSigVerCrypto() ); Credential credential = new Credential(); credential.setSamlAssertion(samlAssertion); if (validator != null) { return validator.validate(credential, data); } return credential; }",unrelated,unrelated,True,,0.007731608580797911,0.9922683835029602
21
+ 19,"protected void verifyTrust( X509Certificate[] certs, boolean enableRevocation, Collection<Pattern> subjectCertConstraints ) throws WSSecurityException { if (certs.length == 1 && !enableRevocation) { String issuerString = certs[0].getIssuerX500Principal().getName(); BigInteger issuerSerial = certs[0].getSerialNumber(); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ISSUER_SERIAL); cryptoType.setIssuerSerial(issuerString, issuerSerial); X509Certificate[] foundCerts = getX509Certificates(cryptoType); if (foundCerts != null && foundCerts.length > 0 && foundCerts[0] != null && foundCerts[0].equals(certs[0])) { try { certs[0].checkValidity(); } catch (CertificateExpiredException | CertificateNotYetValidException e) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILED_CHECK, e, ""invalidCert"" ); } LOG.debug( ""Direct trust for certificate with {}"", certs[0].getSubjectX500Principal().getName() ); return; } } List<Certificate[]> foundIssuingCertChains = null; String issuerString = certs[0].getIssuerX500Principal().getName(); if (certs.length == 1) { Object subject = convertSubjectToPrincipal(issuerString); if (keystore != null) { foundIssuingCertChains = getCertificates(subject, keystore, false); } if ((foundIssuingCertChains == null || foundIssuingCertChains.isEmpty()) && truststore != null) { foundIssuingCertChains = getCertificates(subject, truststore, true); } if (foundIssuingCertChains == null || foundIssuingCertChains.isEmpty() || foundIssuingCertChains.get(0).length < 1) { String subjectString = certs[0].getSubjectX500Principal().getName(); LOG.debug( ""No certs found in keystore for issuer {} of certificate for {}"", issuerString, subjectString ); throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, ""certpath"", new Object[] {""No trusted certs found""} ); } } LOG.debug( ""Preparing to validate certificate path for issuer {}"", issuerString ); try { Set<TrustAnchor> set = new HashSet<>(); if (truststore != null) { addTrustAnchors(set, truststore); } if (keystore != null && (truststore == null || loadCACerts)) { addTrustAnchors(set, keystore); } String provider = getCryptoProvider(); CertPathValidator validator = null; if (provider == null || provider.length() == 0) { validator = CertPathValidator.getInstance(""PKIX""); } else { validator = CertPathValidator.getInstance(""PKIX"", provider); } PKIXParameters param = createPKIXParameters(set, enableRevocation); if (foundIssuingCertChains != null && !foundIssuingCertChains.isEmpty()) { java.security.cert.CertPathValidatorException validatorException = null; for (Certificate[] foundCertChain : foundIssuingCertChains) { X509Certificate[] x509certs = new X509Certificate[foundCertChain.length + 1]; x509certs[0] = certs[0]; System.arraycopy(foundCertChain, 0, x509certs, 1, foundCertChain.length); List<X509Certificate> certList = Arrays.asList(x509certs); CertPath path = getCertificateFactory().generateCertPath(certList); try { validator.validate(path, param); validatorException = null; break; } catch (java.security.cert.CertPathValidatorException e) { validatorException = e; } } if (validatorException != null) { throw validatorException; } } else { List<X509Certificate> certList = Arrays.asList(certs); CertPath path = getCertificateFactory().generateCertPath(certList); validator.validate(path, param); } } catch (NoSuchProviderException | NoSuchAlgorithmException | CertificateException | InvalidAlgorithmParameterException | java.security.cert.CertPathValidatorException | KeyStoreException e) { throw new WSSecurityException( WSSecurityException.ErrorCode.FAILURE, e, ""certpath"" ); } if (!matchesSubjectDnPattern(certs[0], subjectCertConstraints)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } }",unrelated,unrelated,True,,0.00047715107211843133,0.9995228052139282
22
+ 20,"public List<WSSecurityEngineResult> handleToken( Element elem, RequestData data ) throws WSSecurityException { LOG.debug(""Found signature element""); Element keyInfoElement = XMLUtils.getDirectChildElement( elem, ""KeyInfo"", WSConstants.SIG_NS ); X509Certificate[] certs = null; Principal principal = null; PublicKey publicKey = null; byte[] secretKey = null; String signatureMethod = getSignatureMethod(elem); REFERENCE_TYPE referenceType = null; Credential credential = new Credential(); Validator validator = data.getValidator(WSConstants.SIGNATURE); if (keyInfoElement == null) { certs = getDefaultCerts(data.getSigVerCrypto()); principal = certs[0].getSubjectX500Principal(); } else { int result = 0; Node node = keyInfoElement.getFirstChild(); Element child = null; while (node != null) { if (Node.ELEMENT_NODE == node.getNodeType()) { result++; child = (Element)node; } node = node.getNextSibling(); } if (result != 1) { data.getBSPEnforcer().handleBSPRule(BSPRule.R5402); } if (!(SecurityTokenReference.SECURITY_TOKEN_REFERENCE.equals(child.getLocalName()) && WSConstants.WSSE_NS.equals(child.getNamespaceURI()))) { data.getBSPEnforcer().handleBSPRule(BSPRule.R5417); publicKey = X509Util.parseKeyValue(keyInfoElement, signatureFactory); if (validator != null) { credential.setPublicKey(publicKey); principal = new PublicKeyPrincipalImpl(publicKey); credential.setPrincipal(principal); credential = validator.validate(credential, data); } } else { STRParserParameters parameters = new STRParserParameters(); parameters.setData(data); parameters.setStrElement(child); if (signatureMethod != null) { parameters.setDerivationKeyLength(KeyUtils.getKeyLength(signatureMethod)); } STRParser strParser = new SignatureSTRParser(); STRParserResult parserResult = strParser.parseSecurityTokenReference(parameters); principal = parserResult.getPrincipal(); certs = parserResult.getCertificates(); publicKey = parserResult.getPublicKey(); secretKey = parserResult.getSecretKey(); referenceType = parserResult.getCertificatesReferenceType(); boolean trusted = parserResult.isTrustedCredential(); if (trusted) { LOG.debug(""Direct Trust for SAML/BST credential""); } if (!trusted && (publicKey != null || (certs != null && certs.length > 0)) && validator != null) { credential.setPublicKey(publicKey); credential.setCertificates(certs); credential.setPrincipal(principal); credential = validator.validate(credential, data); } } } if ((certs == null || certs.length == 0 || certs[0] == null) && secretKey == null && publicKey == null) { LOG.debug(""No certificates or keys were found with which to validate the signature""); throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK); } AlgorithmSuite algorithmSuite = data.getAlgorithmSuite(); if (algorithmSuite != null) { AlgorithmSuiteValidator algorithmSuiteValidator = new AlgorithmSuiteValidator(algorithmSuite); if (principal instanceof WSDerivedKeyTokenPrincipal) { algorithmSuiteValidator.checkDerivedKeyAlgorithm( ((WSDerivedKeyTokenPrincipal)principal).getAlgorithm() ); algorithmSuiteValidator.checkSignatureDerivedKeyLength( ((WSDerivedKeyTokenPrincipal)principal).getLength() ); } else { if (certs != null && certs.length > 0) { algorithmSuiteValidator.checkAsymmetricKeyLength(certs); } else if (publicKey != null) { algorithmSuiteValidator.checkAsymmetricKeyLength(publicKey); } else if (secretKey != null) { algorithmSuiteValidator.checkSymmetricKeyLength(secretKey.length); } } } XMLSignature xmlSignature = verifyXMLSignature(elem, certs, publicKey, secretKey, signatureMethod, data, data.getWsDocInfo()); byte[] signatureValue = xmlSignature.getSignatureValue().getValue(); String c14nMethod = xmlSignature.getSignedInfo().getCanonicalizationMethod().getAlgorithm(); List<WSDataRef> dataRefs = buildProtectedRefs( elem.getOwnerDocument(), xmlSignature.getSignedInfo(), data, data.getWsDocInfo() ); if (dataRefs.isEmpty()) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK); } int actionPerformed = WSConstants.SIGN; if (principal instanceof UsernameTokenPrincipal) { actionPerformed = WSConstants.UT_SIGN; } WSSecurityEngineResult result = new WSSecurityEngineResult( actionPerformed, principal, certs, dataRefs, signatureValue); result.put(WSSecurityEngineResult.TAG_SIGNATURE_METHOD, signatureMethod); result.put(WSSecurityEngineResult.TAG_CANONICALIZATION_METHOD, c14nMethod); String tokenId = elem.getAttributeNS(null, ""Id""); if (tokenId.length() != 0) { result.put(WSSecurityEngineResult.TAG_ID, tokenId); } result.put(WSSecurityEngineResult.TAG_SECRET, secretKey); result.put(WSSecurityEngineResult.TAG_PUBLIC_KEY, publicKey); result.put(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE, referenceType); result.put(WSSecurityEngineResult.TAG_TOKEN_ELEMENT, elem); if (validator != null) { result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE); if (credential != null) { result.put(WSSecurityEngineResult.TAG_SUBJECT, credential.getSubject()); } } data.getWsDocInfo().addResult(result); data.getWsDocInfo().addTokenElement(elem); return java.util.Collections.singletonList(result); }",unrelated,unrelated,True,,0.0004893092554993927,0.999510645866394
23
+ 21,"public void validateSignatureAgainstProfile() throws WSSecurityException { Signature sig = getSignature(); if (sig != null) { SAMLSignatureProfileValidator validator = new SAMLSignatureProfileValidator(); try { validator.validate(sig); } catch (SignatureException ex) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, ""empty"", new Object[] {""SAML signature validation failed""}); } } }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980600476264954,0.0019399269949644804
24
+ 22,"@Override public @Nullable String resolveCsrfTokenValue(HttpServletRequest request, CsrfToken csrfToken) { String actualToken = super.resolveCsrfTokenValue(request, csrfToken); if (actualToken == null) { return null; } return getTokenValue(actualToken, csrfToken.getToken()); }",unrelated,unrelated,True,,0.0004771631502080709,0.9995228052139282
25
+ 23,private static boolean isSnapshot(String version) { return version.endsWith(SNAPSHOT) || SNAPSHOT_TIMESTAMP.matcher(version).matches(); },input_validation,input_validation,True,,0.9981513619422913,0.0018486627377569675
26
+ 24,"String keyId = getString(WSHandlerConstants.SIG_KEY_ID, mc); if (keyId != null) { Integer id = WSHandlerConstants.getKeyIdentifier(keyId); if (id == null) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ""empty"", new Object[] {""WSHandler: Signature: unknown key identification""} ); } int tmp = id; if (!(tmp == WSConstants.ISSUER_SERIAL || tmp == WSConstants.ISSUER_SERIAL_QUOTE_FORMAT || tmp == WSConstants.BST_DIRECT_REFERENCE || tmp == WSConstants.X509_KEY_IDENTIFIER || tmp == WSConstants.SKI_KEY_IDENTIFIER || tmp == WSConstants.THUMBPRINT_IDENTIFIER || tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER || tmp == WSConstants.KEY_VALUE)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ""empty"", new Object[] {""WSHandler: Signature: illegal key identification""} ); }",input_validation,input_validation,True,,0.9979806542396545,0.0020193338859826326
27
+ 25,"public static SmartExecutor newSmartExecutor(Integer tasks, int maxConcurrentTasks, String namePrefix) { if (maxConcurrentTasks < 1) { throw new IllegalArgumentException(""maxConcurrentTasks must be > 0""); } requireNonNull(namePrefix); int poolSize; if (tasks != null) { if (tasks < 1) { throw new IllegalArgumentException(""tasks must be > 0""); } if (tasks == 1 || maxConcurrentTasks == 1) { return DIRECT; } poolSize = Math.min(tasks, maxConcurrentTasks); } else { if (maxConcurrentTasks == 1) { return DIRECT; } poolSize = maxConcurrentTasks; } return new SmartExecutor.Pooled(Executors.newFixedThreadPool(poolSize, new WorkerThreadFactory(namePrefix))); }",unrelated,unrelated,True,,0.0004819169989787042,0.9995180368423462
28
+ 26,"private Node linkFirst(E e) { final Node<E> newNode = newNode(Objects.requireNonNull(e)); restartFromHead: for (;;) for (Node<E> h = head, p = h, q;;) { if ((q = p.prev) != null && (q = (p = q).prev) != null) p = (h != (h = head)) ? h : q; else if (p.next == p) continue restartFromHead; else { NEXT.set(newNode, p); if (PREV.compareAndSet(p, null, newNode)) { if (p != h) HEAD.weakCompareAndSet(this, h, newNode); return newNode; } } } }",unrelated,unrelated,True,,0.0004826383083127439,0.9995173215866089
29
+ 27,"public static String getNodeNameIgnorePrefix(Node node) { if (node == null) { return null; } String nodeName = node.getNodeName(); if (nodeName.contains("":"")) { nodeName = nodeName.split("":"")[1]; } return nodeName; }",unrelated,unrelated,True,,0.0051710521802306175,0.994828999042511
30
+ 28,"private void store(int streamId, StreamHolder streamHolder) { if (streamHolder == null) { return; } streamHolders.put(streamId, streamHolder); entries.add(new StreamCacheEntry(streamId)); }",unrelated,unrelated,True,,0.0004909444833174348,0.9995090961456299
31
+ 29,"@Override public InputStreamSource getResource(AbsoluteIri absoluteIri) { String iri = absoluteIri != null ? absoluteIri.toString() : """"; String name = null; if (iri.startsWith(""classpath:"")) { name = iri.substring(10); } else if (iri.startsWith(""resource:"")) { name = iri.substring(9); } if (name != null) { ClassLoader classLoader = this.classLoaderSource.get(); if (name.startsWith(""//"")) { name = name.substring(2); } String resource = name; return () -> { InputStream result = classLoader.getResourceAsStream(resource); if (result == null) { result = classLoader.getResourceAsStream(resource.substring(1)); } if (result == null && this.fallbackToOwnClassLoader) { ClassLoader ownClassLoader = ResourceLoader.class.getClassLoader(); if (ownClassLoader != null && ownClassLoader != classLoader) { result = ownClassLoader.getResourceAsStream(resource); if (result == null) { result = ownClassLoader.getResourceAsStream(resource.substring(1)); } } } if (result == null) { throw new FileNotFoundException(iri); } return result; }; } return null; }",unrelated,unrelated,True,,0.0004891148419119418,0.9995108842849731
32
+ 30,"protected T addRule(final String peer, final boolean deny) { if (IP4_EXACT.matcher(peer).matches()) { addIpV4ExactMatch(peer, deny); } else if (IP4_WILDCARD.matcher(peer).matches()) { addIpV4WildcardMatch(peer, deny); } else if (IP4_SLASH.matcher(peer).matches()) { addIpV4SlashPrefix(peer, deny); } else if (IP6_EXACT.matcher(peer).matches()) { addIpV6ExactMatch(peer, deny); } else if (IP6_WILDCARD.matcher(peer).matches()) { addIpV6WildcardMatch(peer, deny); } else if (IP6_SLASH.matcher(peer).matches()) { addIpV6SlashPrefix(peer, deny); } else { throw UndertowMessages.MESSAGES.notAValidIpPattern(peer); }",input_validation,input_validation,True,,0.9981067180633545,0.0018932222155854106
33
+ 31,"private final static Pattern MAX_AGE_PATTERN = Pattern.compile(""^\\-?[0-9]+$"");",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0008087989408522844,0.9991912245750427
34
+ 32,public PathMatcher includePath(final String path) { ANNOUNCE_INCLUDE.announce(); validatePath(path); includedPaths.add(path); return this; },input_validation,input_validation,True,,0.9977841973304749,0.002215778222307563
35
+ 33,"public static List<File> findFiles(String fileExt, String basePath, String partialPath, String stringToFind) throws IOException { if (basePath == null) { basePath = System.getProperty(""ofbiz.home""); } Set<String> stringsToFindInPath = new HashSet<>(); Set<String> stringsToFindInFile = new HashSet<>(); if (partialPath != null) { stringsToFindInPath.add(partialPath); } if (stringToFind != null) { stringsToFindInFile.add(stringToFind); } List<File> fileList = new LinkedList<>(); FileUtil.searchFiles(fileList, new File(basePath), new SearchTextFilesFilter(fileExt, stringsToFindInPath, stringsToFindInFile), true); return fileList; }",unrelated,unrelated,True,,0.0033776715863496065,0.9966223239898682
36
+ 34,"public void lcd(String path) throws SftpException { path = localAbsolutePath(path); if ((new File(path)).isDirectory()) { try { path = (new File(path)).getCanonicalPath(); } catch (Exception e) { } lcwd = path; return; } throw new SftpException(SSH_FX_NO_SUCH_FILE, ""No such directory""); }",unrelated,unrelated,True,,0.0006625272217206657,0.9993374943733215
37
+ 35,"boolean found = false; final boolean requireAllOrigins = this.requireAllOrigins; for (final String header : origin) { if (allowedOrigins.contains(header)) { found = true; if (!requireAllOrigins) { break; } } else if (requireAllOrigins) { if (UndertowLogger.REQUEST_LOGGER.isDebugEnabled()) { UndertowLogger.REQUEST_LOGGER.debugf(""Refusing request for %s due to Origin %s not being in the allowed origins list"", exchange.getRequestPath(), header); } originFailedHandler.handleRequest(exchange); return; }",input_validation,input_validation,True,,0.9981513619422913,0.0018486689077690244
38
+ 36,"private static void validatePath(String path) { CommonHelper.assertNotBlank(""path"", path); if (!path.startsWith(""/"")) { throw new TechnicalException(""Excluded path must begin with a /""); } }",input_validation,input_validation,True,,0.9981241822242737,0.0018757757497951388
39
+ 37,"public static File newFile(String destinationDirName, ZipEntry zipEntry) throws IOException { File destinationDir = new File(destinationDirName); File destFile = new File(destinationDir, zipEntry.getName()); String destDirPath = destinationDir.getCanonicalPath(); String destFilePath = destFile.getCanonicalPath(); if (!destFilePath.startsWith(destDirPath + File.separator)) { throw new IOException(""Entry is outside of the target dir: "" + zipEntry.getName()); } return destFile; }",input_validation,input_validation,True,,0.9725556969642639,0.027444347739219666
40
+ 38,"public static void validateArtifactComponents(Artifact artifact) { validatePathComponent(artifact.getGroupId(), ""groupId""); validatePathComponent(artifact.getArtifactId(), ""artifactId""); validatePathComponent(artifact.getVersion(), ""version""); validatePathComponent(artifact.getBaseVersion(), ""baseVersion""); validatePathComponent(artifact.getClassifier(), ""classifier""); validatePathComponent(artifact.getExtension(), ""extension""); }",input_validation,input_validation,True,,0.9981330037117004,0.001867016777396202
41
+ 39,"public static byte[] decodeFromFile(String filename) throws java.io.IOException { byte[] decodedData = null; Base64.InputStream bis = null; try { Path file = Paths.get(filename); byte[] buffer; int length = 0; int numBytes; if (Files.size(file) > Integer.MAX_VALUE) { throw new java.io.IOException(""File is too big for this convenience method ("" + Files.size(file) + "" bytes).""); } buffer = new byte[(int) Files.size(file)];",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004972864990122616,0.9995026588439941
42
+ 40,"public SimpleRedirectSessionInformationExpiredStrategy(String invalidSessionUrl, RedirectStrategy redirectStrategy) { Assert.isTrue(UrlUtils.isValidRedirectUrl(invalidSessionUrl), ""url must start with '/' or with 'http(s)'""); this.destinationUrl = invalidSessionUrl; this.redirectStrategy = redirectStrategy; }",input_validation,input_validation,True,,0.9978783130645752,0.0021216715686023235
43
+ 41,"public PathMatcher excludeBranch(final String path) { ANNOUNCE_REGEXP.announce(); validatePath(path); excludedPatterns.add(Pattern.compile(""^"" + path + ""(/.*)?$"", Pattern.DOTALL)); return this; }",input_validation,input_validation,True,,0.9981127977371216,0.001887256046757102
44
+ 42,private static Path canonicalPath(Path path) { try { return path.toRealPath(); } catch (IOException e) { return path.getParent() != null ? canonicalPath(path.getParent()).resolve(path.getFileName()) : path.toAbsolutePath(); } },unrelated,unrelated,True,,0.0005016075447201729,0.9994983673095703
45
+ 43,public PathMatcher excludePath(final String path) { validatePath(path); excludedPaths.add(path); return this; },input_validation,input_validation,True,,0.9979427456855774,0.0020572757348418236
46
+ 44,"protected PathResource getFileResource(final Path file, final String path, final Path symlinkBase, String normalizedFile) throws IOException { if (this.caseSensitive) { if (symlinkBase != null) { String relative = symlinkBase.relativize(file.normalize()).toString(); String fileResolved = file.toRealPath().toString(); String symlinkBaseResolved = symlinkBase.toRealPath().toString(); if (!fileResolved.startsWith(symlinkBaseResolved)) { log.tracef(""Rejected path resource %s from path resource manager with base %s, as the case did not match actual case of %s"", path, base, normalizedFile); return null; } String compare = fileResolved.substring(symlinkBaseResolved.length()); if(compare.startsWith(fileSystem.getSeparator())) { compare = compare.substring(fileSystem.getSeparator().length()); } if(relative.startsWith(fileSystem.getSeparator())) { relative = relative.substring(fileSystem.getSeparator().length()); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004937829216942191,0.9995062351226807
47
+ 45,"public CachingResourceManager(final int metadataCacheSize, final long maxFileSize, final DirectBufferCache dataCache, final ResourceManager underlyingResourceManager, final int maxAge) { this.maxFileSize = maxFileSize; this.underlyingResourceManager = underlyingResourceManager; this.dataCache = dataCache; if(maxAge > 0 || maxAge == MAX_AGE_NO_CACHING || maxAge == MAX_AGE_NO_EXPIRY) { this.maxAge = maxAge; } else { UndertowLogger.ROOT_LOGGER.wrongCacheTTLValue(maxAge, MAX_AGE_NO_CACHING); this.maxAge = MAX_AGE_NO_CACHING; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004814083513338119,0.999518632888794
48
+ 46,"protected void createParentDirectories(File destination) throws TransferFailedException { File destinationDirectory = destination.getParentFile(); if (destinationDirectory == null) { return; } try { destinationDirectory = destinationDirectory.getCanonicalFile(); } catch (IOException e) { } destinationDirectory.mkdirs(); if (!destinationDirectory.exists()) { throw new TransferFailedException( ""Specified destination directory cannot be created: "" + destinationDirectory); } }",unrelated,unrelated,True,,0.0005749448318965733,0.9994250535964966
49
+ 47,"public static final PolicyFactory BIRT_FLEXIBLE_REPORT_POLICY = new HtmlPolicyBuilder() .allowWithoutAttributes(""html"", ""body"") .allowElements(""form"", ""div"", ""span"", ""table"", ""tr"", ""td"", ""input"", ""textarea"", ""label"", ""select"", ""option"") .allowAttributes(""id"", ""class"", ""name"", ""value"", ""onclick"").globally() .allowAttributes(""width"", ""cellspacing"").onElements(""table"") .allowAttributes(""type"", ""size"", ""maxlength"").onElements(""input"") .allowAttributes(""cols"", ""rows"").onElements(""textarea"") .allowAttributes(""class"").onElements(""td"") .allowAttributes(""method"").onElements(""form"") .allowAttributes(""accept"", ""action"", ""accept-charset"", ""autocomplete"", ""enctype"", ""method"", ""name"", ""novalidate"", ""target"").onElements(""form"") .toFactory();",input_validation,input_validation,True,,0.9981526732444763,0.0018472509691491723
50
+ 48,@Override public String canonicalize(String path) throws IOException { return super.canonicalize(cwdify(path)); },unrelated,unrelated,True,,0.0005563626764342189,0.9994435906410217
51
+ 49,} else { if (UtilValidate.isNotEmpty(sanitizer)) { sanitizer = sanitizer.and(Sanitizers.FORMATTING.and(Sanitizers.BLOCKS).and(Sanitizers.IMAGES).and( Sanitizers.LINKS).and(Sanitizers.STYLES)); } else { sanitizer = Sanitizers.FORMATTING.and(Sanitizers.BLOCKS).and(Sanitizers.IMAGES).and( Sanitizers.LINKS).and(Sanitizers.STYLES); } } sanitizer = sanitizer.and(PERMISSIVE_POLICY); return sanitizer.sanitize(original); },input_validation,input_validation,True,,0.9981613755226135,0.001838647061958909
52
+ 50,"protected GSSContext createGSSContext( final GSSManager manager, final Oid oid, final GSSName serverName, final GSSCredential gssCredential) throws GSSException { final GSSContext gssContext = manager.createContext(serverName.canonicalize(oid), oid, gssCredential, GSSContext.DEFAULT_LIFETIME); gssContext.requestMutualAuth(true); if (config.getRequestDelegCreds() != org.apache.hc.client5.http.auth.KerberosConfig.Option.DEFAULT) { gssContext.requestCredDeleg(config.getRequestDelegCreds() == org.apache.hc.client5.http.auth.KerberosConfig.Option.ENABLE); } return gssContext; }",unrelated,unrelated,True,,0.0004830170364584774,0.9995169639587402
53
+ 51,String canonicalize(String path) throws IOException;,unrelated,unrelated,True,,0.009404946118593216,0.9905951023101807
54
+ 52,PolicyFactory getSanitizerPolicy();,unrelated,unrelated,True,,0.0015255562029778957,0.9984744191169739
55
+ 53,"Builder withValue(String key, String value) { this.values.put(key, HtmlUtils.htmlEscape(value)); return this; }",input_validation,input_validation,True,,0.9699428677558899,0.030057135969400406
56
+ 54,"@Override public Mono<Void> sendRedirect(ServerWebExchange exchange, URI location) { final UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUri(location); final StringBuilder hiddenInputsHtmlBuilder = new StringBuilder(); for (final Map.Entry<String, List<String>> entry : uriComponentsBuilder.build().getQueryParams().entrySet()) { final String name = entry.getKey(); for (final String value : entry.getValue()) { final String hiddenInput = HIDDEN_INPUT_TEMPLATE .replace(""{{name}}"", HtmlUtils.htmlEscape(name)) .replace(""{{value}}"", HtmlUtils.htmlEscape(value)); hiddenInputsHtmlBuilder.append(hiddenInput.trim()); }",input_validation,input_validation,True,,0.9980841875076294,0.0019158243667334318
57
+ 55,"public static final PolicyFactory POLICY_DEFINITION = new HtmlPolicyBuilder() .allowStandardUrlProtocols() .allowStyling() .allowAttributes(""title"").globally() .allowAttributes(""href"").onElements(""a"") .requireRelNofollowOnLinks() .allowAttributes(""lang"").matching(Pattern.compile(""[a-zA-Z]{2,20}"")) .globally() .allowAttributes(""align"") .matching(true, ""center"", ""left"", ""right"", ""justify"", ""char"") .onElements(""p"") .allowElements(""a"", ""p"", ""div"", ""i"", ""b"", ""em"", ""blockquote"", ""hr"", ""strong"", ""br"", ""ul"", ""ol"", ""li"", ""img"") .allowAttributes(""src"", ""alt"").onElements(""img"") .toFactory();",input_validation,input_validation,True,,0.9981499910354614,0.0018500949954614043
58
+ 56,public synchronized String pwd() throws IOException { return super.canonicalize(cwd); },unrelated,unrelated,True,,0.0005384396645240486,0.9994615912437439
59
+ 57,"Resource resource = null; try { if (File.separatorChar == '/' || !exchange.getRelativePath().contains(File.separator)) { resource = resourceSupplier.getResource(exchange, canonicalize(exchange.getRelativePath())); }",input_validation,input_validation,True,,0.9977108240127563,0.002289139200001955
60
+ 58,"@Override public HttpUriRequest getRedirect(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException { final URI uri = getLocationURI(request, response, context); if (request instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest encRequest = (HttpEntityEnclosingRequest) request; if (encRequest.getEntity() instanceof AbstractHttpClientWagon.WagonHttpEntity) { AbstractHttpClientWagon.WagonHttpEntity whe = (WagonHttpEntity) encRequest.getEntity(); if (whe.getWagon() instanceof AbstractHttpClientWagon) { AbstractHttpClientWagon httpWagon = (AbstractHttpClientWagon) whe.getWagon(); TransferEvent transferEvent = new TransferEvent( httpWagon, whe.getResource(), TransferEvent.TRANSFER_STARTED, TransferEvent.REQUEST_PUT); transferEvent.setTimestamp(System.currentTimeMillis()); transferEvent.setLocalFile(whe.getSource()); httpWagon .getTransferEventSupport() .fireDebug(String.format( ""Following redirect from '%s' to '%s'"", request.getRequestLine().getUri(), uri.toASCIIString())); httpWagon.getTransferEventSupport().fireTransferStarted(transferEvent); } else { LOGGER.warn( ""Cannot properly handle redirect transfer event, wagon has unexpected class: {}"", whe.getWagon().getClass()); } } } return RequestBuilder.copy(request).setUri(uri).build(); }",unrelated,unrelated,True,,0.000504146097227931,0.9994958639144897
61
+ 59,"final String requestURI = getPathWithinApplication(request); final String requestURINoTrailingSlash = removeTrailingSlash(requestURI); for (String pathPattern : filterChainManager.getChainNames()) { if (pathMatches(pathPattern, requestURI)) { if (LOGGER.isTraceEnabled()) { LOGGER.trace(""Matched path pattern [{}] for requestURI [{}]. "" + ""Utilizing corresponding filter chain..."", pathPattern, Encode.forHtml(requestURI)); }",input_validation,input_validation,True,,0.9981683492660522,0.0018315938068553805
62
+ 60,"static String canonicalize(String value, boolean strict) throws IntrusionException { return canonicalize(value, strict, strict); }",input_validation,input_validation,True,,0.9157175421714783,0.0842825323343277
63
+ 61,"val profile = new WeiboProfile(); val json = JsonHelper.getFirstNode(body); if (json != null) { profile.setId( ProfileHelper.sanitizeIdentifier(JsonHelper.getElement(json, ""id""))); for (val attribute : getPrimaryAttributes()) { convertAndAdd(profile, PROFILE_ATTRIBUTE, attribute, JsonHelper.getElement(json, attribute)); } } else { raiseProfileExtractionJsonError(body);",input_validation,input_validation,True,,0.9981536269187927,0.001846326282247901
64
+ 62,"var userNode = array.get(0); if (userNode == null) { raiseProfileExtractionJsonError(body, ""response""); } profile.setId(ProfileHelper.sanitizeIdentifier(JsonHelper.getElement(userNode, ""uid""))); for (val attribute : getPrimaryAttributes()) { convertAndAdd(profile, PROFILE_ATTRIBUTE, attribute, JsonHelper.getElement(userNode, attribute)); }",input_validation,input_validation,True,,0.9981445074081421,0.001855484675616026
65
+ 63,"val json = JsonHelper.getFirstNode(body); if (json != null) { if (getProfileId() != null) { profile.setId(ProfileHelper.sanitizeIdentifier(JsonHelper.getElement(json, getProfileId()))); } for (val attribute : getPrimaryAttributes()) { convertAndAdd(profile, PROFILE_ATTRIBUTE, attribute, JsonHelper.getElement(json, attribute)); } } else { raiseProfileExtractionJsonError(body);",input_validation,input_validation,True,,0.9981468915939331,0.0018531759269535542
66
+ 64,"String sanitize(String outString, String contentTypeId);",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980699419975281,0.0019300220301374793
67
+ 65,"public static String canonicalize(final String path) { return canonicalize(path, false); }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9938609600067139,0.006139026023447514
68
+ 66,"private static long asLong(final String value) throws ResourceIOException { try { return Long.parseLong(value); } catch (final NumberFormatException ex) { throw new ResourceIOException(""Invalid cache header format""); } }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.000490382662974298,0.9995095729827881
69
+ 67,"private static long getParameterValue(Map<String, Object> parameters, String parameterName, long defaultValue) { long parameterValue = defaultValue; Object obj = parameters.get(parameterName); if (obj != null) { if (obj.getClass() == Long.class) { parameterValue = (Long) obj; } else if (obj.getClass() == Integer.class) { parameterValue = (Integer) obj; } else { try { parameterValue = Long.parseLong(obj.toString()); } catch (NumberFormatException ignored) { } } } return parameterValue; }",unrelated,unrelated,True,,0.0005030540633015335,0.9994969367980957
70
+ 68,"String keyId = getString(WSHandlerConstants.SIG_KEY_ID, mc); if (keyId != null) { Integer id = WSHandlerConstants.getKeyIdentifier(keyId); if (id == null) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ""empty"", new Object[] {""WSHandler: Signature: unknown key identification""} ); } int tmp = id; if (!(tmp == WSConstants.ISSUER_SERIAL || tmp == WSConstants.ISSUER_SERIAL_QUOTE_FORMAT || tmp == WSConstants.BST_DIRECT_REFERENCE || tmp == WSConstants.X509_KEY_IDENTIFIER || tmp == WSConstants.SKI_KEY_IDENTIFIER || tmp == WSConstants.THUMBPRINT_IDENTIFIER || tmp == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER || tmp == WSConstants.KEY_VALUE)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ""empty"", new Object[] {""WSHandler: Signature: illegal key identification""} ); } actionToken.setKeyIdentifierId(tmp);",input_validation,input_validation,True,,0.9967310428619385,0.0032689576037228107
71
+ 69,"public static Document makeEmptyXmlDocument(String rootElementName) { Document document = null; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.newDocument(); } catch (Exception e) { Debug.logError(e, MODULE); } if (document == null) { return null; } if (rootElementName != null) { Element rootElement = document.createElement(rootElementName); document.appendChild(rootElement); } return document; }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981703758239746,0.0018295582849532366
72
+ 70,"Schema refSchema = this.schema.getSchema(); if (refSchema == null) { Error error = error().keyword(KeywordType.REF.getValue()) .messageKey(""internal.unresolvedRef"").message(""Reference {0} cannot be resolved"") .instanceLocation(instanceLocation).evaluationPath(executionContext.getEvaluationPath()) .arguments(schemaNode.asString()).build(); throw new InvalidSchemaRefException(error); } if (node == null) { boolean circularDependency = false; SchemaLocation schemaLocation = refSchema.getSchemaLocation(); for (Iterator<Schema> iter = executionContext.getEvaluationSchema().descendingIterator(); iter.hasNext();) { Schema check = iter.next(); if (check.getSchemaLocation().equals(schemaLocation)) { circularDependency = true; break; } } if (circularDependency) { return; } }",input_validation,input_validation,True,,0.9980263113975525,0.001973670907318592
73
+ 71,"URL url = FlexibleLocation.resolveLocation(str); if (url != null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature(""http://xml.org/sax/features/external-general-entities"", false); factory.setFeature(""http://xml.org/sax/features/external-parameter-entities"", false); factory.setFeature(""http://apache.org/xml/features/nonvalidating/load-external-dtd"", false); factory.setXIncludeAware(false); factory.setExpandEntityReferences(false); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(url.openStream()); document.getDocumentElement().normalize();",input_validation,input_validation,True,,0.9981637597084045,0.0018362969858571887
74
+ 72,"File entityEngineFile = new File(ENTITY_ENGINE_FILE); if (!entityEngineFile.exists()) { return null; } try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature(""http://apache.org/xml/features/disallow-doctype-decl"", true); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc; try (InputStream is = Files.newInputStream(entityEngineFile.toPath())) { doc = builder.parse(is); } doc.getDocumentElement().normalize();",input_validation,input_validation,True,,0.9981613755226135,0.00183867069426924
75
+ 73,"private void addIpV6SlashPrefix(final String peer, final boolean deny) { String[] components = peer.split(""\\/""); String[] parts = components[0].split(""\\:""); int maskLen = Integer.parseInt(components[1]); assert parts.length == 8; byte[] pattern = new byte[16]; byte[] mask = new byte[16]; for (int i = 0; i < 8; ++i) { int val = Integer.parseInt(parts[i], 16); pattern[i * 2] = (byte) (val >> 8); pattern[i * 2 + 1] = (byte) (val & 0xFF); } for (int i = 0; i < 16; ++i) { if (maskLen > 8) { mask[i] = (byte) (0xFF); maskLen -= 8; } else if (maskLen != 0) { mask[i] = (byte) (Bits.intBitMask(8 - maskLen, 7) & 0xFF); maskLen = 0; } else { break; } } ipv6Matches.add(new PrefixIpV6PeerMatch(peer, mask, pattern, deny)); }",unrelated,unrelated,True,,0.0004740038712043315,0.9995260238647461
76
+ 74,"public DocumentCreatorImpl() throws ParserConfigurationException { documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); documentBuilderFactory.setFeature(""http://apache.org/xml/features/disallow-doctype-decl"", true); }",input_validation,input_validation,True,,0.9981566071510315,0.0018433425575494766
77
+ 75,"public static ByteRange parse(String rangeHeader) { if(rangeHeader == null || rangeHeader.length() < 7) { return null; } if(!rangeHeader.startsWith(""bytes="")) { return null; } List<Range> ranges = new ArrayList<>(); String[] parts = rangeHeader.substring(6).split("",""); for(String part : parts) { try { int index = part.indexOf('-'); if (index == 0) { long val = Long.parseLong(part.substring(1)); if(val <= 0) { UndertowLogger.REQUEST_LOGGER.debugf(""Invalid range spec %s"", rangeHeader); return null; } ranges.add(new Range(-1, val));",input_validation,input_validation,True,,0.9981365203857422,0.0018634061561897397
78
+ 76,boolean isContentExpected() { if (HttpContinue.requiresContinueResponse(headerMap)) { return true; } String contentLengthString = headerMap.getFirst(Headers.CONTENT_LENGTH); try { return contentLengthString != null ? Long.parseLong(contentLengthString) > 0 : false; } catch (NumberFormatException e) { return false; } },input_validation,input_validation,True,,0.9981459379196167,0.0018540802411735058
79
+ 77,"public static void elementToStream(Element element, OutputStream out) throws TransformerException { DOMSource source = new DOMSource(element); StreamResult result = new StreamResult(out); TransformerFactory transFactory = TransformerFactory.newInstance(); transFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); try { transFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, """"); transFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, """"); } catch (IllegalArgumentException ex) { } Transformer transformer = transFactory.newTransformer(); transformer.transform(source, result); }",input_validation,input_validation,True,,0.9981579184532166,0.0018420279957354069
80
+ 78,"ByteArrayInputStream bis = new ByteArrayInputStream(sb.toString().getBytes(StandardCharsets.UTF_8)); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, """"); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, """"); try (ByteArrayOutputStream os = new ByteArrayOutputStream();) { UtilXml.transformDomDocument(transformerFactory.newTransformer(new StreamSource(bis)), node, os); return os.toString(); }",input_validation,input_validation,True,,0.9981703758239746,0.0018296560738235712
81
+ 79,"public static Schema loadWSSecuritySchemas() throws SAXException { SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); schemaFactory.setResourceResolver(new LSResourceResolver() { @Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { if (""http://www.w3.org/2001/XMLSchema.dtd"".equals(systemId)) { ConcreteLSInput concreteLSInput = new ConcreteLSInput(); concreteLSInput.setByteStream(ClassLoaderUtils.getResourceAsStream(""schemas/XMLSchema.dtd"", WSSec.class)); return concreteLSInput; } else if (""XMLSchema.dtd"".equals(systemId)) { ConcreteLSInput concreteLSInput = new ConcreteLSInput(); concreteLSInput.setByteStream(ClassLoaderUtils.getResourceAsStream(""schemas/XMLSchema.dtd"", WSSec.class)); return concreteLSInput;",input_validation,input_validation,True,,0.9981685876846313,0.0018314161570742726
82
+ 80,"@SuppressWarnings(""removal"") public DefaultOAuth2UserService() { RestTemplate restTemplate = new RestTemplate(); restTemplate.setErrorHandler(new OAuth2ErrorResponseErrorHandler()); this.restOperations = restTemplate; }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980118274688721,0.0019881611224263906
83
+ 81,"public static SetErrorHandler setErrorHandler(int responseCode, HttpHandler next) { return new SetErrorHandler(next, responseCode); }",unrelated,unrelated,True,,0.0005447592702694237,0.9994552731513977
84
+ 82,"TransformerFactory tfactory = TransformerFactory.newInstance(); tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); tfactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, """"); tfactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, """"); if (tfactory.getFeature(SAXSource.FEATURE)) { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); pfactory.setValidating(false); pfactory.setXIncludeAware(true); XMLReader reader = null; try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); pfactory.setFeature(""http://xml.org/sax/features/external-general-entities"", false); pfactory.setFeature(""http://xml.org/sax/features/external-parameter-entities"", false); pfactory.setFeature(""http://apache.org/xml/features/nonvalidating/load-external-dtd"", false); reader = pfactory.newSAXParser().getXMLReader(); } catch (Exception e) { throw new TransformerException(""Error creating SAX parser/reader"", e);",input_validation,input_validation,True,,0.9981682300567627,0.0018317376961931586
85
+ 83,"ByteArrayInputStream bis = new ByteArrayInputStream(sb.toString().getBytes()); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, """"); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, """"); return transformerFactory.newTransformer(new StreamSource(bis));",input_validation,input_validation,True,,0.9981696605682373,0.0018303667893633246
86
+ 84,"TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer; try { tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, """"); tf.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, """"); transformer = tf.newTransformer();",input_validation,input_validation,True,,0.9981630444526672,0.0018370280740782619
87
+ 85,"private void addIpV4WildcardMatch(final String peer, final boolean deny) { String[] parts = peer.split(""\\.""); int mask = 0; int prefix = 0; for (int i = 0; i < 4; ++i) { mask <<= 8; prefix <<= 8; String part = parts[i]; if (!part.equals(""*"")) { int no = Integer.parseInt(part); mask |= 0xFF; prefix |= no; } } ipv4Matches.add(new PrefixIpV4PeerMatch(peer, mask, prefix, deny)); }",unrelated,unrelated,True,,0.002605925314128399,0.9973940849304199
88
+ 86,"parser.setFeature(""http://xml.org/sax/features/namespaces"", true); parser.setFeature(""http://xml.org/sax/features/validation"", validate); parser.setFeature(""http://apache.org/xml/features/validation/schema"", validate); parser.setFeature(""http://apache.org/xml/features/dom/defer-node-expansion"", false); parser.setFeature(""http://xml.org/sax/features/external-general-entities"", false); parser.setFeature(""http://xml.org/sax/features/external-parameter-entities"", false); parser.setFeature(""http://apache.org/xml/features/nonvalidating/load-external-dtd"", false); if (validate) { LocalResolver lr = new LocalResolver(new DefaultHandler()); ErrorHandler eh = new LocalErrorHandler(docDescription, lr); parser.setEntityResolver(lr); parser.setErrorHandler(eh); }",input_validation,input_validation,True,,0.9981132745742798,0.0018866827012971044
89
+ 87,"DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(validate); factory.setNamespaceAware(true); factory.setAttribute(""http://xml.org/sax/features/validation"", validate); factory.setAttribute(""http://apache.org/xml/features/validation/schema"", validate); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature(""http://xml.org/sax/features/external-general-entities"", false); factory.setFeature(""http://xml.org/sax/features/external-parameter-entities"", false); factory.setFeature(""http://apache.org/xml/features/nonvalidating/load-external-dtd"", false); factory.setXIncludeAware(false); factory.setExpandEntityReferences(false);",input_validation,input_validation,True,,0.9981550574302673,0.0018449350027367473
90
+ 88,"public void walk(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, NodePath instanceLocation, boolean shouldValidateSchema) { Schema refSchema = getSchemaRef(executionContext).getSchema(); if (refSchema == null) { Error error = error().keyword(KeywordType.DYNAMIC_REF.getValue()) .messageKey(""internal.unresolvedRef"").message(""Reference {0} cannot be resolved"") .instanceLocation(instanceLocation).evaluationPath(executionContext.getEvaluationPath()) .arguments(schemaNode.asString()).build(); throw new InvalidSchemaRefException(error); }",input_validation,input_validation,True,,0.9981287121772766,0.0018712548771873116
91
+ 89,"public void walk(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, NodePath instanceLocation, boolean shouldValidateSchema) { Schema refSchema = getSchemaRef(executionContext).getSchema(); if (refSchema == null) { Error error = error().keyword(KeywordType.RECURSIVE_REF.getValue()) .messageKey(""internal.unresolvedRef"").message(""Reference {0} cannot be resolved"") .instanceLocation(instanceLocation).evaluationPath(executionContext.getEvaluationPath()) .arguments(schemaNode.toString()).build(); throw new InvalidSchemaRefException(error); }",input_validation,input_validation,True,,0.99811851978302,0.001881478470750153
92
+ 90,"protected ResultSetType resolveResultSetType(String alias) { try { return alias == null ? null : ResultSetType.valueOf(alias); } catch (IllegalArgumentException e) { throw new BuilderException(""Error resolving ResultSetType. Cause: "" + e, e); } }",unrelated,unrelated,True,,0.0004929284332320094,0.9995070695877075
93
+ 91,@Override public RandomProviderState saveState() { return new RandomProviderDefaultState(getStateInternal()); },unrelated,unrelated,True,,0.0004989498993381858,0.9995009899139404
94
+ 92,"private GuideTableDiscreteSampler(UniformRandomProvider rng, double[] cumulativeProbabilities, int[] guideTable) { this.rng = rng; this.cumulativeProbabilities = cumulativeProbabilities; this.guideTable = guideTable; }",unrelated,unrelated,True,,0.0004977502976544201,0.9995021820068359
95
+ 93,"private int skipWS(String expression, int p) { for (int i = p; i < expression.length(); i++) { if (expression.charAt(i) > 0x20) { return i; } } return expression.length(); }",unrelated,unrelated,True,,0.0005607451894320548,0.9994391798973083
96
+ 94,"private BoxMullerGaussianSampler(double mean, double standardDeviation, UniformRandomProvider rng) { super(null); this.rng = rng; this.mean = mean; this.standardDeviation = standardDeviation; }",unrelated,unrelated,True,,0.00048695580335333943,0.9995130300521851
97
+ 95,"private PoissonSamplerCache(int minN, int maxN, LargeMeanPoissonSamplerState[] states) { this.minN = minN; this.maxN = maxN; this.values = states; }",unrelated,unrelated,True,,0.0004786726785823703,0.9995213747024536
98
+ 96,@Override public long next() { final int p = bufferPosition; if (bufferPosition < PHILOX_BUFFER_SIZE) { bufferPosition = p + 1; return buffer[p]; } incrementCounter(); rand10(); bufferPosition = 1; return buffer[0]; },unrelated,unrelated,True,,0.0004901700303889811,0.9995098114013672
99
+ 97,public void setLogImpl(Class<? extends Log> logImpl) { if (logImpl != null) { this.logImpl = logImpl; LogFactory.useCustomLogging(this.logImpl); } },unrelated,unrelated,True,,0.0005142991431057453,0.9994857311248779
100
+ 98,@Override public UniformRandomProvider jump() { final UniformRandomProvider copy = new L32X64Mix(this); ls = M * ls + la; resetCachedState(); return copy; },unrelated,unrelated,True,,0.0004816864093299955,0.9995182752609253
101
+ 99,"private static void putInt(int v, byte[] buffer, int index) { buffer[index ] = (byte) (v & INT_LOWEST_BYTE_MASK); buffer[index + 1] = (byte)((v >>> 8) & INT_LOWEST_BYTE_MASK); buffer[index + 2] = (byte)((v >>> 16) & INT_LOWEST_BYTE_MASK); buffer[index + 3] = (byte) (v >>> 24); }",unrelated,unrelated,True,,0.0004974118783138692,0.9995025396347046
102
+ 100,"private <E> List<E> selectList() throws SQLException { Executor localExecutor = executor; if (Thread.currentThread().getId() != this.creatorThreadId || localExecutor.isClosed()) { localExecutor = newExecutor(); } try { return localExecutor.query(mappedStatement, parameterObject, RowBounds.DEFAULT, Executor.NO_RESULT_HANDLER, cacheKey, boundSql); } finally { if (localExecutor != executor) { localExecutor.close(false); } } }",unrelated,unrelated,True,,0.0004779909795615822,0.9995219707489014
103
+ 101,public List<ResultMapping> resolveWithConstructor() { if (constructorResultMappings.isEmpty()) { return constructorResultMappings; } final List<ConstructorMetaInfo> matchingConstructorCandidates = retrieveConstructorCandidates( constructorResultMappings.size()); if (matchingConstructorCandidates.isEmpty()) { return constructorResultMappings; } final Set<String> constructorArgsByName = constructorResultMappings.stream().map(ResultMapping::getProperty) .filter(Objects::nonNull).collect(Collectors.toCollection(LinkedHashSet::new)); final boolean allMappingsHavePropertyNames = verifyPropertyNaming(constructorArgsByName);,unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9877303242683411,0.012269685976207256
104
+ 102,@Override public Class<?> getSetterType(String name) { PropertyTokenizer prop = new PropertyTokenizer(name); if (prop.hasNext()) { MetaObject metaValue = metaObject.metaObjectForProperty(prop.getIndexedName()); if (metaValue == SystemMetaObject.NULL_META_OBJECT) { return Object.class; } else { return metaValue.getSetterType(prop.getChildren()); } } if (map.get(name) != null) { return map.get(name).getClass(); } else { return Object.class; } },unrelated,unrelated,True,,0.0004923969972878695,0.9995075464248657
105
+ 103,"private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings, String resultMapId) { final List<ResultMapping> mappings = new ArrayList<>(); for (Arg arg : args) { List<ResultFlag> flags = new ArrayList<>(); flags.add(ResultFlag.CONSTRUCTOR); if (arg.id()) { flags.add(ResultFlag.ID); } @SuppressWarnings(""unchecked"") Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>) (arg .typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler()); ResultMapping resultMapping = assistant.buildResultMapping(resultType, nullOrEmpty(arg.name()), nullOrEmpty(arg.column()), arg.javaType() == void.class ? null : arg.javaType(), arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(), nullOrEmpty(arg.select()), nullOrEmpty(arg.resultMap()), null, nullOrEmpty(arg.columnPrefix()), typeHandler, flags, null, null, false); mappings.add(resultMapping); } final ResultMappingConstructorResolver resolver = new ResultMappingConstructorResolver(configuration, mappings,",unrelated,unrelated,True,,0.00048702338244765997,0.9995130300521851
106
+ 104,private MetaObject getParamMetaObject() { if (paramMetaObject != null) { return paramMetaObject; } paramMetaObject = configuration.newMetaObject(parameterObject); return paramMetaObject; },unrelated,unrelated,True,,0.0004888016264885664,0.9995112419128418
107
+ 105,public int getActiveConnectionCount() { lock.lock(); try { return activeConnections.size(); } finally { lock.unlock(); } },unrelated,unrelated,True,,0.0005012375768274069,0.999498724937439
108
+ 106,"@Override public BigDecimal getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getBigDecimal(columnName); }",unrelated,unrelated,True,,0.0005166884511709213,0.9994832277297974
109
+ 107,"@Override public void error(String s, Throwable e) { logger.log(MARKER, FQCN, LocationAwareLogger.ERROR_INT, s, null, e); }",unrelated,unrelated,True,,0.0005717046442441642,0.9994282126426697
110
+ 108,"public PreparedStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) { super(executor, mappedStatement, parameter, rowBounds, resultHandler, boundSql); }",unrelated,unrelated,True,,0.0004928717971779406,0.9995070695877075
111
+ 109,"private void parseSelectKeyNodes(String parentId, List<XNode> list, Class<?> parameterTypeClass, LanguageDriver langDriver, String skRequiredDatabaseId) { for (XNode nodeToHandle : list) { String id = parentId + SelectKeyGenerator.SELECT_KEY_SUFFIX; String databaseId = nodeToHandle.getStringAttribute(""databaseId""); if (databaseIdMatchesCurrent(id, databaseId, skRequiredDatabaseId)) { parseSelectKeyNode(id, nodeToHandle, parameterTypeClass, langDriver, databaseId); } } }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980114698410034,0.0019884801004081964
112
+ 110,private void setState(long[] state) { key0 = state[0]; key1 = state[1]; counter0 = state[2]; counter1 = state[3]; counter2 = state[4]; counter3 = state[5]; },unrelated,unrelated,True,,0.0005079155671410263,0.9994920492172241
113
+ 111,"public Class<?> getGetterType(String propertyName) { Class<?> clazz = getTypes.getOrDefault(propertyName, nullEntry).getValue(); if (clazz == null) { throw new ReflectionException(""There is no getter for property named '"" + propertyName + ""' in '"" + clazz + ""'""); } return clazz; }",unrelated,unrelated,True,,0.0004861289053224027,0.9995138645172119
114
+ 112,"@Override protected void setStateInternal(byte[] s) { final byte[][] c = splitStateInternal(s, (N + 1) * 4); final int[] tmp = NumberFactory.makeIntArray(c[0]); System.arraycopy(tmp, 0, mt, 0, N); mti = tmp[N]; super.setStateInternal(c[1]); }",unrelated,unrelated,True,,0.0004905067617073655,0.9995094537734985
115
+ 113,"@Override public <E> List<E> query(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException { BoundSql boundSql = ms.getBoundSql(parameterObject); CacheKey key = createCacheKey(ms, parameterObject, rowBounds, boundSql); return query(ms, parameterObject, rowBounds, resultHandler, key, boundSql); }",unrelated,unrelated,True,,0.00048652617260813713,0.9995135068893433
116
+ 114,private boolean isLazy(Result result) { boolean isLazy = configuration.isLazyLoadingEnabled(); if (!result.one().select().isEmpty() && FetchType.DEFAULT != result.one().fetchType()) { isLazy = result.one().fetchType() == FetchType.LAZY; } else if (!result.many().select().isEmpty() && FetchType.DEFAULT != result.many().fetchType()) { isLazy = result.many().fetchType() == FetchType.LAZY; } return isLazy; },unrelated,unrelated,True,,0.0005416129715740681,0.999458372592926
117
+ 115,public CacheBuilder addDecorator(Class<? extends Cache> decorator) { if (decorator != null) { this.decorators.add(decorator); } return this; },unrelated,unrelated,True,,0.0005047860904596746,0.9994951486587524
118
+ 116,@Override public void clear() { lastClear = System.currentTimeMillis(); delegate.clear(); },unrelated,unrelated,True,,0.0005165152251720428,0.9994834661483765
119
+ 117,"@Override protected Statement instantiateStatement(Connection connection) throws SQLException { String sql = boundSql.getSql(); if (mappedStatement.getResultSetType() == ResultSetType.DEFAULT) { return connection.prepareCall(sql); } return connection.prepareCall(sql, mappedStatement.getResultSetType().getValue(), ResultSet.CONCUR_READ_ONLY); }",unrelated,unrelated,True,,0.0004896359168924391,0.9995104074478149
120
+ 118,"private static <T> SharedStateDiscreteSampler createSampler(UniformRandomProvider rng, List<T> collection, double[] probabilities) { if (probabilities.length != collection.size()) { throw new IllegalArgumentException(""Size mismatch: "" + probabilities.length + "" != "" + collection.size()); } return GuideTableDiscreteSampler.of(rng, probabilities); }",unrelated,unrelated,True,,0.00048334590974263847,0.9995166063308716
121
+ 119,"private ResultMapping buildResultMappingFromContext(XNode context, Class<?> resultType, List<ResultFlag> flags) { String property; if (flags.contains(ResultFlag.CONSTRUCTOR)) { property = context.getStringAttribute(""name""); } else { property = context.getStringAttribute(""property""); } String column = context.getStringAttribute(""column""); String javaType = context.getStringAttribute(""javaType""); String jdbcType = context.getStringAttribute(""jdbcType""); String nestedSelect = context.getStringAttribute(""select""); String nestedResultMap = context.getStringAttribute(""resultMap"", () -> processNestedResultMappings(context, List.of(), resultType)); String notNullColumn = context.getStringAttribute(""notNullColumn""); String columnPrefix = context.getStringAttribute(""columnPrefix""); String typeHandler = context.getStringAttribute(""typeHandler""); String resultSet = context.getStringAttribute(""resultSet""); String foreignColumn = context.getStringAttribute(""foreignColumn""); boolean lazy = ""lazy"" .equals(context.getStringAttribute(""fetchType"", configuration.isLazyLoadingEnabled() ? ""lazy"" : ""eager""));",unrelated,unrelated,True,,0.0005052104243077338,0.9994947910308838
122
+ 120,@Override public <E> Cursor<E> queryCursor(Statement statement) throws SQLException { return delegate.queryCursor(statement); },unrelated,unrelated,True,,0.0004958898643963039,0.9995040893554688
123
+ 121,"private JdbcType safeGetJdbcTypeForColumn(ResultSetMetaData rsmd, Integer columnIndex) { try { return JdbcType.forCode(rsmd.getColumnType(columnIndex)); } catch (Exception e) { return null; } }",unrelated,unrelated,True,,0.00048754052841104567,0.9995124340057373
124
+ 122,@Override public int next() { final int indexRm1 = TABLE.getIndexPred(index); final int v0 = v[index]; final int vM1 = v[TABLE.getIndexM1(index)]; final int vM2 = v[TABLE.getIndexM2(index)]; final int vM3 = v[TABLE.getIndexM3(index)]; final int z0 = v[indexRm1]; final int z1 = v0 ^ (vM1 ^ (vM1 >>> 8)); final int z2 = (vM2 ^ (vM2 << 19)) ^ (vM3 ^ (vM3 << 14)); final int z3 = z1 ^ z2; final int z4 = (z0 ^ (z0 << 11)) ^ (z1 ^ (z1 << 7)) ^ (z2 ^ (z2 << 13)); v[index] = z3; v[indexRm1] = z4; index = indexRm1; return z4;,unrelated,unrelated,True,,0.0004943181411363184,0.9995056390762329
125
+ 123,"private void linkToParents(ResultSet rs, ResultMapping parentMapping, Object rowValue) throws SQLException { CacheKey parentKey = createKeyForMultipleResults(rs, parentMapping, parentMapping.getColumn(), parentMapping.getForeignColumn()); List<PendingRelation> parents = pendingRelations.get(parentKey); if (parents != null) { for (PendingRelation parent : parents) { if (parent != null && rowValue != null) { linkObjects(parent.metaObject, parent.propertyMapping, rowValue); } } } }",unrelated,unrelated,True,,0.0004992068279534578,0.9995007514953613
126
+ 124,PendingCreationKey(ResultMapping constructorMapping) { this.resultMapId = constructorMapping.getNestedResultMapId(); this.constructorColumnPrefix = constructorMapping.getColumnPrefix(); },unrelated,unrelated,True,,0.0004931222065351903,0.9995068311691284
127
+ 125,"private static long sum(long[] frequencies) { if (frequencies == null || frequencies.length == 0) { throw new IllegalArgumentException(""frequencies must contain at least 1 value""); } long m = 0; long signFlag = 0; for (final long o : frequencies) { m += o; signFlag |= o | m; } if (signFlag < 0) { for (final long o : frequencies) { if (o < 0) {",unrelated,unrelated,True,,0.00047295205877162516,0.999527096748352
128
+ 126,@Override public String[] getSetterNames() { return map.keySet().toArray(new String[0]); },unrelated,unrelated,True,,0.0005421805544756353,0.9994577765464783
129
+ 127,"private InverseTransformParetoSampler(double scale, double shape, UniformRandomProvider rng) { super(null); this.rng = rng; this.scale = scale; this.oneOverShape = 1 / shape; nextDouble = shape >= 1 ? InternalUtils::makeNonZeroDouble : InternalUtils::makeDouble; }",unrelated,unrelated,True,,0.0004846885276492685,0.9995152950286865
130
+ 128,public long getClaimedOverdueConnectionCount() { lock.lock(); try { return claimedOverdueConnectionCount; } finally { lock.unlock(); } },unrelated,unrelated,True,,0.0004977863864041865,0.9995021820068359
131
+ 129,"public static double[] shuffle(UniformRandomProvider rng, double[] array) { int i = array.length; for (; i > BATCH_2; --i) { swap(array, i - 1, rng.nextInt(i)); } final int[] productBound = {i * (i - 1)}; for (; i > 1; i -= 2) { final int[] indices = randomBounded2(i, i - 1, productBound, rng); final int index1 = indices[0]; final int index2 = indices[1]; swap(array, i - 1, index1); swap(array, i - 2, index2); } return array; }",unrelated,unrelated,True,,0.0004954356118105352,0.999504566192627
132
+ 130,"@Override public Reader getNullableResult(ResultSet rs, String columnName) throws SQLException { return toReader(rs.getClob(columnName)); }",unrelated,unrelated,True,,0.000498104898724705,0.9995019435882568
133
+ 131,"@Override public int next() { z = computeNew(36969, z); w = computeNew(18000, w); final int mwc = (z << 16) + w; jsr ^= jsr << 13; jsr ^= jsr >>> 17; jsr ^= jsr << 5; jcong = 69069 * jcong + 1234567; return (mwc ^ jcong) + jsr; }",unrelated,unrelated,True,,0.0004958428908139467,0.9995042085647583
134
+ 132,"@SuppressWarnings({""rawtypes"", ""unchecked""}) public static <T> void shuffle(UniformRandomProvider rng, List<T> list) { if (list instanceof RandomAccess || list.size() < RANDOM_ACCESS_SIZE_THRESHOLD) { ArraySampler.shuffle(rng, list); } else { final Object[] array = list.toArray(); ArraySampler.shuffle(rng, array); final ListIterator it = list.listIterator(); for (final Object item : array) { it.next(); it.set(item); } } }",unrelated,unrelated,True,,0.00048344270908273757,0.9995166063308716
135
+ 133,"private void cacheElement(XNode context) { if (context != null) { String type = context.getStringAttribute(""type"", ""PERPETUAL""); Class<? extends Cache> typeClass = typeAliasRegistry.resolveAlias(type); String eviction = context.getStringAttribute(""eviction"", ""LRU""); Class<? extends Cache> evictionClass = typeAliasRegistry.resolveAlias(eviction); Long flushInterval = context.getLongAttribute(""flushInterval""); Integer size = context.getIntAttribute(""size""); boolean readWrite = !context.getBooleanAttribute(""readOnly"", false); boolean blocking = context.getBooleanAttribute(""blocking"", false); Properties props = context.getChildrenAsProperties(); builderAssistant.useNewCache(typeClass, evictionClass, flushInterval, size, readWrite, blocking, props); } }",unrelated,unrelated,True,,0.000480808928841725,0.9995192289352417
136
+ 134,"@Override protected void setStateInternal(byte[] s) { final byte[][] c = splitStateInternal(s, SEED_SIZE * 8); setState(NumberFactory.makeLongArray(c[0])); super.setStateInternal(c[1]); }",unrelated,unrelated,True,,0.0004869251570198685,0.9995130300521851
137
+ 135,"public static Type resolveFieldType(Field field, Type srcType) { Type fieldType = field.getGenericType(); Class<?> declaringClass = field.getDeclaringClass(); return resolveType(fieldType, srcType, declaringClass); }",unrelated,unrelated,True,,0.0005047295708209276,0.999495267868042
138
+ 136,private void finishJump() { resetCachedState(); if (bufferPosition < PHILOX_BUFFER_SIZE) { rand10(); } },unrelated,unrelated,True,,0.0005054897628724575,0.9994944334030151
input_validation_codebert_v1/history.json ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "epoch": 1,
4
+ "train_loss": 0.5565753924909612,
5
+ "loss": 0.328972461606775,
6
+ "accuracy": 0.8759124087591241,
7
+ "macro_f1": 0.8677681258161585,
8
+ "labels": [
9
+ "input_validation",
10
+ "unrelated"
11
+ ],
12
+ "precision": [
13
+ 0.86,
14
+ 0.8850574712643678
15
+ ],
16
+ "recall": [
17
+ 0.8113207547169812,
18
+ 0.9166666666666666
19
+ ],
20
+ "f1": [
21
+ 0.8349514563106796,
22
+ 0.9005847953216374
23
+ ],
24
+ "support": [
25
+ 53,
26
+ 84
27
+ ],
28
+ "confusion_matrix": [
29
+ [
30
+ 43,
31
+ 10
32
+ ],
33
+ [
34
+ 7,
35
+ 77
36
+ ]
37
+ ]
38
+ },
39
+ {
40
+ "epoch": 2,
41
+ "train_loss": 0.22394190748340229,
42
+ "loss": 0.39977135908390793,
43
+ "accuracy": 0.8978102189781022,
44
+ "macro_f1": 0.8936807095343681,
45
+ "labels": [
46
+ "input_validation",
47
+ "unrelated"
48
+ ],
49
+ "precision": [
50
+ 0.8421052631578947,
51
+ 0.9375
52
+ ],
53
+ "recall": [
54
+ 0.9056603773584906,
55
+ 0.8928571428571429
56
+ ],
57
+ "f1": [
58
+ 0.8727272727272727,
59
+ 0.9146341463414634
60
+ ],
61
+ "support": [
62
+ 53,
63
+ 84
64
+ ],
65
+ "confusion_matrix": [
66
+ [
67
+ 48,
68
+ 5
69
+ ],
70
+ [
71
+ 9,
72
+ 75
73
+ ]
74
+ ]
75
+ },
76
+ {
77
+ "epoch": 3,
78
+ "train_loss": 0.08927091950973706,
79
+ "loss": 0.525531681929715,
80
+ "accuracy": 0.8905109489051095,
81
+ "macro_f1": 0.8833248168966104,
82
+ "labels": [
83
+ "input_validation",
84
+ "unrelated"
85
+ ],
86
+ "precision": [
87
+ 0.88,
88
+ 0.896551724137931
89
+ ],
90
+ "recall": [
91
+ 0.8301886792452831,
92
+ 0.9285714285714286
93
+ ],
94
+ "f1": [
95
+ 0.8543689320388349,
96
+ 0.9122807017543859
97
+ ],
98
+ "support": [
99
+ 53,
100
+ 84
101
+ ],
102
+ "confusion_matrix": [
103
+ [
104
+ 44,
105
+ 9
106
+ ],
107
+ [
108
+ 6,
109
+ 78
110
+ ]
111
+ ]
112
+ },
113
+ {
114
+ "epoch": 4,
115
+ "train_loss": 0.07377087197866632,
116
+ "loss": 0.5408764827514201,
117
+ "accuracy": 0.8978102189781022,
118
+ "macro_f1": 0.8915158371040723,
119
+ "labels": [
120
+ "input_validation",
121
+ "unrelated"
122
+ ],
123
+ "precision": [
124
+ 0.8823529411764706,
125
+ 0.9069767441860465
126
+ ],
127
+ "recall": [
128
+ 0.8490566037735849,
129
+ 0.9285714285714286
130
+ ],
131
+ "f1": [
132
+ 0.8653846153846154,
133
+ 0.9176470588235294
134
+ ],
135
+ "support": [
136
+ 53,
137
+ 84
138
+ ],
139
+ "confusion_matrix": [
140
+ [
141
+ 45,
142
+ 8
143
+ ],
144
+ [
145
+ 6,
146
+ 78
147
+ ]
148
+ ]
149
+ },
150
+ {
151
+ "epoch": 5,
152
+ "train_loss": 0.021251737062235584,
153
+ "loss": 0.6025232114263677,
154
+ "accuracy": 0.9051094890510949,
155
+ "macro_f1": 0.8996336996336997,
156
+ "labels": [
157
+ "input_validation",
158
+ "unrelated"
159
+ ],
160
+ "precision": [
161
+ 0.8846153846153846,
162
+ 0.9176470588235294
163
+ ],
164
+ "recall": [
165
+ 0.8679245283018868,
166
+ 0.9285714285714286
167
+ ],
168
+ "f1": [
169
+ 0.8761904761904762,
170
+ 0.9230769230769231
171
+ ],
172
+ "support": [
173
+ 53,
174
+ 84
175
+ ],
176
+ "confusion_matrix": [
177
+ [
178
+ 46,
179
+ 7
180
+ ],
181
+ [
182
+ 6,
183
+ 78
184
+ ]
185
+ ]
186
+ },
187
+ {
188
+ "epoch": 6,
189
+ "train_loss": 0.01539977520710828,
190
+ "loss": 0.5931772343381974,
191
+ "accuracy": 0.9051094890510949,
192
+ "macro_f1": 0.9003301807599754,
193
+ "labels": [
194
+ "input_validation",
195
+ "unrelated"
196
+ ],
197
+ "precision": [
198
+ 0.8703703703703703,
199
+ 0.927710843373494
200
+ ],
201
+ "recall": [
202
+ 0.8867924528301887,
203
+ 0.9166666666666666
204
+ ],
205
+ "f1": [
206
+ 0.8785046728971962,
207
+ 0.9221556886227545
208
+ ],
209
+ "support": [
210
+ 53,
211
+ 84
212
+ ],
213
+ "confusion_matrix": [
214
+ [
215
+ 47,
216
+ 6
217
+ ],
218
+ [
219
+ 7,
220
+ 77
221
+ ]
222
+ ]
223
+ },
224
+ {
225
+ "epoch": 7,
226
+ "train_loss": 0.011989723037580736,
227
+ "loss": 0.634260358154175,
228
+ "accuracy": 0.8978102189781022,
229
+ "macro_f1": 0.8936807095343681,
230
+ "labels": [
231
+ "input_validation",
232
+ "unrelated"
233
+ ],
234
+ "precision": [
235
+ 0.8421052631578947,
236
+ 0.9375
237
+ ],
238
+ "recall": [
239
+ 0.9056603773584906,
240
+ 0.8928571428571429
241
+ ],
242
+ "f1": [
243
+ 0.8727272727272727,
244
+ 0.9146341463414634
245
+ ],
246
+ "support": [
247
+ 53,
248
+ 84
249
+ ],
250
+ "confusion_matrix": [
251
+ [
252
+ 48,
253
+ 5
254
+ ],
255
+ [
256
+ 9,
257
+ 75
258
+ ]
259
+ ]
260
+ },
261
+ {
262
+ "epoch": 8,
263
+ "train_loss": 0.012358490379304218,
264
+ "loss": 0.6111653279247028,
265
+ "accuracy": 0.9051094890510949,
266
+ "macro_f1": 0.9009730330831249,
267
+ "labels": [
268
+ "input_validation",
269
+ "unrelated"
270
+ ],
271
+ "precision": [
272
+ 0.8571428571428571,
273
+ 0.9382716049382716
274
+ ],
275
+ "recall": [
276
+ 0.9056603773584906,
277
+ 0.9047619047619048
278
+ ],
279
+ "f1": [
280
+ 0.8807339449541285,
281
+ 0.9212121212121213
282
+ ],
283
+ "support": [
284
+ 53,
285
+ 84
286
+ ],
287
+ "confusion_matrix": [
288
+ [
289
+ 48,
290
+ 5
291
+ ],
292
+ [
293
+ 8,
294
+ 76
295
+ ]
296
+ ]
297
+ }
298
+ ]
input_validation_codebert_v1/test_errors.csv ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset_index,text,true_label,predicted_label,correct,error_type,probability_input_validation,probability_unrelated
2
+ 1,"@Override public boolean isValid(Float value, ConstraintValidatorContext context) { if ( value == null ) { return true; } return NumberSignHelper.signum( value, InfinityNumberComparatorHelper.GREATER_THAN ) < 0; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004934293101541698,0.9995065927505493
3
+ 3,"@Override public boolean validateObject( PooledObject<LdapConnection> connection ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_04152_VALIDATING, connection ) ); } return validator.validate( connection.getObject() ); }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981310963630676,0.00186887476593256
4
+ 6,"@Override public boolean isValid(Float value, ConstraintValidatorContext context) { if ( value == null ) { return true; } return NumberSignHelper.signum( value, InfinityNumberComparatorHelper.LESS_THAN ) > 0; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004919250495731831,0.9995080232620239
5
+ 10,"@Message(id = 29, value = ""Constraint factory returned null when trying to create instance of %s."") ValidationException getConstraintValidatorFactoryMustNotReturnNullException(@FormatWith(ClassObjectFormatter.class) Class<? extends ConstraintValidator<?, ?>> validatorClass);",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981630444526672,0.0018370068864896894
6
+ 18,"@Override public boolean isValid(Map map, ConstraintValidatorContext constraintValidatorContext) { if ( map == null ) { return true; } int size = map.size(); return size >= min && size <= max; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005930535844527185,0.9994069337844849
7
+ 19,"@LogMessage(level = WARN) @Message(id = 271, value = ""Using `@Valid` on a container (%1$s) is deprecated. You should apply the annotation on the type argument(s). Affected element: %2$s"") void deprecatedUseOfValidOnContainer(@FormatWith(ClassObjectFormatter.class) Class<?> valueType, Object context);",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980403780937195,0.001959622837603092
8
+ 20,"@LogMessage(level = WARN) @Message(id = 272, value = ""Using `@Valid` on a container is deprecated. You should apply the annotation on the type argument(s). (%1$s) can potentially be a container at runtime. Affected element: %2$s"") void potentiallyDeprecatedUseOfValidOnContainer(@FormatWith(ClassObjectFormatter.class) Class<?> valueType, Object context);",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9980251789093018,0.0019748774357140064
9
+ 22,"@Override public boolean isValid(CharSequence value, ConstraintValidatorContext constraintValidatorContext) { if ( value == null ) { return true; } int length = value.length(); return length >= min && length <= max; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.013626660220324993,0.9863733053207397
10
+ 37,"public PKMACBuilder setIterationCount(int iterationCount) { if (iterationCount < 100) { throw new IllegalArgumentException(""iteration count must be at least 100""); } checkIterationCountCeiling(iterationCount); this.iterationCount = iterationCount; return this; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004844584909733385,0.9995155334472656
11
+ 45,"public MayoPrivateKeyParameters(MayoParameters params, byte[] seed_sk) { super(true, params); if (seed_sk.length != params.getCskBytes()) { throw new IllegalArgumentException(""'seed_sk' has invalid length""); } this.seed_sk = Arrays.clone(seed_sk); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0004936579498462379,0.9995063543319702
12
+ 47,"public static boolean mkdirs( File f) { if (Constants.isOSX) { Pattern pat = Pattern.compile(""^(/Volumes/[^/]+)""); Matcher matcher = pat.matcher(f.getParent()); if (matcher.find()) { String sVolume = matcher.group(); File fVolume = newFile(sVolume); if (!fVolume.isDirectory()) { Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, sVolume + "" is not mounted or not available."")); return false; } } } return f.mkdirs(); }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981462955474854,0.0018537157448008657
13
+ 48,"static ASN1ObjectIdentifier getDigestOID(String alg) { ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)forMic.get(Strings.toLowerCase(alg)); if (oid == null) { throw new IllegalArgumentException(""unknown micalg passed: "" + alg); } return oid; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005577669362537563,0.9994422793388367
14
+ 58,"private void validatePathPseudoHeader(final String method, final String scheme, final String path) throws ProtocolException { if (URIScheme.HTTP.name().equalsIgnoreCase(scheme) || URIScheme.HTTPS.name().equalsIgnoreCase(scheme)) { if (TextUtils.isBlank(path)) { throw new ProtocolException(""':path' pseudo-header field must not be empty for 'http' or 'https' URIs""); } else { final boolean isRoot = path.startsWith(""/""); if (Method.OPTIONS.isSame(method)) { if (!""*"".equals(path) && !isRoot) { throw new ProtocolException(""OPTIONS request for an 'http' or 'https' URI must have a ':path' pseudo-header field with a value of '*' or '/'""); } } else { if (!isRoot) { throw new ProtocolException(""':path' pseudo-header field for 'http' or 'https' URIs must start with '/'""); } } } } }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.1332388073205948,0.8667611479759216
15
+ 71,"@Override public void doTag() throws JspException, IOException { Encode.forUri(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005434787017293274,0.9994564652442932
16
+ 74,"@Override public void doTag() throws JspException, IOException { Encode.forHtml(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005660169990733266,0.9994339346885681
17
+ 76,"private boolean equivalentStrings(String s1, String s2) { String value = canonicalize(s1); String oValue = canonicalize(s2); if (!value.equals(oValue)) { value = stripInternalSpaces(value); oValue = stripInternalSpaces(oValue); if (!value.equals(oValue)) { return false; } } return true; }",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.9981354475021362,0.0018644689116626978
18
+ 79,"@Override public void doTag() throws JspException, IOException { Encode.forXmlComment(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0006016989354975522,0.9993983507156372
19
+ 80,"PolicyFactory( Map<String, ElementAndAttributePolicies> policies, Set<String> textContainers, Map<String, AttributePolicy> globalAttrPolicies, HtmlStreamEventProcessor preprocessor, HtmlStreamEventProcessor postprocessor) { this.policies = policies; this.textContainers = textContainers; this.globalAttrPolicies = globalAttrPolicies; this.preprocessor = preprocessor; this.postprocessor = postprocessor; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0006560651818290353,0.9993439316749573
20
+ 81,"@Override public void doTag() throws JspException, IOException { Encode.forUriComponent(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005336343892849982,0.9994663596153259
21
+ 82,"@Override public void doTag() throws JspException, IOException { Encode.forXml(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005690690595656633,0.9994309544563293
22
+ 85,"public HtmlPolicyBuilder withPostprocessor(HtmlStreamEventProcessor pp) { this.postprocessor = HtmlStreamEventProcessor.Processors.compose( this.postprocessor, pp); return this; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005119030829519033,0.999488115310669
23
+ 86,"@Override public void doTag() throws JspException, IOException { Encode.forXmlAttribute(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0006018767016939819,0.9993981122970581
24
+ 87,"@Override public void doTag() throws JspException, IOException { Encode.forXmlContent(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005860140081495047,0.9994139671325684
25
+ 88,"@Override public void doTag() throws JspException, IOException { Encode.forCssString(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0006773995701223612,0.9993226528167725
26
+ 90,"@Override public void doTag() throws JspException, IOException { Encode.forJavaScriptAttribute(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005539414123632014,0.9994460940361023
27
+ 95,"public HtmlPolicyBuilder withPreprocessor(HtmlStreamEventProcessor pp) { this.preprocessor = HtmlStreamEventProcessor.Processors.compose( this.preprocessor, pp); return this; }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005130906356498599,0.9994869232177734
28
+ 97,"public static final String CONFIG_NO_PW_WHITELIST = ""Password Disabled Whitelist"";",unrelated,input_validation,False,true_unrelated_predicted_input_validation,0.996841311454773,0.0031586799304932356
29
+ 101,"@Override public void doTag() throws JspException, IOException { Encode.forHtmlContent(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0005838244105689228,0.9994162321090698
30
+ 102,"@Override public void doTag() throws JspException, IOException { Encode.forCssUrl(getJspContext().getOut(), _value); }",input_validation,unrelated,False,true_input_validation_predicted_unrelated,0.0009083918994292617,0.999091625213623
input_validation_codebert_v1/test_metrics.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "loss": 1.1106457078247332,
3
+ "accuracy": 0.8388888888888889,
4
+ "macro_f1": 0.8111364376424617,
5
+ "labels": [
6
+ "input_validation",
7
+ "unrelated"
8
+ ],
9
+ "precision": [
10
+ 0.8541666666666666,
11
+ 0.8333333333333334
12
+ ],
13
+ "recall": [
14
+ 0.6507936507936508,
15
+ 0.9401709401709402
16
+ ],
17
+ "f1": [
18
+ 0.7387387387387387,
19
+ 0.8835341365461847
20
+ ],
21
+ "support": [
22
+ 63,
23
+ 117
24
+ ],
25
+ "confusion_matrix": [
26
+ [
27
+ 41,
28
+ 22
29
+ ],
30
+ [
31
+ 7,
32
+ 110
33
+ ]
34
+ ],
35
+ "classification_report": " precision recall f1-score support\n\ninput_validation 0.85 0.65 0.74 63\n unrelated 0.83 0.94 0.88 117\n\n accuracy 0.84 180\n macro avg 0.84 0.80 0.81 180\n weighted avg 0.84 0.84 0.83 180\n"
36
+ }
input_validation_codebert_v1/test_predictions.csv ADDED
The diff for this file is too large to render. See raw diff
 
input_validation_codebert_v1/tokenizer/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
input_validation_codebert_v1/tokenizer/special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
input_validation_codebert_v1/tokenizer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
input_validation_codebert_v1/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "50264": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "model_max_length": 512,
53
+ "pad_token": "<pad>",
54
+ "sep_token": "</s>",
55
+ "tokenizer_class": "RobertaTokenizer",
56
+ "trim_offsets": true,
57
+ "unk_token": "<unk>"
58
+ }
input_validation_codebert_v1/tokenizer/vocab.json ADDED
The diff for this file is too large to render. See raw diff