File size: 59,411 Bytes
7141f4e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | dataset_index,text,true_label,predicted_label,correct,error_type,probability_authentication_identity,probability_unrelated
0,"@Override protected void internalInit(final boolean forceReinit) { assertNotNull(""ldapAuthenticator"", ldapAuthenticator); assertNotNull(""connectionFactory"", connectionFactory); assertNull(""passwordEncoder"", getPasswordEncoder()); assertNotBlank(""usersDn"", usersDn); setProfileDefinitionIfUndefined(new CommonProfileDefinition(x -> new LdapProfile())); setSerializer(new JsonSerializer(LdapProfile.class)); super.internalInit(forceReinit); }",authentication_identity,authentication_identity,True,,0.9853034019470215,0.014696617610752583
1,public BadCredentialsException(final String message) { super(message); },unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9643884897232056,0.03561149910092354
2,"private void authenticate(Krb5AcceptCredential cred, InetAddress initiator) throws KrbException, IOException { int encPartKeyType = apReqMessg.ticket.encPart.getEType(); Integer kvno = apReqMessg.ticket.encPart.getKeyVersionNumber(); EncryptionKey[] keys = cred.getKrb5EncryptionKeys(apReqMessg.ticket.sname); EncryptionKey dkey = EncryptionKey.findKey(encPartKeyType, kvno, keys); if (dkey == null) { throw new KrbException(Krb5.API_INVALID_ARG, ""Cannot find key of appropriate type to decrypt AP-REQ - "" + EType.toString(encPartKeyType)); } byte[] bytes = apReqMessg.ticket.encPart.decrypt(dkey, KeyUsage.KU_TICKET); byte[] temp = apReqMessg.ticket.encPart.reset(bytes); EncTicketPart enc_ticketPart = new EncTicketPart(temp); checkPermittedEType(enc_ticketPart.key.getEType()); byte[] bytes2 = apReqMessg.authenticator.decrypt(enc_ticketPart.key, KeyUsage.KU_AP_REQ_AUTHENTICATOR); byte[] temp2 = apReqMessg.authenticator.reset(bytes2); authenticator = new Authenticator(temp2);",authentication_identity,authentication_identity,True,,0.9853805899620056,0.014619413763284683
3,"DefaultHttpClient client = new DefaultHttpClient(); Credentials creds = new UsernamePasswordCredentials(user, password); client.getCredentialsProvider().setCredentials(AuthScope.ANY, creds); HttpGet get = new HttpGet(address + ""/users/self""); boolean version2 = version != null && (version.equals(""2.x"") || version.equals(""2"")); if (version2) { get.setHeader(""Content-Type"", ""application/json""); } else { get.setHeader(""Content-Type"", ""application/xml""); } List<String> roles = new ArrayList<>(); try { CloseableHttpResponse response = client.execute(get); LOGGER.debug(""Syncope HTTP response status code: {}"", response.getStatusLine().getStatusCode()); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { LOGGER.warn(""User {} not authenticated"", user); return false; }",authentication_identity,authentication_identity,True,,0.9858691692352295,0.014130841940641403
4,"BindAuthenticator bindAuthenticator = new BindAuthenticator(ldapContextSource); bindAuthenticator.setUserSearch(userSearch); String[] userDnPatterns = new String[] {rangerLdapUserDNPattern}; bindAuthenticator.setUserDnPatterns(userDnPatterns); bindAuthenticator.afterPropertiesSet(); LdapAuthenticationProvider ldapAuthenticationProvider = new LdapAuthenticationProvider(bindAuthenticator, defaultLdapAuthoritiesPopulator); if (userName != null && userPassword != null && !userName.trim().isEmpty() && !userPassword.trim().isEmpty()) { final List<GrantedAuthority> grantedAuths = new ArrayList<>(); grantedAuths.add(new SimpleGrantedAuthority(rangerLdapDefaultRole)); final UserDetails principal = new User(userName, userPassword, grantedAuths); final Authentication finalAuthentication = new UsernamePasswordAuthenticationToken(principal, userPassword, grantedAuths); authentication = ldapAuthenticationProvider.authenticate(finalAuthentication); authentication = getAuthenticationWithGrantedAuthority(authentication); }",authentication_identity,authentication_identity,True,,0.9857660531997681,0.014233929105103016
5,"public BadCredentialsException(String message, Throwable t) { super(message, t); }",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9823687672615051,0.017631201073527336
6,"DefaultJaasAuthenticationProvider jaasAuthenticationProvider = new DefaultJaasAuthenticationProvider(); String loginModuleName = ""org.apache.ranger.authentication.unix.jaas.PamLoginModule""; LoginModuleControlFlag controlFlag = LoginModuleControlFlag.REQUIRED; Map<String, String> options = PropertiesUtil.getPropertiesMap(); if (!options.containsKey(""ranger.pam.service"")) { options.put(""ranger.pam.service"", ""ranger-admin""); } AppConfigurationEntry appConfigurationEntry = new AppConfigurationEntry(loginModuleName, controlFlag, options); AppConfigurationEntry[] appConfigurationEntries = new AppConfigurationEntry[] {appConfigurationEntry}; Map<String, AppConfigurationEntry[]> appConfigurationEntriesOptions = new HashMap<>(); appConfigurationEntriesOptions.put(""SPRINGSECURITY"", appConfigurationEntries); Configuration configuration = new InMemoryConfiguration(appConfigurationEntriesOptions); jaasAuthenticationProvider.setConfiguration(configuration); RoleUserAuthorityGranter authorityGranter = new RoleUserAuthorityGranter(); RoleUserAuthorityGranter[] authorityGranters = new RoleUserAuthorityGranter[] {authorityGranter}; jaasAuthenticationProvider.setAuthorityGranters(authorityGranters); jaasAuthenticationProvider.afterPropertiesSet();",authentication_identity,authentication_identity,True,,0.9856488704681396,0.01435112114995718
7,"private String getCertFingerPrint(String mdAlg, Certificate cert) throws Exception { byte[] encCertInfo = cert.getEncoded(); MessageDigest md = MessageDigest.getInstance(mdAlg); byte[] digest = md.digest(encCertInfo); return HexFormat.ofDelimiter("":"").withUpperCase().formatHex(digest); }",unrelated,unrelated,True,,0.07169478386640549,0.9283052086830139
8,"public static void validateChecksumString(String checksum) { if(StringUtils.isNotEmpty(checksum)) { ChecksumValue checksumValue = new ChecksumValue(checksum); String digest = checksumValue.getChecksum(); Map<String, Integer> map = getChecksumLengthsMap(); if (!map.containsKey(checksumValue.getAlgorithm())) { throw new IllegalArgumentException(""Algorithm "" + checksumValue.getAlgorithm() + "" was provided but it is not one of the supported algorithms""); } Integer expectedLength = map.get(checksumValue.getAlgorithm()); if (digest.length() != expectedLength) { throw new IllegalArgumentException(""Checksum digest length should be "" + expectedLength + "" instead of "" + digest.length()); } } }",unrelated,unrelated,True,,0.0022970486897975206,0.9977030158042908
9,"private void setAuthenticator(OkHttpClient.Builder okHttpClientBuilder, ProcessContext context) { final String authUser = trimToEmpty(context.getProperty(REQUEST_USERNAME).getValue()); if (!authUser.isEmpty() && context.getProperty(REQUEST_DIGEST_AUTHENTICATION_ENABLED).asBoolean()) { final String authPass = trimToEmpty(context.getProperty(REQUEST_PASSWORD).getValue()); final Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>(); com.burgstaller.okhttp.digest.Credentials credentials = new com.burgstaller.okhttp.digest.Credentials(authUser, authPass); final DigestAuthenticator digestAuthenticator = new DigestAuthenticator(credentials); okHttpClientBuilder.interceptors().add(new AuthenticationCacheInterceptor(authCache)); okHttpClientBuilder.authenticator(new CachingAuthenticatorDecorator(digestAuthenticator, authCache)); } }",authentication_identity,authentication_identity,True,,0.9862444996833801,0.013755498453974724
10,"public DigestCredentials(final String token, final String httpMethod, final String username, final String realm, final String nonce, final String uri, final String cnonce, final String nc, final String qop) { super(token); this.username = username; this.realm = realm; this.nonce = nonce; this.uri = uri; this.cnonce = cnonce; this.nc = nc; this.qop = qop; this.httpMethod = httpMethod; }",authentication_identity,unrelated,False,true_authentication_identity_predicted_unrelated,0.40286368131637573,0.5971363186836243
11,"public boolean matches(final byte[] message, final byte[] digest) { if (!isInitialized()) { initialize(); } int poolPosition; synchronized(this) { poolPosition = this.roundRobin; this.roundRobin = (this.roundRobin + 1) % this.poolSize; } return this.pool[poolPosition].matches(message, digest); }",authentication_identity,unrelated,False,true_authentication_identity_predicted_unrelated,0.0020012210588902235,0.9979987740516663
12,"@Override protected byte[] doDecoding(final byte[] bytes) throws DecoderException { if (bytes == null) { return null; } try { return Base64.builder() .setLineLength(0) .setLineSeparator(BaseNCodec.getChunkSeparator()) .setUrlSafe(false) .setDecodingPolicy(decodingPolicy) .get() .decode(bytes); } catch (final IllegalArgumentException e) { throw new DecoderException(e.getMessage(), e); } }",unrelated,unrelated,True,,0.0023744646459817886,0.9976255297660828
13,"@Override protected void checkCredentials(final CallContext ctx, final Credentials credentials) { if (credentials == null) { val nonce = calculateNonce(); ctx.webContext().setResponseHeader(HttpConstants.AUTHENTICATE_HEADER, ""Digest realm=\"""" + realm + ""\"", qop=\""auth\"", nonce=\"""" + nonce + ""\""""); } else { ctx.webContext().setResponseHeader(HttpConstants.AUTHENTICATE_HEADER, Pac4jConstants.EMPTY_STRING); } }",authentication_identity,authentication_identity,True,,0.9858745336532593,0.0141255222260952
14,"@Override public KerberosTicketValidation validateTicket(byte[] token) { init(); try { return Subject.doAs(this.serviceSubject, new KerberosValidateAction(token)); } catch (PrivilegedActionException e) { throw new BadCredentialsException(""Kerberos validation not successful"", e); } }",authentication_identity,authentication_identity,True,,0.9856614470481873,0.014338471926748753
15,"static final String PRINCIPAL = ""ranger.spnego.kerberos.principal"";",unrelated,unrelated,True,,0.004356158897280693,0.9956438541412354
16,"if (authToken != null && authToken != AuthenticationToken.ANONYMOUS) { LOG.debug(""remote user from authtoken = {}"", authToken.getUserName()); UserGroupInformation ugi = UserGroupInformation.createRemoteUser(authToken.getUserName(), SaslRpcServer.AuthMethod.KERBEROS); if (ugi != null) { ugi = UserGroupInformation.createProxyUser(doAsUser, ugi); LOG.debug(""Real user from UGI = {}"", ugi.getRealUser().getShortUserName()); try { ProxyUsers.authorize(ugi, request.getRemoteAddr()); } catch (AuthorizationException ex) { HttpExceptionUtils.createServletExceptionResponse(response, 403, ex); if (LOG.isDebugEnabled()) { LOG.debug(""Authentication exception: {}"", ex.getMessage(), ex); } else { LOG.warn(""Authentication exception: {}"", ex.getMessage()); } return; }",authentication_identity,authentication_identity,True,,0.9854755997657776,0.014524423517286777
17,"static final String KEYTAB_PARAM = ""kerberos.keytab"";",unrelated,unrelated,True,,0.0025046044029295444,0.9974954128265381
18,"params.put(TOKEN_VALID_PARAM, PropertiesUtil.getProperty(TOKEN_VALID, ""30"")); params.put(COOKIE_DOMAIN_PARAM, PropertiesUtil.getProperty(COOKIE_DOMAIN, PropertiesUtil.getProperty(HOST_NAME, ""localhost""))); params.put(COOKIE_PATH_PARAM, PropertiesUtil.getProperty(COOKIE_PATH, ""/"")); params.put(ALLOW_TRUSTED_PROXY, PropertiesUtil.getProperty(ALLOW_TRUSTED_PROXY, ""false"")); params.put(RULES_MECHANISM_PARAM, PropertiesUtil.getProperty(RULES_MECHANISM, ""hadoop"")); try { params.put(PRINCIPAL_PARAM, SecureClientLogin.getPrincipal(PropertiesUtil.getProperty(PRINCIPAL, """"), PropertiesUtil.getProperty(HOST_NAME))); } catch (IOException ignored) { } params.put(KEYTAB_PARAM, PropertiesUtil.getProperty(KEYTAB, """"));",authentication_identity,authentication_identity,True,,0.9857968688011169,0.014203152619302273
19,"var keyTabLocationAsString = normalizeKeyTabPath(this.keyTabLocation.getURL().toExternalForm()); var loginConfig = new LoginConfig(keyTabLocationAsString, this.servicePrincipal, this.debug); Set<Principal> princ = new HashSet<>(1); princ.add(new KerberosPrincipal(this.servicePrincipal)); var sub = new Subject(false, princ, new HashSet<>(), new HashSet<>()); var lc = new LoginContext(Pac4jConstants.EMPTY_STRING, sub, null, loginConfig); lc.login(); this.serviceSubject = lc.getSubject();",authentication_identity,authentication_identity,True,,0.9851880073547363,0.014811950735747814
20,"private Predicate<RangerPolicyItem> filterByPrincipalsPredicate(String[] filteringPrincipals) { if (ArrayUtils.isEmpty(filteringPrincipals)) { return policyItem -> true; } Map<String, Set<String>> principalCriteriaMap = new HashMap<>(); for (String principal : filteringPrincipals) { String[] parts = principal.split("":""); String principalType = parts.length > 1 ? parts[0] : DEFAULT_PRINCIPAL_TYPE; String principalName = parts.length > 1 ? parts[1] : parts[0]; principalCriteriaMap.computeIfAbsent(principalType.toLowerCase(), k -> new HashSet<>()).add(principalName); } return policyItem -> { Set<String> users = principalCriteriaMap.getOrDefault(PRINCIPAL_TYPE_USER, Collections.emptySet()); Set<String> groups = principalCriteriaMap.getOrDefault(PRINCIPAL_TYPE_GROUP, Collections.emptySet()); Set<String> roles = principalCriteriaMap.getOrDefault(PRINCIPAL_TYPE_ROLE, Collections.emptySet()); return (policyItem.getUsers() != null && policyItem.getUsers().stream().anyMatch(users::contains)) || (policyItem.getGroups() != null && policyItem.getGroups().stream().anyMatch(groups::contains)) || (policyItem.getRoles() != null && policyItem.getRoles().stream().anyMatch(roles::contains)); }; }",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9715377688407898,0.028462234884500504
21,public boolean isInitiatorCredential() { return (usage != GSSCredential.ACCEPT_ONLY); },authentication_identity,authentication_identity,True,,0.984828770160675,0.015171248465776443
22,private Predicate<RangerPolicyItem> matchesPrincipalPredicate(RangerPrincipal principal) { String principalName = principal.getName(); PrincipalType principalType = principal.getType(); return policyItem -> { switch (principalType) { case USER: return policyItem.getUsers().contains(principalName); case GROUP: return policyItem.getGroups().contains(principalName); case ROLE: return policyItem.getRoles().contains(principalName); } return false; }; },authentication_identity,authentication_identity,True,,0.9831148982048035,0.0168850626796484
23,"@Override public void initialize(Subject _subject, CallbackHandler _callbackHandler, Map<String, ?> _sharedState, Map<String, ?> _options) { Map<String, Object> options = new HashMap<>(_options); for (Map.Entry<String, ?> entry : _options.entrySet()) { if (entry.getValue() instanceof String) { options.put(entry.getKey(), Krb5LoginModule.interpolate((String)entry.getValue())); } else { options.put(entry.getKey(), entry.getValue()); } } this.loginModule.initialize(_subject, _callbackHandler, _sharedState, options);",authentication_identity,authentication_identity,True,,0.9827393293380737,0.017260659486055374
24,"public SpNegoMechFactory(GSSCaller caller) { manager = new GSSManagerImpl(caller, false); Oid[] mechs = manager.getMechs(); availableMechs = new Oid[mechs.length-1]; for (int i = 0, j = 0; i < mechs.length; i++) { if (!mechs[i].equals(GSS_SPNEGO_MECH_OID)) { availableMechs[j++] = mechs[i]; } }",authentication_identity,authentication_identity,True,,0.7696043848991394,0.23039557039737701
25,if (sslContextProvider != null) { final SSLContext sslContext = sslContextProvider.createContext(); SslConfiguration sslConfiguration = new StandardSslConfiguration(sslContext); listenerFactory.setSslConfiguration(sslConfiguration); listenerFactory.setImplicitSsl(true); DataConnectionConfigurationFactory dataConnectionConfigurationFactory = new DataConnectionConfigurationFactory(); dataConnectionConfigurationFactory.setImplicitSsl(true); dataConnectionConfigurationFactory.setSslConfiguration(sslConfiguration);,authentication_identity,authentication_identity,True,,0.9847270250320435,0.015273015014827251
26,") { final StandardServerConnectorFactory serverConnectorFactory = new StandardServerConnectorFactory(server, port); serverConnectorFactory.setRequestHeaderSize(requestMaxHeaderSize); final SSLContext sslContext = sslContextProvider == null ? null : sslContextProvider.createContext(); serverConnectorFactory.setSslContext(sslContext); final String[] enabledProtocols = sslContext == null ? new String[0] : sslContext.getDefaultSSLParameters().getProtocols(); serverConnectorFactory.setIncludeSecurityProtocols(enabledProtocols); if (ClientAuthentication.REQUIRED == clientAuthentication) { serverConnectorFactory.setNeedClientAuth(true); } else if (ClientAuthentication.WANT == clientAuthentication) { serverConnectorFactory.setWantClientAuth(true); }",authentication_identity,authentication_identity,True,,0.9858269095420837,0.014173166826367378
27,"moduleStack[i].module.initialize(subject, callbackHandler, state, moduleStack[i].entry.getOptions()); } boolean status; switch (methodName) { case LOGIN_METHOD: status = moduleStack[i].module.login(); break; case COMMIT_METHOD: status = moduleStack[i].module.commit(); break; case LOGOUT_METHOD: status = moduleStack[i].module.logout(); break; case ABORT_METHOD: status = moduleStack[i].module.abort(); break;",authentication_identity,authentication_identity,True,,0.9798840284347534,0.020115982741117477
28,@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; var that = (KerberosCredentials) o; return !(kerberosTicket != null ? !getTicketAsString(kerberosTicket).equals(getTicketAsString(that.kerberosTicket)) : that.kerberosTicket != null); },authentication_identity,authentication_identity,True,,0.9847868084907532,0.01521321851760149
29,"byte[] decryptSeq(byte[] ivec, byte[] ciphertext, int start, int len) throws GSSException { switch (sgnAlg) { case MessageToken.SGN_ALG_DES_MAC_MD5: case MessageToken.SGN_ALG_DES_MAC: try { Cipher des = getInitializedDes(false, keybytes, ivec); return des.doFinal(ciphertext, start, len); } catch (GeneralSecurityException e) { GSSException ge = new GSSException(GSSException.FAILURE, -1, ""Could not decrypt sequence number using DES - "" + e.getMessage()); ge.initCause(e); throw ge; }",authentication_identity,authentication_identity,True,,0.8657008409500122,0.1342991441488266
30,"@Override public byte[] getMIC(byte[] message, int s, int l) { try { MessageProp prop = new MessageProp(0, true); return context.getMIC(message, s, l, prop); } catch (GSSException ex) { return null; } }",authentication_identity,unrelated,False,true_authentication_identity_predicted_unrelated,0.0033432645723223686,0.9966567754745483
31,"@OnScheduled public void onScheduled(final ProcessContext context) throws IOException { final TransportProtocol transportProtocol = context.getProperty(PROTOCOL).asAllowableValue(TransportProtocol.class); final int receiveBufferSize = context.getProperty(RECV_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); final int maxMessageQueueSize = context.getProperty(MAX_MESSAGE_QUEUE_SIZE).asInteger(); final String networkInterfaceName = context.getProperty(NETWORK_INTF_NAME).evaluateAttributeExpressions().getValue(); final Charset charset = Charset.forName(context.getProperty(CHARSET).evaluateAttributeExpressions().getValue()); final String msgDemarcator = context.getProperty(MESSAGE_DELIMITER).getValue().replace(""\\n"", ""\n"").replace(""\\r"", ""\r"").replace(""\\t"", ""\t""); messageDemarcatorBytes = msgDemarcator.getBytes(charset); parser = new SyslogParser(charset); syslogEvents = new LinkedBlockingQueue<>(maxMessageQueueSize); final int port; final int maxSocketBufferSize; final int workerThreads; final SSLContextProvider sslContextProvider; if (transportProtocol == TransportProtocol.TCP) { port = context.getProperty(TCP_PORT).evaluateAttributeExpressions().asInteger(); maxSocketBufferSize = context.getProperty(MAX_SOCKET_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); workerThreads = context.getProperty(WORKER_THREADS).asLong().intValue(); sslContextProvider = context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextProvider.class); } else { port = context.getProperty(UDP_PORT).evaluateAttributeExpressions().asInteger(); maxSocketBufferSize = 1_000_000; workerThreads = 2; sslContextProvider = null; } final InetAddress address = getListenAddress(networkInterfaceName); final ByteArrayMessageNettyEventServerFactory factory = new ByteArrayMessageNettyEventServerFactory(getLogger(), address, port, transportProtocol, messageDemarcatorBytes, receiveBufferSize, syslogEvents, FilteringStrategy.EMPTY); factory.setShutdownQuietPeriod(ShutdownQuietPeriod.QUICK.getDuration()); factory.setThreadNamePrefix(String.format(""%s[%s]"", ListenSyslog.class.getSimpleName(), getIdentifier())); factory.setWorkerThreads(workerThreads); factory.setSocketReceiveBuffer(maxSocketBufferSize); if (sslContextProvider != null) { final SSLContext sslContext = sslContextProvider.createContext(); ClientAuth clientAuth = ClientAuth.REQUIRED; final PropertyValue clientAuthProperty = context.getProperty(CLIENT_AUTH); if (clientAuthProperty.isSet()) { clientAuth = ClientAuth.valueOf(clientAuthProperty.getValue()); } factory.setSslContext(sslContext); factory.setClientAuth(clientAuth); } eventServer = factory.getEventServer(); }",unrelated,unrelated,True,,0.44981107115745544,0.5501888990402222
32,"@OnScheduled public void setUpClient(final ProcessContext context) throws IOException { okHttpClientAtomicReference.set(null); OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient().newBuilder(); final ProxyConfiguration proxyConfig = ProxyConfiguration.getConfiguration(context); final Proxy proxy = proxyConfig.createProxy(); if (!Type.DIRECT.equals(proxy.type())) { okHttpClientBuilder.proxy(proxy); if (proxyConfig.hasCredential()) { ProxyAuthenticator proxyAuthenticator = new ProxyAuthenticator(proxyConfig.getProxyUserName(), proxyConfig.getProxyUserPassword()); okHttpClientBuilder.proxyAuthenticator(proxyAuthenticator); } } final boolean cachingEnabled = context.getProperty(RESPONSE_CACHE_ENABLED).asBoolean(); if (cachingEnabled) { final int maxCacheSizeBytes = context.getProperty(RESPONSE_CACHE_SIZE).asDataSize(DataUnit.B).intValue(); okHttpClientBuilder.cache(new Cache(getResponseCacheDirectory(), maxCacheSizeBytes)); } if (context.getProperty(HTTP2_DISABLED).asBoolean()) { okHttpClientBuilder.protocols(List.of(Protocol.HTTP_1_1)); } okHttpClientBuilder.followRedirects(context.getProperty(RESPONSE_REDIRECTS_ENABLED).asBoolean()); okHttpClientBuilder.connectTimeout((context.getProperty(SOCKET_CONNECT_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue()), TimeUnit.MILLISECONDS); okHttpClientBuilder.readTimeout(context.getProperty(SOCKET_READ_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue(), TimeUnit.MILLISECONDS); okHttpClientBuilder.writeTimeout(context.getProperty(SOCKET_WRITE_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue(), TimeUnit.MILLISECONDS); okHttpClientBuilder.connectionPool( new ConnectionPool( context.getProperty(SOCKET_IDLE_CONNECTIONS).asInteger(), context.getProperty(SOCKET_IDLE_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue(), TimeUnit.MILLISECONDS ) ); final SSLContextProvider sslContextProvider = context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextProvider.class); if (sslContextProvider != null) { final SSLContext sslContext = sslContextProvider.createContext(); final SSLSocketFactory socketFactory = sslContext.getSocketFactory(); final X509TrustManager trustManager = sslContextProvider.createTrustManager(); okHttpClientBuilder.sslSocketFactory(socketFactory, trustManager); } final CookieStrategy cookieStrategy = CookieStrategy.valueOf(context.getProperty(RESPONSE_COOKIE_STRATEGY).getValue()); switch (cookieStrategy) { case DISABLED: break; case ACCEPT_ALL: final CookieManager cookieManager = new CookieManager(); cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); okHttpClientBuilder.cookieJar(new JavaNetCookieJar(cookieManager)); break; } setAuthenticator(okHttpClientBuilder, context); okHttpClientAtomicReference.set(okHttpClientBuilder.build()); }",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9822630286216736,0.017736922949552536
33,"private boolean isSpnegoEnable(String authType) { String principal = PropertiesUtil.getProperty(PRINCIPAL); String keytabPath = PropertiesUtil.getProperty(KEYTAB); return ((!StringUtils.isEmpty(authType)) && KERBEROS_TYPE.equalsIgnoreCase(authType) && SecureClientLogin.isKerberosCredentialExists(principal, keytabPath)); }",authentication_identity,authentication_identity,True,,0.9860957264900208,0.01390429399907589
34,"public static String getPaddedDigest(String algorithm, String inputString) throws NoSuchAlgorithmException { MessageDigest digest = MessageDigest.getInstance(algorithm); digest.reset(); BigInteger pwInt = new BigInteger(1, digest.digest(inputString.getBytes())); return getPaddedDigestString(digest, pwInt); }",unrelated,unrelated,True,,0.0020067626610398293,0.9979932308197021
35,"private void removeMatchingPrincipalFromPolicyItem(RangerPolicyItem policyItem, RangerPrincipal principal) { String principalName = principal.getName(); PrincipalType principalType = principal.getType(); if (principalType == PrincipalType.USER && policyItem.getUsers() != null) { policyItem.getUsers().remove(principalName); } else if (principalType == PrincipalType.GROUP && policyItem.getGroups() != null) { policyItem.getGroups().remove(principalName); } else if (principalType == PrincipalType.ROLE && policyItem.getRoles() != null) { policyItem.getRoles().remove(principalName); } }",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9818555116653442,0.018144547939300537
36,"@Override protected boolean authorizeProxyUser(String realUser, String doAsUser, String remoteAddr) { try { UserGroupInformation ugi = UserGroupInformation.createRemoteUser(realUser); ugi = UserGroupInformation.createProxyUser(doAsUser, ugi); ProxyUsers.authorize(ugi, remoteAddr); LOG.debug(""RangerJwtAuthFilter.authorizeProxyUser(): ProxyUsers.authorize SUCCEEDED for realUser=[{}], doAs=[{}]"", realUser, doAsUser); return true; } catch (AuthorizationException ex) { LOG.warn(""JWT ProxyUsers.authorize failed for doAs=[{}], realUser=[{}]: {}"", doAsUser, realUser, ex.getMessage()); return false;",authentication_identity,authentication_identity,True,,0.9855592250823975,0.014440752565860748
37,"static final String KEYTAB = ""ranger.spnego.kerberos.keytab"";",unrelated,unrelated,True,,0.0023559164255857468,0.9976440072059631
38,"String[] userDnAndNamespace; try (LDAPCache cache = LDAPCache.getCache(lOptions)) { try { logger.debug(""Get the user DN.""); userDnAndNamespace = cache.getUserDnAndNamespace(user); } catch (Exception e) { logger.warn(""Can't connect to the LDAP server: {}"", e.getMessage(), e); throw new LoginException(""Can't connect to the LDAP server: "" + e.getMessage()); } if (userDnAndNamespace == null) { return false; } principals.add(new UserPrincipal(user)); try { String[] roles = cache.getUserRoles(user, userDnAndNamespace[0], userDnAndNamespace[1]); for (String role : roles) { principals.add(new RolePrincipal(role));",authentication_identity,authentication_identity,True,,0.9853797554969788,0.014620216563344002
39,public LdapProfileService(final Authenticator ldapAuthenticator) { this.ldapAuthenticator = ldapAuthenticator; },authentication_identity,authentication_identity,True,,0.9838395118713379,0.01616046018898487
40,"public synchronized DirContext open() throws NamingException { if (isContextAlive()) { return context; } clearCache(); context = new InitialDirContext(options.getEnv()); EventDirContext eventContext = ((EventDirContext) context.lookup("""")); final SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); if (!options.getDisableCache()) { String filter = options.getUserFilter(); filter = filter.replaceAll(Pattern.quote(""%u""), Matcher.quoteReplacement(""*"")); filter = filter.replace(""\\"", ""\\\\""); eventContext.addNamingListener(options.getUserBaseDn(), filter, constraints, this);",authentication_identity,authentication_identity,True,,0.978754460811615,0.021245574578642845
41,"protected OAuthRequest createAccessTokenRequest(AccessTokenRequestParams params) { final OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint()); final Map<String, String> map = new HashMap<>(); map.put(""client_id"", getApiKey()); map.put(""client_secret"", getApiSecret()); map.put(OAuthConstants.GRANT_TYPE, OAuthConstants.AUTHORIZATION_CODE); map.put(OAuthConstants.CODE, params.getCode()); map.put(OAuthConstants.REDIRECT_URI, getCallback());",authentication_identity,authentication_identity,True,,0.9858368635177612,0.014163156040012836
42,"val credentials = new OidcCredentials(); val code = successResponse.getAuthorizationCode(); if (code != null) { credentials.setCode(code.getValue()); } val idToken = successResponse.getIDToken(); if (idToken != null) { credentials.setIdToken(idToken.serialize()); } val accessToken = successResponse.getAccessToken(); if (accessToken != null) { credentials.setAccessTokenObject(accessToken); } if (code == null && idToken == null && accessToken == null) { throw new TechnicalException(""Cannot accept empty OIDC credentials""); } return Optional.of(credentials);",authentication_identity,authentication_identity,True,,0.9854016304016113,0.014598360285162926
43,"private JSONObject createConnection(String externalId) throws Exception { if (accessToken == null || accessToken.isEmpty()) { JSONObject accessTokenResponse = getAccessToken(); if (!accessTokenResponse.has(""accessToken"")) { return accessTokenResponse; } accessToken = accessTokenResponse.getString(""accessToken""); } Map<String, String> snapBiTransactionHeader = buildSnapBiTransactionHeader(externalId, timeStamp); String url = SnapBiConfig.getSnapBiTransactionBaseUrl() + apiPath; return SnapBiApiRequestor.remoteCall(url, snapBiTransactionHeader, body); }",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9857118725776672,0.014288097620010376
44,"public JSONObject getAccessToken() throws Exception { Map<String, String> snapBiAccessTokenHeader = buildAccessTokenHeader(this.timeStamp); Map<String, String> openApiPayload = new HashMap<>(); openApiPayload.put(""grant_type"", ""client_credentials""); return SnapBiApiRequestor.remoteCall( SnapBiConfig.getSnapBiTransactionBaseUrl() + ACCESS_TOKEN, snapBiAccessTokenHeader, openApiPayload ); }",authentication_identity,authentication_identity,True,,0.9853400588035583,0.014659914188086987
45,"private static final String EXCHANGE_TOKEN_URL = ""https://graph.facebook.com/v2.8/oauth/access_token?grant_type=fb_exchange_token"";",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.9830819964408875,0.01691802218556404
46,"if (userName != null && !userName.trim().isEmpty()) { final List<GrantedAuthority> grantedAuths = new ArrayList<>(); grantedAuths.add(new SimpleGrantedAuthority(rangerLdapDefaultRole)); final UserDetails principal = new User(userName, """", grantedAuths); final AbstractAuthenticationToken finalAuthentication = new UsernamePasswordAuthenticationToken(principal, """", grantedAuths); WebAuthenticationDetails webDetails = new WebAuthenticationDetails(httpRequest); finalAuthentication.setDetails(webDetails); RangerAuthenticationProvider authenticationProvider = new RangerAuthenticationProvider(); authenticationProvider.setSsoEnabled(ssoEnabled); Authentication authentication = authenticationProvider.authenticate(finalAuthentication); authentication = getGrantedAuthority(authentication); SecurityContextHolder.getContext().setAuthentication(authentication);",authentication_identity,authentication_identity,True,,0.9854332804679871,0.014566773548722267
47,private boolean isAuthenticated() { Authentication existingAuth = SecurityContextHolder.getContext().getAuthentication(); return !(!(existingAuth != null && existingAuth.isAuthenticated()) || existingAuth instanceof SSOAuthentication); },authentication_identity,authentication_identity,True,,0.9855839014053345,0.014416063204407692
48,public WebSessionManager getSessionManager() { return this.sessionManager; },unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.8186979293823242,0.18130211532115936
49,"public HttpHandler build() { WebHandler decorated = new FilteringWebHandler(this.webHandler, this.filters); decorated = new ExceptionHandlingWebHandler(decorated, this.exceptionHandlers); HttpWebHandlerAdapter adapted = new HttpWebHandlerAdapter(decorated); if (this.sessionManager != null) { adapted.setSessionManager(this.sessionManager); } if (this.codecConfigurer != null) { adapted.setCodecConfigurer(this.codecConfigurer); } if (this.localeContextResolver != null) { adapted.setLocaleContextResolver(this.localeContextResolver); } if (this.forwardedHeaderTransformer != null) { adapted.setForwardedHeaderTransformer(this.forwardedHeaderTransformer); } if (this.observationRegistry != null) { adapted.setObservationRegistry(this.observationRegistry); } if (this.observationConvention != null) { adapted.setObservationConvention(this.observationConvention); } if (this.applicationContext != null) { adapted.setApplicationContext(this.applicationContext); } if (this.defaultHtmlEscape != null) { adapted.setDefaultHtmlEscape(this.defaultHtmlEscape); } adapted.afterPropertiesSet(); return (this.httpHandlerDecorator != null ? this.httpHandlerDecorator.apply(adapted) : adapted); }",unrelated,authentication_identity,False,true_unrelated_predicted_authentication_identity,0.6373922228813171,0.3626077473163605
50,private @Nullable WebSessionManager sessionManager;,unrelated,unrelated,True,,0.03111000917851925,0.9688900113105774
51,private boolean isRequestAuthenticated() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); return auth != null && auth.isAuthenticated(); },authentication_identity,authentication_identity,True,,0.9857171773910522,0.014282786287367344
52,private WebHttpHandlerBuilder(WebHttpHandlerBuilder other) { this.webHandler = other.webHandler; this.applicationContext = other.applicationContext; this.filters.addAll(other.filters); this.exceptionHandlers.addAll(other.exceptionHandlers); this.httpHandlerDecorator = other.httpHandlerDecorator; this.sessionManager = other.sessionManager; this.codecConfigurer = other.codecConfigurer; this.localeContextResolver = other.localeContextResolver; this.forwardedHeaderTransformer = other.forwardedHeaderTransformer; this.observationRegistry = other.observationRegistry; this.observationConvention = other.observationConvention; this.defaultHtmlEscape = other.defaultHtmlEscape; },unrelated,unrelated,True,,0.21125465631484985,0.7887453436851501
53,"this.attributes.put(ServerWebExchange.LOG_ID_ATTRIBUTE, request.getId()); this.request = request; this.response = response; this.sessionMono = sessionManager.getSession(this).cache(); this.localeContextResolver = localeContextResolver; this.formDataMono = initFormData(request, codecConfigurer, getLogPrefix()); this.multipartDataMono = initMultipartData(codecConfigurer, getLogPrefix()); this.applicationContext = applicationContext;",authentication_identity,authentication_identity,True,,0.9848954677581787,0.015104508958756924
54,"try { builder.sessionManager( context.getBean(WEB_SESSION_MANAGER_BEAN_NAME, WebSessionManager.class)); } catch (NoSuchBeanDefinitionException ex) { }",authentication_identity,authentication_identity,True,,0.9841852784156799,0.015814734622836113
55,"public void setSessionManager(WebSessionManager sessionManager) { Assert.notNull(sessionManager, ""WebSessionManager must not be null""); this.sessionManager = sessionManager; }",authentication_identity,unrelated,False,true_authentication_identity_predicted_unrelated,0.4417704939842224,0.5582294464111328
56,public WebHttpHandlerBuilder sessionManager(WebSessionManager manager) { this.sessionManager = manager; return this; },authentication_identity,unrelated,False,true_authentication_identity_predicted_unrelated,0.27255502343177795,0.7274449467658997
57,"protected boolean validateAudiences(SignedJWT jwtToken) { boolean valid = false; if (jwtProperties.getAudiences().isEmpty()) { valid = true; } else { try { List<String> tokenAudienceList = jwtToken.getJWTClaimsSet().getAudience(); if (tokenAudienceList != null) { for (String aud : tokenAudienceList) { if (jwtProperties.getAudiences().contains(aud)) { LOG.debug(""Audience claim has been validated.""); valid = true;",authentication_identity,authentication_identity,True,,0.9859927296638489,0.014007355086505413
58,"@Override public void setRememberMeServices(RememberMeServices rememberMeServices) { if (LOG.isDebugEnabled()) { LOG.debug(""setRememberMeServices() enter: rememberMeServices={}"", rememberMeServices.toString()); } super.setRememberMeServices(rememberMeServices); }",authentication_identity,authentication_identity,True,,0.9818142056465149,0.018185822293162346
59,"protected boolean validateSignature(SignedJWT jwtToken) { boolean valid = false; if (JWSObject.State.SIGNED == jwtToken.getState()) { LOG.debug(""SSO token is in a SIGNED state""); if (jwtToken.getSignature() != null) { LOG.debug(""SSO token signature is not null""); try { JWSVerifier verifier = new RSASSAVerifier(publicKey); if (jwtToken.verify(verifier)) { valid = true; LOG.debug(""SSO token has been successfully verified""); } else { LOG.warn(""SSO signature verification failed.Please check the public key""); }",authentication_identity,authentication_identity,True,,0.9854322075843811,0.014567812904715538
60,"@Override public void onSubscribe(@NonNull Disposable d) { try { lastThread = Thread.currentThread(); if (d == null) { errors.add(new NullPointerException(""onSubscribe received a null Subscription"")); return; } if (!upstream.compareAndSet(null, d)) { d.dispose(); if (upstream.get() != DisposableHelper.DISPOSED) { errors.add(new IllegalStateException(""onSubscribe received multiple subscriptions: "" + d)); } return; } downstream.onSubscribe(d); } finally { onSubscribeReady.countDown();",unrelated,unrelated,True,,0.006943417713046074,0.99305659532547
61,public void setMillis(ReadableInstant instant) { long instantMillis = DateTimeUtils.getInstantMillis(instant); setMillis(instantMillis); },unrelated,unrelated,True,,0.0021300124935805798,0.9978699684143066
62,"public Interval gap(ReadableInterval interval) { interval = DateTimeUtils.getReadableInterval(interval); long otherStart = interval.getStartMillis(); long otherEnd = interval.getEndMillis(); long thisStart = getStartMillis(); long thisEnd = getEndMillis(); if (thisStart > otherEnd) { return new Interval(otherEnd, thisStart, getChronology()); } else if (otherStart > thisEnd) { return new Interval(thisEnd, otherStart, getChronology()); } else { return null; } }",unrelated,unrelated,True,,0.0023430376313626766,0.9976569414138794
63,"private int generateRandomNumber(final List<Character> characterList) { final int listSize = characterList.size(); if (random != null) { return String.valueOf(characterList.get(random.applyAsInt(listSize))).codePointAt(0); } return String.valueOf(characterList.get(ThreadLocalRandom.current().nextInt(0, listSize))).codePointAt(0); }",unrelated,unrelated,True,,0.0020210270304232836,0.9979789853096008
64,"@Override protected void subscribeActual(MaybeObserver<? super R> observer) { source.subscribe(new MapOptionalSingleObserver<>(observer, mapper)); }",unrelated,unrelated,True,,0.0021535062696784735,0.9978464841842651
65,"@Override protected void subscribeActual(Observer<? super R> observer) { source.subscribe(new ConcatMapEagerMainObserver<>(observer, mapper, maxConcurrency, prefetch, errorMode)); }",unrelated,unrelated,True,,0.0021169076208025217,0.9978830218315125
66,@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GJCacheKey)) { return false; } GJCacheKey other = (GJCacheKey) obj; if (cutoverInstant == null) { if (other.cutoverInstant != null) { return false; } } else if (!cutoverInstant.equals(other.cutoverInstant)) { return false; } if (minDaysInFirstWeek != other.minDaysInFirstWeek) {,unrelated,unrelated,True,,0.002392106456682086,0.9976078271865845
67,public void setZone(DateTimeZone zone) { iSavedState = null; iZone = zone; },unrelated,unrelated,True,,0.0022487896494567394,0.9977511763572693
68,"protected String resolveVariable(final String variableName, final TextStringBuilder buf, final int startPos, final int endPos) { final StringLookup resolver = getStringLookup(); if (resolver == null) { return null; } return resolver.apply(variableName); }",unrelated,unrelated,True,,0.0021646751556545496,0.9978353381156921
69,public Seconds minus(Seconds seconds) { if (seconds == null) { return this; } return minus(seconds.getValue()); },unrelated,unrelated,True,,0.0021463006269186735,0.997853696346283
70,"@SuppressWarnings(""unchecked"") void remove(ReplaySubscription<T> rs) { for (;;) { ReplaySubscription<T>[] a = subscribers.get(); if (a == TERMINATED || a == EMPTY) { return; } int len = a.length; int j = -1; for (int i = 0; i < len; i++) { if (a[i] == rs) { j = i; break; } } if (j < 0) { return; } ReplaySubscription<T>[] b;",unrelated,unrelated,True,,0.002198417205363512,0.9978016018867493
71,"public static String toCamelCase(String str, final boolean capitalizeFirstLetter, final char... delimiters) { if (StringUtils.isEmpty(str)) { return str; } str = str.toLowerCase(Locale.ROOT); final int strLen = str.length(); final int[] newCodePoints = new int[strLen]; int outOffset = 0; final Set<Integer> delimiterSet = toDelimiterSet(delimiters); boolean capitalizeNext = capitalizeFirstLetter; for (int index = 0; index < strLen;) { final int codePoint = str.codePointAt(index); if (delimiterSet.contains(codePoint)) { capitalizeNext = outOffset != 0; index += Character.charCount(codePoint); } else if (capitalizeNext || outOffset == 0 && capitalizeFirstLetter) { final int titleCaseCodePoint = Character.toTitleCase(codePoint); newCodePoints[outOffset++] = titleCaseCodePoint; index += Character.charCount(titleCaseCodePoint); capitalizeNext = false;",unrelated,unrelated,True,,0.0022544972598552704,0.9977454543113708
72,"public DateMidnight plusMonths(int months) { if (months == 0) { return this; } long instant = getChronology().months().add(getMillis(), months); return withMillis(instant); }",unrelated,unrelated,True,,0.002312174066901207,0.997687816619873
73,"private String parseFormatDescription(final String pattern, final ParsePosition pos) { final int start = pos.getIndex(); seekNonWs(pattern, pos); final int text = pos.getIndex(); int depth = 1; while (pos.getIndex() < pattern.length()) { switch (pattern.charAt(pos.getIndex())) { case START_FE: depth++; next(pos); break; case END_FE: depth--; if (depth == 0) { return pattern.substring(text, pos.getIndex()); } next(pos); break; case QUOTE: getQuotedString(pattern, pos);",unrelated,unrelated,True,,0.0022954775486141443,0.9977045655250549
74,"@Override public int hashCode() { int total = 157; for (int i = 0, isize = size(); i < isize; i++) { total = 23 * total + getValue(i); total = 23 * total + getFieldType(i).hashCode(); } total += getChronology().hashCode(); return total; }",unrelated,unrelated,True,,0.002078015822917223,0.9979220032691956
75,"@Override public @NonNull CompletionStage<Boolean> next(@NonNull T item) { try { return Objects.requireNonNull(onNext.apply(item), ""onNext returned a null CompletionStage""); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); return CompletableFuture.failedStage(ex); } }",unrelated,unrelated,True,,0.0021127737127244473,0.9978871941566467
76,"@CheckReturnValue @SchedulerSupport(SchedulerSupport.CUSTOM) @NonNull public final Observable<T> observeOn(@NonNull Scheduler scheduler) { return observeOn(scheduler, StandardBufferedConfig.DEFAULT); }",unrelated,unrelated,True,,0.002153420588001609,0.9978466033935547
77,public MpscLinkedQueue() { producerNode = new AtomicReference<>(); consumerNode = new AtomicReference<>(); LinkedQueueNode<T> node = new LinkedQueueNode<>(); spConsumerNode(node); xchgProducerNode(node); },unrelated,unrelated,True,,0.002014442812651396,0.9979856014251709
78,"private static int[] algorithmB(final CharSequence left, final CharSequence right) { final int m = left.length(); final int n = right.length(); final int[][] dpRows = new int[2][1 + n]; for (int i = 1; i <= m; i++) { final int[] temp = dpRows[0]; dpRows[0] = dpRows[1]; dpRows[1] = temp; for (int j = 1; j <= n; j++) { if (left.charAt(i - 1) == right.charAt(j - 1)) { dpRows[1][j] = dpRows[0][j - 1] + 1; } else { dpRows[1][j] = Math.max(dpRows[1][j - 1], dpRows[0][j]);",unrelated,unrelated,True,,0.0022144238464534283,0.9977855682373047
79,"public void printTo(StringBuffer buf, long instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { } }",unrelated,unrelated,True,,0.0021780335810035467,0.9978219270706177
80,public boolean isGreaterThan(Seconds other) { if (other == null) { return getValue() > 0; } return getValue() > other.getValue(); },unrelated,unrelated,True,,0.0021135862916707993,0.9978863596916199
81,"@Override public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, iMin, iMax); int remainder = getRemainder(getWrappedField().get(instant)); return getWrappedField().set(instant, value * iDivisor + remainder); }",unrelated,unrelated,True,,0.0020139378029853106,0.9979860782623291
82,final void removeSelf() { DisposableContainer c = composite.getAndSet(null); if (c != null) { c.delete(this); } },unrelated,unrelated,True,,0.0021781364921480417,0.9978219270706177
83,"@Override int getMonthOfYear(long millis, int year) { long monthZeroBased = (millis - getYearMillis(year)) / MILLIS_PER_MONTH; return ((int) monthZeroBased) + 1; }",unrelated,unrelated,True,,0.0022540960926562548,0.997745931148529
84,"int getDayOfMonth(long millis, int year) { int month = getMonthOfYear(millis, year); return getDayOfMonth(millis, year, month); }",unrelated,unrelated,True,,0.0022461710032075644,0.9977537989616394
85,"private GJChronology(Chronology base, JulianChronology julian, GregorianChronology gregorian, Instant cutoverInstant) { super(base, new Object[] {julian, gregorian, cutoverInstant}); }",unrelated,unrelated,True,,0.002180487150326371,0.9978195428848267
86,"public static void appendPaddedInteger(Appendable appendable, long value, int size) throws IOException { int intValue = (int)value; if (intValue == value) { appendPaddedInteger(appendable, intValue, size); } else if (size <= 19) { appendable.append(Long.toString(value)); } else { if (value < 0) { appendable.append('-'); if (value != Long.MIN_VALUE) { value = -value; } else { for (; size > 19; size--) { appendable.append('0'); } appendable.append(""9223372036854775808""); return; } } int digits = (int)(Math.log(value) / LOG_10) + 1;",unrelated,unrelated,True,,0.002189141931012273,0.9978109002113342
87,"@Override public void onNext(T t) { if (fusionMode == QueueSubscription.NONE) { parent.innerNext(this, t); } else { parent.drain(); } }",unrelated,unrelated,True,,0.0020935276988893747,0.9979064464569092
88,"public static Years yearsBetween(ReadableInstant start, ReadableInstant end) { int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.years()); return Years.years(amount); }",unrelated,unrelated,True,,0.0022532951552420855,0.9977466464042664
89,private Chronology selectChronology(Chronology chrono) { chrono = DateTimeUtils.getChronology(chrono); if (iChrono != null) { chrono = iChrono; } if (iZone != null) { chrono = chrono.withZone(iZone); } return chrono; },unrelated,unrelated,True,,0.0024744397960603237,0.9975255131721497
90,"public StrBuilder replaceAll(final char search, final char replace) { if (search != replace) { for (int i = 0; i < size; i++) { if (buffer[i] == search) { buffer[i] = replace; } } } return this; }",unrelated,unrelated,True,,0.0021355575881898403,0.9978644251823425
91,"public static <V> String replace(final Object source, final Map<String, V> valueMap, final String prefix, final String suffix) { return new StrSubstitutor(valueMap, prefix, suffix).replace(source); }",unrelated,unrelated,True,,0.0022106794640421867,0.9977892637252808
92,public boolean isGreaterThan(Minutes other) { if (other == null) { return getValue() > 0; } return getValue() > other.getValue(); },unrelated,unrelated,True,,0.002180809620767832,0.997819185256958
93,"protected int convertText(String text, Locale locale) { try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new IllegalFieldValueException(getType(), text); } }",unrelated,unrelated,True,,0.0022921620402485132,0.9977078437805176
94,"@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @NonNull public static <@NonNull T> Observable<T> merge(@NonNull Iterable<@NonNull ? extends ObservableSource<? extends T>> sources, @NonNull StandardConcurrentBufferedConfig config) { Objects.requireNonNull(config, ""config is null""); return fromIterable(sources).flatMap(Functions.identity(), config); }",unrelated,unrelated,True,,0.0022771889343857765,0.9977228045463562
95,"public ObservableWithLatestFromMany(@NonNull ObservableSource<T> source, @NonNull Iterable<? extends ObservableSource<?>> otherIterable, @NonNull Function<? super Object[], R> combiner) { super(source); this.otherArray = null; this.otherIterable = otherIterable; this.combiner = combiner; }",unrelated,unrelated,True,,0.0021755434572696686,0.9978244304656982
96,"@Override public String toString() { String str = ""BuddhistChronology""; DateTimeZone zone = getZone(); if (zone != null) { str = str + '[' + zone.getID() + ']'; } return str; }",unrelated,unrelated,True,,0.0034949108958244324,0.9965051412582397
97,"@Override public long set(long millis, int value) { FieldUtils.verifyValueBounds(this, value, iMinValue, getMaximumValue()); if (value <= iSkip) { value--; } return super.set(millis, value); }",unrelated,unrelated,True,,0.002027526032179594,0.9979724287986755
98,"public Interval withDurationAfterStart(ReadableDuration duration) { long durationMillis = DateTimeUtils.getDurationMillis(duration); if (durationMillis == toDurationMillis()) { return this; } Chronology chrono = getChronology(); long startMillis = getStartMillis(); long endMillis = chrono.add(startMillis, durationMillis, 1); return new Interval(startMillis, endMillis, chrono); }",unrelated,unrelated,True,,0.002324159722775221,0.9976758360862732
99,"@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.COMPUTATION) @NonNull public final <@NonNull R> Flowable<R> replay(@NonNull Function<? super Flowable<T>, @NonNull ? extends Publisher<R>> selector, long time, @NonNull TimeUnit unit) { return replay(selector, time, unit, Schedulers.computation()); }",unrelated,unrelated,True,,0.0022999197244644165,0.997700035572052
100,"@SuppressWarnings(""unchecked"") @NonNull public static <T> Predicate<T> alwaysFalse() { return (Predicate<T>)ALWAYS_FALSE; }",unrelated,unrelated,True,,0.002140803262591362,0.9978591799736023
101,"@Override public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, getMinimumValue(), getMaximumValue()); return instant + (value - get(instant)) * iUnitMillis; }",unrelated,unrelated,True,,0.0020617868285626173,0.9979382157325745
102,"public DelegatedDateTimeField(DateTimeField field, DurationField rangeField, DateTimeFieldType type) { super(); if (field == null) { throw new IllegalArgumentException(""The field must not be null""); } iField = field; iRangeDurationField = rangeField; iType = (type == null ? field.getType() : type); }",unrelated,unrelated,True,,0.0020121359266340733,0.9979878664016724
103,"public Calendar toCalendar(Locale locale) { if (locale == null) { locale = Locale.getDefault(); } DateTimeZone zone = getZone(); Calendar cal = Calendar.getInstance(zone.toTimeZone(), locale); cal.setTime(toDate()); return cal; }",unrelated,unrelated,True,,0.002411596942692995,0.9975883960723877
104,public StringMatcher stringMatcher(final char... chars) { final int length = ArrayUtils.getLength(chars); return length == 0 ? NONE_MATCHER : length == 1 ? new AbstractStringMatcher.CharMatcher(chars[0]) : new AbstractStringMatcher.CharArrayMatcher(chars); },unrelated,unrelated,True,,0.002150751883164048,0.9978492259979248
105,@Override public int getMinimumValue(ReadablePartial instant) { return getMinimumValue(); },unrelated,unrelated,True,,0.0022391246166080236,0.9977608919143677
106,"@Override protected void subscribeActual(Observer<? super T> t) { CacheDisposable<T> consumer = new CacheDisposable<>(t, multicaster, head); t.onSubscribe(consumer); multicaster.add(consumer); if (consumer.isDisposed()) { multicaster.remove(consumer); } if (!once.get() && once.compareAndSet(false, true)) { source.subscribe(multicaster); } else { multicaster.replay(consumer); } }",unrelated,unrelated,True,,0.002077061915770173,0.997922956943512
107,"public LocalDateTime withTime(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) { Chronology chrono = getChronology(); long instant = getLocalMillis(); instant = chrono.hourOfDay().set(instant, hourOfDay); instant = chrono.minuteOfHour().set(instant, minuteOfHour); instant = chrono.secondOfMinute().set(instant, secondOfMinute); instant = chrono.millisOfSecond().set(instant, millisOfSecond); return withLocalMillis(instant); }",unrelated,unrelated,True,,0.002154097892343998,0.9978458881378174
108,"public void printTo(StringBuilder buf, ReadablePartial partial) { try { printTo((Appendable) buf, partial); } catch (IOException ex) { } }",unrelated,unrelated,True,,0.0021577137522399426,0.9978423118591309
109,"public MaybeToSingle(MaybeSource<T> source, T defaultValue) { this.source = source; this.defaultValue = defaultValue; }",unrelated,unrelated,True,,0.002133613685145974,0.9978664517402649
110,"public DeferredExecutorScheduler(@NonNull Supplier<? extends Executor> executorSupplier, boolean interruptibleWorker, boolean fair) { this.executorSupplier = executorSupplier; this.interruptibleWorker = interruptibleWorker; this.fair = fair; }",unrelated,unrelated,True,,0.0020666727796196938,0.9979333877563477
111,"@Override public long add(long instant, int years) { if (years == 0) { return instant; } return set(instant, get(instant) + years); }",unrelated,unrelated,True,,0.0020524179562926292,0.997947633266449
112,@Override public boolean equals(Object period) { if (this == period) { return true; } if (period instanceof ReadablePeriod == false) { return false; } ReadablePeriod other = (ReadablePeriod) period; return (other.getPeriodType() == getPeriodType() && other.getValue(0) == getValue()); },unrelated,unrelated,True,,0.002274209400638938,0.997725784778595
113,"public int indexOf(final char ch, int startIndex) { startIndex = Math.max(startIndex, 0); if (startIndex >= size) { return -1; } final char[] thisBuf = buffer; for (int i = startIndex; i < size; i++) { if (thisBuf[i] == ch) { return i; } } return -1; }",unrelated,unrelated,True,,0.0020948173478245735,0.9979052543640137
114,@Override public Object clone() { try { return cloneReset(); } catch (final CloneNotSupportedException ex) { return null; } },unrelated,unrelated,True,,0.0021289631258696318,0.9978710412979126
115,"BasicDayOfYearDateTimeField(BasicChronology chronology, DurationField days) { super(DateTimeFieldType.dayOfYear(), days); iChronology = chronology; }",unrelated,unrelated,True,,0.002198517555370927,0.9978014826774597
116,"public LocalTime(Object instant, Chronology chronology) { PartialConverter converter = ConverterManager.getInstance().getPartialConverter(instant); chronology = converter.getChronology(instant, chronology); chronology = DateTimeUtils.getChronology(chronology); iChronology = chronology.withUTC(); int[] values = converter.getPartialValues(this, instant, chronology, ISODateTimeFormat.localTimeParser()); iLocalMillis = iChronology.getDateTimeMillis(0L, values[0], values[1], values[2], values[3]); }",unrelated,unrelated,True,,0.002505528973415494,0.9974944591522217
117,"private static Predicate<Integer> generateIsDelimiterFunction(final char[] delimiters) { final Predicate<Integer> isDelimiter; if (delimiters == null || delimiters.length == 0) { isDelimiter = delimiters == null ? Character::isWhitespace : c -> false; } else { final Set<Integer> delimiterSet = new HashSet<>(); for (int index = 0; index < delimiters.length; index++) { delimiterSet.add(Character.codePointAt(delimiters, index)); } isDelimiter = delimiterSet::contains; } return isDelimiter; }",unrelated,unrelated,True,,0.0021101657766848803,0.9978898167610168
118,static long readMillis(DataInput in) throws IOException { int v = in.readUnsignedByte(); switch (v >> 6) { case 0: default: v = (v << (32 - 6)) >> (32 - 6); return v * (30 * 60000L); case 1: v = (v << (32 - 6)) >> (32 - 30); v |= (in.readUnsignedByte()) << 16; v |= (in.readUnsignedByte()) << 8; v |= (in.readUnsignedByte()); return v * 60000L; case 2: long w = (((long)v) << (64 - 6)) >> (64 - 38); w |= (in.readUnsignedByte()) << 24;,unrelated,unrelated,True,,0.0024100984446704388,0.9975899457931519
119,public boolean isGreaterThan(Weeks other) { if (other == null) { return getValue() > 0; } return getValue() > other.getValue(); },unrelated,unrelated,True,,0.002090905327349901,0.9979090690612793
120,"@SuppressWarnings(""unchecked"") public final U awaitOnSubscribe(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { if (!onSubscribeReady.await(timeout, unit)) { throw new TimeoutException(""TestSubscriber.awaitOnSubscribe timed out""); } return (U)this; }",unrelated,unrelated,True,,0.002319167135283351,0.9976807832717896
121,"@Override public int getMaximumValue(ReadablePartial partial) { if (partial.isSupported(DateTimeFieldType.monthOfYear())) { int month = partial.get(DateTimeFieldType.monthOfYear()); if (partial.isSupported(DateTimeFieldType.year())) { int year = partial.get(DateTimeFieldType.year()); return iChronology.getDaysInYearMonth(year, month); } return iChronology.getDaysInMonthMax(month); } return getMaximumValue(); }",unrelated,unrelated,True,,0.0028317379765212536,0.997168242931366
122,"public static Hours hoursBetween(ReadableInstant start, ReadableInstant end) { int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.hours()); return Hours.hours(amount); }",unrelated,unrelated,True,,0.0022327506449073553,0.9977672100067139
123,"public int get(DateTimeField field) { if (field == null) { throw new IllegalArgumentException(""The DateTimeField must not be null""); } return field.get(getMillis()); }",unrelated,unrelated,True,,0.002047112677246332,0.9979528188705444
124,@Override public long roundHalfFloor(long instant) { return getWrappedField().roundHalfFloor(instant); },unrelated,unrelated,True,,0.002089650137349963,0.9979103207588196
|