repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
molgenis/molgenis | molgenis-navigator/src/main/java/org/molgenis/navigator/copy/service/PretendingEntity.java | PretendingEntity.getEntity | @Override
@SuppressWarnings("unchecked")
public <E extends Entity> E getEntity(String attributeName, Class<E> clazz) {
"""
Because the File datatype has a reference to {@link FileMetaMetadata} it can happen that a
typed FileMeta Entity is requested.
"""
Entity entity = delegate().getEntity(attributeNa... | java | @Override
@SuppressWarnings("unchecked")
public <E extends Entity> E getEntity(String attributeName, Class<E> clazz) {
Entity entity = delegate().getEntity(attributeName, clazz);
if (clazz.equals(FileMeta.class)) {
return entity != null ? (E) new FileMeta(newPretendingEntity(entity)) : null;
} els... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"E",
"extends",
"Entity",
">",
"E",
"getEntity",
"(",
"String",
"attributeName",
",",
"Class",
"<",
"E",
">",
"clazz",
")",
"{",
"Entity",
"entity",
"=",
"delegate",
"(",
... | Because the File datatype has a reference to {@link FileMetaMetadata} it can happen that a
typed FileMeta Entity is requested. | [
"Because",
"the",
"File",
"datatype",
"has",
"a",
"reference",
"to",
"{"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-navigator/src/main/java/org/molgenis/navigator/copy/service/PretendingEntity.java#L48-L57 |
wildfly/wildfly-core | process-controller/src/main/java/org/jboss/as/process/ProcessUtils.java | ProcessUtils.killProcess | static boolean killProcess(final String processName, int id) {
"""
Try to kill a given process.
@param processName the process name
@param id the process integer id, or {@code -1} if this is not relevant
@return {@code true} if the command succeeded, {@code false} otherwise
"""
int pid;
tr... | java | static boolean killProcess(final String processName, int id) {
int pid;
try {
pid = processUtils.resolveProcessId(processName, id);
if(pid > 0) {
try {
Runtime.getRuntime().exec(processUtils.getKillCommand(pid));
return true... | [
"static",
"boolean",
"killProcess",
"(",
"final",
"String",
"processName",
",",
"int",
"id",
")",
"{",
"int",
"pid",
";",
"try",
"{",
"pid",
"=",
"processUtils",
".",
"resolveProcessId",
"(",
"processName",
",",
"id",
")",
";",
"if",
"(",
"pid",
">",
"... | Try to kill a given process.
@param processName the process name
@param id the process integer id, or {@code -1} if this is not relevant
@return {@code true} if the command succeeded, {@code false} otherwise | [
"Try",
"to",
"kill",
"a",
"given",
"process",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/process-controller/src/main/java/org/jboss/as/process/ProcessUtils.java#L38-L54 |
coveo/fmt-maven-plugin | src/main/java/com/coveo/FMT.java | FMT.onNonComplyingFile | @Override
protected void onNonComplyingFile(File file, String formatted) throws IOException {
"""
Hook called when the processd file is not compliant with the formatter.
@param file the file that is not compliant
@param formatted the corresponding formatted of the file.
"""
CharSink sink = Files.asCh... | java | @Override
protected void onNonComplyingFile(File file, String formatted) throws IOException {
CharSink sink = Files.asCharSink(file, Charsets.UTF_8);
sink.write(formatted);
} | [
"@",
"Override",
"protected",
"void",
"onNonComplyingFile",
"(",
"File",
"file",
",",
"String",
"formatted",
")",
"throws",
"IOException",
"{",
"CharSink",
"sink",
"=",
"Files",
".",
"asCharSink",
"(",
"file",
",",
"Charsets",
".",
"UTF_8",
")",
";",
"sink",... | Hook called when the processd file is not compliant with the formatter.
@param file the file that is not compliant
@param formatted the corresponding formatted of the file. | [
"Hook",
"called",
"when",
"the",
"processd",
"file",
"is",
"not",
"compliant",
"with",
"the",
"formatter",
"."
] | train | https://github.com/coveo/fmt-maven-plugin/blob/9368be6985ecc2126c875ff4aabe647c7e57ecca/src/main/java/com/coveo/FMT.java#L26-L30 |
apache/incubator-zipkin | zipkin/src/main/java/zipkin2/v1/V1BinaryAnnotation.java | V1BinaryAnnotation.createAddress | public static V1BinaryAnnotation createAddress(String address, Endpoint endpoint) {
"""
Creates an address annotation, which is the same as {@link Span#remoteEndpoint()}
"""
if (endpoint == null) throw new NullPointerException("endpoint == null");
return new V1BinaryAnnotation(address, null, endpoint);... | java | public static V1BinaryAnnotation createAddress(String address, Endpoint endpoint) {
if (endpoint == null) throw new NullPointerException("endpoint == null");
return new V1BinaryAnnotation(address, null, endpoint);
} | [
"public",
"static",
"V1BinaryAnnotation",
"createAddress",
"(",
"String",
"address",
",",
"Endpoint",
"endpoint",
")",
"{",
"if",
"(",
"endpoint",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"endpoint == null\"",
")",
";",
"return",
"new",
... | Creates an address annotation, which is the same as {@link Span#remoteEndpoint()} | [
"Creates",
"an",
"address",
"annotation",
"which",
"is",
"the",
"same",
"as",
"{"
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin/src/main/java/zipkin2/v1/V1BinaryAnnotation.java#L39-L42 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.getOrCreateRegularFile | public RegularFile getOrCreateRegularFile(
JimfsPath path, Set<OpenOption> options, FileAttribute<?>... attrs) throws IOException {
"""
Gets the regular file at the given path, creating it if it doesn't exist and the given options
specify that it should be created.
"""
checkNotNull(path);
if (!... | java | public RegularFile getOrCreateRegularFile(
JimfsPath path, Set<OpenOption> options, FileAttribute<?>... attrs) throws IOException {
checkNotNull(path);
if (!options.contains(CREATE_NEW)) {
// assume file exists unless we're explicitly trying to create a new file
RegularFile file = lookUpRegul... | [
"public",
"RegularFile",
"getOrCreateRegularFile",
"(",
"JimfsPath",
"path",
",",
"Set",
"<",
"OpenOption",
">",
"options",
",",
"FileAttribute",
"<",
"?",
">",
"...",
"attrs",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"path",
")",
";",
"if",
"... | Gets the regular file at the given path, creating it if it doesn't exist and the given options
specify that it should be created. | [
"Gets",
"the",
"regular",
"file",
"at",
"the",
"given",
"path",
"creating",
"it",
"if",
"it",
"doesn",
"t",
"exist",
"and",
"the",
"given",
"options",
"specify",
"that",
"it",
"should",
"be",
"created",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L285-L302 |
qiujuer/Genius-Android | caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java | Run.onUiSync | public static <T> T onUiSync(Func<T> func, long waitMillis, boolean cancelOnTimeOut) {
"""
Synchronously
<p/>
In this you can receiver {@link Func#call()} return
<p/>
The current thread relative thread synchronization operation,
blocking the current thread,
thread for the main thread to complete
But the cur... | java | public static <T> T onUiSync(Func<T> func, long waitMillis, boolean cancelOnTimeOut) {
return onUiSync(func, waitMillis, 0, cancelOnTimeOut);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"onUiSync",
"(",
"Func",
"<",
"T",
">",
"func",
",",
"long",
"waitMillis",
",",
"boolean",
"cancelOnTimeOut",
")",
"{",
"return",
"onUiSync",
"(",
"func",
",",
"waitMillis",
",",
"0",
",",
"cancelOnTimeOut",
")",
... | Synchronously
<p/>
In this you can receiver {@link Func#call()} return
<p/>
The current thread relative thread synchronization operation,
blocking the current thread,
thread for the main thread to complete
But the current thread just wait for the waitTime long.
@param func Func Interface
@param waitMillis ... | [
"Synchronously",
"<p",
"/",
">",
"In",
"this",
"you",
"can",
"receiver",
"{",
"@link",
"Func#call",
"()",
"}",
"return",
"<p",
"/",
">",
"The",
"current",
"thread",
"relative",
"thread",
"synchronization",
"operation",
"blocking",
"the",
"current",
"thread",
... | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-handler/src/main/java/net/qiujuer/genius/kit/handler/Run.java#L239-L241 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/util/TaskConfig.java | TaskConfig.setImplicitConvergenceCriterion | public void setImplicitConvergenceCriterion(String aggregatorName, ConvergenceCriterion<?> convCriterion) {
"""
Sets the default convergence criterion of a {@link DeltaIteration}
@param aggregatorName
@param convCriterion
"""
try {
InstantiationUtil.writeObjectToConfig(convCriterion, this.config, ITER... | java | public void setImplicitConvergenceCriterion(String aggregatorName, ConvergenceCriterion<?> convCriterion) {
try {
InstantiationUtil.writeObjectToConfig(convCriterion, this.config, ITERATION_IMPLICIT_CONVERGENCE_CRITERION);
} catch (IOException e) {
throw new RuntimeException("Error while writing the implicit ... | [
"public",
"void",
"setImplicitConvergenceCriterion",
"(",
"String",
"aggregatorName",
",",
"ConvergenceCriterion",
"<",
"?",
">",
"convCriterion",
")",
"{",
"try",
"{",
"InstantiationUtil",
".",
"writeObjectToConfig",
"(",
"convCriterion",
",",
"this",
".",
"config",
... | Sets the default convergence criterion of a {@link DeltaIteration}
@param aggregatorName
@param convCriterion | [
"Sets",
"the",
"default",
"convergence",
"criterion",
"of",
"a",
"{",
"@link",
"DeltaIteration",
"}"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/util/TaskConfig.java#L1004-L1011 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java | TimestampUtils.convertToDate | public Date convertToDate(long millis, TimeZone tz) {
"""
Extracts the date part from a timestamp.
@param millis The timestamp from which to extract the date.
@param tz The time zone of the date.
@return The extracted date.
"""
// no adjustments for the inifity hack values
if (millis <= PGStateme... | java | public Date convertToDate(long millis, TimeZone tz) {
// no adjustments for the inifity hack values
if (millis <= PGStatement.DATE_NEGATIVE_INFINITY
|| millis >= PGStatement.DATE_POSITIVE_INFINITY) {
return new Date(millis);
}
if (tz == null) {
tz = getDefaultTz();
}
if (isS... | [
"public",
"Date",
"convertToDate",
"(",
"long",
"millis",
",",
"TimeZone",
"tz",
")",
"{",
"// no adjustments for the inifity hack values",
"if",
"(",
"millis",
"<=",
"PGStatement",
".",
"DATE_NEGATIVE_INFINITY",
"||",
"millis",
">=",
"PGStatement",
".",
"DATE_POSITIV... | Extracts the date part from a timestamp.
@param millis The timestamp from which to extract the date.
@param tz The time zone of the date.
@return The extracted date. | [
"Extracts",
"the",
"date",
"part",
"from",
"a",
"timestamp",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L1225-L1259 |
pravega/pravega | common/src/main/java/io/pravega/common/util/btree/BTreePage.java | BTreePage.applyInsertsAndRemovals | private BTreePage applyInsertsAndRemovals(ChangeInfo ci) {
"""
Inserts the new PageEntry instances at the given offsets.
@param ci A {@link ChangeInfo} object containing information to change.
@return A new BTreePage instance with the updated contents.
"""
int newCount = getCount() + ci.insertCount... | java | private BTreePage applyInsertsAndRemovals(ChangeInfo ci) {
int newCount = getCount() + ci.insertCount - ci.deleteCount;
// Allocate new buffer of the correct size and start copying from the old one.
val newPage = new BTreePage(this.config, new ByteArraySegment(new byte[DATA_OFFSET + newCount * ... | [
"private",
"BTreePage",
"applyInsertsAndRemovals",
"(",
"ChangeInfo",
"ci",
")",
"{",
"int",
"newCount",
"=",
"getCount",
"(",
")",
"+",
"ci",
".",
"insertCount",
"-",
"ci",
".",
"deleteCount",
";",
"// Allocate new buffer of the correct size and start copying from the ... | Inserts the new PageEntry instances at the given offsets.
@param ci A {@link ChangeInfo} object containing information to change.
@return A new BTreePage instance with the updated contents. | [
"Inserts",
"the",
"new",
"PageEntry",
"instances",
"at",
"the",
"given",
"offsets",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/BTreePage.java#L515-L554 |
jbundle/jbundle | thin/base/screen/splash/src/main/java/org/jbundle/thin/base/screen/splash/Splash.java | Splash.invokeMain | public static void invokeMain(String className, String[] args) {
"""
Invokes the main method of the provided class name.
@param args the command line arguments
"""
try {
Class<?> clazz = null;
if (ClassServiceUtility.getClassService().getClassFinder(null) != null)
... | java | public static void invokeMain(String className, String[] args) {
try {
Class<?> clazz = null;
if (ClassServiceUtility.getClassService().getClassFinder(null) != null)
clazz = ClassServiceUtility.getClassService().getClassFinder(null).findClass(className, null);
... | [
"public",
"static",
"void",
"invokeMain",
"(",
"String",
"className",
",",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"null",
";",
"if",
"(",
"ClassServiceUtility",
".",
"getClassService",
"(",
")",
".",
"ge... | Invokes the main method of the provided class name.
@param args the command line arguments | [
"Invokes",
"the",
"main",
"method",
"of",
"the",
"provided",
"class",
"name",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/splash/src/main/java/org/jbundle/thin/base/screen/splash/Splash.java#L254-L268 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.getFragment | @GwtIncompatible("incompatible method")
private static long getFragment(final Date date, final int fragment, final TimeUnit unit) {
"""
Gets a Date fragment for any unit.
@param date the date to work with, not null
@param fragment the Calendar field part of date to calculate
@param unit the time unit
@re... | java | @GwtIncompatible("incompatible method")
private static long getFragment(final Date date, final int fragment, final TimeUnit unit) {
validateDateNotNull(date);
final Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return getFragment(calendar, fragment, unit);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"private",
"static",
"long",
"getFragment",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"fragment",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"validateDateNotNull",
"(",
"date",
")",
";",
"f... | Gets a Date fragment for any unit.
@param date the date to work with, not null
@param fragment the Calendar field part of date to calculate
@param unit the time unit
@return number of units within the fragment of the date
@throws IllegalArgumentException if the date is <code>null</code> or
fragment is not supported
@s... | [
"Gets",
"a",
"Date",
"fragment",
"for",
"any",
"unit",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1664-L1670 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java | MonitoringAspect.resolveAnnotation | private Monitor resolveAnnotation(final ProceedingJoinPoint pjp) {
"""
Trying to resolve {@link Monitor} annotation first in method annotations scope, then in class scope. Note - method will also check
if {@link Monitor} is Placed to some other annotation as meta!
Search order :
- 1 method;
- 2 type.
@param... | java | private Monitor resolveAnnotation(final ProceedingJoinPoint pjp) {
final Signature signature = pjp.getSignature();
final Class<?> type = signature.getDeclaringType();
final Method method = (signature instanceof MethodSignature) ? MethodSignature.class.cast(signature).getMethod() :
null;
final Monitor method... | [
"private",
"Monitor",
"resolveAnnotation",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
")",
"{",
"final",
"Signature",
"signature",
"=",
"pjp",
".",
"getSignature",
"(",
")",
";",
"final",
"Class",
"<",
"?",
">",
"type",
"=",
"signature",
".",
"getDeclaringTyp... | Trying to resolve {@link Monitor} annotation first in method annotations scope, then in class scope. Note - method will also check
if {@link Monitor} is Placed to some other annotation as meta!
Search order :
- 1 method;
- 2 type.
@param pjp
{@link ProceedingJoinPoint}
@return {@link Monitor} or {@code null} | [
"Trying",
"to",
"resolve",
"{",
"@link",
"Monitor",
"}",
"annotation",
"first",
"in",
"method",
"annotations",
"scope",
"then",
"in",
"class",
"scope",
".",
"Note",
"-",
"method",
"will",
"also",
"check",
"if",
"{",
"@link",
"Monitor",
"}",
"is",
"Placed",... | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java#L98-L107 |
aws/aws-sdk-java | aws-java-sdk-elasticloadbalancingv2/src/main/java/com/amazonaws/services/elasticloadbalancingv2/model/AuthenticateCognitoActionConfig.java | AuthenticateCognitoActionConfig.withAuthenticationRequestExtraParams | public AuthenticateCognitoActionConfig withAuthenticationRequestExtraParams(java.util.Map<String, String> authenticationRequestExtraParams) {
"""
<p>
The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
</p>
@param authenticationRequestExtraParams
The query parame... | java | public AuthenticateCognitoActionConfig withAuthenticationRequestExtraParams(java.util.Map<String, String> authenticationRequestExtraParams) {
setAuthenticationRequestExtraParams(authenticationRequestExtraParams);
return this;
} | [
"public",
"AuthenticateCognitoActionConfig",
"withAuthenticationRequestExtraParams",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"authenticationRequestExtraParams",
")",
"{",
"setAuthenticationRequestExtraParams",
"(",
"authenticationRequestExtraPar... | <p>
The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
</p>
@param authenticationRequestExtraParams
The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
@return Returns a reference to this object so that method calls can be cha... | [
"<p",
">",
"The",
"query",
"parameters",
"(",
"up",
"to",
"10",
")",
"to",
"include",
"in",
"the",
"redirect",
"request",
"to",
"the",
"authorization",
"endpoint",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticloadbalancingv2/src/main/java/com/amazonaws/services/elasticloadbalancingv2/model/AuthenticateCognitoActionConfig.java#L396-L399 |
graphhopper/graphhopper | client-hc/src/main/java/com/graphhopper/api/MatrixResponse.java | MatrixResponse.getDistance | public double getDistance(int from, int to) {
"""
Returns the distance for the specific entry (from -> to) in meter.
"""
if (hasErrors()) {
throw new IllegalStateException("Cannot return distance (" + from + "," + to + ") if errors occured " + getErrors());
}
if (from >=... | java | public double getDistance(int from, int to) {
if (hasErrors()) {
throw new IllegalStateException("Cannot return distance (" + from + "," + to + ") if errors occured " + getErrors());
}
if (from >= distances.length) {
throw new IllegalStateException("Cannot get 'from' " +... | [
"public",
"double",
"getDistance",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"hasErrors",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot return distance (\"",
"+",
"from",
"+",
"\",\"",
"+",
"to",
"+",
"\") if ... | Returns the distance for the specific entry (from -> to) in meter. | [
"Returns",
"the",
"distance",
"for",
"the",
"specific",
"entry",
"(",
"from",
"-",
">",
";",
"to",
")",
"in",
"meter",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/client-hc/src/main/java/com/graphhopper/api/MatrixResponse.java#L117-L128 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/util/concurrent/UnsynchronizedRateLimiter.java | UnsynchronizedRateLimiter.reserveNextTicket | private long reserveNextTicket(double requiredPermits, long nowMicros) {
"""
Reserves next ticket and returns the wait time that the caller must wait for.
<p>The return value is guaranteed to be non-negative.
"""
resync(nowMicros);
long microsToNextFreeTicket = Math.max(0, nextFreeTicketMicros - now... | java | private long reserveNextTicket(double requiredPermits, long nowMicros) {
resync(nowMicros);
long microsToNextFreeTicket = Math.max(0, nextFreeTicketMicros - nowMicros);
double storedPermitsToSpend = Math.min(requiredPermits, this.storedPermits);
double freshPermits = requiredPermits - storedPermitsToSpe... | [
"private",
"long",
"reserveNextTicket",
"(",
"double",
"requiredPermits",
",",
"long",
"nowMicros",
")",
"{",
"resync",
"(",
"nowMicros",
")",
";",
"long",
"microsToNextFreeTicket",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"nextFreeTicketMicros",
"-",
"nowMicros"... | Reserves next ticket and returns the wait time that the caller must wait for.
<p>The return value is guaranteed to be non-negative. | [
"Reserves",
"next",
"ticket",
"and",
"returns",
"the",
"wait",
"time",
"that",
"the",
"caller",
"must",
"wait",
"for",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/UnsynchronizedRateLimiter.java#L502-L514 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupsImpl.java | PersonGroupsImpl.updateWithServiceResponseAsync | public Observable<ServiceResponse<Void>> updateWithServiceResponseAsync(String personGroupId, UpdatePersonGroupsOptionalParameter updateOptionalParameter) {
"""
Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated.
@param personGro... | java | public Observable<ServiceResponse<Void>> updateWithServiceResponseAsync(String personGroupId, UpdatePersonGroupsOptionalParameter updateOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and cannot be null... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Void",
">",
">",
"updateWithServiceResponseAsync",
"(",
"String",
"personGroupId",
",",
"UpdatePersonGroupsOptionalParameter",
"updateOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"azureRegion"... | Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated.
@param personGroupId Id referencing a particular person group.
@param updateOptionalParameter the object representing the optional parameters to be set before calling this API
@throws ... | [
"Update",
"an",
"existing",
"person",
"group",
"s",
"display",
"name",
"and",
"userData",
".",
"The",
"properties",
"which",
"does",
"not",
"appear",
"in",
"request",
"body",
"will",
"not",
"be",
"updated",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupsImpl.java#L465-L476 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | public Toast setTypeface(Toast toast, @StringRes int strResId, int style) {
"""
Set the typeface for the toast view.
@param toast toast.
@param strResId string resource containing typeface name.
@param style the typeface style.
@return toast that the typeface is injected.
"""
return setTypeface(toast, mA... | java | public Toast setTypeface(Toast toast, @StringRes int strResId, int style) {
return setTypeface(toast, mApplication.getString(strResId), style);
} | [
"public",
"Toast",
"setTypeface",
"(",
"Toast",
"toast",
",",
"@",
"StringRes",
"int",
"strResId",
",",
"int",
"style",
")",
"{",
"return",
"setTypeface",
"(",
"toast",
",",
"mApplication",
".",
"getString",
"(",
"strResId",
")",
",",
"style",
")",
";",
... | Set the typeface for the toast view.
@param toast toast.
@param strResId string resource containing typeface name.
@param style the typeface style.
@return toast that the typeface is injected. | [
"Set",
"the",
"typeface",
"for",
"the",
"toast",
"view",
"."
] | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L538-L540 |
Stratio/deep-spark | deep-jdbc/src/main/java/com/stratio/deep/jdbc/extractor/JdbcNativeEntityExtractor.java | JdbcNativeEntityExtractor.transformElement | @Override
protected T transformElement(Map<String, Object> entity) {
"""
Transforms a database row represented as a Map into a Stratio Deep Entity.
@param entity Database row represented as a Map of column_name:column_value.
@return Stratio Deep Entity carrying row data.
"""
try {
ret... | java | @Override
protected T transformElement(Map<String, Object> entity) {
try {
return (T)UtilJdbc.getObjectFromRow(jdbcDeepJobConfig.getEntityClass(), entity, jdbcDeepJobConfig);
} catch(IllegalAccessException | InvocationTargetException | InstantiationException e) {
throw new De... | [
"@",
"Override",
"protected",
"T",
"transformElement",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"entity",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",
"UtilJdbc",
".",
"getObjectFromRow",
"(",
"jdbcDeepJobConfig",
".",
"getEntityClass",
"(",
")",
"... | Transforms a database row represented as a Map into a Stratio Deep Entity.
@param entity Database row represented as a Map of column_name:column_value.
@return Stratio Deep Entity carrying row data. | [
"Transforms",
"a",
"database",
"row",
"represented",
"as",
"a",
"Map",
"into",
"a",
"Stratio",
"Deep",
"Entity",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-jdbc/src/main/java/com/stratio/deep/jdbc/extractor/JdbcNativeEntityExtractor.java#L46-L53 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/evaluation/DefaultXPathEvaluator.java | DefaultXPathEvaluator.asBoolean | @Override
public boolean asBoolean() {
"""
Evaluates the XPath as a boolean value. This method is just a shortcut for as(Boolean.TYPE);
@return true when the selected value equals (ignoring case) 'true'
"""
final Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
return eval... | java | @Override
public boolean asBoolean() {
final Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
return evaluateSingeValue(Boolean.TYPE, callerClass);
} | [
"@",
"Override",
"public",
"boolean",
"asBoolean",
"(",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"callerClass",
"=",
"ReflectionHelper",
".",
"getDirectCallerClass",
"(",
")",
";",
"return",
"evaluateSingeValue",
"(",
"Boolean",
".",
"TYPE",
",",
"callerClas... | Evaluates the XPath as a boolean value. This method is just a shortcut for as(Boolean.TYPE);
@return true when the selected value equals (ignoring case) 'true' | [
"Evaluates",
"the",
"XPath",
"as",
"a",
"boolean",
"value",
".",
"This",
"method",
"is",
"just",
"a",
"shortcut",
"for",
"as",
"(",
"Boolean",
".",
"TYPE",
")",
";"
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/evaluation/DefaultXPathEvaluator.java#L80-L84 |
cternes/openkeepass | src/main/java/de/slackspace/openkeepass/KeePassDatabase.java | KeePassDatabase.openDatabase | public KeePassFile openDatabase(String password) {
"""
Opens a KeePass database with the given password and returns the
KeePassFile for further processing.
<p>
If the database cannot be decrypted with the provided password an
exception will be thrown.
@param password
the password to open the database
@ret... | java | public KeePassFile openDatabase(String password) {
if (password == null) {
throw new IllegalArgumentException(MSG_EMPTY_MASTER_KEY);
}
try {
byte[] passwordBytes = password.getBytes(UTF_8);
byte[] hashedPassword = Sha256.hash(passwordBytes);
... | [
"public",
"KeePassFile",
"openDatabase",
"(",
"String",
"password",
")",
"{",
"if",
"(",
"password",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"MSG_EMPTY_MASTER_KEY",
")",
";",
"}",
"try",
"{",
"byte",
"[",
"]",
"passwordBytes",
... | Opens a KeePass database with the given password and returns the
KeePassFile for further processing.
<p>
If the database cannot be decrypted with the provided password an
exception will be thrown.
@param password
the password to open the database
@return a KeePassFile
@see KeePassFile | [
"Opens",
"a",
"KeePass",
"database",
"with",
"the",
"given",
"password",
"and",
"returns",
"the",
"KeePassFile",
"for",
"further",
"processing",
".",
"<p",
">",
"If",
"the",
"database",
"cannot",
"be",
"decrypted",
"with",
"the",
"provided",
"password",
"an",
... | train | https://github.com/cternes/openkeepass/blob/4a354aecaea38af3c0dce5eb81b533f297e8d94f/src/main/java/de/slackspace/openkeepass/KeePassDatabase.java#L156-L169 |
eclipse/hawkbit | hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpControllerAuthentication.java | AmqpControllerAuthentication.doAuthenticate | public Authentication doAuthenticate(final DmfTenantSecurityToken securityToken) {
"""
Performs authentication with the security token.
@param securityToken
the authentication request object
@return the authentication object
"""
resolveTenant(securityToken);
PreAuthenticatedAuthenticationT... | java | public Authentication doAuthenticate(final DmfTenantSecurityToken securityToken) {
resolveTenant(securityToken);
PreAuthenticatedAuthenticationToken authentication = new PreAuthenticatedAuthenticationToken(null, null);
for (final PreAuthenticationFilter filter : filterChain) {
final ... | [
"public",
"Authentication",
"doAuthenticate",
"(",
"final",
"DmfTenantSecurityToken",
"securityToken",
")",
"{",
"resolveTenant",
"(",
"securityToken",
")",
";",
"PreAuthenticatedAuthenticationToken",
"authentication",
"=",
"new",
"PreAuthenticatedAuthenticationToken",
"(",
"... | Performs authentication with the security token.
@param securityToken
the authentication request object
@return the authentication object | [
"Performs",
"authentication",
"with",
"the",
"security",
"token",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpControllerAuthentication.java#L124-L137 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.JensenShannonDivergence | public static double JensenShannonDivergence(double[] x, double[] y) {
"""
Jensen-Shannon divergence JS(P||Q) = (KL(P||M) + KL(Q||M)) / 2, where
M = (P+Q)/2. The Jensen-Shannon divergence is a popular
method of measuring the similarity between two probability distributions.
It is also known as information radiu... | java | public static double JensenShannonDivergence(double[] x, double[] y) {
double[] m = new double[x.length];
for (int i = 0; i < m.length; i++) {
m[i] = (x[i] + y[i]) / 2;
}
return (KullbackLeiblerDivergence(x, m) + KullbackLeiblerDivergence(y, m)) / 2;
} | [
"public",
"static",
"double",
"JensenShannonDivergence",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"double",
"[",
"]",
"m",
"=",
"new",
"double",
"[",
"x",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Jensen-Shannon divergence JS(P||Q) = (KL(P||M) + KL(Q||M)) / 2, where
M = (P+Q)/2. The Jensen-Shannon divergence is a popular
method of measuring the similarity between two probability distributions.
It is also known as information radius or total divergence to the average.
It is based on the Kullback-Leibler divergenc... | [
"Jensen",
"-",
"Shannon",
"divergence",
"JS",
"(",
"P||Q",
")",
"=",
"(",
"KL",
"(",
"P||M",
")",
"+",
"KL",
"(",
"Q||M",
"))",
"/",
"2",
"where",
"M",
"=",
"(",
"P",
"+",
"Q",
")",
"/",
"2",
".",
"The",
"Jensen",
"-",
"Shannon",
"divergence",
... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L2395-L2402 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/MarkedElement.java | MarkedElement.markupBond | public static MarkedElement markupBond(IRenderingElement elem, IBond bond) {
"""
Markup a bond with the class 'bond' and optionally the ids/classes
from it's properties.
@param elem rendering element
@param bond bond
@return the marked element
"""
assert elem != null;
MarkedElement tagEle... | java | public static MarkedElement markupBond(IRenderingElement elem, IBond bond) {
assert elem != null;
MarkedElement tagElem = markupChemObj(elem, bond);
tagElem.aggClass("bond");
return tagElem;
} | [
"public",
"static",
"MarkedElement",
"markupBond",
"(",
"IRenderingElement",
"elem",
",",
"IBond",
"bond",
")",
"{",
"assert",
"elem",
"!=",
"null",
";",
"MarkedElement",
"tagElem",
"=",
"markupChemObj",
"(",
"elem",
",",
"bond",
")",
";",
"tagElem",
".",
"a... | Markup a bond with the class 'bond' and optionally the ids/classes
from it's properties.
@param elem rendering element
@param bond bond
@return the marked element | [
"Markup",
"a",
"bond",
"with",
"the",
"class",
"bond",
"and",
"optionally",
"the",
"ids",
"/",
"classes",
"from",
"it",
"s",
"properties",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/MarkedElement.java#L182-L187 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.create_child_account | public String create_child_account(Object data) {
"""
/*
Create Child Account.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} child_email: Email address of Reseller child [Mandatory]
@options data {String} password: Password of Reseller child to login [Manda... | java | public String create_child_account(Object data) {
Gson gson = new Gson();
String json = gson.toJson(data);
return post("account", json);
} | [
"public",
"String",
"create_child_account",
"(",
"Object",
"data",
")",
"{",
"Gson",
"gson",
"=",
"new",
"Gson",
"(",
")",
";",
"String",
"json",
"=",
"gson",
".",
"toJson",
"(",
"data",
")",
";",
"return",
"post",
"(",
"\"account\"",
",",
"json",
")",... | /*
Create Child Account.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} child_email: Email address of Reseller child [Mandatory]
@options data {String} password: Password of Reseller child to login [Mandatory]
@options data {String} company_org: Name of Reseller chil... | [
"/",
"*",
"Create",
"Child",
"Account",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L195-L199 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.pages_getInfo | public T pages_getInfo(Integer userId, EnumSet<PageProfileField> fields)
throws FacebookException, IOException {
"""
Retrieves the requested profile fields for the Facebook Pages of the user with the given
<code>userId</code>.
@param userId the ID of a user about whose pages to fetch info (defaulted to the l... | java | public T pages_getInfo(Integer userId, EnumSet<PageProfileField> fields)
throws FacebookException, IOException {
if (fields == null || fields.isEmpty()) {
throw new IllegalArgumentException("fields cannot be empty or null");
}
if (userId == null) {
userId = this._userId;
}
return thi... | [
"public",
"T",
"pages_getInfo",
"(",
"Integer",
"userId",
",",
"EnumSet",
"<",
"PageProfileField",
">",
"fields",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"if",
"(",
"fields",
"==",
"null",
"||",
"fields",
".",
"isEmpty",
"(",
")",
")",
... | Retrieves the requested profile fields for the Facebook Pages of the user with the given
<code>userId</code>.
@param userId the ID of a user about whose pages to fetch info (defaulted to the logged-in user)
@param fields a set of PageProfileFields
@return a T consisting of a list of pages, with each page element
contai... | [
"Retrieves",
"the",
"requested",
"profile",
"fields",
"for",
"the",
"Facebook",
"Pages",
"of",
"the",
"user",
"with",
"the",
"given",
"<code",
">",
"userId<",
"/",
"code",
">",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L2129-L2140 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/Sysprop.java | Sysprop.addProperty | @JsonAnySetter
public Sysprop addProperty(String name, Object value) {
"""
Adds a new key/value pair to the map.
@param name a key
@param value a value
@return this
"""
if (!StringUtils.isBlank(name) && value != null) {
getProperties().put(name, value);
}
return this;
} | java | @JsonAnySetter
public Sysprop addProperty(String name, Object value) {
if (!StringUtils.isBlank(name) && value != null) {
getProperties().put(name, value);
}
return this;
} | [
"@",
"JsonAnySetter",
"public",
"Sysprop",
"addProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isBlank",
"(",
"name",
")",
"&&",
"value",
"!=",
"null",
")",
"{",
"getProperties",
"(",
")",
".",
"... | Adds a new key/value pair to the map.
@param name a key
@param value a value
@return this | [
"Adds",
"a",
"new",
"key",
"/",
"value",
"pair",
"to",
"the",
"map",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/Sysprop.java#L83-L89 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.enumTemplate | @Deprecated
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl,
String template, ImmutableList<?> args) {
"""
Create a new Template expression
@deprecated Use {@link #enumTemplate(Class, String, List)} ins... | java | @Deprecated
public static <T extends Enum<T>> EnumTemplate<T> enumTemplate(Class<? extends T> cl,
String template, ImmutableList<?> args) {
return enumTemplate(cl, createTemplate(template), args);
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"EnumTemplate",
"<",
"T",
">",
"enumTemplate",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"cl",
",",
"String",
"template",
",",
"ImmutableList",
"<",
"?",
">",
... | Create a new Template expression
@deprecated Use {@link #enumTemplate(Class, String, List)} instead.
@param cl type of expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L740-L744 |
netty/netty | transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java | ServerBootstrap.childAttr | public <T> ServerBootstrap childAttr(AttributeKey<T> childKey, T value) {
"""
Set the specific {@link AttributeKey} with the given value on every child {@link Channel}. If the value is
{@code null} the {@link AttributeKey} is removed
"""
if (childKey == null) {
throw new NullPointerExcepti... | java | public <T> ServerBootstrap childAttr(AttributeKey<T> childKey, T value) {
if (childKey == null) {
throw new NullPointerException("childKey");
}
if (value == null) {
childAttrs.remove(childKey);
} else {
childAttrs.put(childKey, value);
}
... | [
"public",
"<",
"T",
">",
"ServerBootstrap",
"childAttr",
"(",
"AttributeKey",
"<",
"T",
">",
"childKey",
",",
"T",
"value",
")",
"{",
"if",
"(",
"childKey",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"childKey\"",
")",
";",
"}... | Set the specific {@link AttributeKey} with the given value on every child {@link Channel}. If the value is
{@code null} the {@link AttributeKey} is removed | [
"Set",
"the",
"specific",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java#L117-L127 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Pair.java | Pair.compareTo | @SuppressWarnings("unchecked")
public int compareTo(Pair<T1,T2> another) {
"""
Compares this <code>Pair</code> to another object.
If the object is a <code>Pair</code>, this function will work providing
the elements of the <code>Pair</code> are themselves comparable.
It will then return a value based on the p... | java | @SuppressWarnings("unchecked")
public int compareTo(Pair<T1,T2> another) {
int comp = ((Comparable<T1>) first()).compareTo(another.first());
if (comp != 0) {
return comp;
} else {
return ((Comparable<T2>) second()).compareTo(another.second());
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"int",
"compareTo",
"(",
"Pair",
"<",
"T1",
",",
"T2",
">",
"another",
")",
"{",
"int",
"comp",
"=",
"(",
"(",
"Comparable",
"<",
"T1",
">",
")",
"first",
"(",
")",
")",
".",
"compareTo",
... | Compares this <code>Pair</code> to another object.
If the object is a <code>Pair</code>, this function will work providing
the elements of the <code>Pair</code> are themselves comparable.
It will then return a value based on the pair of objects, where
<code>p > q iff p.first() > q.first() ||
(p.first().equals(q.f... | [
"Compares",
"this",
"<code",
">",
"Pair<",
"/",
"code",
">",
"to",
"another",
"object",
".",
"If",
"the",
"object",
"is",
"a",
"<code",
">",
"Pair<",
"/",
"code",
">",
"this",
"function",
"will",
"work",
"providing",
"the",
"elements",
"of",
"the",
"<c... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Pair.java#L158-L166 |
Javen205/IJPay | src/main/java/com/jpay/ext/kit/ZxingKit.java | ZxingKit.encode | public static boolean encode(String contents, BarcodeFormat barcodeFormat, Integer margin,
ErrorCorrectionLevel errorLevel, String format, int width, int height, String saveImgFilePath) {
"""
Zxing图形码生成工具
@param contents
内容
@param barcodeFormat
BarcodeFormat对象
@param format
图片格式,可选[png,jpg,bmp]
@param ... | java | public static boolean encode(String contents, BarcodeFormat barcodeFormat, Integer margin,
ErrorCorrectionLevel errorLevel, String format, int width, int height, String saveImgFilePath) {
Boolean bool = false;
BufferedImage bufImg;
Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>();
//... | [
"public",
"static",
"boolean",
"encode",
"(",
"String",
"contents",
",",
"BarcodeFormat",
"barcodeFormat",
",",
"Integer",
"margin",
",",
"ErrorCorrectionLevel",
"errorLevel",
",",
"String",
"format",
",",
"int",
"width",
",",
"int",
"height",
",",
"String",
"sa... | Zxing图形码生成工具
@param contents
内容
@param barcodeFormat
BarcodeFormat对象
@param format
图片格式,可选[png,jpg,bmp]
@param width
宽
@param height
高
@param margin
边框间距px
@param saveImgFilePath
存储图片的完整位置,包含文件名
@return {boolean} | [
"Zxing图形码生成工具"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/ext/kit/ZxingKit.java#L52-L71 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/data/model/CorrelationAnalysisSolution.java | CorrelationAnalysisSolution.squaredDistance | public double squaredDistance(V p) {
"""
Returns the distance of NumberVector p from the hyperplane underlying this
solution.
@param p a vector in the space underlying this solution
@return the distance of p from the hyperplane underlying this solution
"""
// V_affin = V + a
// dist(p, V_affin) = ... | java | public double squaredDistance(V p) {
// V_affin = V + a
// dist(p, V_affin) = d(p-a, V) = ||p - a - proj_V(p-a) ||
double[] p_minus_a = minusEquals(p.toArray(), centroid);
return squareSum(minusEquals(p_minus_a, times(strongEigenvectors, transposeTimes(strongEigenvectors, p_minus_a))));
} | [
"public",
"double",
"squaredDistance",
"(",
"V",
"p",
")",
"{",
"// V_affin = V + a",
"// dist(p, V_affin) = d(p-a, V) = ||p - a - proj_V(p-a) ||",
"double",
"[",
"]",
"p_minus_a",
"=",
"minusEquals",
"(",
"p",
".",
"toArray",
"(",
")",
",",
"centroid",
")",
";",
... | Returns the distance of NumberVector p from the hyperplane underlying this
solution.
@param p a vector in the space underlying this solution
@return the distance of p from the hyperplane underlying this solution | [
"Returns",
"the",
"distance",
"of",
"NumberVector",
"p",
"from",
"the",
"hyperplane",
"underlying",
"this",
"solution",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/data/model/CorrelationAnalysisSolution.java#L190-L195 |
xerial/snappy-java | src/main/java/org/xerial/snappy/SnappyInputStream.java | SnappyInputStream.readNext | private int readNext(byte[] dest, int offset, int len)
throws IOException {
"""
Read next len bytes
@param dest
@param offset
@param len
@return read bytes
"""
int readBytes = 0;
while (readBytes < len) {
int ret = in.read(dest, readBytes + offset, len - readBytes)... | java | private int readNext(byte[] dest, int offset, int len)
throws IOException
{
int readBytes = 0;
while (readBytes < len) {
int ret = in.read(dest, readBytes + offset, len - readBytes);
if (ret == -1) {
finishedReading = true;
return r... | [
"private",
"int",
"readNext",
"(",
"byte",
"[",
"]",
"dest",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"readBytes",
"=",
"0",
";",
"while",
"(",
"readBytes",
"<",
"len",
")",
"{",
"int",
"ret",
"=",
"in",
".... | Read next len bytes
@param dest
@param offset
@param len
@return read bytes | [
"Read",
"next",
"len",
"bytes"
] | train | https://github.com/xerial/snappy-java/blob/9df6ed7bbce88186c82f2e7cdcb7b974421b3340/src/main/java/org/xerial/snappy/SnappyInputStream.java#L373-L386 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java | ConcurrentLinkedHashMap.afterRead | void afterRead(Node<K, V> node) {
"""
Performs the post-processing work required after a read.
@param node the entry in the page replacement policy
"""
final int bufferIndex = readBufferIndex();
final long writeCount = recordRead(bufferIndex, node);
drainOnReadIfNeeded(bufferIndex, w... | java | void afterRead(Node<K, V> node) {
final int bufferIndex = readBufferIndex();
final long writeCount = recordRead(bufferIndex, node);
drainOnReadIfNeeded(bufferIndex, writeCount);
notifyListener();
} | [
"void",
"afterRead",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"node",
")",
"{",
"final",
"int",
"bufferIndex",
"=",
"readBufferIndex",
"(",
")",
";",
"final",
"long",
"writeCount",
"=",
"recordRead",
"(",
"bufferIndex",
",",
"node",
")",
";",
"drainOnReadIf... | Performs the post-processing work required after a read.
@param node the entry in the page replacement policy | [
"Performs",
"the",
"post",
"-",
"processing",
"work",
"required",
"after",
"a",
"read",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/clhm/ConcurrentLinkedHashMap.java#L339-L344 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.Struct | public JBBPDslBuilder Struct(final String name) {
"""
Create new named struct.
@param name name of structure, it can be null for anonymous one
@return the builder instance, must not be null
"""
final Item item = new Item(BinType.STRUCT, name, this.byteOrder);
this.addItem(item);
this.openedStru... | java | public JBBPDslBuilder Struct(final String name) {
final Item item = new Item(BinType.STRUCT, name, this.byteOrder);
this.addItem(item);
this.openedStructCounter++;
return this;
} | [
"public",
"JBBPDslBuilder",
"Struct",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"STRUCT",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
";",
"this",
".",
"addItem",
"(",
"item",
")",
... | Create new named struct.
@param name name of structure, it can be null for anonymous one
@return the builder instance, must not be null | [
"Create",
"new",
"named",
"struct",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L332-L337 |
javagl/ND | nd-arrays/src/main/java/de/javagl/nd/arrays/Utils.java | Utils.countDifferences | public static int countDifferences(IntTuple t0, IntTuple t1) {
"""
Returns the number of entries of the given tuples that are
different
@param t0 The first tuple
@param t1 The second tuple
@return The number of differences
@throws NullPointerException If any of the arguments is <code>null</code>
@throws Il... | java | public static int countDifferences(IntTuple t0, IntTuple t1)
{
if (t0.getSize() != t1.getSize())
{
throw new IllegalArgumentException(
"Sizes do not match: "+t0.getSize()+
" and "+t1.getSize());
}
int n = t0.getSize();
int ... | [
"public",
"static",
"int",
"countDifferences",
"(",
"IntTuple",
"t0",
",",
"IntTuple",
"t1",
")",
"{",
"if",
"(",
"t0",
".",
"getSize",
"(",
")",
"!=",
"t1",
".",
"getSize",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Sizes do... | Returns the number of entries of the given tuples that are
different
@param t0 The first tuple
@param t1 The second tuple
@return The number of differences
@throws NullPointerException If any of the arguments is <code>null</code>
@throws IllegalArgumentException If the given tuples do not have
the same {@link IntTuple... | [
"Returns",
"the",
"number",
"of",
"entries",
"of",
"the",
"given",
"tuples",
"that",
"are",
"different"
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-arrays/src/main/java/de/javagl/nd/arrays/Utils.java#L160-L178 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.beginCreateOrUpdateAsync | public Observable<SignalRResourceInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) {
"""
Create a new SignalR service and update an exiting SignalR service.
@param resourceGroupName The name of the resource group that contains the resource. You ca... | java | public Observable<SignalRResourceInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResour... | [
"public",
"Observable",
"<",
"SignalRResourceInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"SignalRCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"reso... | Create a new SignalR service and update an exiting SignalR service.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param resourceName The name of the SignalR resource.
@param parameters Parameters for the... | [
"Create",
"a",
"new",
"SignalR",
"service",
"and",
"update",
"an",
"exiting",
"SignalR",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L1235-L1242 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/FleetsApi.java | FleetsApi.deleteFleetsFleetIdWingsWingId | public void deleteFleetsFleetIdWingsWingId(Long fleetId, Long wingId, String datasource, String token)
throws ApiException {
"""
Delete fleet wing Delete a fleet wing, only empty wings can be deleted.
The wing may contain squads, but the squads must be empty --- SSO Scope:
esi-fleets.write_fleet.v1
... | java | public void deleteFleetsFleetIdWingsWingId(Long fleetId, Long wingId, String datasource, String token)
throws ApiException {
deleteFleetsFleetIdWingsWingIdWithHttpInfo(fleetId, wingId, datasource, token);
} | [
"public",
"void",
"deleteFleetsFleetIdWingsWingId",
"(",
"Long",
"fleetId",
",",
"Long",
"wingId",
",",
"String",
"datasource",
",",
"String",
"token",
")",
"throws",
"ApiException",
"{",
"deleteFleetsFleetIdWingsWingIdWithHttpInfo",
"(",
"fleetId",
",",
"wingId",
","... | Delete fleet wing Delete a fleet wing, only empty wings can be deleted.
The wing may contain squads, but the squads must be empty --- SSO Scope:
esi-fleets.write_fleet.v1
@param fleetId
ID for a fleet (required)
@param wingId
The wing to delete (required)
@param datasource
The server name you would like data from (opt... | [
"Delete",
"fleet",
"wing",
"Delete",
"a",
"fleet",
"wing",
"only",
"empty",
"wings",
"can",
"be",
"deleted",
".",
"The",
"wing",
"may",
"contain",
"squads",
"but",
"the",
"squads",
"must",
"be",
"empty",
"---",
"SSO",
"Scope",
":",
"esi",
"-",
"fleets",
... | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/FleetsApi.java#L473-L476 |
google/closure-compiler | src/com/google/javascript/jscomp/PureFunctionIdentifier.java | PureFunctionIdentifier.populateFunctionDefinitions | private void populateFunctionDefinitions(String name, List<Node> references) {
"""
For a name and its set of references, record the set of functions that may define that name or
blacklist the name if there are unclear definitions.
@param name A variable or property name,
@param references The set of all nodes... | java | private void populateFunctionDefinitions(String name, List<Node> references) {
AmbiguatedFunctionSummary summaryForName = checkNotNull(summariesByName.get(name));
// Make sure we get absolutely every R-value assigned to `name` or at the very least detect
// there are some we're missing. Overlooking a singl... | [
"private",
"void",
"populateFunctionDefinitions",
"(",
"String",
"name",
",",
"List",
"<",
"Node",
">",
"references",
")",
"{",
"AmbiguatedFunctionSummary",
"summaryForName",
"=",
"checkNotNull",
"(",
"summariesByName",
".",
"get",
"(",
"name",
")",
")",
";",
"/... | For a name and its set of references, record the set of functions that may define that name or
blacklist the name if there are unclear definitions.
@param name A variable or property name,
@param references The set of all nodes representing R- and L-value references to {@code name}. | [
"For",
"a",
"name",
"and",
"its",
"set",
"of",
"references",
"record",
"the",
"set",
"of",
"functions",
"that",
"may",
"define",
"that",
"name",
"or",
"blacklist",
"the",
"name",
"if",
"there",
"are",
"unclear",
"definitions",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PureFunctionIdentifier.java#L417-L460 |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/ScalarizationUtils.java | ScalarizationUtils.weightedChebyshev | public static <S extends Solution<?>> void weightedChebyshev(List<S> solutionsList, double[] weights) {
"""
Chebyhsev function with weighted objectives.
@param solutionsList A list of solutions.
@param weights Constants by which ideal values and objective values are
multiplied.
"""
weightedCheb... | java | public static <S extends Solution<?>> void weightedChebyshev(List<S> solutionsList, double[] weights) {
weightedChebyshev(solutionsList, getIdealValues(solutionsList), weights);
} | [
"public",
"static",
"<",
"S",
"extends",
"Solution",
"<",
"?",
">",
">",
"void",
"weightedChebyshev",
"(",
"List",
"<",
"S",
">",
"solutionsList",
",",
"double",
"[",
"]",
"weights",
")",
"{",
"weightedChebyshev",
"(",
"solutionsList",
",",
"getIdealValues",... | Chebyhsev function with weighted objectives.
@param solutionsList A list of solutions.
@param weights Constants by which ideal values and objective values are
multiplied. | [
"Chebyhsev",
"function",
"with",
"weighted",
"objectives",
"."
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/ScalarizationUtils.java#L188-L190 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/EndpointActivationService.java | EndpointActivationService.deactivateEndpoint | public void deactivateEndpoint(Object activationSpec, WSMessageEndpointFactory messageEndpointFactory) throws ResourceException {
"""
Deactivate the endpoint corresponding to the specified activation spec instance.
@param activationSpec the activation spec instance.
@param messageEndpointFactory the message en... | java | public void deactivateEndpoint(Object activationSpec, WSMessageEndpointFactory messageEndpointFactory) throws ResourceException {
try {
if (activationSpec instanceof ActivationSpec) {
if (endpointActivationParams.remove(new ActivationParams(activationSpec, messageEndpointFactory)))
... | [
"public",
"void",
"deactivateEndpoint",
"(",
"Object",
"activationSpec",
",",
"WSMessageEndpointFactory",
"messageEndpointFactory",
")",
"throws",
"ResourceException",
"{",
"try",
"{",
"if",
"(",
"activationSpec",
"instanceof",
"ActivationSpec",
")",
"{",
"if",
"(",
"... | Deactivate the endpoint corresponding to the specified activation spec instance.
@param activationSpec the activation spec instance.
@param messageEndpointFactory the message endpoint factory.
@throws ResourceException | [
"Deactivate",
"the",
"endpoint",
"corresponding",
"to",
"the",
"specified",
"activation",
"spec",
"instance",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/EndpointActivationService.java#L626-L641 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMath.java | FastMath.cosQ | private static double cosQ(double xa, double xb) {
"""
Compute cosine in the first quadrant by subtracting input from PI/2 and
then calling sinQ. This is more accurate as the input approaches PI/2.
@param xa number from which cosine is requested
@param xb extra bits for x (may be 0.0)
@return cos(xa + xb)
... | java | private static double cosQ(double xa, double xb) {
final double pi2a = 1.5707963267948966;
final double pi2b = 6.123233995736766E-17;
final double a = pi2a - xa;
double b = -(a - pi2a + xa);
b += pi2b - xb;
return sinQ(a, b);
} | [
"private",
"static",
"double",
"cosQ",
"(",
"double",
"xa",
",",
"double",
"xb",
")",
"{",
"final",
"double",
"pi2a",
"=",
"1.5707963267948966",
";",
"final",
"double",
"pi2b",
"=",
"6.123233995736766E-17",
";",
"final",
"double",
"a",
"=",
"pi2a",
"-",
"x... | Compute cosine in the first quadrant by subtracting input from PI/2 and
then calling sinQ. This is more accurate as the input approaches PI/2.
@param xa number from which cosine is requested
@param xb extra bits for x (may be 0.0)
@return cos(xa + xb) | [
"Compute",
"cosine",
"in",
"the",
"first",
"quadrant",
"by",
"subtracting",
"input",
"from",
"PI",
"/",
"2",
"and",
"then",
"calling",
"sinQ",
".",
"This",
"is",
"more",
"accurate",
"as",
"the",
"input",
"approaches",
"PI",
"/",
"2",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMath.java#L1880-L1889 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/JCellTextField.java | JCellTextField.init | public void init(int iMaxLength, boolean bAlignRight) {
"""
Creates new JCellButton.
@param iMaxLength The number of columns of text in this field.
@param bAlignRight If true, align the text to the right.
"""
this.setColumns(iMaxLength);
this.setBorder(null);
if (bAlignRight)
... | java | public void init(int iMaxLength, boolean bAlignRight)
{
this.setColumns(iMaxLength);
this.setBorder(null);
if (bAlignRight)
this.setHorizontalAlignment(JTextField.RIGHT);
} | [
"public",
"void",
"init",
"(",
"int",
"iMaxLength",
",",
"boolean",
"bAlignRight",
")",
"{",
"this",
".",
"setColumns",
"(",
"iMaxLength",
")",
";",
"this",
".",
"setBorder",
"(",
"null",
")",
";",
"if",
"(",
"bAlignRight",
")",
"this",
".",
"setHorizont... | Creates new JCellButton.
@param iMaxLength The number of columns of text in this field.
@param bAlignRight If true, align the text to the right. | [
"Creates",
"new",
"JCellButton",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/JCellTextField.java#L71-L77 |
dmfs/http-client-interfaces | src/org/dmfs/httpclientinterfaces/HttpStatus.java | HttpStatus.fromStatusCode | public static HttpStatus fromStatusCode(final int statusCode) {
"""
Returns the {@link HttpStatus} having the given status code.
@param statusCode
An HTTP status code integer.
@return The {@link HttpStatus} having the given status code.
"""
if (statusCode < 100 || statusCode > 999)
{
throw new Ille... | java | public static HttpStatus fromStatusCode(final int statusCode)
{
if (statusCode < 100 || statusCode > 999)
{
throw new IllegalArgumentException("Illegal status code " + statusCode);
}
HttpStatus result = STATUS_CODES.get(statusCode);
if (result == null)
{
return new HttpStatus(statusCode, "Unknown");... | [
"public",
"static",
"HttpStatus",
"fromStatusCode",
"(",
"final",
"int",
"statusCode",
")",
"{",
"if",
"(",
"statusCode",
"<",
"100",
"||",
"statusCode",
">",
"999",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Illegal status code \"",
"+",
"sta... | Returns the {@link HttpStatus} having the given status code.
@param statusCode
An HTTP status code integer.
@return The {@link HttpStatus} having the given status code. | [
"Returns",
"the",
"{",
"@link",
"HttpStatus",
"}",
"having",
"the",
"given",
"status",
"code",
"."
] | train | https://github.com/dmfs/http-client-interfaces/blob/10896c71270ccaf32ac4ed5d706dfa0001fd3862/src/org/dmfs/httpclientinterfaces/HttpStatus.java#L405-L418 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getExplicitListAsync | public Observable<List<ExplicitListItem>> getExplicitListAsync(UUID appId, String versionId, UUID entityId) {
"""
Get the explicit list of the pattern.any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity id.
@throws IllegalArgumentException thro... | java | public Observable<List<ExplicitListItem>> getExplicitListAsync(UUID appId, String versionId, UUID entityId) {
return getExplicitListWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<List<ExplicitListItem>>, List<ExplicitListItem>>() {
@Override
public Lis... | [
"public",
"Observable",
"<",
"List",
"<",
"ExplicitListItem",
">",
">",
"getExplicitListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"getExplicitListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
... | Get the explicit list of the pattern.any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<ExplicitListItem> object | [
"Get",
"the",
"explicit",
"list",
"of",
"the",
"pattern",
".",
"any",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L9926-L9933 |
Whiley/WhileyCompiler | src/main/java/wyil/io/WyilFilePrinter.java | WyilFilePrinter.visitBracketedExpression | public void visitBracketedExpression(Expr expr, Integer indent) {
"""
Write a bracketed operand if necessary. Any operand whose human-readable
representation can contain whitespace must have brackets around it.
@param operand
@param enclosing
@param out
"""
boolean needsBrackets = needsBrackets(expr);
... | java | public void visitBracketedExpression(Expr expr, Integer indent) {
boolean needsBrackets = needsBrackets(expr);
if (needsBrackets) {
out.print("(");
}
visitExpression(expr, indent);
if (needsBrackets) {
out.print(")");
}
} | [
"public",
"void",
"visitBracketedExpression",
"(",
"Expr",
"expr",
",",
"Integer",
"indent",
")",
"{",
"boolean",
"needsBrackets",
"=",
"needsBrackets",
"(",
"expr",
")",
";",
"if",
"(",
"needsBrackets",
")",
"{",
"out",
".",
"print",
"(",
"\"(\"",
")",
";... | Write a bracketed operand if necessary. Any operand whose human-readable
representation can contain whitespace must have brackets around it.
@param operand
@param enclosing
@param out | [
"Write",
"a",
"bracketed",
"operand",
"if",
"necessary",
".",
"Any",
"operand",
"whose",
"human",
"-",
"readable",
"representation",
"can",
"contain",
"whitespace",
"must",
"have",
"brackets",
"around",
"it",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/io/WyilFilePrinter.java#L397-L406 |
sagiegurari/fax4j | src/main/java/org/fax4j/bridge/email/DefaultMailMessageParser.java | DefaultMailMessageParser.updateFaxJobFromInputDataImpl | @Override
protected void updateFaxJobFromInputDataImpl(Message inputData,FaxJob faxJob) {
"""
This function update the fax job from the request data.<br>
This fax job will not have any file data.
@param inputData
The input data
@param faxJob
The fax job to update
"""
String targetAddress... | java | @Override
protected void updateFaxJobFromInputDataImpl(Message inputData,FaxJob faxJob)
{
String targetAddress=null;
String senderEmail=null;
try
{
//get target address
targetAddress=this.getTargetAddress(inputData);
//get sender e... | [
"@",
"Override",
"protected",
"void",
"updateFaxJobFromInputDataImpl",
"(",
"Message",
"inputData",
",",
"FaxJob",
"faxJob",
")",
"{",
"String",
"targetAddress",
"=",
"null",
";",
"String",
"senderEmail",
"=",
"null",
";",
"try",
"{",
"//get target address",
"targ... | This function update the fax job from the request data.<br>
This fax job will not have any file data.
@param inputData
The input data
@param faxJob
The fax job to update | [
"This",
"function",
"update",
"the",
"fax",
"job",
"from",
"the",
"request",
"data",
".",
"<br",
">",
"This",
"fax",
"job",
"will",
"not",
"have",
"any",
"file",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/email/DefaultMailMessageParser.java#L91-L112 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java | WalkingIterator.setRoot | public void setRoot(int context, Object environment) {
"""
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
"""
super.setRoot(context, environment);
if(null != m_firstWalker)
{
m_firstWalker.setR... | java | public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
if(null != m_firstWalker)
{
m_firstWalker.setRoot(context);
m_lastUsedWalker = m_firstWalker;
}
} | [
"public",
"void",
"setRoot",
"(",
"int",
"context",
",",
"Object",
"environment",
")",
"{",
"super",
".",
"setRoot",
"(",
"context",
",",
"environment",
")",
";",
"if",
"(",
"null",
"!=",
"m_firstWalker",
")",
"{",
"m_firstWalker",
".",
"setRoot",
"(",
"... | Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation. | [
"Initialize",
"the",
"context",
"values",
"for",
"this",
"expression",
"after",
"it",
"is",
"cloned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java#L150-L160 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/MyBatisUtils.java | MyBatisUtils.myBatisAutoGenerator | public static void myBatisAutoGenerator(String configFilePath, boolean overwrite, List<String> warnings)
throws Exception {
"""
此方法用于Mybatis的逆向工程
@param configFilePath 逆向工程的配置文件路径
@param overwrite 若自动生成的文件在配置文件中配置的路径下有同名文件是否重写
@param warnings 逆向工程执行期间产生的警告信息,存入此参数中
@throws Exception
... | java | public static void myBatisAutoGenerator(String configFilePath, boolean overwrite, List<String> warnings)
throws Exception {
File configFile =
new File(configFilePath);
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConfigura... | [
"public",
"static",
"void",
"myBatisAutoGenerator",
"(",
"String",
"configFilePath",
",",
"boolean",
"overwrite",
",",
"List",
"<",
"String",
">",
"warnings",
")",
"throws",
"Exception",
"{",
"File",
"configFile",
"=",
"new",
"File",
"(",
"configFilePath",
")",
... | 此方法用于Mybatis的逆向工程
@param configFilePath 逆向工程的配置文件路径
@param overwrite 若自动生成的文件在配置文件中配置的路径下有同名文件是否重写
@param warnings 逆向工程执行期间产生的警告信息,存入此参数中
@throws Exception | [
"此方法用于Mybatis的逆向工程"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/MyBatisUtils.java#L90-L99 |
beangle/beangle3 | commons/web/src/main/java/org/beangle/commons/web/util/CookieUtils.java | CookieUtils.deleteCookie | public static void deleteCookie(HttpServletResponse response, Cookie cookie, String path) {
"""
Convenience method for deleting a cookie by name
@param response
the current web response
@param cookie
the cookie to delete
@param path
the path on which the cookie was set (i.e. /appfuse)
"""
if (cooki... | java | public static void deleteCookie(HttpServletResponse response, Cookie cookie, String path) {
if (cookie != null) {
// Delete the cookie by setting its maximum age to zero
cookie.setMaxAge(0);
cookie.setPath(path);
response.addCookie(cookie);
}
} | [
"public",
"static",
"void",
"deleteCookie",
"(",
"HttpServletResponse",
"response",
",",
"Cookie",
"cookie",
",",
"String",
"path",
")",
"{",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"// Delete the cookie by setting its maximum age to zero",
"cookie",
".",
"setM... | Convenience method for deleting a cookie by name
@param response
the current web response
@param cookie
the cookie to delete
@param path
the path on which the cookie was set (i.e. /appfuse) | [
"Convenience",
"method",
"for",
"deleting",
"a",
"cookie",
"by",
"name"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/web/src/main/java/org/beangle/commons/web/util/CookieUtils.java#L156-L163 |
iipc/webarchive-commons | src/main/java/org/archive/url/LaxURI.java | LaxURI.parseAuthority | protected void parseAuthority(String original, boolean escaped)
throws URIException {
"""
Coalesce the _host and _authority fields where
possible.
In the web crawl/http domain, most URIs have an
identical _host and _authority. (There is no port
or user info.) However, the superclass always
creat... | java | protected void parseAuthority(String original, boolean escaped)
throws URIException {
super.parseAuthority(original, escaped);
if (_host != null && _authority != null
&& _host.length == _authority.length) {
_host = _authority;
}
} | [
"protected",
"void",
"parseAuthority",
"(",
"String",
"original",
",",
"boolean",
"escaped",
")",
"throws",
"URIException",
"{",
"super",
".",
"parseAuthority",
"(",
"original",
",",
"escaped",
")",
";",
"if",
"(",
"_host",
"!=",
"null",
"&&",
"_authority",
... | Coalesce the _host and _authority fields where
possible.
In the web crawl/http domain, most URIs have an
identical _host and _authority. (There is no port
or user info.) However, the superclass always
creates two separate char[] instances.
Notably, the lengths of these char[] fields are
equal if and only if their val... | [
"Coalesce",
"the",
"_host",
"and",
"_authority",
"fields",
"where",
"possible",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/url/LaxURI.java#L188-L195 |
dbracewell/hermes | hermes-wordnet/src/main/java/com/davidbracewell/hermes/wordnet/WordNet.java | WordNet.getRelation | public WordNetRelation getRelation(Sense from, Sense to) {
"""
Gets relation.
@param from the from
@param to the to
@return the relation
"""
if (from == null || to == null) {
return null;
}
return db.getRelation(from, to);
} | java | public WordNetRelation getRelation(Sense from, Sense to) {
if (from == null || to == null) {
return null;
}
return db.getRelation(from, to);
} | [
"public",
"WordNetRelation",
"getRelation",
"(",
"Sense",
"from",
",",
"Sense",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"null",
"||",
"to",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"db",
".",
"getRelation",
"(",
"from",
",",
"to... | Gets relation.
@param from the from
@param to the to
@return the relation | [
"Gets",
"relation",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-wordnet/src/main/java/com/davidbracewell/hermes/wordnet/WordNet.java#L412-L417 |
alkacon/opencms-core | src/org/opencms/xml/templatemapper/CmsTemplateMapper.java | CmsTemplateMapper.getConfiguration | private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {
"""
Loads the configuration file, using CmsVfsMemoryObjectCache for caching.
@param cms the CMS context
@return the template mapper configuration
"""
if (!m_enabled) {
return CmsTemplateMapperConfiguration.... | java | private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {
if (!m_enabled) {
return CmsTemplateMapperConfiguration.EMPTY_CONFIG;
}
if (m_configPath == null) {
m_configPath = OpenCms.getSystemInfo().getConfigFilePath(cms, "template-mapping.xml");
... | [
"private",
"CmsTemplateMapperConfiguration",
"getConfiguration",
"(",
"final",
"CmsObject",
"cms",
")",
"{",
"if",
"(",
"!",
"m_enabled",
")",
"{",
"return",
"CmsTemplateMapperConfiguration",
".",
"EMPTY_CONFIG",
";",
"}",
"if",
"(",
"m_configPath",
"==",
"null",
... | Loads the configuration file, using CmsVfsMemoryObjectCache for caching.
@param cms the CMS context
@return the template mapper configuration | [
"Loads",
"the",
"configuration",
"file",
"using",
"CmsVfsMemoryObjectCache",
"for",
"caching",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/templatemapper/CmsTemplateMapper.java#L348-L381 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java | ClassParser.readConstant | private Constant readConstant() throws InvalidClassFileFormatException, IOException {
"""
Read a constant from the constant pool. Return null for
@return a StaticConstant
@throws InvalidClassFileFormatException
@throws IOException
"""
int tag = in.readUnsignedByte();
if (tag < 0 || tag >= ... | java | private Constant readConstant() throws InvalidClassFileFormatException, IOException {
int tag = in.readUnsignedByte();
if (tag < 0 || tag >= CONSTANT_FORMAT_MAP.length) {
throw new InvalidClassFileFormatException(expectedClassDescriptor, codeBaseEntry);
}
String format = CONS... | [
"private",
"Constant",
"readConstant",
"(",
")",
"throws",
"InvalidClassFileFormatException",
",",
"IOException",
"{",
"int",
"tag",
"=",
"in",
".",
"readUnsignedByte",
"(",
")",
";",
"if",
"(",
"tag",
"<",
"0",
"||",
"tag",
">=",
"CONSTANT_FORMAT_MAP",
".",
... | Read a constant from the constant pool. Return null for
@return a StaticConstant
@throws InvalidClassFileFormatException
@throws IOException | [
"Read",
"a",
"constant",
"from",
"the",
"constant",
"pool",
".",
"Return",
"null",
"for"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java#L243-L284 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java | HttpContext.applyQueryParams | private WebTarget applyQueryParams(WebTarget target, List<String> queryParams) {
"""
Add the given set of query parameters to the web target.
@param target The web target to add the parameters to
@param queryParams The query parameters to add
@return The updated target
"""
if(queryParams != null)
... | java | private WebTarget applyQueryParams(WebTarget target, List<String> queryParams)
{
if(queryParams != null)
{
for(int i = 0; i < queryParams.size(); i += 2)
{
target = target.queryParam(queryParams.get(i), queryParams.get(i+1));
}
}
r... | [
"private",
"WebTarget",
"applyQueryParams",
"(",
"WebTarget",
"target",
",",
"List",
"<",
"String",
">",
"queryParams",
")",
"{",
"if",
"(",
"queryParams",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"queryParams",
".",
"si... | Add the given set of query parameters to the web target.
@param target The web target to add the parameters to
@param queryParams The query parameters to add
@return The updated target | [
"Add",
"the",
"given",
"set",
"of",
"query",
"parameters",
"to",
"the",
"web",
"target",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L590-L601 |
apereo/cas | support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/UrlResourceMetadataResolver.java | UrlResourceMetadataResolver.fetchMetadata | protected HttpResponse fetchMetadata(final String metadataLocation, final CriteriaSet criteriaSet) {
"""
Fetch metadata http response.
@param metadataLocation the metadata location
@param criteriaSet the criteria set
@return the http response
"""
LOGGER.debug("Fetching metadata from [{}]", me... | java | protected HttpResponse fetchMetadata(final String metadataLocation, final CriteriaSet criteriaSet) {
LOGGER.debug("Fetching metadata from [{}]", metadataLocation);
return HttpUtils.executeGet(metadataLocation, new LinkedHashMap<>());
} | [
"protected",
"HttpResponse",
"fetchMetadata",
"(",
"final",
"String",
"metadataLocation",
",",
"final",
"CriteriaSet",
"criteriaSet",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Fetching metadata from [{}]\"",
",",
"metadataLocation",
")",
";",
"return",
"HttpUtils",
".... | Fetch metadata http response.
@param metadataLocation the metadata location
@param criteriaSet the criteria set
@return the http response | [
"Fetch",
"metadata",
"http",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/UrlResourceMetadataResolver.java#L146-L149 |
apiman/apiman | tools/i18n/src/main/java/io/apiman/tools/i18n/TemplateScanner.java | TemplateScanner.outputMessages | private static void outputMessages(TreeMap<String, String> strings, File outputFile) throws FileNotFoundException {
"""
Output the sorted map of strings to the specified output file.
@param strings
@param outputFile
@throws FileNotFoundException
"""
PrintWriter writer = new PrintWriter(new FileOutpu... | java | private static void outputMessages(TreeMap<String, String> strings, File outputFile) throws FileNotFoundException {
PrintWriter writer = new PrintWriter(new FileOutputStream(outputFile));
for (Entry<String, String> entry : strings.entrySet()) {
String key = entry.getKey();
String... | [
"private",
"static",
"void",
"outputMessages",
"(",
"TreeMap",
"<",
"String",
",",
"String",
">",
"strings",
",",
"File",
"outputFile",
")",
"throws",
"FileNotFoundException",
"{",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"new",
"FileOutputStream",... | Output the sorted map of strings to the specified output file.
@param strings
@param outputFile
@throws FileNotFoundException | [
"Output",
"the",
"sorted",
"map",
"of",
"strings",
"to",
"the",
"specified",
"output",
"file",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/tools/i18n/src/main/java/io/apiman/tools/i18n/TemplateScanner.java#L220-L232 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_trafficExtracts_POST | public OvhTrafficExtract billingAccount_line_serviceName_trafficExtracts_POST(String billingAccount, String serviceName, Date dateEnd, Date dateStart) throws IOException {
"""
Launch a traffic extract on your line
REST: POST /telephony/{billingAccount}/line/{serviceName}/trafficExtracts
@param dateStart [requi... | java | public OvhTrafficExtract billingAccount_line_serviceName_trafficExtracts_POST(String billingAccount, String serviceName, Date dateEnd, Date dateStart) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/trafficExtracts";
StringBuilder sb = path(qPath, billingAccount, serviceName);
... | [
"public",
"OvhTrafficExtract",
"billingAccount_line_serviceName_trafficExtracts_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Date",
"dateEnd",
",",
"Date",
"dateStart",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony... | Launch a traffic extract on your line
REST: POST /telephony/{billingAccount}/line/{serviceName}/trafficExtracts
@param dateStart [required] The start date of the traffic extract
@param dateEnd [required] The end date of the traffic extract
@param billingAccount [required] The name of your billingAccount
@param service... | [
"Launch",
"a",
"traffic",
"extract",
"on",
"your",
"line"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L799-L807 |
ggrandes/kvstore | src/main/java/org/javastack/kvstore/io/FileBlockStore.java | FileBlockStore.set | public WriteBuffer set(final int index) {
"""
Alloc a WriteBuffer
@param index of block
@return WriteBuffer
"""
if (useMmap) {
final ByteBuffer buf = getMmapForIndex(index);
if (buf != null) {
return new WriteBuffer(this, index, useMmap, buf);
}
}
return new WriteBuffer(this, index, fals... | java | public WriteBuffer set(final int index) {
if (useMmap) {
final ByteBuffer buf = getMmapForIndex(index);
if (buf != null) {
return new WriteBuffer(this, index, useMmap, buf);
}
}
return new WriteBuffer(this, index, false, bufstack.pop());
} | [
"public",
"WriteBuffer",
"set",
"(",
"final",
"int",
"index",
")",
"{",
"if",
"(",
"useMmap",
")",
"{",
"final",
"ByteBuffer",
"buf",
"=",
"getMmapForIndex",
"(",
"index",
")",
";",
"if",
"(",
"buf",
"!=",
"null",
")",
"{",
"return",
"new",
"WriteBuffe... | Alloc a WriteBuffer
@param index of block
@return WriteBuffer | [
"Alloc",
"a",
"WriteBuffer"
] | train | https://github.com/ggrandes/kvstore/blob/c79277f79f4604e0fec8349a98519838e3de38f0/src/main/java/org/javastack/kvstore/io/FileBlockStore.java#L359-L367 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.fsync | void fsync(String src, String clientName) throws IOException {
"""
Persist all metadata about this file.
@param src The string representation of the path
@param clientName The string representation of the client
@throws IOException if path does not exist
"""
NameNode.stateChangeLog.info("BLOCK... | java | void fsync(String src, String clientName) throws IOException {
NameNode.stateChangeLog.info("BLOCK* NameSystem.fsync: file "
+ src + " for " + clientName);
writeLock();
try {
if (isInSafeMode()) {
throw new SafeModeException("Cannot fsync file " + src, safeMode);
}
INodeFile... | [
"void",
"fsync",
"(",
"String",
"src",
",",
"String",
"clientName",
")",
"throws",
"IOException",
"{",
"NameNode",
".",
"stateChangeLog",
".",
"info",
"(",
"\"BLOCK* NameSystem.fsync: file \"",
"+",
"src",
"+",
"\" for \"",
"+",
"clientName",
")",
";",
"writeLoc... | Persist all metadata about this file.
@param src The string representation of the path
@param clientName The string representation of the client
@throws IOException if path does not exist | [
"Persist",
"all",
"metadata",
"about",
"this",
"file",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L4108-L4130 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/type/InternalTypeUtils.java | InternalTypeUtils.shouldAutoCastTo | public static boolean shouldAutoCastTo(PrimitiveType from, PrimitiveType to) {
"""
Returns whether this type should be automatically casted to
the target type in an arithmetic operation.
"""
InternalType[] castTypes = POSSIBLE_CAST_MAP.get(from);
if (castTypes != null) {
for (InternalType type : POSSIB... | java | public static boolean shouldAutoCastTo(PrimitiveType from, PrimitiveType to) {
InternalType[] castTypes = POSSIBLE_CAST_MAP.get(from);
if (castTypes != null) {
for (InternalType type : POSSIBLE_CAST_MAP.get(from)) {
if (type.equals(to)) {
return true;
}
}
}
return false;
} | [
"public",
"static",
"boolean",
"shouldAutoCastTo",
"(",
"PrimitiveType",
"from",
",",
"PrimitiveType",
"to",
")",
"{",
"InternalType",
"[",
"]",
"castTypes",
"=",
"POSSIBLE_CAST_MAP",
".",
"get",
"(",
"from",
")",
";",
"if",
"(",
"castTypes",
"!=",
"null",
"... | Returns whether this type should be automatically casted to
the target type in an arithmetic operation. | [
"Returns",
"whether",
"this",
"type",
"should",
"be",
"automatically",
"casted",
"to",
"the",
"target",
"type",
"in",
"an",
"arithmetic",
"operation",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/type/InternalTypeUtils.java#L81-L91 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/caps/cache/SimpleDirectoryPersistentCache.java | SimpleDirectoryPersistentCache.writeInfoToFile | private static void writeInfoToFile(File file, DiscoverInfo info) throws IOException {
"""
Writes the DiscoverInfo stanza to an file
@param file
@param info
@throws IOException
"""
try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(file))) {
dos.writeUTF(info.toXML()... | java | private static void writeInfoToFile(File file, DiscoverInfo info) throws IOException {
try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(file))) {
dos.writeUTF(info.toXML().toString());
}
} | [
"private",
"static",
"void",
"writeInfoToFile",
"(",
"File",
"file",
",",
"DiscoverInfo",
"info",
")",
"throws",
"IOException",
"{",
"try",
"(",
"DataOutputStream",
"dos",
"=",
"new",
"DataOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
"... | Writes the DiscoverInfo stanza to an file
@param file
@param info
@throws IOException | [
"Writes",
"the",
"DiscoverInfo",
"stanza",
"to",
"an",
"file"
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/cache/SimpleDirectoryPersistentCache.java#L132-L136 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java | InjectionBinding.getInjectableObject | Object getInjectableObject(Object targetObject, // F743-33811.2
InjectionTargetContext targetContext) // F49213.1
throws InjectionException {
"""
Returns an object to be injected for this injection binding. This method
must be used instead of {@link #getInjectionObject} for exte... | java | Object getInjectableObject(Object targetObject, // F743-33811.2
InjectionTargetContext targetContext) // F49213.1
throws InjectionException
{
if (getInjectionScope() != InjectionScope.COMP)
{
// In some environments, non-comp bindings might not be fully... | [
"Object",
"getInjectableObject",
"(",
"Object",
"targetObject",
",",
"// F743-33811.2",
"InjectionTargetContext",
"targetContext",
")",
"// F49213.1",
"throws",
"InjectionException",
"{",
"if",
"(",
"getInjectionScope",
"(",
")",
"!=",
"InjectionScope",
".",
"COMP",
")"... | Returns an object to be injected for this injection binding. This method
must be used instead of {@link #getInjectionObject} for externally merged
java:global/:app/:module bindings.
@param targetObject the object being injected into
@param targetContext provides access to context data associated with
the target of the... | [
"Returns",
"an",
"object",
"to",
"be",
"injected",
"for",
"this",
"injection",
"binding",
".",
"This",
"method",
"must",
"be",
"used",
"instead",
"of",
"{",
"@link",
"#getInjectionObject",
"}",
"for",
"externally",
"merged",
"java",
":",
"global",
"/",
":",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java#L1354-L1369 |
jbundle/jbundle | base/db/jdbc/src/main/java/org/jbundle/base/db/jdbc/JdbcTable.java | JdbcTable.doSetHandle | public boolean doSetHandle(Object objectID, int iHandleType) throws DBException {
"""
Read the record given the ID to this persistent object.
<p />Note: ObjectID and DataSource handles are the same as bookmark handles for SQL.
@param objectID java.lang.Object
@exception DBException File exception.
"""
... | java | public boolean doSetHandle(Object objectID, int iHandleType) throws DBException
{
if (iHandleType == DBConstants.OBJECT_ID_HANDLE)
{
if (objectID instanceof String) // It is okay to pass in a string, but convert it first!
{
try {
obje... | [
"public",
"boolean",
"doSetHandle",
"(",
"Object",
"objectID",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"if",
"(",
"iHandleType",
"==",
"DBConstants",
".",
"OBJECT_ID_HANDLE",
")",
"{",
"if",
"(",
"objectID",
"instanceof",
"String",
")",
"... | Read the record given the ID to this persistent object.
<p />Note: ObjectID and DataSource handles are the same as bookmark handles for SQL.
@param objectID java.lang.Object
@exception DBException File exception. | [
"Read",
"the",
"record",
"given",
"the",
"ID",
"to",
"this",
"persistent",
"object",
".",
"<p",
"/",
">",
"Note",
":",
"ObjectID",
"and",
"DataSource",
"handles",
"are",
"the",
"same",
"as",
"bookmark",
"handles",
"for",
"SQL",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/jdbc/src/main/java/org/jbundle/base/db/jdbc/JdbcTable.java#L707-L724 |
ag-gipp/MathMLTools | mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/distances/Distances.java | Distances.computeEarthMoverAbsoluteDistance | public static double computeEarthMoverAbsoluteDistance(Map<String, Double> h1, Map<String, Double> h2) {
"""
probably only makes sense to compute this on CI
@param h1
@param h2
@return
"""
Signature s1 = EarthMoverDistanceWrapper.histogramToSignature(h1);
Signature s2 = EarthMoverDistanceW... | java | public static double computeEarthMoverAbsoluteDistance(Map<String, Double> h1, Map<String, Double> h2) {
Signature s1 = EarthMoverDistanceWrapper.histogramToSignature(h1);
Signature s2 = EarthMoverDistanceWrapper.histogramToSignature(h2);
return JFastEMD.distance(s1, s2, 0.0);
} | [
"public",
"static",
"double",
"computeEarthMoverAbsoluteDistance",
"(",
"Map",
"<",
"String",
",",
"Double",
">",
"h1",
",",
"Map",
"<",
"String",
",",
"Double",
">",
"h2",
")",
"{",
"Signature",
"s1",
"=",
"EarthMoverDistanceWrapper",
".",
"histogramToSignature... | probably only makes sense to compute this on CI
@param h1
@param h2
@return | [
"probably",
"only",
"makes",
"sense",
"to",
"compute",
"this",
"on",
"CI"
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/distances/Distances.java#L36-L41 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/BizwifiAPI.java | BizwifiAPI.openpluginToken | public static OpenPluginTokenResult openpluginToken(String accessToken, OpenPluginToken openPluginToken) {
"""
第三方平台获取插件wifi_token
@param accessToken accessToken
@param openPluginToken openpluginToken
@return OpenpluginTokenResult
"""
return openpluginToken(accessToken, JsonUtil.toJSONString(... | java | public static OpenPluginTokenResult openpluginToken(String accessToken, OpenPluginToken openPluginToken) {
return openpluginToken(accessToken, JsonUtil.toJSONString(openPluginToken));
} | [
"public",
"static",
"OpenPluginTokenResult",
"openpluginToken",
"(",
"String",
"accessToken",
",",
"OpenPluginToken",
"openPluginToken",
")",
"{",
"return",
"openpluginToken",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"openPluginToken",
")",
")",
... | 第三方平台获取插件wifi_token
@param accessToken accessToken
@param openPluginToken openpluginToken
@return OpenpluginTokenResult | [
"第三方平台获取插件wifi_token"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L50-L52 |
xm-online/xm-commons | xm-commons-logging/src/main/java/com/icthh/xm/commons/logging/util/LogObjectPrinter.java | LogObjectPrinter.printResult | public static String printResult(final JoinPoint joinPoint, final Object object) {
"""
Print Result object according to input parameters and {@link LoggingAspectConfig}.
@param joinPoint - intercepting join point
@param object - result value to be printed
"""
return printResult(joi... | java | public static String printResult(final JoinPoint joinPoint, final Object object) {
return printResult(joinPoint, object, LoggingAspectConfig.DEFAULT_RESULT_DETAILS);
} | [
"public",
"static",
"String",
"printResult",
"(",
"final",
"JoinPoint",
"joinPoint",
",",
"final",
"Object",
"object",
")",
"{",
"return",
"printResult",
"(",
"joinPoint",
",",
"object",
",",
"LoggingAspectConfig",
".",
"DEFAULT_RESULT_DETAILS",
")",
";",
"}"
] | Print Result object according to input parameters and {@link LoggingAspectConfig}.
@param joinPoint - intercepting join point
@param object - result value to be printed | [
"Print",
"Result",
"object",
"according",
"to",
"input",
"parameters",
"and",
"{"
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-logging/src/main/java/com/icthh/xm/commons/logging/util/LogObjectPrinter.java#L244-L246 |
sporniket/core | sporniket-core-lang/src/main/java/com/sporniket/libre/lang/ExceptionTools.java | ExceptionTools.getStackTrace | public static String getStackTrace(final Throwable t, final int limit) {
"""
Return a string containing the result of <code>printStackTrace()</code>.
<p>
This method is not limited to exceptions but is applicable on any throwable objects.
</p>
@param t
the throwable to trace.
@param limit
limit the number... | java | public static String getStackTrace(final Throwable t, final int limit)
{
if (0 >= limit)
{
return getStackTrace(t);
}
StringBuffer _resultBuffer = new StringBuffer();
_resultBuffer.append(t.getClass().getName()).append(" : ").append(t.getLocalizedMessage());
StackTraceElement[] _stackTrace = t.getStackT... | [
"public",
"static",
"String",
"getStackTrace",
"(",
"final",
"Throwable",
"t",
",",
"final",
"int",
"limit",
")",
"{",
"if",
"(",
"0",
">=",
"limit",
")",
"{",
"return",
"getStackTrace",
"(",
"t",
")",
";",
"}",
"StringBuffer",
"_resultBuffer",
"=",
"new... | Return a string containing the result of <code>printStackTrace()</code>.
<p>
This method is not limited to exceptions but is applicable on any throwable objects.
</p>
@param t
the throwable to trace.
@param limit
limit the number of trace to display. 0 means all the stack.
@return the String containing the trace | [
"Return",
"a",
"string",
"containing",
"the",
"result",
"of",
"<code",
">",
"printStackTrace",
"()",
"<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"method",
"is",
"not",
"limited",
"to",
"exceptions",
"but",
"is",
"applicable",
"on",
"any",
"throwable",
... | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-lang/src/main/java/com/sporniket/libre/lang/ExceptionTools.java#L75-L94 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/protocol/Message.java | Message.propagateUserData | private void propagateUserData(HashMap<String, String> clientValues) {
"""
in 'clientValues' wird eine hashtable uebergeben, die als schluessel den
pfadnames und als wert den wert eines zu setzenden elementes enthaelt. mit
der methode werden vom nutzer einzugebenede daten (wie kontonummern, namen
usw.) in die g... | java | private void propagateUserData(HashMap<String, String> clientValues) {
String dottedName = getName() + ".";
clientValues.forEach((key, value) -> {
if (key.startsWith(dottedName) && value != null && value.length() != 0) {
if (!propagateValue(key, value, TRY_TO_CREATE, DONT_ALL... | [
"private",
"void",
"propagateUserData",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"clientValues",
")",
"{",
"String",
"dottedName",
"=",
"getName",
"(",
")",
"+",
"\".\"",
";",
"clientValues",
".",
"forEach",
"(",
"(",
"key",
",",
"value",
")",
... | in 'clientValues' wird eine hashtable uebergeben, die als schluessel den
pfadnames und als wert den wert eines zu setzenden elementes enthaelt. mit
der methode werden vom nutzer einzugebenede daten (wie kontonummern, namen
usw.) in die generierte nachricht eingebaut | [
"in",
"clientValues",
"wird",
"eine",
"hashtable",
"uebergeben",
"die",
"als",
"schluessel",
"den",
"pfadnames",
"und",
"als",
"wert",
"den",
"wert",
"eines",
"zu",
"setzenden",
"elementes",
"enthaelt",
".",
"mit",
"der",
"methode",
"werden",
"vom",
"nutzer",
... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/Message.java#L82-L91 |
RuntimeTools/javametrics | javaagent/src/main/java/com/ibm/javametrics/instrument/ClassAdapter.java | ClassAdapter.visitMethod | @Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
"""
/*
(non-Javadoc)
@see org.objectweb.asm.ClassVisitor#visitMethod(int, java.lang.String,
java.lang.String, java.lang.String, java.lang.String[]) Called for each
method in the class... | java | @Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
mv = visitHttpMethod(mv, access, name, desc, signature, exceptions);
return mv;
} | [
"@",
"Override",
"public",
"MethodVisitor",
"visitMethod",
"(",
"int",
"access",
",",
"String",
"name",
",",
"String",
"desc",
",",
"String",
"signature",
",",
"String",
"[",
"]",
"exceptions",
")",
"{",
"MethodVisitor",
"mv",
"=",
"super",
".",
"visitMethod... | /*
(non-Javadoc)
@see org.objectweb.asm.ClassVisitor#visitMethod(int, java.lang.String,
java.lang.String, java.lang.String, java.lang.String[]) Called for each
method in the class.
We return a new instance of a class specific MethodVisitor for each
method we need to instrument. | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/ClassAdapter.java#L87-L95 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.getBeansOfTypeForField | @SuppressWarnings("WeakerAccess")
@Internal
protected final Collection getBeansOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint) {
"""
Obtains a bean definition for the field at the given index and the argument at the given index
<p>
Warning:... | java | @SuppressWarnings("WeakerAccess")
@Internal
protected final Collection getBeansOfTypeForField(BeanResolutionContext resolutionContext, BeanContext context, FieldInjectionPoint injectionPoint) {
return resolveBeanWithGenericsForField(resolutionContext, injectionPoint, (beanType, qualifier) -> {
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"Internal",
"protected",
"final",
"Collection",
"getBeansOfTypeForField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"FieldInjectionPoint",
"injectionPoint",
")",
"{",
... | Obtains a bean definition for the field at the given index and the argument at the given index
<p>
Warning: this method is used by internal generated code and should not be called by user code.
@param resolutionContext The resolution context
@param context The context
@param injectionPoint The field injec... | [
"Obtains",
"a",
"bean",
"definition",
"for",
"the",
"field",
"at",
"the",
"given",
"index",
"and",
"the",
"argument",
"at",
"the",
"given",
"index",
"<p",
">",
"Warning",
":",
"this",
"method",
"is",
"used",
"by",
"internal",
"generated",
"code",
"and",
... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1405-L1418 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.asNumber | public static <T extends Number & Comparable<?>> NumberExpression<T> asNumber(Expression<T> expr) {
"""
Create a new NumberExpression
@param expr Expression of type Number
@return new NumberExpression
"""
Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
if (underlyingMixin ins... | java | public static <T extends Number & Comparable<?>> NumberExpression<T> asNumber(Expression<T> expr) {
Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
if (underlyingMixin instanceof PathImpl) {
return new NumberPath<T>((PathImpl<T>) underlyingMixin);
} else if (underlying... | [
"public",
"static",
"<",
"T",
"extends",
"Number",
"&",
"Comparable",
"<",
"?",
">",
">",
"NumberExpression",
"<",
"T",
">",
"asNumber",
"(",
"Expression",
"<",
"T",
">",
"expr",
")",
"{",
"Expression",
"<",
"T",
">",
"underlyingMixin",
"=",
"ExpressionU... | Create a new NumberExpression
@param expr Expression of type Number
@return new NumberExpression | [
"Create",
"a",
"new",
"NumberExpression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L2093-L2113 |
kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameEncodingSupport.java | WsFrameEncodingSupport.doEncodeOpcode | private static byte doEncodeOpcode(byte b, WsMessage message) {
"""
Encode a WebSocket opcode onto a byte that might have some high bits set.
@param b
@param message
@return
"""
Kind kind = message.getKind();
switch (kind) {
case CONTINUATION:
b |= Opcode.CONTINUATION.... | java | private static byte doEncodeOpcode(byte b, WsMessage message) {
Kind kind = message.getKind();
switch (kind) {
case CONTINUATION:
b |= Opcode.CONTINUATION.getCode();
break;
case TEXT: {
b |= Opcode.TEXT.getCode();
break;
}
case B... | [
"private",
"static",
"byte",
"doEncodeOpcode",
"(",
"byte",
"b",
",",
"WsMessage",
"message",
")",
"{",
"Kind",
"kind",
"=",
"message",
".",
"getKind",
"(",
")",
";",
"switch",
"(",
"kind",
")",
"{",
"case",
"CONTINUATION",
":",
"b",
"|=",
"Opcode",
".... | Encode a WebSocket opcode onto a byte that might have some high bits set.
@param b
@param message
@return | [
"Encode",
"a",
"WebSocket",
"opcode",
"onto",
"a",
"byte",
"that",
"might",
"have",
"some",
"high",
"bits",
"set",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameEncodingSupport.java#L231-L262 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Algorithms.java | Algorithms.findFirst | public Object findFirst(Collection collection, Constraint constraint) {
"""
Find the first element in the collection matching the specified
constraint.
@param collection the collection
@param constraint the predicate
@return The first object match, or null if no match
"""
return findFirst(collection.it... | java | public Object findFirst(Collection collection, Constraint constraint) {
return findFirst(collection.iterator(), constraint);
} | [
"public",
"Object",
"findFirst",
"(",
"Collection",
"collection",
",",
"Constraint",
"constraint",
")",
"{",
"return",
"findFirst",
"(",
"collection",
".",
"iterator",
"(",
")",
",",
"constraint",
")",
";",
"}"
] | Find the first element in the collection matching the specified
constraint.
@param collection the collection
@param constraint the predicate
@return The first object match, or null if no match | [
"Find",
"the",
"first",
"element",
"in",
"the",
"collection",
"matching",
"the",
"specified",
"constraint",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Algorithms.java#L111-L113 |
loadimpact/loadimpact-sdk-java | src/main/java/com/loadimpact/ApiTokenClient.java | ApiTokenClient.deleteDataStore | public void deleteDataStore(final int id) {
"""
Deletes a data store.
@param id its id
@throws com.loadimpact.exception.ResponseParseException if it was unsuccessful
"""
invoke(DATA_STORES, id,
new RequestClosure<JsonStructure>() {
@Override
p... | java | public void deleteDataStore(final int id) {
invoke(DATA_STORES, id,
new RequestClosure<JsonStructure>() {
@Override
public JsonStructure call(Invocation.Builder request) {
Response response = request.delete();
... | [
"public",
"void",
"deleteDataStore",
"(",
"final",
"int",
"id",
")",
"{",
"invoke",
"(",
"DATA_STORES",
",",
"id",
",",
"new",
"RequestClosure",
"<",
"JsonStructure",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"JsonStructure",
"call",
"(",
"Invocation",
... | Deletes a data store.
@param id its id
@throws com.loadimpact.exception.ResponseParseException if it was unsuccessful | [
"Deletes",
"a",
"data",
"store",
"."
] | train | https://github.com/loadimpact/loadimpact-sdk-java/blob/49af80b768c5453266414108b0d30a0fc01b8cef/src/main/java/com/loadimpact/ApiTokenClient.java#L762-L776 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/LinkUtil.java | LinkUtil.getUnmappedUrl | public static String getUnmappedUrl(SlingHttpServletRequest request, String url) {
"""
Builds a unmapped link to a path (resource path) without selectors and a determined extension.
@param request the request context for path mapping (the result is always mapped)
@param url the URL to use (complete) or the... | java | public static String getUnmappedUrl(SlingHttpServletRequest request, String url) {
return getUrl(request, url, null, null, LinkMapper.CONTEXT);
} | [
"public",
"static",
"String",
"getUnmappedUrl",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"url",
")",
"{",
"return",
"getUrl",
"(",
"request",
",",
"url",
",",
"null",
",",
"null",
",",
"LinkMapper",
".",
"CONTEXT",
")",
";",
"}"
] | Builds a unmapped link to a path (resource path) without selectors and a determined extension.
@param request the request context for path mapping (the result is always mapped)
@param url the URL to use (complete) or the path to an addressed resource (without any extension)
@return the unmapped url for the referen... | [
"Builds",
"a",
"unmapped",
"link",
"to",
"a",
"path",
"(",
"resource",
"path",
")",
"without",
"selectors",
"and",
"a",
"determined",
"extension",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/LinkUtil.java#L76-L78 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java | UIComponentClassicTagBase._indexOfStartingFrom | private static int _indexOfStartingFrom(List<?> list, int startIndex, Object searchValue) {
"""
Similar to List.indexOf, except that we start searching from a specific index
and then wrap aroud. For this to be performant, the List should implement
RandomAccess.
@param <T>
@param list List to seatch
@param st... | java | private static int _indexOfStartingFrom(List<?> list, int startIndex, Object searchValue)
{
int itemCount = list.size();
boolean found = false;
// start searching from location remembered from last time
for (int currIndex = startIndex; currIndex < itemCount; currIndex++)
{
... | [
"private",
"static",
"int",
"_indexOfStartingFrom",
"(",
"List",
"<",
"?",
">",
"list",
",",
"int",
"startIndex",
",",
"Object",
"searchValue",
")",
"{",
"int",
"itemCount",
"=",
"list",
".",
"size",
"(",
")",
";",
"boolean",
"found",
"=",
"false",
";",
... | Similar to List.indexOf, except that we start searching from a specific index
and then wrap aroud. For this to be performant, the List should implement
RandomAccess.
@param <T>
@param list List to seatch
@param startIndex index to start searching for value from
@param searchValue Value to search for (null not supporte... | [
"Similar",
"to",
"List",
".",
"indexOf",
"except",
"that",
"we",
"start",
"searching",
"from",
"a",
"specific",
"index",
"and",
"then",
"wrap",
"aroud",
".",
"For",
"this",
"to",
"be",
"performant",
"the",
"List",
"should",
"implement",
"RandomAccess",
"."
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/webapp/UIComponentClassicTagBase.java#L884-L918 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/IdentityLinkEntityManagerImpl.java | IdentityLinkEntityManagerImpl.involveUser | @Override
public IdentityLinkEntity involveUser(ExecutionEntity executionEntity, String userId, String type) {
"""
Adds an IdentityLink for the given user id with the specified type,
but only if the user is not associated with the execution entity yet.
"""
for (IdentityLinkEntity identityLink : executio... | java | @Override
public IdentityLinkEntity involveUser(ExecutionEntity executionEntity, String userId, String type) {
for (IdentityLinkEntity identityLink : executionEntity.getIdentityLinks()) {
if (identityLink.isUser() && identityLink.getUserId().equals(userId)) {
return identityLink;
}
}
r... | [
"@",
"Override",
"public",
"IdentityLinkEntity",
"involveUser",
"(",
"ExecutionEntity",
"executionEntity",
",",
"String",
"userId",
",",
"String",
"type",
")",
"{",
"for",
"(",
"IdentityLinkEntity",
"identityLink",
":",
"executionEntity",
".",
"getIdentityLinks",
"(",... | Adds an IdentityLink for the given user id with the specified type,
but only if the user is not associated with the execution entity yet. | [
"Adds",
"an",
"IdentityLink",
"for",
"the",
"given",
"user",
"id",
"with",
"the",
"specified",
"type",
"but",
"only",
"if",
"the",
"user",
"is",
"not",
"associated",
"with",
"the",
"execution",
"entity",
"yet",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/IdentityLinkEntityManagerImpl.java#L152-L160 |
Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java | WebMBeanAdapter.invokeOperation | public String invokeOperation(String operationName, Map<String, String[]> parameterMap)
throws JMException, UnsupportedEncodingException {
"""
Invoke an operation on an MBean by name.
Note that only basic data types are supported for parameter values.
@param operationName the operation name (can be URL-e... | java | public String invokeOperation(String operationName, Map<String, String[]> parameterMap)
throws JMException, UnsupportedEncodingException {
MBeanOperationInfo operationInfo = getOperationInfo(operationName);
MBeanOperationInvoker invoker = createMBeanOperationInvoker(mBeanServer, objectName, oper... | [
"public",
"String",
"invokeOperation",
"(",
"String",
"operationName",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameterMap",
")",
"throws",
"JMException",
",",
"UnsupportedEncodingException",
"{",
"MBeanOperationInfo",
"operationInfo",
"=",
"getOp... | Invoke an operation on an MBean by name.
Note that only basic data types are supported for parameter values.
@param operationName the operation name (can be URL-encoded).
@param parameterMap the {@link Map} of parameter names and value arrays.
@return the returned value from the operation.
@throws JMException Java Mana... | [
"Invoke",
"an",
"operation",
"on",
"an",
"MBean",
"by",
"name",
".",
"Note",
"that",
"only",
"basic",
"data",
"types",
"are",
"supported",
"for",
"parameter",
"values",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanAdapter.java#L167-L172 |
aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/R.java | R1.getA | protected IConceptSet getA(int B, int r) {
"""
Returns {A | A [ r.B} or {A | (A,B) in R(r)}
Lazily initialise data from base as a side-effect of this call.
@param B
@param r
@return
"""
if (B >= CONCEPTS) {
resizeConcepts(B);
}
if (r >= ROLES) {
resi... | java | protected IConceptSet getA(int B, int r) {
if (B >= CONCEPTS) {
resizeConcepts(B);
}
if (r >= ROLES) {
resizeRoles(r);
}
// Note the "+1" in the following line:
final int index = indexOf(B, r) + 1;
if (null == data[index]) {
... | [
"protected",
"IConceptSet",
"getA",
"(",
"int",
"B",
",",
"int",
"r",
")",
"{",
"if",
"(",
"B",
">=",
"CONCEPTS",
")",
"{",
"resizeConcepts",
"(",
"B",
")",
";",
"}",
"if",
"(",
"r",
">=",
"ROLES",
")",
"{",
"resizeRoles",
"(",
"r",
")",
";",
"... | Returns {A | A [ r.B} or {A | (A,B) in R(r)}
Lazily initialise data from base as a side-effect of this call.
@param B
@param r
@return | [
"Returns",
"{",
"A",
"|",
"A",
"[",
"r",
".",
"B",
"}",
"or",
"{",
"A",
"|",
"(",
"A",
"B",
")",
"in",
"R",
"(",
"r",
")",
"}"
] | train | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/R.java#L223-L241 |
apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.deleteFlowConfig | public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header, boolean triggerListener) throws FlowConfigLoggedException {
"""
Delete flowConfig locally and trigger all listeners iff @param triggerListener is set to true
"""
log.info("[GAAS-REST] Delete called with flowGroup {} flowName {}", flo... | java | public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header, boolean triggerListener) throws FlowConfigLoggedException {
log.info("[GAAS-REST] Delete called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName());
URI flowUri = null;
try {
flowUri = FlowUriUtils.crea... | [
"public",
"UpdateResponse",
"deleteFlowConfig",
"(",
"FlowId",
"flowId",
",",
"Properties",
"header",
",",
"boolean",
"triggerListener",
")",
"throws",
"FlowConfigLoggedException",
"{",
"log",
".",
"info",
"(",
"\"[GAAS-REST] Delete called with flowGroup {} flowName {}\"",
... | Delete flowConfig locally and trigger all listeners iff @param triggerListener is set to true | [
"Delete",
"flowConfig",
"locally",
"and",
"trigger",
"all",
"listeners",
"iff"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L171-L183 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/WebFacesConfigDescriptorImpl.java | WebFacesConfigDescriptorImpl.addNamespace | public WebFacesConfigDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>WebFacesConfigDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public WebFacesConfigDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"WebFacesConfigDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>WebFacesConfigDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/WebFacesConfigDescriptorImpl.java#L97-L101 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_namespaces_namespaceId_permissions_permissionId_GET | public OvhPermissions serviceName_namespaces_namespaceId_permissions_permissionId_GET(String serviceName, String namespaceId, String permissionId) throws IOException {
"""
Inspect permission
REST: GET /caas/registry/{serviceName}/namespaces/{namespaceId}/permissions/{permissionId}
@param namespaceId [required]... | java | public OvhPermissions serviceName_namespaces_namespaceId_permissions_permissionId_GET(String serviceName, String namespaceId, String permissionId) throws IOException {
String qPath = "/caas/registry/{serviceName}/namespaces/{namespaceId}/permissions/{permissionId}";
StringBuilder sb = path(qPath, serviceName, names... | [
"public",
"OvhPermissions",
"serviceName_namespaces_namespaceId_permissions_permissionId_GET",
"(",
"String",
"serviceName",
",",
"String",
"namespaceId",
",",
"String",
"permissionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/registry/{serviceName}/n... | Inspect permission
REST: GET /caas/registry/{serviceName}/namespaces/{namespaceId}/permissions/{permissionId}
@param namespaceId [required] Namespace id
@param permissionId [required] Permission id
@param serviceName [required] Service name
API beta | [
"Inspect",
"permission"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L453-L458 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java | SARLValidator.isIgnored | protected boolean isIgnored(String issueCode, EObject currentObject) {
"""
Replies if the given issue is ignored for the given object.
@param issueCode the code if the issue.
@param currentObject the current object.
@return <code>true</code> if the issue is ignored.
@see #isIgnored(String)
"""
final Is... | java | protected boolean isIgnored(String issueCode, EObject currentObject) {
final IssueSeverities severities = getIssueSeverities(getContext(), currentObject);
return severities.isIgnored(issueCode);
} | [
"protected",
"boolean",
"isIgnored",
"(",
"String",
"issueCode",
",",
"EObject",
"currentObject",
")",
"{",
"final",
"IssueSeverities",
"severities",
"=",
"getIssueSeverities",
"(",
"getContext",
"(",
")",
",",
"currentObject",
")",
";",
"return",
"severities",
".... | Replies if the given issue is ignored for the given object.
@param issueCode the code if the issue.
@param currentObject the current object.
@return <code>true</code> if the issue is ignored.
@see #isIgnored(String) | [
"Replies",
"if",
"the",
"given",
"issue",
"is",
"ignored",
"for",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L506-L509 |
lukas-krecan/JsonUnit | json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java | JsonUtils.convertToJson | public static Node convertToJson(Object source, String label, boolean lenient) {
"""
Converts object to JSON.
@param source
@param label label to be logged in case of error.
@param lenient lenient parser used for expected values. Allows unquoted keys.
@return
"""
if (source instanceof JsonSource... | java | public static Node convertToJson(Object source, String label, boolean lenient) {
if (source instanceof JsonSource) {
return converter.convertToNode(((JsonSource) source).getJson(), label, lenient);
} else {
return converter.convertToNode(source, label, lenient);
}
} | [
"public",
"static",
"Node",
"convertToJson",
"(",
"Object",
"source",
",",
"String",
"label",
",",
"boolean",
"lenient",
")",
"{",
"if",
"(",
"source",
"instanceof",
"JsonSource",
")",
"{",
"return",
"converter",
".",
"convertToNode",
"(",
"(",
"(",
"JsonSou... | Converts object to JSON.
@param source
@param label label to be logged in case of error.
@param lenient lenient parser used for expected values. Allows unquoted keys.
@return | [
"Converts",
"object",
"to",
"JSON",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/JsonUtils.java#L52-L58 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/AccountsApi.java | AccountsApi.getBrandResourcesByContentType | public void getBrandResourcesByContentType(String accountId, String brandId, String resourceContentType, AccountsApi.GetBrandResourcesByContentTypeOptions options) throws ApiException {
"""
Returns the specified branding resource file.
@param accountId The external account number (int) or account ID Guid. (requ... | java | public void getBrandResourcesByContentType(String accountId, String brandId, String resourceContentType, AccountsApi.GetBrandResourcesByContentTypeOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
... | [
"public",
"void",
"getBrandResourcesByContentType",
"(",
"String",
"accountId",
",",
"String",
"brandId",
",",
"String",
"resourceContentType",
",",
"AccountsApi",
".",
"GetBrandResourcesByContentTypeOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"loca... | Returns the specified branding resource file.
@param accountId The external account number (int) or account ID Guid. (required)
@param brandId The unique identifier of a brand. (required)
@param resourceContentType (required)
@param options for modifying the method behavior.
@throws ApiException if fails to make API ... | [
"Returns",
"the",
"specified",
"branding",
"resource",
"file",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/AccountsApi.java#L1311-L1360 |
ReactiveX/RxNetty | rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/client/HttpClient.java | HttpClient.newClient | public static HttpClient<ByteBuf, ByteBuf> newClient(String host, int port) {
"""
Creates a new HTTP client instance with the passed host and port for the target server.
@param host Hostname for the target server.
@param port Port for the target server.
@return A new {@code HttpClient} instance.
"""
... | java | public static HttpClient<ByteBuf, ByteBuf> newClient(String host, int port) {
return newClient(new InetSocketAddress(host, port));
} | [
"public",
"static",
"HttpClient",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"newClient",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"newClient",
"(",
"new",
"InetSocketAddress",
"(",
"host",
",",
"port",
")",
")",
";",
"}"
] | Creates a new HTTP client instance with the passed host and port for the target server.
@param host Hostname for the target server.
@param port Port for the target server.
@return A new {@code HttpClient} instance. | [
"Creates",
"a",
"new",
"HTTP",
"client",
"instance",
"with",
"the",
"passed",
"host",
"and",
"port",
"for",
"the",
"target",
"server",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/client/HttpClient.java#L316-L318 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/compiler/Type.java | Type.convertableFrom | public int convertableFrom(Type other, boolean vararg) {
"""
Check if a type is convertable including support for varargs. If varargs
is true, then this will add 40 to the total cost such that non-varargs
will always take precedence.
@see #convertableFrom(Type)
"""
int cost = convertableFrom(othe... | java | public int convertableFrom(Type other, boolean vararg) {
int cost = convertableFrom(other);
if (cost < 0) { return cost; }
return (vararg ? cost + 40 : cost);
} | [
"public",
"int",
"convertableFrom",
"(",
"Type",
"other",
",",
"boolean",
"vararg",
")",
"{",
"int",
"cost",
"=",
"convertableFrom",
"(",
"other",
")",
";",
"if",
"(",
"cost",
"<",
"0",
")",
"{",
"return",
"cost",
";",
"}",
"return",
"(",
"vararg",
"... | Check if a type is convertable including support for varargs. If varargs
is true, then this will add 40 to the total cost such that non-varargs
will always take precedence.
@see #convertableFrom(Type) | [
"Check",
"if",
"a",
"type",
"is",
"convertable",
"including",
"support",
"for",
"varargs",
".",
"If",
"varargs",
"is",
"true",
"then",
"this",
"will",
"add",
"40",
"to",
"the",
"total",
"cost",
"such",
"that",
"non",
"-",
"varargs",
"will",
"always",
"ta... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Type.java#L1180-L1185 |
ag-gipp/MathMLTools | mathml-converters/src/main/java/com/formulasearchengine/mathmltools/converters/mathoid/EnrichedMathMLTransformer.java | EnrichedMathMLTransformer.getFullMathML | public String getFullMathML() throws Exception {
"""
Transformers the enriched MathML to a well formed MathML that contains
pMML and cMML semantics into a new document and returns it as a string.
<p>
This method still has a lot of flaws.
@return String of the new formed document or null, if transformation fa... | java | public String getFullMathML() throws Exception {
XPath xPath = XMLHelper.namespaceAwareXpath("m", CMMLInfo.NS_MATHML);
Element semanticRoot = (Element) XMLHelper.getElementB(readDocument, xPath.compile("*//m:semantics"));
boolean hasSemanticEle = semanticRoot != null;
// get the first m... | [
"public",
"String",
"getFullMathML",
"(",
")",
"throws",
"Exception",
"{",
"XPath",
"xPath",
"=",
"XMLHelper",
".",
"namespaceAwareXpath",
"(",
"\"m\"",
",",
"CMMLInfo",
".",
"NS_MATHML",
")",
";",
"Element",
"semanticRoot",
"=",
"(",
"Element",
")",
"XMLHelpe... | Transformers the enriched MathML to a well formed MathML that contains
pMML and cMML semantics into a new document and returns it as a string.
<p>
This method still has a lot of flaws.
@return String of the new formed document or null, if transformation failed.
@throws Exception a lot could go wrong here: parser or tr... | [
"Transformers",
"the",
"enriched",
"MathML",
"to",
"a",
"well",
"formed",
"MathML",
"that",
"contains",
"pMML",
"and",
"cMML",
"semantics",
"into",
"a",
"new",
"document",
"and",
"returns",
"it",
"as",
"a",
"string",
".",
"<p",
">",
"This",
"method",
"stil... | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-converters/src/main/java/com/formulasearchengine/mathmltools/converters/mathoid/EnrichedMathMLTransformer.java#L55-L97 |
Netflix/conductor | grpc-client/src/main/java/com/netflix/conductor/client/grpc/MetadataClient.java | MetadataClient.getWorkflowDef | public WorkflowDef getWorkflowDef(String name, @Nullable Integer version) {
"""
Retrieve the workflow definition
@param name the name of the workflow
@param version the version of the workflow def
@return Workflow definition for the given workflow and version
"""
Preconditions.checkArgument(Str... | java | public WorkflowDef getWorkflowDef(String name, @Nullable Integer version) {
Preconditions.checkArgument(StringUtils.isNotBlank(name), "name cannot be blank");
MetadataServicePb.GetWorkflowRequest.Builder request =
MetadataServicePb.GetWorkflowRequest.newBuilder()
... | [
"public",
"WorkflowDef",
"getWorkflowDef",
"(",
"String",
"name",
",",
"@",
"Nullable",
"Integer",
"version",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"name",
")",
",",
"\"name cannot be blank\"",
")",
";",
"Me... | Retrieve the workflow definition
@param name the name of the workflow
@param version the version of the workflow def
@return Workflow definition for the given workflow and version | [
"Retrieve",
"the",
"workflow",
"definition"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/grpc-client/src/main/java/com/netflix/conductor/client/grpc/MetadataClient.java#L60-L71 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/collections/Collections3.java | Collections3.mergeMaps | @Beta
public static <K, V> Map<K, V> mergeMaps(Map<K, V> first, Map<K, V> second, V defaultValue) {
"""
Mergers two maps handling null keys, null values and duplicates
@param first the first map to merge
@param second the second map to merge
@param defaultValue the value to be used in case of... | java | @Beta
public static <K, V> Map<K, V> mergeMaps(Map<K, V> first, Map<K, V> second, V defaultValue) {
checkArgument(first != null, "Expected non-null first map");
checkArgument(second != null, "Expected non-null second map");
checkArgument(defaultValue != null, "Expected non-null default value... | [
"@",
"Beta",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"mergeMaps",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"first",
",",
"Map",
"<",
"K",
",",
"V",
">",
"second",
",",
"V",
"defaultValue",
")",
"{",
"checkArgu... | Mergers two maps handling null keys, null values and duplicates
@param first the first map to merge
@param second the second map to merge
@param defaultValue the value to be used in case of null value
@param <K> the key type
@param <V> the value type
@return a single map containing entries from the given ... | [
"Mergers",
"two",
"maps",
"handling",
"null",
"keys",
"null",
"values",
"and",
"duplicates"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/collections/Collections3.java#L121-L143 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.login | public void login(String username, String password) {
"""
Log a user in to the the CmsSell.<p>
@param username the name of the user to log in
@param password the password of the user
"""
username = OpenCms.getImportExportManager().translateUser(username);
try {
m_cms.loginUser(... | java | public void login(String username, String password) {
username = OpenCms.getImportExportManager().translateUser(username);
try {
m_cms.loginUser(username, password);
// reset the settings, this will switch the startup site root etc.
m_shell.initSettings();
... | [
"public",
"void",
"login",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"username",
"=",
"OpenCms",
".",
"getImportExportManager",
"(",
")",
".",
"translateUser",
"(",
"username",
")",
";",
"try",
"{",
"m_cms",
".",
"loginUser",
"(",
"us... | Log a user in to the the CmsSell.<p>
@param username the name of the user to log in
@param password the password of the user | [
"Log",
"a",
"user",
"in",
"to",
"the",
"the",
"CmsSell",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L1011-L1027 |
VoltDB/voltdb | src/frontend/org/voltcore/utils/ssl/SSLBufferDecrypter.java | SSLBufferDecrypter.tlsunwrap | public ByteBuf tlsunwrap(ByteBuffer srcBuffer, ByteBuf dstBuf, PooledByteBufAllocator allocator) {
"""
Encrypt data in {@code srcBuffer} into {@code dstBuf} if it is large enough. If an error occurs {@code dstBuf}
will be released. If {@code dstBuf} is not large enough a new buffer will be allocated from {@code a... | java | public ByteBuf tlsunwrap(ByteBuffer srcBuffer, ByteBuf dstBuf, PooledByteBufAllocator allocator) {
int writerIndex = dstBuf.writerIndex();
ByteBuffer byteBuffer = dstBuf.nioBuffer(writerIndex, dstBuf.writableBytes());
while (true) {
SSLEngineResult result;
try {
... | [
"public",
"ByteBuf",
"tlsunwrap",
"(",
"ByteBuffer",
"srcBuffer",
",",
"ByteBuf",
"dstBuf",
",",
"PooledByteBufAllocator",
"allocator",
")",
"{",
"int",
"writerIndex",
"=",
"dstBuf",
".",
"writerIndex",
"(",
")",
";",
"ByteBuffer",
"byteBuffer",
"=",
"dstBuf",
"... | Encrypt data in {@code srcBuffer} into {@code dstBuf} if it is large enough. If an error occurs {@code dstBuf}
will be released. If {@code dstBuf} is not large enough a new buffer will be allocated from {@code allocator} and
{@code dstBuf} will be released.
@param srcBuffer holding encrypted data
@param dstBuf to a... | [
"Encrypt",
"data",
"in",
"{",
"@code",
"srcBuffer",
"}",
"into",
"{",
"@code",
"dstBuf",
"}",
"if",
"it",
"is",
"large",
"enough",
".",
"If",
"an",
"error",
"occurs",
"{",
"@code",
"dstBuf",
"}",
"will",
"be",
"released",
".",
"If",
"{",
"@code",
"ds... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/ssl/SSLBufferDecrypter.java#L123-L164 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingHeapDecorator.java | VectorPackingHeapDecorator.loadSlack | private int loadSlack(int dim, int bin) {
"""
compute the load slack of a bin
@param dim the dimension
@param bin the bin
@return the load slack of bin on dimension bin
"""
return p.loads[dim][bin].getUB() - p.loads[dim][bin].getLB();
} | java | private int loadSlack(int dim, int bin) {
return p.loads[dim][bin].getUB() - p.loads[dim][bin].getLB();
} | [
"private",
"int",
"loadSlack",
"(",
"int",
"dim",
",",
"int",
"bin",
")",
"{",
"return",
"p",
".",
"loads",
"[",
"dim",
"]",
"[",
"bin",
"]",
".",
"getUB",
"(",
")",
"-",
"p",
".",
"loads",
"[",
"dim",
"]",
"[",
"bin",
"]",
".",
"getLB",
"(",... | compute the load slack of a bin
@param dim the dimension
@param bin the bin
@return the load slack of bin on dimension bin | [
"compute",
"the",
"load",
"slack",
"of",
"a",
"bin"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingHeapDecorator.java#L65-L67 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java | EffectUtil.fromString | static public Color fromString (String rgb) {
"""
Converts a string to a color.
@param rgb The string encoding the colour
@return The colour represented by the given encoded string
"""
if (rgb == null || rgb.length() != 6) return Color.white;
return new Color(Integer.parseInt(rgb.substring(0, 2), 16)... | java | static public Color fromString (String rgb) {
if (rgb == null || rgb.length() != 6) return Color.white;
return new Color(Integer.parseInt(rgb.substring(0, 2), 16), Integer.parseInt(rgb.substring(2, 4), 16), Integer.parseInt(rgb
.substring(4, 6), 16));
} | [
"static",
"public",
"Color",
"fromString",
"(",
"String",
"rgb",
")",
"{",
"if",
"(",
"rgb",
"==",
"null",
"||",
"rgb",
".",
"length",
"(",
")",
"!=",
"6",
")",
"return",
"Color",
".",
"white",
";",
"return",
"new",
"Color",
"(",
"Integer",
".",
"p... | Converts a string to a color.
@param rgb The string encoding the colour
@return The colour represented by the given encoded string | [
"Converts",
"a",
"string",
"to",
"a",
"color",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java#L211-L215 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/BasePrepareStatement.java | BasePrepareStatement.setURL | @Override
public void setURL(final int parameterIndex, final URL url) throws SQLException {
"""
Sets the designated parameter to the given <code>java.net.URL</code> value. The driver converts
this to an SQL
<code>DATALINK</code> value when it sends it to the database.
@param parameterIndex the first paramet... | java | @Override
public void setURL(final int parameterIndex, final URL url) throws SQLException {
if (url == null) {
setNull(parameterIndex, ColumnType.STRING);
return;
}
setParameter(parameterIndex, new StringParameter(url.toString(), noBackslashEscapes));
} | [
"@",
"Override",
"public",
"void",
"setURL",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"URL",
"url",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"ColumnType",
".",
"STRING"... | Sets the designated parameter to the given <code>java.net.URL</code> value. The driver converts
this to an SQL
<code>DATALINK</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the second is 2, ...
@param url the <code>java.net.URL</code> object to be set
@throws ... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"java",
".",
"net",
".",
"URL<",
"/",
"code",
">",
"value",
".",
"The",
"driver",
"converts",
"this",
"to",
"an",
"SQL",
"<code",
">",
"DATALINK<",
"/",
"code",
">",
"value",... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/BasePrepareStatement.java#L703-L710 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java | Attachment.fromBinaryBytes | public static Attachment fromBinaryBytes( byte[] bytes, MediaType mediaType ) {
"""
Creates an attachment from a given array of bytes.
The bytes will be Base64 encoded.
@throws java.lang.IllegalArgumentException if mediaType is not binary
"""
if( !mediaType.isBinary() ) {
throw new Illega... | java | public static Attachment fromBinaryBytes( byte[] bytes, MediaType mediaType ) {
if( !mediaType.isBinary() ) {
throw new IllegalArgumentException( "MediaType must be binary" );
}
return new Attachment(BaseEncoding.base64().encode( bytes ), mediaType, null );
} | [
"public",
"static",
"Attachment",
"fromBinaryBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"MediaType",
"mediaType",
")",
"{",
"if",
"(",
"!",
"mediaType",
".",
"isBinary",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"MediaType must b... | Creates an attachment from a given array of bytes.
The bytes will be Base64 encoded.
@throws java.lang.IllegalArgumentException if mediaType is not binary | [
"Creates",
"an",
"attachment",
"from",
"a",
"given",
"array",
"of",
"bytes",
".",
"The",
"bytes",
"will",
"be",
"Base64",
"encoded",
"."
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java#L163-L168 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/util/GraphicUtils.java | GraphicUtils.fillCircle | public static void fillCircle(Graphics g, int centerX, int centerY, int diam, Color color) {
"""
Draws a circle with the specified diameter using the given point coordinates as center
and fills it with the given color.
@param g Graphics context
@param centerX X coordinate of circle center
@param centerY Y coor... | java | public static void fillCircle(Graphics g, int centerX, int centerY, int diam, Color color){
Color c = g.getColor();
g.setColor(color);
fillCircle(g, centerX, centerY, diam);
g.setColor(c);
} | [
"public",
"static",
"void",
"fillCircle",
"(",
"Graphics",
"g",
",",
"int",
"centerX",
",",
"int",
"centerY",
",",
"int",
"diam",
",",
"Color",
"color",
")",
"{",
"Color",
"c",
"=",
"g",
".",
"getColor",
"(",
")",
";",
"g",
".",
"setColor",
"(",
"c... | Draws a circle with the specified diameter using the given point coordinates as center
and fills it with the given color.
@param g Graphics context
@param centerX X coordinate of circle center
@param centerY Y coordinate of circle center
@param diam Circle diameter | [
"Draws",
"a",
"circle",
"with",
"the",
"specified",
"diameter",
"using",
"the",
"given",
"point",
"coordinates",
"as",
"center",
"and",
"fills",
"it",
"with",
"the",
"given",
"color",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/util/GraphicUtils.java#L76-L81 |
3redronin/mu-server | src/main/java/io/muserver/handlers/ResourceHandler.java | ResourceHandler.fileOrClasspath | @Deprecated
public static ResourceHandler.Builder fileOrClasspath(String fileRootIfExists, String classpathRoot) {
"""
Creates a resource handler that serves from the file system if the directory exists; otherwise from the class path.
<p>
A common use case is for when you want to serve from the file path at ... | java | @Deprecated
public static ResourceHandler.Builder fileOrClasspath(String fileRootIfExists, String classpathRoot) {
Path path = Paths.get(fileRootIfExists);
if (Files.isDirectory(path)) {
return fileHandler(path);
} else {
return classpathHandler(classpathRoot);
... | [
"@",
"Deprecated",
"public",
"static",
"ResourceHandler",
".",
"Builder",
"fileOrClasspath",
"(",
"String",
"fileRootIfExists",
",",
"String",
"classpathRoot",
")",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"fileRootIfExists",
")",
";",
"if",
"(",
"F... | Creates a resource handler that serves from the file system if the directory exists; otherwise from the class path.
<p>
A common use case is for when you want to serve from the file path at development time (so you can update
files without restarting) but at deploy time resources are packaged in an uber jar.
@param fil... | [
"Creates",
"a",
"resource",
"handler",
"that",
"serves",
"from",
"the",
"file",
"system",
"if",
"the",
"directory",
"exists",
";",
"otherwise",
"from",
"the",
"class",
"path",
".",
"<p",
">",
"A",
"common",
"use",
"case",
"is",
"for",
"when",
"you",
"wan... | train | https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/handlers/ResourceHandler.java#L260-L268 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/request/Headers.java | Headers.addHeader | public void addHeader( String name, String value ) {
"""
Add a new header to the list
@param name The header name
@param value The header value
"""
headers.add( new BasicHeader( name, value ) );
} | java | public void addHeader( String name, String value )
{
headers.add( new BasicHeader( name, value ) );
} | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"headers",
".",
"add",
"(",
"new",
"BasicHeader",
"(",
"name",
",",
"value",
")",
")",
";",
"}"
] | Add a new header to the list
@param name The header name
@param value The header value | [
"Add",
"a",
"new",
"header",
"to",
"the",
"list"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/Headers.java#L52-L55 |
rundeck/rundeck | rundeck-storage/rundeck-storage-api/src/main/java/org/rundeck/storage/api/PathUtil.java | PathUtil.hasRoot | public static boolean hasRoot(Path path, Path root) {
"""
@return true if the given path starts with the given root
@param path test path
@param root root
"""
return hasRoot(path.getPath(), root.getPath());
} | java | public static boolean hasRoot(Path path, Path root) {
return hasRoot(path.getPath(), root.getPath());
} | [
"public",
"static",
"boolean",
"hasRoot",
"(",
"Path",
"path",
",",
"Path",
"root",
")",
"{",
"return",
"hasRoot",
"(",
"path",
".",
"getPath",
"(",
")",
",",
"root",
".",
"getPath",
"(",
")",
")",
";",
"}"
] | @return true if the given path starts with the given root
@param path test path
@param root root | [
"@return",
"true",
"if",
"the",
"given",
"path",
"starts",
"with",
"the",
"given",
"root"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeck-storage/rundeck-storage-api/src/main/java/org/rundeck/storage/api/PathUtil.java#L138-L140 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.