File size: 36,367 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
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
dataset_index,text,true_label,predicted_label,correct,error_type,probability_data_integrity,probability_unrelated
0,"@Override public String toString() { return ""Hashing.crc32c()""; }",unrelated,unrelated,True,,0.007277349475771189,0.9927226901054382
1,@J2ktIncompatible public static HashFunction crc32c() { return Crc32CSupplier.HASH_FUNCTION; },data_integrity,data_integrity,True,,0.990380048751831,0.009619913063943386
2,public static final Set<String> ALL_PARAMS = new HashSet<>();,unrelated,unrelated,True,,0.002923418302088976,0.9970766305923462
3,"public static MutableBasicCredentials parseCredentials(String userInfo) { if (GenericUtils.isEmpty(userInfo)) { return null; } int pos = userInfo.indexOf(':'); if (pos < 0) { return new BasicCredentialsImpl(userInfo, null); } return new BasicCredentialsImpl(userInfo.substring(0, pos), userInfo.substring(pos + 1)); }",unrelated,unrelated,True,,0.09326852113008499,0.9067314863204956
4,"public HttpsToken(SPConstants.SPVersion version, SPConstants.IncludeTokenType includeTokenType, Element issuer, String issuerName, Element claims, Policy nestedPolicy, boolean requireClientCert) { super(version, includeTokenType, issuer, issuerName, claims, nestedPolicy); parseNestedPolicy(nestedPolicy, this); if (requireClientCert) { setAuthenticationType(AuthenticationType.RequireClientCertificate); } }",unrelated,unrelated,True,,0.006910206750035286,0.9930898547172546
5,"private static int decodeFutureTimeToLive(Map<String, Object> config, boolean timestamp) { String tag = ConfigurationConstants.TTL_FUTURE_TIMESTAMP; if (!timestamp) { tag = ConfigurationConstants.TTL_FUTURE_USERNAMETOKEN; } String ttl = getString(tag, config); int defaultFutureTimeToLive = 60; if (ttl != null) { try { int ttlI = Integer.parseInt(ttl); if (ttlI < 0) { return defaultFutureTimeToLive; } return ttlI; } catch (NumberFormatException e) { return defaultFutureTimeToLive; } } return defaultFutureTimeToLive; }",unrelated,unrelated,True,,0.002408543135970831,0.997591495513916
6,"static AttributeRepository ofAttributesMap(Map<AttributeKey<?>, ?> attributes) { return new AttributeRepository() { @Override public int getAttributesCount() { return attributes.size(); } @Override @SuppressWarnings(""unchecked"") public <T> T getAttribute(AttributeKey<T> key) { Objects.requireNonNull(key, ""No key provided""); return MapEntryUtils.isEmpty(attributes) ? null : (T) attributes.get(key); } @Override public Collection<AttributeKey<?>> attributeKeys() { return MapEntryUtils.isEmpty(attributes) ? Collections.emptySet() : new HashSet<>(attributes.keySet()); } @Override public String toString() { return AttributeRepository.class.getSimpleName() + ""["" + attributes + ""]""; } }; }",unrelated,unrelated,True,,0.0021586890798062086,0.9978412389755249
7,"@Override public int hashCode() { return GenericUtils.hashCode(getCipherName(), Boolean.TRUE) + GenericUtils.hashCode(getCipherType(), Boolean.TRUE) + GenericUtils.hashCode(getCipherMode(), Boolean.TRUE) + Objects.hashCode(getPassword()) + Arrays.hashCode(getInitVector()); }",unrelated,unrelated,True,,0.003340651746839285,0.9966593980789185
8,"@Override public int hashCode() { return Objects.hash(numHashFunctions, funnel, strategy, bits); }",unrelated,unrelated,True,,0.0027586952783167362,0.9972412586212158
9,static int smearedHash(@Nullable Object o) { return smear((o == null) ? 0 : o.hashCode()); },unrelated,unrelated,True,,0.0021455816458910704,0.9978544116020203
10,@Override public int hashCode() { return map().hashCode(); },unrelated,unrelated,True,,0.0021943352185189724,0.997805655002594
11,@Override int hashCode();,unrelated,unrelated,True,,0.003080167341977358,0.9969198703765869
12,"attachmentInputStream.mark(Integer.MAX_VALUE); try { DigestOutputStream digestOutputStream = createMessageDigestOutputStream(referenceType, inputProcessorChain.getSecurityContext()); try (UnsyncBufferedOutputStream bufferedDigestOutputStream = new UnsyncBufferedOutputStream(digestOutputStream)) { if (referenceType.getTransforms() != null) { Transformer transformer = buildTransformerChain(referenceType, bufferedDigestOutputStream, inputProcessorChain, null); if (!(transformer instanceof AttachmentContentSignatureTransform)) {",data_integrity,data_integrity,True,,0.9904705286026001,0.009529508650302887
13,"inputStream.reset(); } catch (IOException | XMLStreamException e) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e); } String calculatedDigest = XMLUtils.encodeToString(digestOutputStream.getDigestValue()); LOG.debug(""Calculated Digest: {}"", calculatedDigest); signaturePartDef.setDigestValue(calculatedDigest); Attachment resultAttachment = new Attachment();",data_integrity,data_integrity,True,,0.9905477166175842,0.009452269412577152
14,"protected int convertText(String text, Locale locale) { try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new IllegalFieldValueException(getType(), text); } }",unrelated,unrelated,True,,0.002234802581369877,0.9977651834487915
15,"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.002342772437259555,0.9976571798324585
16,public void setMillis(ReadableInstant instant) { long instantMillis = DateTimeUtils.getInstantMillis(instant); setMillis(instantMillis); },unrelated,unrelated,True,,0.0023232067469507456,0.9976767897605896
17,"public void printTo(Appendable appendable, ReadablePartial partial, Locale locale) throws IOException { if (appendable instanceof StringBuffer) { StringBuffer buf = (StringBuffer) appendable; underlying.printTo(buf, partial, locale); } else if (appendable instanceof Writer) { Writer out = (Writer) appendable; underlying.printTo(out, partial, locale); } else { StringBuffer buf = new StringBuffer(estimatePrintedLength()); underlying.printTo(buf, partial, locale); appendable.append(buf); } }",unrelated,unrelated,True,,0.0021555793937295675,0.9978444576263428
18,"private GJChronology(Chronology base, JulianChronology julian, GregorianChronology gregorian, Instant cutoverInstant) { super(base, new Object[] {julian, gregorian, cutoverInstant}); }",unrelated,unrelated,True,,0.002202215138822794,0.9977978467941284
19,public boolean isGreaterThan(Seconds other) { if (other == null) { return getValue() > 0; } return getValue() > other.getValue(); },unrelated,unrelated,True,,0.002277321182191372,0.9977226853370667
20,"public static Hours hoursBetween(ReadableInstant start, ReadableInstant end) { int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.hours()); return Hours.hours(amount); }",unrelated,unrelated,True,,0.0023199499119073153,0.997680127620697
21,"@Override public long set(long instant, int value) { FieldUtils.verifyValueBounds(this, value, getMinimumValue(), getMaximumValue()); return instant + (value - get(instant)) * iUnitMillis; }",unrelated,unrelated,True,,0.0022181894164532423,0.9977818131446838
22,@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.0022006670478731394,0.9977993369102478
23,"public static Years yearsBetween(ReadableInstant start, ReadableInstant end) { int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.years()); return Years.years(amount); }",unrelated,unrelated,True,,0.002355491043999791,0.9976444840431213
24,"@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.0021986409556120634,0.9978013634681702
25,"BasicDayOfMonthDateTimeField(BasicChronology chronology, DurationField days) { super(DateTimeFieldType.dayOfMonth(), days); iChronology = chronology; }",unrelated,unrelated,True,,0.0021779912058264017,0.9978220462799072
26,"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.002582473447546363,0.9974175691604614
27,"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.0022385972552001476,0.9977613687515259
28,@Override public int getMinimumValue(ReadablePartial instant) { return getMinimumValue(); },unrelated,unrelated,True,,0.0022605289705097675,0.9977394342422485
29,"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.0023592475336045027,0.9976407289505005
30,"@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.002193389693275094,0.9978066086769104
31,public void setZone(DateTimeZone zone) { iSavedState = null; iZone = zone; },unrelated,unrelated,True,,0.0024884999729692936,0.9975115060806274
32,"public DateMidnight plusMonths(int months) { if (months == 0) { return this; } long instant = getChronology().months().add(getMillis(), months); return withMillis(instant); }",unrelated,unrelated,True,,0.0024116404820233583,0.9975883960723877
33,"@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.002135970164090395,0.9978640675544739
34,@Override public final DateTimeField clockhourOfDay() { return iClockhourOfDay; },unrelated,unrelated,True,,0.002280707936733961,0.9977192282676697
35,"@Override int getMonthOfYear(long millis, int year) { long monthZeroBased = (millis - getYearMillis(year)) / MILLIS_PER_MONTH; return ((int) monthZeroBased) + 1; }",unrelated,unrelated,True,,0.0022256646770983934,0.9977743029594421
36,"int getDayOfMonth(long millis, int year) { int month = getMonthOfYear(millis, year); return getDayOfMonth(millis, year, month); }",unrelated,unrelated,True,,0.0022911832202225924,0.997708797454834
37,public Hours toStandardHours() { long hours = getStandardHours(); return Hours.hours(FieldUtils.safeToInt(hours)); },unrelated,unrelated,True,,0.0021930839866399765,0.997806966304779
38,public boolean isGreaterThan(Weeks other) { if (other == null) { return getValue() > 0; } return getValue() > other.getValue(); },unrelated,unrelated,True,,0.002232571132481098,0.997767448425293
39,"public DateTime toDateTimeAtCurrentTime(DateTimeZone zone) { Chronology chrono = getChronology().withZone(zone); long instantMillis = DateTimeUtils.currentTimeMillis(); long resolved = chrono.set(this, instantMillis); return new DateTime(resolved, chrono); }",unrelated,unrelated,True,,0.002360341139137745,0.9976396560668945
40,"@Override protected void assemble(Fields fields) { if (getBase() == null) { super.assemble(fields); fields.year = new SkipDateTimeField(this, fields.year); fields.weekyear = new SkipDateTimeField(this, fields.weekyear); fields.era = ERA_FIELD; fields.monthOfYear = new BasicMonthOfYearDateTimeField(this, 13); fields.months = fields.monthOfYear.getDurationField(); } }",unrelated,unrelated,True,,0.0022245158907026052,0.9977754950523376
41,"@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.0022523272782564163,0.9977476000785828
42,"private static PeriodFormatter buildWordBased(Locale locale) { ResourceBundle b = ResourceBundle.getBundle(BUNDLE_NAME, locale); if (containsKey(b, ""PeriodFormat.regex.separator"")) { return buildRegExFormatter(b, locale); } else { return buildNonRegExFormatter(b, locale); } }",unrelated,unrelated,True,,0.002184422453865409,0.9978156089782715
43,public Seconds minus(Seconds seconds) { if (seconds == null) { return this; } return minus(seconds.getValue()); },unrelated,unrelated,True,,0.0023653903044760227,0.9976346492767334
44,"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.0024207341484725475,0.9975792765617371
45,@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.002194370608776808,0.997805655002594
46,"@Override public String toString() { String str = ""BuddhistChronology""; DateTimeZone zone = getZone(); if (zone != null) { str = str + '[' + zone.getID() + ']'; } return str; }",unrelated,unrelated,True,,0.0025719685945659876,0.9974279999732971
47,"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.0022845950443297625,0.9977154731750488
48,"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.002150649670511484,0.9978493452072144
49,@Override public long roundHalfFloor(long instant) { return getWrappedField().roundHalfFloor(instant); },unrelated,unrelated,True,,0.002232940634712577,0.9977670907974243
50,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.0022643008269369602,0.9977357387542725
51,@Override public int hashCode() { int hash = iHash; if (hash == 0) { hash = iHash = super.hashCode(); } return hash; },unrelated,unrelated,True,,0.003508147783577442,0.9964918494224548
52,"public void printTo(StringBuffer buf, long instant) { try { printTo((Appendable) buf, instant); } catch (IOException ex) { } }",unrelated,unrelated,True,,0.0022212122566998005,0.9977788329124451
53,"@Override public long set(ReadablePartial partial, long instant) { for (int i = 0, isize = partial.size(); i < isize; i++) { instant = partial.getFieldType(i).getField(this).set(instant, partial.getValue(i)); } return instant; }",unrelated,unrelated,True,,0.0021992726251482964,0.9978006482124329
54,"protected LenientDateTimeField(DateTimeField field, Chronology base) { super(field); iBase = base; }",unrelated,unrelated,True,,0.002186538651585579,0.9978134632110596
55,"public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) { UnsupportedDurationField field; if (cCache == null) { cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7); field = null; } else { field = cCache.get(type); } if (field == null) { field = new UnsupportedDurationField(type); cCache.put(type, field); } return field; }",unrelated,unrelated,True,,0.002105767372995615,0.9978942275047302
56,"BasicDayOfYearDateTimeField(BasicChronology chronology, DurationField days) { super(DateTimeFieldType.dayOfYear(), days); iChronology = chronology; }",unrelated,unrelated,True,,0.0022109360434114933,0.9977890253067017
57,"@Override public long add(long instant, int years) { if (years == 0) { return instant; } return set(instant, get(instant) + years); }",unrelated,unrelated,True,,0.0022524900268763304,0.9977474808692932
58,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.0024239986669272184,0.9975760579109192
59,"public void printTo(StringBuilder buf, ReadablePartial partial) { try { printTo((Appendable) buf, partial); } catch (IOException ex) { } }",unrelated,unrelated,True,,0.0022287247702479362,0.9977712631225586
60,public boolean isGreaterThan(Minutes other) { if (other == null) { return getValue() > 0; } return getValue() > other.getValue(); },unrelated,unrelated,True,,0.0022809260990470648,0.9977189898490906
61,"@Override long getTotalMillisByYearMonth(int year, int month) { if (--month % 2 == 1) { month /= 2; return month * MILLIS_PER_MONTH_PAIR + MILLIS_PER_LONG_MONTH; } else { month /= 2; return month * MILLIS_PER_MONTH_PAIR; } }",unrelated,unrelated,True,,0.002308162860572338,0.9976918697357178
62,"public Duration dividedBy(long divisor) { if (divisor == 1) { return this; } return new Duration(FieldUtils.safeDivide(getMillis(), divisor)); }",unrelated,unrelated,True,,0.0024144931230694056,0.9975855350494385
63,"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.0021051194053143263,0.9978949427604675
64,"private static Mac getMac(String algorithmName, Key key) { try { Mac mac = Mac.getInstance(algorithmName); mac.init(key); return mac; } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(e); } catch (InvalidKeyException e) { throw new IllegalArgumentException(e);",data_integrity,data_integrity,True,,0.9907791614532471,0.009220803156495094
65,"@Override public byte[] createKey(byte[] secret, byte[] seed, int offset, long length) throws WSSecurityException { try { Mac mac = Mac.getInstance(""HmacSHA1""); byte[] tempBytes = pHash(secret, seed, mac, offset + (int) length); byte[] key = new byte[(int) length]; System.arraycopy(tempBytes, offset, key, 0, key.length);",data_integrity,data_integrity,True,,0.9907183051109314,0.009281715378165245
66,"public static final NavigableMap<String, OptionalFeature> DEFAULT_SUPPORTED_CLIENT_EXTENSIONS = NavigableMapBuilder.<String, OptionalFeature> builder() .put(SftpConstants.EXT_VERSION_SELECT, OptionalFeature.TRUE) .put(SftpConstants.EXT_COPY_FILE, OptionalFeature.TRUE) .put(SftpConstants.EXT_MD5_HASH, BuiltinDigests.md5) .put(SftpConstants.EXT_MD5_HASH_HANDLE, BuiltinDigests.md5) .put(SftpConstants.EXT_CHECK_FILE_HANDLE, OptionalFeature.any(BuiltinDigests.VALUES)) .put(SftpConstants.EXT_CHECK_FILE_NAME, OptionalFeature.any(BuiltinDigests.VALUES)) .put(SftpConstants.EXT_COPY_DATA, OptionalFeature.TRUE) .put(SftpConstants.EXT_SPACE_AVAILABLE, OptionalFeature.TRUE) .immutable();",data_integrity,unrelated,False,true_data_integrity_predicted_unrelated,0.005573483649641275,0.9944264888763428
67,"name = ""path_md5_sum"", doc = ""Return the md5 hash of a file at a checkout path. Do not use unless working with legacy"" + "" systems that require MD5.\n"" + ""WARNING: do not use unless working with legacy systems that require MD5"", parameters = {@Param(name = ""path"", doc = ""checkout path pointing to a file to be hashed"")}) public String pathMd5Sum(CheckoutPath path) throws IOException { @SuppressWarnings(""deprecation"") HashFunction hashFunc = Hashing.md5(); return hashFile(path.fullPath(), hashFunc); }",data_integrity,data_integrity,True,,0.9897174835205078,0.010282525792717934
68,"throws Exception { ValidateUtils.checkTrue(startOffset >= 0L, ""Invalid start offset: %d"", startOffset); ValidateUtils.checkTrue(length > 0L, ""Invalid length: %d"", length); if (!BuiltinDigests.md5.isSupported()) { throw new UnsupportedOperationException(BuiltinDigests.md5.getAlgorithm() + "" hash not supported""); } Digest digest = BuiltinDigests.md5.create(); digest.init(); long effectiveLength = length; byte[] digestBuf = new byte[(int) Math.min(effectiveLength, SftpConstants.MD5_QUICK_HASH_SIZE)]; ByteBuffer wb = ByteBuffer.wrap(digestBuf); boolean hashMatches = false; byte[] hashValue = null; SftpFileSystemAccessor accessor = getFileSystemAccessor(); boolean traceEnabled = log.isTraceEnabled(); ServerSession session = getServerSession(); try (SeekableByteChannel channel = accessor.openFile( this, null, path, null, Collections.emptySet())) { channel.position(startOffset); if (NumberUtils.length(quickCheckHash) <= 0) { hashMatches = true; } else {",data_integrity,data_integrity,True,,0.990635335445404,0.009364640340209007
69,"public static String hashIdentity(ToStringHelper helper, String workflowIdentityUser) { helper.add( ""user"", workflowIdentityUser != null ? workflowIdentityUser : StandardSystemProperty.USER_NAME.value()); String identity = helper.toString(); String hash = BaseEncoding.base16() .encode(Hashing.md5().hashString(identity, StandardCharsets.UTF_8).asBytes()); logger.atInfo().log(""Computed migration identity hash for %s as %s "", identity, hash); return hash; }",data_integrity,data_integrity,True,,0.9896037578582764,0.010396269150078297
70,"public ChecksumObserver() throws NoSuchAlgorithmException { this(""MD5""); }",data_integrity,data_integrity,True,,0.9906436800956726,0.00935638602823019
71,"throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } byte[] origPasswordBytes = pwCb.getPassword().getBytes(StandardCharsets.UTF_8); byte[] passwordBytes = passwordType.getValue().getBytes(StandardCharsets.UTF_8); if (!MessageDigest.isEqual(origPasswordBytes, passwordBytes)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } passwordType.setValue(pwCb.getPassword()); }",data_integrity,data_integrity,True,,0.9906529188156128,0.009347140789031982
72,"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];",data_integrity,data_integrity,True,,0.9908772110939026,0.009122835472226143
73,"if (pwCb.getPassword() == null) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } byte[] passDigest = UsernameTokenUtil.doRawPasswordDigest(nonceVal, created, pwCb.getPassword().getBytes(StandardCharsets.UTF_8)); byte[] decodedPassword = XMLUtils.decode(passwordType.getValue()); if (!MessageDigest.isEqual(decodedPassword, passDigest)) { throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION); } passwordType.setValue(pwCb.getPassword());",data_integrity,data_integrity,True,,0.9908226728439331,0.00917732808738947
74,"@J2ktIncompatible public static HashFunction hmacSha256(byte[] key) { return hmacSha256(new SecretKeySpec(checkNotNull(key), ""HmacSHA256"")); }",data_integrity,data_integrity,True,,0.9910263419151306,0.008973641321063042
75,default HashFunction getHashFunction() { return Hashing.sha256(); },data_integrity,data_integrity,True,,0.9908917546272278,0.009108247235417366
76,"} ByteArrayBuffer encoded = new ByteArrayBuffer(); encoded.putString(getSignatureKeyType()); encoded.putBytes(rawSig); MessageDigest md = SecurityUtils.getMessageDigest(""SHA-256""); byte[] appNameDigest = md.digest(publicKey.getAppName().getBytes(StandardCharsets.UTF_8)); byte[] challengeDigest = this.challengeDigest.digest(); ByteArrayBuffer counterData = new ByteArrayBuffer(Integer.BYTES, false); counterData.putUInt(counter); Signature delegate = getDelegateSignature(); delegate.initVerifier(session, publicKey.getDelegatePublicKey()); delegate.update(session, appNameDigest); delegate.update(session, new byte[] { flags }); delegate.update(session, counterData.getCompactData()); delegate.update(session, challengeDigest); return delegate.verify(session, encoded.getCompactData()); }",data_integrity,data_integrity,True,,0.9909204244613647,0.009079553186893463
77,"parameters = {@Param(name = ""path"", doc = ""checkout path pointing to a file to be hashed"")}) public String pathSha256Sum(CheckoutPath path) throws IOException { return hashFile(path.fullPath(), Hashing.sha256()); }",data_integrity,data_integrity,True,,0.9896296858787537,0.010370300151407719
78,"}) public String hashStringWithSha256(Object input) throws ValidationException, EvalException { if (input instanceof String) { return Hashing.sha256().hashString((String) input, UTF_8).toString(); } List<String> stringInputs = convertStringList(input, ""input""); Hasher hasher = Hashing.sha256().newHasher(); if (stringInputs.isEmpty()) { throw new ValidationException( ""hashing.hash_str_with_sha256 cannot be called with an empty object list.""); } for (String stringInput : stringInputs) { hasher.putString(stringInput, UTF_8); } return hasher.hash().toString(); }",data_integrity,data_integrity,True,,0.99016934633255,0.009830608032643795
79,"nistp384(Constants.NISTP384, ""secp384r1"", new int[] { 1, 3, 132, 0, 34 }, 48, BuiltinDigests.sha384), nistp521(Constants.NISTP521, ""secp521r1"", new int[] { 1, 3, 132, 0, 35 }, 66, BuiltinDigests.sha512); public static final Set<ECCurves> VALUES = Collections.unmodifiableSet(EnumSet.allOf(ECCurves.class)); public static final NavigableSet<String> NAMES = Collections.unmodifiableNavigableSet( GenericUtils.mapSort(VALUES, ECCurves::getName, String.CASE_INSENSITIVE_ORDER));",data_integrity,data_integrity,True,,0.776800811290741,0.2231992483139038
80,"} verif.initSigner(session, kp.getPrivate()); verif.update(session, data); byte[] signature = verif.sign(session); return new SimpleImmutableEntry<>(factory.getName(), signature); } catch (IOException e) { throw e; } catch (Exception e) {",data_integrity,data_integrity,True,,0.990778923034668,0.00922109093517065
81,"NamedFactory.create(session.getSignatureFactories(), keyAlg), ""No verifier located for algorithm=%s"", keyAlg); verif.initVerifier(session, serverKey); verif.update(session, h); if (!verif.verify(session, sig)) { throw new SshException(SshConstants.SSH2_DISCONNECT_KEY_EXCHANGE_FAILED, ""KeyExchange signature verification failed for key type="" + keyAlg); } session.setServerKey(serverKey);",data_integrity,data_integrity,True,,0.99072265625,0.009277322329580784
82,"ValidateUtils.checkNotNull(verifier, ""No signer could be located for key type=%s"", algo); verifier.initSigner(session, pair.getPrivate()); verifier.update(session, data); byte[] signature = verifier.sign(session); return new SimpleImmutableEntry<>(factory.getName(), signature); }",data_integrity,data_integrity,True,,0.9908650517463684,0.009134969674050808
83,getWsDocInfo().setCallbackLookup(callbackLookup); getWsDocInfo().setTokensOnContext((DOMSignContext)signContext); sig.sign(signContext); signatureValue = sig.getSignatureValue().getValue(); cleanup();,data_integrity,data_integrity,True,,0.9908913969993591,0.00910861324518919
84,"""No CA verifier located for algorithm=%s of key ID=%s"", sigAlg, keyId); verif.initVerifier(session, signatureKey); verif.update(session, cert.getMessage()); if (!verif.verify(session, cert.getSignature())) { throw new CertificateException(""CA signature verification failed for key type="" + keyAlg + "" of key ID="" + keyId); } }",data_integrity,data_integrity,True,,0.9908522963523865,0.009147700853645802
85,"wsDocInfo.setTokensOnContext((DOMSignContext)signContext); sig.sign(signContext); signatureValue = sig.getSignatureValue().getValue(); } catch (Exception ex) { LOG.error(ex.getMessage(), ex);",data_integrity,data_integrity,True,,0.9909118413925171,0.009088099002838135
86,"bs.putString(clientHostname); bs.putString(clientUsername); verifier.update(session, bs.array(), bs.rpos(), bs.available()); byte[] signature = verifier.sign(session); if (log.isTraceEnabled()) { log.trace(""appendSignature({})[{}][{}] type={}, fingerprint={}, client={}@{}: signature={}"", session, service, name, keyType, KeyUtils.getFingerPrint(key), clientUsername, clientHostname, BufferUtils.toHex(signature));",data_integrity,data_integrity,True,,0.9907386302947998,0.009261347353458405
87,"throw new IllegalArgumentException(""SSH2_AGENTC_SIGN_REQUEST: Unknown flag value 0x"" + Integer.toHexString(flags) + "", only 0, 2, or 4 are allowed.""); } } Map.Entry<String, byte[]> result = agent.sign(null, signingKey, signatureAlgorithm, data); String algo = result.getKey(); byte[] signature = result.getValue(); Buffer sig = new ByteArrayBuffer(algo.length() + signature.length + Long.SIZE, false); sig.putString(algo);",data_integrity,data_integrity,True,,0.9906430840492249,0.009356965310871601
88,"public void verifySignature( SAMLKeyInfoProcessor keyInfoProcessor, Crypto sigCrypto ) throws WSSecurityException { Signature sig = getSignature(); if (sig != null) {",data_integrity,data_integrity,True,,0.9907456636428833,0.009254319593310356
89,@Override public byte[] sign(SessionContext session) throws Exception { byte[] sig = super.sign(session); try (DERParser parser = new DERParser(sig)) { int type = parser.read(); if (type != 0x30) {,data_integrity,data_integrity,True,,0.9906637668609619,0.009336248971521854
90,"verifier.initVerifier(session, verifyKey); buffer.rpos(oldPos); buffer.wpos(oldPos + 4 + len); if (!verifySignature(session, username, alg, key, buffer, verifier, sig)) { throw new SignatureException(""Key verification failed""); } if (debugEnabled) {",data_integrity,data_integrity,True,,0.9908595681190491,0.009140482172369957
91,"public void initSigner(SessionContext session, PrivateKey key) throws Exception { String algo = getAlgorithm(); signatureInstance = Objects.requireNonNull( doInitSignature(session, algo, key, true), ""No signature instance create""); signatureInstance.initSign(Objects.requireNonNull(key, ""No private key provided"")); }",data_integrity,data_integrity,True,,0.9905527830123901,0.009447207674384117
92,algorithmSuiteValidator.checkAsymmetricKeyLength(key); } } samlAssertion.verifySignature(samlKeyInfo); return xmlSignature; },data_integrity,data_integrity,True,,0.9909982681274414,0.00900171510875225
93,"byte[] contents = bs.getCompactData(); byte[] sig; try { Map.Entry<String, byte[]> result = current.sign(session, algo, contents); String factoryName = result.getKey(); ValidateUtils.checkState(algo.equalsIgnoreCase(factoryName), ""Mismatched signature type generated: requested=%s, used=%s"", algo, factoryName); sig = result.getValue();",data_integrity,data_integrity,True,,0.9908621311187744,0.00913784746080637
94,"clientUsername, clientHostName, GenericUtils.size(certs), BufferUtils.toHex(signature)); } verifier.update(session, buf.array(), buf.rpos(), buf.available()); if (!verifier.verify(session, signature)) { throw new SignatureException(""Key verification failed""); } if (debugEnabled) {",data_integrity,data_integrity,True,,0.9906228184700012,0.009377221576869488
95,"protected boolean doVerify(byte[] data) throws SignatureException { java.security.Signature signature = Objects.requireNonNull(getSignature(), ""Signature not initialized""); return signature.verify(data); }",data_integrity,data_integrity,True,,0.9908080697059631,0.009191992692649364
96,public void verifySignature(SAMLKeyInfo samlKeyInfo) throws WSSecurityException { Signature sig = getSignature(); if (sig != null) { if (samlKeyInfo == null) { throw new WSSecurityException(,data_integrity,data_integrity,True,,0.9906693696975708,0.009330658242106438
97,"""No KeyExchange CA verifier located for algorithm=%s of key ID=%s"", sigAlg, keyId); verif.initVerifier(session, signatureKey); verif.update(session, openSshKey.getMessage()); if (!verif.verify(session, openSshKey.getSignature())) { throw new SshException(SshConstants.SSH2_DISCONNECT_KEY_EXCHANGE_FAILED, ""KeyExchange CA signature verification failed for key type="" + keyAlg + "" of key ID="" + keyId); }",data_integrity,data_integrity,True,,0.9907704591751099,0.009229572489857674
98,"NamedFactory.create(session.getSignatureFactories(), keyAlg), ""No verifier located for algorithm=%s"", keyAlg); verif.initVerifier(session, serverPublicHostKey); verif.update(session, h); if (!verif.verify(session, sig)) { throw new SshException(SshConstants.SSH2_DISCONNECT_KEY_EXCHANGE_FAILED, ""KeyExchange signature verification failed for key type="" + keyAlg); }",data_integrity,data_integrity,True,,0.9906595945358276,0.009340385906398296
99,"public void initVerifier(SessionContext session, PublicKey key) throws Exception { String algo = getAlgorithm(); signatureInstance = Objects.requireNonNull( doInitSignature(session, algo, key, false), ""No signature instance create""); signatureInstance.initVerify(Objects.requireNonNull(key, ""No public key provided"")); }",data_integrity,data_integrity,True,,0.9905776977539062,0.009422332048416138
100,"@Override public byte[] sign(SessionContext session) throws Exception { java.security.Signature signature = Objects.requireNonNull(getSignature(), ""Signature not initialized""); return signature.sign(); }",data_integrity,data_integrity,True,,0.9906124472618103,0.009387538768351078
101,@Override public byte[] sign(SessionContext session) throws Exception { byte[] sig = super.sign(session); try (DERParser parser = new DERParser(sig)) { int type = parser.read(); if (type != 0x30) {,data_integrity,data_integrity,True,,0.9906637668609619,0.009336248971521854
102,getWsDocInfo().setTokensOnContext((DOMSignContext)signContext); sig.sign(signContext); signatureValue = sig.getSignatureValue().getValue(); } catch (Exception ex) {,data_integrity,data_integrity,True,,0.9908267855644226,0.009173179976642132
103,"signer.update(null, toSign); final ByteArrayBuffer tmpBuffer = new ByteArrayBuffer(); tmpBuffer.putString(factory.getName()); tmpBuffer.putBytes(signer.sign(null)); cert.setMessage(toSign); cert.setSignature(tmpBuffer.getCompactData());",data_integrity,data_integrity,True,,0.9907363057136536,0.00926364865154028