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 |
|---|---|---|---|---|---|---|---|---|---|---|
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java | MMCIFFileTools.toLoopMmCifHeaderString | public static String toLoopMmCifHeaderString(String categoryName, String className) throws ClassNotFoundException {
"""
Produces a mmCIF loop header string for the given categoryName and className.
className must be one of the beans in the {@link org.biojava.nbio.structure.io.mmcif.model} package
@param category... | java | public static String toLoopMmCifHeaderString(String categoryName, String className) throws ClassNotFoundException {
StringBuilder str = new StringBuilder();
str.append(SimpleMMcifParser.LOOP_START+newline);
Class<?> c = Class.forName(className);
for (Field f : getFields(c)) {
str.append(categoryName+"."+f... | [
"public",
"static",
"String",
"toLoopMmCifHeaderString",
"(",
"String",
"categoryName",
",",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
"{",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"str",
".",
"append",
"(",
"Simple... | Produces a mmCIF loop header string for the given categoryName and className.
className must be one of the beans in the {@link org.biojava.nbio.structure.io.mmcif.model} package
@param categoryName
@param className
@return
@throws ClassNotFoundException if the given className can not be found | [
"Produces",
"a",
"mmCIF",
"loop",
"header",
"string",
"for",
"the",
"given",
"categoryName",
"and",
"className",
".",
"className",
"must",
"be",
"one",
"of",
"the",
"beans",
"in",
"the",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java#L87-L99 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/util/BitMaskUtil.java | BitMaskUtil.setBit | public static int setBit(int value, int bitNumber, boolean bitValue) {
"""
Set bit to '0' or '1' in the given int.
@param current
integer value
@param bitNumber
number of the bit to set to '0' or '1' (right first bit starting at 1).
@param bitValue
if true, bit set to '1'. If false, '0'.
"""
if (bi... | java | public static int setBit(int value, int bitNumber, boolean bitValue) {
if (bitValue) {
return setBitOn(value, bitNumber);
} else {
return setBitOff(value, bitNumber);
}
} | [
"public",
"static",
"int",
"setBit",
"(",
"int",
"value",
",",
"int",
"bitNumber",
",",
"boolean",
"bitValue",
")",
"{",
"if",
"(",
"bitValue",
")",
"{",
"return",
"setBitOn",
"(",
"value",
",",
"bitNumber",
")",
";",
"}",
"else",
"{",
"return",
"setBi... | Set bit to '0' or '1' in the given int.
@param current
integer value
@param bitNumber
number of the bit to set to '0' or '1' (right first bit starting at 1).
@param bitValue
if true, bit set to '1'. If false, '0'. | [
"Set",
"bit",
"to",
"0",
"or",
"1",
"in",
"the",
"given",
"int",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/util/BitMaskUtil.java#L99-L105 |
arquillian/arquillian-extension-warp | impl/src/main/java/org/jboss/arquillian/warp/impl/server/execution/WarpFilter.java | WarpFilter.doFilterHttp | private void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
"""
<p>
Checks whether the request processing can be delegated to one of registered {@link RequestDelegationService}s.
</p>
<p>
<p>
If not, delegates proc... | java | private void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
request.setAttribute(ARQUILLIAN_MANAGER_ATTRIBUTE, manager);
boolean isDelegated = delegator.tryDelegateRequest(request, response, filterChain);
... | [
"private",
"void",
"doFilterHttp",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"FilterChain",
"filterChain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"request",
".",
"setAttribute",
"(",
"ARQUILLIAN_MANAGER_ATTRIBU... | <p>
Checks whether the request processing can be delegated to one of registered {@link RequestDelegationService}s.
</p>
<p>
<p>
If not, delegates processing to {@link #doFilterWarp(HttpServletRequest, HttpServletResponse, FilterChain)}.
</p> | [
"<p",
">",
"Checks",
"whether",
"the",
"request",
"processing",
"can",
"be",
"delegated",
"to",
"one",
"of",
"registered",
"{"
] | train | https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/impl/src/main/java/org/jboss/arquillian/warp/impl/server/execution/WarpFilter.java#L113-L123 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setSimpleValue | private static void setSimpleValue(Object obj, Property property, Object value) {
"""
/*
Internal: Static version of {@link ObjectWrapper#setSimpleValue(Property, Object)}.
"""
if (property == null) {
throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' pr... | java | private static void setSimpleValue(Object obj, Property property, Object value) {
if (property == null) {
throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyName.");
}
property.set(obj, value);
} | [
"private",
"static",
"void",
"setSimpleValue",
"(",
"Object",
"obj",
",",
"Property",
"property",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"property",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot set a new value to a prope... | /*
Internal: Static version of {@link ObjectWrapper#setSimpleValue(Property, Object)}. | [
"/",
"*",
"Internal",
":",
"Static",
"version",
"of",
"{"
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L735-L741 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagHeadIncludes.java | CmsJspTagHeadIncludes.getStandardContext | private CmsJspStandardContextBean getStandardContext(CmsObject cms, HttpServletRequest req) throws CmsException {
"""
Returns the standard context bean.<p>
@param cms the current cms context
@param req the current request
@return the standard context bean
@throws CmsException if something goes wrong
... | java | private CmsJspStandardContextBean getStandardContext(CmsObject cms, HttpServletRequest req) throws CmsException {
CmsJspStandardContextBean standardContext = CmsJspStandardContextBean.getInstance(req);
standardContext.initPage();
return standardContext;
} | [
"private",
"CmsJspStandardContextBean",
"getStandardContext",
"(",
"CmsObject",
"cms",
",",
"HttpServletRequest",
"req",
")",
"throws",
"CmsException",
"{",
"CmsJspStandardContextBean",
"standardContext",
"=",
"CmsJspStandardContextBean",
".",
"getInstance",
"(",
"req",
")"... | Returns the standard context bean.<p>
@param cms the current cms context
@param req the current request
@return the standard context bean
@throws CmsException if something goes wrong | [
"Returns",
"the",
"standard",
"context",
"bean",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagHeadIncludes.java#L798-L803 |
Whiley/WhileyCompiler | src/main/java/wyil/type/util/ReadWriteTypeExtractor.java | ReadWriteTypeExtractor.unionHelper | @SuppressWarnings("unchecked")
protected static <T extends SemanticType> T unionHelper(T lhs, T rhs) {
"""
Provides a simplistic form of type union which, in some cases, does slightly
better than simply creating a new union. For example, unioning
<code>int</code> with <code>int</code> will return <code>int</cod... | java | @SuppressWarnings("unchecked")
protected static <T extends SemanticType> T unionHelper(T lhs, T rhs) {
if (lhs.equals(rhs)) {
return lhs;
} else if (lhs instanceof Type.Void) {
return rhs;
} else if (rhs instanceof Type.Void) {
return lhs;
} else if (lhs instanceof Type && rhs instanceof Type) {
re... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"<",
"T",
"extends",
"SemanticType",
">",
"T",
"unionHelper",
"(",
"T",
"lhs",
",",
"T",
"rhs",
")",
"{",
"if",
"(",
"lhs",
".",
"equals",
"(",
"rhs",
")",
")",
"{",
"return",
... | Provides a simplistic form of type union which, in some cases, does slightly
better than simply creating a new union. For example, unioning
<code>int</code> with <code>int</code> will return <code>int</code> rather
than <code>int|int</code>.
@param lhs
@param rhs
@return | [
"Provides",
"a",
"simplistic",
"form",
"of",
"type",
"union",
"which",
"in",
"some",
"cases",
"does",
"slightly",
"better",
"than",
"simply",
"creating",
"a",
"new",
"union",
".",
"For",
"example",
"unioning",
"<code",
">",
"int<",
"/",
"code",
">",
"with"... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/type/util/ReadWriteTypeExtractor.java#L847-L860 |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/Shutdown.java | Shutdown.run | public VoltTable[] run(SystemProcedureExecutionContext ctx) {
"""
Begin an un-graceful shutdown.
@param ctx Internal parameter not exposed to the end-user.
@return Never returned, no he never returned...
"""
createAndExecuteSysProcPlan(SysProcFragmentId.PF_shutdownSync, SysProcFragmentId.PF_shutdownS... | java | public VoltTable[] run(SystemProcedureExecutionContext ctx) {
createAndExecuteSysProcPlan(SysProcFragmentId.PF_shutdownSync, SysProcFragmentId.PF_shutdownSyncDone);
SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[] {
new SynthesizedPlanFragment(SysProcFragmentId.PF_shutdownC... | [
"public",
"VoltTable",
"[",
"]",
"run",
"(",
"SystemProcedureExecutionContext",
"ctx",
")",
"{",
"createAndExecuteSysProcPlan",
"(",
"SysProcFragmentId",
".",
"PF_shutdownSync",
",",
"SysProcFragmentId",
".",
"PF_shutdownSyncDone",
")",
";",
"SynthesizedPlanFragment",
"pf... | Begin an un-graceful shutdown.
@param ctx Internal parameter not exposed to the end-user.
@return Never returned, no he never returned... | [
"Begin",
"an",
"un",
"-",
"graceful",
"shutdown",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/Shutdown.java#L126-L134 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java | BoundingBox.extendMargin | public BoundingBox extendMargin(float margin) {
"""
Creates a BoundingBox that is a fixed margin factor larger on all sides (but does not cross date line/poles).
@param margin extension (must be > 0)
@return an extended BoundingBox or this (if margin == 1)
"""
if (margin == 1) {
return ... | java | public BoundingBox extendMargin(float margin) {
if (margin == 1) {
return this;
} else if (margin <= 0) {
throw new IllegalArgumentException("BoundingBox extend operation does not accept negative or zero values");
}
double verticalExpansion = (this.getLatitudeSpa... | [
"public",
"BoundingBox",
"extendMargin",
"(",
"float",
"margin",
")",
"{",
"if",
"(",
"margin",
"==",
"1",
")",
"{",
"return",
"this",
";",
"}",
"else",
"if",
"(",
"margin",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Boundin... | Creates a BoundingBox that is a fixed margin factor larger on all sides (but does not cross date line/poles).
@param margin extension (must be > 0)
@return an extended BoundingBox or this (if margin == 1) | [
"Creates",
"a",
"BoundingBox",
"that",
"is",
"a",
"fixed",
"margin",
"factor",
"larger",
"on",
"all",
"sides",
"(",
"but",
"does",
"not",
"cross",
"date",
"line",
"/",
"poles",
")",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java#L220-L236 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuOccupancyMaxPotentialBlockSize | public static int cuOccupancyMaxPotentialBlockSize(int minGridSize[], int blockSize[], CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, long dynamicSMemSize, int blockSizeLimit) {
"""
<code><pre>
\brief Suggest a launch configuration with reasonable occupancy
Returns in \p *blockSize a reasonabl... | java | public static int cuOccupancyMaxPotentialBlockSize(int minGridSize[], int blockSize[], CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, long dynamicSMemSize, int blockSizeLimit)
{
// The callback involves a state on the native side,
// so ensure synchronization here
synchr... | [
"public",
"static",
"int",
"cuOccupancyMaxPotentialBlockSize",
"(",
"int",
"minGridSize",
"[",
"]",
",",
"int",
"blockSize",
"[",
"]",
",",
"CUfunction",
"func",
",",
"CUoccupancyB2DSize",
"blockSizeToDynamicSMemSize",
",",
"long",
"dynamicSMemSize",
",",
"int",
"bl... | <code><pre>
\brief Suggest a launch configuration with reasonable occupancy
Returns in \p *blockSize a reasonable block size that can achieve
the maximum occupancy (or, the maximum number of active warps with
the fewest blocks per multiprocessor), and in \p *minGridSize the
minimum grid size to achieve the maximum occ... | [
"<code",
">",
"<pre",
">",
"\\",
"brief",
"Suggest",
"a",
"launch",
"configuration",
"with",
"reasonable",
"occupancy"
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L13119-L13127 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SSLTransportParameters.java | SSLTransportParameters.setKeyStore | public void setKeyStore(String keyStore, String keyPass, String keyManagerType, String keyStoreType) {
"""
Set the keystore, password, certificate type and the store type
@param keyStore Location of the Keystore on disk
@param keyPass Keystore password
@param keyManagerType The default is X509
@param keyStor... | java | public void setKeyStore(String keyStore, String keyPass, String keyManagerType, String keyStoreType)
{
if((keyStore == null) || (keyPass == null))
{
this.keyStore = System.getProperty("javax.net.ssl.keyStore");
this.keyPass = System.getProperty("javax.net.ssl.keyStoreP... | [
"public",
"void",
"setKeyStore",
"(",
"String",
"keyStore",
",",
"String",
"keyPass",
",",
"String",
"keyManagerType",
",",
"String",
"keyStoreType",
")",
"{",
"if",
"(",
"(",
"keyStore",
"==",
"null",
")",
"||",
"(",
"keyPass",
"==",
"null",
")",
")",
"... | Set the keystore, password, certificate type and the store type
@param keyStore Location of the Keystore on disk
@param keyPass Keystore password
@param keyManagerType The default is X509
@param keyStoreType The default is JKS | [
"Set",
"the",
"keystore",
"password",
"certificate",
"type",
"and",
"the",
"store",
"type"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SSLTransportParameters.java#L185-L205 |
kiswanij/jk-util | src/main/java/com/jk/util/validation/builtin/ValidationBundle.java | ValidationBundle.getMessage | public static String getMessage(final Class class1, final String string, final String compName) {
"""
Gets the message.
@param class1 the class 1
@param string the string
@param compName the comp name
@return the message
"""
return JKMessage.get(string, compName);
} | java | public static String getMessage(final Class class1, final String string, final String compName) {
return JKMessage.get(string, compName);
} | [
"public",
"static",
"String",
"getMessage",
"(",
"final",
"Class",
"class1",
",",
"final",
"String",
"string",
",",
"final",
"String",
"compName",
")",
"{",
"return",
"JKMessage",
".",
"get",
"(",
"string",
",",
"compName",
")",
";",
"}"
] | Gets the message.
@param class1 the class 1
@param string the string
@param compName the comp name
@return the message | [
"Gets",
"the",
"message",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/validation/builtin/ValidationBundle.java#L61-L63 |
CloudSlang/score | runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/PythonExecutor.java | PythonExecutor.exec | public PythonExecutionResult exec(String script, Map<String, Serializable> callArguments) {
"""
we need this method to be synchronized so we will not have multiple scripts run in parallel on the same context
"""
checkValidInterpreter();
initInterpreter();
prepareInterpreterContext(ca... | java | public PythonExecutionResult exec(String script, Map<String, Serializable> callArguments) {
checkValidInterpreter();
initInterpreter();
prepareInterpreterContext(callArguments);
Exception originException = null;
for(int i = 0; i < RETRIES_NUMBER_ON_THREADED_ISSUE; i++) {
... | [
"public",
"PythonExecutionResult",
"exec",
"(",
"String",
"script",
",",
"Map",
"<",
"String",
",",
"Serializable",
">",
"callArguments",
")",
"{",
"checkValidInterpreter",
"(",
")",
";",
"initInterpreter",
"(",
")",
";",
"prepareInterpreterContext",
"(",
"callArg... | we need this method to be synchronized so we will not have multiple scripts run in parallel on the same context | [
"we",
"need",
"this",
"method",
"to",
"be",
"synchronized",
"so",
"we",
"will",
"not",
"have",
"multiple",
"scripts",
"run",
"in",
"parallel",
"on",
"the",
"same",
"context"
] | train | https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/runtime-management/runtime-management-impl/src/main/java/io/cloudslang/runtime/impl/python/PythonExecutor.java#L106-L125 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/FormatUtils.java | FormatUtils.byteArrayToHexString | public static String byteArrayToHexString(byte[] bytes, String prefix, String separator) {
"""
Parses a byte array into a hex string where each byte is represented in the
format {@code %02x}.
@param bytes the byte array to be transformed
@param prefix the prefix to use
@param separator the separator to use
... | java | public static String byteArrayToHexString(byte[] bytes, String prefix, String separator) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
sb.append(String.format("%s%02x", prefix, bytes[i]));
if (i != bytes.length - 1) {
sb.append(separator);
}
}
... | [
"public",
"static",
"String",
"byteArrayToHexString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"prefix",
",",
"String",
"separator",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",... | Parses a byte array into a hex string where each byte is represented in the
format {@code %02x}.
@param bytes the byte array to be transformed
@param prefix the prefix to use
@param separator the separator to use
@return the string representation of the byte array | [
"Parses",
"a",
"byte",
"array",
"into",
"a",
"hex",
"string",
"where",
"each",
"byte",
"is",
"represented",
"in",
"the",
"format",
"{",
"@code",
"%02x",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/FormatUtils.java#L96-L105 |
jbundle/jbundle | thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java | Application.showTheDocument | public boolean showTheDocument(String strURL, BaseAppletReference applet, int iOptions) {
"""
Display this URL in a web browser.
Uses the applet or jnlp context.
@param strURL The local URL to display (not fully qualified).
@param iOptions ThinMenuConstants.HELP_WINDOW_CHANGE If help pane is already displayed, ... | java | public boolean showTheDocument(String strURL, BaseAppletReference applet, int iOptions)
{
if (applet != null)
return applet.showTheDocument(this, strURL, iOptions);
return false; // Override this
} | [
"public",
"boolean",
"showTheDocument",
"(",
"String",
"strURL",
",",
"BaseAppletReference",
"applet",
",",
"int",
"iOptions",
")",
"{",
"if",
"(",
"applet",
"!=",
"null",
")",
"return",
"applet",
".",
"showTheDocument",
"(",
"this",
",",
"strURL",
",",
"iOp... | Display this URL in a web browser.
Uses the applet or jnlp context.
@param strURL The local URL to display (not fully qualified).
@param iOptions ThinMenuConstants.HELP_WINDOW_CHANGE If help pane is already displayed, change to this content.
@param The applet (optional).
@return True if successfully displayed. | [
"Display",
"this",
"URL",
"in",
"a",
"web",
"browser",
".",
"Uses",
"the",
"applet",
"or",
"jnlp",
"context",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java#L703-L708 |
arquillian/arquillian-core | container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/ContainerDeployController.java | ContainerDeployController.deployManaged | public void deployManaged(@Observes DeployManagedDeployments event) throws Exception {
"""
Deploy all deployments marked as managed = true.
@throws Exception
"""
forEachManagedDeployment(new Operation<Container, Deployment>() {
@Inject
private Event<DeploymentEvent> event;
... | java | public void deployManaged(@Observes DeployManagedDeployments event) throws Exception {
forEachManagedDeployment(new Operation<Container, Deployment>() {
@Inject
private Event<DeploymentEvent> event;
@Override
public void perform(Container container, Deployment de... | [
"public",
"void",
"deployManaged",
"(",
"@",
"Observes",
"DeployManagedDeployments",
"event",
")",
"throws",
"Exception",
"{",
"forEachManagedDeployment",
"(",
"new",
"Operation",
"<",
"Container",
",",
"Deployment",
">",
"(",
")",
"{",
"@",
"Inject",
"private",
... | Deploy all deployments marked as managed = true.
@throws Exception | [
"Deploy",
"all",
"deployments",
"marked",
"as",
"managed",
"=",
"true",
"."
] | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/container/impl-base/src/main/java/org/jboss/arquillian/container/impl/client/container/ContainerDeployController.java#L76-L96 |
contentful/contentful.java | src/main/java/com/contentful/java/cda/image/ImageOption.java | ImageOption.backgroundColorOf | public static ImageOption backgroundColorOf(int r, int g, int b) {
"""
Define a background color by its components.
<p>
Each color component must be a hexadecimal in the range from 0 to 255 inclusively.
@param r the red color component in hex to be used.
@param g the green color component in hex to be used.
... | java | public static ImageOption backgroundColorOf(int r, int g, int b) {
if (r > 255 || r < 0) {
throw new IllegalArgumentException("Red component out of range: " + r);
}
if (g > 255 || g < 0) {
throw new IllegalArgumentException("Green component out of range: " + g);
}
if (b > 255 || b < 0) {... | [
"public",
"static",
"ImageOption",
"backgroundColorOf",
"(",
"int",
"r",
",",
"int",
"g",
",",
"int",
"b",
")",
"{",
"if",
"(",
"r",
">",
"255",
"||",
"r",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Red component out of range: ... | Define a background color by its components.
<p>
Each color component must be a hexadecimal in the range from 0 to 255 inclusively.
@param r the red color component in hex to be used.
@param g the green color component in hex to be used.
@param b the blue color component in hex to be used.
@return an image option for ... | [
"Define",
"a",
"background",
"color",
"by",
"its",
"components",
".",
"<p",
">",
"Each",
"color",
"component",
"must",
"be",
"a",
"hexadecimal",
"in",
"the",
"range",
"from",
"0",
"to",
"255",
"inclusively",
"."
] | train | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/image/ImageOption.java#L262-L274 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/requestOptions/BaseOptions.java | BaseOptions.addEnumList | protected void addEnumList(String key, List<? extends Enum> list) {
"""
Add a list of enums to the options map
@param key The key for the options map (ex: "include[]")
@param list A list of enums
"""
optionsMap.put(key, list.stream().map(i -> i.toString()).collect(Collectors.toList()));
} | java | protected void addEnumList(String key, List<? extends Enum> list) {
optionsMap.put(key, list.stream().map(i -> i.toString()).collect(Collectors.toList()));
} | [
"protected",
"void",
"addEnumList",
"(",
"String",
"key",
",",
"List",
"<",
"?",
"extends",
"Enum",
">",
"list",
")",
"{",
"optionsMap",
".",
"put",
"(",
"key",
",",
"list",
".",
"stream",
"(",
")",
".",
"map",
"(",
"i",
"->",
"i",
".",
"toString",... | Add a list of enums to the options map
@param key The key for the options map (ex: "include[]")
@param list A list of enums | [
"Add",
"a",
"list",
"of",
"enums",
"to",
"the",
"options",
"map"
] | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/requestOptions/BaseOptions.java#L23-L25 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/LongStream.java | LongStream.iterate | @NotNull
public static LongStream iterate(
final long seed,
@NotNull final LongPredicate predicate,
@NotNull final LongUnaryOperator op) {
"""
Creates an {@code LongStream} by iterative application {@code LongUnaryOperator} function
to an initial element {@code seed}, condi... | java | @NotNull
public static LongStream iterate(
final long seed,
@NotNull final LongPredicate predicate,
@NotNull final LongUnaryOperator op) {
Objects.requireNonNull(predicate);
return iterate(seed, op).takeWhile(predicate);
} | [
"@",
"NotNull",
"public",
"static",
"LongStream",
"iterate",
"(",
"final",
"long",
"seed",
",",
"@",
"NotNull",
"final",
"LongPredicate",
"predicate",
",",
"@",
"NotNull",
"final",
"LongUnaryOperator",
"op",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"pr... | Creates an {@code LongStream} by iterative application {@code LongUnaryOperator} function
to an initial element {@code seed}, conditioned on satisfying the supplied predicate.
<p>Example:
<pre>
seed: 0
predicate: (a) -> a < 20
f: (a) -> a + 5
result: [0, 5, 10, 15]
</pre>
@param seed the initial value
@para... | [
"Creates",
"an",
"{",
"@code",
"LongStream",
"}",
"by",
"iterative",
"application",
"{",
"@code",
"LongUnaryOperator",
"}",
"function",
"to",
"an",
"initial",
"element",
"{",
"@code",
"seed",
"}",
"conditioned",
"on",
"satisfying",
"the",
"supplied",
"predicate"... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/LongStream.java#L188-L195 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java | TmdbLists.createList | public String createList(String sessionId, String name, String description) throws MovieDbException {
"""
This method lets users create a new list. A valid session id is required.
@param sessionId
@param name
@param description
@return The list id
@throws MovieDbException
"""
TmdbParameters para... | java | public String createList(String sessionId, String name, String description) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SESSION_ID, sessionId);
String jsonBody = new PostTools()
.add(PostBody.NAME, StringUtils.trimToEmpty(name... | [
"public",
"String",
"createList",
"(",
"String",
"sessionId",
",",
"String",
"name",
",",
"String",
"description",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",... | This method lets users create a new list. A valid session id is required.
@param sessionId
@param name
@param description
@return The list id
@throws MovieDbException | [
"This",
"method",
"lets",
"users",
"create",
"a",
"new",
"list",
".",
"A",
"valid",
"session",
"id",
"is",
"required",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L113-L130 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonRootValue.java | PactDslJsonRootValue.valueFromProviderState | public static PactDslJsonRootValue valueFromProviderState(String expression, Object example) {
"""
Adds a value that will have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to be used in the consumer test
"""
... | java | public static PactDslJsonRootValue valueFromProviderState(String expression, Object example) {
PactDslJsonRootValue value = new PactDslJsonRootValue();
value.generators.addGenerator(Category.BODY, "", new ProviderStateGenerator(expression));
value.setValue(example);
return value;
} | [
"public",
"static",
"PactDslJsonRootValue",
"valueFromProviderState",
"(",
"String",
"expression",
",",
"Object",
"example",
")",
"{",
"PactDslJsonRootValue",
"value",
"=",
"new",
"PactDslJsonRootValue",
"(",
")",
";",
"value",
".",
"generators",
".",
"addGenerator",
... | Adds a value that will have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to be used in the consumer test | [
"Adds",
"a",
"value",
"that",
"will",
"have",
"it",
"s",
"value",
"injected",
"from",
"the",
"provider",
"state"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonRootValue.java#L806-L811 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy3rd | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy3rd(TriFunction<T1, T2, T3, R> function, Box<T3> param3) {
"""
Proxies a ternary function spying for third parameter.
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@p... | java | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy3rd(TriFunction<T1, T2, T3, R> function, Box<T3> param3) {
return spy(function, Box.<R>empty(), Box.<T1>empty(), Box.<T2>empty(), param3);
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"spy3rd",
"(",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"function",
",",
"Box",
"<",
"T3"... | Proxies a ternary function spying for third parameter.
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <T3> the function third parameter type
@param function the function that will be spied
@param param3 a box that will be containi... | [
"Proxies",
"a",
"ternary",
"function",
"spying",
"for",
"third",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L239-L241 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_storage_containerId_cors_POST | public void project_serviceName_storage_containerId_cors_POST(String serviceName, String containerId, String origin) throws IOException {
"""
Add CORS support on your container
REST: POST /cloud/project/{serviceName}/storage/{containerId}/cors
@param containerId [required] Container id
@param origin [required... | java | public void project_serviceName_storage_containerId_cors_POST(String serviceName, String containerId, String origin) throws IOException {
String qPath = "/cloud/project/{serviceName}/storage/{containerId}/cors";
StringBuilder sb = path(qPath, serviceName, containerId);
HashMap<String, Object>o = new HashMap<Strin... | [
"public",
"void",
"project_serviceName_storage_containerId_cors_POST",
"(",
"String",
"serviceName",
",",
"String",
"containerId",
",",
"String",
"origin",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/storage/{containerId}/cors\"",
... | Add CORS support on your container
REST: POST /cloud/project/{serviceName}/storage/{containerId}/cors
@param containerId [required] Container id
@param origin [required] Allow this origin
@param serviceName [required] Service name | [
"Add",
"CORS",
"support",
"on",
"your",
"container"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L665-L671 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.escapeXML | public static String escapeXML(final String s) {
"""
Escape XML characters.
@param s value needed to be escaped
@return escaped value
"""
final char[] chars = s.toCharArray();
return escapeXML(chars, 0, chars.length);
} | java | public static String escapeXML(final String s) {
final char[] chars = s.toCharArray();
return escapeXML(chars, 0, chars.length);
} | [
"public",
"static",
"String",
"escapeXML",
"(",
"final",
"String",
"s",
")",
"{",
"final",
"char",
"[",
"]",
"chars",
"=",
"s",
".",
"toCharArray",
"(",
")",
";",
"return",
"escapeXML",
"(",
"chars",
",",
"0",
",",
"chars",
".",
"length",
")",
";",
... | Escape XML characters.
@param s value needed to be escaped
@return escaped value | [
"Escape",
"XML",
"characters",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L637-L640 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java | BeanPath.createCollection | @SuppressWarnings("unchecked")
protected <A, Q extends SimpleExpression<? super A>> CollectionPath<A, Q> createCollection(String property, Class<? super A> type, Class<? super Q> queryType, PathInits inits) {
"""
Create a new Collection typed path
@param <A>
@param property property name
@param type prope... | java | @SuppressWarnings("unchecked")
protected <A, Q extends SimpleExpression<? super A>> CollectionPath<A, Q> createCollection(String property, Class<? super A> type, Class<? super Q> queryType, PathInits inits) {
return add(new CollectionPath<A, Q>(type, (Class) queryType, forProperty(property), inits));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"A",
",",
"Q",
"extends",
"SimpleExpression",
"<",
"?",
"super",
"A",
">",
">",
"CollectionPath",
"<",
"A",
",",
"Q",
">",
"createCollection",
"(",
"String",
"property",
",",
"Class",
"<... | Create a new Collection typed path
@param <A>
@param property property name
@param type property type
@return property path | [
"Create",
"a",
"new",
"Collection",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java#L149-L152 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java | MM2BasedParameterSetReader.massNumber | private Integer massNumber(int atomicNumber, double exactMass) throws IOException {
"""
Mass number for a atom with a given atomic number and exact mass.
@param atomicNumber atomic number
@param exactMass exact mass
@return the mass number (or null) if no mass number was found
@throws IOException isotope confi... | java | private Integer massNumber(int atomicNumber, double exactMass) throws IOException {
String symbol = PeriodicTable.getSymbol(atomicNumber);
IIsotope isotope = Isotopes.getInstance().getIsotope(symbol, exactMass, 0.001);
return isotope != null ? isotope.getMassNumber() : null;
} | [
"private",
"Integer",
"massNumber",
"(",
"int",
"atomicNumber",
",",
"double",
"exactMass",
")",
"throws",
"IOException",
"{",
"String",
"symbol",
"=",
"PeriodicTable",
".",
"getSymbol",
"(",
"atomicNumber",
")",
";",
"IIsotope",
"isotope",
"=",
"Isotopes",
".",... | Mass number for a atom with a given atomic number and exact mass.
@param atomicNumber atomic number
@param exactMass exact mass
@return the mass number (or null) if no mass number was found
@throws IOException isotope configuration could not be loaded | [
"Mass",
"number",
"for",
"a",
"atom",
"with",
"a",
"given",
"atomic",
"number",
"and",
"exact",
"mass",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java#L885-L889 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java | UpdatePreferencesServlet.removeByFName | @RequestMapping(method = RequestMethod.POST, params = "action=removeByFName")
public ModelAndView removeByFName(
HttpServletRequest request,
HttpServletResponse response,
@RequestParam(value = "fname") String fname)
throws IOException {
"""
Remove the first eleme... | java | @RequestMapping(method = RequestMethod.POST, params = "action=removeByFName")
public ModelAndView removeByFName(
HttpServletRequest request,
HttpServletResponse response,
@RequestParam(value = "fname") String fname)
throws IOException {
IUserInstance ui = use... | [
"@",
"RequestMapping",
"(",
"method",
"=",
"RequestMethod",
".",
"POST",
",",
"params",
"=",
"\"action=removeByFName\"",
")",
"public",
"ModelAndView",
"removeByFName",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"@",
"RequestPar... | Remove the first element with the provided fname from the layout.
@param request HttpServletRequest
@param response HttpServletResponse
@param fname fname of the portlet to remove from the layout
@return json response
@throws IOException if the person cannot be retrieved | [
"Remove",
"the",
"first",
"element",
"with",
"the",
"provided",
"fname",
"from",
"the",
"layout",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java#L216-L261 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/io/GeoPackageIOUtils.java | GeoPackageIOUtils.addFileExtension | public static File addFileExtension(File file, String extension) {
"""
Add a the file extension to the file
@param file
file
@param extension
file extension
@return new file with extension
@since 3.0.2
"""
return new File(file.getAbsolutePath() + "." + extension);
} | java | public static File addFileExtension(File file, String extension) {
return new File(file.getAbsolutePath() + "." + extension);
} | [
"public",
"static",
"File",
"addFileExtension",
"(",
"File",
"file",
",",
"String",
"extension",
")",
"{",
"return",
"new",
"File",
"(",
"file",
".",
"getAbsolutePath",
"(",
")",
"+",
"\".\"",
"+",
"extension",
")",
";",
"}"
] | Add a the file extension to the file
@param file
file
@param extension
file extension
@return new file with extension
@since 3.0.2 | [
"Add",
"a",
"the",
"file",
"extension",
"to",
"the",
"file"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/io/GeoPackageIOUtils.java#L70-L72 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/octracker/ConnectionDataGroup.java | ConnectionDataGroup.purgeFromInvalidateImpl | protected void purgeFromInvalidateImpl(OutboundConnection connection, boolean notifyPeer) {
"""
Purge a connection from this group from within invalidate processing.
Purging a connection removes it from the group even if the connection
still has conversations associated with it.
The purged connection is closed ... | java | protected void purgeFromInvalidateImpl(OutboundConnection connection, boolean notifyPeer)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "purgeFromInvalidateImpl", new Object[] { connection, Boolean.valueOf(notifyPeer) });
purge(connection, true,... | [
"protected",
"void",
"purgeFromInvalidateImpl",
"(",
"OutboundConnection",
"connection",
",",
"boolean",
"notifyPeer",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"e... | Purge a connection from this group from within invalidate processing.
Purging a connection removes it from the group even if the connection
still has conversations associated with it.
The purged connection is closed and not added to the idle pool.
@param connection The connection to purge
@param notifyPeer Should we n... | [
"Purge",
"a",
"connection",
"from",
"this",
"group",
"from",
"within",
"invalidate",
"processing",
".",
"Purging",
"a",
"connection",
"removes",
"it",
"from",
"the",
"group",
"even",
"if",
"the",
"connection",
"still",
"has",
"conversations",
"associated",
"with... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/octracker/ConnectionDataGroup.java#L1019-L1026 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.patchProfile | @Override
public Observable<ComapiResult<Map<String, Object>>> patchProfile(@NonNull final String profileId, @NonNull final Map<String, Object> profileDetails, final String eTag) {
"""
Applies given profile patch if required permission is granted.
@param profileId Id of an profile to patch.
@param pro... | java | @Override
public Observable<ComapiResult<Map<String, Object>>> patchProfile(@NonNull final String profileId, @NonNull final Map<String, Object> profileDetails, final String eTag) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queue... | [
"@",
"Override",
"public",
"Observable",
"<",
"ComapiResult",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
">",
"patchProfile",
"(",
"@",
"NonNull",
"final",
"String",
"profileId",
",",
"@",
"NonNull",
"final",
"Map",
"<",
"String",
",",
"Object",
... | Applies given profile patch if required permission is granted.
@param profileId Id of an profile to patch.
@param profileDetails Profile details.
@param eTag ETag for server to check if local version of the data is the same as the one the server side.
@return Observable with to perform update profile fo... | [
"Applies",
"given",
"profile",
"patch",
"if",
"required",
"permission",
"is",
"granted",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L351-L363 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java | TaskLockbox.doInCriticalSection | public <T> T doInCriticalSection(Task task, List<Interval> intervals, CriticalAction<T> action) throws Exception {
"""
Perform the given action with a guarantee that the locks of the task are not revoked in the middle of action. This
method first checks that all locks for the given task and intervals are valid a... | java | public <T> T doInCriticalSection(Task task, List<Interval> intervals, CriticalAction<T> action) throws Exception
{
giant.lock();
try {
return action.perform(isTaskLocksValid(task, intervals));
}
finally {
giant.unlock();
}
} | [
"public",
"<",
"T",
">",
"T",
"doInCriticalSection",
"(",
"Task",
"task",
",",
"List",
"<",
"Interval",
">",
"intervals",
",",
"CriticalAction",
"<",
"T",
">",
"action",
")",
"throws",
"Exception",
"{",
"giant",
".",
"lock",
"(",
")",
";",
"try",
"{",
... | Perform the given action with a guarantee that the locks of the task are not revoked in the middle of action. This
method first checks that all locks for the given task and intervals are valid and perform the right action.
The given action should be finished as soon as possible because all other methods in this class... | [
"Perform",
"the",
"given",
"action",
"with",
"a",
"guarantee",
"that",
"the",
"locks",
"of",
"the",
"task",
"are",
"not",
"revoked",
"in",
"the",
"middle",
"of",
"action",
".",
"This",
"method",
"first",
"checks",
"that",
"all",
"locks",
"for",
"the",
"g... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java#L622-L632 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java | Utils.replaceAllWithoutRegex | public static String replaceAllWithoutRegex(String text, String from, String to) {
"""
Replaces all occurrences of the from text with to text without any regular expressions
@param text text string
@param from from string
@param to to string
@return returns processed string
"""
if (text == null) {
... | java | public static String replaceAllWithoutRegex(String text, String from, String to) {
if (text == null) {
return null;
}
int idx = 0;
while (true) {
idx = text.indexOf(from, idx);
if (idx >= 0) {
text = text.substring(0, idx) + to + text.substring(idx + from.length());
//... | [
"public",
"static",
"String",
"replaceAllWithoutRegex",
"(",
"String",
"text",
",",
"String",
"from",
",",
"String",
"to",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"idx",
"=",
"0",
";",
"while",
"(",
"tr... | Replaces all occurrences of the from text with to text without any regular expressions
@param text text string
@param from from string
@param to to string
@return returns processed string | [
"Replaces",
"all",
"occurrences",
"of",
"the",
"from",
"text",
"with",
"to",
"text",
"without",
"any",
"regular",
"expressions"
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java#L260-L277 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/protocol/CommandArgsAccessor.java | CommandArgsAccessor.getFirstString | @SuppressWarnings("unchecked")
public static <K, V> String getFirstString(CommandArgs<K, V> commandArgs) {
"""
Get the first {@link String} argument.
@param commandArgs must not be null.
@return the first {@link String} argument or {@literal null}.
"""
for (SingularArgument singularArgument : ... | java | @SuppressWarnings("unchecked")
public static <K, V> String getFirstString(CommandArgs<K, V> commandArgs) {
for (SingularArgument singularArgument : commandArgs.singularArguments) {
if (singularArgument instanceof StringArgument) {
return ((StringArgument) singularArgument).val;... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"String",
"getFirstString",
"(",
"CommandArgs",
"<",
"K",
",",
"V",
">",
"commandArgs",
")",
"{",
"for",
"(",
"SingularArgument",
"singularArgument",
":",
"comma... | Get the first {@link String} argument.
@param commandArgs must not be null.
@return the first {@link String} argument or {@literal null}. | [
"Get",
"the",
"first",
"{",
"@link",
"String",
"}",
"argument",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/protocol/CommandArgsAccessor.java#L58-L69 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addPropertyName | private void addPropertyName(Document doc, InternalQName name) throws RepositoryException {
"""
Adds the property name to the lucene _:PROPERTIES_SET field.
@param doc the document.
@param name the name of the property.
@throws RepositoryException
"""
String fieldName = name.getName();
try
... | java | private void addPropertyName(Document doc, InternalQName name) throws RepositoryException
{
String fieldName = name.getName();
try
{
fieldName = resolver.createJCRName(name).getAsString();
}
catch (NamespaceException e)
{
// will never happen
if (LOG.isT... | [
"private",
"void",
"addPropertyName",
"(",
"Document",
"doc",
",",
"InternalQName",
"name",
")",
"throws",
"RepositoryException",
"{",
"String",
"fieldName",
"=",
"name",
".",
"getName",
"(",
")",
";",
"try",
"{",
"fieldName",
"=",
"resolver",
".",
"createJCRN... | Adds the property name to the lucene _:PROPERTIES_SET field.
@param doc the document.
@param name the name of the property.
@throws RepositoryException | [
"Adds",
"the",
"property",
"name",
"to",
"the",
"lucene",
"_",
":",
"PROPERTIES_SET",
"field",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L669-L685 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/service/CoinbaseMarketDataServiceRaw.java | CoinbaseMarketDataServiceRaw.getCoinbaseSellPrice | public CoinbasePrice getCoinbaseSellPrice(BigDecimal quantity, String currency)
throws IOException {
"""
Unauthenticated resource that tells you the total amount you can get if you sell some quantity
Bitcoin.
@param quantity The quantity of Bitcoin you would like to sell (default is 1 if null).
@param c... | java | public CoinbasePrice getCoinbaseSellPrice(BigDecimal quantity, String currency)
throws IOException {
return coinbase.getSellPrice(quantity, currency);
} | [
"public",
"CoinbasePrice",
"getCoinbaseSellPrice",
"(",
"BigDecimal",
"quantity",
",",
"String",
"currency",
")",
"throws",
"IOException",
"{",
"return",
"coinbase",
".",
"getSellPrice",
"(",
"quantity",
",",
"currency",
")",
";",
"}"
] | Unauthenticated resource that tells you the total amount you can get if you sell some quantity
Bitcoin.
@param quantity The quantity of Bitcoin you would like to sell (default is 1 if null).
@param currency Default is USD. Right now this is the only value allowed.
@return The price in the desired {@code currency} to s... | [
"Unauthenticated",
"resource",
"that",
"tells",
"you",
"the",
"total",
"amount",
"you",
"can",
"get",
"if",
"you",
"sell",
"some",
"quantity",
"Bitcoin",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/service/CoinbaseMarketDataServiceRaw.java#L122-L126 |
nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java | MappingList.generatedPositionAfter | private boolean generatedPositionAfter(Mapping mappingA, Mapping mappingB) {
"""
Determine whether mappingB is after mappingA with respect to generated position.
"""
// Optimized for most common case
int lineA = mappingA.generated.line;
int lineB = mappingB.generated.line;
int c... | java | private boolean generatedPositionAfter(Mapping mappingA, Mapping mappingB) {
// Optimized for most common case
int lineA = mappingA.generated.line;
int lineB = mappingB.generated.line;
int columnA = mappingA.generated.column;
int columnB = mappingB.generated.column;
retur... | [
"private",
"boolean",
"generatedPositionAfter",
"(",
"Mapping",
"mappingA",
",",
"Mapping",
"mappingB",
")",
"{",
"// Optimized for most common case",
"int",
"lineA",
"=",
"mappingA",
".",
"generated",
".",
"line",
";",
"int",
"lineB",
"=",
"mappingB",
".",
"gener... | Determine whether mappingB is after mappingA with respect to generated position. | [
"Determine",
"whether",
"mappingB",
"is",
"after",
"mappingA",
"with",
"respect",
"to",
"generated",
"position",
"."
] | train | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java#L32-L39 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java | GJGeometryReader.parseMultiPoint | private MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLException {
"""
Parses an array of positions
Syntax:
{ "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }
@param jsParser
@throws IOException
@return MultiPoint
"""
jp.nextToken(); // FIELD_NAME coord... | java | private MultiPoint parseMultiPoint(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME coordinates
String coordinatesField = jp.getText();
if (coordinatesField.equalsIgnoreCase(GeoJsonField.COORDINATES)) {
jp.nextToken(); // START_ARRAY [ coordinat... | [
"private",
"MultiPoint",
"parseMultiPoint",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"// FIELD_NAME coordinates ",
"String",
"coordinatesField",
"=",
"jp",
".",
"getText",
"(",
"... | Parses an array of positions
Syntax:
{ "type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }
@param jsParser
@throws IOException
@return MultiPoint | [
"Parses",
"an",
"array",
"of",
"positions"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GJGeometryReader.java#L115-L126 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java | DbEntityManager.deletePreserveOrder | public DbBulkOperation deletePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) {
"""
Several delete operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to.
They will though be executed after all "not-bul... | java | public DbBulkOperation deletePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) {
return performBulkOperationPreserveOrder(entityType, statement, parameter, DELETE_BULK);
} | [
"public",
"DbBulkOperation",
"deletePreserveOrder",
"(",
"Class",
"<",
"?",
"extends",
"DbEntity",
">",
"entityType",
",",
"String",
"statement",
",",
"Object",
"parameter",
")",
"{",
"return",
"performBulkOperationPreserveOrder",
"(",
"entityType",
",",
"statement",
... | Several delete operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to.
They will though be executed after all "not-bulk" operations (e.g. {@link DbEntityManager#insert(DbEntity)} or {@link DbEntityManager#merge(DbEntity)})
and after those deletes ... | [
"Several",
"delete",
"operations",
"added",
"by",
"this",
"method",
"will",
"be",
"executed",
"preserving",
"the",
"order",
"of",
"method",
"calls",
"no",
"matter",
"what",
"entity",
"type",
"they",
"refer",
"to",
".",
"They",
"will",
"though",
"be",
"execut... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java#L637-L639 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setTimestamp | @Override
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
"""
Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object.
"""
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | java | @Override
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
{
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setTimestamp",
"(",
"int",
"parameterIndex",
",",
"Timestamp",
"x",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(... | Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"Timestamp",
"value",
"using",
"the",
"given",
"Calendar",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L582-L587 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/SearchUrl.java | SearchUrl.getSynonymDefinitionCollectionUrl | public static MozuUrl getSynonymDefinitionCollectionUrl(String localeCode, String responseFields) {
"""
Get Resource Url for GetSynonymDefinitionCollection
@param localeCode The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localiz... | java | public static MozuUrl getSynonymDefinitionCollectionUrl(String localeCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/search/synonym-definitions/{localeCode}?responseFields={responseFields}");
formatter.formatUrl("localeCode", localeCode);
formatter.format... | [
"public",
"static",
"MozuUrl",
"getSynonymDefinitionCollectionUrl",
"(",
"String",
"localeCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/search/synonym-definitions/{localeCode}?respons... | Get Resource Url for GetSynonymDefinitionCollection
@param localeCode The two character country code that sets the locale, such as US for United States. Sites, tenants, and catalogs use locale codes for localizing content, such as translated product text per supported country.
@param responseFields Filtering syntax app... | [
"Get",
"Resource",
"Url",
"for",
"GetSynonymDefinitionCollection"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/SearchUrl.java#L80-L86 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/animation/transformation/Scale.java | Scale.doTransform | @Override
protected void doTransform(ITransformable.Scale transformable, float comp) {
"""
Calculate the transformation.
@param transformable the transformable
@param comp the comp
"""
float fromX = reversed ? this.toX : this.fromX;
float toX = reversed ? this.fromX : this.toX;
float fromY = reverse... | java | @Override
protected void doTransform(ITransformable.Scale transformable, float comp)
{
float fromX = reversed ? this.toX : this.fromX;
float toX = reversed ? this.fromX : this.toX;
float fromY = reversed ? this.toY : this.fromY;
float toY = reversed ? this.fromY : this.toY;
float fromZ = reversed ? this.toZ... | [
"@",
"Override",
"protected",
"void",
"doTransform",
"(",
"ITransformable",
".",
"Scale",
"transformable",
",",
"float",
"comp",
")",
"{",
"float",
"fromX",
"=",
"reversed",
"?",
"this",
".",
"toX",
":",
"this",
".",
"fromX",
";",
"float",
"toX",
"=",
"r... | Calculate the transformation.
@param transformable the transformable
@param comp the comp | [
"Calculate",
"the",
"transformation",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Scale.java#L135-L147 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.changeEmail_POST | public OvhTask changeEmail_POST(String newEmail) throws IOException {
"""
Initiate an email change procedure
REST: POST /me/changeEmail
@param newEmail [required] New email to associate to your account
"""
String qPath = "/me/changeEmail";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = ne... | java | public OvhTask changeEmail_POST(String newEmail) throws IOException {
String qPath = "/me/changeEmail";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "newEmail", newEmail);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhT... | [
"public",
"OvhTask",
"changeEmail_POST",
"(",
"String",
"newEmail",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/changeEmail\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"HashMap",
"<",
"String",
",",
"Object",
">",... | Initiate an email change procedure
REST: POST /me/changeEmail
@param newEmail [required] New email to associate to your account | [
"Initiate",
"an",
"email",
"change",
"procedure"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2674-L2681 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.methodsIn | public static Set<ExecutableElement>
methodsIn(Set<? extends Element> elements) {
"""
Returns a set of methods in {@code elements}.
@return a set of methods in {@code elements}
@param elements the elements to filter
"""
return setFilter(elements, METHOD_KIND, ExecutableElement.class);
... | java | public static Set<ExecutableElement>
methodsIn(Set<? extends Element> elements) {
return setFilter(elements, METHOD_KIND, ExecutableElement.class);
} | [
"public",
"static",
"Set",
"<",
"ExecutableElement",
">",
"methodsIn",
"(",
"Set",
"<",
"?",
"extends",
"Element",
">",
"elements",
")",
"{",
"return",
"setFilter",
"(",
"elements",
",",
"METHOD_KIND",
",",
"ExecutableElement",
".",
"class",
")",
";",
"}"
] | Returns a set of methods in {@code elements}.
@return a set of methods in {@code elements}
@param elements the elements to filter | [
"Returns",
"a",
"set",
"of",
"methods",
"in",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L142-L145 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/protocol/file/Handler.java | Handler.hostsEqual | protected boolean hostsEqual(URL u1, URL u2) {
"""
Compares the host components of two URLs.
@param u1 the URL of the first host to compare
@param u2 the URL of the second host to compare
@return <tt>true</tt> if and only if they
are equal, <tt>false</tt> otherwise.
"""
/*
* Special case ... | java | protected boolean hostsEqual(URL u1, URL u2) {
/*
* Special case for file: URLs
* per RFC 1738 no hostname is equivalent to 'localhost'
* i.e. file:///path is equal to file://localhost/path
*/
String s1 = u1.getHost();
String s2 = u2.getHost();
if ("lo... | [
"protected",
"boolean",
"hostsEqual",
"(",
"URL",
"u1",
",",
"URL",
"u2",
")",
"{",
"/*\n * Special case for file: URLs\n * per RFC 1738 no hostname is equivalent to 'localhost'\n * i.e. file:///path is equal to file://localhost/path\n */",
"String",
"s1",
... | Compares the host components of two URLs.
@param u1 the URL of the first host to compare
@param u2 the URL of the second host to compare
@return <tt>true</tt> if and only if they
are equal, <tt>false</tt> otherwise. | [
"Compares",
"the",
"host",
"components",
"of",
"two",
"URLs",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/protocol/file/Handler.java#L122-L135 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getInheritedContainerState | public CmsInheritedContainerState getInheritedContainerState(CmsObject cms, String rootPath, String name)
throws CmsException {
"""
Returns the inheritance state for the given inheritance name and root path.<p>
@param cms the current cms context
@param rootPath the root path
@param name the inheritance na... | java | public CmsInheritedContainerState getInheritedContainerState(CmsObject cms, String rootPath, String name)
throws CmsException {
String oldSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot("");
CmsResource resource = cms.readResource(... | [
"public",
"CmsInheritedContainerState",
"getInheritedContainerState",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"String",
"oldSiteRoot",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getSit... | Returns the inheritance state for the given inheritance name and root path.<p>
@param cms the current cms context
@param rootPath the root path
@param name the inheritance name
@return the inheritance state
@throws CmsException if something goes wrong | [
"Returns",
"the",
"inheritance",
"state",
"for",
"the",
"given",
"inheritance",
"name",
"and",
"root",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L688-L699 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java | RuleActivator.isSameAsParent | private static boolean isSameAsParent(ActiveRuleChange change, RuleActivationContext context) {
"""
True if trying to override an inherited rule but with exactly the same values
"""
ActiveRuleWrapper parentActiveRule = context.getParentActiveRule();
if (parentActiveRule == null) {
return false;
... | java | private static boolean isSameAsParent(ActiveRuleChange change, RuleActivationContext context) {
ActiveRuleWrapper parentActiveRule = context.getParentActiveRule();
if (parentActiveRule == null) {
return false;
}
if (!StringUtils.equals(change.getSeverity(), parentActiveRule.get().getSeverityString... | [
"private",
"static",
"boolean",
"isSameAsParent",
"(",
"ActiveRuleChange",
"change",
",",
"RuleActivationContext",
"context",
")",
"{",
"ActiveRuleWrapper",
"parentActiveRule",
"=",
"context",
".",
"getParentActiveRule",
"(",
")",
";",
"if",
"(",
"parentActiveRule",
"... | True if trying to override an inherited rule but with exactly the same values | [
"True",
"if",
"trying",
"to",
"override",
"an",
"inherited",
"rule",
"but",
"with",
"exactly",
"the",
"same",
"values"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java#L454-L468 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/availability/CmsAvailabilityDialog.java | CmsAvailabilityDialog.initResetCheckbox | private void initResetCheckbox(CheckBox box, final CmsDateField field) {
"""
Creates a reset checkbox which can enable / disable a date field.<p>
@param box the check box
@param field the date field
"""
box.addValueChangeListener(new ValueChangeListener() {
private static final long s... | java | private void initResetCheckbox(CheckBox box, final CmsDateField field) {
box.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean)(event.getProper... | [
"private",
"void",
"initResetCheckbox",
"(",
"CheckBox",
"box",
",",
"final",
"CmsDateField",
"field",
")",
"{",
"box",
".",
"addValueChangeListener",
"(",
"new",
"ValueChangeListener",
"(",
")",
"{",
"private",
"static",
"final",
"long",
"serialVersionUID",
"=",
... | Creates a reset checkbox which can enable / disable a date field.<p>
@param box the check box
@param field the date field | [
"Creates",
"a",
"reset",
"checkbox",
"which",
"can",
"enable",
"/",
"disable",
"a",
"date",
"field",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/availability/CmsAvailabilityDialog.java#L516-L533 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.loadXml | public void loadXml(String fileName) throws CoreException {
"""
Load existing FindBugs xml report for the given collection of files.
@param fileName
xml file name to load bugs from
@throws CoreException
"""
if (fileName == null) {
return;
}
st = new StopTimer();
... | java | public void loadXml(String fileName) throws CoreException {
if (fileName == null) {
return;
}
st = new StopTimer();
// clear markers
clearMarkers(null);
final Project findBugsProject = new Project();
final Reporter bugReporter = new Reporter(javaProj... | [
"public",
"void",
"loadXml",
"(",
"String",
"fileName",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"fileName",
"==",
"null",
")",
"{",
"return",
";",
"}",
"st",
"=",
"new",
"StopTimer",
"(",
")",
";",
"// clear markers",
"clearMarkers",
"(",
"null",
... | Load existing FindBugs xml report for the given collection of files.
@param fileName
xml file name to load bugs from
@throws CoreException | [
"Load",
"existing",
"FindBugs",
"xml",
"report",
"for",
"the",
"given",
"collection",
"of",
"files",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L247-L264 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.allocateSlot | public boolean allocateSlot(int index, JobID jobId, AllocationID allocationId, Time slotTimeout) {
"""
Allocate the slot with the given index for the given job and allocation id. Returns true if
the slot could be allocated. Otherwise it returns false.
@param index of the task slot to allocate
@param jobId to ... | java | public boolean allocateSlot(int index, JobID jobId, AllocationID allocationId, Time slotTimeout) {
checkInit();
TaskSlot taskSlot = taskSlots.get(index);
boolean result = taskSlot.allocate(jobId, allocationId);
if (result) {
// update the allocation id to task slot map
allocationIDTaskSlotMap.put(alloc... | [
"public",
"boolean",
"allocateSlot",
"(",
"int",
"index",
",",
"JobID",
"jobId",
",",
"AllocationID",
"allocationId",
",",
"Time",
"slotTimeout",
")",
"{",
"checkInit",
"(",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"taskSlots",
".",
"get",
"(",
"index",
")",
... | Allocate the slot with the given index for the given job and allocation id. Returns true if
the slot could be allocated. Otherwise it returns false.
@param index of the task slot to allocate
@param jobId to allocate the task slot for
@param allocationId identifying the allocation
@param slotTimeout until the slot time... | [
"Allocate",
"the",
"slot",
"with",
"the",
"given",
"index",
"for",
"the",
"given",
"job",
"and",
"allocation",
"id",
".",
"Returns",
"true",
"if",
"the",
"slot",
"could",
"be",
"allocated",
".",
"Otherwise",
"it",
"returns",
"false",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L193-L219 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.writeRequestLine | protected void writeRequestLine(HttpState state, HttpConnection conn)
throws IOException, HttpException {
"""
Writes the request line to the given {@link HttpConnection connection}.
<p>
Subclasses may want to override this method to to customize the
processing.
</p>
@param state the {@link HttpState s... | java | protected void writeRequestLine(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)");
String requestLine = getRequestLine(conn);
if (Wire.HEADER_WIRE.enabled()) {
Wire.... | [
"protected",
"void",
"writeRequestLine",
"(",
"HttpState",
"state",
",",
"HttpConnection",
"conn",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)\"",
")",
";",
"String"... | Writes the request line to the given {@link HttpConnection connection}.
<p>
Subclasses may want to override this method to to customize the
processing.
</p>
@param state the {@link HttpState state} information associated with this method
@param conn the {@link HttpConnection connection} used to execute
this HTTP meth... | [
"Writes",
"the",
"request",
"line",
"to",
"the",
"given",
"{",
"@link",
"HttpConnection",
"connection",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L2342-L2351 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlUtil.java | SqlUtil.blobToStr | public static String blobToStr(Blob blob, Charset charset) {
"""
Blob字段值转字符串
@param blob {@link Blob}
@param charset 编码
@return 字符串
@since 3.0.6
"""
InputStream in = null;
try {
in = blob.getBinaryStream();
return IoUtil.read(in, charset);
} catch (SQLException e) {
throw new DbRunti... | java | public static String blobToStr(Blob blob, Charset charset) {
InputStream in = null;
try {
in = blob.getBinaryStream();
return IoUtil.read(in, charset);
} catch (SQLException e) {
throw new DbRuntimeException(e);
} finally {
IoUtil.close(in);
}
} | [
"public",
"static",
"String",
"blobToStr",
"(",
"Blob",
"blob",
",",
"Charset",
"charset",
")",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"blob",
".",
"getBinaryStream",
"(",
")",
";",
"return",
"IoUtil",
".",
"read",
"(",
"in"... | Blob字段值转字符串
@param blob {@link Blob}
@param charset 编码
@return 字符串
@since 3.0.6 | [
"Blob字段值转字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlUtil.java#L173-L183 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/Precision.java | Precision.equalsIncludingNaN | public static boolean equalsIncludingNaN(float x, float y) {
"""
Returns true if both arguments are NaN or neither is NaN and they are
equal as defined by {@link #equals(float,float) equals(x, y, 1)}.
@param x first value
@param y second value
@return {@code true} if the values are equal or both are NaN.
@s... | java | public static boolean equalsIncludingNaN(float x, float y) {
return (Float.isNaN(x) && Float.isNaN(y)) || equals(x, y, 1);
} | [
"public",
"static",
"boolean",
"equalsIncludingNaN",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"return",
"(",
"Float",
".",
"isNaN",
"(",
"x",
")",
"&&",
"Float",
".",
"isNaN",
"(",
"y",
")",
")",
"||",
"equals",
"(",
"x",
",",
"y",
",",
"1... | Returns true if both arguments are NaN or neither is NaN and they are
equal as defined by {@link #equals(float,float) equals(x, y, 1)}.
@param x first value
@param y second value
@return {@code true} if the values are equal or both are NaN.
@since 2.2 | [
"Returns",
"true",
"if",
"both",
"arguments",
"are",
"NaN",
"or",
"neither",
"is",
"NaN",
"and",
"they",
"are",
"equal",
"as",
"defined",
"by",
"{",
"@link",
"#equals",
"(",
"float",
"float",
")",
"equals",
"(",
"x",
"y",
"1",
")",
"}",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/Precision.java#L147-L149 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/ParameterServerListener.java | ParameterServerListener.onNDArrayPartial | @Override
public synchronized void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
"""
Used for partial updates using tensor along
dimension
@param arr the array to count as an update
@param idx the index for the tensor along dimension
@param dimensions the dimensions to act on ... | java | @Override
public synchronized void onNDArrayPartial(INDArray arr, long idx, int... dimensions) {
updater.partialUpdate(arr, updater.ndArrayHolder().get(), idx, dimensions);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"onNDArrayPartial",
"(",
"INDArray",
"arr",
",",
"long",
"idx",
",",
"int",
"...",
"dimensions",
")",
"{",
"updater",
".",
"partialUpdate",
"(",
"arr",
",",
"updater",
".",
"ndArrayHolder",
"(",
")",
".",
... | Used for partial updates using tensor along
dimension
@param arr the array to count as an update
@param idx the index for the tensor along dimension
@param dimensions the dimensions to act on for the tensor along dimension | [
"Used",
"for",
"partial",
"updates",
"using",
"tensor",
"along",
"dimension"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server/src/main/java/org/nd4j/parameterserver/ParameterServerListener.java#L92-L95 |
weld/core | impl/src/main/java/org/jboss/weld/util/Beans.java | Beans.isBeanProxyable | public static boolean isBeanProxyable(Bean<?> bean, BeanManagerImpl manager) {
"""
Indicates if a bean is proxyable
@param bean The bean to test
@return True if proxyable, false otherwise
"""
if (bean instanceof RIBean<?>) {
return ((RIBean<?>) bean).isProxyable();
} else {
... | java | public static boolean isBeanProxyable(Bean<?> bean, BeanManagerImpl manager) {
if (bean instanceof RIBean<?>) {
return ((RIBean<?>) bean).isProxyable();
} else {
return Proxies.isTypesProxyable(bean.getTypes(), manager.getServices());
}
} | [
"public",
"static",
"boolean",
"isBeanProxyable",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"manager",
")",
"{",
"if",
"(",
"bean",
"instanceof",
"RIBean",
"<",
"?",
">",
")",
"{",
"return",
"(",
"(",
"RIBean",
"<",
"?",
">",
")",
"... | Indicates if a bean is proxyable
@param bean The bean to test
@return True if proxyable, false otherwise | [
"Indicates",
"if",
"a",
"bean",
"is",
"proxyable"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Beans.java#L156-L162 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.extractDiag | public static void extractDiag(DMatrixRMaj src, DMatrixRMaj dst ) {
"""
<p>
Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst'
can either be a row or column vector.
<p>
@param src Matrix whose diagonal elements are being extracted. Not modified.
@param dst A vector the results will be... | java | public static void extractDiag(DMatrixRMaj src, DMatrixRMaj dst )
{
int N = Math.min(src.numRows, src.numCols);
if( !MatrixFeatures_DDRM.isVector(dst) || dst.numCols*dst.numCols != N ) {
dst.reshape(N,1);
}
for( int i = 0; i < N; i++ ) {
dst.set( i , src.uns... | [
"public",
"static",
"void",
"extractDiag",
"(",
"DMatrixRMaj",
"src",
",",
"DMatrixRMaj",
"dst",
")",
"{",
"int",
"N",
"=",
"Math",
".",
"min",
"(",
"src",
".",
"numRows",
",",
"src",
".",
"numCols",
")",
";",
"if",
"(",
"!",
"MatrixFeatures_DDRM",
"."... | <p>
Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst'
can either be a row or column vector.
<p>
@param src Matrix whose diagonal elements are being extracted. Not modified.
@param dst A vector the results will be written into. Modified. | [
"<p",
">",
"Extracts",
"the",
"diagonal",
"elements",
"src",
"write",
"it",
"to",
"the",
"dst",
"vector",
".",
"dst",
"can",
"either",
"be",
"a",
"row",
"or",
"column",
"vector",
".",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1310-L1321 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/TransactionMetrics.java | TransactionMetrics.abortTransactionFailed | public void abortTransactionFailed(String scope, String streamName, String txnId) {
"""
This method increments the global, Stream-related and Transaction-related counters of failed abort operations.
@param scope Scope.
@param streamName Name of the Stream.
@param txnId Transaction id.
"""
... | java | public void abortTransactionFailed(String scope, String streamName, String txnId) {
DYNAMIC_LOGGER.incCounterValue(globalMetricName(ABORT_TRANSACTION_FAILED), 1);
DYNAMIC_LOGGER.incCounterValue(ABORT_TRANSACTION_FAILED, 1, streamTags(scope, streamName));
DYNAMIC_LOGGER.incCounterValue(ABORT_TRAN... | [
"public",
"void",
"abortTransactionFailed",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"String",
"txnId",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"globalMetricName",
"(",
"ABORT_TRANSACTION_FAILED",
")",
",",
"1",
")",
";",
"DYNAMIC... | This method increments the global, Stream-related and Transaction-related counters of failed abort operations.
@param scope Scope.
@param streamName Name of the Stream.
@param txnId Transaction id. | [
"This",
"method",
"increments",
"the",
"global",
"Stream",
"-",
"related",
"and",
"Transaction",
"-",
"related",
"counters",
"of",
"failed",
"abort",
"operations",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/TransactionMetrics.java#L111-L115 |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.presignV4 | public static HttpUrl presignV4(Request request, String region, String accessKey, String secretKey, int expires)
throws NoSuchAlgorithmException, InvalidKeyException {
"""
Returns pre-signed HttpUrl object for given request, region, access key, secret key and expires time.
"""
String contentSha256 = "U... | java | public static HttpUrl presignV4(Request request, String region, String accessKey, String secretKey, int expires)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = "UNSIGNED-PAYLOAD";
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
Sign... | [
"public",
"static",
"HttpUrl",
"presignV4",
"(",
"Request",
"request",
",",
"String",
"region",
",",
"String",
"accessKey",
",",
"String",
"secretKey",
",",
"int",
"expires",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"String",
"co... | Returns pre-signed HttpUrl object for given request, region, access key, secret key and expires time. | [
"Returns",
"pre",
"-",
"signed",
"HttpUrl",
"object",
"for",
"given",
"request",
"region",
"access",
"key",
"secret",
"key",
"and",
"expires",
"time",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L328-L343 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/DiagonalMatrix.java | DiagonalMatrix.setColumn | public void setColumn(int column, double[] values) {
"""
{@inheritDoc}
Note that any values are not on the diagonal are ignored.
"""
checkIndices(values.length - 1, column);
values[column] = values[column];
} | java | public void setColumn(int column, double[] values) {
checkIndices(values.length - 1, column);
values[column] = values[column];
} | [
"public",
"void",
"setColumn",
"(",
"int",
"column",
",",
"double",
"[",
"]",
"values",
")",
"{",
"checkIndices",
"(",
"values",
".",
"length",
"-",
"1",
",",
"column",
")",
";",
"values",
"[",
"column",
"]",
"=",
"values",
"[",
"column",
"]",
";",
... | {@inheritDoc}
Note that any values are not on the diagonal are ignored. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/DiagonalMatrix.java#L165-L169 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.batchOfKeys | public static Batch batchOfKeys( final Iterator<NodeKey> keys,
final long nodeCount,
final float score,
final String workspaceName,
final RepositoryCache repository ) {
... | java | public static Batch batchOfKeys( final Iterator<NodeKey> keys,
final long nodeCount,
final float score,
final String workspaceName,
final RepositoryCache repository ) {
... | [
"public",
"static",
"Batch",
"batchOfKeys",
"(",
"final",
"Iterator",
"<",
"NodeKey",
">",
"keys",
",",
"final",
"long",
"nodeCount",
",",
"final",
"float",
"score",
",",
"final",
"String",
"workspaceName",
",",
"final",
"RepositoryCache",
"repository",
")",
"... | Create a batch of nodes around the supplied iterator. Note that the supplied iterator is accessed lazily only when the
batch is {@link Batch#nextRow() used}.
@param keys the iterator over the keys of the nodes to be returned; if null, an {@link #emptySequence empty instance} is
returned
@param nodeCount the number of ... | [
"Create",
"a",
"batch",
"of",
"nodes",
"around",
"the",
"supplied",
"iterator",
".",
"Note",
"that",
"the",
"supplied",
"iterator",
"is",
"accessed",
"lazily",
"only",
"when",
"the",
"batch",
"is",
"{",
"@link",
"Batch#nextRow",
"()",
"used",
"}",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1517-L1526 |
IBM-Cloud/gp-java-client | src/main/java/com/ibm/g11n/pipeline/client/rb/CloudResourceBundleControl.java | CloudResourceBundleControl.getInstance | public static CloudResourceBundleControl getInstance(ServiceAccount serviceAccount,
long cacheExpiration, String inclusionPattern, String exclusionPattern) {
"""
Create an instance of <code>CloudResourceBundleControl</code> with the specified
service account, cache expiration and bundle inclusion/excl... | java | public static CloudResourceBundleControl getInstance(ServiceAccount serviceAccount,
long cacheExpiration, String inclusionPattern, String exclusionPattern) {
return getInstance(serviceAccount, cacheExpiration, null, null, null);
} | [
"public",
"static",
"CloudResourceBundleControl",
"getInstance",
"(",
"ServiceAccount",
"serviceAccount",
",",
"long",
"cacheExpiration",
",",
"String",
"inclusionPattern",
",",
"String",
"exclusionPattern",
")",
"{",
"return",
"getInstance",
"(",
"serviceAccount",
",",
... | Create an instance of <code>CloudResourceBundleControl</code> with the specified
service account, cache expiration and bundle inclusion/exclusion name patterns.
<p>
This method is equivalent to
<code>getInstance(serviceAccount, cacheExpiration, inclusionPattern, exclusionPattern, null)</code>.
@param serviceAccount ... | [
"Create",
"an",
"instance",
"of",
"<code",
">",
"CloudResourceBundleControl<",
"/",
"code",
">",
"with",
"the",
"specified",
"service",
"account",
"cache",
"expiration",
"and",
"bundle",
"inclusion",
"/",
"exclusion",
"name",
"patterns",
".",
"<p",
">",
"This",
... | train | https://github.com/IBM-Cloud/gp-java-client/blob/b015a081d7a7313bc48c448087fbc07bce860427/src/main/java/com/ibm/g11n/pipeline/client/rb/CloudResourceBundleControl.java#L247-L250 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java | ApptentiveNestedScrollView.fullScroll | public boolean fullScroll(int direction) {
"""
<p>Handles scrolling in response to a "home/end" shortcut press. This
method will scroll the view to the top or bottom and give the focus
to the topmost/bottommost component in the new visible area. If no
component is a good candidate for focus, this scrollview rec... | java | public boolean fullScroll(int direction) {
boolean down = direction == View.FOCUS_DOWN;
int height = getHeight();
mTempRect.top = 0;
mTempRect.bottom = height;
if (down) {
int count = getChildCount();
if (count > 0) {
View view = getChildAt(count - 1);
mTempRect.bottom = view.getBottom() + get... | [
"public",
"boolean",
"fullScroll",
"(",
"int",
"direction",
")",
"{",
"boolean",
"down",
"=",
"direction",
"==",
"View",
".",
"FOCUS_DOWN",
";",
"int",
"height",
"=",
"getHeight",
"(",
")",
";",
"mTempRect",
".",
"top",
"=",
"0",
";",
"mTempRect",
".",
... | <p>Handles scrolling in response to a "home/end" shortcut press. This
method will scroll the view to the top or bottom and give the focus
to the topmost/bottommost component in the new visible area. If no
component is a good candidate for focus, this scrollview reclaims the
focus.</p>
@param direction the scroll direc... | [
"<p",
">",
"Handles",
"scrolling",
"in",
"response",
"to",
"a",
"home",
"/",
"end",
"shortcut",
"press",
".",
"This",
"method",
"will",
"scroll",
"the",
"view",
"to",
"the",
"top",
"or",
"bottom",
"and",
"give",
"the",
"focus",
"to",
"the",
"topmost",
... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/view/ApptentiveNestedScrollView.java#L1148-L1165 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java | ElementBase.addChild | protected void addChild(ElementBase child, boolean doEvent) {
"""
Adds the specified child element. The validity of the operation is first tested and an
exception thrown if the element is not a valid child for this parent.
@param child Element to add as a child.
@param doEvent Fires the add child events if tr... | java | protected void addChild(ElementBase child, boolean doEvent) {
if (!child.canAcceptParent(this)) {
CWFException.raise(child.rejectReason);
}
if (!canAcceptChild(child)) {
CWFException.raise(rejectReason);
}
if (doEvent) {
befor... | [
"protected",
"void",
"addChild",
"(",
"ElementBase",
"child",
",",
"boolean",
"doEvent",
")",
"{",
"if",
"(",
"!",
"child",
".",
"canAcceptParent",
"(",
"this",
")",
")",
"{",
"CWFException",
".",
"raise",
"(",
"child",
".",
"rejectReason",
")",
";",
"}"... | Adds the specified child element. The validity of the operation is first tested and an
exception thrown if the element is not a valid child for this parent.
@param child Element to add as a child.
@param doEvent Fires the add child events if true. | [
"Adds",
"the",
"specified",
"child",
"element",
".",
"The",
"validity",
"of",
"the",
"operation",
"is",
"first",
"tested",
"and",
"an",
"exception",
"thrown",
"if",
"the",
"element",
"is",
"not",
"a",
"valid",
"child",
"for",
"this",
"parent",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java#L155-L178 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.safeLoadStylesheets | public static void safeLoadStylesheets(String[] stylesheets, JavaScriptObject callback) {
"""
Loads a list of stylesheets and invokes a Javascript callback after everything has been loaded.<p>
@param stylesheets the array of stylesheet uris
@param callback the callback to call after everything is loaded
""... | java | public static void safeLoadStylesheets(String[] stylesheets, JavaScriptObject callback) {
CmsStylesheetLoader loader = new CmsStylesheetLoader(Arrays.asList(stylesheets), new Runnable() {
public native void call(JavaScriptObject jsCallback) /*-{
jsCallback();
}-*/;
public ... | [
"public",
"static",
"void",
"safeLoadStylesheets",
"(",
"String",
"[",
"]",
"stylesheets",
",",
"JavaScriptObject",
"callback",
")",
"{",
"CmsStylesheetLoader",
"loader",
"=",
"new",
"CmsStylesheetLoader",
"(",
"Arrays",
".",
"asList",
"(",
"stylesheets",
")",
","... | Loads a list of stylesheets and invokes a Javascript callback after everything has been loaded.<p>
@param stylesheets the array of stylesheet uris
@param callback the callback to call after everything is loaded | [
"Loads",
"a",
"list",
"of",
"stylesheets",
"and",
"invokes",
"a",
"Javascript",
"callback",
"after",
"everything",
"has",
"been",
"loaded",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L2009-L2026 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Instant.java | Instant.ofEpochMilli | public static Instant ofEpochMilli(long epochMilli) {
"""
Obtains an instance of {@code Instant} using milliseconds from the
epoch of 1970-01-01T00:00:00Z.
<p>
The seconds and nanoseconds are extracted from the specified milliseconds.
@param epochMilli the number of milliseconds from 1970-01-01T00:00:00Z
@... | java | public static Instant ofEpochMilli(long epochMilli) {
long secs = Math.floorDiv(epochMilli, 1000);
int mos = (int)Math.floorMod(epochMilli, 1000);
return create(secs, mos * 1000_000);
} | [
"public",
"static",
"Instant",
"ofEpochMilli",
"(",
"long",
"epochMilli",
")",
"{",
"long",
"secs",
"=",
"Math",
".",
"floorDiv",
"(",
"epochMilli",
",",
"1000",
")",
";",
"int",
"mos",
"=",
"(",
"int",
")",
"Math",
".",
"floorMod",
"(",
"epochMilli",
... | Obtains an instance of {@code Instant} using milliseconds from the
epoch of 1970-01-01T00:00:00Z.
<p>
The seconds and nanoseconds are extracted from the specified milliseconds.
@param epochMilli the number of milliseconds from 1970-01-01T00:00:00Z
@return an instant, not null
@throws DateTimeException if the instant ... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"Instant",
"}",
"using",
"milliseconds",
"from",
"the",
"epoch",
"of",
"1970",
"-",
"01",
"-",
"01T00",
":",
"00",
":",
"00Z",
".",
"<p",
">",
"The",
"seconds",
"and",
"nanoseconds",
"are",
"extracted",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Instant.java#L337-L341 |
gallandarakhneorg/afc | advanced/attributes/src/main/java/org/arakhne/afc/attrs/attr/AttributeImpl.java | AttributeImpl.compareAttrNames | @Pure
public static int compareAttrNames(String arg0, String arg1) {
"""
Compare the two specified attribute names.
@param arg0 first attribute.
@param arg1 second attribute.
@return replies a negative value if {@code arg0} is lesser than
{@code arg1}, a positive value if {@code arg0} is greater than
{@cod... | java | @Pure
public static int compareAttrNames(String arg0, String arg1) {
if (arg0 == arg1) {
return 0;
}
if (arg0 == null) {
return Integer.MAX_VALUE;
}
if (arg1 == null) {
return Integer.MIN_VALUE;
}
return arg0.compareToIgnoreCase(arg1);
} | [
"@",
"Pure",
"public",
"static",
"int",
"compareAttrNames",
"(",
"String",
"arg0",
",",
"String",
"arg1",
")",
"{",
"if",
"(",
"arg0",
"==",
"arg1",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"arg0",
"==",
"null",
")",
"{",
"return",
"Integer",
... | Compare the two specified attribute names.
@param arg0 first attribute.
@param arg1 second attribute.
@return replies a negative value if {@code arg0} is lesser than
{@code arg1}, a positive value if {@code arg0} is greater than
{@code arg1}, or <code>0</code> if they are equal.
@see AttributeNameComparator | [
"Compare",
"the",
"two",
"specified",
"attribute",
"names",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/attributes/src/main/java/org/arakhne/afc/attrs/attr/AttributeImpl.java#L376-L388 |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/AbstractParser.java | AbstractParser.addError | protected void addError(final DefaultDataSet ds, final String errorDesc, final int lineNo, final int errorLevel, final String lineData) {
"""
Adds a new error to this DataSet. These can be collected, and retrieved
after processing
@param ds
the data set from the parser
@param errorDesc
String description of... | java | protected void addError(final DefaultDataSet ds, final String errorDesc, final int lineNo, final int errorLevel, final String lineData) {
if (errorLevel == 1 && isIgnoreParseWarnings()) {
// user has selected to not log warnings in the parser
return;
}
ds.addError(ne... | [
"protected",
"void",
"addError",
"(",
"final",
"DefaultDataSet",
"ds",
",",
"final",
"String",
"errorDesc",
",",
"final",
"int",
"lineNo",
",",
"final",
"int",
"errorLevel",
",",
"final",
"String",
"lineData",
")",
"{",
"if",
"(",
"errorLevel",
"==",
"1",
... | Adds a new error to this DataSet. These can be collected, and retrieved
after processing
@param ds
the data set from the parser
@param errorDesc
String description of error
@param lineNo
line number error occurred on
@param errorLevel
errorLevel 1,2,3 1=warning 2=error 3= severe error'
@param lineData
Data of the line... | [
"Adds",
"a",
"new",
"error",
"to",
"this",
"DataSet",
".",
"These",
"can",
"be",
"collected",
"and",
"retrieved",
"after",
"processing"
] | train | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java#L275-L281 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java | OmemoManager.distrustOmemoIdentity | public void distrustOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
"""
Distrust the fingerprint/OmemoDevice tuple.
The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must
be of length 64.
@param device device
@param fingerprint fingerprint
... | java | public void distrustOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
if (trustCallback == null) {
throw new IllegalStateException("No TrustCallback set.");
}
trustCallback.setTrust(device, fingerprint, TrustState.untrusted);
} | [
"public",
"void",
"distrustOmemoIdentity",
"(",
"OmemoDevice",
"device",
",",
"OmemoFingerprint",
"fingerprint",
")",
"{",
"if",
"(",
"trustCallback",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No TrustCallback set.\"",
")",
";",
"}",
... | Distrust the fingerprint/OmemoDevice tuple.
The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must
be of length 64.
@param device device
@param fingerprint fingerprint | [
"Distrust",
"the",
"fingerprint",
"/",
"OmemoDevice",
"tuple",
".",
"The",
"fingerprint",
"must",
"be",
"the",
"lowercase",
"hexadecimal",
"fingerprint",
"of",
"the",
"identityKey",
"of",
"the",
"device",
"and",
"must",
"be",
"of",
"length",
"64",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L435-L441 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/tsdb/model/Filters.java | Filters.addField | public Filters addField(String field, String value) {
"""
Add field filter to fields which just append not replace.
@param field The field name for filter
@param value The value filter
@return Filters
"""
initialFields();
fields.add(new FieldFilter(field, value));
return this;
... | java | public Filters addField(String field, String value) {
initialFields();
fields.add(new FieldFilter(field, value));
return this;
} | [
"public",
"Filters",
"addField",
"(",
"String",
"field",
",",
"String",
"value",
")",
"{",
"initialFields",
"(",
")",
";",
"fields",
".",
"add",
"(",
"new",
"FieldFilter",
"(",
"field",
",",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add field filter to fields which just append not replace.
@param field The field name for filter
@param value The value filter
@return Filters | [
"Add",
"field",
"filter",
"to",
"fields",
"which",
"just",
"append",
"not",
"replace",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/tsdb/model/Filters.java#L277-L281 |
jenkinsci/pipeline-maven-plugin | jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java | XmlUtils.join | @Nonnull
public static String join(@Nonnull Iterable<String> elements, @Nonnull String delimiter) {
"""
Concatenate the given {@code elements} using the given {@code delimiter} to concatenate.
"""
StringBuilder result = new StringBuilder();
Iterator<String> it = elements.iterator();
... | java | @Nonnull
public static String join(@Nonnull Iterable<String> elements, @Nonnull String delimiter) {
StringBuilder result = new StringBuilder();
Iterator<String> it = elements.iterator();
while (it.hasNext()) {
String element = it.next();
result.append(element);
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"join",
"(",
"@",
"Nonnull",
"Iterable",
"<",
"String",
">",
"elements",
",",
"@",
"Nonnull",
"String",
"delimiter",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Iterator",
... | Concatenate the given {@code elements} using the given {@code delimiter} to concatenate. | [
"Concatenate",
"the",
"given",
"{"
] | train | https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java#L420-L432 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java | ListManagementTermsImpl.addTerm | public Object addTerm(String listId, String term, String language) {
"""
Add a term to the term list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param term Term to be deleted
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail ... | java | public Object addTerm(String listId, String term, String language) {
return addTermWithServiceResponseAsync(listId, term, language).toBlocking().single().body();
} | [
"public",
"Object",
"addTerm",
"(",
"String",
"listId",
",",
"String",
"term",
",",
"String",
"language",
")",
"{",
"return",
"addTermWithServiceResponseAsync",
"(",
"listId",
",",
"term",
",",
"language",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"("... | Add a term to the term list with list Id equal to list Id passed.
@param listId List Id of the image list.
@param term Term to be deleted
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown if the request is rejected by serve... | [
"Add",
"a",
"term",
"to",
"the",
"term",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L89-L91 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java | BcUtils.isAlgorithlIdentifierEqual | public static boolean isAlgorithlIdentifierEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2) {
"""
Compare two algorithm identifier.
@param id1 an algorithm identifier.
@param id2 another algorithm identifier.
@return true if both algorithm identifier are equals, false otherwise.
"""
if (!id... | java | public static boolean isAlgorithlIdentifierEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2)
{
if (!id1.getAlgorithm().equals(id2.getAlgorithm()))
{
return false;
}
if (id1.getParameters() == null)
{
return !(id2.getParameters() != null && !id2.... | [
"public",
"static",
"boolean",
"isAlgorithlIdentifierEqual",
"(",
"AlgorithmIdentifier",
"id1",
",",
"AlgorithmIdentifier",
"id2",
")",
"{",
"if",
"(",
"!",
"id1",
".",
"getAlgorithm",
"(",
")",
".",
"equals",
"(",
"id2",
".",
"getAlgorithm",
"(",
")",
")",
... | Compare two algorithm identifier.
@param id1 an algorithm identifier.
@param id2 another algorithm identifier.
@return true if both algorithm identifier are equals, false otherwise. | [
"Compare",
"two",
"algorithm",
"identifier",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L149-L167 |
Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java | ThriftKeyspaceImpl.toThriftKeyspaceDefinition | private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition(final Map<String, Object> options) {
"""
Convert a Map of options to an internal thrift keyspace definition
@param options
"""
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl();
Map<String, Object> int... | java | private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition(final Map<String, Object> options) {
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
internalOptions.putAll(op... | [
"private",
"ThriftKeyspaceDefinitionImpl",
"toThriftKeyspaceDefinition",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"ThriftKeyspaceDefinitionImpl",
"def",
"=",
"new",
"ThriftKeyspaceDefinitionImpl",
"(",
")",
";",
"Map",
"<",
"String"... | Convert a Map of options to an internal thrift keyspace definition
@param options | [
"Convert",
"a",
"Map",
"of",
"options",
"to",
"an",
"internal",
"thrift",
"keyspace",
"definition"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java#L800-L819 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java | FhirContext.setDefaultTypeForProfile | public void setDefaultTypeForProfile(String theProfile, Class<? extends IBaseResource> theClass) {
"""
Sets the default type which will be used when parsing a resource that is found to be
of the given profile.
<p>
For example, this method is invoked with the profile string of
<code>"http://example.com/some_pat... | java | public void setDefaultTypeForProfile(String theProfile, Class<? extends IBaseResource> theClass) {
Validate.notBlank(theProfile, "theProfile must not be null or empty");
if (theClass == null) {
myDefaultTypeForProfile.remove(theProfile);
} else {
myDefaultTypeForProfile.put(theProfile, theClass);
}
} | [
"public",
"void",
"setDefaultTypeForProfile",
"(",
"String",
"theProfile",
",",
"Class",
"<",
"?",
"extends",
"IBaseResource",
">",
"theClass",
")",
"{",
"Validate",
".",
"notBlank",
"(",
"theProfile",
",",
"\"theProfile must not be null or empty\"",
")",
";",
"if",... | Sets the default type which will be used when parsing a resource that is found to be
of the given profile.
<p>
For example, this method is invoked with the profile string of
<code>"http://example.com/some_patient_profile"</code> and the type of <code>MyPatient.class</code>,
if the parser is parsing a resource and finds... | [
"Sets",
"the",
"default",
"type",
"which",
"will",
"be",
"used",
"when",
"parsing",
"a",
"resource",
"that",
"is",
"found",
"to",
"be",
"of",
"the",
"given",
"profile",
".",
"<p",
">",
"For",
"example",
"this",
"method",
"is",
"invoked",
"with",
"the",
... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java#L830-L837 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationEventHandler.java | AVIMConversationEventHandler.onMemberUnblocked | public void onMemberUnblocked(AVIMClient client, AVIMConversation conversation, List<String> members, String operator) {
"""
聊天室成员被移出黑名单通知处理函数
@param client 聊天客户端
@param conversation 对话
@param members 成员列表
@param operator 操作者 id
"""
LOGGER.d("Notification --- " + operator + " unblock... | java | public void onMemberUnblocked(AVIMClient client, AVIMConversation conversation, List<String> members, String operator){
LOGGER.d("Notification --- " + operator + " unblocked members: " + StringUtil.join(", ", members));
} | [
"public",
"void",
"onMemberUnblocked",
"(",
"AVIMClient",
"client",
",",
"AVIMConversation",
"conversation",
",",
"List",
"<",
"String",
">",
"members",
",",
"String",
"operator",
")",
"{",
"LOGGER",
".",
"d",
"(",
"\"Notification --- \"",
"+",
"operator",
"+",
... | 聊天室成员被移出黑名单通知处理函数
@param client 聊天客户端
@param conversation 对话
@param members 成员列表
@param operator 操作者 id | [
"聊天室成员被移出黑名单通知处理函数"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationEventHandler.java#L146-L148 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/transport/BaseTransport.java | BaseTransport.internalMessageHandler | protected void internalMessageHandler(DirectBuffer buffer, int offset, int length, Header header) {
"""
This message handler is responsible for receiving coordination messages on Shard side
@param buffer
@param offset
@param length
@param header
"""
/**
* All incoming internal messages a... | java | protected void internalMessageHandler(DirectBuffer buffer, int offset, int length, Header header) {
/**
* All incoming internal messages are either op commands, or aggregation messages that are tied to commands
*/
byte[] data = new byte[length];
buffer.getBytes(offset, data);
... | [
"protected",
"void",
"internalMessageHandler",
"(",
"DirectBuffer",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Header",
"header",
")",
"{",
"/**\n * All incoming internal messages are either op commands, or aggregation messages that are tied to commands\n ... | This message handler is responsible for receiving coordination messages on Shard side
@param buffer
@param offset
@param length
@param header | [
"This",
"message",
"handler",
"is",
"responsible",
"for",
"receiving",
"coordination",
"messages",
"on",
"Shard",
"side"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/transport/BaseTransport.java#L248-L260 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getGuildTreasuryInfo | public void getGuildTreasuryInfo(String id, String api, Callback<List<GuildTreasury>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on guild treasury API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/treasury">here</a><br/>
Give user the access to {@link Callback#on... | java | public void getGuildTreasuryInfo(String id, String api, Callback<List<GuildTreasury>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getGuildTreasuryInfo(id, api).enqueue(callback);
} | [
"public",
"void",
"getGuildTreasuryInfo",
"(",
"String",
"id",
",",
"String",
"api",
",",
"Callback",
"<",
"List",
"<",
"GuildTreasury",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"Pa... | For more info on guild treasury API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/treasury">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/>
@param id guild id
@param api Guil... | [
"For",
"more",
"info",
"on",
"guild",
"treasury",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
"/",
"treasury",
">",
"here<",
"/",
"a",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1569-L1572 |
vigna/Sux4J | src/it/unimi/dsi/sux4j/mph/HypergraphSorter.java | HypergraphSorter.tripleToEdge | public static void tripleToEdge(final long[] triple, final long seed, final int numVertices, final int e[]) {
"""
Turns a triple of longs into a 3-hyperedge.
@param triple a triple of intermediate hashes.
@param seed the seed for the hash function.
@param numVertices the number of vertices in the underlying h... | java | public static void tripleToEdge(final long[] triple, final long seed, final int numVertices, final int e[]) {
tripleToEdge(triple, seed, numVertices, (int)(numVertices * 0xAAAAAAABL >>> 33), e); // Fast division by 3
} | [
"public",
"static",
"void",
"tripleToEdge",
"(",
"final",
"long",
"[",
"]",
"triple",
",",
"final",
"long",
"seed",
",",
"final",
"int",
"numVertices",
",",
"final",
"int",
"e",
"[",
"]",
")",
"{",
"tripleToEdge",
"(",
"triple",
",",
"seed",
",",
"numV... | Turns a triple of longs into a 3-hyperedge.
@param triple a triple of intermediate hashes.
@param seed the seed for the hash function.
@param numVertices the number of vertices in the underlying hypergraph.
@param e an array to store the resulting edge.
@see #bitVectorToEdge(BitVector, long, int, int, int[]) | [
"Turns",
"a",
"triple",
"of",
"longs",
"into",
"a",
"3",
"-",
"hyperedge",
"."
] | train | https://github.com/vigna/Sux4J/blob/d57de8fa897c7d273e0e6dae7a3274174f175a5f/src/it/unimi/dsi/sux4j/mph/HypergraphSorter.java#L253-L255 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/WhitelistingApi.java | WhitelistingApi.enableWhitelist | public WhitelistEnvelope enableWhitelist(String dtid, DeviceTypeUpdateInput deviceTypeUpdateInfo) throws ApiException {
"""
Enable or disble whitelist feature of a device type
Enable or disble whitelist feature of a device type
@param dtid Device Type ID. (required)
@param deviceTypeUpdateInfo Device type updat... | java | public WhitelistEnvelope enableWhitelist(String dtid, DeviceTypeUpdateInput deviceTypeUpdateInfo) throws ApiException {
ApiResponse<WhitelistEnvelope> resp = enableWhitelistWithHttpInfo(dtid, deviceTypeUpdateInfo);
return resp.getData();
} | [
"public",
"WhitelistEnvelope",
"enableWhitelist",
"(",
"String",
"dtid",
",",
"DeviceTypeUpdateInput",
"deviceTypeUpdateInfo",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"WhitelistEnvelope",
">",
"resp",
"=",
"enableWhitelistWithHttpInfo",
"(",
"dtid",
",",
... | Enable or disble whitelist feature of a device type
Enable or disble whitelist feature of a device type
@param dtid Device Type ID. (required)
@param deviceTypeUpdateInfo Device type update input. (required)
@return WhitelistEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize ... | [
"Enable",
"or",
"disble",
"whitelist",
"feature",
"of",
"a",
"device",
"type",
"Enable",
"or",
"disble",
"whitelist",
"feature",
"of",
"a",
"device",
"type"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/WhitelistingApi.java#L392-L395 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readPropertyObject | public CmsProperty readPropertyObject(CmsDbContext dbc, CmsResource resource, String key, boolean search)
throws CmsException {
"""
Reads a property object from a resource specified by a property name.<p>
Returns <code>{@link CmsProperty#getNullProperty()}</code> if the property is not found.<p>
@param d... | java | public CmsProperty readPropertyObject(CmsDbContext dbc, CmsResource resource, String key, boolean search)
throws CmsException {
// NOTE: Do not call readPropertyObject(dbc, resource, key, search, null) for performance reasons
// use the list reading method to obtain all properties for the resource... | [
"public",
"CmsProperty",
"readPropertyObject",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"String",
"key",
",",
"boolean",
"search",
")",
"throws",
"CmsException",
"{",
"// NOTE: Do not call readPropertyObject(dbc, resource, key, search, null) for performa... | Reads a property object from a resource specified by a property name.<p>
Returns <code>{@link CmsProperty#getNullProperty()}</code> if the property is not found.<p>
@param dbc the current database context
@param resource the resource where the property is read from
@param key the property key name
@param search if <c... | [
"Reads",
"a",
"property",
"object",
"from",
"a",
"resource",
"specified",
"by",
"a",
"property",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7383-L7400 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.concatDelayError | @SuppressWarnings( {
"""
Concatenates the Iterable sequence of MaybeSources into a single sequence by subscribing to each MaybeSource,
one after the other, one at a time and delays any errors till the all inner MaybeSources terminate.
<p>
<img width="640" height="469" src="https://raw.github.com/wiki/ReactiveX/... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
@BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concatDelayError(Iterable<? extends MaybeSource<? extends T>> sources) {
ObjectHelper.requireNonNull(sources, "sourc... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static... | Concatenates the Iterable sequence of MaybeSources into a single sequence by subscribing to each MaybeSource,
one after the other, one at a time and delays any errors till the all inner MaybeSources terminate.
<p>
<img width="640" height="469" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.... | [
"Concatenates",
"the",
"Iterable",
"sequence",
"of",
"MaybeSources",
"into",
"a",
"single",
"sequence",
"by",
"subscribing",
"to",
"each",
"MaybeSource",
"one",
"after",
"the",
"other",
"one",
"at",
"a",
"time",
"and",
"delays",
"any",
"errors",
"till",
"the",... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L434-L441 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java | SwaptionDataLattice.getValue | public double getValue(double maturity, double tenor, double moneyness, QuotingConvention convention, double displacement, AnalyticModel model) {
"""
Return the value in the given quoting convention.
Conversion involving receiver premium assumes zero wide collar.
@param maturity The maturity of the option as y... | java | public double getValue(double maturity, double tenor, double moneyness, QuotingConvention convention, double displacement, AnalyticModel model) {
DataKey key = new DataKey(maturity, tenor, moneyness);
return convertToConvention(getValue(key), key, convention, displacement, quotingConvention, this.displacement, mo... | [
"public",
"double",
"getValue",
"(",
"double",
"maturity",
",",
"double",
"tenor",
",",
"double",
"moneyness",
",",
"QuotingConvention",
"convention",
",",
"double",
"displacement",
",",
"AnalyticModel",
"model",
")",
"{",
"DataKey",
"key",
"=",
"new",
"DataKey"... | Return the value in the given quoting convention.
Conversion involving receiver premium assumes zero wide collar.
@param maturity The maturity of the option as year fraction from the reference date.
@param tenor The tenor of the swap as year fraction from the reference date.
@param moneyness The moneyness as actual di... | [
"Return",
"the",
"value",
"in",
"the",
"given",
"quoting",
"convention",
".",
"Conversion",
"involving",
"receiver",
"premium",
"assumes",
"zero",
"wide",
"collar",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java#L612-L615 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, ArrayList<CharSequence> value) {
"""
Inserts an ArrayList<CharSequence> 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 an ArrayList<CharSequence> object, or nul... | java | public TaskResult add(String key, ArrayList<CharSequence> value) {
mBundle.putCharSequenceArrayList(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"CharSequence",
">",
"value",
")",
"{",
"mBundle",
".",
"putCharSequenceArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an ArrayList<CharSequence> 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 an ArrayList<CharSequence> object, or null | [
"Inserts",
"an",
"ArrayList<CharSequence",
">",
"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/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L251-L254 |
Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/locking/LockedObject.java | LockedObject.checkChildren | private boolean checkChildren(boolean exclusive, int depth) {
"""
helper of checkLocks(). looks if the children are locked
@param exclusive
wheather the new lock should be exclusive
@return true if no locks at the children paths are forbidding a new lock
@param depth
depth
"""
if (_children == n... | java | private boolean checkChildren(boolean exclusive, int depth) {
if (_children == null) {
// a file
return _owner == null || !(_exclusive || exclusive);
} else {
// a folder
if (_owner == null) {
// no owner, checking children
... | [
"private",
"boolean",
"checkChildren",
"(",
"boolean",
"exclusive",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"_children",
"==",
"null",
")",
"{",
"// a file",
"return",
"_owner",
"==",
"null",
"||",
"!",
"(",
"_exclusive",
"||",
"exclusive",
")",
";",
"... | helper of checkLocks(). looks if the children are locked
@param exclusive
wheather the new lock should be exclusive
@return true if no locks at the children paths are forbidding a new lock
@param depth
depth | [
"helper",
"of",
"checkLocks",
"()",
".",
"looks",
"if",
"the",
"children",
"are",
"locked"
] | train | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/locking/LockedObject.java#L298-L328 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/image/ImageProxy.java | ImageProxy.getImageData | public ImageData getImageData() {
"""
Returns an ImageData object that can be used for further image processing
e.g. by image filters.
@return ImageData
"""
if (false == isLoaded())
{
return null;
}
if (m_fastout)
{
final ScratchPad tem... | java | public ImageData getImageData()
{
if (false == isLoaded())
{
return null;
}
if (m_fastout)
{
final ScratchPad temp = new ScratchPad(m_dest_wide, m_dest_high);
temp.getContext().drawImage(m_jsimg, m_clip_xpos, m_clip_ypos, m_clip_... | [
"public",
"ImageData",
"getImageData",
"(",
")",
"{",
"if",
"(",
"false",
"==",
"isLoaded",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"m_fastout",
")",
"{",
"final",
"ScratchPad",
"temp",
"=",
"new",
"ScratchPad",
"(",
"m_dest_wide",
"... | Returns an ImageData object that can be used for further image processing
e.g. by image filters.
@return ImageData | [
"Returns",
"an",
"ImageData",
"object",
"that",
"can",
"be",
"used",
"for",
"further",
"image",
"processing",
"e",
".",
"g",
".",
"by",
"image",
"filters",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/image/ImageProxy.java#L595-L613 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Footer.java | ID3v2Footer.checkFooter | private boolean checkFooter(RandomAccessInputStream raf, int location) throws IOException {
"""
Checks to see if there is an id3v2 footer in the file provided to the
constructor.
@param location where the footer should be located in the file
@return true if an id3v2 footer exists in the file
@exception FileN... | java | private boolean checkFooter(RandomAccessInputStream raf, int location) throws IOException
{
raf.seek(location);
byte[] buf = new byte[FOOT_SIZE];
if (raf.read(buf) != FOOT_SIZE)
{
throw new IOException("Error encountered finding id3v2 footer");
}
String result = new String(buf, ENC_TYPE);
if (result... | [
"private",
"boolean",
"checkFooter",
"(",
"RandomAccessInputStream",
"raf",
",",
"int",
"location",
")",
"throws",
"IOException",
"{",
"raf",
".",
"seek",
"(",
"location",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"FOOT_SIZE",
"]",
";",
... | Checks to see if there is an id3v2 footer in the file provided to the
constructor.
@param location where the footer should be located in the file
@return true if an id3v2 footer exists in the file
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs | [
"Checks",
"to",
"see",
"if",
"there",
"is",
"an",
"id3v2",
"footer",
"in",
"the",
"file",
"provided",
"to",
"the",
"constructor",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Footer.java#L81-L104 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java | SpiceServiceListenerNotifier.notifyObserversOfRequestProgress | public void notifyObserversOfRequestProgress(CachedSpiceRequest<?> request, RequestProgress requestProgress) {
"""
Notify interested observers of request progress.
@param request the request in progress.
@param requestProgress the progress of the request.
"""
RequestProcessingContext requestProcessin... | java | public void notifyObserversOfRequestProgress(CachedSpiceRequest<?> request, RequestProgress requestProgress) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingContext.setRequ... | [
"public",
"void",
"notifyObserversOfRequestProgress",
"(",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"RequestProgress",
"requestProgress",
")",
"{",
"RequestProcessingContext",
"requestProcessingContext",
"=",
"new",
"RequestProcessingContext",
"(",
")",
";",
"... | Notify interested observers of request progress.
@param request the request in progress.
@param requestProgress the progress of the request. | [
"Notify",
"interested",
"observers",
"of",
"request",
"progress",
"."
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L122-L127 |
JavaMoney/jsr354-api | src/main/java/javax/money/Monetary.java | Monetary.isRoundingAvailable | public static boolean isRoundingAvailable(RoundingQuery roundingQuery) {
"""
Checks if a {@link MonetaryRounding} matching the query is available.
@param roundingQuery The {@link javax.money.RoundingQuery} that may contains arbitrary parameters to be
evaluated.
@return true, if a corresponding {@link javax.mo... | java | public static boolean isRoundingAvailable(RoundingQuery roundingQuery) {
return Optional.ofNullable(monetaryRoundingsSingletonSpi()).orElseThrow(
() -> new MonetaryException("No MonetaryRoundingsSpi loaded, query functionality is not available."))
.isRoundingAvailable(roundingQue... | [
"public",
"static",
"boolean",
"isRoundingAvailable",
"(",
"RoundingQuery",
"roundingQuery",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"monetaryRoundingsSingletonSpi",
"(",
")",
")",
".",
"orElseThrow",
"(",
"(",
")",
"->",
"new",
"MonetaryException",
... | Checks if a {@link MonetaryRounding} matching the query is available.
@param roundingQuery The {@link javax.money.RoundingQuery} that may contains arbitrary parameters to be
evaluated.
@return true, if a corresponding {@link javax.money.MonetaryRounding} is available.
@throws IllegalArgumentException if no such roundi... | [
"Checks",
"if",
"a",
"{",
"@link",
"MonetaryRounding",
"}",
"matching",
"the",
"query",
"is",
"available",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L234-L238 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/FunctionsInner.java | FunctionsInner.createOrReplace | public FunctionInner createOrReplace(String resourceGroupName, String jobName, String functionName, FunctionInner function) {
"""
Creates a function or replaces an already existing function under an existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You c... | java | public FunctionInner createOrReplace(String resourceGroupName, String jobName, String functionName, FunctionInner function) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, functionName, function).toBlocking().single().body();
} | [
"public",
"FunctionInner",
"createOrReplace",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"functionName",
",",
"FunctionInner",
"function",
")",
"{",
"return",
"createOrReplaceWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobN... | Creates a function or replaces an already existing function under an existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param functionName... | [
"Creates",
"a",
"function",
"or",
"replaces",
"an",
"already",
"existing",
"function",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/FunctionsInner.java#L121-L123 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/StreamPlan.java | StreamPlan.transferRanges | public StreamPlan transferRanges(InetAddress to, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies) {
"""
Add transfer task to send data of specific {@code columnFamilies} under {@code keyspace} and {@code ranges}.
@param to endpoint address of receiver
@param c... | java | public StreamPlan transferRanges(InetAddress to, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies)
{
StreamSession session = coordinator.getOrCreateNextSession(to, connecting);
session.addTransferRanges(keyspace, ranges, Arrays.asList(columnFamilies)... | [
"public",
"StreamPlan",
"transferRanges",
"(",
"InetAddress",
"to",
",",
"InetAddress",
"connecting",
",",
"String",
"keyspace",
",",
"Collection",
"<",
"Range",
"<",
"Token",
">",
">",
"ranges",
",",
"String",
"...",
"columnFamilies",
")",
"{",
"StreamSession",... | Add transfer task to send data of specific {@code columnFamilies} under {@code keyspace} and {@code ranges}.
@param to endpoint address of receiver
@param connecting Actual connecting address of the endpoint
@param keyspace name of keyspace
@param ranges ranges to send
@param columnFamilies specific column families
@r... | [
"Add",
"transfer",
"task",
"to",
"send",
"data",
"of",
"specific",
"{",
"@code",
"columnFamilies",
"}",
"under",
"{",
"@code",
"keyspace",
"}",
"and",
"{",
"@code",
"ranges",
"}",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamPlan.java#L127-L132 |
line/armeria | logback/src/main/java/com/linecorp/armeria/common/logback/RequestContextExportingAppender.java | RequestContextExportingAppender.addAttribute | public void addAttribute(String alias, AttributeKey<?> attrKey, Function<?, String> stringifier) {
"""
Adds the specified {@link AttributeKey} to the export list.
@param alias the alias of the attribute to export
@param attrKey the key of the attribute to export
@param stringifier the {@link Function} that co... | java | public void addAttribute(String alias, AttributeKey<?> attrKey, Function<?, String> stringifier) {
ensureNotStarted();
builder.addAttribute(alias, attrKey, stringifier);
} | [
"public",
"void",
"addAttribute",
"(",
"String",
"alias",
",",
"AttributeKey",
"<",
"?",
">",
"attrKey",
",",
"Function",
"<",
"?",
",",
"String",
">",
"stringifier",
")",
"{",
"ensureNotStarted",
"(",
")",
";",
"builder",
".",
"addAttribute",
"(",
"alias"... | Adds the specified {@link AttributeKey} to the export list.
@param alias the alias of the attribute to export
@param attrKey the key of the attribute to export
@param stringifier the {@link Function} that converts the attribute value into a {@link String} | [
"Adds",
"the",
"specified",
"{",
"@link",
"AttributeKey",
"}",
"to",
"the",
"export",
"list",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/logback/src/main/java/com/linecorp/armeria/common/logback/RequestContextExportingAppender.java#L115-L118 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.findNamedQuery | public static NamedQuery findNamedQuery(Class<?> type, String name) {
"""
get a named query from an entity
@param type
@param name
@return
"""
NamedQuery annotatedNamedQuery = (NamedQuery) type.getAnnotation(NamedQuery.class);
if (annotatedNamedQuery != null) {
return annota... | java | public static NamedQuery findNamedQuery(Class<?> type, String name)
{
NamedQuery annotatedNamedQuery = (NamedQuery) type.getAnnotation(NamedQuery.class);
if (annotatedNamedQuery != null) {
return annotatedNamedQuery;
}
NamedQueries annotatedNamedQueries = (NamedQu... | [
"public",
"static",
"NamedQuery",
"findNamedQuery",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"{",
"NamedQuery",
"annotatedNamedQuery",
"=",
"(",
"NamedQuery",
")",
"type",
".",
"getAnnotation",
"(",
"NamedQuery",
".",
"class",
")",
";... | get a named query from an entity
@param type
@param name
@return | [
"get",
"a",
"named",
"query",
"from",
"an",
"entity"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L228-L249 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java | SearchResourcesImpl.searchSheet | public SearchResult searchSheet(long sheetId, String query) throws SmartsheetException {
"""
Performs a search within a sheet.
It mirrors to the following Smartsheet REST API method: GET /search/sheet/{sheetId}
Exceptions:
IllegalArgumentException : if query is null/empty string
InvalidRequestException : i... | java | public SearchResult searchSheet(long sheetId, String query) throws SmartsheetException {
Util.throwIfNull(query);
Util.throwIfEmpty(query);
try {
return this.getResource("search/sheets/" + sheetId + "?query=" + URLEncoder.encode(query,
"utf-8"), SearchResult.class... | [
"public",
"SearchResult",
"searchSheet",
"(",
"long",
"sheetId",
",",
"String",
"query",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"query",
")",
";",
"Util",
".",
"throwIfEmpty",
"(",
"query",
")",
";",
"try",
"{",
"return",... | Performs a search within a sheet.
It mirrors to the following Smartsheet REST API method: GET /search/sheet/{sheetId}
Exceptions:
IllegalArgumentException : if query is null/empty string
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with t... | [
"Performs",
"a",
"search",
"within",
"a",
"sheet",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java#L146-L155 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addCustomFields | private void addCustomFields(MpxjTreeNode parentNode, ProjectFile file) {
"""
Add custom fields to the tree.
@param parentNode parent tree node
@param file custom fields container
"""
for (CustomField field : file.getCustomFields())
{
final CustomField c = field;
MpxjTreeNode ... | java | private void addCustomFields(MpxjTreeNode parentNode, ProjectFile file)
{
for (CustomField field : file.getCustomFields())
{
final CustomField c = field;
MpxjTreeNode childNode = new MpxjTreeNode(field)
{
@Override public String toString()
{
... | [
"private",
"void",
"addCustomFields",
"(",
"MpxjTreeNode",
"parentNode",
",",
"ProjectFile",
"file",
")",
"{",
"for",
"(",
"CustomField",
"field",
":",
"file",
".",
"getCustomFields",
"(",
")",
")",
"{",
"final",
"CustomField",
"c",
"=",
"field",
";",
"MpxjT... | Add custom fields to the tree.
@param parentNode parent tree node
@param file custom fields container | [
"Add",
"custom",
"fields",
"to",
"the",
"tree",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L374-L390 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getIncomingEdgeWithType | public Edge getIncomingEdgeWithType(BasicBlock basicBlock, @Type int edgeType) {
"""
Get the first incoming edge in basic block with given type.
@param basicBlock
the basic block
@param edgeType
the edge type
@return the Edge, or null if there is no edge with that edge type
"""
return getEdgeWit... | java | public Edge getIncomingEdgeWithType(BasicBlock basicBlock, @Type int edgeType) {
return getEdgeWithType(incomingEdgeIterator(basicBlock), edgeType);
} | [
"public",
"Edge",
"getIncomingEdgeWithType",
"(",
"BasicBlock",
"basicBlock",
",",
"@",
"Type",
"int",
"edgeType",
")",
"{",
"return",
"getEdgeWithType",
"(",
"incomingEdgeIterator",
"(",
"basicBlock",
")",
",",
"edgeType",
")",
";",
"}"
] | Get the first incoming edge in basic block with given type.
@param basicBlock
the basic block
@param edgeType
the edge type
@return the Edge, or null if there is no edge with that edge type | [
"Get",
"the",
"first",
"incoming",
"edge",
"in",
"basic",
"block",
"with",
"given",
"type",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L491-L493 |
chanjarster/weixin-java-tools | weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java | WxCryptUtil.generateXml | private String generateXml(String encrypt, String signature, String timestamp, String nonce) {
"""
生成xml消息
@param encrypt 加密后的消息密文
@param signature 安全签名
@param timestamp 时间戳
@param nonce 随机字符串
@return 生成的xml字符串
"""
String format =
"<xml>\n"
+ "<Encrypt><![CDATA[%1$s]]></... | java | private String generateXml(String encrypt, String signature, String timestamp, String nonce) {
String format =
"<xml>\n"
+ "<Encrypt><![CDATA[%1$s]]></Encrypt>\n"
+ "<MsgSignature><![CDATA[%2$s]]></MsgSignature>\n"
+ "<TimeStamp>%3$s</TimeStamp>\n"
+ "<N... | [
"private",
"String",
"generateXml",
"(",
"String",
"encrypt",
",",
"String",
"signature",
",",
"String",
"timestamp",
",",
"String",
"nonce",
")",
"{",
"String",
"format",
"=",
"\"<xml>\\n\"",
"+",
"\"<Encrypt><![CDATA[%1$s]]></Encrypt>\\n\"",
"+",
"\"<MsgSignature><!... | 生成xml消息
@param encrypt 加密后的消息密文
@param signature 安全签名
@param timestamp 时间戳
@param nonce 随机字符串
@return 生成的xml字符串 | [
"生成xml消息"
] | train | https://github.com/chanjarster/weixin-java-tools/blob/2a0b1c30c0f60c2de466cb8933c945bc0d391edf/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java#L309-L318 |
dropwizard/dropwizard | dropwizard-client/src/main/java/io/dropwizard/client/JerseyClientBuilder.java | JerseyClientBuilder.buildRx | public <RX extends RxInvokerProvider<?>> Client buildRx(String name, Class<RX> invokerType) {
"""
Builds the {@link Client} instance with a custom reactive client provider.
@return a fully-configured {@link Client}
"""
return build(name).register(invokerType);
} | java | public <RX extends RxInvokerProvider<?>> Client buildRx(String name, Class<RX> invokerType) {
return build(name).register(invokerType);
} | [
"public",
"<",
"RX",
"extends",
"RxInvokerProvider",
"<",
"?",
">",
">",
"Client",
"buildRx",
"(",
"String",
"name",
",",
"Class",
"<",
"RX",
">",
"invokerType",
")",
"{",
"return",
"build",
"(",
"name",
")",
".",
"register",
"(",
"invokerType",
")",
"... | Builds the {@link Client} instance with a custom reactive client provider.
@return a fully-configured {@link Client} | [
"Builds",
"the",
"{",
"@link",
"Client",
"}",
"instance",
"with",
"a",
"custom",
"reactive",
"client",
"provider",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-client/src/main/java/io/dropwizard/client/JerseyClientBuilder.java#L324-L326 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java | AiMaterial.getProperty | public Property getProperty(String key, int semantic, int index) {
"""
Returns a single property based on its key.
@param key the key
@param semantic the semantic type (texture type)
@param index the index
@return the property or null if the property is not set
"""
for (Property property : m_prop... | java | public Property getProperty(String key, int semantic, int index) {
for (Property property : m_properties) {
if (property.getKey().equals(key) &&
property.m_semantic == semantic &&
property.m_index == index) {
return property;... | [
"public",
"Property",
"getProperty",
"(",
"String",
"key",
",",
"int",
"semantic",
",",
"int",
"index",
")",
"{",
"for",
"(",
"Property",
"property",
":",
"m_properties",
")",
"{",
"if",
"(",
"property",
".",
"getKey",
"(",
")",
".",
"equals",
"(",
"ke... | Returns a single property based on its key.
@param key the key
@param semantic the semantic type (texture type)
@param index the index
@return the property or null if the property is not set | [
"Returns",
"a",
"single",
"property",
"based",
"on",
"its",
"key",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1194-L1205 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java | ProtobufProxy.dynamicCodeGenerate | public static void dynamicCodeGenerate(OutputStream os, Class cls, Charset charset) throws IOException {
"""
To generate a protobuf proxy java source code for target class.
@param os to generate java source code
@param cls target class
@param charset charset type
@throws IOException in case of any io relativ... | java | public static void dynamicCodeGenerate(OutputStream os, Class cls, Charset charset) throws IOException {
dynamicCodeGenerate(os, cls, charset, getCodeGenerator(cls));
} | [
"public",
"static",
"void",
"dynamicCodeGenerate",
"(",
"OutputStream",
"os",
",",
"Class",
"cls",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"dynamicCodeGenerate",
"(",
"os",
",",
"cls",
",",
"charset",
",",
"getCodeGenerator",
"(",
"cls",
... | To generate a protobuf proxy java source code for target class.
@param os to generate java source code
@param cls target class
@param charset charset type
@throws IOException in case of any io relative exception. | [
"To",
"generate",
"a",
"protobuf",
"proxy",
"java",
"source",
"code",
"for",
"target",
"class",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufProxy.java#L131-L133 |
hawkular/hawkular-agent | hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/config/ConfigManager.java | ConfigManager.overlayConfiguration | public void overlayConfiguration(InputStream configStream, boolean save, boolean createBackup) throws Exception {
"""
Overlays the current configuration with the configuration found in the given input stream and writes the
new config to the {@link #getConfigFile() file}, overwriting the previous content of the fi... | java | public void overlayConfiguration(InputStream configStream, boolean save, boolean createBackup) throws Exception {
if (configStream == null) {
throw new IllegalArgumentException("config must not be null");
}
Lock lock = this.configurationLock.writeLock();
lock.lock();
... | [
"public",
"void",
"overlayConfiguration",
"(",
"InputStream",
"configStream",
",",
"boolean",
"save",
",",
"boolean",
"createBackup",
")",
"throws",
"Exception",
"{",
"if",
"(",
"configStream",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Overlays the current configuration with the configuration found in the given input stream and writes the
new config to the {@link #getConfigFile() file}, overwriting the previous content of the file.
This overlays a config on top of the old config - it isn't a blanket overwrite.
Only inventory metadata related configu... | [
"Overlays",
"the",
"current",
"configuration",
"with",
"the",
"configuration",
"found",
"in",
"the",
"given",
"input",
"stream",
"and",
"writes",
"the",
"new",
"config",
"to",
"the",
"{",
"@link",
"#getConfigFile",
"()",
"file",
"}",
"overwriting",
"the",
"pre... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/config/ConfigManager.java#L150-L178 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jEntityQueries.java | BaseNeo4jEntityQueries.getFindAssociationTargetEmbeddedValues | protected String getFindAssociationTargetEmbeddedValues(String relationshipType, AssociationKeyMetadata associationKeyMetadata) {
"""
/*
Example:
MATCH (owner:ENTITY:Car {`carId.maker`: {0}, `carId.model`: {1}}) <-[r:tires]- (target)
OPTIONAL MATCH (target) -[x*1..]->(e:EMBEDDED)
RETURN id(target), extract(n... | java | protected String getFindAssociationTargetEmbeddedValues(String relationshipType, AssociationKeyMetadata associationKeyMetadata) {
StringBuilder queryBuilder = findAssociationPartialQuery( relationshipType, associationKeyMetadata );
queryBuilder.append( "OPTIONAL MATCH (target) -[x*1..]->(e:EMBEDDED) " );
// Shoul... | [
"protected",
"String",
"getFindAssociationTargetEmbeddedValues",
"(",
"String",
"relationshipType",
",",
"AssociationKeyMetadata",
"associationKeyMetadata",
")",
"{",
"StringBuilder",
"queryBuilder",
"=",
"findAssociationPartialQuery",
"(",
"relationshipType",
",",
"associationKe... | /*
Example:
MATCH (owner:ENTITY:Car {`carId.maker`: {0}, `carId.model`: {1}}) <-[r:tires]- (target)
OPTIONAL MATCH (target) -[x*1..]->(e:EMBEDDED)
RETURN id(target), extract(n IN x| type(n)), x, e ORDER BY id(target)
or for embedded associations:
MATCH (owner:ENTITY:StoryGame {id: {0}}) -[:evilBranch]-> (:EMBEDDED) ... | [
"/",
"*",
"Example",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jEntityQueries.java#L359-L365 |
landawn/AbacusUtil | src/com/landawn/abacus/util/HBaseColumn.java | HBaseColumn.asSortedSet | public static <T> SortedSet<HBaseColumn<T>> asSortedSet(T value, long version) {
"""
Returns a sorted set descended by version
@param value
@param version
@return
"""
return asSortedSet(value, version, DESC_HBASE_COLUMN_COMPARATOR);
} | java | public static <T> SortedSet<HBaseColumn<T>> asSortedSet(T value, long version) {
return asSortedSet(value, version, DESC_HBASE_COLUMN_COMPARATOR);
} | [
"public",
"static",
"<",
"T",
">",
"SortedSet",
"<",
"HBaseColumn",
"<",
"T",
">",
">",
"asSortedSet",
"(",
"T",
"value",
",",
"long",
"version",
")",
"{",
"return",
"asSortedSet",
"(",
"value",
",",
"version",
",",
"DESC_HBASE_COLUMN_COMPARATOR",
")",
";"... | Returns a sorted set descended by version
@param value
@param version
@return | [
"Returns",
"a",
"sorted",
"set",
"descended",
"by",
"version"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/HBaseColumn.java#L143-L145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.