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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getRootPath | protected String getRootPath(CmsUUID structureId, boolean online) throws CmsException {
"""
Gets the root path for a given resource structure id.<p>
@param structureId the structure id
@param online if true, the resource will be looked up in the online project ,else in the offline project
@return the root p... | java | protected String getRootPath(CmsUUID structureId, boolean online) throws CmsException {
CmsConfigurationCache cache = online ? m_onlineCache : m_offlineCache;
return cache.getPathForStructureId(structureId);
} | [
"protected",
"String",
"getRootPath",
"(",
"CmsUUID",
"structureId",
",",
"boolean",
"online",
")",
"throws",
"CmsException",
"{",
"CmsConfigurationCache",
"cache",
"=",
"online",
"?",
"m_onlineCache",
":",
"m_offlineCache",
";",
"return",
"cache",
".",
"getPathForS... | Gets the root path for a given resource structure id.<p>
@param structureId the structure id
@param online if true, the resource will be looked up in the online project ,else in the offline project
@return the root path for the given structure id
@throws CmsException if something goes wrong | [
"Gets",
"the",
"root",
"path",
"for",
"a",
"given",
"resource",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L1426-L1430 |
taimos/dvalin | mongodb/src/main/java/de/taimos/dvalin/mongo/ChangelogUtil.java | ChangelogUtil.addIndex | public static void addIndex(DBCollection collection, String field, boolean asc, boolean background) {
"""
Add an index on the given collection and field
@param collection the collection to use for the index
@param field the field to use for the index
@param asc the sorting direction. <code>true</c... | java | public static void addIndex(DBCollection collection, String field, boolean asc, boolean background) {
int dir = (asc) ? 1 : -1;
collection.createIndex(new BasicDBObject(field, dir), new BasicDBObject("background", background));
} | [
"public",
"static",
"void",
"addIndex",
"(",
"DBCollection",
"collection",
",",
"String",
"field",
",",
"boolean",
"asc",
",",
"boolean",
"background",
")",
"{",
"int",
"dir",
"=",
"(",
"asc",
")",
"?",
"1",
":",
"-",
"1",
";",
"collection",
".",
"crea... | Add an index on the given collection and field
@param collection the collection to use for the index
@param field the field to use for the index
@param asc the sorting direction. <code>true</code> to sort ascending; <code>false</code> to sort descending
@param background iff <code>true</code> the index is ... | [
"Add",
"an",
"index",
"on",
"the",
"given",
"collection",
"and",
"field"
] | train | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/mongodb/src/main/java/de/taimos/dvalin/mongo/ChangelogUtil.java#L62-L65 |
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java | SharedPreferenceUtils.initWith | public static SharedPreferenceUtils initWith(Context context, String name) {
"""
Init SharedPreferences with context and a SharedPreferences name
@param context:
Context to init SharedPreferences
@param name:
Name of SharedPreferences file. If you pass <code>null</code> it will create default SharedPrefernce... | java | public static SharedPreferenceUtils initWith(Context context, String name) {
if (sharedPreferenceUtils == null) {
sharedPreferenceUtils = new SharedPreferenceUtils();
}
if (isEmptyString(name)) {
sharedPreferenceUtils.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
} else {
... | [
"public",
"static",
"SharedPreferenceUtils",
"initWith",
"(",
"Context",
"context",
",",
"String",
"name",
")",
"{",
"if",
"(",
"sharedPreferenceUtils",
"==",
"null",
")",
"{",
"sharedPreferenceUtils",
"=",
"new",
"SharedPreferenceUtils",
"(",
")",
";",
"}",
"if... | Init SharedPreferences with context and a SharedPreferences name
@param context:
Context to init SharedPreferences
@param name:
Name of SharedPreferences file. If you pass <code>null</code> it will create default SharedPrefernces
@return: SharedPreferenceUtils object. It will store given the sharedPreferences value w... | [
"Init",
"SharedPreferences",
"with",
"context",
"and",
"a",
"SharedPreferences",
"name"
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java#L63-L73 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.setupRecordListener | public BaseMessageFilter setupRecordListener(JMessageListener listener, boolean bTrackMultipleRecords, boolean bAllowEchos) {
"""
Set up a listener to notify when an external change is made to the current record.
@param listener The listener to set to the new filter. If null, use the record's recordowner.
@param... | java | public BaseMessageFilter setupRecordListener(JMessageListener listener, boolean bTrackMultipleRecords, boolean bAllowEchos)
{
boolean bReceiveAllAdds = false;
if (((this.getDatabaseType() & DBConstants.TABLE_MASK) == DBConstants.TABLE)
|| ((this.getDatabaseType() & DBConstants.TABLE_MASK... | [
"public",
"BaseMessageFilter",
"setupRecordListener",
"(",
"JMessageListener",
"listener",
",",
"boolean",
"bTrackMultipleRecords",
",",
"boolean",
"bAllowEchos",
")",
"{",
"boolean",
"bReceiveAllAdds",
"=",
"false",
";",
"if",
"(",
"(",
"(",
"this",
".",
"getDataba... | Set up a listener to notify when an external change is made to the current record.
@param listener The listener to set to the new filter. If null, use the record's recordowner.
@param bTrackMultipleRecord Use a GridRecordMessageFilter to watch for multiple records.
@param bAllowEchos Allow this record to be notified of... | [
"Set",
"up",
"a",
"listener",
"to",
"notify",
"when",
"an",
"external",
"change",
"is",
"made",
"to",
"the",
"current",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2782-L2790 |
mpetazzoni/ttorrent | ttorrent-tracker/src/main/java/com/turn/ttorrent/tracker/TrackerRequestProcessor.java | TrackerRequestProcessor.serveError | private void serveError(Status status, String error, RequestHandler requestHandler) throws IOException {
"""
Write an error message to the response with the given HTTP status code.
@param status The HTTP status code to return.
@param error The error message reported by the tracker.
"""
this.serveError... | java | private void serveError(Status status, String error, RequestHandler requestHandler) throws IOException {
this.serveError(status, HTTPTrackerErrorMessage.craft(error), requestHandler);
} | [
"private",
"void",
"serveError",
"(",
"Status",
"status",
",",
"String",
"error",
",",
"RequestHandler",
"requestHandler",
")",
"throws",
"IOException",
"{",
"this",
".",
"serveError",
"(",
"status",
",",
"HTTPTrackerErrorMessage",
".",
"craft",
"(",
"error",
")... | Write an error message to the response with the given HTTP status code.
@param status The HTTP status code to return.
@param error The error message reported by the tracker. | [
"Write",
"an",
"error",
"message",
"to",
"the",
"response",
"with",
"the",
"given",
"HTTP",
"status",
"code",
"."
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-tracker/src/main/java/com/turn/ttorrent/tracker/TrackerRequestProcessor.java#L300-L302 |
eclipse/xtext-extras | org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/util/TypeReferences.java | TypeReferences.findDeclaredType | public JvmType findDeclaredType(String typeName, Notifier context) {
"""
looks up a JVMType corresponding to the given {@link Class}. This method ignores any Jvm types created in non-
{@link TypeResource} in the given context's resourceSet, but goes straight to the Java-layer, using a
{@link IJvmTypeProvider}.
... | java | public JvmType findDeclaredType(String typeName, Notifier context) {
if (typeName == null)
throw new NullPointerException("typeName");
if (context == null)
throw new NullPointerException("context");
ResourceSet resourceSet = EcoreUtil2.getResourceSet(context);
if (resourceSet == null)
return null;
//... | [
"public",
"JvmType",
"findDeclaredType",
"(",
"String",
"typeName",
",",
"Notifier",
"context",
")",
"{",
"if",
"(",
"typeName",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"typeName\"",
")",
";",
"if",
"(",
"context",
"==",
"null",
")"... | looks up a JVMType corresponding to the given {@link Class}. This method ignores any Jvm types created in non-
{@link TypeResource} in the given context's resourceSet, but goes straight to the Java-layer, using a
{@link IJvmTypeProvider}.
@return the JvmType with the same qualified name as the given {@link Class} obje... | [
"looks",
"up",
"a",
"JVMType",
"corresponding",
"to",
"the",
"given",
"{",
"@link",
"Class",
"}",
".",
"This",
"method",
"ignores",
"any",
"Jvm",
"types",
"created",
"in",
"non",
"-",
"{",
"@link",
"TypeResource",
"}",
"in",
"the",
"given",
"context",
"s... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/util/TypeReferences.java#L244-L262 |
FrodeRanders/java-vopn | src/main/java/org/gautelis/vopn/xml/Serializer.java | Serializer.obj2Xml | public static String obj2Xml(Class clazz, Object o) throws JAXBException, ParserConfigurationException {
"""
Serializes an object into XML
<p>
You need to catch the JAXBException, but beware that the cause is not conveyed correctly through getCause().
Take a peek at the internal 'cause' member and look out for... | java | public static String obj2Xml(Class clazz, Object o) throws JAXBException, ParserConfigurationException {
Document doc = obj2Doc(clazz, o);
DOMImplementationLS domImplementation = (DOMImplementationLS) doc.getImplementation();
LSSerializer lsSerializer = domImplementation.createLSSerializer();
... | [
"public",
"static",
"String",
"obj2Xml",
"(",
"Class",
"clazz",
",",
"Object",
"o",
")",
"throws",
"JAXBException",
",",
"ParserConfigurationException",
"{",
"Document",
"doc",
"=",
"obj2Doc",
"(",
"clazz",
",",
"o",
")",
";",
"DOMImplementationLS",
"domImplemen... | Serializes an object into XML
<p>
You need to catch the JAXBException, but beware that the cause is not conveyed correctly through getCause().
Take a peek at the internal 'cause' member and look out for detailed information about the problem.
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts o... | [
"Serializes",
"an",
"object",
"into",
"XML",
"<p",
">",
"You",
"need",
"to",
"catch",
"the",
"JAXBException",
"but",
"beware",
"that",
"the",
"cause",
"is",
"not",
"conveyed",
"correctly",
"through",
"getCause",
"()",
".",
"Take",
"a",
"peek",
"at",
"the",... | train | https://github.com/FrodeRanders/java-vopn/blob/4c7b2f90201327af4eaa3cd46b3fee68f864e5cc/src/main/java/org/gautelis/vopn/xml/Serializer.java#L92-L116 |
haifengl/smile | core/src/main/java/smile/feature/MaxAbsScaler.java | MaxAbsScaler.transform | @Override
public double[] transform(double[] x) {
"""
Scales each feature by its maximum absolute value.
@param x a vector to be scaled. The vector will be modified on output.
@return the input vector.
"""
if (x.length != scale.length) {
throw new IllegalArgumentException(String.forma... | java | @Override
public double[] transform(double[] x) {
if (x.length != scale.length) {
throw new IllegalArgumentException(String.format("Invalid vector size %d, expected %d", x.length, scale.length));
}
double[] y = copy ? new double[x.length] : x;
for (int i = 0; i < x.lengt... | [
"@",
"Override",
"public",
"double",
"[",
"]",
"transform",
"(",
"double",
"[",
"]",
"x",
")",
"{",
"if",
"(",
"x",
".",
"length",
"!=",
"scale",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
... | Scales each feature by its maximum absolute value.
@param x a vector to be scaled. The vector will be modified on output.
@return the input vector. | [
"Scales",
"each",
"feature",
"by",
"its",
"maximum",
"absolute",
"value",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/feature/MaxAbsScaler.java#L79-L91 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.beginReset | public void beginReset(String resourceGroupName, String accountName, String liveEventName) {
"""
Reset Live Event.
Resets an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The... | java | public void beginReset(String resourceGroupName, String accountName, String liveEventName) {
beginResetWithServiceResponseAsync(resourceGroupName, accountName, liveEventName).toBlocking().single().body();
} | [
"public",
"void",
"beginReset",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
")",
"{",
"beginResetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"liveEventName",
")",
".",
"toBlocking",
... | Reset Live Event.
Resets an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ... | [
"Reset",
"Live",
"Event",
".",
"Resets",
"an",
"existing",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L1734-L1736 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.detectWithUrl | public List<DetectedFace> detectWithUrl(String url, DetectWithUrlOptionalParameter detectWithUrlOptionalParameter) {
"""
Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param url Publicly reachable URL of an image
@param detectWithUrlOptionalP... | java | public List<DetectedFace> detectWithUrl(String url, DetectWithUrlOptionalParameter detectWithUrlOptionalParameter) {
return detectWithUrlWithServiceResponseAsync(url, detectWithUrlOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"DetectedFace",
">",
"detectWithUrl",
"(",
"String",
"url",
",",
"DetectWithUrlOptionalParameter",
"detectWithUrlOptionalParameter",
")",
"{",
"return",
"detectWithUrlWithServiceResponseAsync",
"(",
"url",
",",
"detectWithUrlOptionalParameter",
")",
"... | Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param url Publicly reachable URL of an image
@param detectWithUrlOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException throw... | [
"Detect",
"human",
"faces",
"in",
"an",
"image",
"and",
"returns",
"face",
"locations",
"and",
"optionally",
"with",
"faceIds",
"landmarks",
"and",
"attributes",
"."
] | 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/FacesImpl.java#L657-L659 |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/DocxStamperConfiguration.java | DocxStamperConfiguration.addTypeResolver | public <T> DocxStamperConfiguration addTypeResolver(Class<T> resolvedType, ITypeResolver resolver) {
"""
<p>
Registers the given ITypeResolver for the given class. The registered ITypeResolver's resolve() method will only
be called with objects of the specified class.
</p>
<p>
Note that each type can only be ... | java | public <T> DocxStamperConfiguration addTypeResolver(Class<T> resolvedType, ITypeResolver resolver) {
this.typeResolvers.put(resolvedType, resolver);
return this;
} | [
"public",
"<",
"T",
">",
"DocxStamperConfiguration",
"addTypeResolver",
"(",
"Class",
"<",
"T",
">",
"resolvedType",
",",
"ITypeResolver",
"resolver",
")",
"{",
"this",
".",
"typeResolvers",
".",
"put",
"(",
"resolvedType",
",",
"resolver",
")",
";",
"return",... | <p>
Registers the given ITypeResolver for the given class. The registered ITypeResolver's resolve() method will only
be called with objects of the specified class.
</p>
<p>
Note that each type can only be resolved by ONE ITypeResolver implementation. Multiple calls to addTypeResolver()
with the same resolvedType parame... | [
"<p",
">",
"Registers",
"the",
"given",
"ITypeResolver",
"for",
"the",
"given",
"class",
".",
"The",
"registered",
"ITypeResolver",
"s",
"resolve",
"()",
"method",
"will",
"only",
"be",
"called",
"with",
"objects",
"of",
"the",
"specified",
"class",
".",
"<"... | train | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/DocxStamperConfiguration.java#L95-L98 |
jillesvangurp/iterables-support | src/main/java/com/jillesvangurp/iterables/Iterables.java | Iterables.castingIterable | public static <I,O> Iterable<O> castingIterable(Iterable<I> it, Class<O> clazz) {
"""
Allows you to iterate over objects and cast them to the appropriate type on the fly.
@param it iterable of I
@param clazz class to cast to
@param <I> input type
@param <O> output type
@return an iterable that casts elements ... | java | public static <I,O> Iterable<O> castingIterable(Iterable<I> it, Class<O> clazz) {
return map(it, new Processor<I,O>() {
@SuppressWarnings("unchecked")
@Override
public O process(I input) {
return (O)input;
}});
} | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"Iterable",
"<",
"O",
">",
"castingIterable",
"(",
"Iterable",
"<",
"I",
">",
"it",
",",
"Class",
"<",
"O",
">",
"clazz",
")",
"{",
"return",
"map",
"(",
"it",
",",
"new",
"Processor",
"<",
"I",
",",
... | Allows you to iterate over objects and cast them to the appropriate type on the fly.
@param it iterable of I
@param clazz class to cast to
@param <I> input type
@param <O> output type
@return an iterable that casts elements to the specified class.
@throws ClassCastException if the elements are not castable | [
"Allows",
"you",
"to",
"iterate",
"over",
"objects",
"and",
"cast",
"them",
"to",
"the",
"appropriate",
"type",
"on",
"the",
"fly",
"."
] | train | https://github.com/jillesvangurp/iterables-support/blob/a0a967d82fb7d8d5504a50eb19d5e7f1541b2771/src/main/java/com/jillesvangurp/iterables/Iterables.java#L298-L305 |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.setVersion | protected static void setVersion(Selenified clazz, ITestContext context, String version) {
"""
Sets the version of the current test suite being executed.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run a... | java | protected static void setVersion(Selenified clazz, ITestContext context, String version) {
context.setAttribute(clazz.getClass().getName() + "Version", version);
} | [
"protected",
"static",
"void",
"setVersion",
"(",
"Selenified",
"clazz",
",",
"ITestContext",
"context",
",",
"String",
"version",
")",
"{",
"context",
".",
"setAttribute",
"(",
"clazz",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\"Version\""... | Sets the version of the current test suite being executed.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associated with the test suite, used for
storing app... | [
"Sets",
"the",
"version",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
"."
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L135-L137 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java | PoolablePreparedStatement.setDate | @Override
public void setDate(int parameterIndex, Date x) throws SQLException {
"""
Method setDate.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setDate(int, Date)
"""
internalStmt.setDate(parameterIndex, x);
} | java | @Override
public void setDate(int parameterIndex, Date x) throws SQLException {
internalStmt.setDate(parameterIndex, x);
} | [
"@",
"Override",
"public",
"void",
"setDate",
"(",
"int",
"parameterIndex",
",",
"Date",
"x",
")",
"throws",
"SQLException",
"{",
"internalStmt",
".",
"setDate",
"(",
"parameterIndex",
",",
"x",
")",
";",
"}"
] | Method setDate.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setDate(int, Date) | [
"Method",
"setDate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L711-L714 |
mozilla/rhino | src/org/mozilla/classfile/ClassFileWriter.java | ClassFileWriter.classNameToSignature | public static String classNameToSignature(String name) {
"""
Convert Java class name in dot notation into "Lname-with-dots-replaced-by-slashes;" form
suitable for use as JVM type signatures.
"""
int nameLength = name.length();
int colonPos = 1 + nameLength;
char[] buf = new char[colonP... | java | public static String classNameToSignature(String name) {
int nameLength = name.length();
int colonPos = 1 + nameLength;
char[] buf = new char[colonPos + 1];
buf[0] = 'L';
buf[colonPos] = ';';
name.getChars(0, nameLength, buf, 1);
for (int i = 1; i != colonPos; ++i... | [
"public",
"static",
"String",
"classNameToSignature",
"(",
"String",
"name",
")",
"{",
"int",
"nameLength",
"=",
"name",
".",
"length",
"(",
")",
";",
"int",
"colonPos",
"=",
"1",
"+",
"nameLength",
";",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"["... | Convert Java class name in dot notation into "Lname-with-dots-replaced-by-slashes;" form
suitable for use as JVM type signatures. | [
"Convert",
"Java",
"class",
"name",
"in",
"dot",
"notation",
"into",
"Lname",
"-",
"with",
"-",
"dots",
"-",
"replaced",
"-",
"by",
"-",
"slashes",
";",
"form",
"suitable",
"for",
"use",
"as",
"JVM",
"type",
"signatures",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/classfile/ClassFileWriter.java#L113-L126 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.newHashMap | public static <K, V> HashMap<K, V> newHashMap(boolean isOrder) {
"""
新建一个HashMap
@param <K> Key类型
@param <V> Value类型
@param isOrder Map的Key是否有序,有序返回 {@link LinkedHashMap},否则返回 {@link HashMap}
@return HashMap对象
"""
return newHashMap(DEFAULT_INITIAL_CAPACITY, isOrder);
} | java | public static <K, V> HashMap<K, V> newHashMap(boolean isOrder) {
return newHashMap(DEFAULT_INITIAL_CAPACITY, isOrder);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HashMap",
"<",
"K",
",",
"V",
">",
"newHashMap",
"(",
"boolean",
"isOrder",
")",
"{",
"return",
"newHashMap",
"(",
"DEFAULT_INITIAL_CAPACITY",
",",
"isOrder",
")",
";",
"}"
] | 新建一个HashMap
@param <K> Key类型
@param <V> Value类型
@param isOrder Map的Key是否有序,有序返回 {@link LinkedHashMap},否则返回 {@link HashMap}
@return HashMap对象 | [
"新建一个HashMap"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L106-L108 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.getComputeNodeRemoteLoginSettings | public ComputeNodeGetRemoteLoginSettingsResult getComputeNodeRemoteLoginSettings(String poolId, String nodeId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Gets the settings required for remote login to a compute node.
@param poolId The ID of the pool that con... | java | public ComputeNodeGetRemoteLoginSettingsResult getComputeNodeRemoteLoginSettings(String poolId, String nodeId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
ComputeNodeGetRemoteLoginSettingsOptions options = new ComputeNodeGetRemoteLoginSettingsOptions();
B... | [
"public",
"ComputeNodeGetRemoteLoginSettingsResult",
"getComputeNodeRemoteLoginSettings",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
... | Gets the settings required for remote login to a compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node for which to get a remote login settings.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Bat... | [
"Gets",
"the",
"settings",
"required",
"for",
"remote",
"login",
"to",
"a",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L490-L496 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDatasetRepository.java | FileSystemDatasetRepository.pathForDataset | @edu.umd.cs.findbugs.annotations.SuppressWarnings(
value="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification="Checked in precondition")
static Path pathForDataset(Path root, @Nullable String namespace, @Nullable String name) {
"""
Returns the correct dataset path for the given name a... | java | @edu.umd.cs.findbugs.annotations.SuppressWarnings(
value="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification="Checked in precondition")
static Path pathForDataset(Path root, @Nullable String namespace, @Nullable String name) {
Preconditions.checkNotNull(namespace, "Namespace cannot be... | [
"@",
"edu",
".",
"umd",
".",
"cs",
".",
"findbugs",
".",
"annotations",
".",
"SuppressWarnings",
"(",
"value",
"=",
"\"NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE\"",
",",
"justification",
"=",
"\"Checked in precondition\"",
")",
"static",
"Path",
"pathForDatase... | Returns the correct dataset path for the given name and root directory.
@param root A Path
@param name A String dataset name
@return the correct dataset Path | [
"Returns",
"the",
"correct",
"dataset",
"path",
"for",
"the",
"given",
"name",
"and",
"root",
"directory",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDatasetRepository.java#L311-L320 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/geohash/SpatialKeyAlgo.java | SpatialKeyAlgo.decode | @Override
public final void decode(long spatialKey, GHPoint latLon) {
"""
This method returns latitude and longitude via latLon - calculated from specified spatialKey
<p>
@param spatialKey is the input
"""
// Performance: calculating 'midLon' and 'midLat' on the fly is not slower than using
... | java | @Override
public final void decode(long spatialKey, GHPoint latLon) {
// Performance: calculating 'midLon' and 'midLat' on the fly is not slower than using
// precalculated values from arrays and for 'bits' a precalculated array is even slightly slower!
// Use the value in the middle => st... | [
"@",
"Override",
"public",
"final",
"void",
"decode",
"(",
"long",
"spatialKey",
",",
"GHPoint",
"latLon",
")",
"{",
"// Performance: calculating 'midLon' and 'midLat' on the fly is not slower than using ",
"// precalculated values from arrays and for 'bits' a precalculated array is ev... | This method returns latitude and longitude via latLon - calculated from specified spatialKey
<p>
@param spatialKey is the input | [
"This",
"method",
"returns",
"latitude",
"and",
"longitude",
"via",
"latLon",
"-",
"calculated",
"from",
"specified",
"spatialKey",
"<p",
">"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/geohash/SpatialKeyAlgo.java#L194-L229 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/HerokuAPI.java | HerokuAPI.getBuildInfo | public Build getBuildInfo(String appName, String buildId) {
"""
Gets the info for a running build
@param appName See {@link #listApps} for a list of apps that can be used.
@param buildId the unique identifier of the build
"""
return connection.execute(new BuildInfo(appName, buildId), apiKey);
} | java | public Build getBuildInfo(String appName, String buildId) {
return connection.execute(new BuildInfo(appName, buildId), apiKey);
} | [
"public",
"Build",
"getBuildInfo",
"(",
"String",
"appName",
",",
"String",
"buildId",
")",
"{",
"return",
"connection",
".",
"execute",
"(",
"new",
"BuildInfo",
"(",
"appName",
",",
"buildId",
")",
",",
"apiKey",
")",
";",
"}"
] | Gets the info for a running build
@param appName See {@link #listApps} for a list of apps that can be used.
@param buildId the unique identifier of the build | [
"Gets",
"the",
"info",
"for",
"a",
"running",
"build"
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L451-L453 |
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.updateIntent | public OperationStatus updateIntent(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) {
"""
Updates the name of an intent classifier.
@param appId The application ID.
@param versionId The version ID.
@param intentId The intent classifier ID.
@param upda... | java | public OperationStatus updateIntent(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) {
return updateIntentWithServiceResponseAsync(appId, versionId, intentId, updateIntentOptionalParameter).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateIntent",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"intentId",
",",
"UpdateIntentOptionalParameter",
"updateIntentOptionalParameter",
")",
"{",
"return",
"updateIntentWithServiceResponseAsync",
"(",
"appId",
",",
"v... | Updates the name of an intent classifier.
@param appId The application ID.
@param versionId The version ID.
@param intentId The intent classifier ID.
@param updateIntentOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if paramet... | [
"Updates",
"the",
"name",
"of",
"an",
"intent",
"classifier",
"."
] | 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#L2911-L2913 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.findContainerId | private String findContainerId(String imageNameOrAlias, boolean checkAllContainers) throws DockerAccessException {
"""
checkAllContainers: false = only running containers are considered
"""
String id = lookupContainer(imageNameOrAlias);
// check for external container. The image name is interp... | java | private String findContainerId(String imageNameOrAlias, boolean checkAllContainers) throws DockerAccessException {
String id = lookupContainer(imageNameOrAlias);
// check for external container. The image name is interpreted as a *container name* for that case ...
if (id == null) {
... | [
"private",
"String",
"findContainerId",
"(",
"String",
"imageNameOrAlias",
",",
"boolean",
"checkAllContainers",
")",
"throws",
"DockerAccessException",
"{",
"String",
"id",
"=",
"lookupContainer",
"(",
"imageNameOrAlias",
")",
";",
"// check for external container. The ima... | checkAllContainers: false = only running containers are considered | [
"checkAllContainers",
":",
"false",
"=",
"only",
"running",
"containers",
"are",
"considered"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L423-L434 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdServiceImpl.java | MessageBirdServiceImpl.doRequest | <P> APIResponse doRequest(final String method, final String url, final P payload) throws GeneralException {
"""
Actually sends a HTTP request and returns its body and HTTP status code.
@param method HTTP method.
@param url Absolute URL.
@param payload Payload to JSON encode for the request body. May be n... | java | <P> APIResponse doRequest(final String method, final String url, final P payload) throws GeneralException {
HttpURLConnection connection = null;
InputStream inputStream = null;
if (METHOD_PATCH.equalsIgnoreCase(method)) {
// It'd perhaps be cleaner to call this in the constructor, b... | [
"<",
"P",
">",
"APIResponse",
"doRequest",
"(",
"final",
"String",
"method",
",",
"final",
"String",
"url",
",",
"final",
"P",
"payload",
")",
"throws",
"GeneralException",
"{",
"HttpURLConnection",
"connection",
"=",
"null",
";",
"InputStream",
"inputStream",
... | Actually sends a HTTP request and returns its body and HTTP status code.
@param method HTTP method.
@param url Absolute URL.
@param payload Payload to JSON encode for the request body. May be null.
@param <P> Type of the payload.
@return APIResponse containing the response's body and status. | [
"Actually",
"sends",
"a",
"HTTP",
"request",
"and",
"returns",
"its",
"body",
"and",
"HTTP",
"status",
"code",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L219-L253 |
prometheus/client_java | simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java | TextFormat.write004 | public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException {
"""
Write out the text version 0.0.4 of the given MetricFamilySamples.
"""
/* See http://prometheus.io/docs/instrumenting/exposition_formats/
* for the output format specification. */
wh... | java | public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException {
/* See http://prometheus.io/docs/instrumenting/exposition_formats/
* for the output format specification. */
while(mfs.hasMoreElements()) {
Collector.MetricFamilySamples metricFamilySamples... | [
"public",
"static",
"void",
"write004",
"(",
"Writer",
"writer",
",",
"Enumeration",
"<",
"Collector",
".",
"MetricFamilySamples",
">",
"mfs",
")",
"throws",
"IOException",
"{",
"/* See http://prometheus.io/docs/instrumenting/exposition_formats/\n * for the output format sp... | Write out the text version 0.0.4 of the given MetricFamilySamples. | [
"Write",
"out",
"the",
"text",
"version",
"0",
".",
"0",
".",
"4",
"of",
"the",
"given",
"MetricFamilySamples",
"."
] | train | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java#L18-L56 |
baratine/baratine | framework/src/main/java/com/caucho/v5/config/types/Period.java | Period.periodEnd | public static long periodEnd(long now, long period) {
"""
Calculates the next period end. The calculation is in local time.
@param now the current time in GMT ms since the epoch
@return the time of the next period in GMT ms since the epoch
"""
QDate localCalendar = QDate.allocateLocalDate();
... | java | public static long periodEnd(long now, long period)
{
QDate localCalendar = QDate.allocateLocalDate();
long endTime = periodEnd(now, period, localCalendar);
QDate.freeLocalDate(localCalendar);
return endTime;
} | [
"public",
"static",
"long",
"periodEnd",
"(",
"long",
"now",
",",
"long",
"period",
")",
"{",
"QDate",
"localCalendar",
"=",
"QDate",
".",
"allocateLocalDate",
"(",
")",
";",
"long",
"endTime",
"=",
"periodEnd",
"(",
"now",
",",
"period",
",",
"localCalend... | Calculates the next period end. The calculation is in local time.
@param now the current time in GMT ms since the epoch
@return the time of the next period in GMT ms since the epoch | [
"Calculates",
"the",
"next",
"period",
"end",
".",
"The",
"calculation",
"is",
"in",
"local",
"time",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/config/types/Period.java#L217-L226 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findXMethod | @Deprecated
public static XMethod findXMethod(JavaClass[] classList, String methodName, String methodSig) {
"""
Find XMethod for method in given list of classes, searching the classes
in order.
@param classList
list of classes in which to search
@param methodName
the name of the method
@param methodSig... | java | @Deprecated
public static XMethod findXMethod(JavaClass[] classList, String methodName, String methodSig) {
return findXMethod(classList, methodName, methodSig, ANY_METHOD);
} | [
"@",
"Deprecated",
"public",
"static",
"XMethod",
"findXMethod",
"(",
"JavaClass",
"[",
"]",
"classList",
",",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"findXMethod",
"(",
"classList",
",",
"methodName",
",",
"methodSig",
",",
"A... | Find XMethod for method in given list of classes, searching the classes
in order.
@param classList
list of classes in which to search
@param methodName
the name of the method
@param methodSig
the signature of the method
@return the XMethod, or null if no such method exists in the class | [
"Find",
"XMethod",
"for",
"method",
"in",
"given",
"list",
"of",
"classes",
"searching",
"the",
"classes",
"in",
"order",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L667-L670 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressString.java | IPAddressString.adjustPrefixLength | public IPAddressString adjustPrefixLength(int adjustment) {
"""
Increases or decreases prefix length by the given increment.
<p>
This acts on address strings with an associated prefix length, whether or not there is also an associated address value.
<p>
If the address string has prefix length 0 and represents ... | java | public IPAddressString adjustPrefixLength(int adjustment) {
if(isPrefixOnly()) {
int newBits = adjustment > 0 ? Math.min(IPv6Address.BIT_COUNT, getNetworkPrefixLength() + adjustment) : Math.max(0, getNetworkPrefixLength() + adjustment);
return new IPAddressString(IPAddressNetwork.getPrefixString(newBits), valid... | [
"public",
"IPAddressString",
"adjustPrefixLength",
"(",
"int",
"adjustment",
")",
"{",
"if",
"(",
"isPrefixOnly",
"(",
")",
")",
"{",
"int",
"newBits",
"=",
"adjustment",
">",
"0",
"?",
"Math",
".",
"min",
"(",
"IPv6Address",
".",
"BIT_COUNT",
",",
"getNet... | Increases or decreases prefix length by the given increment.
<p>
This acts on address strings with an associated prefix length, whether or not there is also an associated address value.
<p>
If the address string has prefix length 0 and represents all addresses of the same version,
and the prefix length is being decreas... | [
"Increases",
"or",
"decreases",
"prefix",
"length",
"by",
"the",
"given",
"increment",
".",
"<p",
">",
"This",
"acts",
"on",
"address",
"strings",
"with",
"an",
"associated",
"prefix",
"length",
"whether",
"or",
"not",
"there",
"is",
"also",
"an",
"associate... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressString.java#L843-L860 |
googlemaps/google-maps-services-java | src/main/java/com/google/maps/PlacesApi.java | PlacesApi.nearbySearchQuery | public static NearbySearchRequest nearbySearchQuery(GeoApiContext context, LatLng location) {
"""
Performs a search for nearby Places.
@param context The context on which to make Geo API requests.
@param location The latitude/longitude around which to retrieve place information.
@return Returns a NearbySearch... | java | public static NearbySearchRequest nearbySearchQuery(GeoApiContext context, LatLng location) {
NearbySearchRequest request = new NearbySearchRequest(context);
request.location(location);
return request;
} | [
"public",
"static",
"NearbySearchRequest",
"nearbySearchQuery",
"(",
"GeoApiContext",
"context",
",",
"LatLng",
"location",
")",
"{",
"NearbySearchRequest",
"request",
"=",
"new",
"NearbySearchRequest",
"(",
"context",
")",
";",
"request",
".",
"location",
"(",
"loc... | Performs a search for nearby Places.
@param context The context on which to make Geo API requests.
@param location The latitude/longitude around which to retrieve place information.
@return Returns a NearbySearchRequest that can be configured and executed. | [
"Performs",
"a",
"search",
"for",
"nearby",
"Places",
"."
] | train | https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/PlacesApi.java#L40-L44 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_web_serviceName_changeMainDomain_duration_GET | public OvhOrder hosting_web_serviceName_changeMainDomain_duration_GET(String serviceName, String duration, String domain, OvhMxPlanEnum mxplan) throws IOException {
"""
Get prices and contracts information
REST: GET /order/hosting/web/{serviceName}/changeMainDomain/{duration}
@param domain [required] New domai... | java | public OvhOrder hosting_web_serviceName_changeMainDomain_duration_GET(String serviceName, String duration, String domain, OvhMxPlanEnum mxplan) throws IOException {
String qPath = "/order/hosting/web/{serviceName}/changeMainDomain/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "doma... | [
"public",
"OvhOrder",
"hosting_web_serviceName_changeMainDomain_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"String",
"domain",
",",
"OvhMxPlanEnum",
"mxplan",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/hosting/we... | Get prices and contracts information
REST: GET /order/hosting/web/{serviceName}/changeMainDomain/{duration}
@param domain [required] New domain for change the main domain
@param mxplan [required] MX plan linked to the odl main domain
@param serviceName [required] The internal name of your hosting
@param duration [requ... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4890-L4897 |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendDetail | protected void appendDetail(StringBuilder buffer, String fieldName, Collection<?> coll) {
"""
<p>Append to the <code>toString</code> a <code>Collection</code>.</p>
@param buffer the <code>StringBuilder</code> to populate
@param fieldName the field name, typically not used as already appended
@param coll ... | java | protected void appendDetail(StringBuilder buffer, String fieldName, Collection<?> coll) {
buffer.append(coll);
} | [
"protected",
"void",
"appendDetail",
"(",
"StringBuilder",
"buffer",
",",
"String",
"fieldName",
",",
"Collection",
"<",
"?",
">",
"coll",
")",
"{",
"buffer",
".",
"append",
"(",
"coll",
")",
";",
"}"
] | <p>Append to the <code>toString</code> a <code>Collection</code>.</p>
@param buffer the <code>StringBuilder</code> to populate
@param fieldName the field name, typically not used as already appended
@param coll the <code>Collection</code> to add to the
<code>toString</code>, not <code>null</code> | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"a",
"<code",
">",
"Collection<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L603-L605 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.collect | public Binder collect(int index, Class<?> type) {
"""
Box all incoming arguments from the given position onward into the given array type.
@param index the index from which to start boxing args
@param type the array type into which the args will be boxed
@return a new Binder
"""
return new Binder... | java | public Binder collect(int index, Class<?> type) {
return new Binder(this, new Collect(type(), index, type));
} | [
"public",
"Binder",
"collect",
"(",
"int",
"index",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"new",
"Binder",
"(",
"this",
",",
"new",
"Collect",
"(",
"type",
"(",
")",
",",
"index",
",",
"type",
")",
")",
";",
"}"
] | Box all incoming arguments from the given position onward into the given array type.
@param index the index from which to start boxing args
@param type the array type into which the args will be boxed
@return a new Binder | [
"Box",
"all",
"incoming",
"arguments",
"from",
"the",
"given",
"position",
"onward",
"into",
"the",
"given",
"array",
"type",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L879-L881 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitNaryExpression | public T visitNaryExpression(NaryExpression elm, C context) {
"""
Visit a NaryExpression. This method will be called for
every node in the tree that is a NaryExpression.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
if (elm instanceof ... | java | public T visitNaryExpression(NaryExpression elm, C context) {
if (elm instanceof Coalesce) return visitCoalesce((Coalesce)elm, context);
else if (elm instanceof Concatenate) return visitConcatenate((Concatenate)elm, context);
else if (elm instanceof Except) return visitExcept((Except)elm, contex... | [
"public",
"T",
"visitNaryExpression",
"(",
"NaryExpression",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
"instanceof",
"Coalesce",
")",
"return",
"visitCoalesce",
"(",
"(",
"Coalesce",
")",
"elm",
",",
"context",
")",
";",
"else",
"if",
"(",
... | Visit a NaryExpression. This method will be called for
every node in the tree that is a NaryExpression.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"NaryExpression",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"NaryExpression",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L299-L306 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java | CalendarPanel.labelIndicatorSetColorsToDefaultState | private void labelIndicatorSetColorsToDefaultState(JLabel label) {
"""
labelIndicatorSetColorsToDefaultState, This event is called to set a label indicator to the
state it should have when there is no mouse hovering over it.
"""
if (label == null || settings == null) {
return;
}
... | java | private void labelIndicatorSetColorsToDefaultState(JLabel label) {
if (label == null || settings == null) {
return;
}
if (label == labelMonth || label == labelYear) {
label.setBackground(settings.getColor(DateArea.BackgroundMonthAndYearMenuLabels));
monthAndYe... | [
"private",
"void",
"labelIndicatorSetColorsToDefaultState",
"(",
"JLabel",
"label",
")",
"{",
"if",
"(",
"label",
"==",
"null",
"||",
"settings",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"label",
"==",
"labelMonth",
"||",
"label",
"==",
"labe... | labelIndicatorSetColorsToDefaultState, This event is called to set a label indicator to the
state it should have when there is no mouse hovering over it. | [
"labelIndicatorSetColorsToDefaultState",
"This",
"event",
"is",
"called",
"to",
"set",
"a",
"label",
"indicator",
"to",
"the",
"state",
"it",
"should",
"have",
"when",
"there",
"is",
"no",
"mouse",
"hovering",
"over",
"it",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/CalendarPanel.java#L961-L977 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractMapView.java | AbstractMapView.fireEntryAdded | @SuppressWarnings("unchecked")
protected void fireEntryAdded(K key, V value) {
"""
Fire the addition event.
@param key the added key.
@param value the added value.
"""
if (this.listeners != null) {
for (final DMapListener<? super K, ? super V> listener : this.listeners.getListeners(DMapListener.class... | java | @SuppressWarnings("unchecked")
protected void fireEntryAdded(K key, V value) {
if (this.listeners != null) {
for (final DMapListener<? super K, ? super V> listener : this.listeners.getListeners(DMapListener.class)) {
listener.entryAdded(key, value);
}
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"fireEntryAdded",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"this",
".",
"listeners",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"DMapListener",
"<",
"?",
"super",
... | Fire the addition event.
@param key the added key.
@param value the added value. | [
"Fire",
"the",
"addition",
"event",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractMapView.java#L58-L65 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/impl/InternalPartitionServiceImpl.java | InternalPartitionServiceImpl.createMigrationCommitPartitionState | PartitionRuntimeState createMigrationCommitPartitionState(MigrationInfo migrationInfo) {
"""
Creates a transient PartitionRuntimeState to commit given migration.
Result migration is applied to partition table and migration is added to completed-migrations set.
Version of created partition table is incremented by... | java | PartitionRuntimeState createMigrationCommitPartitionState(MigrationInfo migrationInfo) {
lock.lock();
try {
if (!partitionStateManager.isInitialized()) {
return null;
}
List<MigrationInfo> completedMigrations = migrationManager.getCompletedMigrationsC... | [
"PartitionRuntimeState",
"createMigrationCommitPartitionState",
"(",
"MigrationInfo",
"migrationInfo",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"partitionStateManager",
".",
"isInitialized",
"(",
")",
")",
"{",
"return",
"null",
... | Creates a transient PartitionRuntimeState to commit given migration.
Result migration is applied to partition table and migration is added to completed-migrations set.
Version of created partition table is incremented by 1. | [
"Creates",
"a",
"transient",
"PartitionRuntimeState",
"to",
"commit",
"given",
"migration",
".",
"Result",
"migration",
"is",
"applied",
"to",
"partition",
"table",
"and",
"migration",
"is",
"added",
"to",
"completed",
"-",
"migrations",
"set",
".",
"Version",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/InternalPartitionServiceImpl.java#L444-L466 |
networknt/light-4j | security/src/main/java/com/networknt/security/JwtHelper.java | JwtHelper.verifyJwt | @Deprecated
public static JwtClaims verifyJwt(String jwt, boolean ignoreExpiry) throws InvalidJwtException, ExpiredTokenException {
"""
Verify JWT token format and signature. If ignoreExpiry is true, skip expiry verification, otherwise
verify the expiry before signature verification.
In most cases, we need... | java | @Deprecated
public static JwtClaims verifyJwt(String jwt, boolean ignoreExpiry) throws InvalidJwtException, ExpiredTokenException {
return verifyJwt(jwt, ignoreExpiry, true);
} | [
"@",
"Deprecated",
"public",
"static",
"JwtClaims",
"verifyJwt",
"(",
"String",
"jwt",
",",
"boolean",
"ignoreExpiry",
")",
"throws",
"InvalidJwtException",
",",
"ExpiredTokenException",
"{",
"return",
"verifyJwt",
"(",
"jwt",
",",
"ignoreExpiry",
",",
"true",
")"... | Verify JWT token format and signature. If ignoreExpiry is true, skip expiry verification, otherwise
verify the expiry before signature verification.
In most cases, we need to verify the expiry of the jwt token. The only time we need to ignore expiry
verification is in SPA middleware handlers which need to verify csrf ... | [
"Verify",
"JWT",
"token",
"format",
"and",
"signature",
".",
"If",
"ignoreExpiry",
"is",
"true",
"skip",
"expiry",
"verification",
"otherwise",
"verify",
"the",
"expiry",
"before",
"signature",
"verification",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/security/src/main/java/com/networknt/security/JwtHelper.java#L176-L179 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java | Math.floorDiv | public static int floorDiv(int x, int y) {
"""
Returns the largest (closest to positive infinity)
{@code int} value that is less than or equal to the algebraic quotient.
There is one special case, if the dividend is the
{@linkplain Integer#MIN_VALUE Integer.MIN_VALUE} and the divisor is {@code -1},
then intege... | java | public static int floorDiv(int x, int y) {
int r = x / y;
// if the signs are different and modulo not zero, round down
if ((x ^ y) < 0 && (r * y != x)) {
r--;
}
return r;
} | [
"public",
"static",
"int",
"floorDiv",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"r",
"=",
"x",
"/",
"y",
";",
"// if the signs are different and modulo not zero, round down",
"if",
"(",
"(",
"x",
"^",
"y",
")",
"<",
"0",
"&&",
"(",
"r",
"*",
... | Returns the largest (closest to positive infinity)
{@code int} value that is less than or equal to the algebraic quotient.
There is one special case, if the dividend is the
{@linkplain Integer#MIN_VALUE Integer.MIN_VALUE} and the divisor is {@code -1},
then integer overflow occurs and
the result is equal to the {@code ... | [
"Returns",
"the",
"largest",
"(",
"closest",
"to",
"positive",
"infinity",
")",
"{",
"@code",
"int",
"}",
"value",
"that",
"is",
"less",
"than",
"or",
"equal",
"to",
"the",
"algebraic",
"quotient",
".",
"There",
"is",
"one",
"special",
"case",
"if",
"the... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java#L1056-L1063 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java | BOMUtil.newReader | public static Reader newReader(File file)
throws IOException {
"""
<p>newReader.</p>
@param file a {@link java.io.File} object.
@return a {@link java.io.Reader} object.
@throws java.io.IOException if any.
"""
final String fileEncoding = System.getProperty( "file.encoding", "UTF-8" );
... | java | public static Reader newReader(File file)
throws IOException
{
final String fileEncoding = System.getProperty( "file.encoding", "UTF-8" );
final String greenPepperEncoding = System.getProperty( "greenpepper.file.encoding", fileEncoding );
return newReader( file, greenPepperEncodi... | [
"public",
"static",
"Reader",
"newReader",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"final",
"String",
"fileEncoding",
"=",
"System",
".",
"getProperty",
"(",
"\"file.encoding\"",
",",
"\"UTF-8\"",
")",
";",
"final",
"String",
"greenPepperEncoding",... | <p>newReader.</p>
@param file a {@link java.io.File} object.
@return a {@link java.io.Reader} object.
@throws java.io.IOException if any. | [
"<p",
">",
"newReader",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java#L144-L150 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.copyInputStreamToOutputStreamAndCloseOS | @Nonnull
public static ESuccess copyInputStreamToOutputStreamAndCloseOS (@WillClose @Nullable final InputStream aIS,
@WillClose @Nullable final OutputStream aOS) {
"""
Pass the content of the given input stream to the given output stream. Both
th... | java | @Nonnull
public static ESuccess copyInputStreamToOutputStreamAndCloseOS (@WillClose @Nullable final InputStream aIS,
@WillClose @Nullable final OutputStream aOS)
{
try
{
return copyInputStreamToOutputStream (aIS, aOS, new byte [DEFAULT_... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"copyInputStreamToOutputStreamAndCloseOS",
"(",
"@",
"WillClose",
"@",
"Nullable",
"final",
"InputStream",
"aIS",
",",
"@",
"WillClose",
"@",
"Nullable",
"final",
"OutputStream",
"aOS",
")",
"{",
"try",
"{",
"return"... | Pass the content of the given input stream to the given output stream. Both
the input stream and the output stream are automatically closed.
@param aIS
The input stream to read from. May be <code>null</code>. Automatically
closed!
@param aOS
The output stream to write to. May be <code>null</code>. Automatically
closed... | [
"Pass",
"the",
"content",
"of",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
".",
"Both",
"the",
"input",
"stream",
"and",
"the",
"output",
"stream",
"are",
"automatically",
"closed",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L239-L251 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.getInterfaceWithOutAddOnLoader | public <T> T getInterfaceWithOutAddOnLoader(ScriptWrapper script, Class<T> clasz) throws ScriptException, IOException {
"""
Gets the interface {@code clasz} from the given {@code script}. Might return {@code null} if the {@code script} does not
implement the interface.
<p>
First tries to get the interface direc... | java | public <T> T getInterfaceWithOutAddOnLoader(ScriptWrapper script, Class<T> clasz) throws ScriptException, IOException {
T iface = script.getInterface(clasz);
if (iface != null) {
// the script wrapper has overriden the usual scripting mechanism
return iface;
}
return invokeScriptWithOutAddOnLoader(s... | [
"public",
"<",
"T",
">",
"T",
"getInterfaceWithOutAddOnLoader",
"(",
"ScriptWrapper",
"script",
",",
"Class",
"<",
"T",
">",
"clasz",
")",
"throws",
"ScriptException",
",",
"IOException",
"{",
"T",
"iface",
"=",
"script",
".",
"getInterface",
"(",
"clasz",
"... | Gets the interface {@code clasz} from the given {@code script}. Might return {@code null} if the {@code script} does not
implement the interface.
<p>
First tries to get the interface directly from the {@code script} by calling the method
{@code ScriptWrapper.getInterface(Class)}, if it returns {@code null} the interfac... | [
"Gets",
"the",
"interface",
"{",
"@code",
"clasz",
"}",
"from",
"the",
"given",
"{",
"@code",
"script",
"}",
".",
"Might",
"return",
"{",
"@code",
"null",
"}",
"if",
"the",
"{",
"@code",
"script",
"}",
"does",
"not",
"implement",
"the",
"interface",
".... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L1751-L1758 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getMetadataWithChildrenIfChangedC | public <C> Maybe<DbxEntry./*@Nullable*/WithChildrenC<C>> getMetadataWithChildrenIfChangedC(
String path, boolean includeMediaInfo, /*@Nullable*/String previousFolderHash, Collector<DbxEntry,? extends C> collector)
throws DbxException {
"""
Same as {@link #getMetadataWithChildrenIfChanged} excep... | java | public <C> Maybe<DbxEntry./*@Nullable*/WithChildrenC<C>> getMetadataWithChildrenIfChangedC(
String path, boolean includeMediaInfo, /*@Nullable*/String previousFolderHash, Collector<DbxEntry,? extends C> collector)
throws DbxException
{
return getMetadataWithChildrenIfChangedBase(path, in... | [
"public",
"<",
"C",
">",
"Maybe",
"<",
"DbxEntry",
".",
"/*@Nullable*/",
"WithChildrenC",
"<",
"C",
">",
">",
"getMetadataWithChildrenIfChangedC",
"(",
"String",
"path",
",",
"boolean",
"includeMediaInfo",
",",
"/*@Nullable*/",
"String",
"previousFolderHash",
",",
... | Same as {@link #getMetadataWithChildrenIfChanged} except instead of always returning a list of
{@link DbxEntry} objects, you specify a {@link Collector} that processes the {@link DbxEntry}
objects one by one and aggregates them however you want.
<p>
This allows your to process the {@link DbxEntry} values as they arriv... | [
"Same",
"as",
"{",
"@link",
"#getMetadataWithChildrenIfChanged",
"}",
"except",
"instead",
"of",
"always",
"returning",
"a",
"list",
"of",
"{",
"@link",
"DbxEntry",
"}",
"objects",
"you",
"specify",
"a",
"{",
"@link",
"Collector",
"}",
"that",
"processes",
"th... | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L294-L299 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AbstractAlgorithmRunner.java | AbstractAlgorithmRunner.printQualityIndicators | public static <S extends Solution<?>> void printQualityIndicators(List<S> population, String paretoFrontFile)
throws FileNotFoundException {
"""
Print all the available quality indicators
@param population
@param paretoFrontFile
@throws FileNotFoundException
"""
Front referenceFront = new ArrayFro... | java | public static <S extends Solution<?>> void printQualityIndicators(List<S> population, String paretoFrontFile)
throws FileNotFoundException {
Front referenceFront = new ArrayFront(paretoFrontFile);
FrontNormalizer frontNormalizer = new FrontNormalizer(referenceFront) ;
Front normalizedReferenceFront =... | [
"public",
"static",
"<",
"S",
"extends",
"Solution",
"<",
"?",
">",
">",
"void",
"printQualityIndicators",
"(",
"List",
"<",
"S",
">",
"population",
",",
"String",
"paretoFrontFile",
")",
"throws",
"FileNotFoundException",
"{",
"Front",
"referenceFront",
"=",
... | Print all the available quality indicators
@param population
@param paretoFrontFile
@throws FileNotFoundException | [
"Print",
"all",
"the",
"available",
"quality",
"indicators"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AbstractAlgorithmRunner.java#L47-L91 |
darrachequesne/spring-data-jpa-datatables | src/main/java/org/springframework/data/jpa/datatables/mapping/DataTablesInput.java | DataTablesInput.addColumn | public void addColumn(String columnName, boolean searchable, boolean orderable,
String searchValue) {
"""
Add a new column
@param columnName the name of the column
@param searchable whether the column is searchable or not
@param orderable whether the column is orderable or not
@param searchValue if any... | java | public void addColumn(String columnName, boolean searchable, boolean orderable,
String searchValue) {
this.columns.add(new Column(columnName, "", searchable, orderable,
new Search(searchValue, false)));
} | [
"public",
"void",
"addColumn",
"(",
"String",
"columnName",
",",
"boolean",
"searchable",
",",
"boolean",
"orderable",
",",
"String",
"searchValue",
")",
"{",
"this",
".",
"columns",
".",
"add",
"(",
"new",
"Column",
"(",
"columnName",
",",
"\"\"",
",",
"s... | Add a new column
@param columnName the name of the column
@param searchable whether the column is searchable or not
@param orderable whether the column is orderable or not
@param searchValue if any, the search value to apply | [
"Add",
"a",
"new",
"column"
] | train | https://github.com/darrachequesne/spring-data-jpa-datatables/blob/0174dec8f52595a8e4b79f32c79922d64b02b732/src/main/java/org/springframework/data/jpa/datatables/mapping/DataTablesInput.java#L100-L104 |
meertensinstituut/mtas | src/main/java/mtas/codec/util/CodecInfo.java | CodecInfo.getDoc | public IndexDoc getDoc(String field, int docId) {
"""
Gets the doc.
@param field
the field
@param docId
the doc id
@return the doc
"""
if (fieldReferences.containsKey(field)) {
FieldReferences fr = fieldReferences.get(field);
try {
IndexInput inIndexDocId = indexInputList.get("in... | java | public IndexDoc getDoc(String field, int docId) {
if (fieldReferences.containsKey(field)) {
FieldReferences fr = fieldReferences.get(field);
try {
IndexInput inIndexDocId = indexInputList.get("indexDocId");
ArrayList<MtasTreeHit<?>> list = CodecSearchTree.searchMtasTree(docId,
... | [
"public",
"IndexDoc",
"getDoc",
"(",
"String",
"field",
",",
"int",
"docId",
")",
"{",
"if",
"(",
"fieldReferences",
".",
"containsKey",
"(",
"field",
")",
")",
"{",
"FieldReferences",
"fr",
"=",
"fieldReferences",
".",
"get",
"(",
"field",
")",
";",
"tr... | Gets the doc.
@param field
the field
@param docId
the doc id
@return the doc | [
"Gets",
"the",
"doc",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecInfo.java#L566-L582 |
johnkil/Android-ProgressFragment | progressfragment-native/src/com/devspark/progressfragment/ProgressGridFragment.java | ProgressGridFragment.setGridShown | private void setGridShown(boolean shown, boolean animate) {
"""
Control whether the grid is being displayed. You can make it not
displayed if you are waiting for the initial data to show in it. During
this time an indeterminant progress indicator will be shown instead.
@param shown If true, the grid view ... | java | private void setGridShown(boolean shown, boolean animate) {
ensureList();
if (mProgressContainer == null) {
throw new IllegalStateException("Can't be used with a custom content view");
}
if (mGridShown == shown) {
return;
}
mGridShown = shown;
... | [
"private",
"void",
"setGridShown",
"(",
"boolean",
"shown",
",",
"boolean",
"animate",
")",
"{",
"ensureList",
"(",
")",
";",
"if",
"(",
"mProgressContainer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Can't be used with a custom cont... | Control whether the grid is being displayed. You can make it not
displayed if you are waiting for the initial data to show in it. During
this time an indeterminant progress indicator will be shown instead.
@param shown If true, the grid view is shown; if false, the progress
indicator. The initial value is true.
@... | [
"Control",
"whether",
"the",
"grid",
"is",
"being",
"displayed",
".",
"You",
"can",
"make",
"it",
"not",
"displayed",
"if",
"you",
"are",
"waiting",
"for",
"the",
"initial",
"data",
"to",
"show",
"in",
"it",
".",
"During",
"this",
"time",
"an",
"indeterm... | train | https://github.com/johnkil/Android-ProgressFragment/blob/f4b3b969f36f3ac9598c662722630f9ffb151bd6/progressfragment-native/src/com/devspark/progressfragment/ProgressGridFragment.java#L221-L255 |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java | MediaModuleGenerator.generatePeerLinks | private void generatePeerLinks(final Metadata m, final Element e) {
"""
Generation of peerLink tags.
@param m source
@param e element to attach new element to
"""
for (final PeerLink peerLink : m.getPeerLinks()) {
final Element peerLinkElement = new Element("peerLink", NS);
... | java | private void generatePeerLinks(final Metadata m, final Element e) {
for (final PeerLink peerLink : m.getPeerLinks()) {
final Element peerLinkElement = new Element("peerLink", NS);
addNotNullAttribute(peerLinkElement, "type", peerLink.getType());
addNotNullAttribute(peerLinkEl... | [
"private",
"void",
"generatePeerLinks",
"(",
"final",
"Metadata",
"m",
",",
"final",
"Element",
"e",
")",
"{",
"for",
"(",
"final",
"PeerLink",
"peerLink",
":",
"m",
".",
"getPeerLinks",
"(",
")",
")",
"{",
"final",
"Element",
"peerLinkElement",
"=",
"new"... | Generation of peerLink tags.
@param m source
@param e element to attach new element to | [
"Generation",
"of",
"peerLink",
"tags",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java#L414-L423 |
graphql-java/graphql-java | src/main/java/graphql/language/NodeTraverser.java | NodeTraverser.preOrder | public Object preOrder(NodeVisitor nodeVisitor, Node root) {
"""
Version of {@link #preOrder(NodeVisitor, Collection)} with one root.
@param nodeVisitor the visitor of the nodes
@param root the root node
@return the accumulation result of this traversal
"""
return preOrder(nodeVisitor, Co... | java | public Object preOrder(NodeVisitor nodeVisitor, Node root) {
return preOrder(nodeVisitor, Collections.singleton(root));
} | [
"public",
"Object",
"preOrder",
"(",
"NodeVisitor",
"nodeVisitor",
",",
"Node",
"root",
")",
"{",
"return",
"preOrder",
"(",
"nodeVisitor",
",",
"Collections",
".",
"singleton",
"(",
"root",
")",
")",
";",
"}"
] | Version of {@link #preOrder(NodeVisitor, Collection)} with one root.
@param nodeVisitor the visitor of the nodes
@param root the root node
@return the accumulation result of this traversal | [
"Version",
"of",
"{",
"@link",
"#preOrder",
"(",
"NodeVisitor",
"Collection",
")",
"}",
"with",
"one",
"root",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/language/NodeTraverser.java#L90-L92 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateCertificateAsync | public Observable<CertificateBundle> updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion) {
"""
Updates the specified attributes associated with the given certificate.
The UpdateCertificate operation applies the specified update on the given certificate; the only elements... | java | public Observable<CertificateBundle> updateCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion) {
return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion).map(new Func1<ServiceResponse<CertificateBundle>, CertificateBundle>() {
... | [
"public",
"Observable",
"<",
"CertificateBundle",
">",
"updateCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"certificateVersion",
")",
"{",
"return",
"updateCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
... | Updates the specified attributes associated with the given certificate.
The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission.
@param vaultBaseUrl The vault name, for ... | [
"Updates",
"the",
"specified",
"attributes",
"associated",
"with",
"the",
"given",
"certificate",
".",
"The",
"UpdateCertificate",
"operation",
"applies",
"the",
"specified",
"update",
"on",
"the",
"given",
"certificate",
";",
"the",
"only",
"elements",
"updated",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7366-L7373 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.copyReaderToWriter | @Nonnull
public static ESuccess copyReaderToWriter (@WillClose @Nullable final Reader aReader,
@WillNotClose @Nullable final Writer aWriter) {
"""
Pass the content of the given reader to the given writer. The reader is
automatically closed, whereas the writer stays o... | java | @Nonnull
public static ESuccess copyReaderToWriter (@WillClose @Nullable final Reader aReader,
@WillNotClose @Nullable final Writer aWriter)
{
return copyReaderToWriter (aReader, aWriter, new char [DEFAULT_BUFSIZE], (MutableLong) null, (Long) null);
} | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"copyReaderToWriter",
"(",
"@",
"WillClose",
"@",
"Nullable",
"final",
"Reader",
"aReader",
",",
"@",
"WillNotClose",
"@",
"Nullable",
"final",
"Writer",
"aWriter",
")",
"{",
"return",
"copyReaderToWriter",
"(",
"a... | Pass the content of the given reader to the given writer. The reader is
automatically closed, whereas the writer stays open!
@param aReader
The reader to read from. May be <code>null</code>. Automatically
closed!
@param aWriter
The writer to write to. May be <code>null</code>. Not automatically
closed!
@return <code>{... | [
"Pass",
"the",
"content",
"of",
"the",
"given",
"reader",
"to",
"the",
"given",
"writer",
".",
"The",
"reader",
"is",
"automatically",
"closed",
"whereas",
"the",
"writer",
"stays",
"open!"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L738-L743 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseWhileStatement | private Stmt parseWhileStatement(EnclosingScope scope) {
"""
Parse a while statement, which has the form:
<pre>
WhileStmt ::= "while" Expr ("where" Expr)* ':' NewLine Block
</pre>
@see wyc.lang.Stmt.While
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. de... | java | private Stmt parseWhileStatement(EnclosingScope scope) {
int start = index;
match(While);
// NOTE: expression terminated by ':'
Expr condition = parseLogicalExpression(scope, true);
// Parse the loop invariants
Tuple<Expr> invariants = parseInvariant(scope,Where);
match(Colon);
int end = index;
matchE... | [
"private",
"Stmt",
"parseWhileStatement",
"(",
"EnclosingScope",
"scope",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"While",
")",
";",
"// NOTE: expression terminated by ':'",
"Expr",
"condition",
"=",
"parseLogicalExpression",
"(",
"scope",
",",
... | Parse a while statement, which has the form:
<pre>
WhileStmt ::= "while" Expr ("where" Expr)* ':' NewLine Block
</pre>
@see wyc.lang.Stmt.While
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@return
@author Da... | [
"Parse",
"a",
"while",
"statement",
"which",
"has",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1181-L1193 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.spare_spare_GET | public OvhXdslSpare spare_spare_GET(String spare) throws IOException {
"""
Get this object properties
REST: GET /xdsl/spare/{spare}
@param spare [required] The internal name of your spare
"""
String qPath = "/xdsl/spare/{spare}";
StringBuilder sb = path(qPath, spare);
String resp = exec(qPath, "GET",... | java | public OvhXdslSpare spare_spare_GET(String spare) throws IOException {
String qPath = "/xdsl/spare/{spare}";
StringBuilder sb = path(qPath, spare);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhXdslSpare.class);
} | [
"public",
"OvhXdslSpare",
"spare_spare_GET",
"(",
"String",
"spare",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/spare/{spare}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"spare",
")",
";",
"String",
"resp",
"=",
"ex... | Get this object properties
REST: GET /xdsl/spare/{spare}
@param spare [required] The internal name of your spare | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L2083-L2088 |
antopen/alipay-sdk-java | src/main/java/com/alipay/api/internal/util/AtsUtils.java | AtsUtils.ungzip | public static File ungzip(File gzip, File toDir) throws IOException {
"""
解压gzip文件到指定的目录,目前只能解压gzip包里面只包含一个文件的压缩包。
@param gzip 需要解压的gzip文件
@param toDir 需要解压到的目录
@return 解压后的文件
@throws IOException
"""
toDir.mkdirs();
File out = new File(toDir, gzip.getName());
GZIPInputStream gin = null;
FileOutpu... | java | public static File ungzip(File gzip, File toDir) throws IOException {
toDir.mkdirs();
File out = new File(toDir, gzip.getName());
GZIPInputStream gin = null;
FileOutputStream fout = null;
try {
FileInputStream fin = new FileInputStream(gzip);
gin = new GZIPInputStream(fin);
fout = new FileOutputStrea... | [
"public",
"static",
"File",
"ungzip",
"(",
"File",
"gzip",
",",
"File",
"toDir",
")",
"throws",
"IOException",
"{",
"toDir",
".",
"mkdirs",
"(",
")",
";",
"File",
"out",
"=",
"new",
"File",
"(",
"toDir",
",",
"gzip",
".",
"getName",
"(",
")",
")",
... | 解压gzip文件到指定的目录,目前只能解压gzip包里面只包含一个文件的压缩包。
@param gzip 需要解压的gzip文件
@param toDir 需要解压到的目录
@return 解压后的文件
@throws IOException | [
"解压gzip文件到指定的目录,目前只能解压gzip包里面只包含一个文件的压缩包。"
] | train | https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/util/AtsUtils.java#L46-L63 |
stephanrauh/AngularFaces | AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/components/puiupdateModelAfterAJAXRequest/PuiUpdateModelAfterAJAXRequestRenderer.java | PuiUpdateModelAfterAJAXRequestRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
private static final Logger LOGGER = Logger.getLogger("de.beyondjava.angularFaces.components.puiupdateModelAfterAJAXRequest.puiUpdateModelAfterAJAXRequestRenderer");
"""
if (FacesContext.getCurrentInstanc... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (FacesContext.getCurrentInstance().isPostback()) {
ResponseWriter writer = context.getResponseWriter();
writer.writeText("\n", null);
writer.startElement("script", component);
writer.write("if (window.j... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
".",
"isPostback",
"(",
")",
")",
"{",
"Respon... | private static final Logger LOGGER = Logger.getLogger("de.beyondjava.angularFaces.components.puiupdateModelAfterAJAXRequest.puiUpdateModelAfterAJAXRequestRenderer"); | [
"private",
"static",
"final",
"Logger",
"LOGGER",
"=",
"Logger",
".",
"getLogger",
"(",
"de",
".",
"beyondjava",
".",
"angularFaces",
".",
"components",
".",
"puiupdateModelAfterAJAXRequest",
".",
"puiUpdateModelAfterAJAXRequestRenderer",
")",
";"
] | train | https://github.com/stephanrauh/AngularFaces/blob/43d915f004645b1bbbf2625214294dab0858ba01/AngularFaces_2.0/AngularFaces-core/src/main/java/de/beyondjava/angularFaces/components/puiupdateModelAfterAJAXRequest/PuiUpdateModelAfterAJAXRequestRenderer.java#L37-L51 |
lotaris/jee-validation | src/main/java/com/lotaris/jee/validation/AbstractPatchTransferObject.java | AbstractPatchTransferObject.markPropertyAsSet | public <T> T markPropertyAsSet(String property, T value) {
"""
Marks the specified property as set and returns the value given as the second argument. This
is meant to be used as a one-liner.
<p><pre>
public void setFirstName(String firstName) {
this.firstName = markPropertyAsSet(FIRST_NAME, firstName);
}
... | java | public <T> T markPropertyAsSet(String property, T value) {
setProperties.add(property);
return value;
} | [
"public",
"<",
"T",
">",
"T",
"markPropertyAsSet",
"(",
"String",
"property",
",",
"T",
"value",
")",
"{",
"setProperties",
".",
"add",
"(",
"property",
")",
";",
"return",
"value",
";",
"}"
] | Marks the specified property as set and returns the value given as the second argument. This
is meant to be used as a one-liner.
<p><pre>
public void setFirstName(String firstName) {
this.firstName = markPropertyAsSet(FIRST_NAME, firstName);
}
</pre></p>
@param <T> the type of value
@param property the property to ma... | [
"Marks",
"the",
"specified",
"property",
"as",
"set",
"and",
"returns",
"the",
"value",
"given",
"as",
"the",
"second",
"argument",
".",
"This",
"is",
"meant",
"to",
"be",
"used",
"as",
"a",
"one",
"-",
"liner",
"."
] | train | https://github.com/lotaris/jee-validation/blob/feefff820b5a67c7471a13e08fdaf2d60bb3ad16/src/main/java/com/lotaris/jee/validation/AbstractPatchTransferObject.java#L71-L74 |
apache/spark | common/network-shuffle/src/main/java/org/apache/spark/network/sasl/ShuffleSecretManager.java | ShuffleSecretManager.registerApp | public void registerApp(String appId, String shuffleSecret) {
"""
Register an application with its secret.
Executors need to first authenticate themselves with the same secret before
fetching shuffle files written by other executors in this application.
"""
// Always put the new secret information to mak... | java | public void registerApp(String appId, String shuffleSecret) {
// Always put the new secret information to make sure it's the most up to date.
// Otherwise we have to specifically look at the application attempt in addition
// to the applicationId since the secrets change between application attempts on yarn... | [
"public",
"void",
"registerApp",
"(",
"String",
"appId",
",",
"String",
"shuffleSecret",
")",
"{",
"// Always put the new secret information to make sure it's the most up to date.",
"// Otherwise we have to specifically look at the application attempt in addition",
"// to the applicationId... | Register an application with its secret.
Executors need to first authenticate themselves with the same secret before
fetching shuffle files written by other executors in this application. | [
"Register",
"an",
"application",
"with",
"its",
"secret",
".",
"Executors",
"need",
"to",
"first",
"authenticate",
"themselves",
"with",
"the",
"same",
"secret",
"before",
"fetching",
"shuffle",
"files",
"written",
"by",
"other",
"executors",
"in",
"this",
"appl... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/sasl/ShuffleSecretManager.java#L49-L55 |
pushtorefresh/storio | storio-common/src/main/java/com/pushtorefresh/storio3/internal/Checks.java | Checks.checkNotNull | public static void checkNotNull(@Nullable Object object, @NonNull String message) {
"""
Checks that passed reference is not null,
throws {@link NullPointerException} with passed message if reference is null
@param object to check
@param message exception message if object is null
"""
if (object =... | java | public static void checkNotNull(@Nullable Object object, @NonNull String message) {
if (object == null) {
throw new NullPointerException(message);
}
} | [
"public",
"static",
"void",
"checkNotNull",
"(",
"@",
"Nullable",
"Object",
"object",
",",
"@",
"NonNull",
"String",
"message",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"message",
")",
";",
"}",
... | Checks that passed reference is not null,
throws {@link NullPointerException} with passed message if reference is null
@param object to check
@param message exception message if object is null | [
"Checks",
"that",
"passed",
"reference",
"is",
"not",
"null",
"throws",
"{",
"@link",
"NullPointerException",
"}",
"with",
"passed",
"message",
"if",
"reference",
"is",
"null"
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-common/src/main/java/com/pushtorefresh/storio3/internal/Checks.java#L24-L28 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java | DisasterRecoveryConfigurationsInner.listAsync | public Observable<List<DisasterRecoveryConfigurationInner>> listAsync(String resourceGroupName, String serverName) {
"""
Lists a server's disaster recovery configuration.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager... | java | public Observable<List<DisasterRecoveryConfigurationInner>> listAsync(String resourceGroupName, String serverName) {
return listWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<DisasterRecoveryConfigurationInner>>, List<DisasterRecoveryConfigurationInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"DisasterRecoveryConfigurationInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
... | Lists a server's disaster recovery configuration.
@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 serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the val... | [
"Lists",
"a",
"server",
"s",
"disaster",
"recovery",
"configuration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DisasterRecoveryConfigurationsInner.java#L135-L142 |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toBoolean | public static boolean toBoolean(Object value, boolean defaultValue) {
"""
To boolean.
@param value the value
@param defaultValue the default value
@return true, if successful
"""
boolean result;// = defaultValue;
if (value != null) {
if (value instanceof Boolean) {
return ((Boolean) ... | java | public static boolean toBoolean(Object value, boolean defaultValue) {
boolean result;// = defaultValue;
if (value != null) {
if (value instanceof Boolean) {
return ((Boolean) value).booleanValue();
}
if (value.toString().trim().equals("1") || value.toString().trim().toLowerCase().equals("true")... | [
"public",
"static",
"boolean",
"toBoolean",
"(",
"Object",
"value",
",",
"boolean",
"defaultValue",
")",
"{",
"boolean",
"result",
";",
"// = defaultValue;\r",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",... | To boolean.
@param value the value
@param defaultValue the default value
@return true, if successful | [
"To",
"boolean",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L132-L149 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/ImageUtil.java | ImageUtil.createRectangleImage | public static Image createRectangleImage(String id, String url,
double horMargin, double verMargin, double width, double height) {
"""
Creates an {@link Image} with full opacity (new PictureStyle(1)).
horMargin, verMargin, width and height are used to create the {@link Bbox}
@param id is used to create the a... | java | public static Image createRectangleImage(String id, String url,
double horMargin, double verMargin, double width, double height) {
Image i = new Image(id);
i.setHref(url);
i.setStyle(new PictureStyle(1));
i.setBounds(new Bbox(horMargin, verMargin, width, height));
return i;
} | [
"public",
"static",
"Image",
"createRectangleImage",
"(",
"String",
"id",
",",
"String",
"url",
",",
"double",
"horMargin",
",",
"double",
"verMargin",
",",
"double",
"width",
",",
"double",
"height",
")",
"{",
"Image",
"i",
"=",
"new",
"Image",
"(",
"id",... | Creates an {@link Image} with full opacity (new PictureStyle(1)).
horMargin, verMargin, width and height are used to create the {@link Bbox}
@param id is used to create the actual {@link Image} (new Image(id)).
@param url
@param horMargin
@param verMargin
@param width
@param height
@return | [
"Creates",
"an",
"{"
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/ImageUtil.java#L41-L48 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/RandomUtils.java | RandomUtils.nextDouble | public static double nextDouble(final double startInclusive, final double endInclusive) {
"""
<p>
Returns a random double within the specified range.
</p>
@param startInclusive
the smallest value that can be returned, must be non-negative
@param endInclusive
the upper bound (included)
@throws IllegalArgum... | java | public static double nextDouble(final double startInclusive, final double endInclusive) {
Validate.isTrue(endInclusive >= startInclusive,
"Start value must be smaller or equal to end value.");
Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");
if (s... | [
"public",
"static",
"double",
"nextDouble",
"(",
"final",
"double",
"startInclusive",
",",
"final",
"double",
"endInclusive",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"endInclusive",
">=",
"startInclusive",
",",
"\"Start value must be smaller or equal to end value.\"",
... | <p>
Returns a random double within the specified range.
</p>
@param startInclusive
the smallest value that can be returned, must be non-negative
@param endInclusive
the upper bound (included)
@throws IllegalArgumentException
if {@code startInclusive > endInclusive} or if
{@code startInclusive} is negative
@return the ... | [
"<p",
">",
"Returns",
"a",
"random",
"double",
"within",
"the",
"specified",
"range",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/RandomUtils.java#L168-L178 |
protostuff/protostuff | protostuff-core/src/main/java/io/protostuff/CodedInput.java | CodedInput.readRawVarint32 | static int readRawVarint32(final InputStream input) throws IOException {
"""
Reads a varint from the input one byte at a time, so that it does not read any bytes after the end of the varint.
If you simply wrapped the stream in a CodedInput and used {@link #readRawVarint32(InputStream)} then you would
probably en... | java | static int readRawVarint32(final InputStream input) throws IOException
{
final int firstByte = input.read();
if (firstByte == -1)
{
throw ProtobufException.truncatedMessage();
}
if ((firstByte & 0x80) == 0)
{
return firstByte;
}
... | [
"static",
"int",
"readRawVarint32",
"(",
"final",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"final",
"int",
"firstByte",
"=",
"input",
".",
"read",
"(",
")",
";",
"if",
"(",
"firstByte",
"==",
"-",
"1",
")",
"{",
"throw",
"ProtobufExceptio... | Reads a varint from the input one byte at a time, so that it does not read any bytes after the end of the varint.
If you simply wrapped the stream in a CodedInput and used {@link #readRawVarint32(InputStream)} then you would
probably end up reading past the end of the varint since CodedInput buffers its input. | [
"Reads",
"a",
"varint",
"from",
"the",
"input",
"one",
"byte",
"at",
"a",
"time",
"so",
"that",
"it",
"does",
"not",
"read",
"any",
"bytes",
"after",
"the",
"end",
"of",
"the",
"varint",
".",
"If",
"you",
"simply",
"wrapped",
"the",
"stream",
"in",
"... | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-core/src/main/java/io/protostuff/CodedInput.java#L529-L542 |
apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java | SchedulerStateManagerAdaptor.getExecutionState | public ExecutionEnvironment.ExecutionState getExecutionState(String topologyName) {
"""
Get the execution state for the given topology
@return ExecutionState
"""
return awaitResult(delegate.getExecutionState(null, topologyName));
} | java | public ExecutionEnvironment.ExecutionState getExecutionState(String topologyName) {
return awaitResult(delegate.getExecutionState(null, topologyName));
} | [
"public",
"ExecutionEnvironment",
".",
"ExecutionState",
"getExecutionState",
"(",
"String",
"topologyName",
")",
"{",
"return",
"awaitResult",
"(",
"delegate",
".",
"getExecutionState",
"(",
"null",
",",
"topologyName",
")",
")",
";",
"}"
] | Get the execution state for the given topology
@return ExecutionState | [
"Get",
"the",
"execution",
"state",
"for",
"the",
"given",
"topology"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java#L284-L286 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseAutomaticTuningsInner.java | DatabaseAutomaticTuningsInner.updateAsync | public Observable<DatabaseAutomaticTuningInner> updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseAutomaticTuningInner parameters) {
"""
Update automatic tuning properties for target database.
@param resourceGroupName The name of the resource group that contains the resource.... | java | public Observable<DatabaseAutomaticTuningInner> updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseAutomaticTuningInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<DatabaseAutomaticT... | [
"public",
"Observable",
"<",
"DatabaseAutomaticTuningInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"DatabaseAutomaticTuningInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResponse... | Update automatic tuning properties for target database.
@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 serverName The name of the server.
@param databaseName The name of the database.
@param paramet... | [
"Update",
"automatic",
"tuning",
"properties",
"for",
"target",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseAutomaticTuningsInner.java#L201-L208 |
vakinge/jeesuite-libs | jeesuite-mybatis/src/main/java/com/jeesuite/mybatis/plugin/cache/EntityCacheHelper.java | EntityCacheHelper.queryTryCache | public static <T> T queryTryCache(Class<? extends BaseEntity> entityClass,String key,long expireSeconds,Callable<T> dataCaller) {
"""
查询并缓存结果
@param entityClass 实体类class (用户组装实际的缓存key)
@param key 缓存的key(和entityClass一起组成真实的缓存key。<br>如entityClass=UserEntity.class,key=findlist,实际的key为:UserEntity.findlist)
@param e... | java | public static <T> T queryTryCache(Class<? extends BaseEntity> entityClass,String key,long expireSeconds,Callable<T> dataCaller){
if(CacheHandler.cacheProvider == null){
try {
return dataCaller.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
String entityClassName = entity... | [
"public",
"static",
"<",
"T",
">",
"T",
"queryTryCache",
"(",
"Class",
"<",
"?",
"extends",
"BaseEntity",
">",
"entityClass",
",",
"String",
"key",
",",
"long",
"expireSeconds",
",",
"Callable",
"<",
"T",
">",
"dataCaller",
")",
"{",
"if",
"(",
"CacheHan... | 查询并缓存结果
@param entityClass 实体类class (用户组装实际的缓存key)
@param key 缓存的key(和entityClass一起组成真实的缓存key。<br>如entityClass=UserEntity.class,key=findlist,实际的key为:UserEntity.findlist)
@param expireSeconds 过期时间,单位:秒
@param dataCaller 缓存不存在数据加载源
@return | [
"查询并缓存结果"
] | train | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-mybatis/src/main/java/com/jeesuite/mybatis/plugin/cache/EntityCacheHelper.java#L45-L71 |
Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java | CodeQualityServiceImpl.getReportURL | private String getReportURL(String projectUrl,String path,String projectId) {
"""
get projectUrl and projectId from collectorItem and form reportUrl
"""
StringBuilder sb = new StringBuilder(projectUrl);
if(!projectUrl.endsWith("/")) {
sb.append("/");
}
sb.append(path... | java | private String getReportURL(String projectUrl,String path,String projectId) {
StringBuilder sb = new StringBuilder(projectUrl);
if(!projectUrl.endsWith("/")) {
sb.append("/");
}
sb.append(path)
.append(projectId);
return sb.toString();
} | [
"private",
"String",
"getReportURL",
"(",
"String",
"projectUrl",
",",
"String",
"path",
",",
"String",
"projectId",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"projectUrl",
")",
";",
"if",
"(",
"!",
"projectUrl",
".",
"endsWith",
"("... | get projectUrl and projectId from collectorItem and form reportUrl | [
"get",
"projectUrl",
"and",
"projectId",
"from",
"collectorItem",
"and",
"form",
"reportUrl"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java#L220-L228 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/BezierCurve.java | BezierCurve.secondDerivative | private ParameterizedOperator secondDerivative(double... controlPoints) {
"""
Create second derivative function for fixed control points.
@param controlPoints
@return
"""
if (controlPoints.length != 2*length)
{
throw new IllegalArgumentException("control-points length not "+len... | java | private ParameterizedOperator secondDerivative(double... controlPoints)
{
if (controlPoints.length != 2*length)
{
throw new IllegalArgumentException("control-points length not "+length);
}
return secondDerivative(controlPoints, 0);
} | [
"private",
"ParameterizedOperator",
"secondDerivative",
"(",
"double",
"...",
"controlPoints",
")",
"{",
"if",
"(",
"controlPoints",
".",
"length",
"!=",
"2",
"*",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"control-points length not \"",
... | Create second derivative function for fixed control points.
@param controlPoints
@return | [
"Create",
"second",
"derivative",
"function",
"for",
"fixed",
"control",
"points",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/BezierCurve.java#L143-L150 |
apache/groovy | subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java | Groovyc.scanDir | protected void scanDir(File srcDir, File destDir, String[] files) {
"""
Scans the directory looking for source files to be compiled.
The results are returned in the class variable compileList
@param srcDir The source directory
@param destDir The destination directory
@param files An array of filenames
... | java | protected void scanDir(File srcDir, File destDir, String[] files) {
GlobPatternMapper m = new GlobPatternMapper();
SourceFileScanner sfs = new SourceFileScanner(this);
File[] newFiles;
for (String extension : getScriptExtensions()) {
m.setFrom("*." + extension);
m... | [
"protected",
"void",
"scanDir",
"(",
"File",
"srcDir",
",",
"File",
"destDir",
",",
"String",
"[",
"]",
"files",
")",
"{",
"GlobPatternMapper",
"m",
"=",
"new",
"GlobPatternMapper",
"(",
")",
";",
"SourceFileScanner",
"sfs",
"=",
"new",
"SourceFileScanner",
... | Scans the directory looking for source files to be compiled.
The results are returned in the class variable compileList
@param srcDir The source directory
@param destDir The destination directory
@param files An array of filenames | [
"Scans",
"the",
"directory",
"looking",
"for",
"source",
"files",
"to",
"be",
"compiled",
".",
"The",
"results",
"are",
"returned",
"in",
"the",
"class",
"variable",
"compileList"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java#L898-L915 |
j256/ormlite-core | src/main/java/com/j256/ormlite/field/FieldType.java | FieldType.convertStringToJavaField | public Object convertStringToJavaField(String value, int columnPos) throws SQLException {
"""
Convert a string value into the appropriate Java field value.
"""
if (value == null) {
return null;
} else {
return fieldConverter.resultStringToJava(this, value, columnPos);
}
} | java | public Object convertStringToJavaField(String value, int columnPos) throws SQLException {
if (value == null) {
return null;
} else {
return fieldConverter.resultStringToJava(this, value, columnPos);
}
} | [
"public",
"Object",
"convertStringToJavaField",
"(",
"String",
"value",
",",
"int",
"columnPos",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"fieldConverter",
".",
"result... | Convert a string value into the appropriate Java field value. | [
"Convert",
"a",
"string",
"value",
"into",
"the",
"appropriate",
"Java",
"field",
"value",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/FieldType.java#L664-L670 |
HanSolo/Medusa | src/main/java/eu/hansolo/medusa/tools/ConicalGradient.java | ConicalGradient.normalizeStops | private List<Stop> normalizeStops(final double OFFSET, final List<Stop> STOPS) {
"""
/*
private List<Stop> normalizeStops(final Stop... STOPS) { return normalizeStops(0, Arrays.asList(STOPS)); }
private List<Stop> normalizeStops(final double OFFSET, final Stop... STOPS) { return normalizeStops(OFFSET, Arrays.asL... | java | private List<Stop> normalizeStops(final double OFFSET, final List<Stop> STOPS) {
double offset = Helper.clamp(0.0, 1.0, OFFSET);
List<Stop> stops;
if (null == STOPS || STOPS.isEmpty()) {
stops = new ArrayList<>();
stops.add(new Stop(0.0, Color.TRANSPARENT));
s... | [
"private",
"List",
"<",
"Stop",
">",
"normalizeStops",
"(",
"final",
"double",
"OFFSET",
",",
"final",
"List",
"<",
"Stop",
">",
"STOPS",
")",
"{",
"double",
"offset",
"=",
"Helper",
".",
"clamp",
"(",
"0.0",
",",
"1.0",
",",
"OFFSET",
")",
";",
"Lis... | /*
private List<Stop> normalizeStops(final Stop... STOPS) { return normalizeStops(0, Arrays.asList(STOPS)); }
private List<Stop> normalizeStops(final double OFFSET, final Stop... STOPS) { return normalizeStops(OFFSET, Arrays.asList(STOPS)); }
private List<Stop> normalizeStops(final List<Stop> STOPS) { return normalizeS... | [
"/",
"*",
"private",
"List<Stop",
">",
"normalizeStops",
"(",
"final",
"Stop",
"...",
"STOPS",
")",
"{",
"return",
"normalizeStops",
"(",
"0",
"Arrays",
".",
"asList",
"(",
"STOPS",
"))",
";",
"}",
"private",
"List<Stop",
">",
"normalizeStops",
"(",
"final... | train | https://github.com/HanSolo/Medusa/blob/1321e4925dcde659028d4b296e49e316494c114c/src/main/java/eu/hansolo/medusa/tools/ConicalGradient.java#L285-L305 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanJobHelper.java | AzkabanJobHelper.createAzkabanJob | public static String createAzkabanJob(String sessionId, AzkabanProjectConfig azkabanProjectConfig)
throws IOException {
"""
*
Create project on Azkaban based on Azkaban config. This includes preparing the zip file and uploading it to
Azkaban, setting permissions and schedule.
@param sessionId Session Id.
... | java | public static String createAzkabanJob(String sessionId, AzkabanProjectConfig azkabanProjectConfig)
throws IOException {
log.info("Creating Azkaban project for: " + azkabanProjectConfig.getAzkabanProjectName());
// Create zip file
String zipFilePath = createAzkabanJobZip(azkabanProjectConfig);
log... | [
"public",
"static",
"String",
"createAzkabanJob",
"(",
"String",
"sessionId",
",",
"AzkabanProjectConfig",
"azkabanProjectConfig",
")",
"throws",
"IOException",
"{",
"log",
".",
"info",
"(",
"\"Creating Azkaban project for: \"",
"+",
"azkabanProjectConfig",
".",
"getAzkab... | *
Create project on Azkaban based on Azkaban config. This includes preparing the zip file and uploading it to
Azkaban, setting permissions and schedule.
@param sessionId Session Id.
@param azkabanProjectConfig Azkaban Project Config.
@return Project Id.
@throws IOException | [
"*",
"Create",
"project",
"on",
"Azkaban",
"based",
"on",
"Azkaban",
"config",
".",
"This",
"includes",
"preparing",
"the",
"zip",
"file",
"and",
"uploading",
"it",
"to",
"Azkaban",
"setting",
"permissions",
"and",
"schedule",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanJobHelper.java#L108-L121 |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/ClassMatcher.java | ClassMatcher.processPathPart | private static void processPathPart(String path, Set<String> classes) {
"""
For a given classpath root, scan it for packages and classes,
adding all found classnames to the given "classes" param.
"""
File rootFile = new File(path);
if (rootFile.isDirectory() == false) {
return;
... | java | private static void processPathPart(String path, Set<String> classes) {
File rootFile = new File(path);
if (rootFile.isDirectory() == false) {
return;
}
File[] files = rootFile.listFiles();
for (File f : files) {
// classes in the anonymous package
... | [
"private",
"static",
"void",
"processPathPart",
"(",
"String",
"path",
",",
"Set",
"<",
"String",
">",
"classes",
")",
"{",
"File",
"rootFile",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"rootFile",
".",
"isDirectory",
"(",
")",
"==",
"false... | For a given classpath root, scan it for packages and classes,
adding all found classnames to the given "classes" param. | [
"For",
"a",
"given",
"classpath",
"root",
"scan",
"it",
"for",
"packages",
"and",
"classes",
"adding",
"all",
"found",
"classnames",
"to",
"the",
"given",
"classes",
"param",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/ClassMatcher.java#L177-L197 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/webhook/WebhookCluster.java | WebhookCluster.broadcast | public List<RequestFuture<?>> broadcast(File file) {
"""
Sends the provided {@link java.io.File File}
to all registered {@link net.dv8tion.jda.webhook.WebhookClient WebhookClients}.
<br>Use {@link WebhookMessage#files(String, Object, Object...)} to send up to 10 files!
<p><b>The provided data should not excee... | java | public List<RequestFuture<?>> broadcast(File file)
{
Checks.notNull(file, "File");
return broadcast(file, file.getName());
} | [
"public",
"List",
"<",
"RequestFuture",
"<",
"?",
">",
">",
"broadcast",
"(",
"File",
"file",
")",
"{",
"Checks",
".",
"notNull",
"(",
"file",
",",
"\"File\"",
")",
";",
"return",
"broadcast",
"(",
"file",
",",
"file",
".",
"getName",
"(",
")",
")",
... | Sends the provided {@link java.io.File File}
to all registered {@link net.dv8tion.jda.webhook.WebhookClient WebhookClients}.
<br>Use {@link WebhookMessage#files(String, Object, Object...)} to send up to 10 files!
<p><b>The provided data should not exceed 8MB in size!</b>
@param file
The file that should be sent to t... | [
"Sends",
"the",
"provided",
"{",
"@link",
"java",
".",
"io",
".",
"File",
"File",
"}",
"to",
"all",
"registered",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"webhook",
".",
"WebhookClient",
"WebhookClients",
"}",
".",
"<br",
">",
"Use",
"{",... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/webhook/WebhookCluster.java#L736-L740 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTableLookup | public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, Converter fldDisplayFieldDesc, boolean bIncludeBlankOption, boolean bIncludeFormButton) {
"""
Same as setupTablePopup for larger files (that don't fit... | java | public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, Converter fldDisplayFieldDesc, boolean bIncludeBlankOption, boolean bIncludeFormButton)
{
String keyAreaName = null;
if (iQueryKeySeq !... | [
"public",
"ScreenComponent",
"setupTableLookup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"int",
"iQueryKeySeq",
",",
"Converter",
"fldDisplayFieldDe... | Same as setupTablePopup for larger files (that don't fit in a popup).
Displays a [Key to record (opt)] [Record Description] [Lookup button] [Form button (opt)]
@param record Record to display in a popup
@param iQueryKeySeq Key to use for code-lookup operation (-1 = None)
@param iDisplayFieldSeq Description field for th... | [
"Same",
"as",
"setupTablePopup",
"for",
"larger",
"files",
"(",
"that",
"don",
"t",
"fit",
"in",
"a",
"popup",
")",
".",
"Displays",
"a",
"[",
"Key",
"to",
"record",
"(",
"opt",
")",
"]",
"[",
"Record",
"Description",
"]",
"[",
"Lookup",
"button",
"]... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1304-L1310 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.addMultiValuesForKey | @SuppressWarnings( {
"""
Add a collection of unique values to a multi-value user profile property
If the property does not exist it will be created
<p/>
Max 100 values, on reaching 100 cap, oldest value(s) will be removed.
Values must be Strings and are limited to 512 characters.
<p/>
If the key currently co... | java | @SuppressWarnings({"unused", "WeakerAccess"})
public void addMultiValuesForKey(final String key, final ArrayList<String> values) {
postAsyncSafely("addMultiValuesForKey", new Runnable() {
@Override
public void run() {
final String command = (getLocalDataStore().getPro... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"void",
"addMultiValuesForKey",
"(",
"final",
"String",
"key",
",",
"final",
"ArrayList",
"<",
"String",
">",
"values",
")",
"{",
"postAsyncSafely",
"(",
"\"addMultiVal... | Add a collection of unique values to a multi-value user profile property
If the property does not exist it will be created
<p/>
Max 100 values, on reaching 100 cap, oldest value(s) will be removed.
Values must be Strings and are limited to 512 characters.
<p/>
If the key currently contains a scalar value, the key will ... | [
"Add",
"a",
"collection",
"of",
"unique",
"values",
"to",
"a",
"multi",
"-",
"value",
"user",
"profile",
"property",
"If",
"the",
"property",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"<p",
"/",
">",
"Max",
"100",
"values",
"on",
"reaching",... | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L3419-L3428 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java | DepictionGenerator.withAtomMapNumbers | public DepictionGenerator withAtomMapNumbers() {
"""
Display atom-atom mapping numbers on a reaction. Each atom map index
is loaded from the property {@link CDKConstants#ATOM_ATOM_MAPPING}.
Note: A depiction can not have both atom numbers and atom
maps visible (but this can be achieved by manually setting
th... | java | public DepictionGenerator withAtomMapNumbers() {
if (annotateAtomNum)
throw new IllegalArgumentException("Can not annotated atom maps, atom numbers or values are already annotated");
DepictionGenerator copy = new DepictionGenerator(this);
copy.annotateAtomMap = true;
return c... | [
"public",
"DepictionGenerator",
"withAtomMapNumbers",
"(",
")",
"{",
"if",
"(",
"annotateAtomNum",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can not annotated atom maps, atom numbers or values are already annotated\"",
")",
";",
"DepictionGenerator",
"copy",
"=",... | Display atom-atom mapping numbers on a reaction. Each atom map index
is loaded from the property {@link CDKConstants#ATOM_ATOM_MAPPING}.
Note: A depiction can not have both atom numbers and atom
maps visible (but this can be achieved by manually setting
the annotation).
@return new generator for method chaining
@see ... | [
"Display",
"atom",
"-",
"atom",
"mapping",
"numbers",
"on",
"a",
"reaction",
".",
"Each",
"atom",
"map",
"index",
"is",
"loaded",
"from",
"the",
"property",
"{",
"@link",
"CDKConstants#ATOM_ATOM_MAPPING",
"}",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java#L814-L820 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeCheck.java | TypeCheck.visitGetProp | private void visitGetProp(NodeTraversal t, Node n) {
"""
Visits a GETPROP node.
@param t The node traversal object that supplies context, such as the scope chain to use in
name lookups as well as error reporting.
@param n The node being visited.
"""
// obj.prop or obj.method()
// Lots of types can... | java | private void visitGetProp(NodeTraversal t, Node n) {
// obj.prop or obj.method()
// Lots of types can appear on the left, a call to a void function can
// never be on the left. getPropertyType will decide what is acceptable
// and what isn't.
Node property = n.getLastChild();
Node objNode = n.ge... | [
"private",
"void",
"visitGetProp",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"// obj.prop or obj.method()",
"// Lots of types can appear on the left, a call to a void function can",
"// never be on the left. getPropertyType will decide what is acceptable",
"// and what isn't... | Visits a GETPROP node.
@param t The node traversal object that supplies context, such as the scope chain to use in
name lookups as well as error reporting.
@param n The node being visited. | [
"Visits",
"a",
"GETPROP",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L1943-L1959 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java | StereoDisparityWtoNaiveFive.process | public void process( I left , I right , GrayF32 imageDisparity ) {
"""
Computes the disparity for two stereo images along the image's right axis. Both
image must be rectified.
@param left Left camera image.
@param right Right camera image.
"""
// check inputs and initialize data structures
InputSanit... | java | public void process( I left , I right , GrayF32 imageDisparity ) {
// check inputs and initialize data structures
InputSanityCheck.checkSameShape(left,right,imageDisparity);
this.imageLeft = left;
this.imageRight = right;
w = left.width; h = left.height;
// Compute disparity for each pixel
for( int y = ... | [
"public",
"void",
"process",
"(",
"I",
"left",
",",
"I",
"right",
",",
"GrayF32",
"imageDisparity",
")",
"{",
"// check inputs and initialize data structures",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"left",
",",
"right",
",",
"imageDisparity",
")",
";",
"... | Computes the disparity for two stereo images along the image's right axis. Both
image must be rectified.
@param left Left camera image.
@param right Right camera image. | [
"Computes",
"the",
"disparity",
"for",
"two",
"stereo",
"images",
"along",
"the",
"image",
"s",
"right",
"axis",
".",
"Both",
"image",
"must",
"be",
"rectified",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaiveFive.java#L75-L96 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.updatePatternsAsync | public Observable<List<PatternRuleInfo>> updatePatternsAsync(UUID appId, String versionId, List<PatternRuleUpdateObject> patterns) {
"""
Updates patterns.
@param appId The application ID.
@param versionId The version ID.
@param patterns An array represents the patterns.
@throws IllegalArgumentException throw... | java | public Observable<List<PatternRuleInfo>> updatePatternsAsync(UUID appId, String versionId, List<PatternRuleUpdateObject> patterns) {
return updatePatternsWithServiceResponseAsync(appId, versionId, patterns).map(new Func1<ServiceResponse<List<PatternRuleInfo>>, List<PatternRuleInfo>>() {
@Override
... | [
"public",
"Observable",
"<",
"List",
"<",
"PatternRuleInfo",
">",
">",
"updatePatternsAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"PatternRuleUpdateObject",
">",
"patterns",
")",
"{",
"return",
"updatePatternsWithServiceResponseAsync",
... | Updates patterns.
@param appId The application ID.
@param versionId The version ID.
@param patterns An array represents the patterns.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<PatternRuleInfo> object | [
"Updates",
"patterns",
"."
] | 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/PatternsImpl.java#L411-L418 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetCoreDefinitionResult.java | GetCoreDefinitionResult.withTags | public GetCoreDefinitionResult withTags(java.util.Map<String, String> tags) {
"""
The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public GetCoreDefinitionResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"GetCoreDefinitionResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"tags",
"for",
"the",
"definition",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetCoreDefinitionResult.java#L310-L313 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectOneMenu/SelectOneMenuRenderer.java | SelectOneMenuRenderer.renderOptions | protected void renderOptions(FacesContext context, ResponseWriter rw, SelectOneMenu menu) throws IOException {
"""
Parts of this class are an adapted version of InputRenderer#getSelectItems()
of PrimeFaces 5.1.
@param rw
@throws IOException
"""
Converter converter = menu.getConverter();
List<SelectIte... | java | protected void renderOptions(FacesContext context, ResponseWriter rw, SelectOneMenu menu) throws IOException {
Converter converter = menu.getConverter();
List<SelectItemAndComponent> items = SelectItemUtils.collectOptions(context, menu, converter);
SelectItemAndComponent selection = determineSelectedItem(conte... | [
"protected",
"void",
"renderOptions",
"(",
"FacesContext",
"context",
",",
"ResponseWriter",
"rw",
",",
"SelectOneMenu",
"menu",
")",
"throws",
"IOException",
"{",
"Converter",
"converter",
"=",
"menu",
".",
"getConverter",
"(",
")",
";",
"List",
"<",
"SelectIte... | Parts of this class are an adapted version of InputRenderer#getSelectItems()
of PrimeFaces 5.1.
@param rw
@throws IOException | [
"Parts",
"of",
"this",
"class",
"are",
"an",
"adapted",
"version",
"of",
"InputRenderer#getSelectItems",
"()",
"of",
"PrimeFaces",
"5",
".",
"1",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectOneMenu/SelectOneMenuRenderer.java#L357-L373 |
alkacon/opencms-core | src/org/opencms/ui/apps/searchindex/CmsSearchIndexTable.java | CmsSearchIndexTable.onItemClick | void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {
"""
Handles the table item clicks, including clicks on images inside of a table item.<p>
@param event the click event
@param itemId of the clicked row
@param propertyId column id
"""
if (!event.isCtrlKey() && !even... | java | void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {
if (!event.isCtrlKey() && !event.isShiftKey()) {
changeValueIfNotMultiSelect(itemId);
// don't interfere with multi-selection using control key
if (event.getButton().equals(MouseButton.RIGHT... | [
"void",
"onItemClick",
"(",
"MouseEvents",
".",
"ClickEvent",
"event",
",",
"Object",
"itemId",
",",
"Object",
"propertyId",
")",
"{",
"if",
"(",
"!",
"event",
".",
"isCtrlKey",
"(",
")",
"&&",
"!",
"event",
".",
"isShiftKey",
"(",
")",
")",
"{",
"chan... | Handles the table item clicks, including clicks on images inside of a table item.<p>
@param event the click event
@param itemId of the clicked row
@param propertyId column id | [
"Handles",
"the",
"table",
"item",
"clicks",
"including",
"clicks",
"on",
"images",
"inside",
"of",
"a",
"table",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/searchindex/CmsSearchIndexTable.java#L387-L401 |
JOML-CI/JOML | src/org/joml/Vector3i.java | Vector3i.setComponent | public Vector3i setComponent(int component, int value) throws IllegalArgumentException {
"""
Set the value of the specified component of this vector.
@param component
the component whose value to set, within <code>[0..2]</code>
@param value
the value to set
@return this
@throws IllegalArgumentException if ... | java | public Vector3i setComponent(int component, int value) throws IllegalArgumentException {
switch (component) {
case 0:
x = value;
break;
case 1:
y = value;
break;
case 2:
z = value;
... | [
"public",
"Vector3i",
"setComponent",
"(",
"int",
"component",
",",
"int",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"switch",
"(",
"component",
")",
"{",
"case",
"0",
":",
"x",
"=",
"value",
";",
"break",
";",
"case",
"1",
":",
"y",
"=",
... | Set the value of the specified component of this vector.
@param component
the component whose value to set, within <code>[0..2]</code>
@param value
the value to set
@return this
@throws IllegalArgumentException if <code>component</code> is not within <code>[0..2]</code> | [
"Set",
"the",
"value",
"of",
"the",
"specified",
"component",
"of",
"this",
"vector",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector3i.java#L417-L432 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BaseXmlParser.java | BaseXmlParser.addProperties | protected void addProperties(Element element, BeanDefinitionBuilder builder) {
"""
Adds all attributes of the specified elements as properties in the current builder.
@param element Element whose attributes are to be added.
@param builder Target builder.
"""
NamedNodeMap attributes = element.getAtt... | java | protected void addProperties(Element element, BeanDefinitionBuilder builder) {
NamedNodeMap attributes = element.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node node = attributes.item(i);
String attrName = getNodeName(node);
attrName ... | [
"protected",
"void",
"addProperties",
"(",
"Element",
"element",
",",
"BeanDefinitionBuilder",
"builder",
")",
"{",
"NamedNodeMap",
"attributes",
"=",
"element",
".",
"getAttributes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"attribute... | Adds all attributes of the specified elements as properties in the current builder.
@param element Element whose attributes are to be added.
@param builder Target builder. | [
"Adds",
"all",
"attributes",
"of",
"the",
"specified",
"elements",
"as",
"properties",
"in",
"the",
"current",
"builder",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BaseXmlParser.java#L93-L102 |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/ui/NetworkImageView.java | NetworkImageView.setImageUrl | public void setImageUrl(String url, ImageLoader imageLoader) {
"""
Sets URL of the image that should be loaded into this view. Note that calling this will
immediately either set the cached image (if available) or the default image specified by
{@link NetworkImageView#setDefaultImageResId(int)} on the view.
<p/>... | java | public void setImageUrl(String url, ImageLoader imageLoader) {
this.url = url;
this.imageLoader = imageLoader;
if (this.imageLoader.getDefaultImageId() != 0) {
defaultImageId = this.imageLoader.getDefaultImageId();
}
if (this.imageLoader.getErrorImageId() != 0) {
... | [
"public",
"void",
"setImageUrl",
"(",
"String",
"url",
",",
"ImageLoader",
"imageLoader",
")",
"{",
"this",
".",
"url",
"=",
"url",
";",
"this",
".",
"imageLoader",
"=",
"imageLoader",
";",
"if",
"(",
"this",
".",
"imageLoader",
".",
"getDefaultImageId",
"... | Sets URL of the image that should be loaded into this view. Note that calling this will
immediately either set the cached image (if available) or the default image specified by
{@link NetworkImageView#setDefaultImageResId(int)} on the view.
<p/>
NOTE: If applicable, {@link NetworkImageView#setDefaultImageResId(int)} an... | [
"Sets",
"URL",
"of",
"the",
"image",
"that",
"should",
"be",
"loaded",
"into",
"this",
"view",
".",
"Note",
"that",
"calling",
"this",
"will",
"immediately",
"either",
"set",
"the",
"cached",
"image",
"(",
"if",
"available",
")",
"or",
"the",
"default",
... | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/NetworkImageView.java#L111-L122 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java | PathNormalizer.addGetParameter | public static String addGetParameter(String path, String parameterKey, String parameter) {
"""
Adds a key and value to the request path & or ? will be used as needed
path + ? or & + parameterKey=parameter
@param path
the url to add the parameterKey and parameter too
@param parameterKey
the key in the get ... | java | public static String addGetParameter(String path, String parameterKey, String parameter) {
StringBuilder sb = new StringBuilder(path);
if (path.indexOf("?") > 0) {
sb.append("&");
} else {
sb.append("?");
}
sb.append(parameterKey).append("=").append(parameter);
return sb.toString();
} | [
"public",
"static",
"String",
"addGetParameter",
"(",
"String",
"path",
",",
"String",
"parameterKey",
",",
"String",
"parameter",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"path",
")",
";",
"if",
"(",
"path",
".",
"indexOf",
"(",
... | Adds a key and value to the request path & or ? will be used as needed
path + ? or & + parameterKey=parameter
@param path
the url to add the parameterKey and parameter too
@param parameterKey
the key in the get request (parameterKey=parameter)
@param parameter
the parameter to add to the end of the url
@return a Stri... | [
"Adds",
"a",
"key",
"and",
"value",
"to",
"the",
"request",
"path",
"&",
"or",
"?",
"will",
"be",
"used",
"as",
"needed"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PathNormalizer.java#L437-L446 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsErrorDialog.java | CmsErrorDialog.handleException | public static void handleException(Throwable t) {
"""
Handles the exception by logging the exception to the server log and displaying an error dialog on the client.<p>
@param t the throwable
"""
String message;
StackTraceElement[] trace;
String cause = null;
String className... | java | public static void handleException(Throwable t) {
String message;
StackTraceElement[] trace;
String cause = null;
String className;
if (t instanceof CmsRpcException) {
CmsRpcException ex = (CmsRpcException)t;
message = ex.getOriginalMessage();
... | [
"public",
"static",
"void",
"handleException",
"(",
"Throwable",
"t",
")",
"{",
"String",
"message",
";",
"StackTraceElement",
"[",
"]",
"trace",
";",
"String",
"cause",
"=",
"null",
";",
"String",
"className",
";",
"if",
"(",
"t",
"instanceof",
"CmsRpcExcep... | Handles the exception by logging the exception to the server log and displaying an error dialog on the client.<p>
@param t the throwable | [
"Handles",
"the",
"exception",
"by",
"logging",
"the",
"exception",
"to",
"the",
"server",
"log",
"and",
"displaying",
"an",
"error",
"dialog",
"on",
"the",
"client",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsErrorDialog.java#L196-L229 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addDescription | protected void addDescription(MemberDoc member, Content dlTree, SearchIndexItem si) {
"""
Add description for Class, Field, Method or Constructor.
@param member MemberDoc for the member of the Class Kind
@param dlTree the content tree to which the description will be added
"""
String name = (member... | java | protected void addDescription(MemberDoc member, Content dlTree, SearchIndexItem si) {
String name = (member instanceof ExecutableMemberDoc)?
member.name() + ((ExecutableMemberDoc)member).flatSignature() :
member.name();
si.setContainingPackage(utils.getPackageName((member.contain... | [
"protected",
"void",
"addDescription",
"(",
"MemberDoc",
"member",
",",
"Content",
"dlTree",
",",
"SearchIndexItem",
"si",
")",
"{",
"String",
"name",
"=",
"(",
"member",
"instanceof",
"ExecutableMemberDoc",
")",
"?",
"member",
".",
"name",
"(",
")",
"+",
"(... | Add description for Class, Field, Method or Constructor.
@param member MemberDoc for the member of the Class Kind
@param dlTree the content tree to which the description will be added | [
"Add",
"description",
"for",
"Class",
"Field",
"Method",
"or",
"Constructor",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java#L243-L268 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java | CouchDatabaseBase.invokeUpdateHandler | public String invokeUpdateHandler(String updateHandlerUri, String docId, Params params) {
"""
Invokes an Update Handler.
<pre>
Params params = new Params()
.addParam("field", "foo")
.addParam("value", "bar");
String output = dbClient.invokeUpdateHandler("designDoc/update1", "docId", params);
</pre>
@param... | java | public String invokeUpdateHandler(String updateHandlerUri, String docId, Params params) {
assertNotEmpty(updateHandlerUri, "uri");
final String[] v = updateHandlerUri.split("/");
final InputStream response;
final URI uri;
DatabaseURIHelper uriHelper = new DatabaseURIHelper(dbUri)... | [
"public",
"String",
"invokeUpdateHandler",
"(",
"String",
"updateHandlerUri",
",",
"String",
"docId",
",",
"Params",
"params",
")",
"{",
"assertNotEmpty",
"(",
"updateHandlerUri",
",",
"\"uri\"",
")",
";",
"final",
"String",
"[",
"]",
"v",
"=",
"updateHandlerUri... | Invokes an Update Handler.
<pre>
Params params = new Params()
.addParam("field", "foo")
.addParam("value", "bar");
String output = dbClient.invokeUpdateHandler("designDoc/update1", "docId", params);
</pre>
@param updateHandlerUri The Update Handler URI, in the format: <code>designDoc/update1</code>
@param docId ... | [
"Invokes",
"an",
"Update",
"Handler",
".",
"<pre",
">",
"Params",
"params",
"=",
"new",
"Params",
"()",
".",
"addParam",
"(",
"field",
"foo",
")",
".",
"addParam",
"(",
"value",
"bar",
")",
";",
"String",
"output",
"=",
"dbClient",
".",
"invokeUpdateHand... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java#L433-L450 |
pravega/pravega | client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java | FlowHandler.createFlow | public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) {
"""
Create a flow on existing connection.
@param flow Flow.
@param rp ReplyProcessor for the specified flow.
@return Client Connection object.
"""
Exceptions.checkNotClosed(closed.get(), this);
Preconditions.check... | java | public ClientConnection createFlow(final Flow flow, final ReplyProcessor rp) {
Exceptions.checkNotClosed(closed.get(), this);
Preconditions.checkState(!disableFlow.get(), "Ensure flows are enabled.");
log.info("Creating Flow {} for endpoint {}. The current Channel is {}.", flow.getFlowId(), conn... | [
"public",
"ClientConnection",
"createFlow",
"(",
"final",
"Flow",
"flow",
",",
"final",
"ReplyProcessor",
"rp",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"closed",
".",
"get",
"(",
")",
",",
"this",
")",
";",
"Preconditions",
".",
"checkState",
"("... | Create a flow on existing connection.
@param flow Flow.
@param rp ReplyProcessor for the specified flow.
@return Client Connection object. | [
"Create",
"a",
"flow",
"on",
"existing",
"connection",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java#L64-L72 |
google/closure-compiler | src/com/google/javascript/jscomp/DotFormatter.java | DotFormatter.appendDot | static void appendDot(Node n, ControlFlowGraph<Node> inCFG,
Appendable builder) throws IOException {
"""
Converts an AST to dot representation and appends it to the given buffer.
@param n the root of the AST described in the dot formatted string
@param inCFG Control Flow Graph.
@param builder A place to d... | java | static void appendDot(Node n, ControlFlowGraph<Node> inCFG,
Appendable builder) throws IOException {
new DotFormatter(n, inCFG, builder, false);
} | [
"static",
"void",
"appendDot",
"(",
"Node",
"n",
",",
"ControlFlowGraph",
"<",
"Node",
">",
"inCFG",
",",
"Appendable",
"builder",
")",
"throws",
"IOException",
"{",
"new",
"DotFormatter",
"(",
"n",
",",
"inCFG",
",",
"builder",
",",
"false",
")",
";",
"... | Converts an AST to dot representation and appends it to the given buffer.
@param n the root of the AST described in the dot formatted string
@param inCFG Control Flow Graph.
@param builder A place to dump the graph. | [
"Converts",
"an",
"AST",
"to",
"dot",
"representation",
"and",
"appends",
"it",
"to",
"the",
"given",
"buffer",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DotFormatter.java#L170-L173 |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/VoltDDLElementTracker.java | VoltDDLElementTracker.removeProcedure | public void removeProcedure(String procName, boolean ifExists) throws VoltCompilerException {
"""
Searches for and removes the Procedure provided in prior DDL statements
@param Name of procedure being removed
@throws VoltCompilerException if the procedure does not exist
"""
assert procName != null &&... | java | public void removeProcedure(String procName, boolean ifExists) throws VoltCompilerException
{
assert procName != null && ! procName.trim().isEmpty();
String shortName = deriveShortProcedureName(procName);
if( m_procedureMap.containsKey(shortName)) {
m_procedureMap.remove(shortN... | [
"public",
"void",
"removeProcedure",
"(",
"String",
"procName",
",",
"boolean",
"ifExists",
")",
"throws",
"VoltCompilerException",
"{",
"assert",
"procName",
"!=",
"null",
"&&",
"!",
"procName",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
";",
"String"... | Searches for and removes the Procedure provided in prior DDL statements
@param Name of procedure being removed
@throws VoltCompilerException if the procedure does not exist | [
"Searches",
"for",
"and",
"removes",
"the",
"Procedure",
"provided",
"in",
"prior",
"DDL",
"statements"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/VoltDDLElementTracker.java#L129-L142 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cachepolicy_binding.java | cachepolicy_binding.get | public static cachepolicy_binding get(nitro_service service, String policyname) throws Exception {
"""
Use this API to fetch cachepolicy_binding resource of given name .
"""
cachepolicy_binding obj = new cachepolicy_binding();
obj.set_policyname(policyname);
cachepolicy_binding response = (cachepolicy_bi... | java | public static cachepolicy_binding get(nitro_service service, String policyname) throws Exception{
cachepolicy_binding obj = new cachepolicy_binding();
obj.set_policyname(policyname);
cachepolicy_binding response = (cachepolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"cachepolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"policyname",
")",
"throws",
"Exception",
"{",
"cachepolicy_binding",
"obj",
"=",
"new",
"cachepolicy_binding",
"(",
")",
";",
"obj",
".",
"set_policyname",
"(",
"pol... | Use this API to fetch cachepolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"cachepolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cachepolicy_binding.java#L136-L141 |
square/android-times-square | library/src/main/java/com/squareup/timessquare/CalendarPickerView.java | CalendarPickerView.getMonthCellWithIndexByDate | private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {
"""
Return cell and month-index (for scrolling) for a given Date.
"""
Calendar searchCal = Calendar.getInstance(timeZone, locale);
searchCal.setTime(date);
String monthKey = monthKey(searchCal);
Calendar actCal = Calendar.... | java | private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {
Calendar searchCal = Calendar.getInstance(timeZone, locale);
searchCal.setTime(date);
String monthKey = monthKey(searchCal);
Calendar actCal = Calendar.getInstance(timeZone, locale);
int index = cells.getIndexOfKey(monthKey);
... | [
"private",
"MonthCellWithMonthIndex",
"getMonthCellWithIndexByDate",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"searchCal",
"=",
"Calendar",
".",
"getInstance",
"(",
"timeZone",
",",
"locale",
")",
";",
"searchCal",
".",
"setTime",
"(",
"date",
")",
";",
"Strin... | Return cell and month-index (for scrolling) for a given Date. | [
"Return",
"cell",
"and",
"month",
"-",
"index",
"(",
"for",
"scrolling",
")",
"for",
"a",
"given",
"Date",
"."
] | train | https://github.com/square/android-times-square/blob/83b08e7cc220d587845054cd1471a604d17721f6/library/src/main/java/com/squareup/timessquare/CalendarPickerView.java#L861-L878 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/util/logging/ExceptionLogger.java | ExceptionLogger.getConsumer | @SafeVarargs
public static Consumer<Throwable> getConsumer(Class<? extends Throwable>... ignoredThrowableTypes) {
"""
Returns a consumer that can for example be used in the {@link TextChannel#typeContinuously(Consumer)} method.
It unwraps {@link CompletionException CompletionExceptions},
{@link InvocationTar... | java | @SafeVarargs
public static Consumer<Throwable> getConsumer(Class<? extends Throwable>... ignoredThrowableTypes) {
return getConsumer(null, ignoredThrowableTypes);
} | [
"@",
"SafeVarargs",
"public",
"static",
"Consumer",
"<",
"Throwable",
">",
"getConsumer",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"ignoredThrowableTypes",
")",
"{",
"return",
"getConsumer",
"(",
"null",
",",
"ignoredThrowableTypes",
")",
";",... | Returns a consumer that can for example be used in the {@link TextChannel#typeContinuously(Consumer)} method.
It unwraps {@link CompletionException CompletionExceptions},
{@link InvocationTargetException InvocationTargetExceptions} and {@link ExecutionException ExecutionExceptions}
first, and then adds a fresh {@code C... | [
"Returns",
"a",
"consumer",
"that",
"can",
"for",
"example",
"be",
"used",
"in",
"the",
"{",
"@link",
"TextChannel#typeContinuously",
"(",
"Consumer",
")",
"}",
"method",
".",
"It",
"unwraps",
"{",
"@link",
"CompletionException",
"CompletionExceptions",
"}",
"{"... | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/util/logging/ExceptionLogger.java#L62-L65 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java | NodeStack.innerProcessSubTree | private void innerProcessSubTree(
GBSNode p,
int initialState,
int topIndex) {
"""
Walk through an entire sub-tree, invoking processNode on each node.
<p>Walk through a sub-tree, invoking processNode on each node.
processNode is an abstract megthod that is implemented by
sub... | java | private void innerProcessSubTree(
GBSNode p,
int initialState,
int topIndex)
{
boolean done = false;
_topIndex = topIndex;
_endp = p;
_endIndex = _idx;
GBSNode q; /* Used for tree walking */
int s = initialState;
while... | [
"private",
"void",
"innerProcessSubTree",
"(",
"GBSNode",
"p",
",",
"int",
"initialState",
",",
"int",
"topIndex",
")",
"{",
"boolean",
"done",
"=",
"false",
";",
"_topIndex",
"=",
"topIndex",
";",
"_endp",
"=",
"p",
";",
"_endIndex",
"=",
"_idx",
";",
"... | Walk through an entire sub-tree, invoking processNode on each node.
<p>Walk through a sub-tree, invoking processNode on each node.
processNode is an abstract megthod that is implemented by
subclasses.</p>
@param p The node at which to start.
@param initialState The initial state of the walk, which is one of
VISIT_LEF... | [
"Walk",
"through",
"an",
"entire",
"sub",
"-",
"tree",
"invoking",
"processNode",
"on",
"each",
"node",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java#L309-L367 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/android/Facebook.java | Facebook.validateServiceIntent | private boolean validateServiceIntent(Context context, Intent intent) {
"""
Helper to validate a service intent by resolving and checking the
provider's package signature.
@param context
@param intent
@return true if the service intent resolution happens successfully and
the signatures match.
"""
... | java | private boolean validateServiceIntent(Context context, Intent intent) {
ResolveInfo resolveInfo = context.getPackageManager().resolveService(intent, 0);
if (resolveInfo == null) {
return false;
}
return validateAppSignatureForPackage(context, resolveInfo.serviceInfo.packageN... | [
"private",
"boolean",
"validateServiceIntent",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"ResolveInfo",
"resolveInfo",
"=",
"context",
".",
"getPackageManager",
"(",
")",
".",
"resolveService",
"(",
"intent",
",",
"0",
")",
";",
"if",
"(",
... | Helper to validate a service intent by resolving and checking the
provider's package signature.
@param context
@param intent
@return true if the service intent resolution happens successfully and
the signatures match. | [
"Helper",
"to",
"validate",
"a",
"service",
"intent",
"by",
"resolving",
"and",
"checking",
"the",
"provider",
"s",
"package",
"signature",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/android/Facebook.java#L372-L379 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.moveBlockMeta | public BlockMeta moveBlockMeta(BlockMeta blockMeta, TempBlockMeta tempBlockMeta)
throws BlockDoesNotExistException, WorkerOutOfSpaceException, BlockAlreadyExistsException {
"""
Moves an existing block to another location currently hold by a temp block.
@param blockMeta the metadata of the block to move
@... | java | public BlockMeta moveBlockMeta(BlockMeta blockMeta, TempBlockMeta tempBlockMeta)
throws BlockDoesNotExistException, WorkerOutOfSpaceException, BlockAlreadyExistsException {
StorageDir srcDir = blockMeta.getParentDir();
StorageDir dstDir = tempBlockMeta.getParentDir();
srcDir.removeBlockMeta(blockMeta)... | [
"public",
"BlockMeta",
"moveBlockMeta",
"(",
"BlockMeta",
"blockMeta",
",",
"TempBlockMeta",
"tempBlockMeta",
")",
"throws",
"BlockDoesNotExistException",
",",
"WorkerOutOfSpaceException",
",",
"BlockAlreadyExistsException",
"{",
"StorageDir",
"srcDir",
"=",
"blockMeta",
".... | Moves an existing block to another location currently hold by a temp block.
@param blockMeta the metadata of the block to move
@param tempBlockMeta a placeholder in the destination directory
@return the new block metadata if success, absent otherwise
@throws BlockDoesNotExistException when the block to move is not fou... | [
"Moves",
"an",
"existing",
"block",
"to",
"another",
"location",
"currently",
"hold",
"by",
"a",
"temp",
"block",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L376-L386 |
andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getRandomChars | public String getRandomChars(final int minLength, final int maxLength) {
"""
Return a string containing between <code>length</code> random characters
@param minLength minimum number of characters to use in the string
@param maxLength maximum number of characters to use in the string
@return A string contain... | java | public String getRandomChars(final int minLength, final int maxLength) {
validateMinMaxParams(minLength, maxLength);
StringBuilder sb = new StringBuilder(maxLength);
int length = minLength;
if (maxLength != minLength) {
length = length + random.nextInt(maxLength - minLength);
}
wh... | [
"public",
"String",
"getRandomChars",
"(",
"final",
"int",
"minLength",
",",
"final",
"int",
"maxLength",
")",
"{",
"validateMinMaxParams",
"(",
"minLength",
",",
"maxLength",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"maxLength",
")",
... | Return a string containing between <code>length</code> random characters
@param minLength minimum number of characters to use in the string
@param maxLength maximum number of characters to use in the string
@return A string containing <code>length</code> random characters | [
"Return",
"a",
"string",
"containing",
"between",
"<code",
">",
"length<",
"/",
"code",
">",
"random",
"characters"
] | train | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L464-L477 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teaservlet/util/TemplateServerServlet.java | TemplateServerServlet.doGet | public void doGet(HttpServletRequest req,HttpServletResponse res) {
"""
Retrieves all the templates that are newer that the timestamp specified
by the client. The pathInfo from the request specifies which templates
are desired. QueryString parameters "timeStamp" and ??? provide
"""
getTemplateData(... | java | public void doGet(HttpServletRequest req,HttpServletResponse res) {
getTemplateData(req, res,req.getPathInfo());
} | [
"public",
"void",
"doGet",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"getTemplateData",
"(",
"req",
",",
"res",
",",
"req",
".",
"getPathInfo",
"(",
")",
")",
";",
"}"
] | Retrieves all the templates that are newer that the timestamp specified
by the client. The pathInfo from the request specifies which templates
are desired. QueryString parameters "timeStamp" and ??? provide | [
"Retrieves",
"all",
"the",
"templates",
"that",
"are",
"newer",
"that",
"the",
"timestamp",
"specified",
"by",
"the",
"client",
".",
"The",
"pathInfo",
"from",
"the",
"request",
"specifies",
"which",
"templates",
"are",
"desired",
".",
"QueryString",
"parameters... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teaservlet/util/TemplateServerServlet.java#L79-L81 |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEntryNameForMap | private static String getEntryNameForMap(String property, Boolean key, Integer index) {
"""
Returns the entry name for a map element in the EDB format. The key parameter defines if the entry name should be
generated for the key or the value of the map. E.g. the map key for the property "map" with the index 0 woul... | java | private static String getEntryNameForMap(String property, Boolean key, Integer index) {
return String.format("%s.%d.%s", property, index, key ? "key" : "value");
} | [
"private",
"static",
"String",
"getEntryNameForMap",
"(",
"String",
"property",
",",
"Boolean",
"key",
",",
"Integer",
"index",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s.%d.%s\"",
",",
"property",
",",
"index",
",",
"key",
"?",
"\"key\"",
":",
... | Returns the entry name for a map element in the EDB format. The key parameter defines if the entry name should be
generated for the key or the value of the map. E.g. the map key for the property "map" with the index 0 would be
"map.0.key". | [
"Returns",
"the",
"entry",
"name",
"for",
"a",
"map",
"element",
"in",
"the",
"EDB",
"format",
".",
"The",
"key",
"parameter",
"defines",
"if",
"the",
"entry",
"name",
"should",
"be",
"generated",
"for",
"the",
"key",
"or",
"the",
"value",
"of",
"the",
... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L521-L523 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.