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 |
|---|---|---|---|---|---|---|---|---|---|---|
linkhub-sdk/popbill.sdk.java | src/main/java/com/popbill/api/fax/FaxServiceImp.java | FaxServiceImp.resendFAXRN | @Override
public String resendFAXRN(String corpNum, String requestNum, String sendNum,
String senderName, String receiveNum, String receiveName,
Date reserveDT, String userID, String title, String originalFAXrequestNum)
throws PopbillException {
"""
/*
(non-Javadoc)
@see com.popbill.api.FaxService#rese... | java | @Override
public String resendFAXRN(String corpNum, String requestNum, String sendNum,
String senderName, String receiveNum, String receiveName,
Date reserveDT, String userID, String title, String originalFAXrequestNum)
throws PopbillException {
Receiver receiver = null;
if ( !receiveNum.isEmpty() |... | [
"@",
"Override",
"public",
"String",
"resendFAXRN",
"(",
"String",
"corpNum",
",",
"String",
"requestNum",
",",
"String",
"sendNum",
",",
"String",
"senderName",
",",
"String",
"receiveNum",
",",
"String",
"receiveName",
",",
"Date",
"reserveDT",
",",
"String",
... | /*
(non-Javadoc)
@see com.popbill.api.FaxService#resendFAXRN(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Date, java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/linkhub-sdk/popbill.sdk.java/blob/63a341fefe96d60a368776638f3d4c81888238b7/src/main/java/com/popbill/api/fax/FaxServiceImp.java#L898-L914 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java | EllipsesIntoClusters.axisAdjustedDistanceSq | static double axisAdjustedDistanceSq(EllipseRotated_F64 a , EllipseRotated_F64 b ) {
"""
Compute a new distance that two ellipses are apart using major/minor axis size. If the axises are the
same size then there is no change. If the minor axis is much smaller and ellipse b lies along that
axis then the returne... | java | static double axisAdjustedDistanceSq(EllipseRotated_F64 a , EllipseRotated_F64 b ) {
double dx = b.center.x - a.center.x;
double dy = b.center.y - a.center.y;
double c = Math.cos(a.phi);
double s = Math.sin(a.phi);
// rotate into ellipse's coordinate frame
// scale by ratio of major/minor axis
double x ... | [
"static",
"double",
"axisAdjustedDistanceSq",
"(",
"EllipseRotated_F64",
"a",
",",
"EllipseRotated_F64",
"b",
")",
"{",
"double",
"dx",
"=",
"b",
".",
"center",
".",
"x",
"-",
"a",
".",
"center",
".",
"x",
";",
"double",
"dy",
"=",
"b",
".",
"center",
... | Compute a new distance that two ellipses are apart using major/minor axis size. If the axises are the
same size then there is no change. If the minor axis is much smaller and ellipse b lies along that
axis then the returned distance will be greater. | [
"Compute",
"a",
"new",
"distance",
"that",
"two",
"ellipses",
"are",
"apart",
"using",
"major",
"/",
"minor",
"axis",
"size",
".",
"If",
"the",
"axises",
"are",
"the",
"same",
"size",
"then",
"there",
"is",
"no",
"change",
".",
"If",
"the",
"minor",
"a... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L272-L285 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/stats/JMStats.java | JMStats.calStats | public static Number calStats(String statsString, IntStream numberStream) {
"""
Cal stats number.
@param statsString the stats string
@param numberStream the number stream
@return the number
"""
return StatsField.valueOfAlias(statsString).calStats(numberStream);
} | java | public static Number calStats(String statsString, IntStream numberStream) {
return StatsField.valueOfAlias(statsString).calStats(numberStream);
} | [
"public",
"static",
"Number",
"calStats",
"(",
"String",
"statsString",
",",
"IntStream",
"numberStream",
")",
"{",
"return",
"StatsField",
".",
"valueOfAlias",
"(",
"statsString",
")",
".",
"calStats",
"(",
"numberStream",
")",
";",
"}"
] | Cal stats number.
@param statsString the stats string
@param numberStream the number stream
@return the number | [
"Cal",
"stats",
"number",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/stats/JMStats.java#L64-L66 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java | History.getJSONFromMap | private String getJSONFromMap(Map<String, Object> propMap) {
"""
Turn map into string
@param propMap Map to be converted
@return
"""
try {
return new JSONObject(propMap).toString();
} catch (Exception e) {
return "{}";
}
} | java | private String getJSONFromMap(Map<String, Object> propMap) {
try {
return new JSONObject(propMap).toString();
} catch (Exception e) {
return "{}";
}
} | [
"private",
"String",
"getJSONFromMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"propMap",
")",
"{",
"try",
"{",
"return",
"new",
"JSONObject",
"(",
"propMap",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
... | Turn map into string
@param propMap Map to be converted
@return | [
"Turn",
"map",
"into",
"string"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java#L466-L472 |
google/closure-templates | java/src/com/google/template/soy/msgs/internal/MsgUtils.java | MsgUtils.buildMsgPartsAndComputeMsgIds | private static MsgPartsAndIds buildMsgPartsAndComputeMsgIds(
MsgNode msgNode, boolean doComputeMsgIdUsingBracedPhs) {
"""
Builds the list of SoyMsgParts and computes the unique message id(s) for the given MsgNode.
@param msgNode The message parsed from the Soy source.
@param doComputeMsgIdUsingBracedPhs ... | java | private static MsgPartsAndIds buildMsgPartsAndComputeMsgIds(
MsgNode msgNode, boolean doComputeMsgIdUsingBracedPhs) {
ImmutableList<SoyMsgPart> msgParts = buildMsgParts(msgNode);
long msgId =
SoyMsgIdComputer.computeMsgId(msgParts, msgNode.getMeaning(), msgNode.getContentType());
long msgIdUs... | [
"private",
"static",
"MsgPartsAndIds",
"buildMsgPartsAndComputeMsgIds",
"(",
"MsgNode",
"msgNode",
",",
"boolean",
"doComputeMsgIdUsingBracedPhs",
")",
"{",
"ImmutableList",
"<",
"SoyMsgPart",
">",
"msgParts",
"=",
"buildMsgParts",
"(",
"msgNode",
")",
";",
"long",
"m... | Builds the list of SoyMsgParts and computes the unique message id(s) for the given MsgNode.
@param msgNode The message parsed from the Soy source.
@param doComputeMsgIdUsingBracedPhs Whether to compute the alternate message id using braced
placeholders. If set to false, then the field {@code idUsingBracedPhs} in the r... | [
"Builds",
"the",
"list",
"of",
"SoyMsgParts",
"and",
"computes",
"the",
"unique",
"message",
"id",
"(",
"s",
")",
"for",
"the",
"given",
"MsgNode",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/msgs/internal/MsgUtils.java#L126-L138 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/soap/SOAPMessageTransport.java | SOAPMessageTransport.createExternalMessage | public ExternalMessage createExternalMessage(BaseMessage message, Object rawData) {
"""
Get the external message container for this Internal message.
Typically, the overriding class supplies a default format for the transport type.
<br/>NOTE: The message header from the internal message is copies, but not the me... | java | public ExternalMessage createExternalMessage(BaseMessage message, Object rawData)
{
ExternalMessage externalTrxMessageOut = super.createExternalMessage(message, rawData);
if (externalTrxMessageOut == null)
{
if (MessageTypeModel.MESSAGE_IN.equalsIgnoreCase((String)message.get(Trx... | [
"public",
"ExternalMessage",
"createExternalMessage",
"(",
"BaseMessage",
"message",
",",
"Object",
"rawData",
")",
"{",
"ExternalMessage",
"externalTrxMessageOut",
"=",
"super",
".",
"createExternalMessage",
"(",
"message",
",",
"rawData",
")",
";",
"if",
"(",
"ext... | Get the external message container for this Internal message.
Typically, the overriding class supplies a default format for the transport type.
<br/>NOTE: The message header from the internal message is copies, but not the message itself.
@param The internalTrxMessage that I will convert to this external format.
@retur... | [
"Get",
"the",
"external",
"message",
"container",
"for",
"this",
"Internal",
"message",
".",
"Typically",
"the",
"overriding",
"class",
"supplies",
"a",
"default",
"format",
"for",
"the",
"transport",
"type",
".",
"<br",
"/",
">",
"NOTE",
":",
"The",
"messag... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/soap/SOAPMessageTransport.java#L132-L143 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spyRes | public static <T1, T2> BiPredicate<T1, T2> spyRes(BiPredicate<T1, T2> predicate, Box<Boolean> result) {
"""
Proxies a binary predicate spying for result.
@param <T1> the predicate first parameter type
@param <T2> the predicate second parameter type
@param predicate the predicate that will be spied
@param res... | java | public static <T1, T2> BiPredicate<T1, T2> spyRes(BiPredicate<T1, T2> predicate, Box<Boolean> result) {
return spy(predicate, result, Box.<T1>empty(), Box.<T2>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
">",
"BiPredicate",
"<",
"T1",
",",
"T2",
">",
"spyRes",
"(",
"BiPredicate",
"<",
"T1",
",",
"T2",
">",
"predicate",
",",
"Box",
"<",
"Boolean",
">",
"result",
")",
"{",
"return",
"spy",
"(",
"predicate",
"... | Proxies a binary predicate spying for result.
@param <T1> the predicate first parameter type
@param <T2> the predicate second parameter type
@param predicate the predicate that will be spied
@param result a box that will be containing spied result
@return the proxied predicate | [
"Proxies",
"a",
"binary",
"predicate",
"spying",
"for",
"result",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L456-L458 |
fabric8io/ipaas-quickstarts | archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java | ArchetypeBuilder.copyCodeFiles | protected void copyCodeFiles(File rootPackage, File outDir, Replacement replaceFn) throws IOException {
"""
Copies all java/groovy/kotlin/scala code recursively. <code>replaceFn</code> is used to modify the content of files.
"""
if (rootPackage.isFile()) {
copyFile(rootPackage, outDir, repl... | java | protected void copyCodeFiles(File rootPackage, File outDir, Replacement replaceFn) throws IOException {
if (rootPackage.isFile()) {
copyFile(rootPackage, outDir, replaceFn);
} else {
outDir.mkdirs();
String[] names = rootPackage.list();
if (names != null) ... | [
"protected",
"void",
"copyCodeFiles",
"(",
"File",
"rootPackage",
",",
"File",
"outDir",
",",
"Replacement",
"replaceFn",
")",
"throws",
"IOException",
"{",
"if",
"(",
"rootPackage",
".",
"isFile",
"(",
")",
")",
"{",
"copyFile",
"(",
"rootPackage",
",",
"ou... | Copies all java/groovy/kotlin/scala code recursively. <code>replaceFn</code> is used to modify the content of files. | [
"Copies",
"all",
"java",
"/",
"groovy",
"/",
"kotlin",
"/",
"scala",
"code",
"recursively",
".",
"<code",
">",
"replaceFn<",
"/",
"code",
">",
"is",
"used",
"to",
"modify",
"the",
"content",
"of",
"files",
"."
] | train | https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java#L696-L708 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/json/JsonWriter.java | JsonWriter.stringify | public static String stringify(Object object, String indentString) throws IOException {
"""
Converts an object to a JSON formatted string.
If pretty-printing is enabled, includes spaces, tabs and new-lines to make the format more readable.
@param object an object to convert to a JSON formatted string
@param i... | java | public static String stringify(Object object, String indentString) throws IOException {
if (object == null) {
return null;
}
Writer out = new StringWriter();
JsonWriter jsonWriter = new JsonWriter(out, indentString);
jsonWriter.write(object);
jsonWriter.close(... | [
"public",
"static",
"String",
"stringify",
"(",
"Object",
"object",
",",
"String",
"indentString",
")",
"throws",
"IOException",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Writer",
"out",
"=",
"new",
"StringWriter",
"(",... | Converts an object to a JSON formatted string.
If pretty-printing is enabled, includes spaces, tabs and new-lines to make the format more readable.
@param object an object to convert to a JSON formatted string
@param indentString the string that should be used for indentation when pretty-printing is enabled
@return th... | [
"Converts",
"an",
"object",
"to",
"a",
"JSON",
"formatted",
"string",
".",
"If",
"pretty",
"-",
"printing",
"is",
"enabled",
"includes",
"spaces",
"tabs",
"and",
"new",
"-",
"lines",
"to",
"make",
"the",
"format",
"more",
"readable",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/json/JsonWriter.java#L514-L523 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setSpout | public SpoutDeclarer setSpout(String id, IControlSpout spout) {
"""
Define a new bolt in this topology. This defines a control spout, which is a simpler to use but more restricted kind of bolt. Control spouts are intended for
making sending control message more simply
@param id the id of this component.
@para... | java | public SpoutDeclarer setSpout(String id, IControlSpout spout) {
return setSpout(id, spout, null);
} | [
"public",
"SpoutDeclarer",
"setSpout",
"(",
"String",
"id",
",",
"IControlSpout",
"spout",
")",
"{",
"return",
"setSpout",
"(",
"id",
",",
"spout",
",",
"null",
")",
";",
"}"
] | Define a new bolt in this topology. This defines a control spout, which is a simpler to use but more restricted kind of bolt. Control spouts are intended for
making sending control message more simply
@param id the id of this component.
@param spout the control spout | [
"Define",
"a",
"new",
"bolt",
"in",
"this",
"topology",
".",
"This",
"defines",
"a",
"control",
"spout",
"which",
"is",
"a",
"simpler",
"to",
"use",
"but",
"more",
"restricted",
"kind",
"of",
"bolt",
".",
"Control",
"spouts",
"are",
"intended",
"for",
"m... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L335-L337 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.listVirtualMachineScaleSetPublicIPAddressesAsync | public Observable<Page<PublicIPAddressInner>> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
"""
Gets information about all public IP addresses on a virtual machine scale set level.
@param resourceGroupName The name of the resource gro... | java | public Observable<Page<PublicIPAddressInner>> listVirtualMachineScaleSetPublicIPAddressesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
return listVirtualMachineScaleSetPublicIPAddressesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName)
.map(new... | [
"public",
"Observable",
"<",
"Page",
"<",
"PublicIPAddressInner",
">",
">",
"listVirtualMachineScaleSetPublicIPAddressesAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualMachineScaleSetName",
")",
"{",
"return",
"listVirtualMachineScaleSetPu... | Gets information about all public IP addresses on a virtual machine scale set level.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to ... | [
"Gets",
"information",
"about",
"all",
"public",
"IP",
"addresses",
"on",
"a",
"virtual",
"machine",
"scale",
"set",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L1202-L1210 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java | ChannelHelper.traceableChannel | public static final SeekableByteChannel traceableChannel(SeekableByteChannel channel, Consumer<ByteBuffer> tracer) {
"""
Returns a SeeekableByteChannel having feature that for every read/write method the
tracer function is called with read/write data between position and limit.
<p>
This is planned to support ca... | java | public static final SeekableByteChannel traceableChannel(SeekableByteChannel channel, Consumer<ByteBuffer> tracer)
{
return new TraceableSeekableByteChannel(channel, tracer);
} | [
"public",
"static",
"final",
"SeekableByteChannel",
"traceableChannel",
"(",
"SeekableByteChannel",
"channel",
",",
"Consumer",
"<",
"ByteBuffer",
">",
"tracer",
")",
"{",
"return",
"new",
"TraceableSeekableByteChannel",
"(",
"channel",
",",
"tracer",
")",
";",
"}"
... | Returns a SeeekableByteChannel having feature that for every read/write method the
tracer function is called with read/write data between position and limit.
<p>
This is planned to support calculating digestives.
@param channel
@param tracer
@return | [
"Returns",
"a",
"SeeekableByteChannel",
"having",
"feature",
"that",
"for",
"every",
"read",
"/",
"write",
"method",
"the",
"tracer",
"function",
"is",
"called",
"with",
"read",
"/",
"write",
"data",
"between",
"position",
"and",
"limit",
".",
"<p",
">",
"Th... | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java#L627-L630 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.copyAllFields | public final void copyAllFields(Record record, FieldList fieldList) {
"""
Copy the data in this record to the thin version.
@param fieldList
"""
for (int i = 0; i < fieldList.getFieldCount(); i++)
{
FieldInfo fieldInfo = fieldList.getField(i);
BaseField field = record.g... | java | public final void copyAllFields(Record record, FieldList fieldList)
{
for (int i = 0; i < fieldList.getFieldCount(); i++)
{
FieldInfo fieldInfo = fieldList.getField(i);
BaseField field = record.getField(i);
this.moveFieldToThin(fieldInfo, field, record);
}... | [
"public",
"final",
"void",
"copyAllFields",
"(",
"Record",
"record",
",",
"FieldList",
"fieldList",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fieldList",
".",
"getFieldCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"FieldInfo",
"fieldInf... | Copy the data in this record to the thin version.
@param fieldList | [
"Copy",
"the",
"data",
"in",
"this",
"record",
"to",
"the",
"thin",
"version",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L3275-L3283 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FirewallRulesInner.java | FirewallRulesInner.replaceAsync | public Observable<FirewallRuleInner> replaceAsync(String resourceGroupName, String serverName) {
"""
Replaces all firewall rules on the server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param... | java | public Observable<FirewallRuleInner> replaceAsync(String resourceGroupName, String serverName) {
return replaceWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<FirewallRuleInner>, FirewallRuleInner>() {
@Override
public FirewallRuleInner call(ServiceR... | [
"public",
"Observable",
"<",
"FirewallRuleInner",
">",
"replaceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"replaceWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"new",
"... | Replaces all firewall rules on the server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Replaces",
"all",
"firewall",
"rules",
"on",
"the",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FirewallRulesInner.java#L537-L544 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepository.java | GraphBackedMetadataRepository.deleteTrait | @Override
@GraphTransaction
public void deleteTrait(String guid, String traitNameToBeDeleted) throws TraitNotFoundException, EntityNotFoundException, RepositoryException {
"""
Deletes a given trait from an existing entity represented by a guid.
@param guid globally unique identifier for the entity
... | java | @Override
@GraphTransaction
public void deleteTrait(String guid, String traitNameToBeDeleted) throws TraitNotFoundException, EntityNotFoundException, RepositoryException {
LOG.debug("Deleting trait={} from entity={}", traitNameToBeDeleted, guid);
GraphTransactionInterceptor.lockObjectAndReleaseP... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"void",
"deleteTrait",
"(",
"String",
"guid",
",",
"String",
"traitNameToBeDeleted",
")",
"throws",
"TraitNotFoundException",
",",
"EntityNotFoundException",
",",
"RepositoryException",
"{",
"LOG",
".",
"debug",
"(",... | Deletes a given trait from an existing entity represented by a guid.
@param guid globally unique identifier for the entity
@param traitNameToBeDeleted name of the trait
@throws RepositoryException | [
"Deletes",
"a",
"given",
"trait",
"from",
"an",
"existing",
"entity",
"represented",
"by",
"a",
"guid",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepository.java#L376-L404 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java | SelectListUtil.isLegacyMatch | @Deprecated
private static boolean isLegacyMatch(final Object option, final Object data) {
"""
Check for legacy matching, which supported setSelected using String representations.
@param option the option to test for a match
@param data the test data value
@return true if the option is a legacy match
@depre... | java | @Deprecated
private static boolean isLegacyMatch(final Object option, final Object data) {
// Support legacy matching, which supported setSelected using String representations...
String optionAsString = String.valueOf(option);
String matchAsString = String.valueOf(data);
boolean equal = Util.equals(optionAsStr... | [
"@",
"Deprecated",
"private",
"static",
"boolean",
"isLegacyMatch",
"(",
"final",
"Object",
"option",
",",
"final",
"Object",
"data",
")",
"{",
"// Support legacy matching, which supported setSelected using String representations...",
"String",
"optionAsString",
"=",
"String"... | Check for legacy matching, which supported setSelected using String representations.
@param option the option to test for a match
@param data the test data value
@return true if the option is a legacy match
@deprecated Support for legacy matching will be removed | [
"Check",
"for",
"legacy",
"matching",
"which",
"supported",
"setSelected",
"using",
"String",
"representations",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SelectListUtil.java#L175-L182 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.getUpgradeProfile | public ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName) {
"""
Gets upgrade profile for a managed cluster.
Gets the details of the upgrade profile for a managed cluster with a specified resource group and name.
@param resourceGroupName The name of the resource g... | java | public ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName) {
return getUpgradeProfileWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body();
} | [
"public",
"ManagedClusterUpgradeProfileInner",
"getUpgradeProfile",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getUpgradeProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"toBlocking",
"(",
... | Gets upgrade profile for a managed cluster.
Gets the details of the upgrade profile for a managed cluster with a specified resource group and name.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@throws IllegalArgumentException thrown if parameter... | [
"Gets",
"upgrade",
"profile",
"for",
"a",
"managed",
"cluster",
".",
"Gets",
"the",
"details",
"of",
"the",
"upgrade",
"profile",
"for",
"a",
"managed",
"cluster",
"with",
"a",
"specified",
"resource",
"group",
"and",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L356-L358 |
TouK/sputnik | src/main/java/pl/touk/sputnik/processor/sonar/SonarScanner.java | SonarScanner.setAdditionalProperties | @VisibleForTesting
void setAdditionalProperties(Map<String, String> props) {
"""
Set additional properties needed for sonar to run
@param props a Properties instance
"""
props.put(SonarProperties.INCLUDE_FILES, StringUtils.join(files, ", "));
props.put(SonarProperties.SCM_ENABLED, "false")... | java | @VisibleForTesting
void setAdditionalProperties(Map<String, String> props) {
props.put(SonarProperties.INCLUDE_FILES, StringUtils.join(files, ", "));
props.put(SonarProperties.SCM_ENABLED, "false");
props.put(SonarProperties.SCM_STAT_ENABLED, "false");
props.put(SonarProperties.ISSUE... | [
"@",
"VisibleForTesting",
"void",
"setAdditionalProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"props",
")",
"{",
"props",
".",
"put",
"(",
"SonarProperties",
".",
"INCLUDE_FILES",
",",
"StringUtils",
".",
"join",
"(",
"files",
",",
"\", \"",
")... | Set additional properties needed for sonar to run
@param props a Properties instance | [
"Set",
"additional",
"properties",
"needed",
"for",
"sonar",
"to",
"run"
] | train | https://github.com/TouK/sputnik/blob/64569e603d8837e800e3b3797b604a6942a7b5c5/src/main/java/pl/touk/sputnik/processor/sonar/SonarScanner.java#L73-L84 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/raster/RasterImage.java | RasterImage.getRasterFactor | private static double getRasterFactor(int i, RasterData data) {
"""
Get raster color.
@param i The color offset.
@param data The raster data (must not be <code>null</code>).
@return The rastered color.
@throws LionEngineException If invalid arguments.
"""
Check.notNull(data);
final do... | java | private static double getRasterFactor(int i, RasterData data)
{
Check.notNull(data);
final double force = data.getForce();
final double amplitude = data.getAmplitude();
final int offset = data.getOffset();
if (0 == data.getType())
{
return forc... | [
"private",
"static",
"double",
"getRasterFactor",
"(",
"int",
"i",
",",
"RasterData",
"data",
")",
"{",
"Check",
".",
"notNull",
"(",
"data",
")",
";",
"final",
"double",
"force",
"=",
"data",
".",
"getForce",
"(",
")",
";",
"final",
"double",
"amplitude... | Get raster color.
@param i The color offset.
@param data The raster data (must not be <code>null</code>).
@return The rastered color.
@throws LionEngineException If invalid arguments. | [
"Get",
"raster",
"color",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/raster/RasterImage.java#L56-L69 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/authentication/impl/LoginFailureHandlerImpl.java | LoginFailureHandlerImpl.handle | @Override
public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
IOException {
"""
Redirects the response to target URL if target URL is not empty. If not, a 401 UNAUTHORIZED error is sent.
@param context the request context
@param e the ex... | java | @Override
public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
IOException {
String targetUrl = getTargetUrl();
if (StringUtils.isNotEmpty(targetUrl)) {
RedirectUtils.redirect(context.getRequest(), context.getResponse(), targ... | [
"@",
"Override",
"public",
"void",
"handle",
"(",
"RequestContext",
"context",
",",
"AuthenticationException",
"e",
")",
"throws",
"SecurityProviderException",
",",
"IOException",
"{",
"String",
"targetUrl",
"=",
"getTargetUrl",
"(",
")",
";",
"if",
"(",
"StringUt... | Redirects the response to target URL if target URL is not empty. If not, a 401 UNAUTHORIZED error is sent.
@param context the request context
@param e the exception that caused the login to fail. | [
"Redirects",
"the",
"response",
"to",
"target",
"URL",
"if",
"target",
"URL",
"is",
"not",
"empty",
".",
"If",
"not",
"a",
"401",
"UNAUTHORIZED",
"error",
"is",
"sent",
"."
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/authentication/impl/LoginFailureHandlerImpl.java#L61-L70 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/MD5FileUtils.java | MD5FileUtils.verifySavedMD5 | public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5)
throws IOException {
"""
Verify that the previously saved md5 for the given file matches
expectedMd5.
@throws IOException
"""
MD5Hash storedHash = readStoredMd5ForFile(dataFile);
// Check the hash itself
if (!expectedMD5.... | java | public static void verifySavedMD5(File dataFile, MD5Hash expectedMD5)
throws IOException {
MD5Hash storedHash = readStoredMd5ForFile(dataFile);
// Check the hash itself
if (!expectedMD5.equals(storedHash)) {
throw new IOException(
"File " + dataFile + " did not match stored MD5 checksu... | [
"public",
"static",
"void",
"verifySavedMD5",
"(",
"File",
"dataFile",
",",
"MD5Hash",
"expectedMD5",
")",
"throws",
"IOException",
"{",
"MD5Hash",
"storedHash",
"=",
"readStoredMd5ForFile",
"(",
"dataFile",
")",
";",
"// Check the hash itself",
"if",
"(",
"!",
"e... | Verify that the previously saved md5 for the given file matches
expectedMd5.
@throws IOException | [
"Verify",
"that",
"the",
"previously",
"saved",
"md5",
"for",
"the",
"given",
"file",
"matches",
"expectedMd5",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/MD5FileUtils.java#L54-L63 |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Background.java | Background.runWithCallback | public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback) {
"""
Execute the job in the background and provide a callback which is called
when the job is finished.
It is guarantied that the callback is executed inside of the UI thread.
@param <T>
@param job
@param callback
... | java | public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback)
{
final UI ui = UI.getCurrent();
ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
ListenableFuture<T> future = exec.submit(job);
if(callback != null)
... | [
"public",
"static",
"<",
"T",
">",
"void",
"runWithCallback",
"(",
"Callable",
"<",
"T",
">",
"job",
",",
"final",
"FutureCallback",
"<",
"T",
">",
"callback",
")",
"{",
"final",
"UI",
"ui",
"=",
"UI",
".",
"getCurrent",
"(",
")",
";",
"ListeningExecut... | Execute the job in the background and provide a callback which is called
when the job is finished.
It is guarantied that the callback is executed inside of the UI thread.
@param <T>
@param job
@param callback | [
"Execute",
"the",
"job",
"in",
"the",
"background",
"and",
"provide",
"a",
"callback",
"which",
"is",
"called",
"when",
"the",
"job",
"is",
"finished",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Background.java#L54-L94 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java | MockHttpServletResponse.getOutputAsString | public String getOutputAsString() {
"""
Retrieves the content written to the response.
@return the content written to the response outputStream or printWriter. Null is returned if neither
{@link #getOutputStream()} or {@link #getWriter()} have been called.
"""
if (stringWriter != null) {
return string... | java | public String getOutputAsString() {
if (stringWriter != null) {
return stringWriter.toString();
} else if (outputStream != null) {
String outputStr = null;
byte[] bytes = outputStream.getOutput();
if (bytes != null) {
try {
outputStr = new String(bytes, characterEncoding);
} catch (Unsuppo... | [
"public",
"String",
"getOutputAsString",
"(",
")",
"{",
"if",
"(",
"stringWriter",
"!=",
"null",
")",
"{",
"return",
"stringWriter",
".",
"toString",
"(",
")",
";",
"}",
"else",
"if",
"(",
"outputStream",
"!=",
"null",
")",
"{",
"String",
"outputStr",
"=... | Retrieves the content written to the response.
@return the content written to the response outputStream or printWriter. Null is returned if neither
{@link #getOutputStream()} or {@link #getWriter()} have been called. | [
"Retrieves",
"the",
"content",
"written",
"to",
"the",
"response",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletResponse.java#L428-L447 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.merge | public ExcelWriter merge(int lastColumn, Object content, boolean isSetHeaderStyle) {
"""
合并某行的单元格,并写入对象到单元格<br>
如果写到单元格中的内容非null,行号自动+1,否则当前行号不变<br>
样式为默认标题样式,可使用{@link #getHeadCellStyle()}方法调用后自定义默认样式
@param lastColumn 合并到的最后一个列号
@param content 合并单元格后的内容
@param isSetHeaderStyle 是否为合并后的单元格设置默认标题样式
@return ... | java | public ExcelWriter merge(int lastColumn, Object content, boolean isSetHeaderStyle) {
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
final int rowIndex = this.currentRow.get();
merge(rowIndex, rowIndex, 0, lastColumn, content, isSetHeaderStyle);
// 设置内容后跳到下一行
if (null != content) {
... | [
"public",
"ExcelWriter",
"merge",
"(",
"int",
"lastColumn",
",",
"Object",
"content",
",",
"boolean",
"isSetHeaderStyle",
")",
"{",
"Assert",
".",
"isFalse",
"(",
"this",
".",
"isClosed",
",",
"\"ExcelWriter has been closed!\"",
")",
";",
"final",
"int",
"rowInd... | 合并某行的单元格,并写入对象到单元格<br>
如果写到单元格中的内容非null,行号自动+1,否则当前行号不变<br>
样式为默认标题样式,可使用{@link #getHeadCellStyle()}方法调用后自定义默认样式
@param lastColumn 合并到的最后一个列号
@param content 合并单元格后的内容
@param isSetHeaderStyle 是否为合并后的单元格设置默认标题样式
@return this
@since 4.0.10 | [
"合并某行的单元格,并写入对象到单元格<br",
">",
"如果写到单元格中的内容非null,行号自动",
"+",
"1,否则当前行号不变<br",
">",
"样式为默认标题样式,可使用",
"{",
"@link",
"#getHeadCellStyle",
"()",
"}",
"方法调用后自定义默认样式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L518-L529 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(BigInteger value, byte[] dst, int dstOffset) {
"""
Encodes the given optional BigInteger into a variable amount of bytes
for descending order. If the BigInteger is null, exactly 1 byte is
written. Otherwise, the amount written can be determined by calling
calculateEncodedLength.
... | java | public static int encodeDesc(BigInteger value, byte[] dst, int dstOffset) {
/* Encoding of first byte:
0x00: null high (unused)
0x01: positive signum; four bytes follow for value length
0x02..0x7f: positive signum; value length 7e range, 1..126
0x80..0xfd: nega... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"BigInteger",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"/* Encoding of first byte:\r\n\r\n 0x00: null high (unused)\r\n 0x01: positive signum; four bytes follow for value length... | Encodes the given optional BigInteger into a variable amount of bytes
for descending order. If the BigInteger is null, exactly 1 byte is
written. Otherwise, the amount written can be determined by calling
calculateEncodedLength.
@param value BigInteger value to encode, may be null
@param dst destination for encoded by... | [
"Encodes",
"the",
"given",
"optional",
"BigInteger",
"into",
"a",
"variable",
"amount",
"of",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"BigInteger",
"is",
"null",
"exactly",
"1",
"byte",
"is",
"written",
".",
"Otherwise",
"the",
"amount",
"wr... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L366-L407 |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java | SessionProvider.getSession | public synchronized Session getSession(String workspaceName, ManageableRepository repository) throws LoginException,
NoSuchWorkspaceException, RepositoryException {
"""
Gets the session from an internal cache if a similar session has already been used
or creates a new session and puts it into the internal c... | java | public synchronized Session getSession(String workspaceName, ManageableRepository repository) throws LoginException,
NoSuchWorkspaceException, RepositoryException
{
if (closed)
{
throw new IllegalStateException("Session provider already closed");
}
if (workspaceName == null)
... | [
"public",
"synchronized",
"Session",
"getSession",
"(",
"String",
"workspaceName",
",",
"ManageableRepository",
"repository",
")",
"throws",
"LoginException",
",",
"NoSuchWorkspaceException",
",",
"RepositoryException",
"{",
"if",
"(",
"closed",
")",
"{",
"throw",
"ne... | Gets the session from an internal cache if a similar session has already been used
or creates a new session and puts it into the internal cache.
@param workspaceName the workspace name
@param repository the repository instance
@return a session corresponding to the given repository and workspace
@throws LoginException... | [
"Gets",
"the",
"session",
"from",
"an",
"internal",
"cache",
"if",
"a",
"similar",
"session",
"has",
"already",
"been",
"used",
"or",
"creates",
"a",
"new",
"session",
"and",
"puts",
"it",
"into",
"the",
"internal",
"cache",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java#L171-L211 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.geospatialRegionConstraint | public StructuredQueryDefinition geospatialRegionConstraint(String constraintName, GeospatialOperator operator, Region... regions) {
"""
Matches the container specified by the constraint
whose geospatial region appears within one of the criteria regions.
@param constraintName the constraint definition
@param... | java | public StructuredQueryDefinition geospatialRegionConstraint(String constraintName, GeospatialOperator operator, Region... regions) {
checkRegions(regions);
return new GeospatialRegionConstraintQuery(constraintName, operator, regions);
} | [
"public",
"StructuredQueryDefinition",
"geospatialRegionConstraint",
"(",
"String",
"constraintName",
",",
"GeospatialOperator",
"operator",
",",
"Region",
"...",
"regions",
")",
"{",
"checkRegions",
"(",
"regions",
")",
";",
"return",
"new",
"GeospatialRegionConstraintQu... | Matches the container specified by the constraint
whose geospatial region appears within one of the criteria regions.
@param constraintName the constraint definition
@param operator the geospatial operator to be applied with the regions
in the index and the criteria regions
@param regions the possible regions ... | [
"Matches",
"the",
"container",
"specified",
"by",
"the",
"constraint",
"whose",
"geospatial",
"region",
"appears",
"within",
"one",
"of",
"the",
"criteria",
"regions",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L1105-L1108 |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java | QueryExecuter.runCommonStream | public static Set<BioPAXElement> runCommonStream(
Set<BioPAXElement> sourceSet,
Model model,
Direction direction,
int limit,
Filter... filters) {
"""
Gets the elements in the common upstream or downstream of the seed
@param sourceSet Seed to the query
@param model BioPAX model
@param direction UPSTREA... | java | public static Set<BioPAXElement> runCommonStream(
Set<BioPAXElement> sourceSet,
Model model,
Direction direction,
int limit,
Filter... filters)
{
Graph graph;
if (model.getLevel() == BioPAXLevel.L3)
{
graph = new GraphL3(model, filters);
}
else return Collections.emptySet();
Collection<Set<N... | [
"public",
"static",
"Set",
"<",
"BioPAXElement",
">",
"runCommonStream",
"(",
"Set",
"<",
"BioPAXElement",
">",
"sourceSet",
",",
"Model",
"model",
",",
"Direction",
"direction",
",",
"int",
"limit",
",",
"Filter",
"...",
"filters",
")",
"{",
"Graph",
"graph... | Gets the elements in the common upstream or downstream of the seed
@param sourceSet Seed to the query
@param model BioPAX model
@param direction UPSTREAM or DOWNSTREAM
@param limit Length limit for the search
@param filters for filtering graph elements
@return BioPAX elements in the result | [
"Gets",
"the",
"elements",
"in",
"the",
"common",
"upstream",
"or",
"downstream",
"of",
"the",
"seed"
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L262-L285 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/ObjectWritable.java | ObjectWritable.writeStringCached | public static void writeStringCached(DataOutput out, String entityName)
throws IOException {
"""
This class should be used for writing only class/method names!!!!
"""
byte[] name = getByteNameWithCaching(entityName);
// name should never be null at this point
if (name == null) {
throw n... | java | public static void writeStringCached(DataOutput out, String entityName)
throws IOException {
byte[] name = getByteNameWithCaching(entityName);
// name should never be null at this point
if (name == null) {
throw new RuntimeException("Cannot retrieve class name");
}
out.write(name, 0, nam... | [
"public",
"static",
"void",
"writeStringCached",
"(",
"DataOutput",
"out",
",",
"String",
"entityName",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"name",
"=",
"getByteNameWithCaching",
"(",
"entityName",
")",
";",
"// name should never be null at this point... | This class should be used for writing only class/method names!!!! | [
"This",
"class",
"should",
"be",
"used",
"for",
"writing",
"only",
"class",
"/",
"method",
"names!!!!"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/ObjectWritable.java#L190-L198 |
pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.addRepository | public void addRepository(String id, URL url) {
"""
Add one {@link DefaultUpdateRepository).
@param id of repo
@param url of repo
"""
for (UpdateRepository ur : repositories) {
if (ur.getId().equals(id)) {
throw new RuntimeException("Repository with id " + id + " already... | java | public void addRepository(String id, URL url) {
for (UpdateRepository ur : repositories) {
if (ur.getId().equals(id)) {
throw new RuntimeException("Repository with id " + id + " already exists");
}
}
repositories.add(new DefaultUpdateRepository(id, url));
... | [
"public",
"void",
"addRepository",
"(",
"String",
"id",
",",
"URL",
"url",
")",
"{",
"for",
"(",
"UpdateRepository",
"ur",
":",
"repositories",
")",
"{",
"if",
"(",
"ur",
".",
"getId",
"(",
")",
".",
"equals",
"(",
"id",
")",
")",
"{",
"throw",
"ne... | Add one {@link DefaultUpdateRepository).
@param id of repo
@param url of repo | [
"Add",
"one",
"{",
"@link",
"DefaultUpdateRepository",
")",
"."
] | train | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L172-L179 |
apache/flink | flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/HBaseTableSchema.java | HBaseTableSchema.addColumn | void addColumn(String family, String qualifier, Class<?> clazz) {
"""
Adds a column defined by family, qualifier, and type to the table schema.
@param family the family name
@param qualifier the qualifier name
@param clazz the data type of the qualifier
"""
Preconditions.checkNotNull(family, "fam... | java | void addColumn(String family, String qualifier, Class<?> clazz) {
Preconditions.checkNotNull(family, "family name");
Preconditions.checkNotNull(qualifier, "qualifier name");
Preconditions.checkNotNull(clazz, "class type");
Map<String, TypeInformation<?>> qualifierMap = this.familyMap.get(family);
if (!HBaseR... | [
"void",
"addColumn",
"(",
"String",
"family",
",",
"String",
"qualifier",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"family",
",",
"\"family name\"",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"quali... | Adds a column defined by family, qualifier, and type to the table schema.
@param family the family name
@param qualifier the qualifier name
@param clazz the data type of the qualifier | [
"Adds",
"a",
"column",
"defined",
"by",
"family",
"qualifier",
"and",
"type",
"to",
"the",
"table",
"schema",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/HBaseTableSchema.java#L48-L65 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.computeVarianceSafe | protected double computeVarianceSafe(int x0, int y0, int x1, int y1) {
"""
Computes the variance inside the specified rectangle.
@return variance
"""
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_zero(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
doubl... | java | protected double computeVarianceSafe(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_zero(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_zero(integral, x0 - 1, ... | [
"protected",
"double",
"computeVarianceSafe",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"// can use unsafe operations here since x0 > 0 and y0 > 0",
"double",
"square",
"=",
"GIntegralImageOps",
".",
"block_zero",
"(",
"integr... | Computes the variance inside the specified rectangle.
@return variance | [
"Computes",
"the",
"variance",
"inside",
"the",
"specified",
"rectangle",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L120-L128 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/FileEventStore.java | FileEventStore.prepareCollectionDir | private File prepareCollectionDir(String projectId, String eventCollection) throws IOException {
"""
Prepares the file cache for the given event collection for another event to be added. This
method checks to make sure that the maximum number of events per collection hasn't been
exceeded, and if it has, this met... | java | private File prepareCollectionDir(String projectId, String eventCollection) throws IOException {
File collectionDir = getCollectionDir(projectId, eventCollection);
// Make sure the max number of events has not been exceeded in this collection. If it has,
// delete events to make room.
F... | [
"private",
"File",
"prepareCollectionDir",
"(",
"String",
"projectId",
",",
"String",
"eventCollection",
")",
"throws",
"IOException",
"{",
"File",
"collectionDir",
"=",
"getCollectionDir",
"(",
"projectId",
",",
"eventCollection",
")",
";",
"// Make sure the max number... | Prepares the file cache for the given event collection for another event to be added. This
method checks to make sure that the maximum number of events per collection hasn't been
exceeded, and if it has, this method discards events to make room.
@param projectId The project ID.
@param eventCollection The name of... | [
"Prepares",
"the",
"file",
"cache",
"for",
"the",
"given",
"event",
"collection",
"for",
"another",
"event",
"to",
"be",
"added",
".",
"This",
"method",
"checks",
"to",
"make",
"sure",
"that",
"the",
"maximum",
"number",
"of",
"events",
"per",
"collection",
... | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/FileEventStore.java#L372-L404 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.getProperty | public static Object getProperty(Object bean, String expression) {
"""
解析Bean中的属性值
@param bean Bean对象,支持Map、List、Collection、Array
@param expression 表达式,例如:person.friend[5].name
@return Bean属性值
@see BeanPath#get(Object)
@since 3.0.7
"""
return BeanPath.create(expression).get(bean);
} | java | public static Object getProperty(Object bean, String expression) {
return BeanPath.create(expression).get(bean);
} | [
"public",
"static",
"Object",
"getProperty",
"(",
"Object",
"bean",
",",
"String",
"expression",
")",
"{",
"return",
"BeanPath",
".",
"create",
"(",
"expression",
")",
".",
"get",
"(",
"bean",
")",
";",
"}"
] | 解析Bean中的属性值
@param bean Bean对象,支持Map、List、Collection、Array
@param expression 表达式,例如:person.friend[5].name
@return Bean属性值
@see BeanPath#get(Object)
@since 3.0.7 | [
"解析Bean中的属性值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L301-L303 |
theHilikus/JRoboCom | jrobocom-simple-gui/src/main/java/com/github/thehilikus/jrobocom/gui/panels/BoardPanel.java | BoardPanel.addItem | public void addItem(Point coordinates, Drawable item) {
"""
Adds an item to draw in a particular position
@param coordinates the position of the item
@param item the drawable element
"""
assertEDT();
if (coordinates == null || item == null) {
throw new IllegalArgumentException("Coordinates and added... | java | public void addItem(Point coordinates, Drawable item) {
assertEDT();
if (coordinates == null || item == null) {
throw new IllegalArgumentException("Coordinates and added item cannot be null");
}
log.trace("[addItem] New item added @ {}", coordinates);
getPanelAt(coordinates).addModel(item);
getPanelAt(coordi... | [
"public",
"void",
"addItem",
"(",
"Point",
"coordinates",
",",
"Drawable",
"item",
")",
"{",
"assertEDT",
"(",
")",
";",
"if",
"(",
"coordinates",
"==",
"null",
"||",
"item",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Coord... | Adds an item to draw in a particular position
@param coordinates the position of the item
@param item the drawable element | [
"Adds",
"an",
"item",
"to",
"draw",
"in",
"a",
"particular",
"position"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-simple-gui/src/main/java/com/github/thehilikus/jrobocom/gui/panels/BoardPanel.java#L66-L75 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Util.java | Util.saveTo | public static void saveTo(String path, InputStream in) {
"""
Saves content read from input stream into a file.
@param path path to file.
@param in input stream to read content from.
"""
if (in == null) {
throw new IllegalArgumentException("input stream cannot be null");
}
... | java | public static void saveTo(String path, InputStream in) {
if (in == null) {
throw new IllegalArgumentException("input stream cannot be null");
}
if (path == null) {
throw new IllegalArgumentException("path cannot be null");
}
FileOutputStream out = null;
... | [
"public",
"static",
"void",
"saveTo",
"(",
"String",
"path",
",",
"InputStream",
"in",
")",
"{",
"if",
"(",
"in",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"input stream cannot be null\"",
")",
";",
"}",
"if",
"(",
"path",
... | Saves content read from input stream into a file.
@param path path to file.
@param in input stream to read content from. | [
"Saves",
"content",
"read",
"from",
"input",
"stream",
"into",
"a",
"file",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Util.java#L403-L425 |
elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java | OutputStreamLogger.countNonNewline | private int countNonNewline(String str, int off, int len) {
"""
Count the number of non-newline characters before first newline in the string.
@param str String
@param off offset
@param len length
@return number of non-newline characters
"""
for(int cnt = 0; cnt < len; cnt++) {
final int pos = ... | java | private int countNonNewline(String str, int off, int len) {
for(int cnt = 0; cnt < len; cnt++) {
final int pos = off + cnt;
if(str.charAt(pos) == UNIX_NEWLINE) {
return cnt;
}
if(str.charAt(pos) == CARRIAGE_RETURN) {
return cnt;
}
}
return len;
} | [
"private",
"int",
"countNonNewline",
"(",
"String",
"str",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"cnt",
"=",
"0",
";",
"cnt",
"<",
"len",
";",
"cnt",
"++",
")",
"{",
"final",
"int",
"pos",
"=",
"off",
"+",
"cnt",
";... | Count the number of non-newline characters before first newline in the string.
@param str String
@param off offset
@param len length
@return number of non-newline characters | [
"Count",
"the",
"number",
"of",
"non",
"-",
"newline",
"characters",
"before",
"first",
"newline",
"in",
"the",
"string",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java#L191-L202 |
astrapi69/jaulp-wicket | jaulp-wicket-dropdownchoices/src/main/java/de/alpharogroup/wicket/components/i18n/dropdownchoice/panels/DropdownAutocompleteTextFieldPanel.java | DropdownAutocompleteTextFieldPanel.newChildLabel | protected Label newChildLabel(final String forId, final IModel<String> model) {
"""
Factory method for creating the root Label. This method is invoked in the
constructor from the derived classes and can be overridden so users can
provide their own version of a Label.
@param forId
the for id
@param model
th... | java | protected Label newChildLabel(final String forId, final IModel<String> model) {
return ComponentFactory.newLabel("childLabel", forId, model);
} | [
"protected",
"Label",
"newChildLabel",
"(",
"final",
"String",
"forId",
",",
"final",
"IModel",
"<",
"String",
">",
"model",
")",
"{",
"return",
"ComponentFactory",
".",
"newLabel",
"(",
"\"childLabel\"",
",",
"forId",
",",
"model",
")",
";",
"}"
] | Factory method for creating the root Label. This method is invoked in the
constructor from the derived classes and can be overridden so users can
provide their own version of a Label.
@param forId
the for id
@param model
the model
@return the label | [
"Factory",
"method",
"for",
"creating",
"the",
"root",
"Label",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"versi... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dropdownchoices/src/main/java/de/alpharogroup/wicket/components/i18n/dropdownchoice/panels/DropdownAutocompleteTextFieldPanel.java#L252-L254 |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream._getByte | private static byte _getByte(int startIndex, BitSetStrictLength set)
throws AsnException {
"""
Attepts to read up to 8 bits and store into byte. If less is found, only
those are returned
@param startIndex
@param set
@return
@throws AsnException
"""
int count = 8;
byte data = 0;
// if (se... | java | private static byte _getByte(int startIndex, BitSetStrictLength set)
throws AsnException {
int count = 8;
byte data = 0;
// if (set.length() - 1 < startIndex) {
// throw new AsnException();
// }
while (count > 0) {
if (set.length() - 1 < startIndex) {
break;
} else {
boolean ... | [
"private",
"static",
"byte",
"_getByte",
"(",
"int",
"startIndex",
",",
"BitSetStrictLength",
"set",
")",
"throws",
"AsnException",
"{",
"int",
"count",
"=",
"8",
";",
"byte",
"data",
"=",
"0",
";",
"//\t\tif (set.length() - 1 < startIndex) {\r",
"//\t\t\tthrow new ... | Attepts to read up to 8 bits and store into byte. If less is found, only
those are returned
@param startIndex
@param set
@return
@throws AsnException | [
"Attepts",
"to",
"read",
"up",
"to",
"8",
"bits",
"and",
"store",
"into",
"byte",
".",
"If",
"less",
"is",
"found",
"only",
"those",
"are",
"returned"
] | train | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L589-L614 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/capability/registry/CapabilityResolutionContext.java | CapabilityResolutionContext.attachIfAbsent | public <V> V attachIfAbsent(final AttachmentKey<V> key, final V value) {
"""
Attaches an arbitrary object to this context only if the object was not already attached. If a value has already
been attached with the key provided, the current value associated with the key is returned.
@param key they attachment ... | java | public <V> V attachIfAbsent(final AttachmentKey<V> key, final V value) {
assert key != null;
return key.cast(contextAttachments.putIfAbsent(key, value));
} | [
"public",
"<",
"V",
">",
"V",
"attachIfAbsent",
"(",
"final",
"AttachmentKey",
"<",
"V",
">",
"key",
",",
"final",
"V",
"value",
")",
"{",
"assert",
"key",
"!=",
"null",
";",
"return",
"key",
".",
"cast",
"(",
"contextAttachments",
".",
"putIfAbsent",
... | Attaches an arbitrary object to this context only if the object was not already attached. If a value has already
been attached with the key provided, the current value associated with the key is returned.
@param key they attachment key used to ensure uniqueness and used for retrieval of the value.
@param value the v... | [
"Attaches",
"an",
"arbitrary",
"object",
"to",
"this",
"context",
"only",
"if",
"the",
"object",
"was",
"not",
"already",
"attached",
".",
"If",
"a",
"value",
"has",
"already",
"been",
"attached",
"with",
"the",
"key",
"provided",
"the",
"current",
"value",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/capability/registry/CapabilityResolutionContext.java#L83-L86 |
alkacon/opencms-core | src/org/opencms/gwt/CmsVfsService.java | CmsVfsService.formatDateTime | public static String formatDateTime(CmsObject cms, long date) {
"""
Formats a date given the current user's workplace locale.<p>
@param cms the current CMS context
@param date the date to format
@return the formatted date
"""
return CmsDateUtil.getDateTime(
new Date(date),
... | java | public static String formatDateTime(CmsObject cms, long date) {
return CmsDateUtil.getDateTime(
new Date(date),
DateFormat.MEDIUM,
OpenCms.getWorkplaceManager().getWorkplaceLocale(cms));
} | [
"public",
"static",
"String",
"formatDateTime",
"(",
"CmsObject",
"cms",
",",
"long",
"date",
")",
"{",
"return",
"CmsDateUtil",
".",
"getDateTime",
"(",
"new",
"Date",
"(",
"date",
")",
",",
"DateFormat",
".",
"MEDIUM",
",",
"OpenCms",
".",
"getWorkplaceMan... | Formats a date given the current user's workplace locale.<p>
@param cms the current CMS context
@param date the date to format
@return the formatted date | [
"Formats",
"a",
"date",
"given",
"the",
"current",
"user",
"s",
"workplace",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsVfsService.java#L218-L224 |
maestrano/maestrano-java | src/main/java/com/maestrano/net/ConnecClient.java | ConnecClient.getInstanceUrl | public String getInstanceUrl(String entityName, String groupId, String id) {
"""
Return the url to the instance endpoint
@param entity
name
@param customer
group id
@param entity
id
@return instance url
"""
return connec.getHost() + getInstanceEndpoint(entityName, groupId, id);
} | java | public String getInstanceUrl(String entityName, String groupId, String id) {
return connec.getHost() + getInstanceEndpoint(entityName, groupId, id);
} | [
"public",
"String",
"getInstanceUrl",
"(",
"String",
"entityName",
",",
"String",
"groupId",
",",
"String",
"id",
")",
"{",
"return",
"connec",
".",
"getHost",
"(",
")",
"+",
"getInstanceEndpoint",
"(",
"entityName",
",",
"groupId",
",",
"id",
")",
";",
"}... | Return the url to the instance endpoint
@param entity
name
@param customer
group id
@param entity
id
@return instance url | [
"Return",
"the",
"url",
"to",
"the",
"instance",
"endpoint"
] | train | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/ConnecClient.java#L114-L116 |
prolificinteractive/material-calendarview | library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java | MaterialCalendarView.setCurrentDate | public void setCurrentDate(@Nullable CalendarDay day, boolean useSmoothScroll) {
"""
Set the calendar to a specific month or week based on a date.
In month mode, the calendar will be set to the corresponding month.
In week mode, the calendar will be set to the corresponding week.
@param day a CalendarDay ... | java | public void setCurrentDate(@Nullable CalendarDay day, boolean useSmoothScroll) {
if (day == null) {
return;
}
int index = adapter.getIndexForDay(day);
pager.setCurrentItem(index, useSmoothScroll);
updateUi();
} | [
"public",
"void",
"setCurrentDate",
"(",
"@",
"Nullable",
"CalendarDay",
"day",
",",
"boolean",
"useSmoothScroll",
")",
"{",
"if",
"(",
"day",
"==",
"null",
")",
"{",
"return",
";",
"}",
"int",
"index",
"=",
"adapter",
".",
"getIndexForDay",
"(",
"day",
... | Set the calendar to a specific month or week based on a date.
In month mode, the calendar will be set to the corresponding month.
In week mode, the calendar will be set to the corresponding week.
@param day a CalendarDay to focus the calendar on. Null will do nothing
@param useSmoothScroll use smooth scroll when cha... | [
"Set",
"the",
"calendar",
"to",
"a",
"specific",
"month",
"or",
"week",
"based",
"on",
"a",
"date",
"."
] | train | https://github.com/prolificinteractive/material-calendarview/blob/04fae8175fd034d0a7131f8cb253cae883a88aa2/library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java#L880-L887 |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.log | public void log(String message, Map<String, Object> custom) {
"""
Record a message with extra information attached at the default level returned by {@link
com.rollbar.notifier.Rollbar#level}, (WARNING unless level overridden).
@param message the message.
@param custom the extra information.
"""
log(n... | java | public void log(String message, Map<String, Object> custom) {
log(null, custom, message, null);
} | [
"public",
"void",
"log",
"(",
"String",
"message",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
")",
"{",
"log",
"(",
"null",
",",
"custom",
",",
"message",
",",
"null",
")",
";",
"}"
] | Record a message with extra information attached at the default level returned by {@link
com.rollbar.notifier.Rollbar#level}, (WARNING unless level overridden).
@param message the message.
@param custom the extra information. | [
"Record",
"a",
"message",
"with",
"extra",
"information",
"attached",
"at",
"the",
"default",
"level",
"returned",
"by",
"{",
"@link",
"com",
".",
"rollbar",
".",
"notifier",
".",
"Rollbar#level",
"}",
"(",
"WARNING",
"unless",
"level",
"overridden",
")",
".... | train | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L755-L757 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addSubListAsync | public Observable<Integer> addSubListAsync(UUID appId, String versionId, UUID clEntityId, WordListObject wordListCreateObject) {
"""
Adds a list to an existing closed list.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param wordList... | java | public Observable<Integer> addSubListAsync(UUID appId, String versionId, UUID clEntityId, WordListObject wordListCreateObject) {
return addSubListWithServiceResponseAsync(appId, versionId, clEntityId, wordListCreateObject).map(new Func1<ServiceResponse<Integer>, Integer>() {
@Override
pu... | [
"public",
"Observable",
"<",
"Integer",
">",
"addSubListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
",",
"WordListObject",
"wordListCreateObject",
")",
"{",
"return",
"addSubListWithServiceResponseAsync",
"(",
"appId",
",",
"... | Adds a list to an existing closed list.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param wordListCreateObject Words list.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Integer object | [
"Adds",
"a",
"list",
"to",
"an",
"existing",
"closed",
"list",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5473-L5480 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/writer/Batch.java | Batch.tryAppend | public Future<RecordMetadata> tryAppend(D record, WriteCallback callback, LargeMessagePolicy largeMessagePolicy)
throws RecordTooLargeException {
"""
Try to add a record to this batch
<p>
This method first check room space if a give record can be added
If there is no space for new record, a null is return... | java | public Future<RecordMetadata> tryAppend(D record, WriteCallback callback, LargeMessagePolicy largeMessagePolicy)
throws RecordTooLargeException {
if (!hasRoom(record, largeMessagePolicy)) {
LOG.debug ("Cannot add {} to previous batch because the batch already has {} bytes",
record.toString(), ... | [
"public",
"Future",
"<",
"RecordMetadata",
">",
"tryAppend",
"(",
"D",
"record",
",",
"WriteCallback",
"callback",
",",
"LargeMessagePolicy",
"largeMessagePolicy",
")",
"throws",
"RecordTooLargeException",
"{",
"if",
"(",
"!",
"hasRoom",
"(",
"record",
",",
"large... | Try to add a record to this batch
<p>
This method first check room space if a give record can be added
If there is no space for new record, a null is returned; otherwise {@link Batch#append(Object)}
is invoked and {@link RecordFuture} object is returned. User can call get() method on this object
which will block curren... | [
"Try",
"to",
"add",
"a",
"record",
"to",
"this",
"batch",
"<p",
">",
"This",
"method",
"first",
"check",
"room",
"space",
"if",
"a",
"give",
"record",
"can",
"be",
"added",
"If",
"there",
"is",
"no",
"space",
"for",
"new",
"record",
"a",
"null",
"is"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/writer/Batch.java#L169-L184 |
kite-sdk/kite | kite-data/kite-data-hive/src/main/java/org/kitesdk/data/spi/hive/HiveAbstractMetadataProvider.java | HiveAbstractMetadataProvider.isReadable | private boolean isReadable(String namespace, String name) {
"""
Returns true if the given table exists and can be read by this library.
@param namespace a Hive database name
@param name a table name
@return {@code true} if the table exists and is supported
"""
Table table = getMetaStoreUtil().getTable... | java | private boolean isReadable(String namespace, String name) {
Table table = getMetaStoreUtil().getTable(namespace, name);
if (isManaged(table) || isExternal(table)) { // readable table types
try {
// get a descriptor for the table. if this succeeds, it is readable
HiveUtils.descriptorForTabl... | [
"private",
"boolean",
"isReadable",
"(",
"String",
"namespace",
",",
"String",
"name",
")",
"{",
"Table",
"table",
"=",
"getMetaStoreUtil",
"(",
")",
".",
"getTable",
"(",
"namespace",
",",
"name",
")",
";",
"if",
"(",
"isManaged",
"(",
"table",
")",
"||... | Returns true if the given table exists and can be read by this library.
@param namespace a Hive database name
@param name a table name
@return {@code true} if the table exists and is supported | [
"Returns",
"true",
"if",
"the",
"given",
"table",
"exists",
"and",
"can",
"be",
"read",
"by",
"this",
"library",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hive/src/main/java/org/kitesdk/data/spi/hive/HiveAbstractMetadataProvider.java#L216-L234 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java | PackageManagerUtils.getReceiverPackageInfo | public static PackageInfo getReceiverPackageInfo(Context context, String targetPackage) throws NameNotFoundException {
"""
Get the {@link android.content.pm.PackageInfo} that contains broadcast receiver declaration for the context.
@param context the context.
@param targetPackage the target package name.
@retur... | java | public static PackageInfo getReceiverPackageInfo(Context context, String targetPackage) throws NameNotFoundException {
PackageManager manager = context.getPackageManager();
return manager.getPackageInfo(targetPackage, PackageManager.GET_RECEIVERS);
} | [
"public",
"static",
"PackageInfo",
"getReceiverPackageInfo",
"(",
"Context",
"context",
",",
"String",
"targetPackage",
")",
"throws",
"NameNotFoundException",
"{",
"PackageManager",
"manager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"return",
"manage... | Get the {@link android.content.pm.PackageInfo} that contains broadcast receiver declaration for the context.
@param context the context.
@param targetPackage the target package name.
@return the {@link android.content.pm.PackageInfo}.
@throws NameNotFoundException if no package found. | [
"Get",
"the",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java#L242-L245 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedParametersMap | public static Map<String, QueryParameter> getUsedParametersMap(String sql, Map<String, QueryParameter> allParameters) {
"""
Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The res... | java | public static Map<String, QueryParameter> getUsedParametersMap(String sql, Map<String, QueryParameter> allParameters) {
Query query = new Query(sql);
return getUsedParametersMap(query, allParameters);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedParametersMap",
"(",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"allParameters",
")",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
"sql",
")",
";... | Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will contain also the hidden parameters.
@param sql sql
@param allParameters parameters map
@return used parameters ... | [
"Get",
"used",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
"defined",
... | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L789-L792 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java | AbstractPropertyEditor.createPropertyEditor | public static <D extends BioPAXElement, R> PropertyEditor<D, R> createPropertyEditor(Class<D> domain,
String property) {
"""
This method creates a property reflecting on the domain and property. Proper subclass is chosen
based o... | java | public static <D extends BioPAXElement, R> PropertyEditor<D, R> createPropertyEditor(Class<D> domain,
String property)
{
PropertyEditor editor = null;
try
{
Method getMethod = detectGetMethod(domain, property);
boolean mu... | [
"public",
"static",
"<",
"D",
"extends",
"BioPAXElement",
",",
"R",
">",
"PropertyEditor",
"<",
"D",
",",
"R",
">",
"createPropertyEditor",
"(",
"Class",
"<",
"D",
">",
"domain",
",",
"String",
"property",
")",
"{",
"PropertyEditor",
"editor",
"=",
"null",... | This method creates a property reflecting on the domain and property. Proper subclass is chosen
based on the range of the property.
@param domain paxtools level2 interface that maps to the corresponding owl level2.
@param property to be managed by the constructed controller.
@param <D> domain
@param <R> range
@return a... | [
"This",
"method",
"creates",
"a",
"property",
"reflecting",
"on",
"the",
"domain",
"and",
"property",
".",
"Proper",
"subclass",
"is",
"chosen",
"based",
"on",
"the",
"range",
"of",
"the",
"property",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/AbstractPropertyEditor.java#L120-L149 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/UnionFindRemSP.java | UnionFindRemSP.union | @Override
public boolean union(int x, int y) {
"""
Unites the sets containing the two given elements.
@param x
the first element
@param y
the second element
"""
int rx = x;
int ry = y;
int px = p[rx];
int py = p[ry];
while (px != py) {
if (px < py) ... | java | @Override
public boolean union(int x, int y) {
int rx = x;
int ry = y;
int px = p[rx];
int py = p[ry];
while (px != py) {
if (px < py) {
if (rx == px) {
p[rx] = py;
return true;
}
... | [
"@",
"Override",
"public",
"boolean",
"union",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"rx",
"=",
"x",
";",
"int",
"ry",
"=",
"y",
";",
"int",
"px",
"=",
"p",
"[",
"rx",
"]",
";",
"int",
"py",
"=",
"p",
"[",
"ry",
"]",
";",
"wh... | Unites the sets containing the two given elements.
@param x
the first element
@param y
the second element | [
"Unites",
"the",
"sets",
"containing",
"the",
"two",
"given",
"elements",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/UnionFindRemSP.java#L101-L127 |
dodie/scott | scott/src/main/java/hu/advancedweb/scott/instrumentation/transformation/ScopeExtractorMethodVisitor.java | ScopeExtractorMethodVisitor.calculateScope | private LocalVariableScope calculateScope(LocalVariableScopeData scope) {
"""
Calculate the start and end line numbers for variable scopes. If the
LocalVariableScope start line is 0, then it is an input parameter, as
it's scope start label appeared before the method body.
"""
final TryCatchBlockLabels encl... | java | private LocalVariableScope calculateScope(LocalVariableScopeData scope) {
final TryCatchBlockLabels enclosingTry = getEnclosingTry(scope);
final Label start = scope.labels.start;
final Label end = getTryFixedEndLabel(scope, enclosingTry);
int startIndex = getIndex(start);
int endIndex = getIndex(end);
... | [
"private",
"LocalVariableScope",
"calculateScope",
"(",
"LocalVariableScopeData",
"scope",
")",
"{",
"final",
"TryCatchBlockLabels",
"enclosingTry",
"=",
"getEnclosingTry",
"(",
"scope",
")",
";",
"final",
"Label",
"start",
"=",
"scope",
".",
"labels",
".",
"start",... | Calculate the start and end line numbers for variable scopes. If the
LocalVariableScope start line is 0, then it is an input parameter, as
it's scope start label appeared before the method body. | [
"Calculate",
"the",
"start",
"and",
"end",
"line",
"numbers",
"for",
"variable",
"scopes",
".",
"If",
"the",
"LocalVariableScope",
"start",
"line",
"is",
"0",
"then",
"it",
"is",
"an",
"input",
"parameter",
"as",
"it",
"s",
"scope",
"start",
"label",
"appe... | train | https://github.com/dodie/scott/blob/fd6b492584d3ae7e072871ff2b094cce6041fc99/scott/src/main/java/hu/advancedweb/scott/instrumentation/transformation/ScopeExtractorMethodVisitor.java#L149-L160 |
bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/util/CredentialEncrypter.java | CredentialEncrypter.decryptString | public String decryptString(String encryptedCredentials) {
"""
Recovers the plaintext String from the encrypted value returned by {@link #encryptString(String)}.
"""
byte[] plaintextBytes = decryptBytes(encryptedCredentials);
return new String(plaintextBytes, Charsets.UTF_8);
} | java | public String decryptString(String encryptedCredentials) {
byte[] plaintextBytes = decryptBytes(encryptedCredentials);
return new String(plaintextBytes, Charsets.UTF_8);
} | [
"public",
"String",
"decryptString",
"(",
"String",
"encryptedCredentials",
")",
"{",
"byte",
"[",
"]",
"plaintextBytes",
"=",
"decryptBytes",
"(",
"encryptedCredentials",
")",
";",
"return",
"new",
"String",
"(",
"plaintextBytes",
",",
"Charsets",
".",
"UTF_8",
... | Recovers the plaintext String from the encrypted value returned by {@link #encryptString(String)}. | [
"Recovers",
"the",
"plaintext",
"String",
"from",
"the",
"encrypted",
"value",
"returned",
"by",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/util/CredentialEncrypter.java#L139-L142 |
threerings/nenya | core/src/main/java/com/threerings/media/AbstractMediaManager.java | AbstractMediaManager.insertMedia | protected boolean insertMedia (AbstractMedia media) {
"""
Inserts the specified media into this manager, return true on success.
"""
if (_media.contains(media)) {
log.warning("Attempt to insert media more than once [media=" + media + "].",
new Exception());
... | java | protected boolean insertMedia (AbstractMedia media)
{
if (_media.contains(media)) {
log.warning("Attempt to insert media more than once [media=" + media + "].",
new Exception());
return false;
}
media.init(this);
int ipos = _media.inse... | [
"protected",
"boolean",
"insertMedia",
"(",
"AbstractMedia",
"media",
")",
"{",
"if",
"(",
"_media",
".",
"contains",
"(",
"media",
")",
")",
"{",
"log",
".",
"warning",
"(",
"\"Attempt to insert media more than once [media=\"",
"+",
"media",
"+",
"\"].\"",
",",... | Inserts the specified media into this manager, return true on success. | [
"Inserts",
"the",
"specified",
"media",
"into",
"this",
"manager",
"return",
"true",
"on",
"success",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMediaManager.java#L189-L217 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/CaffeineCacheMetrics.java | CaffeineCacheMetrics.monitor | public static <C extends Cache<?, ?>> C monitor(MeterRegistry registry, C cache, String cacheName, Iterable<Tag> tags) {
"""
Record metrics on a Caffeine cache. You must call {@link Caffeine#recordStats()} prior to building the cache
for metrics to be recorded.
@param registry The registry to bind metrics to.... | java | public static <C extends Cache<?, ?>> C monitor(MeterRegistry registry, C cache, String cacheName, Iterable<Tag> tags) {
new CaffeineCacheMetrics(cache, cacheName, tags).bindTo(registry);
return cache;
} | [
"public",
"static",
"<",
"C",
"extends",
"Cache",
"<",
"?",
",",
"?",
">",
">",
"C",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"C",
"cache",
",",
"String",
"cacheName",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"new",
"CaffeineCacheMe... | Record metrics on a Caffeine cache. You must call {@link Caffeine#recordStats()} prior to building the cache
for metrics to be recorded.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param cacheName Will be used to tag metrics with "cache".
@param tags Tags to apply ... | [
"Record",
"metrics",
"on",
"a",
"Caffeine",
"cache",
".",
"You",
"must",
"call",
"{",
"@link",
"Caffeine#recordStats",
"()",
"}",
"prior",
"to",
"building",
"the",
"cache",
"for",
"metrics",
"to",
"be",
"recorded",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/cache/CaffeineCacheMetrics.java#L83-L86 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/writer/ThrottleWriter.java | ThrottleWriter.writeEnvelope | @Override
public void writeEnvelope(RecordEnvelope<D> record) throws IOException {
"""
Calls inner writer with self throttling.
If the throttle type is byte, it applies throttle after write happens.
This is because it can figure out written bytes after it's written. It's not ideal but throttling after write sh... | java | @Override
public void writeEnvelope(RecordEnvelope<D> record) throws IOException {
try {
if (ThrottleType.QPS.equals(type)) {
acquirePermits(1L);
}
long beforeWrittenBytes = writer.bytesWritten();
writer.writeEnvelope(record);
if (ThrottleType.Bytes.equals(type)) {
l... | [
"@",
"Override",
"public",
"void",
"writeEnvelope",
"(",
"RecordEnvelope",
"<",
"D",
">",
"record",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"ThrottleType",
".",
"QPS",
".",
"equals",
"(",
"type",
")",
")",
"{",
"acquirePermits",
"(",
"1... | Calls inner writer with self throttling.
If the throttle type is byte, it applies throttle after write happens.
This is because it can figure out written bytes after it's written. It's not ideal but throttling after write should be sufficient for most cases.
{@inheritDoc}
@see org.apache.gobblin.writer.DataWriter#write... | [
"Calls",
"inner",
"writer",
"with",
"self",
"throttling",
".",
"If",
"the",
"throttle",
"type",
"is",
"byte",
"it",
"applies",
"throttle",
"after",
"write",
"happens",
".",
"This",
"is",
"because",
"it",
"can",
"figure",
"out",
"written",
"bytes",
"after",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/writer/ThrottleWriter.java#L124-L147 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/datasources/SparqlDataSource.java | SparqlDataSource.runQuery | public SparqlResult runQuery(String endpoint, String query) {
"""
An extension point so we can control how the query gets executed.
This exists for testing purposes, not because we believe it will
actually be used for real.
"""
return SparqlClient.execute(endpoint, query, username, password);
} | java | public SparqlResult runQuery(String endpoint, String query) {
return SparqlClient.execute(endpoint, query, username, password);
} | [
"public",
"SparqlResult",
"runQuery",
"(",
"String",
"endpoint",
",",
"String",
"query",
")",
"{",
"return",
"SparqlClient",
".",
"execute",
"(",
"endpoint",
",",
"query",
",",
"username",
",",
"password",
")",
";",
"}"
] | An extension point so we can control how the query gets executed.
This exists for testing purposes, not because we believe it will
actually be used for real. | [
"An",
"extension",
"point",
"so",
"we",
"can",
"control",
"how",
"the",
"query",
"gets",
"executed",
".",
"This",
"exists",
"for",
"testing",
"purposes",
"not",
"because",
"we",
"believe",
"it",
"will",
"actually",
"be",
"used",
"for",
"real",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/datasources/SparqlDataSource.java#L123-L125 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.sealStream | public CompletableFuture<UpdateStreamStatus.Status> sealStream(String scope, String stream, OperationContext contextOpt) {
"""
Seal a stream.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@return update status.
"""
final OperationContext context = cont... | java | public CompletableFuture<UpdateStreamStatus.Status> sealStream(String scope, String stream, OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
final long requestId = requestTracker.getRequestIdFor("sealStrea... | [
"public",
"CompletableFuture",
"<",
"UpdateStreamStatus",
".",
"Status",
">",
"sealStream",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"context",
"=",
"contextOpt",
"==",
"null",
"... | Seal a stream.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@return update status. | [
"Seal",
"a",
"stream",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L440-L469 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/DisableBehOnFieldHandler.java | DisableBehOnFieldHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int moveMode) {
"""
The Field has Changed.
Enable/disable the target listener if this field now matches the target string.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (... | java | public int fieldChanged(boolean bDisplayOption, int moveMode)
{
boolean flag = !(this.getOwner().getString().equals(m_strDisableOnMatch));
if (!m_bDisableIfMatch)
flag = !flag;
m_listenerToDisable.setEnabledListener(flag);
return DBConstants.NORMAL_RETURN;
} | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"boolean",
"flag",
"=",
"!",
"(",
"this",
".",
"getOwner",
"(",
")",
".",
"getString",
"(",
")",
".",
"equals",
"(",
"m_strDisableOnMatch",
")",
")",
";"... | The Field has Changed.
Enable/disable the target listener if this field now matches the target string.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"The",
"Field",
"has",
"Changed",
".",
"Enable",
"/",
"disable",
"the",
"target",
"listener",
"if",
"this",
"field",
"now",
"matches",
"the",
"target",
"string",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/DisableBehOnFieldHandler.java#L108-L115 |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.alertEquals | public void alertEquals(double seconds, String expectedAlertText) {
"""
Waits up to the provided wait time for an alert present on the page has content equal to the
expected text. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param expectedAlert... | java | public void alertEquals(double seconds, String expectedAlertText) {
try {
double timeTook = popup(seconds);
timeTook = popupEquals(seconds - timeTook, expectedAlertText);
checkAlertEquals(expectedAlertText, seconds, timeTook);
} catch (TimeoutException e) {
... | [
"public",
"void",
"alertEquals",
"(",
"double",
"seconds",
",",
"String",
"expectedAlertText",
")",
"{",
"try",
"{",
"double",
"timeTook",
"=",
"popup",
"(",
"seconds",
")",
";",
"timeTook",
"=",
"popupEquals",
"(",
"seconds",
"-",
"timeTook",
",",
"expected... | Waits up to the provided wait time for an alert present on the page has content equal to the
expected text. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param expectedAlertText the expected text of the alert
@param seconds the number of second... | [
"Waits",
"up",
"to",
"the",
"provided",
"wait",
"time",
"for",
"an",
"alert",
"present",
"on",
"the",
"page",
"has",
"content",
"equal",
"to",
"the",
"expected",
"text",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L492-L500 |
apereo/cas | support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/login/TicketGrantingTicketCheckAction.java | TicketGrantingTicketCheckAction.doExecute | @Override
public Event doExecute(final RequestContext requestContext) {
"""
Determines whether the TGT in the flow request context is valid.
@param requestContext Flow request context.
@return webflow transition to indicate TGT status.
"""
val tgtId = WebUtils.getTicketGrantingTicketId(requestC... | java | @Override
public Event doExecute(final RequestContext requestContext) {
val tgtId = WebUtils.getTicketGrantingTicketId(requestContext);
if (StringUtils.isBlank(tgtId)) {
return new Event(this, CasWebflowConstants.TRANSITION_ID_TGT_NOT_EXISTS);
}
try {
val tick... | [
"@",
"Override",
"public",
"Event",
"doExecute",
"(",
"final",
"RequestContext",
"requestContext",
")",
"{",
"val",
"tgtId",
"=",
"WebUtils",
".",
"getTicketGrantingTicketId",
"(",
"requestContext",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"tgtId... | Determines whether the TGT in the flow request context is valid.
@param requestContext Flow request context.
@return webflow transition to indicate TGT status. | [
"Determines",
"whether",
"the",
"TGT",
"in",
"the",
"flow",
"request",
"context",
"is",
"valid",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/login/TicketGrantingTicketCheckAction.java#L35-L50 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.getExample | public final Example getExample(String name, String filter) {
"""
Gets an example by resource name, including both data and annotation.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClie... | java | public final Example getExample(String name, String filter) {
EXAMPLE_PATH_TEMPLATE.validate(name, "getExample");
GetExampleRequest request =
GetExampleRequest.newBuilder().setName(name).setFilter(filter).build();
return getExample(request);
} | [
"public",
"final",
"Example",
"getExample",
"(",
"String",
"name",
",",
"String",
"filter",
")",
"{",
"EXAMPLE_PATH_TEMPLATE",
".",
"validate",
"(",
"name",
",",
"\"getExample\"",
")",
";",
"GetExampleRequest",
"request",
"=",
"GetExampleRequest",
".",
"newBuilder... | Gets an example by resource name, including both data and annotation.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMP... | [
"Gets",
"an",
"example",
"by",
"resource",
"name",
"including",
"both",
"data",
"and",
"annotation",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L1916-L1921 |
qos-ch/slf4j | slf4j-api/src/main/java/org/slf4j/MDC.java | MDC.setContextMap | public static void setContextMap(Map<String, String> contextMap) {
"""
Set the current thread's context map by first clearing any existing map and
then copying the map passed as parameter. The context map passed as
parameter must only contain keys and values of type String.
@param contextMap
must contain onl... | java | public static void setContextMap(Map<String, String> contextMap) {
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
mdcAdapter.setContextMap(contextMap);
} | [
"public",
"static",
"void",
"setContextMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"contextMap",
")",
"{",
"if",
"(",
"mdcAdapter",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"MDCAdapter cannot be null. See also \"",
"+",
"N... | Set the current thread's context map by first clearing any existing map and
then copying the map passed as parameter. The context map passed as
parameter must only contain keys and values of type String.
@param contextMap
must contain only keys and values of type String
@since 1.5.1 | [
"Set",
"the",
"current",
"thread",
"s",
"context",
"map",
"by",
"first",
"clearing",
"any",
"existing",
"map",
"and",
"then",
"copying",
"the",
"map",
"passed",
"as",
"parameter",
".",
"The",
"context",
"map",
"passed",
"as",
"parameter",
"must",
"only",
"... | train | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/MDC.java#L234-L239 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ConstraintAdapter.java | ConstraintAdapter.search | private boolean search(LinkedList<Control> list, Interaction inter) {
"""
Checks if the control chain is actually controlling the Interaction.
@param list the Control chain
@param inter target Interaction
@return true if the chain controls the Interaction
"""
if (list.getLast().getControlled().contains(in... | java | private boolean search(LinkedList<Control> list, Interaction inter)
{
if (list.getLast().getControlled().contains(inter)) return true;
for (Process process : list.getLast().getControlled())
{
if (process instanceof Control)
{
// prevent searching in cycles
if (list.contains(process)) continue;
... | [
"private",
"boolean",
"search",
"(",
"LinkedList",
"<",
"Control",
">",
"list",
",",
"Interaction",
"inter",
")",
"{",
"if",
"(",
"list",
".",
"getLast",
"(",
")",
".",
"getControlled",
"(",
")",
".",
"contains",
"(",
"inter",
")",
")",
"return",
"true... | Checks if the control chain is actually controlling the Interaction.
@param list the Control chain
@param inter target Interaction
@return true if the chain controls the Interaction | [
"Checks",
"if",
"the",
"control",
"chain",
"is",
"actually",
"controlling",
"the",
"Interaction",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ConstraintAdapter.java#L251-L268 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/io/gpio/OrangePiPin.java | OrangePiPin.createDigitalPin | protected static Pin createDigitalPin(int address, String name) {
"""
this pin is permanently pulled up; pin pull settings do not work
"""
return createDigitalPin(OrangePiGpioProvider.NAME, address, name);
} | java | protected static Pin createDigitalPin(int address, String name) {
return createDigitalPin(OrangePiGpioProvider.NAME, address, name);
} | [
"protected",
"static",
"Pin",
"createDigitalPin",
"(",
"int",
"address",
",",
"String",
"name",
")",
"{",
"return",
"createDigitalPin",
"(",
"OrangePiGpioProvider",
".",
"NAME",
",",
"address",
",",
"name",
")",
";",
"}"
] | this pin is permanently pulled up; pin pull settings do not work | [
"this",
"pin",
"is",
"permanently",
"pulled",
"up",
";",
"pin",
"pull",
"settings",
"do",
"not",
"work"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/io/gpio/OrangePiPin.java#L78-L80 |
Talend/tesb-rt-se | sam/sam-agent/src/main/java/org/talend/esb/sam/agent/flowidprocessor/FlowIdProducerOut.java | FlowIdProducerOut.handleINEvent | protected void handleINEvent(Exchange exchange, String reqFid) throws Fault {
"""
Calling EventProducerInterceptor in case of logging faults.
@param exchange
the message exchange
@param reqFid
the FlowId
@throws Fault
the fault
"""
Message inMsg = exchange.getInMessage();
EventProduc... | java | protected void handleINEvent(Exchange exchange, String reqFid) throws Fault {
Message inMsg = exchange.getInMessage();
EventProducerInterceptor epi = null;
FlowIdHelper.setFlowId(inMsg, reqFid);
ListIterator<Interceptor<? extends Message>> interceptors = inMsg
.getInter... | [
"protected",
"void",
"handleINEvent",
"(",
"Exchange",
"exchange",
",",
"String",
"reqFid",
")",
"throws",
"Fault",
"{",
"Message",
"inMsg",
"=",
"exchange",
".",
"getInMessage",
"(",
")",
";",
"EventProducerInterceptor",
"epi",
"=",
"null",
";",
"FlowIdHelper",... | Calling EventProducerInterceptor in case of logging faults.
@param exchange
the message exchange
@param reqFid
the FlowId
@throws Fault
the fault | [
"Calling",
"EventProducerInterceptor",
"in",
"case",
"of",
"logging",
"faults",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/sam/sam-agent/src/main/java/org/talend/esb/sam/agent/flowidprocessor/FlowIdProducerOut.java#L211-L228 |
domaframework/doma-gen | src/main/java/org/seasar/doma/extension/gen/GlobalFactory.java | GlobalFactory.createDaoDescFactory | public DaoDescFactory createDaoDescFactory(
String packageName, String suffix, String configClassName) {
"""
Dao記述のファクトリを作成します。
@param packageName パッケージ名
@param suffix サフィックス
@param configClassName 設定クラス名
@return Dao記述のファクトリ
@since 1.7.0
"""
return new DaoDescFactory(packageName, suffix, confi... | java | public DaoDescFactory createDaoDescFactory(
String packageName, String suffix, String configClassName) {
return new DaoDescFactory(packageName, suffix, configClassName);
} | [
"public",
"DaoDescFactory",
"createDaoDescFactory",
"(",
"String",
"packageName",
",",
"String",
"suffix",
",",
"String",
"configClassName",
")",
"{",
"return",
"new",
"DaoDescFactory",
"(",
"packageName",
",",
"suffix",
",",
"configClassName",
")",
";",
"}"
] | Dao記述のファクトリを作成します。
@param packageName パッケージ名
@param suffix サフィックス
@param configClassName 設定クラス名
@return Dao記述のファクトリ
@since 1.7.0 | [
"Dao記述のファクトリを作成します。"
] | train | https://github.com/domaframework/doma-gen/blob/8046e0b28d2167d444125f206ce36e554b3ee616/src/main/java/org/seasar/doma/extension/gen/GlobalFactory.java#L153-L156 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java | Items.makeCondItem | CondItem makeCondItem(int opcode, Chain trueJumps, Chain falseJumps) {
"""
Make an item representing a conditional or unconditional jump.
@param opcode The jump's opcode.
@param trueJumps A chain encomassing all jumps that can be taken
if the condition evaluates to true.
@param falseJumps A chain encom... | java | CondItem makeCondItem(int opcode, Chain trueJumps, Chain falseJumps) {
return new CondItem(opcode, trueJumps, falseJumps);
} | [
"CondItem",
"makeCondItem",
"(",
"int",
"opcode",
",",
"Chain",
"trueJumps",
",",
"Chain",
"falseJumps",
")",
"{",
"return",
"new",
"CondItem",
"(",
"opcode",
",",
"trueJumps",
",",
"falseJumps",
")",
";",
"}"
] | Make an item representing a conditional or unconditional jump.
@param opcode The jump's opcode.
@param trueJumps A chain encomassing all jumps that can be taken
if the condition evaluates to true.
@param falseJumps A chain encomassing all jumps that can be taken
if the condition evaluates to false. | [
"Make",
"an",
"item",
"representing",
"a",
"conditional",
"or",
"unconditional",
"jump",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java#L180-L182 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/datastyle/NumberStyleHelper.java | NumberStyleHelper.appendStyleColor | private void appendStyleColor(final XMLUtil util, final Appendable appendable) throws IOException {
"""
Appends the style color.
@param util XML util
@param appendable where to write
@throws IOException If an I/O error occurs
"""
appendable.append("<style:text-properties");
util.appe... | java | private void appendStyleColor(final XMLUtil util, final Appendable appendable) throws IOException {
appendable.append("<style:text-properties");
util.appendAttribute(appendable, "fo:color", this.negativeValueColor.hexValue());
appendable.append("/>");
} | [
"private",
"void",
"appendStyleColor",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"appendable",
".",
"append",
"(",
"\"<style:text-properties\"",
")",
";",
"util",
".",
"appendAttribute",
"(",
"app... | Appends the style color.
@param util XML util
@param appendable where to write
@throws IOException If an I/O error occurs | [
"Appends",
"the",
"style",
"color",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/datastyle/NumberStyleHelper.java#L131-L135 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dropMenu/DropMenuRenderer.java | DropMenuRenderer.encodeDropMenuStart | public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
"""
Renders the Drop Menu.
@param c
@param rw
@param l
@throws IOException
"""
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentC... | java | public static void encodeDropMenuStart(DropMenu c, ResponseWriter rw, String l) throws IOException {
rw.startElement("ul", c);
if (c.getContentClass() != null)
rw.writeAttribute("class", "dropdown-menu " + c.getContentClass(), "class");
else
rw.writeAttribute("class", "dropdown-menu", "class");
if (null !... | [
"public",
"static",
"void",
"encodeDropMenuStart",
"(",
"DropMenu",
"c",
",",
"ResponseWriter",
"rw",
",",
"String",
"l",
")",
"throws",
"IOException",
"{",
"rw",
".",
"startElement",
"(",
"\"ul\"",
",",
"c",
")",
";",
"if",
"(",
"c",
".",
"getContentClass... | Renders the Drop Menu.
@param c
@param rw
@param l
@throws IOException | [
"Renders",
"the",
"Drop",
"Menu",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dropMenu/DropMenuRenderer.java#L210-L220 |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/CreatePlatformApplicationRequest.java | CreatePlatformApplicationRequest.withAttributes | public CreatePlatformApplicationRequest withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html"
>SetPlatformApplicationAttributes</a>
</p>
@param attributes
For a list of ... | java | public CreatePlatformApplicationRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"CreatePlatformApplicationRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html"
>SetPlatformApplicationAttributes</a>
</p>
@param attributes
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html"
>Set... | [
"<p",
">",
"For",
"a",
"list",
"of",
"attributes",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"sns",
"/",
"latest",
"/",
"api",
"/",
"API_SetPlatformApplicationAttributes",
".",
"html",
">",
"SetPl... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/CreatePlatformApplicationRequest.java#L196-L199 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/CheckSumUtils.java | CheckSumUtils.getMD5Checksum | public static String getMD5Checksum(String str, Charset charset) throws IOException {
"""
Returns the MD5 Checksum of the string passed in parameter
@param str
the string content
@param charset
the content charset
@return the Checksum of the input stream
@throws IOException
if an IO exception occurs
... | java | public static String getMD5Checksum(String str, Charset charset) throws IOException {
InputStream is = new ByteArrayInputStream(str.getBytes(charset.name()));
return getMD5Checksum(is);
} | [
"public",
"static",
"String",
"getMD5Checksum",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"(",
"str",
".",
"getBytes",
"(",
"charset",
".",
"name",
"(",
")",
"... | Returns the MD5 Checksum of the string passed in parameter
@param str
the string content
@param charset
the content charset
@return the Checksum of the input stream
@throws IOException
if an IO exception occurs | [
"Returns",
"the",
"MD5",
"Checksum",
"of",
"the",
"string",
"passed",
"in",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/CheckSumUtils.java#L188-L192 |
recommenders/rival | rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/RecommendationRunner.java | RecommendationRunner.writeStats | public static void writeStats(final String path, final String statLabel, final long stat) {
"""
Write the system stats to file.
@param path the path to write to
@param statLabel what statistics is being written
@param stat the value
"""
BufferedWriter out = null;
try {
out = ne... | java | public static void writeStats(final String path, final String statLabel, final long stat) {
BufferedWriter out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path, true), "UTF-8"));
out.write(statLabel + "\t" + stat + "\n");
out.flu... | [
"public",
"static",
"void",
"writeStats",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"statLabel",
",",
"final",
"long",
"stat",
")",
"{",
"BufferedWriter",
"out",
"=",
"null",
";",
"try",
"{",
"out",
"=",
"new",
"BufferedWriter",
"(",
"new",
... | Write the system stats to file.
@param path the path to write to
@param statLabel what statistics is being written
@param stat the value | [
"Write",
"the",
"system",
"stats",
"to",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/RecommendationRunner.java#L208-L226 |
logic-ng/LogicNG | src/main/java/org/logicng/backbones/BackboneGeneration.java | BackboneGeneration.computeNegative | public static Backbone computeNegative(final Collection<Formula> formulas) {
"""
Computes the negative backbone variables for a given collection of formulas.
@param formulas the given collection of formulas
@return the negative backbone or {@code null} if the formula is UNSAT
"""
return compute(formu... | java | public static Backbone computeNegative(final Collection<Formula> formulas) {
return compute(formulas, allVariablesInFormulas(formulas), BackboneType.ONLY_NEGATIVE);
} | [
"public",
"static",
"Backbone",
"computeNegative",
"(",
"final",
"Collection",
"<",
"Formula",
">",
"formulas",
")",
"{",
"return",
"compute",
"(",
"formulas",
",",
"allVariablesInFormulas",
"(",
"formulas",
")",
",",
"BackboneType",
".",
"ONLY_NEGATIVE",
")",
"... | Computes the negative backbone variables for a given collection of formulas.
@param formulas the given collection of formulas
@return the negative backbone or {@code null} if the formula is UNSAT | [
"Computes",
"the",
"negative",
"backbone",
"variables",
"for",
"a",
"given",
"collection",
"of",
"formulas",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L211-L213 |
app55/app55-java | src/support/java/com/googlecode/openbeans/beancontext/BeanContextServicesSupport.java | BeanContextServicesSupport.releaseService | public void releaseService(BeanContextChild child, Object requestor, Object service) {
"""
Release a service which has been requested previously.
@param child
the child that request the service
@param requestor
the requestor object
@param service
the service instance
@throws IllegalArgumentException
if <... | java | public void releaseService(BeanContextChild child, Object requestor, Object service)
{
if (child == null || requestor == null || service == null)
{
throw new NullPointerException();
}
synchronized (globalHierarchyLock)
{
BCSSChild bcssChild;
synchronized (children)
{
bcssChild = (BCSSChild) ... | [
"public",
"void",
"releaseService",
"(",
"BeanContextChild",
"child",
",",
"Object",
"requestor",
",",
"Object",
"service",
")",
"{",
"if",
"(",
"child",
"==",
"null",
"||",
"requestor",
"==",
"null",
"||",
"service",
"==",
"null",
")",
"{",
"throw",
"new"... | Release a service which has been requested previously.
@param child
the child that request the service
@param requestor
the requestor object
@param service
the service instance
@throws IllegalArgumentException
if <code>child</code> is not a child of this context | [
"Release",
"a",
"service",
"which",
"has",
"been",
"requested",
"previously",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/beancontext/BeanContextServicesSupport.java#L824-L845 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java | CouchDBSchemaManager.checkForDBExistence | private boolean checkForDBExistence() throws ClientProtocolException, IOException, URISyntaxException {
"""
Check for db existence.
@return true, if successful
@throws ClientProtocolException
the client protocol exception
@throws IOException
Signals that an I/O exception has occurred.
@throws URISyntaxExce... | java | private boolean checkForDBExistence() throws ClientProtocolException, IOException, URISyntaxException
{
URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase(), null, null);
HttpGet ge... | [
"private",
"boolean",
"checkForDBExistence",
"(",
")",
"throws",
"ClientProtocolException",
",",
"IOException",
",",
"URISyntaxException",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"(",
"CouchDBConstants",
".",
"PROTOCOL",
",",
"null",
",",
"httpHost",
".",
"getHostNa... | Check for db existence.
@return true, if successful
@throws ClientProtocolException
the client protocol exception
@throws IOException
Signals that an I/O exception has occurred.
@throws URISyntaxException
the URI syntax exception | [
"Check",
"for",
"db",
"existence",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java#L716-L737 |
triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/expectations/AbstractExpectationManager.java | AbstractExpectationManager.unsetExpectation | protected synchronized boolean unsetExpectation(final AbstractExpectation<C, P> expectation) {
"""
Stop tracking this expectation. Calls from the internal code only.
@param expectation
The expectation to stop.
@return If stopped, false if stopped already.
"""
if (this.expectations.containsKey(expe... | java | protected synchronized boolean unsetExpectation(final AbstractExpectation<C, P> expectation) {
if (this.expectations.containsKey(expectation)) {
this.expectations.remove(expectation);
AbstractExpectationManager.LOGGER.info("Unregistered expectation {}.", expectation);
return ... | [
"protected",
"synchronized",
"boolean",
"unsetExpectation",
"(",
"final",
"AbstractExpectation",
"<",
"C",
",",
"P",
">",
"expectation",
")",
"{",
"if",
"(",
"this",
".",
"expectations",
".",
"containsKey",
"(",
"expectation",
")",
")",
"{",
"this",
".",
"ex... | Stop tracking this expectation. Calls from the internal code only.
@param expectation
The expectation to stop.
@return If stopped, false if stopped already. | [
"Stop",
"tracking",
"this",
"expectation",
".",
"Calls",
"from",
"the",
"internal",
"code",
"only",
"."
] | train | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/expectations/AbstractExpectationManager.java#L109-L116 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.hexDump | public static String hexDump(ByteBuf buffer, int fromIndex, int length) {
"""
Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a>
of the specified buffer's sub-region.
"""
return HexUtil.hexDump(buffer, fromIndex, length);
} | java | public static String hexDump(ByteBuf buffer, int fromIndex, int length) {
return HexUtil.hexDump(buffer, fromIndex, length);
} | [
"public",
"static",
"String",
"hexDump",
"(",
"ByteBuf",
"buffer",
",",
"int",
"fromIndex",
",",
"int",
"length",
")",
"{",
"return",
"HexUtil",
".",
"hexDump",
"(",
"buffer",
",",
"fromIndex",
",",
"length",
")",
";",
"}"
] | Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a>
of the specified buffer's sub-region. | [
"Returns",
"a",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Hex_dump",
">",
"hex",
"dump<",
"/",
"a",
">",
"of",
"the",
"specified",
"buffer",
"s",
"sub",
"-",
"region",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L121-L123 |
google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/RawTextContextUpdater.java | RawTextContextUpdater.makeDivPreceder | private static Transition makeDivPreceder(String literal) {
"""
Matches a portion of JavaScript that can precede a division operator.
"""
return new Transition(literal) {
@Override
Context computeNextContext(Context prior, Matcher matcher) {
return prior
.toBuilder()
... | java | private static Transition makeDivPreceder(String literal) {
return new Transition(literal) {
@Override
Context computeNextContext(Context prior, Matcher matcher) {
return prior
.toBuilder()
.withState(HtmlContext.JS)
.withSlashType(Context.JsFollowingSlash.DIV... | [
"private",
"static",
"Transition",
"makeDivPreceder",
"(",
"String",
"literal",
")",
"{",
"return",
"new",
"Transition",
"(",
"literal",
")",
"{",
"@",
"Override",
"Context",
"computeNextContext",
"(",
"Context",
"prior",
",",
"Matcher",
"matcher",
")",
"{",
"... | Matches a portion of JavaScript that can precede a division operator. | [
"Matches",
"a",
"portion",
"of",
"JavaScript",
"that",
"can",
"precede",
"a",
"division",
"operator",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/RawTextContextUpdater.java#L619-L630 |
inkstand-io/scribble | scribble-file/src/main/java/io/inkstand/scribble/rules/TemporaryZipFile.java | TemporaryZipFile.addResource | private void addResource(final Path pathToFile, final URL resource) throws IOException {
"""
Adds a resource respectively it's content to the filesystem at the position specified by the pathToFile
@param pathToFile
the path to the file or folder to which the resource's content should be written
@param resourc... | java | private void addResource(final Path pathToFile, final URL resource) throws IOException {
if (resource == null) {
addFolder(pathToFile);
} else {
addEntry(pathToFile, resource);
}
} | [
"private",
"void",
"addResource",
"(",
"final",
"Path",
"pathToFile",
",",
"final",
"URL",
"resource",
")",
"throws",
"IOException",
"{",
"if",
"(",
"resource",
"==",
"null",
")",
"{",
"addFolder",
"(",
"pathToFile",
")",
";",
"}",
"else",
"{",
"addEntry",... | Adds a resource respectively it's content to the filesystem at the position specified by the pathToFile
@param pathToFile
the path to the file or folder to which the resource's content should be written
@param resource
the resource providing the content for the entry. If the resource is null, a folder will be created
... | [
"Adds",
"a",
"resource",
"respectively",
"it",
"s",
"content",
"to",
"the",
"filesystem",
"at",
"the",
"position",
"specified",
"by",
"the",
"pathToFile"
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-file/src/main/java/io/inkstand/scribble/rules/TemporaryZipFile.java#L114-L121 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/MyStreamUtils.java | MyStreamUtils.streamHasText | public static boolean streamHasText(InputStream in, String text) {
"""
Checks if the InputStream have the text
@param in InputStream to read
@param text Text to check
@return whether the inputstream has the text
"""
final byte[] readBuffer = new byte[8192];
StringBuffer sb = new StringBuffer();
... | java | public static boolean streamHasText(InputStream in, String text) {
final byte[] readBuffer = new byte[8192];
StringBuffer sb = new StringBuffer();
try {
if (in.available() > 0) {
int bytesRead = 0;
while ((bytesRead = in.read(readBuffer)) != -1) {
sb.append(new String(readBu... | [
"public",
"static",
"boolean",
"streamHasText",
"(",
"InputStream",
"in",
",",
"String",
"text",
")",
"{",
"final",
"byte",
"[",
"]",
"readBuffer",
"=",
"new",
"byte",
"[",
"8192",
"]",
";",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";"... | Checks if the InputStream have the text
@param in InputStream to read
@param text Text to check
@return whether the inputstream has the text | [
"Checks",
"if",
"the",
"InputStream",
"have",
"the",
"text"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyStreamUtils.java#L89-L116 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.addLockElement | private void addLockElement(CmsRepositoryLockInfo lock, Element parent, String lockToken) {
"""
Generate a dom element from the given information with all needed subelements to
add to the parent.<p>
@param lock the lock with the information to create the subelements
@param parent the parent element where to a... | java | private void addLockElement(CmsRepositoryLockInfo lock, Element parent, String lockToken) {
Element activeLockElem = addElement(parent, TAG_ACTIVELOCK);
addElement(addElement(activeLockElem, TAG_LOCKTYPE), lock.getType());
addElement(addElement(activeLockElem, TAG_LOCKSCOPE), lock.getScope());
... | [
"private",
"void",
"addLockElement",
"(",
"CmsRepositoryLockInfo",
"lock",
",",
"Element",
"parent",
",",
"String",
"lockToken",
")",
"{",
"Element",
"activeLockElem",
"=",
"addElement",
"(",
"parent",
",",
"TAG_ACTIVELOCK",
")",
";",
"addElement",
"(",
"addElemen... | Generate a dom element from the given information with all needed subelements to
add to the parent.<p>
@param lock the lock with the information to create the subelements
@param parent the parent element where to add the created element
@param lockToken the lock token to use | [
"Generate",
"a",
"dom",
"element",
"from",
"the",
"given",
"information",
"with",
"all",
"needed",
"subelements",
"to",
"add",
"to",
"the",
"parent",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L2906-L2930 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/ResourceUtils.java | ResourceUtils.addFiles | public static void addFiles(final Project findBugsProject, File clzDir, final Pattern pat) {
"""
recurse add all the files matching given name pattern inside the given
directory and all subdirectories
"""
if (clzDir.isDirectory()) {
clzDir.listFiles(new FileCollector(pat, findBugsProject))... | java | public static void addFiles(final Project findBugsProject, File clzDir, final Pattern pat) {
if (clzDir.isDirectory()) {
clzDir.listFiles(new FileCollector(pat, findBugsProject));
}
} | [
"public",
"static",
"void",
"addFiles",
"(",
"final",
"Project",
"findBugsProject",
",",
"File",
"clzDir",
",",
"final",
"Pattern",
"pat",
")",
"{",
"if",
"(",
"clzDir",
".",
"isDirectory",
"(",
")",
")",
"{",
"clzDir",
".",
"listFiles",
"(",
"new",
"Fil... | recurse add all the files matching given name pattern inside the given
directory and all subdirectories | [
"recurse",
"add",
"all",
"the",
"files",
"matching",
"given",
"name",
"pattern",
"inside",
"the",
"given",
"directory",
"and",
"all",
"subdirectories"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/ResourceUtils.java#L107-L111 |
yanzhenjie/Album | album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java | AlbumUtils.randomMediaPath | @NonNull
private static String randomMediaPath(File bucket, String extension) {
"""
Generates a random file path using the specified suffix name in the specified directory.
@param bucket specify the directory.
@param extension extension.
@return file path.
"""
if (bucket.exists() && bucket.... | java | @NonNull
private static String randomMediaPath(File bucket, String extension) {
if (bucket.exists() && bucket.isFile()) bucket.delete();
if (!bucket.exists()) bucket.mkdirs();
String outFilePath = AlbumUtils.getNowDateTime("yyyyMMdd_HHmmssSSS") + "_" + getMD5ForString(UUID.randomUUID().toStr... | [
"@",
"NonNull",
"private",
"static",
"String",
"randomMediaPath",
"(",
"File",
"bucket",
",",
"String",
"extension",
")",
"{",
"if",
"(",
"bucket",
".",
"exists",
"(",
")",
"&&",
"bucket",
".",
"isFile",
"(",
")",
")",
"bucket",
".",
"delete",
"(",
")"... | Generates a random file path using the specified suffix name in the specified directory.
@param bucket specify the directory.
@param extension extension.
@return file path. | [
"Generates",
"a",
"random",
"file",
"path",
"using",
"the",
"specified",
"suffix",
"name",
"in",
"the",
"specified",
"directory",
"."
] | train | https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L252-L259 |
maestrano/maestrano-java | src/main/java/com/maestrano/net/ConnecClient.java | ConnecClient.getCollectionUrl | public String getCollectionUrl(String entityName, String groupId) {
"""
Return the url to the collection endpoint
@param entity
name
@param customerW
group id
@return collection url
"""
return connec.getHost() + getCollectionEndpoint(entityName, groupId);
} | java | public String getCollectionUrl(String entityName, String groupId) {
return connec.getHost() + getCollectionEndpoint(entityName, groupId);
} | [
"public",
"String",
"getCollectionUrl",
"(",
"String",
"entityName",
",",
"String",
"groupId",
")",
"{",
"return",
"connec",
".",
"getHost",
"(",
")",
"+",
"getCollectionEndpoint",
"(",
"entityName",
",",
"groupId",
")",
";",
"}"
] | Return the url to the collection endpoint
@param entity
name
@param customerW
group id
@return collection url | [
"Return",
"the",
"url",
"to",
"the",
"collection",
"endpoint"
] | train | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/ConnecClient.java#L78-L80 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/common/struct/ScheduledService.java | ScheduledService.start | public synchronized ScheduledService start() {
"""
开始执行定时任务
@return the boolean
@see ScheduledExecutorService#scheduleAtFixedRate(Runnable, long, long, TimeUnit)
@see ScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
"""
if (started) {
return this;
... | java | public synchronized ScheduledService start() {
if (started) {
return this;
}
if (scheduledExecutorService == null) {
scheduledExecutorService = new ScheduledThreadPoolExecutor(1,
new NamedThreadFactory(threadName, true));
}
ScheduledFuture ... | [
"public",
"synchronized",
"ScheduledService",
"start",
"(",
")",
"{",
"if",
"(",
"started",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"scheduledExecutorService",
"==",
"null",
")",
"{",
"scheduledExecutorService",
"=",
"new",
"ScheduledThreadPoolExecutor",
... | 开始执行定时任务
@return the boolean
@see ScheduledExecutorService#scheduleAtFixedRate(Runnable, long, long, TimeUnit)
@see ScheduledExecutorService#scheduleWithFixedDelay(Runnable, long, long, TimeUnit) | [
"开始执行定时任务"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/common/struct/ScheduledService.java#L127-L158 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java | PathChildrenCache.clearDataBytes | public boolean clearDataBytes(String fullPath, int ifVersion) {
"""
As a memory optimization, you can clear the cached data bytes for a node. Subsequent
calls to {@link ChildData#getData()} for this node will return <code>null</code>.
@param fullPath the path of the node to clear
@param ifVersion if non-nega... | java | public boolean clearDataBytes(String fullPath, int ifVersion)
{
ChildData data = currentData.get(fullPath);
if ( data != null )
{
if ( (ifVersion < 0) || (ifVersion == data.getStat().getVersion()) )
{
if ( data.getData() != null )
{
... | [
"public",
"boolean",
"clearDataBytes",
"(",
"String",
"fullPath",
",",
"int",
"ifVersion",
")",
"{",
"ChildData",
"data",
"=",
"currentData",
".",
"get",
"(",
"fullPath",
")",
";",
"if",
"(",
"data",
"!=",
"null",
")",
"{",
"if",
"(",
"(",
"ifVersion",
... | As a memory optimization, you can clear the cached data bytes for a node. Subsequent
calls to {@link ChildData#getData()} for this node will return <code>null</code>.
@param fullPath the path of the node to clear
@param ifVersion if non-negative, only clear the data if the data's version matches this version
@return ... | [
"As",
"a",
"memory",
"optimization",
"you",
"can",
"clear",
"the",
"cached",
"data",
"bytes",
"for",
"a",
"node",
".",
"Subsequent",
"calls",
"to",
"{",
"@link",
"ChildData#getData",
"()",
"}",
"for",
"this",
"node",
"will",
"return",
"<code",
">",
"null<"... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java#L444-L459 |
reapzor/FiloFirmata | src/main/java/com/bortbort/arduino/FiloFirmata/Parser/CommandParser.java | CommandParser.handleInputStream | public Message handleInputStream(byte commandByte, InputStream inputStream) {
"""
Attempts to identify the corresponding Firmata Message object that responds to the given commandByte
If found, it will ask for the message to be built using given inputStream. The builder will take away
any bytes necessary to build... | java | public Message handleInputStream(byte commandByte, InputStream inputStream) {
// Firmata command bytes are limited to a 0xF0 mask, or bytes 0xF0-0xFF
// The extra data in the byte is for routing the command to various 'midi channels'
// or in our case Firmata device pins.
byte firmat... | [
"public",
"Message",
"handleInputStream",
"(",
"byte",
"commandByte",
",",
"InputStream",
"inputStream",
")",
"{",
"// Firmata command bytes are limited to a 0xF0 mask, or bytes 0xF0-0xFF",
"// The extra data in the byte is for routing the command to various 'midi channels'",
"// or in... | Attempts to identify the corresponding Firmata Message object that responds to the given commandByte
If found, it will ask for the message to be built using given inputStream. The builder will take away
any bytes necessary to build the message and then return. To attempt to identify the correct message
we must mask the... | [
"Attempts",
"to",
"identify",
"the",
"corresponding",
"Firmata",
"Message",
"object",
"that",
"responds",
"to",
"the",
"given",
"commandByte",
"If",
"found",
"it",
"will",
"ask",
"for",
"the",
"message",
"to",
"be",
"built",
"using",
"given",
"inputStream",
".... | train | https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Parser/CommandParser.java#L126-L147 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.add | public static Date add(DateUnit dateUnit, int amount, Date date) {
"""
将指定日期加上指定的时长
@param dateUnit 单位
@param amount 时长
@param date 指定的日期
@return 增加指定时长后的日期
"""
return Date.from(date.toInstant().plus(amount, create(dateUnit)));
} | java | public static Date add(DateUnit dateUnit, int amount, Date date) {
return Date.from(date.toInstant().plus(amount, create(dateUnit)));
} | [
"public",
"static",
"Date",
"add",
"(",
"DateUnit",
"dateUnit",
",",
"int",
"amount",
",",
"Date",
"date",
")",
"{",
"return",
"Date",
".",
"from",
"(",
"date",
".",
"toInstant",
"(",
")",
".",
"plus",
"(",
"amount",
",",
"create",
"(",
"dateUnit",
"... | 将指定日期加上指定的时长
@param dateUnit 单位
@param amount 时长
@param date 指定的日期
@return 增加指定时长后的日期 | [
"将指定日期加上指定的时长"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L149-L151 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/topic/TopicManagerImpl.java | TopicManagerImpl.registerTopicSession | @Override
public int registerTopicSession(String topic, Session session) throws IllegalAccessException {
"""
Register session for topic
@param topic
@param session
@return int : number subscribers
@throws IllegalAccessException
"""
if (isInconsistenceContext(topic, session)) {
return 0;
}
... | java | @Override
public int registerTopicSession(String topic, Session session) throws IllegalAccessException {
if (isInconsistenceContext(topic, session)) {
return 0;
}
Collection<Session> sessions;
if (map.containsKey(topic)) {
sessions = map.get(topic);
} else {
sessions = Collections.synchroni... | [
"@",
"Override",
"public",
"int",
"registerTopicSession",
"(",
"String",
"topic",
",",
"Session",
"session",
")",
"throws",
"IllegalAccessException",
"{",
"if",
"(",
"isInconsistenceContext",
"(",
"topic",
",",
"session",
")",
")",
"{",
"return",
"0",
";",
"}"... | Register session for topic
@param topic
@param session
@return int : number subscribers
@throws IllegalAccessException | [
"Register",
"session",
"for",
"topic"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/TopicManagerImpl.java#L61-L79 |
alkacon/opencms-core | src/org/opencms/configuration/CmsDefaultUserSettings.java | CmsDefaultUserSettings.addPreference | public void addPreference(
String name,
String value,
String widget,
String widgetConfig,
String niceName,
String description,
String ruleRegex,
String error,
String tab) {
"""
Adds a preference.<p>
@param name the name of the preference
@... | java | public void addPreference(
String name,
String value,
String widget,
String widgetConfig,
String niceName,
String description,
String ruleRegex,
String error,
String tab) {
CmsXmlContentProperty prop = new CmsXmlContentProperty(
... | [
"public",
"void",
"addPreference",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"widget",
",",
"String",
"widgetConfig",
",",
"String",
"niceName",
",",
"String",
"description",
",",
"String",
"ruleRegex",
",",
"String",
"error",
",",
"String"... | Adds a preference.<p>
@param name the name of the preference
@param value the default value
@param widget the widget to use for the preference
@param widgetConfig the widget configuration
@param niceName the nice name of the preference
@param description the description of the preference
@param ruleRegex the regex use... | [
"Adds",
"a",
"preference",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsDefaultUserSettings.java#L223-L248 |
torakiki/event-studio | src/main/java/org/sejda/eventstudio/util/ReflectionUtils.java | ReflectionUtils.inferParameterClass | @SuppressWarnings("rawtypes")
public static Class inferParameterClass(Class clazz, String methodName) {
"""
Given a concrete class and a method name, it tries to infer the Class of the first parameter of the method
@param clazz
@param methodName
@return the class or null if nothing found
"""
M... | java | @SuppressWarnings("rawtypes")
public static Class inferParameterClass(Class clazz, String methodName) {
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.getName().equals(methodName) && !method.isBridge()) {
Type[] types = method.getGeneric... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"Class",
"inferParameterClass",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"clazz",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
... | Given a concrete class and a method name, it tries to infer the Class of the first parameter of the method
@param clazz
@param methodName
@return the class or null if nothing found | [
"Given",
"a",
"concrete",
"class",
"and",
"a",
"method",
"name",
"it",
"tries",
"to",
"infer",
"the",
"Class",
"of",
"the",
"first",
"parameter",
"of",
"the",
"method"
] | train | https://github.com/torakiki/event-studio/blob/2937b7ed28bb185a79b9cfb98c4de2eb37690a4a/src/main/java/org/sejda/eventstudio/util/ReflectionUtils.java#L42-L56 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.cloneActionState | public void cloneActionState(final ActionState source, final ActionState target) {
"""
Clone action state.
@param source the source
@param target the target
"""
source.getActionList().forEach(a -> target.getActionList().add(a));
source.getExitActionList().forEach(a -> target.getExitActionLi... | java | public void cloneActionState(final ActionState source, final ActionState target) {
source.getActionList().forEach(a -> target.getActionList().add(a));
source.getExitActionList().forEach(a -> target.getExitActionList().add(a));
source.getAttributes().asMap().forEach((k, v) -> target.getAttributes... | [
"public",
"void",
"cloneActionState",
"(",
"final",
"ActionState",
"source",
",",
"final",
"ActionState",
"target",
")",
"{",
"source",
".",
"getActionList",
"(",
")",
".",
"forEach",
"(",
"a",
"->",
"target",
".",
"getActionList",
"(",
")",
".",
"add",
"(... | Clone action state.
@param source the source
@param target the target | [
"Clone",
"action",
"state",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L642-L653 |
enioka/jqm | jqm-all/jqm-runner/jqm-runner-java/src/main/java/com/enioka/jqm/tools/LibraryResolverFS.java | LibraryResolverFS.shouldLoad | private boolean shouldLoad(Node node, JobDef jd) {
"""
Returns true if the libraries should be loaded in cache. Two cases: never loaded and should be reloaded (jar is more recent than
cache)
"""
if (!cache.containsKey(jd.getApplicationName()))
{
return true;
}
// If... | java | private boolean shouldLoad(Node node, JobDef jd)
{
if (!cache.containsKey(jd.getApplicationName()))
{
return true;
}
// If here: cache exists.
JobDefLibrary libs = cache.get(jd.getApplicationName());
// Is cache stale?
Date lastLoaded = libs.loadT... | [
"private",
"boolean",
"shouldLoad",
"(",
"Node",
"node",
",",
"JobDef",
"jd",
")",
"{",
"if",
"(",
"!",
"cache",
".",
"containsKey",
"(",
"jd",
".",
"getApplicationName",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"// If here: cache exists.",
"... | Returns true if the libraries should be loaded in cache. Two cases: never loaded and should be reloaded (jar is more recent than
cache) | [
"Returns",
"true",
"if",
"the",
"libraries",
"should",
"be",
"loaded",
"in",
"cache",
".",
"Two",
"cases",
":",
"never",
"loaded",
"and",
"should",
"be",
"reloaded",
"(",
"jar",
"is",
"more",
"recent",
"than",
"cache",
")"
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-runner/jqm-runner-java/src/main/java/com/enioka/jqm/tools/LibraryResolverFS.java#L91-L115 |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/impl/DiscoveredBdas.java | DiscoveredBdas.wireBdas | private void wireBdas(Collection<WebSphereBeanDeploymentArchive> wireFromBdas, Collection<WebSphereBeanDeploymentArchive> wireToBdas) {
"""
Make a wire from the group of bdas to a set of destination bdas
@param wireFromBdas the wiring from bda
@param wireToBdas the wiring destination bda
"""
for (W... | java | private void wireBdas(Collection<WebSphereBeanDeploymentArchive> wireFromBdas, Collection<WebSphereBeanDeploymentArchive> wireToBdas) {
for (WebSphereBeanDeploymentArchive wireFromBda : wireFromBdas) {
Collection<BeanDeploymentArchive> accessibleBdas = wireFromBda.getBeanDeploymentArchives();
... | [
"private",
"void",
"wireBdas",
"(",
"Collection",
"<",
"WebSphereBeanDeploymentArchive",
">",
"wireFromBdas",
",",
"Collection",
"<",
"WebSphereBeanDeploymentArchive",
">",
"wireToBdas",
")",
"{",
"for",
"(",
"WebSphereBeanDeploymentArchive",
"wireFromBda",
":",
"wireFrom... | Make a wire from the group of bdas to a set of destination bdas
@param wireFromBdas the wiring from bda
@param wireToBdas the wiring destination bda | [
"Make",
"a",
"wire",
"from",
"the",
"group",
"of",
"bdas",
"to",
"a",
"set",
"of",
"destination",
"bdas"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/impl/DiscoveredBdas.java#L139-L148 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java | CeCPMain.postProcessAlignment | public static AFPChain postProcessAlignment(AFPChain afpChain, Atom[] ca1, Atom[] ca2m,CECalculator calculator, CECPParameters param ) throws StructureException {
"""
Circular permutation specific code to be run after the standard CE alignment
@param afpChain The finished alignment
@param ca1 CA atoms of the f... | java | public static AFPChain postProcessAlignment(AFPChain afpChain, Atom[] ca1, Atom[] ca2m,CECalculator calculator, CECPParameters param ) throws StructureException{
// remove bottom half of the matrix
Matrix doubledMatrix = afpChain.getDistanceMatrix();
// the matrix can be null if the alignment is too short.
if... | [
"public",
"static",
"AFPChain",
"postProcessAlignment",
"(",
"AFPChain",
"afpChain",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2m",
",",
"CECalculator",
"calculator",
",",
"CECPParameters",
"param",
")",
"throws",
"StructureException",
"{",
"// rem... | Circular permutation specific code to be run after the standard CE alignment
@param afpChain The finished alignment
@param ca1 CA atoms of the first protein
@param ca2m A duplicated copy of the second protein
@param calculator The CECalculator used to create afpChain
@param param Parameters
@throws StructureException | [
"Circular",
"permutation",
"specific",
"code",
"to",
"be",
"run",
"after",
"the",
"standard",
"CE",
"alignment"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java#L204-L226 |
undertow-io/undertow | core/src/main/java/io/undertow/util/FlexBase64.java | FlexBase64.decodeURL | public static ByteBuffer decodeURL(byte[] source, int off, int limit) throws IOException {
"""
Decodes a Base64url encoded byte array into a new byte buffer. The returned byte buffer is a heap buffer,
and it is therefor possible to retrieve the backing array using {@link java.nio.ByteBuffer#array()},
{@link jav... | java | public static ByteBuffer decodeURL(byte[] source, int off, int limit) throws IOException {
return Decoder.decode(source, off, limit, true);
} | [
"public",
"static",
"ByteBuffer",
"decodeURL",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"limit",
")",
"throws",
"IOException",
"{",
"return",
"Decoder",
".",
"decode",
"(",
"source",
",",
"off",
",",
"limit",
",",
"true",
")",
";... | Decodes a Base64url encoded byte array into a new byte buffer. The returned byte buffer is a heap buffer,
and it is therefor possible to retrieve the backing array using {@link java.nio.ByteBuffer#array()},
{@link java.nio.ByteBuffer#arrayOffset()} and {@link java.nio.ByteBuffer#limit()}. The latter is very
important ... | [
"Decodes",
"a",
"Base64url",
"encoded",
"byte",
"array",
"into",
"a",
"new",
"byte",
"buffer",
".",
"The",
"returned",
"byte",
"buffer",
"is",
"a",
"heap",
"buffer",
"and",
"it",
"is",
"therefor",
"possible",
"to",
"retrieve",
"the",
"backing",
"array",
"u... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/FlexBase64.java#L385-L387 |
datasift/datasift-java | src/main/java/com/datasift/client/accounts/DataSiftAccount.java | DataSiftAccount.listLimits | public FutureData<LimitList> listLimits(String service, int page, int perPage) {
"""
/*
List limits for the given service
@param service which service you want to list the limits of
@param page page number (can be 0)
@param perPage items per page (can be 0)
@return List of identities
"""
i... | java | public FutureData<LimitList> listLimits(String service, int page, int perPage) {
if (service == null || service.isEmpty()) {
throw new IllegalArgumentException("A service is required");
}
FutureData<LimitList> future = new FutureData<>();
ParamBuilder b = newParams();
... | [
"public",
"FutureData",
"<",
"LimitList",
">",
"listLimits",
"(",
"String",
"service",
",",
"int",
"page",
",",
"int",
"perPage",
")",
"{",
"if",
"(",
"service",
"==",
"null",
"||",
"service",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"Illega... | /*
List limits for the given service
@param service which service you want to list the limits of
@param page page number (can be 0)
@param perPage items per page (can be 0)
@return List of identities | [
"/",
"*",
"List",
"limits",
"for",
"the",
"given",
"service"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/accounts/DataSiftAccount.java#L364-L381 |
roboconf/roboconf-platform | core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/templates/TemplateUtils.java | TemplateUtils.findApplicationName | public static String findApplicationName( final File templateDir, final File templateFile ) {
"""
Finds an application name from a template file.
@param templateDir the templates root directory, the one being watched by the TemplateWatcher
@param templateFile the template file
@return name of the application ... | java | public static String findApplicationName( final File templateDir, final File templateFile ) {
final File parentDir = templateFile.getParentFile();
final String appName;
// No intermediate directory, the template is global!
if( templateDir.equals( parentDir ))
appName = null;
// One intermediate director... | [
"public",
"static",
"String",
"findApplicationName",
"(",
"final",
"File",
"templateDir",
",",
"final",
"File",
"templateFile",
")",
"{",
"final",
"File",
"parentDir",
"=",
"templateFile",
".",
"getParentFile",
"(",
")",
";",
"final",
"String",
"appName",
";",
... | Finds an application name from a template file.
@param templateDir the templates root directory, the one being watched by the TemplateWatcher
@param templateFile the template file
@return name of the application targeted by the given template file, or {@code null} for a template global to all applications
@throws Ille... | [
"Finds",
"an",
"application",
"name",
"from",
"a",
"template",
"file",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/templates/TemplateUtils.java#L66-L85 |
h2oai/h2o-3 | h2o-core/src/main/java/water/init/AbstractEmbeddedH2OConfig.java | AbstractEmbeddedH2OConfig.notifyAboutCloudSize | public void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) {
"""
Tell the embedding software that this H2O instance belongs to
a cloud of a certain size.
This may be nonblocking.
Note: this method will be made abstract in a future stable release. User is expecte... | java | public void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) {
notifyAboutCloudSize(ip, port, size);
} | [
"public",
"void",
"notifyAboutCloudSize",
"(",
"InetAddress",
"ip",
",",
"int",
"port",
",",
"InetAddress",
"leaderIp",
",",
"int",
"leaderPort",
",",
"int",
"size",
")",
"{",
"notifyAboutCloudSize",
"(",
"ip",
",",
"port",
",",
"size",
")",
";",
"}"
] | Tell the embedding software that this H2O instance belongs to
a cloud of a certain size.
This may be nonblocking.
Note: this method will be made abstract in a future stable release. User is expected to override the method
in the implementation.
@param ip IP address this H2O can be reached at.
@param port Port this H2... | [
"Tell",
"the",
"embedding",
"software",
"that",
"this",
"H2O",
"instance",
"belongs",
"to",
"a",
"cloud",
"of",
"a",
"certain",
"size",
".",
"This",
"may",
"be",
"nonblocking",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/init/AbstractEmbeddedH2OConfig.java#L63-L65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.