repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/ui/CmsUserIconHelper.java | CmsUserIconHelper.toPath | private String toPath(String name, IconSize size) {
"""
Transforms user name and icon size into the image path.
@param name the user name
@param size IconSize to get icon for
@return the path
"""
return CmsStringUtil.joinPaths(CmsWorkplace.getSkinUri(), ICON_FOLDER, "" + name.hashCode()) + size... | java | private String toPath(String name, IconSize size) {
return CmsStringUtil.joinPaths(CmsWorkplace.getSkinUri(), ICON_FOLDER, "" + name.hashCode()) + size.getSuffix();
} | [
"private",
"String",
"toPath",
"(",
"String",
"name",
",",
"IconSize",
"size",
")",
"{",
"return",
"CmsStringUtil",
".",
"joinPaths",
"(",
"CmsWorkplace",
".",
"getSkinUri",
"(",
")",
",",
"ICON_FOLDER",
",",
"\"\"",
"+",
"name",
".",
"hashCode",
"(",
")",... | Transforms user name and icon size into the image path.
@param name the user name
@param size IconSize to get icon for
@return the path | [
"Transforms",
"user",
"name",
"and",
"icon",
"size",
"into",
"the",
"image",
"path",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsUserIconHelper.java#L444-L447 |
f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, CharSequence value) {
"""
Inserts a CharSequence value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@return this bundler instance to ... | java | public Bundler put(String key, CharSequence value) {
delegate.putCharSequence(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"delegate",
".",
"putCharSequence",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"CharSequence",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L283-L286 |
jenkinsci/jenkins | core/src/main/java/hudson/security/ACL.java | ACL.checkPermission | public final void checkPermission(@Nonnull Permission p) {
"""
Checks if the current security principal has this permission.
<p>
This is just a convenience function.
@throws AccessDeniedException
if the user doesn't have the permission.
"""
Authentication a = Jenkins.getAuthentication();
... | java | public final void checkPermission(@Nonnull Permission p) {
Authentication a = Jenkins.getAuthentication();
if (a == SYSTEM) {
return;
}
if(!hasPermission(a,p))
throw new AccessDeniedException2(a,p);
} | [
"public",
"final",
"void",
"checkPermission",
"(",
"@",
"Nonnull",
"Permission",
"p",
")",
"{",
"Authentication",
"a",
"=",
"Jenkins",
".",
"getAuthentication",
"(",
")",
";",
"if",
"(",
"a",
"==",
"SYSTEM",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!"... | Checks if the current security principal has this permission.
<p>
This is just a convenience function.
@throws AccessDeniedException
if the user doesn't have the permission. | [
"Checks",
"if",
"the",
"current",
"security",
"principal",
"has",
"this",
"permission",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/ACL.java#L67-L74 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplDisparityScoreSadRect_S16.java | ImplDisparityScoreSadRect_S16.computeRemainingRows | private void computeRemainingRows(GrayS16 left, GrayS16 right ) {
"""
Using previously computed results it efficiently finds the disparity in the remaining rows.
When a new block is processes the last row/column is subtracted and the new row/column is
added.
"""
for( int row = regionHeight; row < left.heig... | java | private void computeRemainingRows(GrayS16 left, GrayS16 right )
{
for( int row = regionHeight; row < left.height; row++ ) {
int oldRow = row%regionHeight;
// subtract first row from vertical score
int scores[] = horizontalScore[oldRow];
for( int i = 0; i < lengthHorizontal; i++ ) {
verticalScore[i] ... | [
"private",
"void",
"computeRemainingRows",
"(",
"GrayS16",
"left",
",",
"GrayS16",
"right",
")",
"{",
"for",
"(",
"int",
"row",
"=",
"regionHeight",
";",
"row",
"<",
"left",
".",
"height",
";",
"row",
"++",
")",
"{",
"int",
"oldRow",
"=",
"row",
"%",
... | Using previously computed results it efficiently finds the disparity in the remaining rows.
When a new block is processes the last row/column is subtracted and the new row/column is
added. | [
"Using",
"previously",
"computed",
"results",
"it",
"efficiently",
"finds",
"the",
"disparity",
"in",
"the",
"remaining",
"rows",
".",
"When",
"a",
"new",
"block",
"is",
"processes",
"the",
"last",
"row",
"/",
"column",
"is",
"subtracted",
"and",
"the",
"new... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/ImplDisparityScoreSadRect_S16.java#L111-L133 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/TransactionImpl.java | TransactionImpl.lockAndRegisterReferences | private void lockAndRegisterReferences(ClassDescriptor cld, Object sourceObject, int lockMode, List registeredObjects) throws LockNotGrantedException {
"""
we only use the registrationList map if the object is not a proxy. During the
reference locking, we will materialize objects and they will enter the registere... | java | private void lockAndRegisterReferences(ClassDescriptor cld, Object sourceObject, int lockMode, List registeredObjects) throws LockNotGrantedException
{
if (implicitLocking)
{
Iterator i = cld.getObjectReferenceDescriptors(true).iterator();
while (i.hasNext())
... | [
"private",
"void",
"lockAndRegisterReferences",
"(",
"ClassDescriptor",
"cld",
",",
"Object",
"sourceObject",
",",
"int",
"lockMode",
",",
"List",
"registeredObjects",
")",
"throws",
"LockNotGrantedException",
"{",
"if",
"(",
"implicitLocking",
")",
"{",
"Iterator",
... | we only use the registrationList map if the object is not a proxy. During the
reference locking, we will materialize objects and they will enter the registered for
lock map. | [
"we",
"only",
"use",
"the",
"registrationList",
"map",
"if",
"the",
"object",
"is",
"not",
"a",
"proxy",
".",
"During",
"the",
"reference",
"locking",
"we",
"will",
"materialize",
"objects",
"and",
"they",
"will",
"enter",
"the",
"registered",
"for",
"lock",... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L983-L1003 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java | AzkabanClient.fetchFlowExecution | public AzkabanFetchExecuteFlowStatus fetchFlowExecution(String execId) throws AzkabanClientException {
"""
Given an execution id, fetches all the detailed information of that execution,
including a list of all the job executions.
@param execId execution id to be fetched.
@return The status object which cont... | java | public AzkabanFetchExecuteFlowStatus fetchFlowExecution(String execId) throws AzkabanClientException {
AzkabanMultiCallables.FetchFlowExecCallable callable =
AzkabanMultiCallables.FetchFlowExecCallable.builder()
.client(this)
.execId(execId)
.build();
return runWithR... | [
"public",
"AzkabanFetchExecuteFlowStatus",
"fetchFlowExecution",
"(",
"String",
"execId",
")",
"throws",
"AzkabanClientException",
"{",
"AzkabanMultiCallables",
".",
"FetchFlowExecCallable",
"callable",
"=",
"AzkabanMultiCallables",
".",
"FetchFlowExecCallable",
".",
"builder",... | Given an execution id, fetches all the detailed information of that execution,
including a list of all the job executions.
@param execId execution id to be fetched.
@return The status object which contains success status and all the detailed
information of that execution. | [
"Given",
"an",
"execution",
"id",
"fetches",
"all",
"the",
"detailed",
"information",
"of",
"that",
"execution",
"including",
"a",
"list",
"of",
"all",
"the",
"job",
"executions",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/service/modules/orchestration/AzkabanClient.java#L415-L423 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.createMappingToSubflowState | public DefaultMapping createMappingToSubflowState(final String name, final String value, final boolean required, final Class type) {
"""
Create mapping to subflow state.
@param name the name
@param value the value
@param required the required
@param type the type
@return the default mapping
"... | java | public DefaultMapping createMappingToSubflowState(final String name, final String value, final boolean required, final Class type) {
val parser = this.flowBuilderServices.getExpressionParser();
val source = parser.parseExpression(value, new FluentParserContext());
val target = parser.parseExpres... | [
"public",
"DefaultMapping",
"createMappingToSubflowState",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
",",
"final",
"boolean",
"required",
",",
"final",
"Class",
"type",
")",
"{",
"val",
"parser",
"=",
"this",
".",
"flowBuilderServices",
".... | Create mapping to subflow state.
@param name the name
@param value the value
@param required the required
@param type the type
@return the default mapping | [
"Create",
"mapping",
"to",
"subflow",
"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#L517-L526 |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/RDFDatabaseWriter.java | RDFDatabaseWriter.writeFFGlobalSettings | private void writeFFGlobalSettings(Database db, XmlStreamWriter writer)
throws Exception {
"""
Writes the firefox settings back.
@param db The database with the settings to write.
@param writer The XML stream to write to.
@throws Exception ... probably never.
"""
writer.writeStar... | java | private void writeFFGlobalSettings(Database db, XmlStreamWriter writer)
throws Exception {
writer.writeStartElement("RDF:Description");
writer.writeAttribute("RDF:about", RDFDatabaseReader.FF_GLOBAL_SETTINGS_URI);
for (String key : db.getGlobalSettings().keySet()) {
... | [
"private",
"void",
"writeFFGlobalSettings",
"(",
"Database",
"db",
",",
"XmlStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"\"RDF:Description\"",
")",
";",
"writer",
".",
"writeAttribute",
"(",
"\"RDF:about\"",
","... | Writes the firefox settings back.
@param db The database with the settings to write.
@param writer The XML stream to write to.
@throws Exception ... probably never. | [
"Writes",
"the",
"firefox",
"settings",
"back",
"."
] | train | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/RDFDatabaseWriter.java#L229-L240 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/gslb/gslbvserver_stats.java | gslbvserver_stats.get | public static gslbvserver_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of gslbvserver_stats resource of given name .
"""
gslbvserver_stats obj = new gslbvserver_stats();
obj.set_name(name);
gslbvserver_stats response = (gslbvserver_stats) obj.stat_... | java | public static gslbvserver_stats get(nitro_service service, String name) throws Exception{
gslbvserver_stats obj = new gslbvserver_stats();
obj.set_name(name);
gslbvserver_stats response = (gslbvserver_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"gslbvserver_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"gslbvserver_stats",
"obj",
"=",
"new",
"gslbvserver_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch statistics of gslbvserver_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"gslbvserver_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/gslb/gslbvserver_stats.java#L329-L334 |
joniles/mpxj | src/main/java/net/sf/mpxj/utility/TimephasedUtility.java | TimephasedUtility.getStartIndex | private <T extends TimephasedItem<?>> int getStartIndex(DateRange range, List<T> assignments, int startIndex) {
"""
Used to locate the first timephased resource assignment block which
intersects with the target date range.
@param <T> payload type
@param range target date range
@param assignments timephased r... | java | private <T extends TimephasedItem<?>> int getStartIndex(DateRange range, List<T> assignments, int startIndex)
{
int result = -1;
if (assignments != null)
{
long rangeStart = range.getStart().getTime();
long rangeEnd = range.getEnd().getTime();
for (int loop = startIndex;... | [
"private",
"<",
"T",
"extends",
"TimephasedItem",
"<",
"?",
">",
">",
"int",
"getStartIndex",
"(",
"DateRange",
"range",
",",
"List",
"<",
"T",
">",
"assignments",
",",
"int",
"startIndex",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"if",
"(",
"a... | Used to locate the first timephased resource assignment block which
intersects with the target date range.
@param <T> payload type
@param range target date range
@param assignments timephased resource assignments
@param startIndex index at which to start the search
@return index of timephased resource assignment which... | [
"Used",
"to",
"locate",
"the",
"first",
"timephased",
"resource",
"assignment",
"block",
"which",
"intersects",
"with",
"the",
"target",
"date",
"range",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/utility/TimephasedUtility.java#L188-L234 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java | HylaFaxClientSpi.cancelFaxJobImpl | @Override
protected void cancelFaxJobImpl(FaxJob faxJob) {
"""
This function will cancel an existing fax job.
@param faxJob
The fax job object containing the needed information
"""
//get fax job
HylaFaxJob hylaFaxJob=(HylaFaxJob)faxJob;
//get client
HylaFAXCli... | java | @Override
protected void cancelFaxJobImpl(FaxJob faxJob)
{
//get fax job
HylaFaxJob hylaFaxJob=(HylaFaxJob)faxJob;
//get client
HylaFAXClient client=this.getHylaFAXClient();
try
{
this.cancelFaxJob(hylaFaxJob,client);
}
catch(... | [
"@",
"Override",
"protected",
"void",
"cancelFaxJobImpl",
"(",
"FaxJob",
"faxJob",
")",
"{",
"//get fax job",
"HylaFaxJob",
"hylaFaxJob",
"=",
"(",
"HylaFaxJob",
")",
"faxJob",
";",
"//get client",
"HylaFAXClient",
"client",
"=",
"this",
".",
"getHylaFAXClient",
"... | This function will cancel an existing fax job.
@param faxJob
The fax job object containing the needed information | [
"This",
"function",
"will",
"cancel",
"an",
"existing",
"fax",
"job",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L392-L413 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/EdgeLabel.java | EdgeLabel.removeOutVertexLabel | void removeOutVertexLabel(VertexLabel lbl, boolean preserveData) {
"""
remove a vertex label from the out collection
@param lbl the vertex label
@param preserveData should we keep the sql data?
"""
this.uncommittedRemovedOutVertexLabels.add(lbl);
if (!preserveData) {
de... | java | void removeOutVertexLabel(VertexLabel lbl, boolean preserveData) {
this.uncommittedRemovedOutVertexLabels.add(lbl);
if (!preserveData) {
deleteColumn(lbl.getFullName() + Topology.OUT_VERTEX_COLUMN_END);
}
} | [
"void",
"removeOutVertexLabel",
"(",
"VertexLabel",
"lbl",
",",
"boolean",
"preserveData",
")",
"{",
"this",
".",
"uncommittedRemovedOutVertexLabels",
".",
"add",
"(",
"lbl",
")",
";",
"if",
"(",
"!",
"preserveData",
")",
"{",
"deleteColumn",
"(",
"lbl",
".",
... | remove a vertex label from the out collection
@param lbl the vertex label
@param preserveData should we keep the sql data? | [
"remove",
"a",
"vertex",
"label",
"from",
"the",
"out",
"collection"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/EdgeLabel.java#L1232-L1237 |
lotaris/rox-client-java | rox-client-java/src/main/java/com/lotaris/rox/common/config/Configuration.java | Configuration.getUidFilesForProject | private List<File> getUidFilesForProject(String category, String projectName) {
"""
Retrieve the list of the version directories for the project
@param category The category
@param projectName The project name
@return The list of version directories or empty list if none are present
"""
// Check that th... | java | private List<File> getUidFilesForProject(String category, String projectName) {
// Check that the category directory exists
File categoryDirectory = new File(uidDirectory, category);
if (!categoryDirectory.exists() || (categoryDirectory.exists() && categoryDirectory.isFile())) {
return new ArrayList<>();
}
... | [
"private",
"List",
"<",
"File",
">",
"getUidFilesForProject",
"(",
"String",
"category",
",",
"String",
"projectName",
")",
"{",
"// Check that the category directory exists",
"File",
"categoryDirectory",
"=",
"new",
"File",
"(",
"uidDirectory",
",",
"category",
")",
... | Retrieve the list of the version directories for the project
@param category The category
@param projectName The project name
@return The list of version directories or empty list if none are present | [
"Retrieve",
"the",
"list",
"of",
"the",
"version",
"directories",
"for",
"the",
"project"
] | train | https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/common/config/Configuration.java#L534-L556 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.changeMarkSize | public static void changeMarkSize( Rule rule, int newSize ) {
"""
Changes the size of a mark inside a rule.
@param rule the {@link Rule}.
@param newSize the new size.
"""
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Graphic graphic = SLD.graphic(pointSymbo... | java | public static void changeMarkSize( Rule rule, int newSize ) {
PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
Graphic graphic = SLD.graphic(pointSymbolizer);
graphic.setSize(ff.literal(newSize));
// Mark oldMark = SLDs.mark(pointSymbolizer);
// old... | [
"public",
"static",
"void",
"changeMarkSize",
"(",
"Rule",
"rule",
",",
"int",
"newSize",
")",
"{",
"PointSymbolizer",
"pointSymbolizer",
"=",
"StyleUtilities",
".",
"pointSymbolizerFromRule",
"(",
"rule",
")",
";",
"Graphic",
"graphic",
"=",
"SLD",
".",
"graphi... | Changes the size of a mark inside a rule.
@param rule the {@link Rule}.
@param newSize the new size. | [
"Changes",
"the",
"size",
"of",
"a",
"mark",
"inside",
"a",
"rule",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L666-L673 |
beangle/beangle3 | commons/web/src/main/java/org/beangle/commons/web/util/CookieUtils.java | CookieUtils.getCookieValue | public static String getCookieValue(HttpServletRequest request, String cookieName) {
"""
获取cookie中的value<br>
自动负责解码<br>
@param request
@param cookieName
@return null when cannot find the cookie
"""
try {
Cookie cookie = getCookie(request, cookieName);
if (null == cookie) {
return ... | java | public static String getCookieValue(HttpServletRequest request, String cookieName) {
try {
Cookie cookie = getCookie(request, cookieName);
if (null == cookie) {
return null;
} else {
return URLDecoder.decode(cookie.getValue(), "utf-8");
}
} catch (Exception e) {
ret... | [
"public",
"static",
"String",
"getCookieValue",
"(",
"HttpServletRequest",
"request",
",",
"String",
"cookieName",
")",
"{",
"try",
"{",
"Cookie",
"cookie",
"=",
"getCookie",
"(",
"request",
",",
"cookieName",
")",
";",
"if",
"(",
"null",
"==",
"cookie",
")"... | 获取cookie中的value<br>
自动负责解码<br>
@param request
@param cookieName
@return null when cannot find the cookie | [
"获取cookie中的value<br",
">",
"自动负责解码<br",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/web/src/main/java/org/beangle/commons/web/util/CookieUtils.java#L61-L72 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/allocator/MaxFreeAllocator.java | MaxFreeAllocator.getCandidateDirInTier | private StorageDirView getCandidateDirInTier(StorageTierView tierView, long blockSize) {
"""
Finds a directory view in a tier view that has max free space and is able to store the block.
@param tierView the storage tier view
@param blockSize the size of block in bytes
@return the storage directory view if fou... | java | private StorageDirView getCandidateDirInTier(StorageTierView tierView, long blockSize) {
StorageDirView candidateDirView = null;
long maxFreeBytes = blockSize - 1;
for (StorageDirView dirView : tierView.getDirViews()) {
if (dirView.getAvailableBytes() > maxFreeBytes) {
maxFreeBytes = dirView.g... | [
"private",
"StorageDirView",
"getCandidateDirInTier",
"(",
"StorageTierView",
"tierView",
",",
"long",
"blockSize",
")",
"{",
"StorageDirView",
"candidateDirView",
"=",
"null",
";",
"long",
"maxFreeBytes",
"=",
"blockSize",
"-",
"1",
";",
"for",
"(",
"StorageDirView... | Finds a directory view in a tier view that has max free space and is able to store the block.
@param tierView the storage tier view
@param blockSize the size of block in bytes
@return the storage directory view if found, null otherwise | [
"Finds",
"a",
"directory",
"view",
"in",
"a",
"tier",
"view",
"that",
"has",
"max",
"free",
"space",
"and",
"is",
"able",
"to",
"store",
"the",
"block",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/allocator/MaxFreeAllocator.java#L91-L101 |
aws/aws-sdk-java | aws-java-sdk-cognitosync/src/main/java/com/amazonaws/services/cognitosync/model/GetCognitoEventsResult.java | GetCognitoEventsResult.withEvents | public GetCognitoEventsResult withEvents(java.util.Map<String, String> events) {
"""
<p>
The Cognito Events returned from the GetCognitoEvents request
</p>
@param events
The Cognito Events returned from the GetCognitoEvents request
@return Returns a reference to this object so that method calls can be chain... | java | public GetCognitoEventsResult withEvents(java.util.Map<String, String> events) {
setEvents(events);
return this;
} | [
"public",
"GetCognitoEventsResult",
"withEvents",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"events",
")",
"{",
"setEvents",
"(",
"events",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The Cognito Events returned from the GetCognitoEvents request
</p>
@param events
The Cognito Events returned from the GetCognitoEvents request
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"Cognito",
"Events",
"returned",
"from",
"the",
"GetCognitoEvents",
"request",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitosync/src/main/java/com/amazonaws/services/cognitosync/model/GetCognitoEventsResult.java#L74-L77 |
davetcc/tcMenu | tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/plugin/DirectoryCodePluginManager.java | DirectoryCodePluginManager.loadModules | protected void loadModules(String sourceDir, Collection<String> moduleNames) {
"""
Load all the modules that were configured into the main class loader, we don't want any additional class
loaders, we just want to load the classes in.
@param sourceDir the directory where the modules exist
@param moduleNames the ... | java | protected void loadModules(String sourceDir, Collection<String> moduleNames) {
ModuleFinder finder = ModuleFinder.of(Paths.get(sourceDir));
ClassLoader scl = ClassLoader.getSystemClassLoader();
ModuleLayer parent = ModuleLayer.boot();
Configuration cf = parent.configuration().resolve(fin... | [
"protected",
"void",
"loadModules",
"(",
"String",
"sourceDir",
",",
"Collection",
"<",
"String",
">",
"moduleNames",
")",
"{",
"ModuleFinder",
"finder",
"=",
"ModuleFinder",
".",
"of",
"(",
"Paths",
".",
"get",
"(",
"sourceDir",
")",
")",
";",
"ClassLoader"... | Load all the modules that were configured into the main class loader, we don't want any additional class
loaders, we just want to load the classes in.
@param sourceDir the directory where the modules exist
@param moduleNames the names of all the modules to load | [
"Load",
"all",
"the",
"modules",
"that",
"were",
"configured",
"into",
"the",
"main",
"class",
"loader",
"we",
"don",
"t",
"want",
"any",
"additional",
"class",
"loaders",
"we",
"just",
"want",
"to",
"load",
"the",
"classes",
"in",
"."
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/plugin/DirectoryCodePluginManager.java#L124-L130 |
jcuda/jnvgraph | JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java | JNvgraph.nvgraphSetVertexData | public static int nvgraphSetVertexData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer vertexData,
long setnum) {
"""
Update the vertex set #setnum with the data in *vertexData, sets have 0-based index
Conversions are not sopported so nvgraphTopologyType_t should match ... | java | public static int nvgraphSetVertexData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
Pointer vertexData,
long setnum)
{
return checkResult(nvgraphSetVertexDataNative(handle, descrG, vertexData, setnum));
} | [
"public",
"static",
"int",
"nvgraphSetVertexData",
"(",
"nvgraphHandle",
"handle",
",",
"nvgraphGraphDescr",
"descrG",
",",
"Pointer",
"vertexData",
",",
"long",
"setnum",
")",
"{",
"return",
"checkResult",
"(",
"nvgraphSetVertexDataNative",
"(",
"handle",
",",
"des... | Update the vertex set #setnum with the data in *vertexData, sets have 0-based index
Conversions are not sopported so nvgraphTopologyType_t should match the graph structure | [
"Update",
"the",
"vertex",
"set",
"#setnum",
"with",
"the",
"data",
"in",
"*",
"vertexData",
"sets",
"have",
"0",
"-",
"based",
"index",
"Conversions",
"are",
"not",
"sopported",
"so",
"nvgraphTopologyType_t",
"should",
"match",
"the",
"graph",
"structure"
] | train | https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L273-L280 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/adaptor/ESAAdaptor.java | ESAAdaptor.requiredByPlatformFeature | private static boolean requiredByPlatformFeature(ContentBasedLocalBundleRepository br, File baseDir, File b) {
"""
Determine there is another platform feature requires this resource
"""
try {
Map<String, ProvisioningFeatureDefinition> features = new Product(baseDir).getFeatureDefinitions();... | java | private static boolean requiredByPlatformFeature(ContentBasedLocalBundleRepository br, File baseDir, File b) {
try {
Map<String, ProvisioningFeatureDefinition> features = new Product(baseDir).getFeatureDefinitions();
for (ProvisioningFeatureDefinition fd : features.values()) {
... | [
"private",
"static",
"boolean",
"requiredByPlatformFeature",
"(",
"ContentBasedLocalBundleRepository",
"br",
",",
"File",
"baseDir",
",",
"File",
"b",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"features",
"=",
"new",
"P... | Determine there is another platform feature requires this resource | [
"Determine",
"there",
"is",
"another",
"platform",
"feature",
"requires",
"this",
"resource"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/adaptor/ESAAdaptor.java#L456-L468 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/FoldersApi.java | FoldersApi.listItems | public FolderItemsResponse listItems(String accountId, String folderId, FoldersApi.ListItemsOptions options) throws ApiException {
"""
Gets a list of the envelopes in the specified folder.
Retrieves a list of the envelopes in the specified folder. You can narrow the query by specifying search criteria in the quer... | java | public FolderItemsResponse listItems(String accountId, String folderId, FoldersApi.ListItemsOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required par... | [
"public",
"FolderItemsResponse",
"listItems",
"(",
"String",
"accountId",
",",
"String",
"folderId",
",",
"FoldersApi",
".",
"ListItemsOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the required para... | Gets a list of the envelopes in the specified folder.
Retrieves a list of the envelopes in the specified folder. You can narrow the query by specifying search criteria in the query string parameters.
@param accountId The external account number (int) or account ID Guid. (required)
@param folderId The ID of the folder b... | [
"Gets",
"a",
"list",
"of",
"the",
"envelopes",
"in",
"the",
"specified",
"folder",
".",
"Retrieves",
"a",
"list",
"of",
"the",
"envelopes",
"in",
"the",
"specified",
"folder",
".",
"You",
"can",
"narrow",
"the",
"query",
"by",
"specifying",
"search",
"crit... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/FoldersApi.java#L251-L299 |
Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACL.java | ACL.parse | int parse(final IntBuffer buff, final int start) {
"""
Load the ACL from the buffer returning the last ACL segment position into the buffer.
@param buff source buffer.
@param start start loading position.
@return last loading position.
"""
int pos = start;
// read for Dacl
byte[] b... | java | int parse(final IntBuffer buff, final int start) {
int pos = start;
// read for Dacl
byte[] bytes = NumberFacility.getBytes(buff.get(pos));
revision = AclRevision.parseValue(bytes[0]);
pos++;
bytes = NumberFacility.getBytes(buff.get(pos));
final int aceCount = Nu... | [
"int",
"parse",
"(",
"final",
"IntBuffer",
"buff",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"// read for Dacl",
"byte",
"[",
"]",
"bytes",
"=",
"NumberFacility",
".",
"getBytes",
"(",
"buff",
".",
"get",
"(",
"pos",
")",... | Load the ACL from the buffer returning the last ACL segment position into the buffer.
@param buff source buffer.
@param start start loading position.
@return last loading position. | [
"Load",
"the",
"ACL",
"from",
"the",
"buffer",
"returning",
"the",
"last",
"ACL",
"segment",
"position",
"into",
"the",
"buffer",
"."
] | train | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACL.java#L90-L110 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionContext.java | ExecutionContext.addError | public void addError(GraphQLError error, ExecutionPath fieldPath) {
"""
This method will only put one error per field path.
@param error the error to add
@param fieldPath the field path to put it under
"""
//
// see http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability about... | java | public void addError(GraphQLError error, ExecutionPath fieldPath) {
//
// see http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability about how per
// field errors should be handled - ie only once per field if its already there for nullability
// but unclear if its not that err... | [
"public",
"void",
"addError",
"(",
"GraphQLError",
"error",
",",
"ExecutionPath",
"fieldPath",
")",
"{",
"//",
"// see http://facebook.github.io/graphql/#sec-Errors-and-Non-Nullability about how per",
"// field errors should be handled - ie only once per field if its already there for null... | This method will only put one error per field path.
@param error the error to add
@param fieldPath the field path to put it under | [
"This",
"method",
"will",
"only",
"put",
"one",
"error",
"per",
"field",
"path",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionContext.java#L125-L140 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/core/DynamicJasperHelper.java | DynamicJasperHelper.generateJasperPrint | public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, Connection con, Map<String, Object> _parameters) throws JRException {
"""
For running queries embebed in the report design
@param dr
@param layoutManager
@param con
@param _parameters
@return
@throws JRException
... | java | public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, Connection con, Map<String, Object> _parameters) throws JRException {
log.info("generating JasperPrint");
JasperPrint jp;
if (_parameters == null)
_parameters = new HashMap<String, Object>()... | [
"public",
"static",
"JasperPrint",
"generateJasperPrint",
"(",
"DynamicReport",
"dr",
",",
"LayoutManager",
"layoutManager",
",",
"Connection",
"con",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"_parameters",
")",
"throws",
"JRException",
"{",
"log",
".",
"i... | For running queries embebed in the report design
@param dr
@param layoutManager
@param con
@param _parameters
@return
@throws JRException | [
"For",
"running",
"queries",
"embebed",
"in",
"the",
"report",
"design"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/core/DynamicJasperHelper.java#L259-L284 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.affineSpan | public Matrix4d affineSpan(Vector3d corner, Vector3d xDir, Vector3d yDir, Vector3d zDir) {
"""
Compute the extents of the coordinate system before this {@link #isAffine() affine} transformation was applied
and store the resulting corner coordinates in <code>corner</code> and the span vectors in
<code>xDir</code>... | java | public Matrix4d affineSpan(Vector3d corner, Vector3d xDir, Vector3d yDir, Vector3d zDir) {
double a = m10 * m22, b = m10 * m21, c = m10 * m02, d = m10 * m01;
double e = m11 * m22, f = m11 * m20, g = m11 * m02, h = m11 * m00;
double i = m12 * m21, j = m12 * m20, k = m12 * m01, l = m12 * m00;
... | [
"public",
"Matrix4d",
"affineSpan",
"(",
"Vector3d",
"corner",
",",
"Vector3d",
"xDir",
",",
"Vector3d",
"yDir",
",",
"Vector3d",
"zDir",
")",
"{",
"double",
"a",
"=",
"m10",
"*",
"m22",
",",
"b",
"=",
"m10",
"*",
"m21",
",",
"c",
"=",
"m10",
"*",
... | Compute the extents of the coordinate system before this {@link #isAffine() affine} transformation was applied
and store the resulting corner coordinates in <code>corner</code> and the span vectors in
<code>xDir</code>, <code>yDir</code> and <code>zDir</code>.
<p>
That means, given the maximum extents of the coordinate... | [
"Compute",
"the",
"extents",
"of",
"the",
"coordinate",
"system",
"before",
"this",
"{",
"@link",
"#isAffine",
"()",
"affine",
"}",
"transformation",
"was",
"applied",
"and",
"store",
"the",
"resulting",
"corner",
"coordinates",
"in",
"<code",
">",
"corner<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L15502-L15519 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java | BackendCleanup.resetData | public void resetData() {
"""
Reset data in order to to be in same state as a fresh installation (but without having to drop db and restart the server).
Please be careful when updating this method as it's called by Orchestrator.
"""
try (DbSession dbSession = dbClient.openSession(false);
Connectio... | java | public void resetData() {
try (DbSession dbSession = dbClient.openSession(false);
Connection connection = dbSession.getConnection()) {
truncateAnalysisTables(connection);
deleteManualRules(connection);
truncateInternalProperties(null, null, connection);
truncateUsers(null, null, conne... | [
"public",
"void",
"resetData",
"(",
")",
"{",
"try",
"(",
"DbSession",
"dbSession",
"=",
"dbClient",
".",
"openSession",
"(",
"false",
")",
";",
"Connection",
"connection",
"=",
"dbSession",
".",
"getConnection",
"(",
")",
")",
"{",
"truncateAnalysisTables",
... | Reset data in order to to be in same state as a fresh installation (but without having to drop db and restart the server).
Please be careful when updating this method as it's called by Orchestrator. | [
"Reset",
"data",
"in",
"order",
"to",
"to",
"be",
"in",
"same",
"state",
"as",
"a",
"fresh",
"installation",
"(",
"but",
"without",
"having",
"to",
"drop",
"db",
"and",
"restart",
"the",
"server",
")",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java#L113-L130 |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.security/src/com/ibm/ws/management/security/internal/AbstractManagementRole.java | AbstractManagementRole.updateBindings | private void updateBindings(Map<String, Object> props) {
"""
Update the binding sets based on the properties from the configuration.
@param props
"""
// Process the user element
processProps(props, CFG_KEY_USER, users);
// Process the user-access-id element
processProps(prop... | java | private void updateBindings(Map<String, Object> props) {
// Process the user element
processProps(props, CFG_KEY_USER, users);
// Process the user-access-id element
processProps(props, CFG_KEY_USER_ACCESSID, users);
// Process the group element
processProps(props, CFG_KE... | [
"private",
"void",
"updateBindings",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"// Process the user element",
"processProps",
"(",
"props",
",",
"CFG_KEY_USER",
",",
"users",
")",
";",
"// Process the user-access-id element",
"processProps",
... | Update the binding sets based on the properties from the configuration.
@param props | [
"Update",
"the",
"binding",
"sets",
"based",
"on",
"the",
"properties",
"from",
"the",
"configuration",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.security/src/com/ibm/ws/management/security/internal/AbstractManagementRole.java#L66-L76 |
darcy-framework/darcy-ui | src/main/java/com/redhat/darcy/ui/internal/Initializer.java | Initializer.assignContext | private void assignContext(ElementContext context) {
"""
Sets fields annotated with {@link com.redhat.darcy.ui.annotations.Context @Context} with the
specified context.
"""
fields.stream()
.filter(f -> f.getAnnotation(Context.class) != null)
.forEach(f -> {
... | java | private void assignContext(ElementContext context) {
fields.stream()
.filter(f -> f.getAnnotation(Context.class) != null)
.forEach(f -> {
try {
f.set(view, context);
} catch (IllegalAccessException | IllegalArgumentE... | [
"private",
"void",
"assignContext",
"(",
"ElementContext",
"context",
")",
"{",
"fields",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"f",
"->",
"f",
".",
"getAnnotation",
"(",
"Context",
".",
"class",
")",
"!=",
"null",
")",
".",
"forEach",
"(",
"f",... | Sets fields annotated with {@link com.redhat.darcy.ui.annotations.Context @Context} with the
specified context. | [
"Sets",
"fields",
"annotated",
"with",
"{"
] | train | https://github.com/darcy-framework/darcy-ui/blob/ae0d89a1ca45f8257ef2764a01e4cfe68f432e33/src/main/java/com/redhat/darcy/ui/internal/Initializer.java#L81-L91 |
colin-lee/mybatis-spring-support | src/main/java/com/github/mybatis/interceptor/PaginationAutoMapInterceptor.java | PaginationAutoMapInterceptor.getTotalCount | private int getTotalCount(String sql, Connection conn, MappedStatement ms, BoundSql boundSql) throws SQLException {
"""
获取总记录数
@param sql 原始sql语句
@param conn
@param ms
@param boundSql
@return
@throws SQLException
"""
int start = sql.indexOf("from");
if (start == -1) {
throw new Runti... | java | private int getTotalCount(String sql, Connection conn, MappedStatement ms, BoundSql boundSql) throws SQLException {
int start = sql.indexOf("from");
if (start == -1) {
throw new RuntimeException("statement has no 'from' keyword");
}
int stop = sql.indexOf("order by");
if (stop == -1) {
s... | [
"private",
"int",
"getTotalCount",
"(",
"String",
"sql",
",",
"Connection",
"conn",
",",
"MappedStatement",
"ms",
",",
"BoundSql",
"boundSql",
")",
"throws",
"SQLException",
"{",
"int",
"start",
"=",
"sql",
".",
"indexOf",
"(",
"\"from\"",
")",
";",
"if",
... | 获取总记录数
@param sql 原始sql语句
@param conn
@param ms
@param boundSql
@return
@throws SQLException | [
"获取总记录数"
] | train | https://github.com/colin-lee/mybatis-spring-support/blob/de412e98d00e9a012c0619778fa1a61832863b82/src/main/java/com/github/mybatis/interceptor/PaginationAutoMapInterceptor.java#L363-L392 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.removeAtomAndConnectedElectronContainers | public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) {
"""
Remove an Atom and the connected ElectronContainers from all AtomContainers
inside an IChemModel.
@param chemModel The IChemModel object.
@param atom The Atom object to remove.
"""
ICrystal c... | java | public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(atom)) {
crystal.removeAtom(atom);
}
return;
}
IAtomC... | [
"public",
"static",
"void",
"removeAtomAndConnectedElectronContainers",
"(",
"IChemModel",
"chemModel",
",",
"IAtom",
"atom",
")",
"{",
"ICrystal",
"crystal",
"=",
"chemModel",
".",
"getCrystal",
"(",
")",
";",
"if",
"(",
"crystal",
"!=",
"null",
")",
"{",
"if... | Remove an Atom and the connected ElectronContainers from all AtomContainers
inside an IChemModel.
@param chemModel The IChemModel object.
@param atom The Atom object to remove. | [
"Remove",
"an",
"Atom",
"and",
"the",
"connected",
"ElectronContainers",
"from",
"all",
"AtomContainers",
"inside",
"an",
"IChemModel",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L110-L126 |
redkale/redkale-plugins | src/org/redkalex/weixin/WeiXinQYService.java | WeiXinQYService.encryptQYMessage | protected String encryptQYMessage(String replyMsg, String timeStamp, String nonce) {
"""
将公众平台回复用户的消息加密打包.
<ol>
<li>对要发送的消息进行AES-CBC加密</li>
<li>生成安全签名</li>
<li>将消息密文和安全签名打包成xml格式</li>
</ol>
<p>
@param replyMsg 公众平台待回复用户的消息,xml格式的字符串
@param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
@param nonce 随机串,可以自... | java | protected String encryptQYMessage(String replyMsg, String timeStamp, String nonce) {
// 加密
String encrypt = encryptQY(random16String(), replyMsg);
// 生成安全签名
if (timeStamp == null || timeStamp.isEmpty()) timeStamp = Long.toString(System.currentTimeMillis());
String signatur... | [
"protected",
"String",
"encryptQYMessage",
"(",
"String",
"replyMsg",
",",
"String",
"timeStamp",
",",
"String",
"nonce",
")",
"{",
"// 加密\r",
"String",
"encrypt",
"=",
"encryptQY",
"(",
"random16String",
"(",
")",
",",
"replyMsg",
")",
";",
"// 生成安全签名\r",
"if... | 将公众平台回复用户的消息加密打包.
<ol>
<li>对要发送的消息进行AES-CBC加密</li>
<li>生成安全签名</li>
<li>将消息密文和安全签名打包成xml格式</li>
</ol>
<p>
@param replyMsg 公众平台待回复用户的消息,xml格式的字符串
@param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
@param nonce 随机串,可以自己生成,也可以用URL参数的nonce
<p>
@return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串 | [
"将公众平台回复用户的消息加密打包",
".",
"<ol",
">",
"<li",
">",
"对要发送的消息进行AES",
"-",
"CBC加密<",
"/",
"li",
">",
"<li",
">",
"生成安全签名<",
"/",
"li",
">",
"<li",
">",
"将消息密文和安全签名打包成xml格式<",
"/",
"li",
">",
"<",
"/",
"ol",
">",
"<p",
">"
] | train | https://github.com/redkale/redkale-plugins/blob/a1edfc906a444ae19fe6aababce2957c9b5ea9d2/src/org/redkalex/weixin/WeiXinQYService.java#L163-L177 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsTargetFileDoesNotExist | public FessMessages addErrorsTargetFileDoesNotExist(String property, String arg0) {
"""
Add the created action message for the key 'errors.target_file_does_not_exist' with parameters.
<pre>
message: {0} file does not exist.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The pa... | java | public FessMessages addErrorsTargetFileDoesNotExist(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_target_file_does_not_exist, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsTargetFileDoesNotExist",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_target_file_does_not_exist",
",... | Add the created action message for the key 'errors.target_file_does_not_exist' with parameters.
<pre>
message: {0} file does not exist.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"target_file_does_not_exist",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"{",
"0",
"}",
"file",
"does",
"not",
"exist",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1447-L1451 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/AbstractStrategy.java | AbstractStrategy.printGroundtruth | protected void printGroundtruth(final String user, final Map<Long, Double> groundtruthItems, final PrintStream out, final OUTPUT_FORMAT format) {
"""
Internal function to print the ground truth (the test set).
@param user The user (as a String).
@param groundtruthItems The ground truth items for the user.
@pa... | java | protected void printGroundtruth(final String user, final Map<Long, Double> groundtruthItems, final PrintStream out, final OUTPUT_FORMAT format) {
for (Entry<Long, Double> e : groundtruthItems.entrySet()) {
switch (format) {
case TRECEVAL:
out.println(user + "\tQ0\... | [
"protected",
"void",
"printGroundtruth",
"(",
"final",
"String",
"user",
",",
"final",
"Map",
"<",
"Long",
",",
"Double",
">",
"groundtruthItems",
",",
"final",
"PrintStream",
"out",
",",
"final",
"OUTPUT_FORMAT",
"format",
")",
"{",
"for",
"(",
"Entry",
"<"... | Internal function to print the ground truth (the test set).
@param user The user (as a String).
@param groundtruthItems The ground truth items for the user.
@param out Where to print.
@param format The format of the printer. | [
"Internal",
"function",
"to",
"print",
"the",
"ground",
"truth",
"(",
"the",
"test",
"set",
")",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/AbstractStrategy.java#L192-L204 |
Netflix/netflix-commons | netflix-infix/src/main/java/com/netflix/infix/TimeUtil.java | TimeUtil.toDateTimeFormatter | public static DateTimeFormatter toDateTimeFormatter(String formatName, String timeFormat) {
"""
Converts the given time format string to a {@link org.joda.time.format.DateTimeFormatter} instance.
@param formatName A name used to identify the given time format. This is mainly used for error reporting.
@param ti... | java | public static DateTimeFormatter toDateTimeFormatter(String formatName, String timeFormat) {
DateTimeFormatter formatter = null;
try{
formatter = DateTimeFormat.forPattern(timeFormat);
}catch(IllegalArgumentException e){
//JODA's error message doesn't tell you which value sucked, so we crea... | [
"public",
"static",
"DateTimeFormatter",
"toDateTimeFormatter",
"(",
"String",
"formatName",
",",
"String",
"timeFormat",
")",
"{",
"DateTimeFormatter",
"formatter",
"=",
"null",
";",
"try",
"{",
"formatter",
"=",
"DateTimeFormat",
".",
"forPattern",
"(",
"timeForma... | Converts the given time format string to a {@link org.joda.time.format.DateTimeFormatter} instance.
@param formatName A name used to identify the given time format. This is mainly used for error reporting.
@param timeFormat The date time format to be converted.
@return A {@link org.joda.time.format.DateTimeFormatter}... | [
"Converts",
"the",
"given",
"time",
"format",
"string",
"to",
"a",
"{",
"@link",
"org",
".",
"joda",
".",
"time",
".",
"format",
".",
"DateTimeFormatter",
"}",
"instance",
"."
] | train | https://github.com/Netflix/netflix-commons/blob/7a158af76906d4a9b753e9344ce3e7abeb91dc01/netflix-infix/src/main/java/com/netflix/infix/TimeUtil.java#L18-L35 |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/servlets/GridStatistics.java | GridStatistics.process | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
This method gets a list of {@link BrowserStatistics} and returns over HTTP as a json document
@param request
{@link HttpServletRequest} that represents the servlet request
@param response
{@link HttpServ... | java | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException {
String acceptHeader = request.getHeader("Accept");
if (acceptHeader != null && ((acceptHeader.contains("*/*")) || (acceptHeader.contains("application/json")))) {
ServletHelper.respondAsJsonW... | [
"protected",
"void",
"process",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"String",
"acceptHeader",
"=",
"request",
".",
"getHeader",
"(",
"\"Accept\"",
")",
";",
"if",
"(",
"acceptHeader",
"!=... | This method gets a list of {@link BrowserStatistics} and returns over HTTP as a json document
@param request
{@link HttpServletRequest} that represents the servlet request
@param response
{@link HttpServletResponse} that represents the servlet response
@throws IOException | [
"This",
"method",
"gets",
"a",
"list",
"of",
"{",
"@link",
"BrowserStatistics",
"}",
"and",
"returns",
"over",
"HTTP",
"as",
"a",
"json",
"document"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/servlets/GridStatistics.java#L112-L120 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java | PDBFileParser.assignAsymIds | private void assignAsymIds(List<List<Chain>> polys, List<List<Chain>> nonPolys, List<List<Chain>> waters) {
"""
Assign asym ids following the rules used by the PDB to assign asym ids in mmCIF files
@param polys
@param nonPolys
@param waters
"""
for (int i=0; i<polys.size(); i++) {
String asymId = "A";... | java | private void assignAsymIds(List<List<Chain>> polys, List<List<Chain>> nonPolys, List<List<Chain>> waters) {
for (int i=0; i<polys.size(); i++) {
String asymId = "A";
for (Chain poly:polys.get(i)) {
poly.setId(asymId);
asymId = getNextAsymId(asymId);
}
for (Chain nonPoly:nonPolys.get(i)) {
no... | [
"private",
"void",
"assignAsymIds",
"(",
"List",
"<",
"List",
"<",
"Chain",
">",
">",
"polys",
",",
"List",
"<",
"List",
"<",
"Chain",
">",
">",
"nonPolys",
",",
"List",
"<",
"List",
"<",
"Chain",
">",
">",
"waters",
")",
"{",
"for",
"(",
"int",
... | Assign asym ids following the rules used by the PDB to assign asym ids in mmCIF files
@param polys
@param nonPolys
@param waters | [
"Assign",
"asym",
"ids",
"following",
"the",
"rules",
"used",
"by",
"the",
"PDB",
"to",
"assign",
"asym",
"ids",
"in",
"mmCIF",
"files"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L3047-L3065 |
k3po/k3po | driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/udp/UdpBootstrapFactorySpi.java | UdpBootstrapFactorySpi.newServerBootstrap | @Override
public synchronized ServerBootstrap newServerBootstrap() throws Exception {
"""
Returns a {@link ServerBootstrap} instance for the named transport.
"""
if (serverChannelFactory == null) {
Executor workerExecutor = executorServiceFactory.newExecutorService("worker.server");
... | java | @Override
public synchronized ServerBootstrap newServerBootstrap() throws Exception {
if (serverChannelFactory == null) {
Executor workerExecutor = executorServiceFactory.newExecutorService("worker.server");
NioDatagramWorkerPool workerPool = new NioDatagramWorkerPool(workerExecutor,... | [
"@",
"Override",
"public",
"synchronized",
"ServerBootstrap",
"newServerBootstrap",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"serverChannelFactory",
"==",
"null",
")",
"{",
"Executor",
"workerExecutor",
"=",
"executorServiceFactory",
".",
"newExecutorService",
... | Returns a {@link ServerBootstrap} instance for the named transport. | [
"Returns",
"a",
"{"
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/udp/UdpBootstrapFactorySpi.java#L107-L119 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.removeByG_A | @Override
public void removeByG_A(long groupId, boolean active) {
"""
Removes all the commerce user segment entries where groupId = ? and active = ? from the database.
@param groupId the group ID
@param active the active
"""
for (CommerceUserSegmentEntry commerceUserSegmentEntry : findByG_A(
... | java | @Override
public void removeByG_A(long groupId, boolean active) {
for (CommerceUserSegmentEntry commerceUserSegmentEntry : findByG_A(
groupId, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceUserSegmentEntry);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_A",
"(",
"long",
"groupId",
",",
"boolean",
"active",
")",
"{",
"for",
"(",
"CommerceUserSegmentEntry",
"commerceUserSegmentEntry",
":",
"findByG_A",
"(",
"groupId",
",",
"active",
",",
"QueryUtil",
".",
"ALL_POS",
"... | Removes all the commerce user segment entries where groupId = ? and active = ? from the database.
@param groupId the group ID
@param active the active | [
"Removes",
"all",
"the",
"commerce",
"user",
"segment",
"entries",
"where",
"groupId",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L2043-L2049 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_automatedBackup_restorePoints_GET | public ArrayList<Date> serviceName_automatedBackup_restorePoints_GET(String serviceName, OvhRestoreStateEnum state) throws IOException {
"""
Get available Restore Points
REST: GET /vps/{serviceName}/automatedBackup/restorePoints
@param state [required] The state of the restore point
@param serviceName [requir... | java | public ArrayList<Date> serviceName_automatedBackup_restorePoints_GET(String serviceName, OvhRestoreStateEnum state) throws IOException {
String qPath = "/vps/{serviceName}/automatedBackup/restorePoints";
StringBuilder sb = path(qPath, serviceName);
query(sb, "state", state);
String resp = exec(qPath, "GET", sb.... | [
"public",
"ArrayList",
"<",
"Date",
">",
"serviceName_automatedBackup_restorePoints_GET",
"(",
"String",
"serviceName",
",",
"OvhRestoreStateEnum",
"state",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/automatedBackup/restorePoints\"",
";",... | Get available Restore Points
REST: GET /vps/{serviceName}/automatedBackup/restorePoints
@param state [required] The state of the restore point
@param serviceName [required] The internal name of your VPS offer | [
"Get",
"available",
"Restore",
"Points"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L104-L110 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/parser/RtfImportMgr.java | RtfImportMgr.importStylesheetList | public boolean importStylesheetList(String listNr, List listIn) {
"""
Imports a stylesheet list value. The stylesheet number for the stylesheet defined
is determined and then the resulting mapping is added.
"""
RtfList rtfList = new RtfList(this.rtfDoc, listIn);
rtfList.setRtfDocument(this.rtf... | java | public boolean importStylesheetList(String listNr, List listIn) {
RtfList rtfList = new RtfList(this.rtfDoc, listIn);
rtfList.setRtfDocument(this.rtfDoc);
// TODO HGS - Finish implementation of import
//this.importStylesheetListMapping.put(listNr, Integer.toString(this.rtfDoc.getDocument... | [
"public",
"boolean",
"importStylesheetList",
"(",
"String",
"listNr",
",",
"List",
"listIn",
")",
"{",
"RtfList",
"rtfList",
"=",
"new",
"RtfList",
"(",
"this",
".",
"rtfDoc",
",",
"listIn",
")",
";",
"rtfList",
".",
"setRtfDocument",
"(",
"this",
".",
"rt... | Imports a stylesheet list value. The stylesheet number for the stylesheet defined
is determined and then the resulting mapping is added. | [
"Imports",
"a",
"stylesheet",
"list",
"value",
".",
"The",
"stylesheet",
"number",
"for",
"the",
"stylesheet",
"defined",
"is",
"determined",
"and",
"then",
"the",
"resulting",
"mapping",
"is",
"added",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/parser/RtfImportMgr.java#L241-L247 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/file/HttpFileServiceBuilder.java | HttpFileServiceBuilder.cacheControl | public HttpFileServiceBuilder cacheControl(CacheControl cacheControl) {
"""
Sets the {@code "cache-control"} header. This method is a shortcut of:
<pre>{@code
builder.setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
}</pre>
"""
requireNonNull(cacheControl, "cacheControl");
return setH... | java | public HttpFileServiceBuilder cacheControl(CacheControl cacheControl) {
requireNonNull(cacheControl, "cacheControl");
return setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
} | [
"public",
"HttpFileServiceBuilder",
"cacheControl",
"(",
"CacheControl",
"cacheControl",
")",
"{",
"requireNonNull",
"(",
"cacheControl",
",",
"\"cacheControl\"",
")",
";",
"return",
"setHeader",
"(",
"HttpHeaderNames",
".",
"CACHE_CONTROL",
",",
"cacheControl",
")",
... | Sets the {@code "cache-control"} header. This method is a shortcut of:
<pre>{@code
builder.setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
}</pre> | [
"Sets",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/file/HttpFileServiceBuilder.java#L206-L209 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaStringGenerator.java | SibRaStringGenerator.addField | void addField(final String name, final boolean value)
throws IllegalStateException {
"""
Adds a string representation of the given boolean field.
@param name
the name of the field
@param value
the value of the field
@throws IllegalStateException
if the string representation has already been com... | java | void addField(final String name, final boolean value)
throws IllegalStateException {
addField(name, Boolean.toString(value));
} | [
"void",
"addField",
"(",
"final",
"String",
"name",
",",
"final",
"boolean",
"value",
")",
"throws",
"IllegalStateException",
"{",
"addField",
"(",
"name",
",",
"Boolean",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Adds a string representation of the given boolean field.
@param name
the name of the field
@param value
the value of the field
@throws IllegalStateException
if the string representation has already been completed | [
"Adds",
"a",
"string",
"representation",
"of",
"the",
"given",
"boolean",
"field",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaStringGenerator.java#L97-L102 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionWriter.java | BinaryExpressionWriter.writeShiftOp | protected boolean writeShiftOp(int type, boolean simulate) {
"""
Write shifting operations.
Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED
@param type the token type
@return true on a successful shift operation write
"""
type = type - LEFT_SHIFT;
if (type < 0 || type > 2) ... | java | protected boolean writeShiftOp(int type, boolean simulate) {
type = type - LEFT_SHIFT;
if (type < 0 || type > 2) return false;
if (!simulate) {
int bytecode = getShiftOperationBytecode(type);
controller.getMethodVisitor().visitInsn(bytecode);
controller.getOp... | [
"protected",
"boolean",
"writeShiftOp",
"(",
"int",
"type",
",",
"boolean",
"simulate",
")",
"{",
"type",
"=",
"type",
"-",
"LEFT_SHIFT",
";",
"if",
"(",
"type",
"<",
"0",
"||",
"type",
">",
"2",
")",
"return",
"false",
";",
"if",
"(",
"!",
"simulate... | Write shifting operations.
Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED
@param type the token type
@return true on a successful shift operation write | [
"Write",
"shifting",
"operations",
".",
"Type",
"is",
"one",
"of",
"LEFT_SHIFT",
"RIGHT_SHIFT",
"or",
"RIGHT_SHIFT_UNSIGNED"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionWriter.java#L259-L269 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/FixedURLGenerator.java | FixedURLGenerator.generateFixedUrls | public static void generateFixedUrls(final ContentSpec contentSpec, boolean missingOnly, final Integer fixedUrlPropertyTagId) {
"""
Generate the fixed urls and sets it where required for a content specification.
@param contentSpec The content spec to generate fixed urls for.
@param missingOnly ... | java | public static void generateFixedUrls(final ContentSpec contentSpec, boolean missingOnly, final Integer fixedUrlPropertyTagId) {
final Set<String> existingFixedUrls = new HashSet<String>();
final Set<SpecNode> nodesWithoutFixedUrls = new HashSet<SpecNode>();
final List<SpecNode> specNodes = getAl... | [
"public",
"static",
"void",
"generateFixedUrls",
"(",
"final",
"ContentSpec",
"contentSpec",
",",
"boolean",
"missingOnly",
",",
"final",
"Integer",
"fixedUrlPropertyTagId",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"existingFixedUrls",
"=",
"new",
"HashSet",
... | Generate the fixed urls and sets it where required for a content specification.
@param contentSpec The content spec to generate fixed urls for.
@param missingOnly Generate only the missing fixed urls.
@param fixedUrlPropertyTagId The Fixed URL Property Tag ID. | [
"Generate",
"the",
"fixed",
"urls",
"and",
"sets",
"it",
"where",
"required",
"for",
"a",
"content",
"specification",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/FixedURLGenerator.java#L46-L57 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java | LabelProcessor.addLabel | public static Label.Builder addLabel(final Label.Builder labelBuilder, final Locale locale, final String label) {
"""
Add a label to a labelBuilder by locale. This is equivalent to calling
{@link #addLabel(Builder, String, String)} but the language code is extracted from the locale
by calling {@link Locale#getLa... | java | public static Label.Builder addLabel(final Label.Builder labelBuilder, final Locale locale, final String label) {
return addLabel(labelBuilder, locale.getLanguage(), label);
} | [
"public",
"static",
"Label",
".",
"Builder",
"addLabel",
"(",
"final",
"Label",
".",
"Builder",
"labelBuilder",
",",
"final",
"Locale",
"locale",
",",
"final",
"String",
"label",
")",
"{",
"return",
"addLabel",
"(",
"labelBuilder",
",",
"locale",
".",
"getLa... | Add a label to a labelBuilder by locale. This is equivalent to calling
{@link #addLabel(Builder, String, String)} but the language code is extracted from the locale
by calling {@link Locale#getLanguage()}.
@param labelBuilder the label builder to be updated
@param locale the locale from which the language code i... | [
"Add",
"a",
"label",
"to",
"a",
"labelBuilder",
"by",
"locale",
".",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#addLabel",
"(",
"Builder",
"String",
"String",
")",
"}",
"but",
"the",
"language",
"code",
"is",
"extracted",
"from",
"the",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java#L146-L148 |
fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/rdf/DefaultRdfStream.java | DefaultRdfStream.fromModel | public static RdfStream fromModel(final Node node, final Model model) {
"""
Create an RdfStream from an existing Model.
@param node The subject node
@param model An input Model
@return a new RdfStream object
"""
return new DefaultRdfStream(node,
stream(spliteratorUnknownSize(model.li... | java | public static RdfStream fromModel(final Node node, final Model model) {
return new DefaultRdfStream(node,
stream(spliteratorUnknownSize(model.listStatements(), IMMUTABLE), false).map(Statement::asTriple));
} | [
"public",
"static",
"RdfStream",
"fromModel",
"(",
"final",
"Node",
"node",
",",
"final",
"Model",
"model",
")",
"{",
"return",
"new",
"DefaultRdfStream",
"(",
"node",
",",
"stream",
"(",
"spliteratorUnknownSize",
"(",
"model",
".",
"listStatements",
"(",
")",... | Create an RdfStream from an existing Model.
@param node The subject node
@param model An input Model
@return a new RdfStream object | [
"Create",
"an",
"RdfStream",
"from",
"an",
"existing",
"Model",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/rdf/DefaultRdfStream.java#L73-L76 |
buschmais/jqa-core-framework | rule/src/main/java/com/buschmais/jqassistant/core/rule/impl/reader/AsciidocRuleParserPlugin.java | AsciidocRuleParserPlugin.parseProperties | private Properties parseProperties(AbstractBlock part, String attributeName) {
"""
Parse properties from an attribute.
@param part
The content part containing the attribute.
@param attributeName
The attribute name.
@return The properties.
"""
Properties properties = new Properties();
Obj... | java | private Properties parseProperties(AbstractBlock part, String attributeName) {
Properties properties = new Properties();
Object attribute = part.getAttributes().get(attributeName);
if (attribute == null) {
return properties;
}
Scanner propertiesScanner = new Scanner(a... | [
"private",
"Properties",
"parseProperties",
"(",
"AbstractBlock",
"part",
",",
"String",
"attributeName",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"Object",
"attribute",
"=",
"part",
".",
"getAttributes",
"(",
")",
".",
"g... | Parse properties from an attribute.
@param part
The content part containing the attribute.
@param attributeName
The attribute name.
@return The properties. | [
"Parse",
"properties",
"from",
"an",
"attribute",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/impl/reader/AsciidocRuleParserPlugin.java#L376-L395 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java | RTreeIndexCoreExtension.getOrCreate | public Extensions getOrCreate(String tableName, String columnName) {
"""
Get or create the extension
@param tableName
table name
@param columnName
column name
@return extension
"""
return getOrCreate(EXTENSION_NAME, tableName, columnName, DEFINITION,
ExtensionScopeType.WRITE_ONLY);
} | java | public Extensions getOrCreate(String tableName, String columnName) {
return getOrCreate(EXTENSION_NAME, tableName, columnName, DEFINITION,
ExtensionScopeType.WRITE_ONLY);
} | [
"public",
"Extensions",
"getOrCreate",
"(",
"String",
"tableName",
",",
"String",
"columnName",
")",
"{",
"return",
"getOrCreate",
"(",
"EXTENSION_NAME",
",",
"tableName",
",",
"columnName",
",",
"DEFINITION",
",",
"ExtensionScopeType",
".",
"WRITE_ONLY",
")",
";"... | Get or create the extension
@param tableName
table name
@param columnName
column name
@return extension | [
"Get",
"or",
"create",
"the",
"extension"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java#L262-L265 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/GridLayout.java | GridLayout.createLayoutData | public static LayoutData createLayoutData(Alignment horizontalAlignment, Alignment verticalAlignment) {
"""
Creates a layout data object for {@code GridLayout}:s that specify the horizontal and vertical alignment for the
component in case the cell space is larger than the preferred size of the component
@param h... | java | public static LayoutData createLayoutData(Alignment horizontalAlignment, Alignment verticalAlignment) {
return createLayoutData(horizontalAlignment, verticalAlignment, false, false);
} | [
"public",
"static",
"LayoutData",
"createLayoutData",
"(",
"Alignment",
"horizontalAlignment",
",",
"Alignment",
"verticalAlignment",
")",
"{",
"return",
"createLayoutData",
"(",
"horizontalAlignment",
",",
"verticalAlignment",
",",
"false",
",",
"false",
")",
";",
"}... | Creates a layout data object for {@code GridLayout}:s that specify the horizontal and vertical alignment for the
component in case the cell space is larger than the preferred size of the component
@param horizontalAlignment Horizontal alignment strategy
@param verticalAlignment Vertical alignment strategy
@return The l... | [
"Creates",
"a",
"layout",
"data",
"object",
"for",
"{"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/GridLayout.java#L110-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/LogFileHandle.java | LogFileHandle.getWriteableLogRecord | public WriteableLogRecord getWriteableLogRecord(int recordLength, long sequenceNumber) throws InternalLogException {
"""
Get a new WritableLogRecord for the log file managed by this LogFileHandleInstance.
The size of the record must be specified along with the record's sequence number.
It is the caller's respons... | java | public WriteableLogRecord getWriteableLogRecord(int recordLength, long sequenceNumber) throws InternalLogException
{
if (!_headerFlushedFollowingRestart)
{
// ensure header is updated now we start to write records for the first time
// synchronization is assured through lock... | [
"public",
"WriteableLogRecord",
"getWriteableLogRecord",
"(",
"int",
"recordLength",
",",
"long",
"sequenceNumber",
")",
"throws",
"InternalLogException",
"{",
"if",
"(",
"!",
"_headerFlushedFollowingRestart",
")",
"{",
"// ensure header is updated now we start to write records... | Get a new WritableLogRecord for the log file managed by this LogFileHandleInstance.
The size of the record must be specified along with the record's sequence number.
It is the caller's responsbility to ensure that both the sequence number is correct
and that the record written using the returned WritableLogRecord is of... | [
"Get",
"a",
"new",
"WritableLogRecord",
"for",
"the",
"log",
"file",
"managed",
"by",
"this",
"LogFileHandleInstance",
".",
"The",
"size",
"of",
"the",
"record",
"must",
"be",
"specified",
"along",
"with",
"the",
"record",
"s",
"sequence",
"number",
".",
"It... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/LogFileHandle.java#L639-L666 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java | ElementMatchers.nameStartsWith | public static <T extends NamedElement> ElementMatcher.Junction<T> nameStartsWith(String prefix) {
"""
Matches a {@link NamedElement} for its name's prefix.
@param prefix The expected name's prefix.
@param <T> The type of the matched object.
@return An element matcher for a named element's name's prefix.
... | java | public static <T extends NamedElement> ElementMatcher.Junction<T> nameStartsWith(String prefix) {
return new NameMatcher<T>(new StringMatcher(prefix, StringMatcher.Mode.STARTS_WITH));
} | [
"public",
"static",
"<",
"T",
"extends",
"NamedElement",
">",
"ElementMatcher",
".",
"Junction",
"<",
"T",
">",
"nameStartsWith",
"(",
"String",
"prefix",
")",
"{",
"return",
"new",
"NameMatcher",
"<",
"T",
">",
"(",
"new",
"StringMatcher",
"(",
"prefix",
... | Matches a {@link NamedElement} for its name's prefix.
@param prefix The expected name's prefix.
@param <T> The type of the matched object.
@return An element matcher for a named element's name's prefix. | [
"Matches",
"a",
"{",
"@link",
"NamedElement",
"}",
"for",
"its",
"name",
"s",
"prefix",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java#L677-L679 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.lockTrigger | protected boolean lockTrigger(TriggerKey triggerKey, T jedis) {
"""
Lock the trigger with the given key to the current jobstore instance
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return true if lock was acquired successfully; false otherwise
"""
re... | java | protected boolean lockTrigger(TriggerKey triggerKey, T jedis){
return jedis.set(redisSchema.triggerLockKey(triggerKey), schedulerInstanceId, "NX", "PX", TRIGGER_LOCK_TIMEOUT).equals("OK");
} | [
"protected",
"boolean",
"lockTrigger",
"(",
"TriggerKey",
"triggerKey",
",",
"T",
"jedis",
")",
"{",
"return",
"jedis",
".",
"set",
"(",
"redisSchema",
".",
"triggerLockKey",
"(",
"triggerKey",
")",
",",
"schedulerInstanceId",
",",
"\"NX\"",
",",
"\"PX\"",
","... | Lock the trigger with the given key to the current jobstore instance
@param triggerKey the key of the desired trigger
@param jedis a thread-safe Redis connection
@return true if lock was acquired successfully; false otherwise | [
"Lock",
"the",
"trigger",
"with",
"the",
"given",
"key",
"to",
"the",
"current",
"jobstore",
"instance"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L789-L791 |
vincentk/joptimizer | src/main/java/com/joptimizer/util/ColtUtils.java | ColtUtils.diagonalMatrixMult | public static final DoubleMatrix1D diagonalMatrixMult(DoubleMatrix1D diagonalM, DoubleMatrix1D vector) {
"""
Matrix-vector multiplication with diagonal matrix.
@param diagonalM diagonal matrix M, in the form of a vector of its diagonal elements
@param vector
@return M.x
"""
int n = diagonalM.size();
D... | java | public static final DoubleMatrix1D diagonalMatrixMult(DoubleMatrix1D diagonalM, DoubleMatrix1D vector){
int n = diagonalM.size();
DoubleMatrix1D ret = DoubleFactory1D.dense.make(n);
for(int i=0; i<n; i++){
ret.setQuick(i, diagonalM.getQuick(i) * vector.getQuick(i));
}
return ret;
} | [
"public",
"static",
"final",
"DoubleMatrix1D",
"diagonalMatrixMult",
"(",
"DoubleMatrix1D",
"diagonalM",
",",
"DoubleMatrix1D",
"vector",
")",
"{",
"int",
"n",
"=",
"diagonalM",
".",
"size",
"(",
")",
";",
"DoubleMatrix1D",
"ret",
"=",
"DoubleFactory1D",
".",
"d... | Matrix-vector multiplication with diagonal matrix.
@param diagonalM diagonal matrix M, in the form of a vector of its diagonal elements
@param vector
@return M.x | [
"Matrix",
"-",
"vector",
"multiplication",
"with",
"diagonal",
"matrix",
"."
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/util/ColtUtils.java#L47-L54 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WListRenderer.java | WListRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WList.
@param component the WList to paint.
@param renderContext the RenderContext to paint to.
"""
WList list = (WList) component;
XmlStringBuilder xml = renderContext.getWriter(... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WList list = (WList) component;
XmlStringBuilder xml = renderContext.getWriter();
WList.Type type = list.getType();
WList.Separator separator = list.getSeparator();
Size gap = list.getSpace();
String gapSt... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WList",
"list",
"=",
"(",
"WList",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".... | Paints the given WList.
@param component the WList to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WList",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WListRenderer.java#L28-L92 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java | Modifiers.setInterface | public static int setInterface(int modifier, boolean b) {
"""
When set as an interface, non-interface settings are cleared and the
modifier is set abstract.
"""
if (b) {
return (modifier | (INTERFACE | ABSTRACT)) &
(~FINAL & ~SYNCHRONIZED & ~VOLATILE & ~TRANSIENT & ~NATIVE... | java | public static int setInterface(int modifier, boolean b) {
if (b) {
return (modifier | (INTERFACE | ABSTRACT)) &
(~FINAL & ~SYNCHRONIZED & ~VOLATILE & ~TRANSIENT & ~NATIVE);
}
else {
return modifier & ~INTERFACE;
}
} | [
"public",
"static",
"int",
"setInterface",
"(",
"int",
"modifier",
",",
"boolean",
"b",
")",
"{",
"if",
"(",
"b",
")",
"{",
"return",
"(",
"modifier",
"|",
"(",
"INTERFACE",
"|",
"ABSTRACT",
")",
")",
"&",
"(",
"~",
"FINAL",
"&",
"~",
"SYNCHRONIZED",... | When set as an interface, non-interface settings are cleared and the
modifier is set abstract. | [
"When",
"set",
"as",
"an",
"interface",
"non",
"-",
"interface",
"settings",
"are",
"cleared",
"and",
"the",
"modifier",
"is",
"set",
"abstract",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/Modifiers.java#L147-L155 |
lazy-koala/java-toolkit | fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/xml/XMLBeanUtil.java | XMLBeanUtil.xml2Bean | public static <T> T xml2Bean(String xmlRoot, String xml, Class<T> clazz, boolean isIgnoreUnknownEles) {
"""
将xml转java对象
<p>Function: xml2Bean</p>
<p>Description: </p>
@param xmlRoot xml根节点名
@param xml
@param clazz 对应的java对象
@param isIgnoreUnknownEles 是否容错(如果不允许容错,xml报文中有的节点 java对象... | java | public static <T> T xml2Bean(String xmlRoot, String xml, Class<T> clazz, boolean isIgnoreUnknownEles) {
XStream xStream = xStreamInstance.get(clazz);
if (xStream == null) {
xStream = new XStream(new DomDriver(ENCODING));
xStream.alias(xmlRoot, clazz);
if (isIgnoreUnkn... | [
"public",
"static",
"<",
"T",
">",
"T",
"xml2Bean",
"(",
"String",
"xmlRoot",
",",
"String",
"xml",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"boolean",
"isIgnoreUnknownEles",
")",
"{",
"XStream",
"xStream",
"=",
"xStreamInstance",
".",
"get",
"(",
"cla... | 将xml转java对象
<p>Function: xml2Bean</p>
<p>Description: </p>
@param xmlRoot xml根节点名
@param xml
@param clazz 对应的java对象
@param isIgnoreUnknownEles 是否容错(如果不允许容错,xml报文中有的节点 java对象中没有将抛异常)
@return
@author acexy@thankjava.com
@date 2016年8月12日 下午3:14:40
@version 1.0 | [
"将xml转java对象",
"<p",
">",
"Function",
":",
"xml2Bean<",
"/",
"p",
">",
"<p",
">",
"Description",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/lazy-koala/java-toolkit/blob/f46055fae0cc73049597a3708e515f5c6582d27a/fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/xml/XMLBeanUtil.java#L40-L50 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java | ScopedServletUtils.getScopedSessionAttr | public static Object getScopedSessionAttr( String attrName, HttpServletRequest request ) {
"""
If the request is a ScopedRequest, this returns an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#getAttribute}.
@exclude
"""
Http... | java | public static Object getScopedSessionAttr( String attrName, HttpServletRequest request )
{
HttpSession session = request.getSession( false );
if ( session != null )
{
return session.getAttribute( getScopedSessionAttrName( attrName, request ) );
}
else
... | [
"public",
"static",
"Object",
"getScopedSessionAttr",
"(",
"String",
"attrName",
",",
"HttpServletRequest",
"request",
")",
"{",
"HttpSession",
"session",
"=",
"request",
".",
"getSession",
"(",
"false",
")",
";",
"if",
"(",
"session",
"!=",
"null",
")",
"{",
... | If the request is a ScopedRequest, this returns an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#getAttribute}.
@exclude | [
"If",
"the",
"request",
"is",
"a",
"ScopedRequest",
"this",
"returns",
"an",
"attribute",
"whose",
"name",
"is",
"scoped",
"to",
"that",
"request",
"s",
"scope",
"-",
"ID",
";",
"otherwise",
"it",
"is",
"a",
"straight",
"passthrough",
"to",
"{",
"@link",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L310-L322 |
ACRA/acra | acra-core/src/main/java/org/acra/attachment/AcraContentProvider.java | AcraContentProvider.getUriForFile | @NonNull
public static Uri getUriForFile(@NonNull Context context, @NonNull File file) {
"""
Get an uri for this content provider for the given file
@param context a context
@param file the file
@return the uri
"""
return getUriForFile(context, Directory.ROOT, file.getPath());
} | java | @NonNull
public static Uri getUriForFile(@NonNull Context context, @NonNull File file) {
return getUriForFile(context, Directory.ROOT, file.getPath());
} | [
"@",
"NonNull",
"public",
"static",
"Uri",
"getUriForFile",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"File",
"file",
")",
"{",
"return",
"getUriForFile",
"(",
"context",
",",
"Directory",
".",
"ROOT",
",",
"file",
".",
"getPath",
"("... | Get an uri for this content provider for the given file
@param context a context
@param file the file
@return the uri | [
"Get",
"an",
"uri",
"for",
"this",
"content",
"provider",
"for",
"the",
"given",
"file"
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/attachment/AcraContentProvider.java#L209-L212 |
ddf-project/DDF | core/src/main/java/io/basic/ddf/BasicDDF.java | BasicDDF.afterDeserialization | @Override
public ISerializable afterDeserialization(ISerializable deserializedObject, Object serializationData)
throws DDFException {
"""
Special case: if we hold a single object of type IPersistible, then some magic happens: we will return *that*
object as a result of the deserialization, instead of this... | java | @Override
public ISerializable afterDeserialization(ISerializable deserializedObject, Object serializationData)
throws DDFException {
try {
if (!Strings.isNullOrEmpty(mUnitTypeName)) {
mUnitType = Class.forName(mUnitTypeName);
}
if (mData != null) {
this.setList(mData, mU... | [
"@",
"Override",
"public",
"ISerializable",
"afterDeserialization",
"(",
"ISerializable",
"deserializedObject",
",",
"Object",
"serializationData",
")",
"throws",
"DDFException",
"{",
"try",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"mUnitTypeName",
... | Special case: if we hold a single object of type IPersistible, then some magic happens: we will return *that*
object as a result of the deserialization, instead of this DDF itself. This makes it possible for clients to do
things like<br/>
<code>
PersistenceUri uri = model.persist();
Model model = (Model) ddfManager.loa... | [
"Special",
"case",
":",
"if",
"we",
"hold",
"a",
"single",
"object",
"of",
"type",
"IPersistible",
"then",
"some",
"magic",
"happens",
":",
"we",
"will",
"return",
"*",
"that",
"*",
"object",
"as",
"a",
"result",
"of",
"the",
"deserialization",
"instead",
... | train | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/basic/ddf/BasicDDF.java#L139-L166 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/ReflectionHelper.java | ReflectionHelper.createInstance | public static Object createInstance(Class<?> type) {
"""
This function creates a new instance of the requested type.
@param type
The class type
@return The instance
"""
Object instance=null;
try
{
//create instance
instance=type.newInstance();
}
... | java | public static Object createInstance(Class<?> type)
{
Object instance=null;
try
{
//create instance
instance=type.newInstance();
}
catch(Exception exception)
{
throw new FaxException("Unable to create new instance of type: "+type,exc... | [
"public",
"static",
"Object",
"createInstance",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Object",
"instance",
"=",
"null",
";",
"try",
"{",
"//create instance",
"instance",
"=",
"type",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Except... | This function creates a new instance of the requested type.
@param type
The class type
@return The instance | [
"This",
"function",
"creates",
"a",
"new",
"instance",
"of",
"the",
"requested",
"type",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/ReflectionHelper.java#L69-L83 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseScsr2csru | public static int cusparseScsr2csru(
cusparseHandle handle,
int m,
int n,
int nnz,
cusparseMatDescr descrA,
Pointer csrVal,
Pointer csrRowPtr,
Pointer csrColInd,
csru2csrInfo info,
Pointer pBuffer) {
"""
Description:... | java | public static int cusparseScsr2csru(
cusparseHandle handle,
int m,
int n,
int nnz,
cusparseMatDescr descrA,
Pointer csrVal,
Pointer csrRowPtr,
Pointer csrColInd,
csru2csrInfo info,
Pointer pBuffer)
{
return ... | [
"public",
"static",
"int",
"cusparseScsr2csru",
"(",
"cusparseHandle",
"handle",
",",
"int",
"m",
",",
"int",
"n",
",",
"int",
"nnz",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrVal",
",",
"Pointer",
"csrRowPtr",
",",
"Pointer",
"csrColInd",
",",
... | Description: Wrapper that un-sorts sparse matrix stored in CSR format
(without exposing the permutation). | [
"Description",
":",
"Wrapper",
"that",
"un",
"-",
"sorts",
"sparse",
"matrix",
"stored",
"in",
"CSR",
"format",
"(",
"without",
"exposing",
"the",
"permutation",
")",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L14494-L14507 |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/universal/UniversalIdStrQueueMessage.java | UniversalIdStrQueueMessage.newInstance | public static UniversalIdStrQueueMessage newInstance(String id, String content) {
"""
Create a new {@link UniversalIdStrQueueMessage} object with specified id
and content.
@param id
@param content
@return
@since 0.7.0
"""
UniversalIdStrQueueMessage msg = newInstance(content);
msg.setId(i... | java | public static UniversalIdStrQueueMessage newInstance(String id, String content) {
UniversalIdStrQueueMessage msg = newInstance(content);
msg.setId(id);
return msg;
} | [
"public",
"static",
"UniversalIdStrQueueMessage",
"newInstance",
"(",
"String",
"id",
",",
"String",
"content",
")",
"{",
"UniversalIdStrQueueMessage",
"msg",
"=",
"newInstance",
"(",
"content",
")",
";",
"msg",
".",
"setId",
"(",
"id",
")",
";",
"return",
"ms... | Create a new {@link UniversalIdStrQueueMessage} object with specified id
and content.
@param id
@param content
@return
@since 0.7.0 | [
"Create",
"a",
"new",
"{",
"@link",
"UniversalIdStrQueueMessage",
"}",
"object",
"with",
"specified",
"id",
"and",
"content",
"."
] | train | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/universal/UniversalIdStrQueueMessage.java#L54-L58 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getSummoners | public Future<Map<Integer, Summoner>> getSummoners(Integer... ids) {
"""
Get summoner information for the summoners with the specified ids
@param ids The ids of the summoners
@return A map, mapping player ids to summoner information
@see <a href=https://developer.riotgames.com/api/methods#!/620/1931>Official AP... | java | public Future<Map<Integer, Summoner>> getSummoners(Integer... ids) {
return new ApiFuture<>(() -> handler.getSummoners(ids));
} | [
"public",
"Future",
"<",
"Map",
"<",
"Integer",
",",
"Summoner",
">",
">",
"getSummoners",
"(",
"Integer",
"...",
"ids",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getSummoners",
"(",
"ids",
")",
")",
";",
"}"... | Get summoner information for the summoners with the specified ids
@param ids The ids of the summoners
@return A map, mapping player ids to summoner information
@see <a href=https://developer.riotgames.com/api/methods#!/620/1931>Official API documentation</a> | [
"Get",
"summoner",
"information",
"for",
"the",
"summoners",
"with",
"the",
"specified",
"ids"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L1111-L1113 |
hal/core | gui/src/main/java/org/jboss/as/console/client/tools/ModelBrowserView.java | ModelBrowserView.onViewChild | @Override
public void onViewChild(ModelNode address, String childName) {
"""
Child selection within editor components (outside left hand tree)
@param address
@param childName
"""
TreeItem rootNode = findTreeItem(tree, address);
TreeItem childNode = null;
for(int i=0; i<rootNode.ge... | java | @Override
public void onViewChild(ModelNode address, String childName) {
TreeItem rootNode = findTreeItem(tree, address);
TreeItem childNode = null;
for(int i=0; i<rootNode.getChildCount(); i++)
{
TreeItem candidate = rootNode.getChild(i);
if(childName.equals(... | [
"@",
"Override",
"public",
"void",
"onViewChild",
"(",
"ModelNode",
"address",
",",
"String",
"childName",
")",
"{",
"TreeItem",
"rootNode",
"=",
"findTreeItem",
"(",
"tree",
",",
"address",
")",
";",
"TreeItem",
"childNode",
"=",
"null",
";",
"for",
"(",
... | Child selection within editor components (outside left hand tree)
@param address
@param childName | [
"Child",
"selection",
"within",
"editor",
"components",
"(",
"outside",
"left",
"hand",
"tree",
")"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/tools/ModelBrowserView.java#L298-L324 |
groupon/odo | client/src/main/java/com/groupon/odo/client/PathValueClient.java | PathValueClient.setDefaultCustomResponse | public static boolean setDefaultCustomResponse(String pathValue, String requestType, String customData) {
"""
Sets a custom response on an endpoint using default profile and client
@param pathValue path (endpoint) value
@param requestType path request type. "GET", "POST", etc
@param customData custom response... | java | public static boolean setDefaultCustomResponse(String pathValue, String requestType, String customData) {
try {
JSONObject profile = getDefaultProfile();
String profileName = profile.getString("name");
PathValueClient client = new PathValueClient(profileName, false);
... | [
"public",
"static",
"boolean",
"setDefaultCustomResponse",
"(",
"String",
"pathValue",
",",
"String",
"requestType",
",",
"String",
"customData",
")",
"{",
"try",
"{",
"JSONObject",
"profile",
"=",
"getDefaultProfile",
"(",
")",
";",
"String",
"profileName",
"=",
... | Sets a custom response on an endpoint using default profile and client
@param pathValue path (endpoint) value
@param requestType path request type. "GET", "POST", etc
@param customData custom response data
@return true if success, false otherwise | [
"Sets",
"a",
"custom",
"response",
"on",
"an",
"endpoint",
"using",
"default",
"profile",
"and",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L65-L75 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java | CheckArg.isSame | public static <T> void isSame( final T argument,
String argumentName,
final T object,
String objectName ) {
"""
Asserts that the specified first object is the same as (==) the specified second object.
@param... | java | public static <T> void isSame( final T argument,
String argumentName,
final T object,
String objectName ) {
if (argument != object) {
if (objectName == null) objectName = getObjectName(object);
... | [
"public",
"static",
"<",
"T",
">",
"void",
"isSame",
"(",
"final",
"T",
"argument",
",",
"String",
"argumentName",
",",
"final",
"T",
"object",
",",
"String",
"objectName",
")",
"{",
"if",
"(",
"argument",
"!=",
"object",
")",
"{",
"if",
"(",
"objectNa... | Asserts that the specified first object is the same as (==) the specified second object.
@param <T>
@param argument The argument to assert as the same as <code>object</code>.
@param argumentName The name that will be used within the exception message for the argument should an exception be thrown
@param object The obj... | [
"Asserts",
"that",
"the",
"specified",
"first",
"object",
"is",
"the",
"same",
"as",
"(",
"==",
")",
"the",
"specified",
"second",
"object",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java#L472-L480 |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createPatchMethod | public HttpPatch createPatchMethod(final String path, final String sparqlUpdate) throws FedoraException {
"""
Create a request to update triples with SPARQL Update.
@param path The datastream path.
@param sparqlUpdate SPARQL Update command.
@return created patch based on parameters
@throws FedoraException
... | java | public HttpPatch createPatchMethod(final String path, final String sparqlUpdate) throws FedoraException {
if ( isBlank(sparqlUpdate) ) {
throw new FedoraException("SPARQL Update command must not be blank");
}
final HttpPatch patch = new HttpPatch(repositoryURL + path);
patch... | [
"public",
"HttpPatch",
"createPatchMethod",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"sparqlUpdate",
")",
"throws",
"FedoraException",
"{",
"if",
"(",
"isBlank",
"(",
"sparqlUpdate",
")",
")",
"{",
"throw",
"new",
"FedoraException",
"(",
"\"SPARQL... | Create a request to update triples with SPARQL Update.
@param path The datastream path.
@param sparqlUpdate SPARQL Update command.
@return created patch based on parameters
@throws FedoraException | [
"Create",
"a",
"request",
"to",
"update",
"triples",
"with",
"SPARQL",
"Update",
"."
] | train | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L244-L253 |
bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java | DataStoreStreaming.updateAllForFacade | public static void updateAllForFacade(DataStore dataStore, Iterable<Update> updates) {
"""
Creates, updates or deletes zero or more pieces of content in the data store facades.
"""
updateAllForFacade(dataStore, updates.iterator());
} | java | public static void updateAllForFacade(DataStore dataStore, Iterable<Update> updates) {
updateAllForFacade(dataStore, updates.iterator());
} | [
"public",
"static",
"void",
"updateAllForFacade",
"(",
"DataStore",
"dataStore",
",",
"Iterable",
"<",
"Update",
">",
"updates",
")",
"{",
"updateAllForFacade",
"(",
"dataStore",
",",
"updates",
".",
"iterator",
"(",
")",
")",
";",
"}"
] | Creates, updates or deletes zero or more pieces of content in the data store facades. | [
"Creates",
"updates",
"or",
"deletes",
"zero",
"or",
"more",
"pieces",
"of",
"content",
"in",
"the",
"data",
"store",
"facades",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStreaming.java#L174-L176 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.skipNonBlanks | private static int skipNonBlanks(String s, int p) {
"""
Skips non-blanks (no-white space) in string s starting at position p.
"""
while (p < s.length() && !Character.isWhitespace(s.charAt(p)))
p++;
return p;
} | java | private static int skipNonBlanks(String s, int p) {
while (p < s.length() && !Character.isWhitespace(s.charAt(p)))
p++;
return p;
} | [
"private",
"static",
"int",
"skipNonBlanks",
"(",
"String",
"s",
",",
"int",
"p",
")",
"{",
"while",
"(",
"p",
"<",
"s",
".",
"length",
"(",
")",
"&&",
"!",
"Character",
".",
"isWhitespace",
"(",
"s",
".",
"charAt",
"(",
"p",
")",
")",
")",
"p",
... | Skips non-blanks (no-white space) in string s starting at position p. | [
"Skips",
"non",
"-",
"blanks",
"(",
"no",
"-",
"white",
"space",
")",
"in",
"string",
"s",
"starting",
"at",
"position",
"p",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1568-L1572 |
wildfly/wildfly-core | elytron/src/main/java/org/wildfly/extension/elytron/CertificateChainAttributeDefinitions.java | CertificateChainAttributeDefinitions.writeCertificates | static void writeCertificates(final ModelNode result, final Certificate[] certificates) throws CertificateEncodingException, NoSuchAlgorithmException {
"""
Populate the supplied response with the model representation of the certificates.
@param result the response to populate.
@param certificates the certifica... | java | static void writeCertificates(final ModelNode result, final Certificate[] certificates) throws CertificateEncodingException, NoSuchAlgorithmException {
if (certificates != null) {
for (Certificate current : certificates) {
ModelNode certificate = new ModelNode();
writ... | [
"static",
"void",
"writeCertificates",
"(",
"final",
"ModelNode",
"result",
",",
"final",
"Certificate",
"[",
"]",
"certificates",
")",
"throws",
"CertificateEncodingException",
",",
"NoSuchAlgorithmException",
"{",
"if",
"(",
"certificates",
"!=",
"null",
")",
"{",... | Populate the supplied response with the model representation of the certificates.
@param result the response to populate.
@param certificates the certificates to add to the response.
@throws CertificateEncodingException
@throws NoSuchAlgorithmException | [
"Populate",
"the",
"supplied",
"response",
"with",
"the",
"model",
"representation",
"of",
"the",
"certificates",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/elytron/src/main/java/org/wildfly/extension/elytron/CertificateChainAttributeDefinitions.java#L156-L164 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsAreaSelectPanel.java | CmsAreaSelectPanel.moveTo | private void moveTo(int posX, int posY) {
"""
Moves the select area to the specified position, while keeping the size.<p>
@param posX the new X position
@param posY the new Y position
"""
posX = (posX < 0)
? 0
: (((posX + m_currentSelection.getWidth()) >= m_elementWidth)
? ... | java | private void moveTo(int posX, int posY) {
posX = (posX < 0)
? 0
: (((posX + m_currentSelection.getWidth()) >= m_elementWidth)
? m_elementWidth - m_currentSelection.getWidth()
: posX);
posY = (posY < 0)
? 0
: (((posY + m_currentSelection.getHeight()) >= m_... | [
"private",
"void",
"moveTo",
"(",
"int",
"posX",
",",
"int",
"posY",
")",
"{",
"posX",
"=",
"(",
"posX",
"<",
"0",
")",
"?",
"0",
":",
"(",
"(",
"(",
"posX",
"+",
"m_currentSelection",
".",
"getWidth",
"(",
")",
")",
">=",
"m_elementWidth",
")",
... | Moves the select area to the specified position, while keeping the size.<p>
@param posX the new X position
@param posY the new Y position | [
"Moves",
"the",
"select",
"area",
"to",
"the",
"specified",
"position",
"while",
"keeping",
"the",
"size",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsAreaSelectPanel.java#L689-L717 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/tools/Model.java | Model.setTrackStart | public void setTrackStart(final double TRACK_START) {
"""
Sets the track start value of the gauge to the given value
@param TRACK_START
"""
// check values
if (Double.compare(TRACK_START, trackStop) == 0) {
throw new IllegalArgumentException("Track start value cannot equal track st... | java | public void setTrackStart(final double TRACK_START) {
// check values
if (Double.compare(TRACK_START, trackStop) == 0) {
throw new IllegalArgumentException("Track start value cannot equal track stop value");
}
trackStart = TRACK_START;
validate();
fireStateCha... | [
"public",
"void",
"setTrackStart",
"(",
"final",
"double",
"TRACK_START",
")",
"{",
"// check values",
"if",
"(",
"Double",
".",
"compare",
"(",
"TRACK_START",
",",
"trackStop",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Trac... | Sets the track start value of the gauge to the given value
@param TRACK_START | [
"Sets",
"the",
"track",
"start",
"value",
"of",
"the",
"gauge",
"to",
"the",
"given",
"value"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/Model.java#L1408-L1416 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addTextField | public Input addTextField(String tag,
String label,
int length,
String value) {
"""
Add a Text Entry Field.
@param tag The form name of the element
@param label The label for the element in the table.
"""
Input... | java | public Input addTextField(String tag,
String label,
int length,
String value)
{
Input i = new Input(Input.Text,tag,value);
i.setSize(length);
addField(label,i);
return i;
} | [
"public",
"Input",
"addTextField",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"int",
"length",
",",
"String",
"value",
")",
"{",
"Input",
"i",
"=",
"new",
"Input",
"(",
"Input",
".",
"Text",
",",
"tag",
",",
"value",
")",
";",
"i",
".",
"se... | Add a Text Entry Field.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"Text",
"Entry",
"Field",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L68-L77 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.substituteLinkForUnknownTarget | public String substituteLinkForUnknownTarget(
CmsObject cms,
String link,
String targetDetailPage,
boolean forceSecure) {
"""
Returns a link <i>from</i> the URI stored in the provided OpenCms user context
<i>to</i> the given <code>link</code>, for use on web pages.<p>
A number o... | java | public String substituteLinkForUnknownTarget(
CmsObject cms,
String link,
String targetDetailPage,
boolean forceSecure) {
if (CmsStringUtil.isEmpty(link)) {
return "";
}
String sitePath = link;
String siteRoot = null;
if (hasScheme(lin... | [
"public",
"String",
"substituteLinkForUnknownTarget",
"(",
"CmsObject",
"cms",
",",
"String",
"link",
",",
"String",
"targetDetailPage",
",",
"boolean",
"forceSecure",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"link",
")",
")",
"{",
"return",
... | Returns a link <i>from</i> the URI stored in the provided OpenCms user context
<i>to</i> the given <code>link</code>, for use on web pages.<p>
A number of tests are performed with the <code>link</code> in order to find out how to create the link:<ul>
<li>If <code>link</code> is empty, an empty String is returned.
<li>... | [
"Returns",
"a",
"link",
"<i",
">",
"from<",
"/",
"i",
">",
"the",
"URI",
"stored",
"in",
"the",
"provided",
"OpenCms",
"user",
"context",
"<i",
">",
"to<",
"/",
"i",
">",
"the",
"given",
"<code",
">",
"link<",
"/",
"code",
">",
"for",
"use",
"on",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L922-L953 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.notifyParentRangeInserted | @UiThread
public void notifyParentRangeInserted(int parentPositionStart, int itemCount) {
"""
Notify any registered observers that the currently reflected {@code itemCount}
parents starting at {@code parentPositionStart} have been newly inserted.
The parents previously located at {@code parentPositionStart} ... | java | @UiThread
public void notifyParentRangeInserted(int parentPositionStart, int itemCount) {
int initialFlatParentPosition;
if (parentPositionStart < mParentList.size() - itemCount) {
initialFlatParentPosition = getFlatParentPosition(parentPositionStart);
} else {
initia... | [
"@",
"UiThread",
"public",
"void",
"notifyParentRangeInserted",
"(",
"int",
"parentPositionStart",
",",
"int",
"itemCount",
")",
"{",
"int",
"initialFlatParentPosition",
";",
"if",
"(",
"parentPositionStart",
"<",
"mParentList",
".",
"size",
"(",
")",
"-",
"itemCo... | Notify any registered observers that the currently reflected {@code itemCount}
parents starting at {@code parentPositionStart} have been newly inserted.
The parents previously located at {@code parentPositionStart} and beyond
can now be found starting at position {@code parentPositionStart + itemCount}.
<p>
This is a s... | [
"Notify",
"any",
"registered",
"observers",
"that",
"the",
"currently",
"reflected",
"{",
"@code",
"itemCount",
"}",
"parents",
"starting",
"at",
"{",
"@code",
"parentPositionStart",
"}",
"have",
"been",
"newly",
"inserted",
".",
"The",
"parents",
"previously",
... | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L883-L904 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/evictor/GreedyEvictor.java | GreedyEvictor.selectEvictableDirFromTier | private StorageDirView selectEvictableDirFromTier(StorageTierView tierView, long availableBytes) {
"""
Selects a dir with enough space (including space evictable) from a given tier
"""
for (StorageDirView dirView : tierView.getDirViews()) {
if (canEvictBlocksFromDir(dirView, availableBytes)) {
... | java | private StorageDirView selectEvictableDirFromTier(StorageTierView tierView, long availableBytes) {
for (StorageDirView dirView : tierView.getDirViews()) {
if (canEvictBlocksFromDir(dirView, availableBytes)) {
return dirView;
}
}
return null;
} | [
"private",
"StorageDirView",
"selectEvictableDirFromTier",
"(",
"StorageTierView",
"tierView",
",",
"long",
"availableBytes",
")",
"{",
"for",
"(",
"StorageDirView",
"dirView",
":",
"tierView",
".",
"getDirViews",
"(",
")",
")",
"{",
"if",
"(",
"canEvictBlocksFromDi... | Selects a dir with enough space (including space evictable) from a given tier | [
"Selects",
"a",
"dir",
"with",
"enough",
"space",
"(",
"including",
"space",
"evictable",
")",
"from",
"a",
"given",
"tier"
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/evictor/GreedyEvictor.java#L149-L156 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java | ApacheHTTPClient.appendBaseURL | protected void appendBaseURL(StringBuilder buffer,String resource,HTTPClientConfiguration configuration) {
"""
This function appends the base URL (protocol, host, port and resource) to the
provided buffer.
@param buffer
The buffer to update
@param resource
The HTTP resource
@param configuration
The ... | java | protected void appendBaseURL(StringBuilder buffer,String resource,HTTPClientConfiguration configuration)
{
buffer.append("http");
if(configuration.isSSL())
{
buffer.append("s");
}
buffer.append("://");
buffer.append(configuration.getHostName());
in... | [
"protected",
"void",
"appendBaseURL",
"(",
"StringBuilder",
"buffer",
",",
"String",
"resource",
",",
"HTTPClientConfiguration",
"configuration",
")",
"{",
"buffer",
".",
"append",
"(",
"\"http\"",
")",
";",
"if",
"(",
"configuration",
".",
"isSSL",
"(",
")",
... | This function appends the base URL (protocol, host, port and resource) to the
provided buffer.
@param buffer
The buffer to update
@param resource
The HTTP resource
@param configuration
The HTTP configuration | [
"This",
"function",
"appends",
"the",
"base",
"URL",
"(",
"protocol",
"host",
"port",
"and",
"resource",
")",
"to",
"the",
"provided",
"buffer",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java#L130-L153 |
alkacon/opencms-core | src/org/opencms/ui/apps/searchindex/CmsSearchIndexTable.java | CmsSearchIndexTable.showSourcesWindow | void showSourcesWindow(String resource) {
"""
Shows dialog for variations of given resource.<p>
@param resource to show variations for
"""
final Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
CmsSourceDialog sourceDialog = new CmsSourceDialog(m_manager, new Runnable() {
... | java | void showSourcesWindow(String resource) {
final Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
CmsSourceDialog sourceDialog = new CmsSourceDialog(m_manager, new Runnable() {
public void run() {
window.close();
}
});
sourceDialog... | [
"void",
"showSourcesWindow",
"(",
"String",
"resource",
")",
"{",
"final",
"Window",
"window",
"=",
"CmsBasicDialog",
".",
"prepareWindow",
"(",
"DialogWidth",
".",
"wide",
")",
";",
"CmsSourceDialog",
"sourceDialog",
"=",
"new",
"CmsSourceDialog",
"(",
"m_manager... | Shows dialog for variations of given resource.<p>
@param resource to show variations for | [
"Shows",
"dialog",
"for",
"variations",
"of",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/searchindex/CmsSearchIndexTable.java#L408-L422 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.arrayAsString | public static String arrayAsString(final String[] arg, String separator) {
"""
Returns a string representation for the given array using the given separator.<p>
@param arg the array to transform to a String
@param separator the item separator
@return the String of the given array
"""
StringBuff... | java | public static String arrayAsString(final String[] arg, String separator) {
StringBuffer result = new StringBuffer();
for (int i = 0; i < arg.length; i++) {
result.append(arg[i]);
if ((i + 1) < arg.length) {
result.append(separator);
}
}
... | [
"public",
"static",
"String",
"arrayAsString",
"(",
"final",
"String",
"[",
"]",
"arg",
",",
"String",
"separator",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arg",
... | Returns a string representation for the given array using the given separator.<p>
@param arg the array to transform to a String
@param separator the item separator
@return the String of the given array | [
"Returns",
"a",
"string",
"representation",
"for",
"the",
"given",
"array",
"using",
"the",
"given",
"separator",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L227-L237 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/GameService.java | GameService.joinGame | public Object joinGame(long id, String password) {
"""
Join a password-protected game.
@param id The id of the game
@param password The password of the game
@return unknown
"""
return client.sendRpcAndWait(SERVICE, "joinGame", id, password);
} | java | public Object joinGame(long id, String password) {
return client.sendRpcAndWait(SERVICE, "joinGame", id, password);
} | [
"public",
"Object",
"joinGame",
"(",
"long",
"id",
",",
"String",
"password",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"joinGame\"",
",",
"id",
",",
"password",
")",
";",
"}"
] | Join a password-protected game.
@param id The id of the game
@param password The password of the game
@return unknown | [
"Join",
"a",
"password",
"-",
"protected",
"game",
"."
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/GameService.java#L59-L61 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/EmoPermission.java | EmoPermission.toPart | @Override
protected MatchingPart toPart(List<MatchingPart> leadingParts, String part) {
"""
Override the logic in the parent to meet the requirements for EmoPermission.
"""
switch (leadingParts.size()) {
case 0:
// The first part must either be a constant or a pure wildc... | java | @Override
protected MatchingPart toPart(List<MatchingPart> leadingParts, String part) {
switch (leadingParts.size()) {
case 0:
// The first part must either be a constant or a pure wildcard; expressions such as
// <code>if(or("sor","blob"))</code> are not permitte... | [
"@",
"Override",
"protected",
"MatchingPart",
"toPart",
"(",
"List",
"<",
"MatchingPart",
">",
"leadingParts",
",",
"String",
"part",
")",
"{",
"switch",
"(",
"leadingParts",
".",
"size",
"(",
")",
")",
"{",
"case",
"0",
":",
"// The first part must either be ... | Override the logic in the parent to meet the requirements for EmoPermission. | [
"Override",
"the",
"logic",
"in",
"the",
"parent",
"to",
"meet",
"the",
"requirements",
"for",
"EmoPermission",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/EmoPermission.java#L86-L126 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.updateCookieCache | protected synchronized void updateCookieCache(ByteArray cookieBytes, String cookieByteString) {
"""
Perform some cookie cache maintenance. If the cookie cache has grown too
large, clear it. Otherwise, store the cookieByteString into the cache
based on the cookieBytes.
@param cookieBytes
@param cookieByteStri... | java | protected synchronized void updateCookieCache(ByteArray cookieBytes, String cookieByteString) {
if (cookieByteStringCache.size() > MAX_COOKIE_STRING_ENTRIES)
cookieByteStringCache.clear();
if (cookieByteString != null)
cookieByteStringCache.put(cookieBytes, cookieByteString);
... | [
"protected",
"synchronized",
"void",
"updateCookieCache",
"(",
"ByteArray",
"cookieBytes",
",",
"String",
"cookieByteString",
")",
"{",
"if",
"(",
"cookieByteStringCache",
".",
"size",
"(",
")",
">",
"MAX_COOKIE_STRING_ENTRIES",
")",
"cookieByteStringCache",
".",
"cle... | Perform some cookie cache maintenance. If the cookie cache has grown too
large, clear it. Otherwise, store the cookieByteString into the cache
based on the cookieBytes.
@param cookieBytes
@param cookieByteString | [
"Perform",
"some",
"cookie",
"cache",
"maintenance",
".",
"If",
"the",
"cookie",
"cache",
"has",
"grown",
"too",
"large",
"clear",
"it",
".",
"Otherwise",
"store",
"the",
"cookieByteString",
"into",
"the",
"cache",
"based",
"on",
"the",
"cookieBytes",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L252-L257 |
cogroo/cogroo4 | cogroo-gc/src/main/java/org/cogroo/tools/checker/rules/util/EqualsUtils.java | EqualsUtils.areBooleanEquals | public static boolean areBooleanEquals(Boolean boolean1, Boolean boolean2) {
"""
Checks if two Booleans are equals.
The booleans can be both null, one of them null or none of them null.
@param boolean1 from tree tree element
@param boolean2 from rule element
@return true if and only if the two booleans are e... | java | public static boolean areBooleanEquals(Boolean boolean1, Boolean boolean2) {
if (boolean1 != null && !boolean1.equals(boolean2)) {
return false;
} else if (boolean2 != null && !boolean2.equals(boolean1)) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"areBooleanEquals",
"(",
"Boolean",
"boolean1",
",",
"Boolean",
"boolean2",
")",
"{",
"if",
"(",
"boolean1",
"!=",
"null",
"&&",
"!",
"boolean1",
".",
"equals",
"(",
"boolean2",
")",
")",
"{",
"return",
"false",
";",
"}",
"... | Checks if two Booleans are equals.
The booleans can be both null, one of them null or none of them null.
@param boolean1 from tree tree element
@param boolean2 from rule element
@return true if and only if the two booleans are equal (both equal or both null) | [
"Checks",
"if",
"two",
"Booleans",
"are",
"equals",
".",
"The",
"booleans",
"can",
"be",
"both",
"null",
"one",
"of",
"them",
"null",
"or",
"none",
"of",
"them",
"null",
"."
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-gc/src/main/java/org/cogroo/tools/checker/rules/util/EqualsUtils.java#L135-L142 |
RestComm/Restcomm-Connect | restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/AccountsEndpoint.java | AccountsEndpoint.updateLinkedClient | private void updateLinkedClient(Account account, MultivaluedMap<String, String> data) {
"""
update SIP client of the corresponding Account.Password and FriendlyName fields are synched.
"""
logger.debug("checking linked client");
String email = account.getEmailAddress();
if (email != nul... | java | private void updateLinkedClient(Account account, MultivaluedMap<String, String> data) {
logger.debug("checking linked client");
String email = account.getEmailAddress();
if (email != null && !email.equals("")) {
logger.debug("account email is valid");
String username = em... | [
"private",
"void",
"updateLinkedClient",
"(",
"Account",
"account",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"data",
")",
"{",
"logger",
".",
"debug",
"(",
"\"checking linked client\"",
")",
";",
"String",
"email",
"=",
"account",
".",
"getEma... | update SIP client of the corresponding Account.Password and FriendlyName fields are synched. | [
"update",
"SIP",
"client",
"of",
"the",
"corresponding",
"Account",
".",
"Password",
"and",
"FriendlyName",
"fields",
"are",
"synched",
"."
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/AccountsEndpoint.java#L576-L603 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java | RelationalJMapper.addClasses | private void addClasses(Class<?>[] classes, HashSet<Class<?>> result, String fieldName) {
"""
Adds to the result parameter all classes that aren't present in it
@param classes classes to control
@param result List to enrich
@param fieldName name of file, only for control purpose
"""
if(classes == nul... | java | private void addClasses(Class<?>[] classes, HashSet<Class<?>> result, String fieldName){
if(classes == null || classes.length==0)
Error.classesAbsent(fieldName, configuredClass);
for (Class<?> classe : classes) result.add(classe);
} | [
"private",
"void",
"addClasses",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
",",
"HashSet",
"<",
"Class",
"<",
"?",
">",
">",
"result",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"classes",
"==",
"null",
"||",
"classes",
".",
"length",
... | Adds to the result parameter all classes that aren't present in it
@param classes classes to control
@param result List to enrich
@param fieldName name of file, only for control purpose | [
"Adds",
"to",
"the",
"result",
"parameter",
"all",
"classes",
"that",
"aren",
"t",
"present",
"in",
"it"
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java#L278-L284 |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java | CmsMessageBundleEditorModel.getMasterState | private EditorState getMasterState() {
"""
Returns the master mode's editor state for editing a bundle with descriptor.
@return the master mode's editor state for editing a bundle with descriptor.
"""
List<TableProperty> cols = new ArrayList<TableProperty>(4);
cols.add(TableProperty.KEY);
... | java | private EditorState getMasterState() {
List<TableProperty> cols = new ArrayList<TableProperty>(4);
cols.add(TableProperty.KEY);
cols.add(TableProperty.DESCRIPTION);
cols.add(TableProperty.DEFAULT);
cols.add(TableProperty.TRANSLATION);
return new EditorState(cols, true);
... | [
"private",
"EditorState",
"getMasterState",
"(",
")",
"{",
"List",
"<",
"TableProperty",
">",
"cols",
"=",
"new",
"ArrayList",
"<",
"TableProperty",
">",
"(",
"4",
")",
";",
"cols",
".",
"add",
"(",
"TableProperty",
".",
"KEY",
")",
";",
"cols",
".",
"... | Returns the master mode's editor state for editing a bundle with descriptor.
@return the master mode's editor state for editing a bundle with descriptor. | [
"Returns",
"the",
"master",
"mode",
"s",
"editor",
"state",
"for",
"editing",
"a",
"bundle",
"with",
"descriptor",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java#L1298-L1306 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java | ManagementGroupVertex.insertBackwardEdge | void insertBackwardEdge(final ManagementGroupEdge edge, final int index) {
"""
Inserts a new edge arriving at this group vertex at the given index.
@param edge
the edge to be added
@param index
the index at which the edge shall be added
"""
while (index >= this.backwardEdges.size()) {
this.backward... | java | void insertBackwardEdge(final ManagementGroupEdge edge, final int index) {
while (index >= this.backwardEdges.size()) {
this.backwardEdges.add(null);
}
this.backwardEdges.set(index, edge);
} | [
"void",
"insertBackwardEdge",
"(",
"final",
"ManagementGroupEdge",
"edge",
",",
"final",
"int",
"index",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"backwardEdges",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"backwardEdges",
".",
"add",
"(",
... | Inserts a new edge arriving at this group vertex at the given index.
@param edge
the edge to be added
@param index
the index at which the edge shall be added | [
"Inserts",
"a",
"new",
"edge",
"arriving",
"at",
"this",
"group",
"vertex",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGroupVertex.java#L144-L151 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java | ExtractJobConfiguration.newBuilder | public static Builder newBuilder(TableId sourceTable, String destinationUri) {
"""
Creates a builder for a BigQuery Extract Job configuration given source table and destination
URI.
"""
return newBuilder(sourceTable, ImmutableList.of(checkNotNull(destinationUri)));
} | java | public static Builder newBuilder(TableId sourceTable, String destinationUri) {
return newBuilder(sourceTable, ImmutableList.of(checkNotNull(destinationUri)));
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"sourceTable",
",",
"String",
"destinationUri",
")",
"{",
"return",
"newBuilder",
"(",
"sourceTable",
",",
"ImmutableList",
".",
"of",
"(",
"checkNotNull",
"(",
"destinationUri",
")",
")",
")",
";",
... | Creates a builder for a BigQuery Extract Job configuration given source table and destination
URI. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Extract",
"Job",
"configuration",
"given",
"source",
"table",
"and",
"destination",
"URI",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java#L242-L244 |
CloudSlang/cs-actions | cs-date-time/src/main/java/io/cloudslang/content/datetime/utils/DateTimeUtils.java | DateTimeUtils.getLocaleByCountry | public static Locale getLocaleByCountry(String lang, String country) {
"""
Generates the locale
@param lang the language
@param country the country
@return the locale
"""
return StringUtils.isNotBlank(country) ? new Locale(lang, country) : new Locale(lang);
} | java | public static Locale getLocaleByCountry(String lang, String country) {
return StringUtils.isNotBlank(country) ? new Locale(lang, country) : new Locale(lang);
} | [
"public",
"static",
"Locale",
"getLocaleByCountry",
"(",
"String",
"lang",
",",
"String",
"country",
")",
"{",
"return",
"StringUtils",
".",
"isNotBlank",
"(",
"country",
")",
"?",
"new",
"Locale",
"(",
"lang",
",",
"country",
")",
":",
"new",
"Locale",
"(... | Generates the locale
@param lang the language
@param country the country
@return the locale | [
"Generates",
"the",
"locale"
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-date-time/src/main/java/io/cloudslang/content/datetime/utils/DateTimeUtils.java#L68-L70 |
lucee/Lucee | core/src/main/java/lucee/commons/io/compress/CompressUtil.java | CompressUtil.compressTGZ | public static void compressTGZ(Resource[] sources, Resource target, int mode) throws IOException {
"""
compress a source file/directory to a tar/gzip file
@param sources
@param target
@param mode
@throws IOException
"""
File tmpTarget = File.createTempFile("_temp", "tmp");
try {
// write Tar
... | java | public static void compressTGZ(Resource[] sources, Resource target, int mode) throws IOException {
File tmpTarget = File.createTempFile("_temp", "tmp");
try {
// write Tar
OutputStream tmpOs = new FileOutputStream(tmpTarget);
try {
compressTar(sources, tmpOs, mode);
}
finally {
IOUtil.clo... | [
"public",
"static",
"void",
"compressTGZ",
"(",
"Resource",
"[",
"]",
"sources",
",",
"Resource",
"target",
",",
"int",
"mode",
")",
"throws",
"IOException",
"{",
"File",
"tmpTarget",
"=",
"File",
".",
"createTempFile",
"(",
"\"_temp\"",
",",
"\"tmp\"",
")",... | compress a source file/directory to a tar/gzip file
@param sources
@param target
@param mode
@throws IOException | [
"compress",
"a",
"source",
"file",
"/",
"directory",
"to",
"a",
"tar",
"/",
"gzip",
"file"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/compress/CompressUtil.java#L359-L386 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java | RuleBasedNumberFormat.getRuleSetDisplayName | public String getRuleSetDisplayName(String ruleSetName) {
"""
Return the rule set display name for the provided rule set in the current default <code>DISPLAY</code> locale.
@return the display name for the rule set
@see #getRuleSetDisplayName(String,ULocale)
@see Category#DISPLAY
"""
return getRuleS... | java | public String getRuleSetDisplayName(String ruleSetName) {
return getRuleSetDisplayName(ruleSetName, ULocale.getDefault(Category.DISPLAY));
} | [
"public",
"String",
"getRuleSetDisplayName",
"(",
"String",
"ruleSetName",
")",
"{",
"return",
"getRuleSetDisplayName",
"(",
"ruleSetName",
",",
"ULocale",
".",
"getDefault",
"(",
"Category",
".",
"DISPLAY",
")",
")",
";",
"}"
] | Return the rule set display name for the provided rule set in the current default <code>DISPLAY</code> locale.
@return the display name for the rule set
@see #getRuleSetDisplayName(String,ULocale)
@see Category#DISPLAY | [
"Return",
"the",
"rule",
"set",
"display",
"name",
"for",
"the",
"provided",
"rule",
"set",
"in",
"the",
"current",
"default",
"<code",
">",
"DISPLAY<",
"/",
"code",
">",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java#L1118-L1120 |
facebookarchive/hadoop-20 | src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java | DistributedPentomino.createInputDirectory | private static void createInputDirectory(FileSystem fs,
Path dir,
Pentomino pent,
int depth
) throws IOException {
"""
Create the input file w... | java | private static void createInputDirectory(FileSystem fs,
Path dir,
Pentomino pent,
int depth
) throws IOException {
fs.mkdirs(dir);
List<int... | [
"private",
"static",
"void",
"createInputDirectory",
"(",
"FileSystem",
"fs",
",",
"Path",
"dir",
",",
"Pentomino",
"pent",
",",
"int",
"depth",
")",
"throws",
"IOException",
"{",
"fs",
".",
"mkdirs",
"(",
"dir",
")",
";",
"List",
"<",
"int",
"[",
"]",
... | Create the input file with all of the possible combinations of the
given depth.
@param fs the filesystem to write into
@param dir the directory to write the input file into
@param pent the puzzle
@param depth the depth to explore when generating prefixes | [
"Create",
"the",
"input",
"file",
"with",
"all",
"of",
"the",
"possible",
"combinations",
"of",
"the",
"given",
"depth",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/examples/org/apache/hadoop/examples/dancing/DistributedPentomino.java#L126-L146 |
ogaclejapan/SmartTabLayout | utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java | Bundler.putSerializable | public Bundler putSerializable(String key, Serializable value) {
"""
Inserts a Serializable value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a Serializable object, or null
@return this
"""
... | java | public Bundler putSerializable(String key, Serializable value) {
bundle.putSerializable(key, value);
return this;
} | [
"public",
"Bundler",
"putSerializable",
"(",
"String",
"key",
",",
"Serializable",
"value",
")",
"{",
"bundle",
".",
"putSerializable",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a Serializable value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a Serializable object, or null
@return this | [
"Inserts",
"a",
"Serializable",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/ogaclejapan/SmartTabLayout/blob/712e81a92f1e12a3c33dcbda03d813e0162e8589/utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java#L265-L268 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_statistics_connection_GET | public ArrayList<OvhRtmConnection> serviceName_statistics_connection_GET(String serviceName) throws IOException {
"""
Get server opened connections
REST: GET /dedicated/server/{serviceName}/statistics/connection
@param serviceName [required] The internal name of your dedicated server
"""
String qPath = "... | java | public ArrayList<OvhRtmConnection> serviceName_statistics_connection_GET(String serviceName) throws IOException {
String qPath = "/dedicated/server/{serviceName}/statistics/connection";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t11... | [
"public",
"ArrayList",
"<",
"OvhRtmConnection",
">",
"serviceName_statistics_connection_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/statistics/connection\"",
";",
"StringBuilder",
"sb",
"=",... | Get server opened connections
REST: GET /dedicated/server/{serviceName}/statistics/connection
@param serviceName [required] The internal name of your dedicated server | [
"Get",
"server",
"opened",
"connections"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1499-L1504 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/ImmutableMultiset.java | ImmutableMultiset.of | @SuppressWarnings("unchecked") //
public static <E> ImmutableMultiset<E> of(E e1, E e2) {
"""
Returns an immutable multiset containing the given elements, in order.
@throws NullPointerException if any element is null
@since 6.0 (source-compatible since 2.0)
"""
return copyOfInternal(e1, e2);
} | java | @SuppressWarnings("unchecked") //
public static <E> ImmutableMultiset<E> of(E e1, E e2) {
return copyOfInternal(e1, e2);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"//",
"public",
"static",
"<",
"E",
">",
"ImmutableMultiset",
"<",
"E",
">",
"of",
"(",
"E",
"e1",
",",
"E",
"e2",
")",
"{",
"return",
"copyOfInternal",
"(",
"e1",
",",
"e2",
")",
";",
"}"
] | Returns an immutable multiset containing the given elements, in order.
@throws NullPointerException if any element is null
@since 6.0 (source-compatible since 2.0) | [
"Returns",
"an",
"immutable",
"multiset",
"containing",
"the",
"given",
"elements",
"in",
"order",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/ImmutableMultiset.java#L83-L86 |
martinwithaar/Encryptor4j | src/main/java/org/encryptor4j/DHPeer.java | DHPeer.createKeyPair | public static final KeyPair createKeyPair(BigInteger p, BigInteger g) throws GeneralSecurityException {
"""
<p>Creates and returns a DH key pair for the given <code>p</code> and <code>g</code>.</p>
@param p
@param g
@return
@throws GeneralSecurityException
"""
KeyPairGenerator keyGen = KeyPairGenerator.g... | java | public static final KeyPair createKeyPair(BigInteger p, BigInteger g) throws GeneralSecurityException {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);
keyGen.initialize(new DHParameterSpec(p, g), new SecureRandom());
return keyGen.generateKeyPair();
} | [
"public",
"static",
"final",
"KeyPair",
"createKeyPair",
"(",
"BigInteger",
"p",
",",
"BigInteger",
"g",
")",
"throws",
"GeneralSecurityException",
"{",
"KeyPairGenerator",
"keyGen",
"=",
"KeyPairGenerator",
".",
"getInstance",
"(",
"ALGORITHM",
")",
";",
"keyGen",
... | <p>Creates and returns a DH key pair for the given <code>p</code> and <code>g</code>.</p>
@param p
@param g
@return
@throws GeneralSecurityException | [
"<p",
">",
"Creates",
"and",
"returns",
"a",
"DH",
"key",
"pair",
"for",
"the",
"given",
"<code",
">",
"p<",
"/",
"code",
">",
"and",
"<code",
">",
"g<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/martinwithaar/Encryptor4j/blob/8c31d84d9136309f59d810323ed68d902b9bac55/src/main/java/org/encryptor4j/DHPeer.java#L111-L115 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/DefinitionInformation.java | DefinitionInformation.withTags | public DefinitionInformation withTags(java.util.Map<String, String> tags) {
"""
The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public DefinitionInformation withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"DefinitionInformation",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"tags",
"for",
"the",
"definition",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/DefinitionInformation.java#L313-L316 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newJedisCluster | public static JedisCluster newJedisCluster(String hostsAndPorts, String password) {
"""
Create a new {@link JedisCluster} with default pool configs.
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@param password
@return
"""
return new... | java | public static JedisCluster newJedisCluster(String hostsAndPorts, String password) {
return newJedisCluster(defaultJedisPoolConfig(), hostsAndPorts, password);
} | [
"public",
"static",
"JedisCluster",
"newJedisCluster",
"(",
"String",
"hostsAndPorts",
",",
"String",
"password",
")",
"{",
"return",
"newJedisCluster",
"(",
"defaultJedisPoolConfig",
"(",
")",
",",
"hostsAndPorts",
",",
"password",
")",
";",
"}"
] | Create a new {@link JedisCluster} with default pool configs.
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@param password
@return | [
"Create",
"a",
"new",
"{",
"@link",
"JedisCluster",
"}",
"with",
"default",
"pool",
"configs",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L253-L255 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addIntTask | public UBench addIntTask(String name, IntSupplier task) {
"""
Include an int-specialized named task in to the benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls.
"""
return addIntTa... | java | public UBench addIntTask(String name, IntSupplier task) {
return addIntTask(name, task, null);
} | [
"public",
"UBench",
"addIntTask",
"(",
"String",
"name",
",",
"IntSupplier",
"task",
")",
"{",
"return",
"addIntTask",
"(",
"name",
",",
"task",
",",
"null",
")",
";",
"}"
] | Include an int-specialized named task in to the benchmark.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls. | [
"Include",
"an",
"int",
"-",
"specialized",
"named",
"task",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L192-L194 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.setSharedKey | public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) {
"""
The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified res... | java | public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) {
return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).toBlocking().last().body();
} | [
"public",
"ConnectionSharedKeyInner",
"setSharedKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"String",
"value",
")",
"{",
"return",
"setSharedKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGate... | The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnect... | [
"The",
"Put",
"VirtualNetworkGatewayConnectionSharedKey",
"operation",
"sets",
"the",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"for",
"passed",
"virtual",
"network",
"gateway",
"connection",
"in",
"the",
"specified",
"resource",
"group",
"through"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L856-L858 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.