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 |
|---|---|---|---|---|---|---|---|---|---|---|
craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bigIntegerToBytes | static public int bigIntegerToBytes(BigInteger integer, byte[] buffer, int index) {
"""
This function converts a big integer into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param integer The big integer to be converted.
@param buffer The byte array.
@param... | java | static public int bigIntegerToBytes(BigInteger integer, byte[] buffer, int index) {
int length = 4 + (integer.bitLength() + 8) / 8;
System.arraycopy(intToBytes(length), 0, buffer, index, 4); // copy in the length
index += 4;
System.arraycopy(integer.toByteArray(), 0, buffer, index, leng... | [
"static",
"public",
"int",
"bigIntegerToBytes",
"(",
"BigInteger",
"integer",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"4",
"+",
"(",
"integer",
".",
"bitLength",
"(",
")",
"+",
"8",
")",
"/",
"8",
";",
... | This function converts a big integer into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param integer The big integer to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"big",
"integer",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L355-L361 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionsInner.java | RoleDefinitionsInner.createOrUpdateAsync | public Observable<RoleDefinitionInner> createOrUpdateAsync(String scope, String roleDefinitionId) {
"""
Creates or updates a role definition.
@param scope The scope of the role definition.
@param roleDefinitionId The ID of the role definition.
@throws IllegalArgumentException thrown if parameters fail the val... | java | public Observable<RoleDefinitionInner> createOrUpdateAsync(String scope, String roleDefinitionId) {
return createOrUpdateWithServiceResponseAsync(scope, roleDefinitionId).map(new Func1<ServiceResponse<RoleDefinitionInner>, RoleDefinitionInner>() {
@Override
public RoleDefinitionInner cal... | [
"public",
"Observable",
"<",
"RoleDefinitionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"scope",
",",
"String",
"roleDefinitionId",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"scope",
",",
"roleDefinitionId",
")",
".",
"map",
"(",
"new",... | Creates or updates a role definition.
@param scope The scope of the role definition.
@param roleDefinitionId The ID of the role definition.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RoleDefinitionInner object | [
"Creates",
"or",
"updates",
"a",
"role",
"definition",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleDefinitionsInner.java#L293-L300 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java | IfmapJ.createSsrc | @Deprecated
public static SSRC createSsrc(String url, String user, String pass, TrustManager[] tms)
throws InitializationException {
"""
Create a new {@link SSRC} object to operate on the given url
using basic authentication.
@param url
the URL to connect to
@param user
basic authentication user
@param... | java | @Deprecated
public static SSRC createSsrc(String url, String user, String pass, TrustManager[] tms)
throws InitializationException {
return new SsrcImpl(url, user, pass, tms, 120 * 1000);
} | [
"@",
"Deprecated",
"public",
"static",
"SSRC",
"createSsrc",
"(",
"String",
"url",
",",
"String",
"user",
",",
"String",
"pass",
",",
"TrustManager",
"[",
"]",
"tms",
")",
"throws",
"InitializationException",
"{",
"return",
"new",
"SsrcImpl",
"(",
"url",
","... | Create a new {@link SSRC} object to operate on the given url
using basic authentication.
@param url
the URL to connect to
@param user
basic authentication user
@param pass
basic authentication password
@param tms
TrustManager instances to initialize the {@link SSLContext} with.
@return a new {@link SSRC} that uses bas... | [
"Create",
"a",
"new",
"{",
"@link",
"SSRC",
"}",
"object",
"to",
"operate",
"on",
"the",
"given",
"url",
"using",
"basic",
"authentication",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java#L97-L101 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java | FeaturesImpl.addPhraseListAsync | public Observable<Integer> addPhraseListAsync(UUID appId, String versionId, PhraselistCreateObject phraselistCreateObject) {
"""
Creates a new phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistCreateObject A Phraselist object containing Name, comma-separate... | java | public Observable<Integer> addPhraseListAsync(UUID appId, String versionId, PhraselistCreateObject phraselistCreateObject) {
return addPhraseListWithServiceResponseAsync(appId, versionId, phraselistCreateObject).map(new Func1<ServiceResponse<Integer>, Integer>() {
@Override
public Intege... | [
"public",
"Observable",
"<",
"Integer",
">",
"addPhraseListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"PhraselistCreateObject",
"phraselistCreateObject",
")",
"{",
"return",
"addPhraseListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
","... | Creates a new phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistCreateObject A Phraselist object containing Name, comma-separated Phrases and the isExchangeable boolean. Default value for isExchangeable is true.
@throws IllegalArgumentException thrown if parameters ... | [
"Creates",
"a",
"new",
"phraselist",
"feature",
"."
] | 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/FeaturesImpl.java#L135-L142 |
nutzam/nutzboot | nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-elasticsearch/src/main/java/io/nutz/demo/simple/utils/ElasticsearchUtil.java | ElasticsearchUtil.createOrUpdateData | public boolean createOrUpdateData(String indexName, String type, String id, Object obj) {
"""
创建或更新文档
@param indexName 索引名
@param type 数据类型(表名)
@param id 主键
@param obj 对象
@return
"""
IndexResponse response = getClient().prepareIndex(indexName, type).setId(id).setSource(Lang.obj... | java | public boolean createOrUpdateData(String indexName, String type, String id, Object obj) {
IndexResponse response = getClient().prepareIndex(indexName, type).setId(id).setSource(Lang.obj2map(obj)).execute().actionGet();
return response.getResult() == DocWriteResponse.Result.CREATED || response.getResult(... | [
"public",
"boolean",
"createOrUpdateData",
"(",
"String",
"indexName",
",",
"String",
"type",
",",
"String",
"id",
",",
"Object",
"obj",
")",
"{",
"IndexResponse",
"response",
"=",
"getClient",
"(",
")",
".",
"prepareIndex",
"(",
"indexName",
",",
"type",
")... | 创建或更新文档
@param indexName 索引名
@param type 数据类型(表名)
@param id 主键
@param obj 对象
@return | [
"创建或更新文档"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-elasticsearch/src/main/java/io/nutz/demo/simple/utils/ElasticsearchUtil.java#L109-L112 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java | PluginDownloader.start | @Override
public void start() {
"""
Deletes the temporary files remaining from previous downloads
"""
try {
forceMkdir(downloadDir);
for (File tempFile : listTempFile(this.downloadDir)) {
deleteQuietly(tempFile);
}
} catch (IOException e) {
throw new IllegalStateExcept... | java | @Override
public void start() {
try {
forceMkdir(downloadDir);
for (File tempFile : listTempFile(this.downloadDir)) {
deleteQuietly(tempFile);
}
} catch (IOException e) {
throw new IllegalStateException("Fail to create the directory: " + downloadDir, e);
}
} | [
"@",
"Override",
"public",
"void",
"start",
"(",
")",
"{",
"try",
"{",
"forceMkdir",
"(",
"downloadDir",
")",
";",
"for",
"(",
"File",
"tempFile",
":",
"listTempFile",
"(",
"this",
".",
"downloadDir",
")",
")",
"{",
"deleteQuietly",
"(",
"tempFile",
")",... | Deletes the temporary files remaining from previous downloads | [
"Deletes",
"the",
"temporary",
"files",
"remaining",
"from",
"previous",
"downloads"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java#L74-L84 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBoundsPicker.java | GVRBoundsPicker.makeObjectHit | static GVRPickedObject makeObjectHit(long colliderPointer, int collidableIndex, float distance, float hitx, float hity, float hitz) {
"""
Internal utility to help JNI add hit objects to the pick list.
"""
GVRCollider collider = GVRCollider.lookup(colliderPointer);
if (collider == null)
... | java | static GVRPickedObject makeObjectHit(long colliderPointer, int collidableIndex, float distance, float hitx, float hity, float hitz)
{
GVRCollider collider = GVRCollider.lookup(colliderPointer);
if (collider == null)
{
Log.d("GVRBoundsPicker", "makeObjectHit: cannot find collider ... | [
"static",
"GVRPickedObject",
"makeObjectHit",
"(",
"long",
"colliderPointer",
",",
"int",
"collidableIndex",
",",
"float",
"distance",
",",
"float",
"hitx",
",",
"float",
"hity",
",",
"float",
"hitz",
")",
"{",
"GVRCollider",
"collider",
"=",
"GVRCollider",
".",... | Internal utility to help JNI add hit objects to the pick list. | [
"Internal",
"utility",
"to",
"help",
"JNI",
"add",
"hit",
"objects",
"to",
"the",
"pick",
"list",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBoundsPicker.java#L287-L298 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/Workbook.java | Workbook.createWorkbook | public static Workbook createWorkbook(FileFormat format, OutputStream os, Workbook existing)
throws IOException {
"""
Creates a new workbook object.
@param format The format of the workbook (XLS or XLSX)
@param os The output stream to write the workbook to
@param existing An existing workbook to add to
... | java | public static Workbook createWorkbook(FileFormat format, OutputStream os, Workbook existing)
throws IOException
{
Workbook ret = null;
if(format == FileFormat.XLS)
{
ret = XlsWorkbook.createWorkbook(os, existing);
}
else if(format == FileFormat.XLSX)
... | [
"public",
"static",
"Workbook",
"createWorkbook",
"(",
"FileFormat",
"format",
",",
"OutputStream",
"os",
",",
"Workbook",
"existing",
")",
"throws",
"IOException",
"{",
"Workbook",
"ret",
"=",
"null",
";",
"if",
"(",
"format",
"==",
"FileFormat",
".",
"XLS",
... | Creates a new workbook object.
@param format The format of the workbook (XLS or XLSX)
@param os The output stream to write the workbook to
@param existing An existing workbook to add to
@return The new workbook created
@throws IOException if the file cannot be written | [
"Creates",
"a",
"new",
"workbook",
"object",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/Workbook.java#L91-L105 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isMethodNode | public static boolean isMethodNode(ASTNode node, String methodNamePattern, Integer numArguments, Class returnType) {
"""
Tells you if the ASTNode is a method node for the given name, arity, and return type.
@param node
the node to inspect
@param methodNamePattern
the expected name of the method
@param numArgu... | java | public static boolean isMethodNode(ASTNode node, String methodNamePattern, Integer numArguments, Class returnType) {
if (!(node instanceof MethodNode)) {
return false;
}
if (!(((MethodNode) node).getName().matches(methodNamePattern))) {
return false;
}
... | [
"public",
"static",
"boolean",
"isMethodNode",
"(",
"ASTNode",
"node",
",",
"String",
"methodNamePattern",
",",
"Integer",
"numArguments",
",",
"Class",
"returnType",
")",
"{",
"if",
"(",
"!",
"(",
"node",
"instanceof",
"MethodNode",
")",
")",
"{",
"return",
... | Tells you if the ASTNode is a method node for the given name, arity, and return type.
@param node
the node to inspect
@param methodNamePattern
the expected name of the method
@param numArguments
the expected number of arguments, optional
@param returnType
the expected return type, optional
@return
true if this node is ... | [
"Tells",
"you",
"if",
"the",
"ASTNode",
"is",
"a",
"method",
"node",
"for",
"the",
"given",
"name",
"arity",
"and",
"return",
"type",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L842-L856 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsContainerpageService.java | CmsContainerpageService.getCachedElement | public CmsContainerElementBean getCachedElement(String clientId, String pageRootPath) throws CmsException {
"""
Reads the cached element-bean for the given client-side-id from cache.<p>
@param clientId the client-side-id
@param pageRootPath the container page root path
@return the cached container element b... | java | public CmsContainerElementBean getCachedElement(String clientId, String pageRootPath) throws CmsException {
String id = clientId;
CmsContainerElementBean element = null;
element = getSessionCache().getCacheContainerElement(id);
if (element != null) {
return element;
... | [
"public",
"CmsContainerElementBean",
"getCachedElement",
"(",
"String",
"clientId",
",",
"String",
"pageRootPath",
")",
"throws",
"CmsException",
"{",
"String",
"id",
"=",
"clientId",
";",
"CmsContainerElementBean",
"element",
"=",
"null",
";",
"element",
"=",
"getS... | Reads the cached element-bean for the given client-side-id from cache.<p>
@param clientId the client-side-id
@param pageRootPath the container page root path
@return the cached container element bean
@throws CmsException in case reading the element resource fails | [
"Reads",
"the",
"cached",
"element",
"-",
"bean",
"for",
"the",
"given",
"client",
"-",
"side",
"-",
"id",
"from",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsContainerpageService.java#L722-L745 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java | FTPControlChannel.waitFor | public void waitFor(Flag aborted, int ioDelay, int maxWait) throws ServerException,
IOException, InterruptedException {
"""
Block until one of the conditions are true:
<ol>
<li> a reply is available in the control channel,
<li> timeout (maxWait) expired
<li> aborted flag changes to true.
</ol>
If maxWait ... | java | public void waitFor(Flag aborted, int ioDelay, int maxWait) throws ServerException,
IOException, InterruptedException {
int oldTimeout = this.socket.getSoTimeout();
try {
int c = 0;
if (maxWait != WAIT_FOREVER) {
this.socket.setSoTimeout(maxWait);
... | [
"public",
"void",
"waitFor",
"(",
"Flag",
"aborted",
",",
"int",
"ioDelay",
",",
"int",
"maxWait",
")",
"throws",
"ServerException",
",",
"IOException",
",",
"InterruptedException",
"{",
"int",
"oldTimeout",
"=",
"this",
".",
"socket",
".",
"getSoTimeout",
"("... | Block until one of the conditions are true:
<ol>
<li> a reply is available in the control channel,
<li> timeout (maxWait) expired
<li> aborted flag changes to true.
</ol>
If maxWait == WAIT_FOREVER, never timeout
and only check conditions (1) and (3).
@param maxWait timeout in miliseconds
@param ioDelay frequency of po... | [
"Block",
"until",
"one",
"of",
"the",
"conditions",
"are",
"true",
":",
"<ol",
">",
"<li",
">",
"a",
"reply",
"is",
"available",
"in",
"the",
"control",
"channel",
"<li",
">",
"timeout",
"(",
"maxWait",
")",
"expired",
"<li",
">",
"aborted",
"flag",
"c... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java#L319-L362 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/extension/Extension.java | Extension.getListenerClass | @SuppressWarnings("unchecked") // We check this ourselves with isAssignableFrom()
private Class<Listener> getListenerClass(String name)
throws GuacamoleException {
"""
Retrieve the Listener subclass having the given name. If
the class having the given name does not exist or isn't actually a
subcl... | java | @SuppressWarnings("unchecked") // We check this ourselves with isAssignableFrom()
private Class<Listener> getListenerClass(String name)
throws GuacamoleException {
try {
// Get listener class
Class<?> listenerClass = classLoader.loadClass(name);
// Verify t... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// We check this ourselves with isAssignableFrom()",
"private",
"Class",
"<",
"Listener",
">",
"getListenerClass",
"(",
"String",
"name",
")",
"throws",
"GuacamoleException",
"{",
"try",
"{",
"// Get listener class",
"C... | Retrieve the Listener subclass having the given name. If
the class having the given name does not exist or isn't actually a
subclass of Listener, an exception will be thrown.
@param name
The name of the Listener class to retrieve.
@return
The subclass of Listener having the given name.
@throws GuacamoleException
If ... | [
"Retrieve",
"the",
"Listener",
"subclass",
"having",
"the",
"given",
"name",
".",
"If",
"the",
"class",
"having",
"the",
"given",
"name",
"does",
"not",
"exist",
"or",
"isn",
"t",
"actually",
"a",
"subclass",
"of",
"Listener",
"an",
"exception",
"will",
"b... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/extension/Extension.java#L283-L307 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DFSClient.java | DFSClient.saveNamespace | void saveNamespace(boolean force, boolean uncompressed)
throws AccessControlException, IOException {
"""
Save namespace image.
See {@link ClientProtocol#saveNamespace()}
for more details.
@see ClientProtocol#saveNamespace()
"""
try {
if (namenodeProtocolProxy == null) {
versionBasedSav... | java | void saveNamespace(boolean force, boolean uncompressed)
throws AccessControlException, IOException {
try {
if (namenodeProtocolProxy == null) {
versionBasedSaveNamespace(force, uncompressed);
} else {
methodBasedSaveNamespace(force, uncompressed);
}
} catch(RemoteException re... | [
"void",
"saveNamespace",
"(",
"boolean",
"force",
",",
"boolean",
"uncompressed",
")",
"throws",
"AccessControlException",
",",
"IOException",
"{",
"try",
"{",
"if",
"(",
"namenodeProtocolProxy",
"==",
"null",
")",
"{",
"versionBasedSaveNamespace",
"(",
"force",
"... | Save namespace image.
See {@link ClientProtocol#saveNamespace()}
for more details.
@see ClientProtocol#saveNamespace() | [
"Save",
"namespace",
"image",
".",
"See",
"{",
"@link",
"ClientProtocol#saveNamespace",
"()",
"}",
"for",
"more",
"details",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java#L2354-L2365 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java | RegistriesInner.createOrUpdate | public RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner registry) {
"""
Creates or updates a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name o... | java | public RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner registry) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body();
} | [
"public",
"RegistryInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryInner",
"registry",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"registry",
... | Creates or updates a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registry The parameters for creating or updating a container registry.
@throws IllegalAr... | [
"Creates",
"or",
"updates",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java#L295-L297 |
apereo/cas | support/cas-server-support-aup-core/src/main/java/org/apereo/cas/aup/AcceptableUsagePolicyStatus.java | AcceptableUsagePolicyStatus.getPropertyOrDefault | public Collection<Object> getPropertyOrDefault(final String name, final Object defaultValue) {
"""
Gets property or default.
@param name the name
@param defaultValue the default value
@return the property or default
"""
return getPropertyOrDefault(name, CollectionUtils.wrapList(defaultValu... | java | public Collection<Object> getPropertyOrDefault(final String name, final Object defaultValue) {
return getPropertyOrDefault(name, CollectionUtils.wrapList(defaultValue));
} | [
"public",
"Collection",
"<",
"Object",
">",
"getPropertyOrDefault",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"defaultValue",
")",
"{",
"return",
"getPropertyOrDefault",
"(",
"name",
",",
"CollectionUtils",
".",
"wrapList",
"(",
"defaultValue",
")",
... | Gets property or default.
@param name the name
@param defaultValue the default value
@return the property or default | [
"Gets",
"property",
"or",
"default",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-aup-core/src/main/java/org/apereo/cas/aup/AcceptableUsagePolicyStatus.java#L100-L102 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/templates/config/SiteConfigurationReader.java | SiteConfigurationReader.mergeConfigurations | private SiteConfiguration mergeConfigurations(SiteConfiguration rootConf, SiteConfiguration controllerConf) {
"""
Letting <code>controllerConf</code> take precedence over <code>rootConf</code>.
<br>Adding them uncritically
<p>Does not do any overwrites on any of the parameters.
Instead it creates a new object... | java | private SiteConfiguration mergeConfigurations(SiteConfiguration rootConf, SiteConfiguration controllerConf) {
// do not do any overwrites to the rootConf
// clone it instead (or create an entirely new object)
SiteConfiguration topConf = rootConf.clone();
if (controllerConf.title != null ... | [
"private",
"SiteConfiguration",
"mergeConfigurations",
"(",
"SiteConfiguration",
"rootConf",
",",
"SiteConfiguration",
"controllerConf",
")",
"{",
"// do not do any overwrites to the rootConf",
"// clone it instead (or create an entirely new object)",
"SiteConfiguration",
"topConf",
"=... | Letting <code>controllerConf</code> take precedence over <code>rootConf</code>.
<br>Adding them uncritically
<p>Does not do any overwrites on any of the parameters.
Instead it creates a new object with all the merges
@param rootConf
The default configuration at the root of the templateFolder
@param controllerConf
The... | [
"Letting",
"<code",
">",
"controllerConf<",
"/",
"code",
">",
"take",
"precedence",
"over",
"<code",
">",
"rootConf<",
"/",
"code",
">",
".",
"<br",
">",
"Adding",
"them",
"uncritically"
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/templates/config/SiteConfigurationReader.java#L200-L229 |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ServerMappingController.java | ServerMappingController.updateSrcRedirectUrl | @RequestMapping(value = "api/edit/server/ {
"""
Updates the src url in the server redirects
@param model
@param id
@param srcUrl
@return
@throws Exception
"""id}/src", method = RequestMethod.POST)
public
@ResponseBody
ServerRedirect updateSrcRedirectUrl(Model model, @PathVariable int id, Str... | java | @RequestMapping(value = "api/edit/server/{id}/src", method = RequestMethod.POST)
public
@ResponseBody
ServerRedirect updateSrcRedirectUrl(Model model, @PathVariable int id, String srcUrl) throws Exception {
ServerRedirectService.getInstance().setSourceUrl(srcUrl, id);
return ServerRedirectSe... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"api/edit/server/{id}/src\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"ServerRedirect",
"updateSrcRedirectUrl",
"(",
"Model",
"model",
",",
"@",
"PathVariable",
"int",
"id",
... | Updates the src url in the server redirects
@param model
@param id
@param srcUrl
@return
@throws Exception | [
"Updates",
"the",
"src",
"url",
"in",
"the",
"server",
"redirects"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ServerMappingController.java#L287-L293 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.methodInvocationTypeArg | public static TypeAnnotationPosition
methodInvocationTypeArg(final List<TypePathEntry> location,
final int type_index) {
"""
Create a {@code TypeAnnotationPosition} for a method
invocation type argument.
@param location The type path.
@param type_index The index of the ... | java | public static TypeAnnotationPosition
methodInvocationTypeArg(final List<TypePathEntry> location,
final int type_index) {
return methodInvocationTypeArg(location, null, type_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"methodInvocationTypeArg",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"type_index",
")",
"{",
"return",
"methodInvocationTypeArg",
"(",
"location",
",",
"null",
",",
"type_index",
"... | Create a {@code TypeAnnotationPosition} for a method
invocation type argument.
@param location The type path.
@param type_index The index of the type argument. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"method",
"invocation",
"type",
"argument",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L911-L915 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/template/TemplateSettingsReader.java | TemplateSettingsReader.readTemplate | public static String readTemplate(String root, String template) throws IOException {
"""
Read a template
@param root dir within the classpath
@param template template name (.json will be appended)
@return The template content
@throws IOException if the connection with elasticsearch is failing
"""
if (roo... | java | public static String readTemplate(String root, String template) throws IOException {
if (root == null) {
return readTemplate(template);
}
String settingsFile = root + "/" + Defaults.TemplateDir + "/" + template + Defaults.JsonFileExtension;
return readFileFromClasspath(settingsFile);
} | [
"public",
"static",
"String",
"readTemplate",
"(",
"String",
"root",
",",
"String",
"template",
")",
"throws",
"IOException",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"{",
"return",
"readTemplate",
"(",
"template",
")",
";",
"}",
"String",
"settingsFile",
... | Read a template
@param root dir within the classpath
@param template template name (.json will be appended)
@return The template content
@throws IOException if the connection with elasticsearch is failing | [
"Read",
"a",
"template"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/template/TemplateSettingsReader.java#L44-L50 |
quattor/pan | panc/src/main/java/org/quattor/pan/dml/functions/AbstractMatcher.java | AbstractMatcher.compilePattern | protected Pattern compilePattern(Element regex, int flags) {
"""
Generate a Pattern from the given string and flags.
@param regex
regular expression to compile
@param flags
matching flags to use for pattern
@return Pattern corresponding to the given regular expression and
matching flags
"""
Patter... | java | protected Pattern compilePattern(Element regex, int flags) {
Pattern p = null;
try {
String re = ((StringProperty) regex).getValue();
p = Pattern.compile(re, flags);
} catch (PatternSyntaxException pse) {
throw EvaluationException.create(sourceRange, MSG_INVALID_REGEXP,
pse.getLocalizedMessage());
... | [
"protected",
"Pattern",
"compilePattern",
"(",
"Element",
"regex",
",",
"int",
"flags",
")",
"{",
"Pattern",
"p",
"=",
"null",
";",
"try",
"{",
"String",
"re",
"=",
"(",
"(",
"StringProperty",
")",
"regex",
")",
".",
"getValue",
"(",
")",
";",
"p",
"... | Generate a Pattern from the given string and flags.
@param regex
regular expression to compile
@param flags
matching flags to use for pattern
@return Pattern corresponding to the given regular expression and
matching flags | [
"Generate",
"a",
"Pattern",
"from",
"the",
"given",
"string",
"and",
"flags",
"."
] | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/dml/functions/AbstractMatcher.java#L112-L124 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java | CassQuery.getColumnName | private String getColumnName(EntityMetadata metadata, String property) {
"""
Gets column name for a given field name.
@param metadata
the metadata
@param property
the property
@return the column name
"""
MetamodelImpl metaModel =
(MetamodelImpl) kunderaMetadata.getApplicationMetadata... | java | private String getColumnName(EntityMetadata metadata, String property) {
MetamodelImpl metaModel =
(MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
String jpaColumnName = null;
if (property.equals(((AbstractAttribute) metadata.get... | [
"private",
"String",
"getColumnName",
"(",
"EntityMetadata",
"metadata",
",",
"String",
"property",
")",
"{",
"MetamodelImpl",
"metaModel",
"=",
"(",
"MetamodelImpl",
")",
"kunderaMetadata",
".",
"getApplicationMetadata",
"(",
")",
".",
"getMetamodel",
"(",
"metadat... | Gets column name for a given field name.
@param metadata
the metadata
@param property
the property
@return the column name | [
"Gets",
"column",
"name",
"for",
"a",
"given",
"field",
"name",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java#L1328-L1342 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/authorization/providers/YamlProvider.java | YamlProvider.policiesFromSource | public static PolicyCollection policiesFromSource(
final YamlSource source,
final Set<Attribute> forcedContext
)
throws IOException {
"""
Load policies from a source
@param source source
@param forcedContext Context to require for all policies parsed
@return po... | java | public static PolicyCollection policiesFromSource(
final YamlSource source,
final Set<Attribute> forcedContext
)
throws IOException
{
return policiesFromSource(source, forcedContext, null);
} | [
"public",
"static",
"PolicyCollection",
"policiesFromSource",
"(",
"final",
"YamlSource",
"source",
",",
"final",
"Set",
"<",
"Attribute",
">",
"forcedContext",
")",
"throws",
"IOException",
"{",
"return",
"policiesFromSource",
"(",
"source",
",",
"forcedContext",
"... | Load policies from a source
@param source source
@param forcedContext Context to require for all policies parsed
@return policies
@throws IOException | [
"Load",
"policies",
"from",
"a",
"source"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/authorization/providers/YamlProvider.java#L153-L160 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getRepeated | @Nonnull
public static String getRepeated (@Nonnull final String sElement, @Nonnegative final int nRepeats) {
"""
Get the passed string element repeated for a certain number of times. Each
string element is simply appended at the end of the string.
@param sElement
The string to get repeated. May not be <cod... | java | @Nonnull
public static String getRepeated (@Nonnull final String sElement, @Nonnegative final int nRepeats)
{
ValueEnforcer.notNull (sElement, "Element");
ValueEnforcer.isGE0 (nRepeats, "Repeats");
final int nElementLength = sElement.length ();
// Check if result length would exceed int range
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getRepeated",
"(",
"@",
"Nonnull",
"final",
"String",
"sElement",
",",
"@",
"Nonnegative",
"final",
"int",
"nRepeats",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sElement",
",",
"\"Element\"",
")",
";",
"V... | Get the passed string element repeated for a certain number of times. Each
string element is simply appended at the end of the string.
@param sElement
The string to get repeated. May not be <code>null</code>.
@param nRepeats
The number of repetitions to retrieve. May not be < 0.
@return A non-<code>null</code> stri... | [
"Get",
"the",
"passed",
"string",
"element",
"repeated",
"for",
"a",
"certain",
"number",
"of",
"times",
".",
"Each",
"string",
"element",
"is",
"simply",
"appended",
"at",
"the",
"end",
"of",
"the",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2379-L2405 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getFromFirstIncl | @Nullable
public static String getFromFirstIncl (@Nullable final String sStr, final char cSearch) {
"""
Get everything from the string from and including the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if the... | java | @Nullable
public static String getFromFirstIncl (@Nullable final String sStr, final char cSearch)
{
return _getFromFirst (sStr, cSearch, true);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getFromFirstIncl",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"char",
"cSearch",
")",
"{",
"return",
"_getFromFirst",
"(",
"sStr",
",",
"cSearch",
",",
"true",
")",
";",
"}"
] | Get everything from the string from and including the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if the passed string does not contain the search
character. | [
"Get",
"everything",
"from",
"the",
"string",
"from",
"and",
"including",
"the",
"first",
"passed",
"char",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4934-L4938 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(Double value, byte[] dst, int dstOffset) {
"""
Encodes the given Double object into exactly 8 bytes for descending
order. A non-canonical NaN value is used to represent null.
@param value optional Double value to encode
@param dst destination for encoded bytes
@param dstOffset o... | java | public static void encodeDesc(Double value, byte[] dst, int dstOffset) {
if (value == null) {
DataEncoder.encode(~0x7fffffffffffffffL, dst, dstOffset);
} else {
encodeDesc(value.doubleValue(), dst, dstOffset);
}
} | [
"public",
"static",
"void",
"encodeDesc",
"(",
"Double",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"DataEncoder",
".",
"encode",
"(",
"~",
"0x7fffffffffffffff",
"L",
",",
"dst"... | Encodes the given Double object into exactly 8 bytes for descending
order. A non-canonical NaN value is used to represent null.
@param value optional Double value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Double",
"object",
"into",
"exactly",
"8",
"bytes",
"for",
"descending",
"order",
".",
"A",
"non",
"-",
"canonical",
"NaN",
"value",
"is",
"used",
"to",
"represent",
"null",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L295-L301 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/component/PathOperationComponent.java | PathOperationComponent.buildDescriptionSection | private void buildDescriptionSection(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
"""
Adds a operation description to the document.
@param operation the Swagger Operation
"""
MarkupDocBuilder descriptionBuilder = copyMarkupDocBuilder(markupDocBuilder);
applyPathsDocumentExte... | java | private void buildDescriptionSection(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
MarkupDocBuilder descriptionBuilder = copyMarkupDocBuilder(markupDocBuilder);
applyPathsDocumentExtension(new PathsDocumentExtension.Context(Position.OPERATION_DESCRIPTION_BEGIN, descriptionBuilder, operat... | [
"private",
"void",
"buildDescriptionSection",
"(",
"MarkupDocBuilder",
"markupDocBuilder",
",",
"PathOperation",
"operation",
")",
"{",
"MarkupDocBuilder",
"descriptionBuilder",
"=",
"copyMarkupDocBuilder",
"(",
"markupDocBuilder",
")",
";",
"applyPathsDocumentExtension",
"("... | Adds a operation description to the document.
@param operation the Swagger Operation | [
"Adds",
"a",
"operation",
"description",
"to",
"the",
"document",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/component/PathOperationComponent.java#L172-L188 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasLSTM.java | KerasLSTM.getForgetBiasInitFromConfig | public double getForgetBiasInitFromConfig(Map<String, Object> layerConfig, boolean train)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
"""
Get LSTM forget gate bias initialization from Keras layer configuration.
@param layerConfig dictionary containing Keras la... | java | public double getForgetBiasInitFromConfig(Map<String, Object> layerConfig, boolean train)
throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
String kerasForget... | [
"public",
"double",
"getForgetBiasInitFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"boolean",
"train",
")",
"throws",
"InvalidKerasConfigurationException",
",",
"UnsupportedKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
... | Get LSTM forget gate bias initialization from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return LSTM forget gate bias init
@throws InvalidKerasConfigurationException Unsupported Keras config | [
"Get",
"LSTM",
"forget",
"gate",
"bias",
"initialization",
"from",
"Keras",
"layer",
"configuration",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/recurrent/KerasLSTM.java#L479-L511 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | MethodUtils.getMethodsListWithAnnotation | public static List<Method> getMethodsListWithAnnotation(final Class<?> cls, final Class<? extends Annotation> annotationCls) {
"""
Gets all class level public methods of the given class that are annotated with the given annotation.
@param cls
the {@link Class} to query
@param annotationCls
the {@link Annotatio... | java | public static List<Method> getMethodsListWithAnnotation(final Class<?> cls, final Class<? extends Annotation> annotationCls) {
return getMethodsListWithAnnotation(cls, annotationCls, false, false);
} | [
"public",
"static",
"List",
"<",
"Method",
">",
"getMethodsListWithAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationCls",
")",
"{",
"return",
"getMethodsListWithAnnotation",
"(",
... | Gets all class level public methods of the given class that are annotated with the given annotation.
@param cls
the {@link Class} to query
@param annotationCls
the {@link Annotation} that must be present on a method to be matched
@return a list of Methods (possibly empty).
@throws IllegalArgumentException
if the class ... | [
"Gets",
"all",
"class",
"level",
"public",
"methods",
"of",
"the",
"given",
"class",
"that",
"are",
"annotated",
"with",
"the",
"given",
"annotation",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java#L861-L863 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java | DependencyBundlingAnalyzer.isShadedJar | protected boolean isShadedJar(Dependency dependency, Dependency nextDependency) {
"""
Determines if the jar is shaded and the created pom.xml identified the
same CPE as the jar - if so, the pom.xml dependency should be removed.
@param dependency a dependency to check
@param nextDependency another dependency t... | java | protected boolean isShadedJar(Dependency dependency, Dependency nextDependency) {
if (dependency == null || dependency.getFileName() == null
|| nextDependency == null || nextDependency.getFileName() == null
|| dependency.getSoftwareIdentifiers().isEmpty()
|| nextD... | [
"protected",
"boolean",
"isShadedJar",
"(",
"Dependency",
"dependency",
",",
"Dependency",
"nextDependency",
")",
"{",
"if",
"(",
"dependency",
"==",
"null",
"||",
"dependency",
".",
"getFileName",
"(",
")",
"==",
"null",
"||",
"nextDependency",
"==",
"null",
... | Determines if the jar is shaded and the created pom.xml identified the
same CPE as the jar - if so, the pom.xml dependency should be removed.
@param dependency a dependency to check
@param nextDependency another dependency to check
@return true if on of the dependencies is a pom.xml and the identifiers
between the two... | [
"Determines",
"if",
"the",
"jar",
"is",
"shaded",
"and",
"the",
"created",
"pom",
".",
"xml",
"identified",
"the",
"same",
"CPE",
"as",
"the",
"jar",
"-",
"if",
"so",
"the",
"pom",
".",
"xml",
"dependency",
"should",
"be",
"removed",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L406-L421 |
OpenTSDB/opentsdb | src/uid/UniqueId.java | UniqueId.hbasePutWithRetry | private void hbasePutWithRetry(final PutRequest put, short attempts, short wait)
throws HBaseException {
"""
Attempts to run the PutRequest given in argument, retrying if needed.
Puts are synchronized.
@param put The PutRequest to execute.
@param attempts The maximum number of attempts.
@param wait The... | java | private void hbasePutWithRetry(final PutRequest put, short attempts, short wait)
throws HBaseException {
put.setBufferable(false); // TODO(tsuna): Remove once this code is async.
while (attempts-- > 0) {
try {
client.put(put).joinUninterruptibly();
return;
} catch (HBaseExceptio... | [
"private",
"void",
"hbasePutWithRetry",
"(",
"final",
"PutRequest",
"put",
",",
"short",
"attempts",
",",
"short",
"wait",
")",
"throws",
"HBaseException",
"{",
"put",
".",
"setBufferable",
"(",
"false",
")",
";",
"// TODO(tsuna): Remove once this code is async.",
"... | Attempts to run the PutRequest given in argument, retrying if needed.
Puts are synchronized.
@param put The PutRequest to execute.
@param attempts The maximum number of attempts.
@param wait The initial amount of time in ms to sleep for after a
failure. This amount is doubled after each failed attempt.
@throws HBase... | [
"Attempts",
"to",
"run",
"the",
"PutRequest",
"given",
"in",
"argument",
"retrying",
"if",
"needed",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1364-L1389 |
knowm/XChange | xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/service/OkCoinFuturesTradeService.java | OkCoinFuturesTradeService.getPriceLimits | public OkCoinPriceLimit getPriceLimits(CurrencyPair currencyPair, Object... args)
throws IOException {
"""
Retrieves the max price from the okex imposed by the price limits
"""
if (args != null && args.length > 0)
return getFuturesPriceLimits(currencyPair, (FuturesContract) args[0]);
else r... | java | public OkCoinPriceLimit getPriceLimits(CurrencyPair currencyPair, Object... args)
throws IOException {
if (args != null && args.length > 0)
return getFuturesPriceLimits(currencyPair, (FuturesContract) args[0]);
else return getFuturesPriceLimits(currencyPair, futuresContract);
} | [
"public",
"OkCoinPriceLimit",
"getPriceLimits",
"(",
"CurrencyPair",
"currencyPair",
",",
"Object",
"...",
"args",
")",
"throws",
"IOException",
"{",
"if",
"(",
"args",
"!=",
"null",
"&&",
"args",
".",
"length",
">",
"0",
")",
"return",
"getFuturesPriceLimits",
... | Retrieves the max price from the okex imposed by the price limits | [
"Retrieves",
"the",
"max",
"price",
"from",
"the",
"okex",
"imposed",
"by",
"the",
"price",
"limits"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/service/OkCoinFuturesTradeService.java#L142-L147 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/Where.java | Where.notIn | public Where<T, ID> notIn(String columnName, Iterable<?> objects) throws SQLException {
"""
Same as {@link #in(String, Iterable)} except with a NOT IN clause.
"""
addClause(new In(columnName, findColumnFieldType(columnName), objects, false));
return this;
} | java | public Where<T, ID> notIn(String columnName, Iterable<?> objects) throws SQLException {
addClause(new In(columnName, findColumnFieldType(columnName), objects, false));
return this;
} | [
"public",
"Where",
"<",
"T",
",",
"ID",
">",
"notIn",
"(",
"String",
"columnName",
",",
"Iterable",
"<",
"?",
">",
"objects",
")",
"throws",
"SQLException",
"{",
"addClause",
"(",
"new",
"In",
"(",
"columnName",
",",
"findColumnFieldType",
"(",
"columnName... | Same as {@link #in(String, Iterable)} except with a NOT IN clause. | [
"Same",
"as",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L226-L229 |
dbflute-session/tomcat-boot | src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java | BotmReflectionUtil.getPublicMethod | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
"""
Get the public method.
@param clazz The type of class that defines the method. (NotNull)
@param methodName The name of method. (NotNull)
@param argTypes The type of argument. (NotNull)
@return The instance of met... | java | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
assertObjectNotNull("clazz", clazz);
assertStringNotNullAndNotTrimmedEmpty("methodName", methodName);
return findMethod(clazz, methodName, argTypes, VisibilityType.PUBLIC, false);
} | [
"public",
"static",
"Method",
"getPublicMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"{",
"assertObjectNotNull",
"(",
"\"clazz\"",
",",
"clazz",
")",
";",
"assertStringN... | Get the public method.
@param clazz The type of class that defines the method. (NotNull)
@param methodName The name of method. (NotNull)
@param argTypes The type of argument. (NotNull)
@return The instance of method. (NullAllowed: if null, not found) | [
"Get",
"the",
"public",
"method",
"."
] | train | https://github.com/dbflute-session/tomcat-boot/blob/fe941f88b6be083781873126f5b12d4c16bb9073/src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java#L368-L372 |
labai/ted | ted-driver/src/main/java/ted/driver/TedDriver.java | TedDriver.createBatch | public Long createBatch(String batchTaskName, String data, String key1, String key2, List<TedTask> tedTasks) {
"""
create tasks by list and batch task for them. return batch taskId
"""
return tedDriverImpl.createBatch(batchTaskName, data, key1, key2, tedTasks);
} | java | public Long createBatch(String batchTaskName, String data, String key1, String key2, List<TedTask> tedTasks) {
return tedDriverImpl.createBatch(batchTaskName, data, key1, key2, tedTasks);
} | [
"public",
"Long",
"createBatch",
"(",
"String",
"batchTaskName",
",",
"String",
"data",
",",
"String",
"key1",
",",
"String",
"key2",
",",
"List",
"<",
"TedTask",
">",
"tedTasks",
")",
"{",
"return",
"tedDriverImpl",
".",
"createBatch",
"(",
"batchTaskName",
... | create tasks by list and batch task for them. return batch taskId | [
"create",
"tasks",
"by",
"list",
"and",
"batch",
"task",
"for",
"them",
".",
"return",
"batch",
"taskId"
] | train | https://github.com/labai/ted/blob/2ee197246a78d842c18d6780c48fd903b00608a6/ted-driver/src/main/java/ted/driver/TedDriver.java#L101-L103 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displayInfo | public void displayInfo (String bundle, String message) {
"""
Display a system INFO message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Info messages are sent when something happens that was neither directly triggered by the
user, nor requires direct action.
""... | java | public void displayInfo (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.INFO, PLACE_CHAT_TYPE);
} | [
"public",
"void",
"displayInfo",
"(",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"displaySystem",
"(",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"INFO",
",",
"PLACE_CHAT_TYPE",
")",
";",
"}"
] | Display a system INFO message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Info messages are sent when something happens that was neither directly triggered by the
user, nor requires direct action. | [
"Display",
"a",
"system",
"INFO",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
".",
"The",
"localtype",
"of",
"the",
"message",
"will",
"be",
"PLACE_CHAT_TYPE",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L321-L324 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createLabel | public GitlabLabel createLabel(Serializable projectId, GitlabLabel label)
throws IOException {
"""
Creates a new label.
@param projectId The ID of the project containing the label.
@param label The label to create.
@return The newly created label.
"""
String name = label.getName();... | java | public GitlabLabel createLabel(Serializable projectId, GitlabLabel label)
throws IOException {
String name = label.getName();
String color = label.getColor();
return createLabel(projectId, name, color);
} | [
"public",
"GitlabLabel",
"createLabel",
"(",
"Serializable",
"projectId",
",",
"GitlabLabel",
"label",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"label",
".",
"getName",
"(",
")",
";",
"String",
"color",
"=",
"label",
".",
"getColor",
"(",
")... | Creates a new label.
@param projectId The ID of the project containing the label.
@param label The label to create.
@return The newly created label. | [
"Creates",
"a",
"new",
"label",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2803-L2808 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByAppArg0 | public Iterable<DContact> queryByAppArg0(Object parent, java.lang.Long appArg0) {
"""
query-by method for field appArg0
@param appArg0 the specified attribute
@return an Iterable of DContacts for the specified appArg0
"""
return queryByField(parent, DContactMapper.Field.APPARG0.getFieldName(), appArg0);
... | java | public Iterable<DContact> queryByAppArg0(Object parent, java.lang.Long appArg0) {
return queryByField(parent, DContactMapper.Field.APPARG0.getFieldName(), appArg0);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByAppArg0",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"Long",
"appArg0",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"APPARG0",
".",
"getFieldNam... | query-by method for field appArg0
@param appArg0 the specified attribute
@return an Iterable of DContacts for the specified appArg0 | [
"query",
"-",
"by",
"method",
"for",
"field",
"appArg0"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L88-L90 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java | ModificationBuilderTarget.removeModule | public T removeModule(final String moduleName, final String slot, final byte[] existingHash) {
"""
Remove a module.
@param moduleName the module name
@param slot the module slot
@param existingHash the existing hash
@return the builder
"""
final ContentItem item = createModuleItem(moduleName, slo... | java | public T removeModule(final String moduleName, final String slot, final byte[] existingHash) {
final ContentItem item = createModuleItem(moduleName, slot, NO_CONTENT);
addContentModification(createContentModification(item, ModificationType.REMOVE, existingHash));
return returnThis();
} | [
"public",
"T",
"removeModule",
"(",
"final",
"String",
"moduleName",
",",
"final",
"String",
"slot",
",",
"final",
"byte",
"[",
"]",
"existingHash",
")",
"{",
"final",
"ContentItem",
"item",
"=",
"createModuleItem",
"(",
"moduleName",
",",
"slot",
",",
"NO_C... | Remove a module.
@param moduleName the module name
@param slot the module slot
@param existingHash the existing hash
@return the builder | [
"Remove",
"a",
"module",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L203-L207 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/BaseDateTimeField.java | BaseDateTimeField.addWrapField | public long addWrapField(long instant, int value) {
"""
Adds a value (which may be negative) to the instant value,
wrapping within this field.
<p>
The value will be added to this field. If the value is too large to be
added solely to this field then it wraps. Larger fields are always
unaffected. Smaller field... | java | public long addWrapField(long instant, int value) {
int current = get(instant);
int wrapped = FieldUtils.getWrappedValue
(current, value, getMinimumValue(instant), getMaximumValue(instant));
return set(instant, wrapped);
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"int",
"current",
"=",
"get",
"(",
"instant",
")",
";",
"int",
"wrapped",
"=",
"FieldUtils",
".",
"getWrappedValue",
"(",
"current",
",",
"value",
",",
"getMinimumValu... | Adds a value (which may be negative) to the instant value,
wrapping within this field.
<p>
The value will be added to this field. If the value is too large to be
added solely to this field then it wraps. Larger fields are always
unaffected. Smaller fields should be unaffected, except where the
result would be an invali... | [
"Adds",
"a",
"value",
"(",
"which",
"may",
"be",
"negative",
")",
"to",
"the",
"instant",
"value",
"wrapping",
"within",
"this",
"field",
".",
"<p",
">",
"The",
"value",
"will",
"be",
"added",
"to",
"this",
"field",
".",
"If",
"the",
"value",
"is",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/BaseDateTimeField.java#L460-L465 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java | Resources.getResourceAsStream | @Pure
@SuppressWarnings("resource")
public static InputStream getResourceAsStream(Class<?> classname, String path) {
"""
Replies the input stream of a resource.
<p>You may use Unix-like syntax to write the resource path, ie.
you may use slashes to separate filenames.
<p>The name of {@code classname} is tr... | java | @Pure
@SuppressWarnings("resource")
public static InputStream getResourceAsStream(Class<?> classname, String path) {
if (classname == null) {
return null;
}
InputStream is = getResourceAsStream(classname.getClassLoader(), classname.getPackage(), path);
if (is == null) {
is = getResourceAsStream(classnam... | [
"@",
"Pure",
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"public",
"static",
"InputStream",
"getResourceAsStream",
"(",
"Class",
"<",
"?",
">",
"classname",
",",
"String",
"path",
")",
"{",
"if",
"(",
"classname",
"==",
"null",
")",
"{",
"return",
"... | Replies the input stream of a resource.
<p>You may use Unix-like syntax to write the resource path, ie.
you may use slashes to separate filenames.
<p>The name of {@code classname} is translated into a resource
path (by remove the name of the class and replacing the dots by slashes) and the given path
is append to. Fo... | [
"Replies",
"the",
"input",
"stream",
"of",
"a",
"resource",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java#L287-L298 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOperations.java | AddOperations.getResultShapeName | private static String getResultShapeName(Operation operation, Map<String, Shape> shapes) {
"""
In query protocol, the wrapped result is the real return type for the given operation. In the c2j model,
if the output shape has only one member, and the member shape is wrapped (wrapper is true), then the
return type ... | java | private static String getResultShapeName(Operation operation, Map<String, Shape> shapes) {
Output output = operation.getOutput();
if (output == null) return null;
Shape outputShape = shapes.get(output.getShape());
if (outputShape.getMembers().keySet().size() != 1) return output.getShape(... | [
"private",
"static",
"String",
"getResultShapeName",
"(",
"Operation",
"operation",
",",
"Map",
"<",
"String",
",",
"Shape",
">",
"shapes",
")",
"{",
"Output",
"output",
"=",
"operation",
".",
"getOutput",
"(",
")",
";",
"if",
"(",
"output",
"==",
"null",
... | In query protocol, the wrapped result is the real return type for the given operation. In the c2j model,
if the output shape has only one member, and the member shape is wrapped (wrapper is true), then the
return type is the wrapped member shape instead of the output shape. In the following example, the service API is:... | [
"In",
"query",
"protocol",
"the",
"wrapped",
"result",
"is",
"the",
"real",
"return",
"type",
"for",
"the",
"given",
"operation",
".",
"In",
"the",
"c2j",
"model",
"if",
"the",
"output",
"shape",
"has",
"only",
"one",
"member",
"and",
"the",
"member",
"s... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddOperations.java#L217-L225 |
jenkinsci/github-plugin | src/main/java/org/jenkinsci/plugins/github/status/sources/ConditionalStatusResultSource.java | ConditionalStatusResultSource.get | @Override
public StatusResult get(@Nonnull Run<?, ?> run, @Nonnull TaskListener listener)
throws IOException, InterruptedException {
"""
First matching result win. Or will be used pending state.
Messages are expanded with token macro and env variables
@return first matched result or pending sta... | java | @Override
public StatusResult get(@Nonnull Run<?, ?> run, @Nonnull TaskListener listener)
throws IOException, InterruptedException {
for (ConditionalResult conditionalResult : getResults()) {
if (conditionalResult.matches(run)) {
return new StatusResult(
... | [
"@",
"Override",
"public",
"StatusResult",
"get",
"(",
"@",
"Nonnull",
"Run",
"<",
"?",
",",
"?",
">",
"run",
",",
"@",
"Nonnull",
"TaskListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"for",
"(",
"ConditionalResult",
"c... | First matching result win. Or will be used pending state.
Messages are expanded with token macro and env variables
@return first matched result or pending state with warn msg | [
"First",
"matching",
"result",
"win",
".",
"Or",
"will",
"be",
"used",
"pending",
"state",
".",
"Messages",
"are",
"expanded",
"with",
"token",
"macro",
"and",
"env",
"variables"
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/status/sources/ConditionalStatusResultSource.java#L48-L65 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/math/Fraction.java | Fraction.getReducedFraction | public static Fraction getReducedFraction(int numerator, int denominator) {
"""
<p>Creates a reduced <code>Fraction</code> instance with the 2 parts
of a fraction Y/Z.</p>
<p>For example, if the input parameters represent 2/4, then the created
fraction will be 1/2.</p>
<p>Any negative signs are resolved to... | java | public static Fraction getReducedFraction(int numerator, int denominator) {
if (denominator == 0) {
throw new ArithmeticException("The denominator must not be zero");
}
if (numerator == 0) {
return ZERO; // normalize zero.
}
// allow 2^k/-2^31 as a valid f... | [
"public",
"static",
"Fraction",
"getReducedFraction",
"(",
"int",
"numerator",
",",
"int",
"denominator",
")",
"{",
"if",
"(",
"denominator",
"==",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"The denominator must not be zero\"",
")",
";",
"}",
... | <p>Creates a reduced <code>Fraction</code> instance with the 2 parts
of a fraction Y/Z.</p>
<p>For example, if the input parameters represent 2/4, then the created
fraction will be 1/2.</p>
<p>Any negative signs are resolved to be on the numerator.</p>
@param numerator the numerator, for example the three in 'three... | [
"<p",
">",
"Creates",
"a",
"reduced",
"<code",
">",
"Fraction<",
"/",
"code",
">",
"instance",
"with",
"the",
"2",
"parts",
"of",
"a",
"fraction",
"Y",
"/",
"Z",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/Fraction.java#L208-L232 |
pravega/pravega | common/src/main/java/io/pravega/common/Exceptions.java | Exceptions.checkNotNullOrEmpty | public static String checkNotNullOrEmpty(String arg, String argName) throws NullPointerException, IllegalArgumentException {
"""
Throws a NullPointerException if the arg argument is null. Throws an IllegalArgumentException if the String arg
argument has a length of zero.
@param arg The argument to check.
... | java | public static String checkNotNullOrEmpty(String arg, String argName) throws NullPointerException, IllegalArgumentException {
Preconditions.checkNotNull(arg, argName);
checkArgument(arg.length() > 0, argName, "Cannot be an empty string.");
return arg;
} | [
"public",
"static",
"String",
"checkNotNullOrEmpty",
"(",
"String",
"arg",
",",
"String",
"argName",
")",
"throws",
"NullPointerException",
",",
"IllegalArgumentException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"arg",
",",
"argName",
")",
";",
"checkArgume... | Throws a NullPointerException if the arg argument is null. Throws an IllegalArgumentException if the String arg
argument has a length of zero.
@param arg The argument to check.
@param argName The name of the argument (to be included in the exception message).
@return The arg.
@throws NullPointerException If ar... | [
"Throws",
"a",
"NullPointerException",
"if",
"the",
"arg",
"argument",
"is",
"null",
".",
"Throws",
"an",
"IllegalArgumentException",
"if",
"the",
"String",
"arg",
"argument",
"has",
"a",
"length",
"of",
"zero",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L155-L159 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/plugin/Version.java | Version.fromClasspathProperties | public static Version fromClasspathProperties(@Nonnull Class<?> clazz, String path, String propertyName, String gitPath, String gitPropertyName, Version defaultVersion) {
"""
Try to read the version from {@code path} ({@code propertyName} property)
and {@code gitPath} ({@code gitPropertyName} property) from the c... | java | public static Version fromClasspathProperties(@Nonnull Class<?> clazz, String path, String propertyName, String gitPath, String gitPropertyName, Version defaultVersion) {
try {
final URL resource = getResource(clazz, path);
final Properties versionProperties = new Properties();
... | [
"public",
"static",
"Version",
"fromClasspathProperties",
"(",
"@",
"Nonnull",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"path",
",",
"String",
"propertyName",
",",
"String",
"gitPath",
",",
"String",
"gitPropertyName",
",",
"Version",
"defaultVersion",
")... | Try to read the version from {@code path} ({@code propertyName} property)
and {@code gitPath} ({@code gitPropertyName} property) from the classpath.
@param clazz Class where the class loader should be obtained from.
@param path Path of the properties file on the classpath which contains the versio... | [
"Try",
"to",
"read",
"the",
"version",
"from",
"{",
"@code",
"path",
"}",
"(",
"{",
"@code",
"propertyName",
"}",
"property",
")",
"and",
"{",
"@code",
"gitPath",
"}",
"(",
"{",
"@code",
"gitPropertyName",
"}",
"property",
")",
"from",
"the",
"classpath"... | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/plugin/Version.java#L213-L244 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BooleanExtensions.java | BooleanExtensions.operator_or | @Pure
@Inline(value="($1 || $2)", constantExpression=true)
public static boolean operator_or(boolean a, boolean b) {
"""
A logical <code>or</code> (disjunction). This is the equivalent to the java <code>||</code> operator.
@param a
a boolean value.
@param b
another boolean value.
@return <code>a || b</cod... | java | @Pure
@Inline(value="($1 || $2)", constantExpression=true)
public static boolean operator_or(boolean a, boolean b) {
return a || b;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 || $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"boolean",
"operator_or",
"(",
"boolean",
"a",
",",
"boolean",
"b",
")",
"{",
"return",
"a",
"||",
"b",
";",
"}"
] | A logical <code>or</code> (disjunction). This is the equivalent to the java <code>||</code> operator.
@param a
a boolean value.
@param b
another boolean value.
@return <code>a || b</code> | [
"A",
"logical",
"<code",
">",
"or<",
"/",
"code",
">",
"(",
"disjunction",
")",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"java",
"<code",
">",
"||<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BooleanExtensions.java#L45-L49 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java | Matrix.getMatrix | public Matrix getMatrix(int[] r, int[] c) {
"""
Get a submatrix.
@param r Array of row indices.
@param c Array of column indices.
@return A(r(:), c(:))
@throws ArrayIndexOutOfBoundsException Submatrix indices
"""
Matrix X = new Matrix(r.length, c.length);
double[][] B = X.getArray();
... | java | public Matrix getMatrix(int[] r, int[] c)
{
Matrix X = new Matrix(r.length, c.length);
double[][] B = X.getArray();
try
{
for (int i = 0; i < r.length; i++)
{
for (int j = 0; j < c.length; j++)
{
B[i][j] = A[... | [
"public",
"Matrix",
"getMatrix",
"(",
"int",
"[",
"]",
"r",
",",
"int",
"[",
"]",
"c",
")",
"{",
"Matrix",
"X",
"=",
"new",
"Matrix",
"(",
"r",
".",
"length",
",",
"c",
".",
"length",
")",
";",
"double",
"[",
"]",
"[",
"]",
"B",
"=",
"X",
"... | Get a submatrix.
@param r Array of row indices.
@param c Array of column indices.
@return A(r(:), c(:))
@throws ArrayIndexOutOfBoundsException Submatrix indices | [
"Get",
"a",
"submatrix",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L392-L411 |
dnsjava/dnsjava | org/xbill/DNS/ResolverConfig.java | ResolverConfig.findProperty | private boolean
findProperty() {
"""
Looks in the system properties to find servers and a search path.
Servers are defined by dns.server=server1,server2...
The search path is defined by dns.search=domain1,domain2...
"""
String prop;
List lserver = new ArrayList(0);
List lsearch = new ArrayList(0);
String... | java | private boolean
findProperty() {
String prop;
List lserver = new ArrayList(0);
List lsearch = new ArrayList(0);
StringTokenizer st;
prop = System.getProperty("dns.server");
if (prop != null) {
st = new StringTokenizer(prop, ",");
while (st.hasMoreTokens())
addServer(st.nextToken(), lserver);
}
prop = S... | [
"private",
"boolean",
"findProperty",
"(",
")",
"{",
"String",
"prop",
";",
"List",
"lserver",
"=",
"new",
"ArrayList",
"(",
"0",
")",
";",
"List",
"lsearch",
"=",
"new",
"ArrayList",
"(",
"0",
")",
";",
"StringTokenizer",
"st",
";",
"prop",
"=",
"Syst... | Looks in the system properties to find servers and a search path.
Servers are defined by dns.server=server1,server2...
The search path is defined by dns.search=domain1,domain2... | [
"Looks",
"in",
"the",
"system",
"properties",
"to",
"find",
"servers",
"and",
"a",
"search",
"path",
".",
"Servers",
"are",
"defined",
"by",
"dns",
".",
"server",
"=",
"server1",
"server2",
"...",
"The",
"search",
"path",
"is",
"defined",
"by",
"dns",
".... | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ResolverConfig.java#L132-L154 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.getValue | public static Object getValue(Name name, int index) {
"""
Get the value of the Rdn at the requested index in the supplied Name.
@param name the Name to work on.
@param index The 0-based index of the rdn value to retrieve. Must be in the range [0,size()).
@return the value of the rdn at the requested index.
@... | java | public static Object getValue(Name name, int index) {
Assert.notNull(name, "name must not be null");
LdapName ldapName = returnOrConstructLdapNameFromName(name);
Rdn rdn = ldapName.getRdn(index);
if(rdn.size() > 1) {
LOGGER.warn("Rdn at position " + index + " of dn '" + name... | [
"public",
"static",
"Object",
"getValue",
"(",
"Name",
"name",
",",
"int",
"index",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name must not be null\"",
")",
";",
"LdapName",
"ldapName",
"=",
"returnOrConstructLdapNameFromName",
"(",
"name",
")",
... | Get the value of the Rdn at the requested index in the supplied Name.
@param name the Name to work on.
@param index The 0-based index of the rdn value to retrieve. Must be in the range [0,size()).
@return the value of the rdn at the requested index.
@throws IndexOutOfBoundsException if index is outside the specified r... | [
"Get",
"the",
"value",
"of",
"the",
"Rdn",
"at",
"the",
"requested",
"index",
"in",
"the",
"supplied",
"Name",
"."
] | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L561-L572 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/Assert.java | Assert.doesNotContain | public static void doesNotContain(String textToSearch, String substring, String message) {
"""
Assert that the given text does not contain the given substring. <pre class="code">Assert .doesNotContain(name,
"rod", "Name must not contain 'rod'");</pre>
@param textToSearch the text to search.
@param substring t... | java | public static void doesNotContain(String textToSearch, String substring, String message) {
if (StringUtils.hasLength(textToSearch) && StringUtils.hasLength(substring) &&
textToSearch.contains(substring)) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"doesNotContain",
"(",
"String",
"textToSearch",
",",
"String",
"substring",
",",
"String",
"message",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasLength",
"(",
"textToSearch",
")",
"&&",
"StringUtils",
".",
"hasLength",
"(",
"subs... | Assert that the given text does not contain the given substring. <pre class="code">Assert .doesNotContain(name,
"rod", "Name must not contain 'rod'");</pre>
@param textToSearch the text to search.
@param substring the substring to find within the text.
@param message the exception message to use if the assertion fails... | [
"Assert",
"that",
"the",
"given",
"text",
"does",
"not",
"contain",
"the",
"given",
"substring",
".",
"<pre",
"class",
"=",
"code",
">",
"Assert",
".",
"doesNotContain",
"(",
"name",
"rod",
"Name",
"must",
"not",
"contain",
"rod",
")",
";",
"<",
"/",
"... | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/Assert.java#L117-L122 |
thinkaurelius/faunus | src/main/java/com/thinkaurelius/faunus/FaunusPipeline.java | FaunusPipeline.linkOut | public FaunusPipeline linkOut(final String label, final String step, final String mergeWeightKey) {
"""
Have the elements for the named step previous project an edge from the current vertex with provided label.
If a merge weight key is provided, then count the number of duplicate edges between the same two vertic... | java | public FaunusPipeline linkOut(final String label, final String step, final String mergeWeightKey) {
return link(OUT, label, step, mergeWeightKey);
} | [
"public",
"FaunusPipeline",
"linkOut",
"(",
"final",
"String",
"label",
",",
"final",
"String",
"step",
",",
"final",
"String",
"mergeWeightKey",
")",
"{",
"return",
"link",
"(",
"OUT",
",",
"label",
",",
"step",
",",
"mergeWeightKey",
")",
";",
"}"
] | Have the elements for the named step previous project an edge from the current vertex with provided label.
If a merge weight key is provided, then count the number of duplicate edges between the same two vertices and add a weight.
No weight key is specified by "_" and then all duplicates are merged, but no weight is ad... | [
"Have",
"the",
"elements",
"for",
"the",
"named",
"step",
"previous",
"project",
"an",
"edge",
"from",
"the",
"current",
"vertex",
"with",
"provided",
"label",
".",
"If",
"a",
"merge",
"weight",
"key",
"is",
"provided",
"then",
"count",
"the",
"number",
"o... | train | https://github.com/thinkaurelius/faunus/blob/1eb8494eeb3fe3b84a98d810d304ba01d55b0d6e/src/main/java/com/thinkaurelius/faunus/FaunusPipeline.java#L856-L858 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.postwrite | public void postwrite(byte[] b,int offset, int length)
throws IOException {
"""
Write bytes into the postreserve.
The capacity is not checked.
@param b
@param offset
@param length
@exception IOException
"""
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
} | java | public void postwrite(byte[] b,int offset, int length)
throws IOException
{
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
} | [
"public",
"void",
"postwrite",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"System",
".",
"arraycopy",
"(",
"b",
",",
"offset",
",",
"_buf",
",",
"_pos",
",",
"length",
")",
";",
"_pos",
... | Write bytes into the postreserve.
The capacity is not checked.
@param b
@param offset
@param length
@exception IOException | [
"Write",
"bytes",
"into",
"the",
"postreserve",
".",
"The",
"capacity",
"is",
"not",
"checked",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L259-L264 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitConfigMonitor.java | GitConfigMonitor.removeChange | @Override
public void removeChange(DiffEntry change) {
"""
remove a {@link FlowSpec} for a deleted or renamed flow config
@param change
"""
if (checkConfigFilePath(change.getOldPath())) {
Path configFilePath = new Path(this.repositoryDir, change.getOldPath());
String flowName = FSSpecStore.g... | java | @Override
public void removeChange(DiffEntry change) {
if (checkConfigFilePath(change.getOldPath())) {
Path configFilePath = new Path(this.repositoryDir, change.getOldPath());
String flowName = FSSpecStore.getSpecName(configFilePath);
String flowGroup = FSSpecStore.getSpecGroup(configFilePath);
... | [
"@",
"Override",
"public",
"void",
"removeChange",
"(",
"DiffEntry",
"change",
")",
"{",
"if",
"(",
"checkConfigFilePath",
"(",
"change",
".",
"getOldPath",
"(",
")",
")",
")",
"{",
"Path",
"configFilePath",
"=",
"new",
"Path",
"(",
"this",
".",
"repositor... | remove a {@link FlowSpec} for a deleted or renamed flow config
@param change | [
"remove",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitConfigMonitor.java#L117-L138 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java | SpiderService.verifyShard | public void verifyShard(TableDefinition tableDef, int shardNumber) {
"""
Get the starting date of the shard with the given number in the given sharded
table. If the given table has not yet started the given shard, null is returned.
@param tableDef {@link TableDefinition} of a sharded table.
@param shardN... | java | public void verifyShard(TableDefinition tableDef, int shardNumber) {
assert tableDef.isSharded();
assert shardNumber > 0;
checkServiceState();
m_shardCache.verifyShard(tableDef, shardNumber);
} | [
"public",
"void",
"verifyShard",
"(",
"TableDefinition",
"tableDef",
",",
"int",
"shardNumber",
")",
"{",
"assert",
"tableDef",
".",
"isSharded",
"(",
")",
";",
"assert",
"shardNumber",
">",
"0",
";",
"checkServiceState",
"(",
")",
";",
"m_shardCache",
".",
... | Get the starting date of the shard with the given number in the given sharded
table. If the given table has not yet started the given shard, null is returned.
@param tableDef {@link TableDefinition} of a sharded table.
@param shardNumber Shard number (must be > 0).
@return Start date of the given s... | [
"Get",
"the",
"starting",
"date",
"of",
"the",
"shard",
"with",
"the",
"given",
"number",
"in",
"the",
"given",
"sharded",
"table",
".",
"If",
"the",
"given",
"table",
"has",
"not",
"yet",
"started",
"the",
"given",
"shard",
"null",
"is",
"returned",
"."... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L484-L489 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/JoblogUtil.java | JoblogUtil.logRawMsgToJobLogAndTrace | @Trivial
public static void logRawMsgToJobLogAndTrace(Level level, String msg, Logger traceLogger) {
"""
logs the message to joblog and trace.
Joblog and trace.log messages will be logged as per supplied logging level
@param level logging level the message was logged at by the code writing the log msg.
@para... | java | @Trivial
public static void logRawMsgToJobLogAndTrace(Level level, String msg, Logger traceLogger){
logToJoblogIfNotTraceLoggable(level, msg, traceLogger);
logToTrace(level, msg, traceLogger);
} | [
"@",
"Trivial",
"public",
"static",
"void",
"logRawMsgToJobLogAndTrace",
"(",
"Level",
"level",
",",
"String",
"msg",
",",
"Logger",
"traceLogger",
")",
"{",
"logToJoblogIfNotTraceLoggable",
"(",
"level",
",",
"msg",
",",
"traceLogger",
")",
";",
"logToTrace",
"... | logs the message to joblog and trace.
Joblog and trace.log messages will be logged as per supplied logging level
@param level logging level the message was logged at by the code writing the log msg.
@param rawMsg Message is complete, it has already been translated with parameters a filled in,
or it is a raw, non-trans... | [
"logs",
"the",
"message",
"to",
"joblog",
"and",
"trace",
".",
"Joblog",
"and",
"trace",
".",
"log",
"messages",
"will",
"be",
"logged",
"as",
"per",
"supplied",
"logging",
"level"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/JoblogUtil.java#L106-L111 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleImportExportRepository.java | CmsModuleImportExportRepository.importModule | public synchronized void importModule(String name, byte[] content) throws CmsException {
"""
Imports module data.<p>
@param name the module file name
@param content the module ZIP file data
@throws CmsException if something goes wrong
"""
String moduleName = null;
boolean ok = true;
... | java | public synchronized void importModule(String name, byte[] content) throws CmsException {
String moduleName = null;
boolean ok = true;
try {
if (content.length == 0) {
// Happens when using CmsResourceWrapperModules with JLAN and createResource is called
... | [
"public",
"synchronized",
"void",
"importModule",
"(",
"String",
"name",
",",
"byte",
"[",
"]",
"content",
")",
"throws",
"CmsException",
"{",
"String",
"moduleName",
"=",
"null",
";",
"boolean",
"ok",
"=",
"true",
";",
"try",
"{",
"if",
"(",
"content",
... | Imports module data.<p>
@param name the module file name
@param content the module ZIP file data
@throws CmsException if something goes wrong | [
"Imports",
"module",
"data",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleImportExportRepository.java#L241-L278 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java | WTable.handleSortRequest | private void handleSortRequest(final Request request) {
"""
Handles a request containing sort instruction data.
@param request the request containing sort instruction data.
"""
String sortColStr = request.getParameter(getId() + ".sort");
String sortDescStr = request.getParameter(getId() + ".sortDesc");
... | java | private void handleSortRequest(final Request request) {
String sortColStr = request.getParameter(getId() + ".sort");
String sortDescStr = request.getParameter(getId() + ".sortDesc");
if (sortColStr != null) {
if ("".equals(sortColStr)) {
// Reset sort
setSort(-1, false);
getOrCreateComponentModel(... | [
"private",
"void",
"handleSortRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"String",
"sortColStr",
"=",
"request",
".",
"getParameter",
"(",
"getId",
"(",
")",
"+",
"\".sort\"",
")",
";",
"String",
"sortDescStr",
"=",
"request",
".",
"getParameter",... | Handles a request containing sort instruction data.
@param request the request containing sort instruction data. | [
"Handles",
"a",
"request",
"containing",
"sort",
"instruction",
"data",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java#L1285-L1314 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java | X500Name.getRFC1779Name | public String getRFC1779Name(Map<String, String> oidMap)
throws IllegalArgumentException {
"""
Returns a string form of the X.500 distinguished name
using the algorithm defined in RFC 1779. Attribute type
keywords defined in RFC 1779 are emitted, as well as additional
keywords contained in the OID/keywo... | java | public String getRFC1779Name(Map<String, String> oidMap)
throws IllegalArgumentException {
if (oidMap.isEmpty()) {
// return cached result
if (rfc1779Dn != null) {
return rfc1779Dn;
} else {
rfc1779Dn = generateRFC1779DN(oidMap);
... | [
"public",
"String",
"getRFC1779Name",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"oidMap",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"oidMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"// return cached result",
"if",
"(",
"rfc1779Dn",
"!=",
"... | Returns a string form of the X.500 distinguished name
using the algorithm defined in RFC 1779. Attribute type
keywords defined in RFC 1779 are emitted, as well as additional
keywords contained in the OID/keyword map. | [
"Returns",
"a",
"string",
"form",
"of",
"the",
"X",
".",
"500",
"distinguished",
"name",
"using",
"the",
"algorithm",
"defined",
"in",
"RFC",
"1779",
".",
"Attribute",
"type",
"keywords",
"defined",
"in",
"RFC",
"1779",
"are",
"emitted",
"as",
"well",
"as"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java#L636-L648 |
glyptodon/guacamole-client | extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/CodeUsageTrackingService.java | CodeUsageTrackingService.useCode | public boolean useCode(String username, String code)
throws GuacamoleException {
"""
Attempts to mark the given code as used. The code MUST have already been
validated against the user's secret key, as this function only verifies
whether the code has been previously used, not whether it is actually
... | java | public boolean useCode(String username, String code)
throws GuacamoleException {
// Repeatedly attempt to use the given code until an explicit success
// or failure has occurred
UsedCode usedCode = new UsedCode(username, code);
for (;;) {
// Explicitly invalidat... | [
"public",
"boolean",
"useCode",
"(",
"String",
"username",
",",
"String",
"code",
")",
"throws",
"GuacamoleException",
"{",
"// Repeatedly attempt to use the given code until an explicit success",
"// or failure has occurred",
"UsedCode",
"usedCode",
"=",
"new",
"UsedCode",
"... | Attempts to mark the given code as used. The code MUST have already been
validated against the user's secret key, as this function only verifies
whether the code has been previously used, not whether it is actually
valid. If the code has not previously been used, the code is stored as
having been used by the given user... | [
"Attempts",
"to",
"mark",
"the",
"given",
"code",
"as",
"used",
".",
"The",
"code",
"MUST",
"have",
"already",
"been",
"validated",
"against",
"the",
"user",
"s",
"secret",
"key",
"as",
"this",
"function",
"only",
"verifies",
"whether",
"the",
"code",
"has... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/CodeUsageTrackingService.java#L220-L253 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/hostcpu.java | hostcpu.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
hostcpu_responses result = (hostcpu_responses) service.get_payload_form... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
hostcpu_responses result = (hostcpu_responses) service.get_payload_formatter().string_to_resource(hostcpu_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NO... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"hostcpu_responses",
"result",
"=",
"(",
"hostcpu_responses",
")",
"service",
".",
"get_payload_formatter",
... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/hostcpu.java#L340-L357 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleContentDescriptionProvider.java | JingleContentDescriptionProvider.parsePayload | protected JinglePayloadType parsePayload(final XmlPullParser parser) {
"""
Parse a iq/jingle/description/payload-type element.
@param parser the input to parse
@return a payload type element
"""
int ptId = 0;
String ptName;
int ptChannels = 0;
try {
ptId = Integ... | java | protected JinglePayloadType parsePayload(final XmlPullParser parser) {
int ptId = 0;
String ptName;
int ptChannels = 0;
try {
ptId = Integer.parseInt(parser.getAttributeValue("", "id"));
} catch (Exception e) {
}
ptName = parser.getAttributeValue("",... | [
"protected",
"JinglePayloadType",
"parsePayload",
"(",
"final",
"XmlPullParser",
"parser",
")",
"{",
"int",
"ptId",
"=",
"0",
";",
"String",
"ptName",
";",
"int",
"ptChannels",
"=",
"0",
";",
"try",
"{",
"ptId",
"=",
"Integer",
".",
"parseInt",
"(",
"parse... | Parse a iq/jingle/description/payload-type element.
@param parser the input to parse
@return a payload type element | [
"Parse",
"a",
"iq",
"/",
"jingle",
"/",
"description",
"/",
"payload",
"-",
"type",
"element",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleContentDescriptionProvider.java#L44-L62 |
SerhatSurguvec/SwipableLayout | app/src/main/java/com/serhatsurguvec/swipablelayoutdemo/Activity/SwipableActivity.java | SwipableActivity.addTransitionListener | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean addTransitionListener(final ImageView imageView, final Item item) {
"""
Try and add a {@link Transition.TransitionListener} to the entering shared element
{@link Transition}. We do this so that we can load the full-size image after the transition
has c... | java | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean addTransitionListener(final ImageView imageView, final Item item) {
final Transition transition = getWindow().getSharedElementEnterTransition();
if (transition != null) {
// There is an entering shared element transition so add a ... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",
")",
"private",
"boolean",
"addTransitionListener",
"(",
"final",
"ImageView",
"imageView",
",",
"final",
"Item",
"item",
")",
"{",
"final",
"Transition",
"transition",
"=",
"getWindow",
"(",... | Try and add a {@link Transition.TransitionListener} to the entering shared element
{@link Transition}. We do this so that we can load the full-size image after the transition
has completed.
@param imageView
@param item
@return true if we were successful in adding a listener to the enter transition | [
"Try",
"and",
"add",
"a",
"{",
"@link",
"Transition",
".",
"TransitionListener",
"}",
"to",
"the",
"entering",
"shared",
"element",
"{",
"@link",
"Transition",
"}",
".",
"We",
"do",
"this",
"so",
"that",
"we",
"can",
"load",
"the",
"full",
"-",
"size",
... | train | https://github.com/SerhatSurguvec/SwipableLayout/blob/3d7e3e9fe91c7a1e9584c2350ca3256d7487e7f1/app/src/main/java/com/serhatsurguvec/swipablelayoutdemo/Activity/SwipableActivity.java#L207-L249 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTableUI.java | SeaGlassTableUI.extendRect | private Rectangle extendRect(Rectangle rect, boolean horizontal) {
"""
DOCUMENT ME!
@param rect DOCUMENT ME!
@param horizontal DOCUMENT ME!
@return DOCUMENT ME!
"""
if (rect == null) {
return rect;
}
if (horizontal) {
rect.x = 0;
r... | java | private Rectangle extendRect(Rectangle rect, boolean horizontal) {
if (rect == null) {
return rect;
}
if (horizontal) {
rect.x = 0;
rect.width = table.getWidth();
} else {
rect.y = 0;
if (table.getRowCount() != 0) {
... | [
"private",
"Rectangle",
"extendRect",
"(",
"Rectangle",
"rect",
",",
"boolean",
"horizontal",
")",
"{",
"if",
"(",
"rect",
"==",
"null",
")",
"{",
"return",
"rect",
";",
"}",
"if",
"(",
"horizontal",
")",
"{",
"rect",
".",
"x",
"=",
"0",
";",
"rect",... | DOCUMENT ME!
@param rect DOCUMENT ME!
@param horizontal DOCUMENT ME!
@return DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTableUI.java#L707-L728 |
lucmoreau/ProvToolbox | prov-interop/src/main/java/org/openprovenance/prov/interop/InteropFramework.java | InteropFramework.getOption | String getOption(String[] options, int index) {
"""
Returns an option at given index in an array of options, or null
@param options an array of Strings
@param index position of the option that is sought
@return the option or null
"""
if ((options != null) && (options.length > index)) {
r... | java | String getOption(String[] options, int index) {
if ((options != null) && (options.length > index)) {
return options[index];
}
return null;
} | [
"String",
"getOption",
"(",
"String",
"[",
"]",
"options",
",",
"int",
"index",
")",
"{",
"if",
"(",
"(",
"options",
"!=",
"null",
")",
"&&",
"(",
"options",
".",
"length",
">",
"index",
")",
")",
"{",
"return",
"options",
"[",
"index",
"]",
";",
... | Returns an option at given index in an array of options, or null
@param options an array of Strings
@param index position of the option that is sought
@return the option or null | [
"Returns",
"an",
"option",
"at",
"given",
"index",
"in",
"an",
"array",
"of",
"options",
"or",
"null"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-interop/src/main/java/org/openprovenance/prov/interop/InteropFramework.java#L289-L294 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerUndelete.java | AbstractWebPageActionHandlerUndelete.createUndeleteToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createUndeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final DATATYPE aSelectedObject) {
"""
Create toolbar for undeleting an... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createUndeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final DATATYPE aSelectedObject)
{
final Locale aDisplayLocale = aWPEC... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createUndeleteToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"FORM_TYPE",
"aForm",
",",
"@",
"Nonnull",
"final",
"DATATYPE",
"aSelectedObject",
")",
... | Create toolbar for undeleting an existing object
@param aWPEC
The web page execution context
@param aForm
The handled form. Never <code>null</code>.
@param aSelectedObject
Selected object. Never <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"undeleting",
"an",
"existing",
"object"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerUndelete.java#L125-L146 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java | QrCodeDecoderBits.checkPaddingBytes | boolean checkPaddingBytes(QrCode qr, int lengthBytes) {
"""
Makes sure the used bytes have the expected values
@param lengthBytes Number of bytes that data should be been written to and not filled with padding.
"""
boolean a = true;
for (int i = lengthBytes; i < qr.corrected.length; i++) {
if (a) {
... | java | boolean checkPaddingBytes(QrCode qr, int lengthBytes) {
boolean a = true;
for (int i = lengthBytes; i < qr.corrected.length; i++) {
if (a) {
if (0b00110111 != (qr.corrected[i] & 0xFF))
return false;
} else {
if (0b10001000 != (qr.corrected[i] & 0xFF)) {
// the pattern starts over at the beg... | [
"boolean",
"checkPaddingBytes",
"(",
"QrCode",
"qr",
",",
"int",
"lengthBytes",
")",
"{",
"boolean",
"a",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"lengthBytes",
";",
"i",
"<",
"qr",
".",
"corrected",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Makes sure the used bytes have the expected values
@param lengthBytes Number of bytes that data should be been written to and not filled with padding. | [
"Makes",
"sure",
"the",
"used",
"bytes",
"have",
"the",
"expected",
"values"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeDecoderBits.java#L208-L231 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseBitwiseOrExpression | private Expr parseBitwiseOrExpression(EnclosingScope scope, boolean terminated) {
"""
Parse an bitwise "inclusive or" expression
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This ... | java | private Expr parseBitwiseOrExpression(EnclosingScope scope, boolean terminated) {
int start = index;
Expr lhs = parseBitwiseXorExpression(scope, terminated);
if (tryAndMatch(terminated, VerticalBar) != null) {
Expr rhs = parseExpression(scope, terminated);
return annotateSourceLocation(new Expr.BitwiseOr(T... | [
"private",
"Expr",
"parseBitwiseOrExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"Expr",
"lhs",
"=",
"parseBitwiseXorExpression",
"(",
"scope",
",",
"terminated",
")",
";",
"if",
"(",
"tr... | Parse an bitwise "inclusive or" expression
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the expression is known to be terminated
(or not). An expression that's known to be... | [
"Parse",
"an",
"bitwise",
"inclusive",
"or",
"expression"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1757-L1767 |
alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.maxBy | public <T> Stream maxBy(String inputFieldName, Comparator<T> comparator) {
"""
This aggregator operation computes the maximum of tuples by the given {@code inputFieldName} in a stream by
using the given {@code comparator}. If the value of tuple with field {@code inputFieldName} is not an
instance of {@code T} th... | java | public <T> Stream maxBy(String inputFieldName, Comparator<T> comparator) {
Aggregator<ComparisonAggregator.State> max = new MaxWithComparator<>(inputFieldName, comparator);
return comparableAggregateStream(inputFieldName, max);
} | [
"public",
"<",
"T",
">",
"Stream",
"maxBy",
"(",
"String",
"inputFieldName",
",",
"Comparator",
"<",
"T",
">",
"comparator",
")",
"{",
"Aggregator",
"<",
"ComparisonAggregator",
".",
"State",
">",
"max",
"=",
"new",
"MaxWithComparator",
"<>",
"(",
"inputFiel... | This aggregator operation computes the maximum of tuples by the given {@code inputFieldName} in a stream by
using the given {@code comparator}. If the value of tuple with field {@code inputFieldName} is not an
instance of {@code T} then it throws {@code ClassCastException}
@param inputFieldName input field name
@param... | [
"This",
"aggregator",
"operation",
"computes",
"the",
"maximum",
"of",
"tuples",
"by",
"the",
"given",
"{",
"@code",
"inputFieldName",
"}",
"in",
"a",
"stream",
"by",
"using",
"the",
"given",
"{",
"@code",
"comparator",
"}",
".",
"If",
"the",
"value",
"of"... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L537-L540 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedceph/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedceph.java | ApiOvhDedicatedceph.serviceName_PUT | public String serviceName_PUT(String serviceName, OvhCrushTunablesEnum crushTunables, String label) throws IOException {
"""
Update cluster details
REST: PUT /dedicated/ceph/{serviceName}
@param serviceName [required] ID of cluster
@param crushTunables [required] Tunables of cluster
@param label [required] N... | java | public String serviceName_PUT(String serviceName, OvhCrushTunablesEnum crushTunables, String label) throws IOException {
String qPath = "/dedicated/ceph/{serviceName}";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "crushTunables", crushTunable... | [
"public",
"String",
"serviceName_PUT",
"(",
"String",
"serviceName",
",",
"OvhCrushTunablesEnum",
"crushTunables",
",",
"String",
"label",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/ceph/{serviceName}\"",
";",
"StringBuilder",
"sb",
"=",
... | Update cluster details
REST: PUT /dedicated/ceph/{serviceName}
@param serviceName [required] ID of cluster
@param crushTunables [required] Tunables of cluster
@param label [required] Name of the cluster
API beta | [
"Update",
"cluster",
"details"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedceph/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedceph.java#L66-L74 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForSubscription | public SummarizeResultsInner summarizeForSubscription(String subscriptionId, QueryOptions queryOptions) {
"""
Summarizes policy states for the resources under the subscription.
@param subscriptionId Microsoft Azure subscription ID.
@param queryOptions Additional parameters for the operation
@throws IllegalArg... | java | public SummarizeResultsInner summarizeForSubscription(String subscriptionId, QueryOptions queryOptions) {
return summarizeForSubscriptionWithServiceResponseAsync(subscriptionId, queryOptions).toBlocking().single().body();
} | [
"public",
"SummarizeResultsInner",
"summarizeForSubscription",
"(",
"String",
"subscriptionId",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"summarizeForSubscriptionWithServiceResponseAsync",
"(",
"subscriptionId",
",",
"queryOptions",
")",
".",
"toBlocking",
"("... | Summarizes policy states for the resources under the subscription.
@param subscriptionId Microsoft Azure subscription ID.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailureException thrown if the request is rejected... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resources",
"under",
"the",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L791-L793 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.doEvaluation | public <T extends IEvaluation> T[] doEvaluation(MultiDataSetIterator iterator, T... evaluations) {
"""
Perform evaluation on the given data (MultiDataSetIterator) with the given {@link IEvaluation} instance
@param iterator Test data to evaluate on
@param evaluations IEvaluation insntance
@param <T> ... | java | public <T extends IEvaluation> T[] doEvaluation(MultiDataSetIterator iterator, T... evaluations) {
try{
return doEvaluationHelper(iterator, evaluations);
} catch (OutOfMemoryError e){
CrashReportingUtil.writeMemoryCrashDump(this, e);
throw e;
}
} | [
"public",
"<",
"T",
"extends",
"IEvaluation",
">",
"T",
"[",
"]",
"doEvaluation",
"(",
"MultiDataSetIterator",
"iterator",
",",
"T",
"...",
"evaluations",
")",
"{",
"try",
"{",
"return",
"doEvaluationHelper",
"(",
"iterator",
",",
"evaluations",
")",
";",
"}... | Perform evaluation on the given data (MultiDataSetIterator) with the given {@link IEvaluation} instance
@param iterator Test data to evaluate on
@param evaluations IEvaluation insntance
@param <T> Type of the IEvaluation instance
@return The input IEvaluation instance, after performing evaluation on the tes... | [
"Perform",
"evaluation",
"on",
"the",
"given",
"data",
"(",
"MultiDataSetIterator",
")",
"with",
"the",
"given",
"{",
"@link",
"IEvaluation",
"}",
"instance"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L4022-L4029 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/authorization/BasicEnvironmentalContext.java | BasicEnvironmentalContext.staticContextFor | public static BasicEnvironmentalContext staticContextFor(String key, String value) {
"""
@param key key
@param value value to use for equality match
@return context with equality matching
"""
if (null == key) {
throw new IllegalArgumentException("key cannot be null");
}
... | java | public static BasicEnvironmentalContext staticContextFor(String key, String value) {
if (null == key) {
throw new IllegalArgumentException("key cannot be null");
}
if (null == value) {
throw new IllegalArgumentException("value cannot be null");
}
return ne... | [
"public",
"static",
"BasicEnvironmentalContext",
"staticContextFor",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"==",
"key",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key cannot be null\"",
")",
";",
"}",
"if",... | @param key key
@param value value to use for equality match
@return context with equality matching | [
"@param",
"key",
"key",
"@param",
"value",
"value",
"to",
"use",
"for",
"equality",
"match"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/authorization/BasicEnvironmentalContext.java#L71-L79 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/rewrite/rewritepolicy_stats.java | rewritepolicy_stats.get | public static rewritepolicy_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of rewritepolicy_stats resource of given name .
"""
rewritepolicy_stats obj = new rewritepolicy_stats();
obj.set_name(name);
rewritepolicy_stats response = (rewritepolicy_stat... | java | public static rewritepolicy_stats get(nitro_service service, String name) throws Exception{
rewritepolicy_stats obj = new rewritepolicy_stats();
obj.set_name(name);
rewritepolicy_stats response = (rewritepolicy_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"rewritepolicy_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"rewritepolicy_stats",
"obj",
"=",
"new",
"rewritepolicy_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
... | Use this API to fetch statistics of rewritepolicy_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"rewritepolicy_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/rewrite/rewritepolicy_stats.java#L169-L174 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/PDBDomainProvider.java | PDBDomainProvider.handleRestRequest | private static void handleRestRequest(String url, DefaultHandler handler) throws SAXException, IOException, ParserConfigurationException {
"""
Handles fetching and processing REST requests. The actual XML parsing is handled
by the handler, which is also in charge of storing interesting data.
@param url REST requ... | java | private static void handleRestRequest(String url, DefaultHandler handler) throws SAXException, IOException, ParserConfigurationException {
// Fetch XML stream
URL u = new URL(url);
InputStream response = URLConnectionTools.getInputStream(u);
InputSource xml = new InputSource(response);
// Parse XML
SAXPars... | [
"private",
"static",
"void",
"handleRestRequest",
"(",
"String",
"url",
",",
"DefaultHandler",
"handler",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"// Fetch XML stream",
"URL",
"u",
"=",
"new",
"URL",
"(",
"url",
... | Handles fetching and processing REST requests. The actual XML parsing is handled
by the handler, which is also in charge of storing interesting data.
@param url REST request
@param handler SAX XML parser
@throws SAXException
@throws IOException
@throws ParserConfigurationException | [
"Handles",
"fetching",
"and",
"processing",
"REST",
"requests",
".",
"The",
"actual",
"XML",
"parsing",
"is",
"handled",
"by",
"the",
"handler",
"which",
"is",
"also",
"in",
"charge",
"of",
"storing",
"interesting",
"data",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/PDBDomainProvider.java#L134-L145 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.replaceEachRepeatedly | public static String replaceEachRepeatedly(final String text, final String[] searchList, final String[] replacementList) {
"""
<p>
Replaces all occurrences of Strings within another String.
</p>
<p>
A {@code null} reference passed to this method is a no-op, or if
any "search string" or "string to replace" i... | java | public static String replaceEachRepeatedly(final String text, final String[] searchList, final String[] replacementList) {
// timeToLive should be 0 if not used or nothing to replace, else it's
// the length of the replace array
final int timeToLive = searchList == null ? 0 : searchList.length;
... | [
"public",
"static",
"String",
"replaceEachRepeatedly",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"[",
"]",
"searchList",
",",
"final",
"String",
"[",
"]",
"replacementList",
")",
"{",
"// timeToLive should be 0 if not used or nothing to replace, else it's",
... | <p>
Replaces all occurrences of Strings within another String.
</p>
<p>
A {@code null} reference passed to this method is a no-op, or if
any "search string" or "string to replace" is null, that replace will be
ignored.
</p>
<pre>
StringUtils.replaceEachRepeatedly(null, *, *) = null
StringUtils.replaceEachRepeatedly("... | [
"<p",
">",
"Replaces",
"all",
"occurrences",
"of",
"Strings",
"within",
"another",
"String",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L5657-L5662 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/FileSystemClassInformationRepository.java | FileSystemClassInformationRepository.addIndividual | public void addIndividual(String className, ClassInformation classInformation) {
"""
Add a custom class.
@param className name of class
@param classInformation information for class
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgumentException if {@code className} already exists... | java | public void addIndividual(String className, ClassInformation classInformation) {
Validate.notNull(className);
Validate.notNull(classInformation);
Validate.isTrue(!hierarchyMap.containsKey(className));
hierarchyMap.put(className, classInformation);
} | [
"public",
"void",
"addIndividual",
"(",
"String",
"className",
",",
"ClassInformation",
"classInformation",
")",
"{",
"Validate",
".",
"notNull",
"(",
"className",
")",
";",
"Validate",
".",
"notNull",
"(",
"classInformation",
")",
";",
"Validate",
".",
"isTrue"... | Add a custom class.
@param className name of class
@param classInformation information for class
@throws NullPointerException if any argument is {@code null}
@throws IllegalArgumentException if {@code className} already exists in this repository | [
"Add",
"a",
"custom",
"class",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/FileSystemClassInformationRepository.java#L67-L73 |
krotscheck/data-file-reader | data-file-reader-json/src/main/java/net/krotscheck/dfr/json/JSONDataEncoder.java | JSONDataEncoder.writeToOutput | @Override
protected void writeToOutput(final Map<String, Object> row)
throws IOException {
"""
Write a row to the file.
@param row A row of data.
@throws java.io.IOException Thrown if there's a problem writing to the
destination.
"""
if (generator == null) {
ObjectMappe... | java | @Override
protected void writeToOutput(final Map<String, Object> row)
throws IOException {
if (generator == null) {
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = new JsonFactory(mapper);
generator = factory.createGenerator(getWriter());
... | [
"@",
"Override",
"protected",
"void",
"writeToOutput",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"row",
")",
"throws",
"IOException",
"{",
"if",
"(",
"generator",
"==",
"null",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"... | Write a row to the file.
@param row A row of data.
@throws java.io.IOException Thrown if there's a problem writing to the
destination. | [
"Write",
"a",
"row",
"to",
"the",
"file",
"."
] | train | https://github.com/krotscheck/data-file-reader/blob/b9a85bd07dc9f9b8291ffbfb6945443d96371811/data-file-reader-json/src/main/java/net/krotscheck/dfr/json/JSONDataEncoder.java#L52-L64 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java | ISPNCacheWorkspaceStorageCache.renameItem | protected void renameItem(final ItemState state, final ItemState lastDelete) {
"""
Apply rename operation on cache. Parent node will be re-added into the cache since
parent or name might changing. For other children only item data will be replaced.
"""
ItemData data = state.getData();
ItemData p... | java | protected void renameItem(final ItemState state, final ItemState lastDelete)
{
ItemData data = state.getData();
ItemData prevData = getFromBufferedCacheById.run(data.getIdentifier());
if (data.isNode())
{
if (state.isPersisted())
{
// it is state where ... | [
"protected",
"void",
"renameItem",
"(",
"final",
"ItemState",
"state",
",",
"final",
"ItemState",
"lastDelete",
")",
"{",
"ItemData",
"data",
"=",
"state",
".",
"getData",
"(",
")",
";",
"ItemData",
"prevData",
"=",
"getFromBufferedCacheById",
".",
"run",
"(",... | Apply rename operation on cache. Parent node will be re-added into the cache since
parent or name might changing. For other children only item data will be replaced. | [
"Apply",
"rename",
"operation",
"on",
"cache",
".",
"Parent",
"node",
"will",
"be",
"re",
"-",
"added",
"into",
"the",
"cache",
"since",
"parent",
"or",
"name",
"might",
"changing",
".",
"For",
"other",
"children",
"only",
"item",
"data",
"will",
"be",
"... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java#L1603-L1643 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/js/CollectingJSCodeProvider.java | CollectingJSCodeProvider.addAt | @Nonnull
public CollectingJSCodeProvider addAt (@Nonnegative final int nIndex, @Nullable final IHasJSCode aProvider) {
"""
Add JS code at the specified index.
@param nIndex
The index where the element should be added. Should be ≥ 0.
@param aProvider
The JS code provider to be added. May be <code>null</c... | java | @Nonnull
public CollectingJSCodeProvider addAt (@Nonnegative final int nIndex, @Nullable final IHasJSCode aProvider)
{
if (aProvider != null)
m_aList.add (nIndex, aProvider);
return this;
} | [
"@",
"Nonnull",
"public",
"CollectingJSCodeProvider",
"addAt",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"@",
"Nullable",
"final",
"IHasJSCode",
"aProvider",
")",
"{",
"if",
"(",
"aProvider",
"!=",
"null",
")",
"m_aList",
".",
"add",
"(",
"nInd... | Add JS code at the specified index.
@param nIndex
The index where the element should be added. Should be ≥ 0.
@param aProvider
The JS code provider to be added. May be <code>null</code>.
@return this for chaining | [
"Add",
"JS",
"code",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/js/CollectingJSCodeProvider.java#L95-L101 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java | AbstractExecutableMemberWriter.addExceptions | protected void addExceptions(ExecutableMemberDoc member, Content htmltree, int indentSize) {
"""
Add exceptions for the executable member.
@param member the member to write exceptions for.
@param htmltree the content tree to which the exceptions information will be added.
"""
Type[] exceptions = me... | java | protected void addExceptions(ExecutableMemberDoc member, Content htmltree, int indentSize) {
Type[] exceptions = member.thrownExceptionTypes();
if (exceptions.length > 0) {
LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.MEMBER, member);
... | [
"protected",
"void",
"addExceptions",
"(",
"ExecutableMemberDoc",
"member",
",",
"Content",
"htmltree",
",",
"int",
"indentSize",
")",
"{",
"Type",
"[",
"]",
"exceptions",
"=",
"member",
".",
"thrownExceptionTypes",
"(",
")",
";",
"if",
"(",
"exceptions",
".",... | Add exceptions for the executable member.
@param member the member to write exceptions for.
@param htmltree the content tree to which the exceptions information will be added. | [
"Add",
"exceptions",
"for",
"the",
"executable",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java#L245-L267 |
Impetus/Kundera | src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientUtilities.java | DSClientUtilities.setIntValue | private static Object setIntValue(Field member, Object retVal) {
"""
Sets the int value.
@param member
the member
@param retVal
the ret val
@return the object
"""
if (member != null)
{
if (member.getType().isAssignableFrom(byte.class))
{
retVal = (... | java | private static Object setIntValue(Field member, Object retVal)
{
if (member != null)
{
if (member.getType().isAssignableFrom(byte.class))
{
retVal = ((Integer) retVal).byteValue();
}
else if (member.getType().isAssignableFrom(short.clas... | [
"private",
"static",
"Object",
"setIntValue",
"(",
"Field",
"member",
",",
"Object",
"retVal",
")",
"{",
"if",
"(",
"member",
"!=",
"null",
")",
"{",
"if",
"(",
"member",
".",
"getType",
"(",
")",
".",
"isAssignableFrom",
"(",
"byte",
".",
"class",
")"... | Sets the int value.
@param member
the member
@param retVal
the ret val
@return the object | [
"Sets",
"the",
"int",
"value",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientUtilities.java#L735-L749 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java | SVGPlot.svgText | public Element svgText(double x, double y, String text) {
"""
Create a SVG text element.
@param x first point x
@param y first point y
@param text Content of text element.
@return New text element.
"""
return SVGUtil.svgText(document, x, y, text);
} | java | public Element svgText(double x, double y, String text) {
return SVGUtil.svgText(document, x, y, text);
} | [
"public",
"Element",
"svgText",
"(",
"double",
"x",
",",
"double",
"y",
",",
"String",
"text",
")",
"{",
"return",
"SVGUtil",
".",
"svgText",
"(",
"document",
",",
"x",
",",
"y",
",",
"text",
")",
";",
"}"
] | Create a SVG text element.
@param x first point x
@param y first point y
@param text Content of text element.
@return New text element. | [
"Create",
"a",
"SVG",
"text",
"element",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPlot.java#L291-L293 |
xwiki/xwiki-rendering | xwiki-rendering-api/src/main/java/org/xwiki/rendering/block/match/BlockNavigator.java | BlockNavigator.addBlock | private <T extends Block> void addBlock(Block currentBlock, List<T> blocks) {
"""
Add provided {@link Block} to provided list (or create list of null) if block validate the provided
{@link BlockMatcher}.
@param <T> the class of the Blocks to return
@param currentBlock the block to search from
@param blocks t... | java | private <T extends Block> void addBlock(Block currentBlock, List<T> blocks)
{
if (currentBlock != null && this.matcher.match(currentBlock)) {
blocks.add((T) currentBlock);
}
} | [
"private",
"<",
"T",
"extends",
"Block",
">",
"void",
"addBlock",
"(",
"Block",
"currentBlock",
",",
"List",
"<",
"T",
">",
"blocks",
")",
"{",
"if",
"(",
"currentBlock",
"!=",
"null",
"&&",
"this",
".",
"matcher",
".",
"match",
"(",
"currentBlock",
")... | Add provided {@link Block} to provided list (or create list of null) if block validate the provided
{@link BlockMatcher}.
@param <T> the class of the Blocks to return
@param currentBlock the block to search from
@param blocks the list of blocks to fill | [
"Add",
"provided",
"{",
"@link",
"Block",
"}",
"to",
"provided",
"list",
"(",
"or",
"create",
"list",
"of",
"null",
")",
"if",
"block",
"validate",
"the",
"provided",
"{",
"@link",
"BlockMatcher",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-api/src/main/java/org/xwiki/rendering/block/match/BlockNavigator.java#L151-L156 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.ltProperty | public PropertyConstraint ltProperty(String propertyName, String otherPropertyName) {
"""
Apply a "less than" constraint to two properties.
@param propertyName The first property
@param otherPropertyName The other property
@return The constraint
"""
return valueProperties(propertyName, LessThan.in... | java | public PropertyConstraint ltProperty(String propertyName, String otherPropertyName) {
return valueProperties(propertyName, LessThan.instance(), otherPropertyName);
} | [
"public",
"PropertyConstraint",
"ltProperty",
"(",
"String",
"propertyName",
",",
"String",
"otherPropertyName",
")",
"{",
"return",
"valueProperties",
"(",
"propertyName",
",",
"LessThan",
".",
"instance",
"(",
")",
",",
"otherPropertyName",
")",
";",
"}"
] | Apply a "less than" constraint to two properties.
@param propertyName The first property
@param otherPropertyName The other property
@return The constraint | [
"Apply",
"a",
"less",
"than",
"constraint",
"to",
"two",
"properties",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L875-L877 |
opencb/datastore | datastore-core/src/main/java/org/opencb/datastore/core/QueryOptions.java | QueryOptions.addToListOption | public Object addToListOption(String key, Object value) {
"""
This method safely add a new Object to an exiting option which type is List.
@param key
@param value
@return the list with the new Object inserted.
"""
if (key != null && !key.equals("")) {
if (this.containsKey(key) && this.... | java | public Object addToListOption(String key, Object value) {
if (key != null && !key.equals("")) {
if (this.containsKey(key) && this.get(key) != null) {
if (!(this.get(key) instanceof List)) { //If was not a list, getAsList returns an Unmodifiable List.
// Create new... | [
"public",
"Object",
"addToListOption",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
"&&",
"!",
"key",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"if",
"(",
"this",
".",
"containsKey",
"(",
"key",
")",
"&&"... | This method safely add a new Object to an exiting option which type is List.
@param key
@param value
@return the list with the new Object inserted. | [
"This",
"method",
"safely",
"add",
"a",
"new",
"Object",
"to",
"an",
"exiting",
"option",
"which",
"type",
"is",
"List",
"."
] | train | https://github.com/opencb/datastore/blob/c6b92b30385d5fc5cc191e2db96c46b0389a88c7/datastore-core/src/main/java/org/opencb/datastore/core/QueryOptions.java#L86-L108 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.binaryTree | public static Matcher<BinaryTree> binaryTree(
final Matcher<ExpressionTree> matcher1, final Matcher<ExpressionTree> matcher2) {
"""
Matches a binary tree if the given matchers match the operands in either order. That is,
returns true if either: matcher1 matches the left operand and matcher2 matches the righ... | java | public static Matcher<BinaryTree> binaryTree(
final Matcher<ExpressionTree> matcher1, final Matcher<ExpressionTree> matcher2) {
return new Matcher<BinaryTree>() {
@Override
public boolean matches(BinaryTree t, VisitorState state) {
return null != ASTHelpers.matchBinaryTree(t, Arrays.asList... | [
"public",
"static",
"Matcher",
"<",
"BinaryTree",
">",
"binaryTree",
"(",
"final",
"Matcher",
"<",
"ExpressionTree",
">",
"matcher1",
",",
"final",
"Matcher",
"<",
"ExpressionTree",
">",
"matcher2",
")",
"{",
"return",
"new",
"Matcher",
"<",
"BinaryTree",
">",... | Matches a binary tree if the given matchers match the operands in either order. That is,
returns true if either: matcher1 matches the left operand and matcher2 matches the right
operand or matcher2 matches the left operand and matcher1 matches the right operand | [
"Matches",
"a",
"binary",
"tree",
"if",
"the",
"given",
"matchers",
"match",
"the",
"operands",
"in",
"either",
"order",
".",
"That",
"is",
"returns",
"true",
"if",
"either",
":",
"matcher1",
"matches",
"the",
"left",
"operand",
"and",
"matcher2",
"matches",... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L1130-L1138 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java | MultiIndex.getIndexReader | public synchronized CachingMultiIndexReader getIndexReader(final boolean initCache) throws IOException {
"""
Returns an read-only <code>IndexReader</code> that spans alls indexes of
this <code>MultiIndex</code>.
@param initCache
when set <code>true</code> the hierarchy cache is completely
initialized before ... | java | public synchronized CachingMultiIndexReader getIndexReader(final boolean initCache) throws IOException
{
return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<CachingMultiIndexReader>()
{
public CachingMultiIndexReader run() throws Exception
{
syn... | [
"public",
"synchronized",
"CachingMultiIndexReader",
"getIndexReader",
"(",
"final",
"boolean",
"initCache",
")",
"throws",
"IOException",
"{",
"return",
"SecurityHelper",
".",
"doPrivilegedIOExceptionAction",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"CachingMultiIndexRe... | Returns an read-only <code>IndexReader</code> that spans alls indexes of
this <code>MultiIndex</code>.
@param initCache
when set <code>true</code> the hierarchy cache is completely
initialized before this call returns.
@return an <code>IndexReader</code>.
@throws IOException
if an error occurs constructing the <code>I... | [
"Returns",
"an",
"read",
"-",
"only",
"<code",
">",
"IndexReader<",
"/",
"code",
">",
"that",
"spans",
"alls",
"indexes",
"of",
"this",
"<code",
">",
"MultiIndex<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java#L1414-L1453 |
samskivert/samskivert | src/main/java/com/samskivert/util/CollectionUtil.java | CollectionUtil.minList | public static <T> List<T> minList (Iterable<T> iterable, Comparator<? super T> comp) {
"""
Return a List containing all the elements of the specified Iterable that compare as being
equal to the minimum element.
@throws NoSuchElementException if the Iterable is empty.
"""
return maxList(iterable, ja... | java | public static <T> List<T> minList (Iterable<T> iterable, Comparator<? super T> comp)
{
return maxList(iterable, java.util.Collections.reverseOrder(comp));
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"minList",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comp",
")",
"{",
"return",
"maxList",
"(",
"iterable",
",",
"java",
".",
"util",
".",
... | Return a List containing all the elements of the specified Iterable that compare as being
equal to the minimum element.
@throws NoSuchElementException if the Iterable is empty. | [
"Return",
"a",
"List",
"containing",
"all",
"the",
"elements",
"of",
"the",
"specified",
"Iterable",
"that",
"compare",
"as",
"being",
"equal",
"to",
"the",
"minimum",
"element",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L185-L188 |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/UiSelector.java | UiSelector.className | public <T> UiSelector className(Class<T> type) {
"""
Set the search criteria to match the class property
for a widget (for example, "android.widget.Button").
@param <T> type
@param type type
@return UiSelector with the specified search criteria
@since API Level 17
"""
return buildSelector(S... | java | public <T> UiSelector className(Class<T> type) {
return buildSelector(SELECTOR_CLASS, type.getName());
} | [
"public",
"<",
"T",
">",
"UiSelector",
"className",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"buildSelector",
"(",
"SELECTOR_CLASS",
",",
"type",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Set the search criteria to match the class property
for a widget (for example, "android.widget.Button").
@param <T> type
@param type type
@return UiSelector with the specified search criteria
@since API Level 17 | [
"Set",
"the",
"search",
"criteria",
"to",
"match",
"the",
"class",
"property",
"for",
"a",
"widget",
"(",
"for",
"example",
"android",
".",
"widget",
".",
"Button",
")",
"."
] | train | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/UiSelector.java#L211-L213 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java | PropertiesUtil.getCharsetProperty | public Charset getCharsetProperty(final String name, final Charset defaultValue) {
"""
Gets the named property as a Charset value.
@param name the name of the property to look up
@param defaultValue the default value to use if the property is undefined
@return the Charset value of the property or {@code defau... | java | public Charset getCharsetProperty(final String name, final Charset defaultValue) {
final String prop = getStringProperty(name);
try {
return prop == null ? defaultValue : Charset.forName(prop);
} catch (UnsupportedCharsetException e) {
LowLevelLogUtil.logException("Unable... | [
"public",
"Charset",
"getCharsetProperty",
"(",
"final",
"String",
"name",
",",
"final",
"Charset",
"defaultValue",
")",
"{",
"final",
"String",
"prop",
"=",
"getStringProperty",
"(",
"name",
")",
";",
"try",
"{",
"return",
"prop",
"==",
"null",
"?",
"defaul... | Gets the named property as a Charset value.
@param name the name of the property to look up
@param defaultValue the default value to use if the property is undefined
@return the Charset value of the property or {@code defaultValue} if undefined. | [
"Gets",
"the",
"named",
"property",
"as",
"a",
"Charset",
"value",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java#L169-L177 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java | DefaultElementProducer.createTableCell | public PdfPCell createTableCell(Object val, Collection<BaseStyler> stylers, boolean noWrap) throws VectorPrintException {
"""
When noWrap is true a {@link NoWrap} is added to the stylers. Calls
{@link #createCell(java.lang.Object, java.util.Collection) }
@param val
@param stylers
@param noWrap
@return
@thr... | java | public PdfPCell createTableCell(Object val, Collection<BaseStyler> stylers, boolean noWrap) throws VectorPrintException {
if (noWrap) {
stylers.add(new NoWrap());
}
return createCell(val, stylers);
} | [
"public",
"PdfPCell",
"createTableCell",
"(",
"Object",
"val",
",",
"Collection",
"<",
"BaseStyler",
">",
"stylers",
",",
"boolean",
"noWrap",
")",
"throws",
"VectorPrintException",
"{",
"if",
"(",
"noWrap",
")",
"{",
"stylers",
".",
"add",
"(",
"new",
"NoWr... | When noWrap is true a {@link NoWrap} is added to the stylers. Calls
{@link #createCell(java.lang.Object, java.util.Collection) }
@param val
@param stylers
@param noWrap
@return
@throws com.vectorprint.VectorPrintException | [
"When",
"noWrap",
"is",
"true",
"a",
"{",
"@link",
"NoWrap",
"}",
"is",
"added",
"to",
"the",
"stylers",
".",
"Calls",
"{",
"@link",
"#createCell",
"(",
"java",
".",
"lang",
".",
"Object",
"java",
".",
"util",
".",
"Collection",
")",
"}"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L352-L358 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsratecontrol.java | nsratecontrol.get | public static nsratecontrol get(nitro_service service, options option) throws Exception {
"""
Use this API to fetch all the nsratecontrol resources that are configured on netscaler.
"""
nsratecontrol obj = new nsratecontrol();
nsratecontrol[] response = (nsratecontrol[])obj.get_resources(service,option);
... | java | public static nsratecontrol get(nitro_service service, options option) throws Exception{
nsratecontrol obj = new nsratecontrol();
nsratecontrol[] response = (nsratecontrol[])obj.get_resources(service,option);
return response[0];
} | [
"public",
"static",
"nsratecontrol",
"get",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"nsratecontrol",
"obj",
"=",
"new",
"nsratecontrol",
"(",
")",
";",
"nsratecontrol",
"[",
"]",
"response",
"=",
"(",
"nsrate... | Use this API to fetch all the nsratecontrol resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"nsratecontrol",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsratecontrol.java#L217-L221 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.getDeployment | @Override
public Deployment getDeployment(final String host, final JobId jobId) {
"""
Returns the current deployment state of {@code jobId} on {@code host}.
"""
final String path = Paths.configHostJob(host, jobId);
final ZooKeeperClient client = provider.get("getDeployment");
try {
final by... | java | @Override
public Deployment getDeployment(final String host, final JobId jobId) {
final String path = Paths.configHostJob(host, jobId);
final ZooKeeperClient client = provider.get("getDeployment");
try {
final byte[] data = client.getData(path);
final Task task = parse(data, Task.class);
... | [
"@",
"Override",
"public",
"Deployment",
"getDeployment",
"(",
"final",
"String",
"host",
",",
"final",
"JobId",
"jobId",
")",
"{",
"final",
"String",
"path",
"=",
"Paths",
".",
"configHostJob",
"(",
"host",
",",
"jobId",
")",
";",
"final",
"ZooKeeperClient"... | Returns the current deployment state of {@code jobId} on {@code host}. | [
"Returns",
"the",
"current",
"deployment",
"state",
"of",
"{"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L1724-L1738 |
OpenTSDB/opentsdb | src/tree/Branch.java | Branch.prependParentPath | public void prependParentPath(final Map<Integer, String> parent_path) {
"""
Sets the path for this branch based off the path of the parent. This map
may be empty, in which case the branch is considered a root.
<b>Warning:</b> If the path has already been set, this will create a new
path, clearing out any existi... | java | public void prependParentPath(final Map<Integer, String> parent_path) {
if (parent_path == null) {
throw new IllegalArgumentException("Parent path was null");
}
path = new TreeMap<Integer, String>();
path.putAll(parent_path);
} | [
"public",
"void",
"prependParentPath",
"(",
"final",
"Map",
"<",
"Integer",
",",
"String",
">",
"parent_path",
")",
"{",
"if",
"(",
"parent_path",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parent path was null\"",
")",
";",
"}... | Sets the path for this branch based off the path of the parent. This map
may be empty, in which case the branch is considered a root.
<b>Warning:</b> If the path has already been set, this will create a new
path, clearing out any existing entries
@param parent_path The map to store as the path
@throws IllegalArgumentEx... | [
"Sets",
"the",
"path",
"for",
"this",
"branch",
"based",
"off",
"the",
"path",
"of",
"the",
"parent",
".",
"This",
"map",
"may",
"be",
"empty",
"in",
"which",
"case",
"the",
"branch",
"is",
"considered",
"a",
"root",
".",
"<b",
">",
"Warning",
":",
"... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Branch.java#L317-L323 |
iipc/webarchive-commons | src/main/java/org/archive/format/text/charset/CharsetDetector.java | CharsetDetector.getCharsetFromBytes | protected String getCharsetFromBytes(byte buffer[], int len)
throws IOException {
"""
Attempts to figure out the character set of the document using
the excellent juniversalchardet library.
@param resource
@return String character encoding found, or null if nothing looked good.
@throws IOException
"""
... | java | protected String getCharsetFromBytes(byte buffer[], int len)
throws IOException {
String charsetName = null;
UniversalDetector detector = new UniversalDetector(null);
detector.handleData(buffer, 0, len);
detector.dataEnd();
charsetName = detector.getDetectedCharset();
detector.reset();
if(is... | [
"protected",
"String",
"getCharsetFromBytes",
"(",
"byte",
"buffer",
"[",
"]",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"String",
"charsetName",
"=",
"null",
";",
"UniversalDetector",
"detector",
"=",
"new",
"UniversalDetector",
"(",
"null",
")",
... | Attempts to figure out the character set of the document using
the excellent juniversalchardet library.
@param resource
@return String character encoding found, or null if nothing looked good.
@throws IOException | [
"Attempts",
"to",
"figure",
"out",
"the",
"character",
"set",
"of",
"the",
"document",
"using",
"the",
"excellent",
"juniversalchardet",
"library",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/text/charset/CharsetDetector.java#L231-L243 |
kite-sdk/kite | kite-tools-parent/kite-tools/src/main/java/org/kitesdk/cli/commands/BaseDatasetCommand.java | BaseDatasetCommand.viewMatches | @VisibleForTesting
static boolean viewMatches(URI view, String requested) {
"""
Verify that a view matches the URI that loaded it without extra options.
<p>
This is used to prevent mis-interpreted URIs from succeeding. For example,
the URI: view:file:./table?year=2014&month=3&dy=14 resolves a view for
all of... | java | @VisibleForTesting
static boolean viewMatches(URI view, String requested) {
// test that the requested options are a subset of the final options
Map<String, String> requestedOptions = optionsForUri(URI.create(requested));
Map<String, String> finalOptions = optionsForUri(view);
for (Map.Entry<String, S... | [
"@",
"VisibleForTesting",
"static",
"boolean",
"viewMatches",
"(",
"URI",
"view",
",",
"String",
"requested",
")",
"{",
"// test that the requested options are a subset of the final options",
"Map",
"<",
"String",
",",
"String",
">",
"requestedOptions",
"=",
"optionsForUr... | Verify that a view matches the URI that loaded it without extra options.
<p>
This is used to prevent mis-interpreted URIs from succeeding. For example,
the URI: view:file:./table?year=2014&month=3&dy=14 resolves a view for
all of March 2014 because "dy" wasn't recognized as "day" and was ignored.
This works by verifyin... | [
"Verify",
"that",
"a",
"view",
"matches",
"the",
"URI",
"that",
"loaded",
"it",
"without",
"extra",
"options",
".",
"<p",
">",
"This",
"is",
"used",
"to",
"prevent",
"mis",
"-",
"interpreted",
"URIs",
"from",
"succeeding",
".",
"For",
"example",
"the",
"... | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-tools-parent/kite-tools/src/main/java/org/kitesdk/cli/commands/BaseDatasetCommand.java#L179-L191 |
thrau/jarchivelib | src/main/java/org/rauschig/jarchivelib/ArchiverFactory.java | ArchiverFactory.createArchiver | public static Archiver createArchiver(String archiveFormat, String compression) throws IllegalArgumentException {
"""
Creates an Archiver for the given archive format that uses compression.
@param archiveFormat the archive format e.g. "tar" or "zip"
@param compression the compression algorithm name e.g. "gz"
... | java | public static Archiver createArchiver(String archiveFormat, String compression) throws IllegalArgumentException {
if (!ArchiveFormat.isValidArchiveFormat(archiveFormat)) {
throw new IllegalArgumentException("Unknown archive format " + archiveFormat);
}
if (!CompressionType.isValidCom... | [
"public",
"static",
"Archiver",
"createArchiver",
"(",
"String",
"archiveFormat",
",",
"String",
"compression",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"ArchiveFormat",
".",
"isValidArchiveFormat",
"(",
"archiveFormat",
")",
")",
"{",
"throw"... | Creates an Archiver for the given archive format that uses compression.
@param archiveFormat the archive format e.g. "tar" or "zip"
@param compression the compression algorithm name e.g. "gz"
@return a new Archiver instance that also handles compression
@throws IllegalArgumentException if the archive format or the com... | [
"Creates",
"an",
"Archiver",
"for",
"the",
"given",
"archive",
"format",
"that",
"uses",
"compression",
"."
] | train | https://github.com/thrau/jarchivelib/blob/8afee5124c588f589306796985b722d63572bbfa/src/main/java/org/rauschig/jarchivelib/ArchiverFactory.java#L78-L87 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java | Validators.validKeyManagerFactory | public static Validator validKeyManagerFactory() {
"""
Validator is used to ensure that the KeyManagerFactory Algorithm specified is valid.
@return
"""
return (s, o) -> {
if (!(o instanceof String)) {
throw new ConfigException(s, o, "Must be a string.");
}
String keyStoreType = ... | java | public static Validator validKeyManagerFactory() {
return (s, o) -> {
if (!(o instanceof String)) {
throw new ConfigException(s, o, "Must be a string.");
}
String keyStoreType = o.toString();
try {
KeyManagerFactory.getInstance(keyStoreType);
} catch (NoSuchAlgorithmEx... | [
"public",
"static",
"Validator",
"validKeyManagerFactory",
"(",
")",
"{",
"return",
"(",
"s",
",",
"o",
")",
"->",
"{",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"String",
")",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"s",
",",
"o",
",",
"\"Mu... | Validator is used to ensure that the KeyManagerFactory Algorithm specified is valid.
@return | [
"Validator",
"is",
"used",
"to",
"ensure",
"that",
"the",
"KeyManagerFactory",
"Algorithm",
"specified",
"is",
"valid",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L211-L226 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/hash/ReOpenableHashPartition.java | ReOpenableHashPartition.spillInMemoryPartition | int spillInMemoryPartition(Channel.ID targetChannel, IOManager ioManager, LinkedBlockingQueue<MemorySegment> writeBehindBuffers) throws IOException {
"""
Spills this partition to disk. This method is invoked once after the initial open() method
@return Number of memorySegments in the writeBehindBuffers!
"""... | java | int spillInMemoryPartition(Channel.ID targetChannel, IOManager ioManager, LinkedBlockingQueue<MemorySegment> writeBehindBuffers) throws IOException {
this.initialPartitionBuffersCount = partitionBuffers.length; // for ReOpenableHashMap
this.initialBuildSideChannel = targetChannel;
initialBuildSideWriter = ioMa... | [
"int",
"spillInMemoryPartition",
"(",
"Channel",
".",
"ID",
"targetChannel",
",",
"IOManager",
"ioManager",
",",
"LinkedBlockingQueue",
"<",
"MemorySegment",
">",
"writeBehindBuffers",
")",
"throws",
"IOException",
"{",
"this",
".",
"initialPartitionBuffersCount",
"=",
... | Spills this partition to disk. This method is invoked once after the initial open() method
@return Number of memorySegments in the writeBehindBuffers! | [
"Spills",
"this",
"partition",
"to",
"disk",
".",
"This",
"method",
"is",
"invoked",
"once",
"after",
"the",
"initial",
"open",
"()",
"method"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/hash/ReOpenableHashPartition.java#L100-L115 |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-core/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/DatabaseProtocolFrontendEngineFactory.java | DatabaseProtocolFrontendEngineFactory.newInstance | public static DatabaseProtocolFrontendEngine newInstance(final DatabaseType databaseType) {
"""
Create new instance of database protocol frontend engine.
@param databaseType database type
@return new instance of database protocol frontend engine
"""
for (DatabaseProtocolFrontendEngine each : NewIns... | java | public static DatabaseProtocolFrontendEngine newInstance(final DatabaseType databaseType) {
for (DatabaseProtocolFrontendEngine each : NewInstanceServiceLoader.newServiceInstances(DatabaseProtocolFrontendEngine.class)) {
if (DatabaseType.valueFrom(each.getDatabaseType()) == databaseType) {
... | [
"public",
"static",
"DatabaseProtocolFrontendEngine",
"newInstance",
"(",
"final",
"DatabaseType",
"databaseType",
")",
"{",
"for",
"(",
"DatabaseProtocolFrontendEngine",
"each",
":",
"NewInstanceServiceLoader",
".",
"newServiceInstances",
"(",
"DatabaseProtocolFrontendEngine",... | Create new instance of database protocol frontend engine.
@param databaseType database type
@return new instance of database protocol frontend engine | [
"Create",
"new",
"instance",
"of",
"database",
"protocol",
"frontend",
"engine",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-core/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/DatabaseProtocolFrontendEngineFactory.java#L45-L52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.