File size: 29,025 Bytes
a71c374
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
dataset_index,text,true_label,predicted_label,correct,error_type,probability_data_integrity,probability_unrelated
0,"public static ChecksumFailureException mismatchDetail( String detail, String expected, String expectedKind, String actual) { String message = ""Checksum validation failed, expected '"" + expected + ""'"" + (expectedKind == null ? """" : "" ("" + expectedKind + "")"") + "" but is actually '"" + actual + ""'""; if (detail != null) { message = message + "" ("" + detail + "")""; } return new ChecksumFailureException(message, null, expected, expectedKind, actual, true);",data_integrity,data_integrity,True,,0.9772672653198242,0.022732699289917946
1,"private static final List<String> HEADER_PREFIXES = Arrays.asList( ""x-checksum-"", ""x-goog-meta-checksum-"", ""x-amz-meta-checksum-"");",data_integrity,unrelated,False,true_data_integrity_predicted_unrelated,0.0033345671836286783,0.9966654181480408
2,"boolean valid = true; boolean validated = false; try { final Map<String, String> calculatedChecksums = ChecksumAlgorithmHelper.calculate(artifact.getPath(), checksumAlgorithmFactories); for (Map.Entry<String, TrustedChecksumsSource> entry : trustedChecksumsSources.entrySet()) { final String trustedSourceName = entry.getKey(); final TrustedChecksumsSource trustedChecksumsSource = entry.getValue();",data_integrity,data_integrity,True,,0.9901137351989746,0.009886294603347778
3,"@Override protected Map<String, String> doGetTrustedArtifactChecksums( RepositorySystemSession session, Artifact artifact, ArtifactRepository artifactRepository, List<ChecksumAlgorithmFactory> checksumAlgorithmFactories) { final boolean originAware = isOriginAware(session); final HashMap<String, String> checksums = new HashMap<>();",data_integrity,data_integrity,True,,0.9882533550262451,0.011746576055884361
4,"@Deprecated public ChecksumFailureException(String expected, String expectedKind, String actual) { super(""Checksum validation failed, expected '"" + expected + ""'"" + (expectedKind == null ? """" : "" ("" + expectedKind + "")"") + "" but is actually '"" + actual + ""'""); this.expected = expected; this.expectedKind = expectedKind; this.actual = actual;",data_integrity,data_integrity,True,,0.9768115878105164,0.02318841777741909
5,"@Override public ChecksumAlgorithmFactory select(String algorithmName) { requireNonNull(algorithmName, ""algorithmMame must not be null""); ChecksumAlgorithmFactory factory = factories.get(algorithmName); if (factory == null) { throw new IllegalArgumentException(String.format( ""Unsupported checksum algorithm %s, supported ones are %s"", algorithmName,",data_integrity,data_integrity,True,,0.989794909954071,0.010205056518316269
6,"@Override public int hashCode() { return Objects.hash(localHost, localPort, remoteHost, remotePort); }",unrelated,unrelated,True,,0.0021921165753155947,0.9978079199790955
7,"@Override public boolean next(Message msg, SSHPacket buffer) throws GeneralSecurityException, TransportException { log.debug(""Got message {}"", msg); try { switch (msg) { case KEXDH_31: return parseGexGroup(buffer); case KEX_DH_GEX_REPLY: return parseGexReply(buffer); default: throw new TransportException(""Unexpected message "" + msg); } } catch (Buffer.BufferException be) { throw new TransportException(be); } }",unrelated,unrelated,True,,0.3244292736053467,0.6755707263946533
8,"private String prependPrefix(String columnName, String prefix) { if (columnName == null || columnName.length() == 0 || prefix == null || prefix.length() == 0) { return columnName; } return prefix + columnName; }",unrelated,unrelated,True,,0.002311318414285779,0.9976886510848999
9,public void setPoolMaximumIdleConnections(int poolMaximumIdleConnections) { this.poolMaximumIdleConnections = poolMaximumIdleConnections; forceCloseAll(); },unrelated,unrelated,True,,0.0023881341330707073,0.9976118803024292
10,"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.0021728521678596735,0.9978271126747131
11,public Collection<String> getMappedStatementNames() { buildAllStatements(); return mappedStatements.keySet(); },unrelated,unrelated,True,,0.0023035036865621805,0.9976964592933655
12,"@Override public Reader getNullableResult(ResultSet rs, String columnName) throws SQLException { return toReader(rs.getClob(columnName)); }",unrelated,unrelated,True,,0.0023524013813585043,0.9976475834846497
13,"@Override public void error(String s) { log.logIfEnabled(FQCN, Level.ERROR, MARKER, (Message) new SimpleMessage(s), null); }",unrelated,unrelated,True,,0.002375629497691989,0.9976243376731873
14,public CacheBuilder addDecorator(Class<? extends Cache> decorator) { if (decorator != null) { this.decorators.add(decorator); } return this; },unrelated,unrelated,True,,0.002343063475564122,0.9976569414138794
15,"@Override public Byte[] getNullableResult(ResultSet rs, String columnName) throws SQLException { byte[] bytes = rs.getBytes(columnName); return getBytes(bytes); }",unrelated,unrelated,True,,0.002343993168324232,0.997655987739563
16,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,unrelated,True,,0.0022015529684722424,0.9977983832359314
17,public long getClaimedOverdueConnectionCount() { lock.lock(); try { return claimedOverdueConnectionCount; } finally { lock.unlock(); } },unrelated,unrelated,True,,0.002327138092368841,0.9976728558540344
18,"private JdbcType safeGetJdbcTypeForColumn(ResultSetMetaData rsmd, Integer columnIndex) { try { return JdbcType.forCode(rsmd.getColumnType(columnIndex)); } catch (Exception e) { return null; } }",unrelated,unrelated,True,,0.002193282125517726,0.9978067278862
19,"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.0022509938571602106,0.9977490305900574
20,"@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.002221229951828718,0.9977787137031555
21,private Throwable extractRootCause(Exception e) { Throwable cause = e; while (cause.getCause() != null) { cause = cause.getCause(); } return cause; },unrelated,unrelated,True,,0.0023785268422216177,0.997621476650238
22,"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.0022331213112920523,0.9977668523788452
23,"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.002137694740667939,0.9978622794151306
24,"private static Configuration newConfig(Class<? extends Configuration> configClass) { try { return configClass.getDeclaredConstructor().newInstance(); } catch (Exception ex) { throw new BuilderException(""Failed to create a new Configuration instance."", ex); } }",unrelated,unrelated,True,,0.0022143120877444744,0.9977856874465942
25,@Override public <E> Cursor<E> queryCursor(Statement statement) throws SQLException { return delegate.queryCursor(statement); },unrelated,unrelated,True,,0.0022801023442298174,0.9977198243141174
26,"@Override public void putObject(Object key, Object value) { try { delegate.putObject(key, value); } finally { releaseLock(key); } }",unrelated,unrelated,True,,0.0022915059234946966,0.9977084398269653
27,"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,unrelated,True,,0.0021317200735211372,0.9978682994842529
28,"private JdbcType[] mappedJdbcTypes(Class<?> clazz) { MappedJdbcTypes mappedJdbcTypesAnno = clazz.getAnnotation(MappedJdbcTypes.class); if (mappedJdbcTypesAnno != null) { JdbcType[] jdbcTypes = mappedJdbcTypesAnno.value(); if (mappedJdbcTypesAnno.includeNullJdbcType()) { int newLength = jdbcTypes.length + 1; jdbcTypes = Arrays.copyOf(jdbcTypes, newLength); jdbcTypes[newLength - 1] = null; } return jdbcTypes; } return new JdbcType[] { null }; }",unrelated,unrelated,True,,0.0022515784949064255,0.9977484345436096
29,@Override public String[] getSetterNames() { return map.keySet().toArray(new String[0]); },unrelated,unrelated,True,,0.002263253554701805,0.9977366924285889
30,@Override public void clear() { lastClear = System.currentTimeMillis(); delegate.clear(); },unrelated,unrelated,True,,0.0025405092164874077,0.9974594712257385
31,"@Override public void error(String s, Throwable e) { logger.log(MARKER, FQCN, LocationAwareLogger.ERROR_INT, s, null, e); }",unrelated,unrelated,True,,0.0023198253475129604,0.9976801872253418
32,private MetaObject getParamMetaObject() { if (paramMetaObject != null) { return paramMetaObject; } paramMetaObject = configuration.newMetaObject(parameterObject); return paramMetaObject; },unrelated,unrelated,True,,0.0021537020802497864,0.997846245765686
33,"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.002257836749777198,0.9977421760559082
34,"@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.002272888319566846,0.99772709608078
35,"@Override public void commit(boolean force) { final SqlSession sqlSession = localSqlSession.get(); if (sqlSession == null) { throw new SqlSessionException(""Error: Cannot commit. No managed session is started.""); } sqlSession.commit(force); }",unrelated,unrelated,True,,0.00228375056758523,0.9977163076400757
36,@Override public List<BatchResult> doFlushStatements(boolean isRollback) { for (Statement stmt : statementMap.values()) { closeStatement(stmt); } statementMap.clear(); return List.of(); },unrelated,unrelated,True,,0.0022746529430150986,0.9977253079414368
37,"@Override public InputStream getNullableResult(ResultSet rs, int columnIndex) throws SQLException { return toInputStream(rs.getBlob(columnIndex)); }",unrelated,unrelated,True,,0.002347251633182168,0.9976528286933899
38,"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.0021503260359168053,0.997849702835083
39,@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.0022500844206660986,0.9977498650550842
40,public void setLogImpl(Class<? extends Log> logImpl) { if (logImpl != null) { this.logImpl = logImpl; LogFactory.useCustomLogging(this.logImpl); } },unrelated,unrelated,True,,0.002434576628729701,0.9975653886795044
41,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.002208577934652567,0.9977914094924927
42,"private void initTokenParser(List<ParameterMapping> parameterMappings) { if (tokenParser == null) { tokenHandler = new ParameterMappingTokenHandler(parameterMappings != null ? parameterMappings : new ArrayList<>(), configuration, parameterObject, parameterType, bindings, paramNameResolver, paramExists); tokenParser = new GenericTokenParser(""#{"", ""}"", tokenHandler); } }",unrelated,unrelated,True,,0.0021172845736145973,0.9978826642036438
43,PendingCreationKey(ResultMapping constructorMapping) { this.resultMapId = constructorMapping.getNestedResultMapId(); this.constructorColumnPrefix = constructorMapping.getColumnPrefix(); },unrelated,unrelated,True,,0.0022750673815608025,0.9977249503135681
44,public T HAVING(String... conditions) { sql().having.addAll(Arrays.asList(conditions)); sql().lastList = sql().having; return getSelf(); },unrelated,unrelated,True,,0.0022795656695961952,0.9977204203605652
45,"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.002131387125700712,0.997868537902832
46,"@Override public void setNonNullParameter(PreparedStatement ps, int i, Time parameter, JdbcType jdbcType) throws SQLException { ps.setTime(i, parameter); }",unrelated,unrelated,True,,0.0023404275998473167,0.9976595640182495
47,"private static Class<?>[] getAllInterfaces(Class<?> type, Map<Class<?>, Set<Method>> signatureMap) { Set<Class<?>> interfaces = new HashSet<>(); while (type != null) { for (Class<?> c : type.getInterfaces()) { if (signatureMap.containsKey(c)) { interfaces.add(c); } } type = type.getSuperclass(); } return interfaces.toArray(new Class<?>[0]); }",unrelated,unrelated,True,,0.002219517482444644,0.9977805018424988
48,public SoftCache(Cache delegate) { this.delegate = delegate; this.numberOfHardLinks = 256; this.hardLinksToAvoidGarbageCollection = new LinkedList<>(); this.queueOfGarbageCollectedEntries = new ReferenceQueue<>(); },unrelated,unrelated,True,,0.00219458038918674,0.9978054165840149
49,"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.002180308336392045,0.9978196620941162
50,"@SuppressWarnings(""unchecked"") protected static <T> T invoke(Method method, Object object, Object... parameters) throws IOException, RuntimeException { try { return (T) method.invoke(object, parameters); } catch (IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { if (e.getTargetException() instanceof IOException) { throw (IOException) e.getTargetException(); } throw new RuntimeException(e); } }",unrelated,unrelated,True,,0.0022652402985841036,0.997734785079956
51,"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.0021860934793949127,0.9978139400482178
52,public int getActiveConnectionCount() { lock.lock(); try { return activeConnections.size(); } finally { lock.unlock(); } },unrelated,unrelated,True,,0.002272113459184766,0.9977279305458069
53,"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.002312880475074053,0.9976871013641357
54,"private ParameterMapping buildParameterMapping(String content) { Map<String, String> propertiesMap = parseParameterMapping(content); final String property = propertiesMap.remove(""property""); final JdbcType jdbcType = resolveJdbcType(propertiesMap.remove(""jdbcType"")); final String typeHandlerAlias = propertiesMap.remove(""typeHandler""); ParameterMapping.Builder builder = new ParameterMapping.Builder(configuration, property, (Class<?>) null); PropertyTokenizer propertyTokenizer = new PropertyTokenizer(property); builder.jdbcType(jdbcType); final Class<?> javaType = figureOutJavaType(propertiesMap, property, propertyTokenizer, jdbcType); builder.javaType(javaType); if (genericType == null) { genericType = javaType; } if (typeHandler == null || typeHandlerAlias != null) { typeHandler = resolveTypeHandler(genericType, jdbcType, typeHandlerAlias); } builder.typeHandler(typeHandler);",unrelated,unrelated,True,,0.002201641211286187,0.9977983832359314
55,"@Override public BigDecimal getNullableResult(ResultSet rs, String columnName) throws SQLException { return rs.getBigDecimal(columnName); }",unrelated,unrelated,True,,0.0024823585990816355,0.9975177049636841
56,public T SELECT(String... columns) { sql().statementType = SQLStatement.StatementType.SELECT; sql().select.addAll(Arrays.asList(columns)); return getSelf(); },unrelated,unrelated,True,,0.002316436031833291,0.9976835250854492
57,"private boolean findUsableConstructorByArgTypes(final Constructor<?> constructor, final List<JdbcType> jdbcTypes) { final Class<?>[] parameterTypes = constructor.getParameterTypes(); if (parameterTypes.length != jdbcTypes.size()) { return false; } for (int i = 0; i < parameterTypes.length; i++) { if (!typeHandlerRegistry.hasTypeHandler(parameterTypes[i], jdbcTypes.get(i))) { return false; } } return true; }",unrelated,unrelated,True,,0.002164730103686452,0.9978353381156921
58,"} if (provider == null) { return false; } try { if (Security.getProvider(provider.getName()) == null) { Security.addProvider(provider); } if (securityProvider == null) { MessageDigest.getInstance(""MD5"", provider); KeyAgreement.getInstance(""DH"", provider); setSecurityProvider(provider.getName()); return true; } } catch (NoSuchAlgorithmException e) {",data_integrity,data_integrity,True,,0.9905725121498108,0.00942752230912447
59,"private static MessageDigest newDigest() { try { return MessageDigest.getInstance(""SHA-1""); } catch (NoSuchAlgorithmException e) { try { return MessageDigest.getInstance(""MD5""); } catch (NoSuchAlgorithmException ne) { throw new IllegalStateException(ne); } } }",data_integrity,data_integrity,True,,0.9909390211105347,0.009060956537723541
60,"public static String getFingerprint(PublicKey key) { MessageDigest md5; try { md5 = getMessageDigest(""MD5""); } catch (GeneralSecurityException e) { throw new SSHRuntimeException(e); } md5.update(new Buffer.PlainBuffer().putPublicKey(key).getCompactData()); final String undelimited = ByteArrayUtils.toHex(md5.digest()); assert undelimited.length() == 32 : ""md5 contract""; StringBuilder fp = new StringBuilder(undelimited.substring(0, 2)); for (int i = 2; i <= undelimited.length() - 2; i += 2) fp.append("":"").append(undelimited.substring(i, i + 2)); return fp.toString(); }",data_integrity,data_integrity,True,,0.9908599853515625,0.009140020236372948
61,"Map<String, Object> results = new LinkedHashMap<>(); Map<String, MessageDigest> digests = new LinkedHashMap<>(); for (String algo : algos) { try { digests.put(algo, MessageDigest.getInstance(algo)); } catch (NoSuchAlgorithmException e) { results.put(algo, e); } } try (InputStream in = data) {",data_integrity,data_integrity,True,,0.9899424314498901,0.010057513602077961
62,"public static Factory HMACSHA2256() { return new Factory(""hmac-sha2-256"", ""HmacSHA256"", 32, 32, false); }",data_integrity,data_integrity,True,,0.989267885684967,0.010732145048677921
63,"public Curve25519SHA256() { super(new Curve25519DH(), new SHA256()); }",data_integrity,data_integrity,True,,0.9909247159957886,0.009075268171727657
64,"protected static byte[] sha256(byte[] data) { try { return MessageDigest.getInstance(""SHA-256"").digest(data); } catch (NoSuchAlgorithmException e) { throw new SSHRuntimeException(e); } }",data_integrity,data_integrity,True,,0.991028368473053,0.008971694856882095
65,"private Mac prepareVerifyMacV3() throws IOException { try { Mac mac = Mac.getInstance(""HmacSHA256""); mac.init(new SecretKeySpec(this.verifyHmac, 0, 32, mac.getAlgorithm())); return mac; } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw new IOException(e.getMessage(), e); } }",data_integrity,data_integrity,True,,0.9908792972564697,0.009120688773691654
66,"public SHA512() { super(""SHA-512"", 64); }",data_integrity,data_integrity,True,,0.9886526465415955,0.011347309686243534
67,"public static DHGroups.Factory Group18SHA512AtSSH() { return new DHGroups.Factory(""diffie-hellman-group18-sha512@ssh.com"", P18, G, new SHA512.Factory()); }",data_integrity,data_integrity,True,,0.9906854033470154,0.009314551949501038
68,"private void sign(InputStream content, OutputStream signature) throws IOException { PGPSignatureGenerator sGen = new PGPSignatureGenerator( new BcPGPContentSignerBuilder(secretKey.getPublicKey().getAlgorithm(), HashAlgorithmTags.SHA512)); try { sGen.init(PGPSignature.BINARY_DOCUMENT, privateKey); sGen.setHashedSubpackets(hashSubPackets); int len; byte[] buffer = new byte[8 * 1024]; while ((len = content.read(buffer)) >= 0) { sGen.update(buffer, 0, len); } try (BCPGOutputStream bcpgOutputStream = new BCPGOutputStream(new ArmoredOutputStream(signature))) { sGen.generate().encode(bcpgOutputStream); } } catch (PGPException e) { throw new IllegalStateException(e); } }",data_integrity,data_integrity,True,,0.9904470443725586,0.009552954696118832
69,"public static DHGroups.Factory Group16SHA512AtSSH() { return new DHGroups.Factory(""diffie-hellman-group16-sha512@ssh.com"", P16, G, new SHA512.Factory()); }",data_integrity,data_integrity,True,,0.9907398223876953,0.009260201826691628
70,"public void pbkdf(byte[] password, byte[] salt, int rounds, byte[] output) { try { MessageDigest sha512 = MessageDigest.getInstance(""SHA-512""); int nblocks = (output.length + 31) / 32; byte[] hpass = sha512.digest(password); byte[] hsalt = new byte[64]; byte[] block_b = new byte[4]; byte[] out = new byte[32];",data_integrity,data_integrity,True,,0.9908785223960876,0.009121539071202278
71,"TrackingUriBuilder appendSignature(String key) { if (key == null) throw new IllegalArgumentException(""Key cannot be null""); if (key.isEmpty()) throw new IllegalArgumentException(""Key cannot be empty""); try { Mac mac = Mac.getInstance(""HmacSHA512""); SecretKeySpec secret_key = new SecretKeySpec(Base64.decodeBase64(key), ""HmacSHA512""); mac.init(secret_key); byte[] buffer = builder.toString().getBytes(StandardCharsets.US_ASCII); byte[] signatureBytes = mac.doFinal(buffer); builder.append(""&Signature=""); builder.append(encode(Base64.encodeBase64String(signatureBytes))); } catch (IllegalStateException | InvalidKeyException | NoSuchAlgorithmException e) { throw new RuntimeException(e); } return this; }",data_integrity,data_integrity,True,,0.9908506274223328,0.009149374440312386
72,"long counter = buf.readUInt32(); byte[] signedData = buildSignedData(flags, counter, sha256(sshData.toByteArray())); signature.update(signedData); return signature.verify(sshSignatureToDevice(sshRawSignature)); } catch (Buffer.BufferException | SignatureException e) { throw new SSHRuntimeException(e); } }",data_integrity,data_integrity,True,,0.9908624887466431,0.00913750659674406
73,".putBuffer(req) .getCompactData(); byte[] signature; try { signature = agent.sign(identity.getKeyBlob(), dataToSign, agentSignFlags()); } catch (IOException e) { throw new UserAuthException(""SSH agent failed to sign for "" + identity, e); }",data_integrity,data_integrity,True,,0.9906587600708008,0.009341198019683361
74,"} byte[] challenge = sha256(sshData.toByteArray()); SecurityKeySignatureData data; try { data = signer.sign(new SecurityKeySigningRequest(signingKey.getKeyTypeName(), application, signingKey.getKeyHandle(), challenge, signingKey.getFlags())); } catch (IOException e) { throw new SSHRuntimeException(""Security key signing failed"", e); }",data_integrity,data_integrity,True,,0.9908922910690308,0.009107709862291813
75,"public static synchronized Signature getSignature(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException { register(); if (getSecurityProvider() == null) return Signature.getInstance(algorithm); else return Signature.getInstance(algorithm, getSecurityProvider()); }",data_integrity,data_integrity,True,,0.9908599853515625,0.009139994159340858
76,"@Override public boolean verify(byte[] sig) { try { return signature.verify(extractSig(sig, ""ssh-ed25519"")); } catch (SignatureException e) { throw new SSHRuntimeException(e); } }",data_integrity,data_integrity,True,,0.9907740950584412,0.009225831367075443