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 |
|---|---|---|---|---|---|---|---|---|---|---|
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java | IdRange.parseRangeSequence | public static List<IdRange> parseRangeSequence(String idRangeSequence) {
"""
Parses a uid sequence, a comma separated list of uid ranges.
<p/>
Example: 1 2:5 8:*
@param idRangeSequence the sequence
@return a list of ranges, never null.
"""
StringTokenizer tokenizer = new StringTokenizer(idRangeS... | java | public static List<IdRange> parseRangeSequence(String idRangeSequence) {
StringTokenizer tokenizer = new StringTokenizer(idRangeSequence, " ");
List<IdRange> ranges = new ArrayList<>();
while (tokenizer.hasMoreTokens()) {
ranges.add(parseRange(tokenizer.nextToken()));
}
... | [
"public",
"static",
"List",
"<",
"IdRange",
">",
"parseRangeSequence",
"(",
"String",
"idRangeSequence",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"idRangeSequence",
",",
"\" \"",
")",
";",
"List",
"<",
"IdRange",
">",
"ranges... | Parses a uid sequence, a comma separated list of uid ranges.
<p/>
Example: 1 2:5 8:*
@param idRangeSequence the sequence
@return a list of ranges, never null. | [
"Parses",
"a",
"uid",
"sequence",
"a",
"comma",
"separated",
"list",
"of",
"uid",
"ranges",
".",
"<p",
"/",
">",
"Example",
":",
"1",
"2",
":",
"5",
"8",
":",
"*"
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/commands/IdRange.java#L52-L59 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.distancePointLine | public static float distancePointLine(float pointX, float pointY, float x0, float y0, float x1, float y1) {
"""
Determine the signed distance of the given point <code>(pointX, pointY)</code> to the line defined by the two points <code>(x0, y0)</code> and <code>(x1, y1)</code>.
<p>
Reference: <a href="http://math... | java | public static float distancePointLine(float pointX, float pointY, float x0, float y0, float x1, float y1) {
float dx = x1 - x0;
float dy = y1 - y0;
float denom = (float) Math.sqrt(dx * dx + dy * dy);
return (dx * (y0 - pointY) - (x0 - pointX) * dy) / denom;
} | [
"public",
"static",
"float",
"distancePointLine",
"(",
"float",
"pointX",
",",
"float",
"pointY",
",",
"float",
"x0",
",",
"float",
"y0",
",",
"float",
"x1",
",",
"float",
"y1",
")",
"{",
"float",
"dx",
"=",
"x1",
"-",
"x0",
";",
"float",
"dy",
"=",
... | Determine the signed distance of the given point <code>(pointX, pointY)</code> to the line defined by the two points <code>(x0, y0)</code> and <code>(x1, y1)</code>.
<p>
Reference: <a href="http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html">http://mathworld.wolfram.com</a>
@param pointX
the x coordinat... | [
"Determine",
"the",
"signed",
"distance",
"of",
"the",
"given",
"point",
"<code",
">",
"(",
"pointX",
"pointY",
")",
"<",
"/",
"code",
">",
"to",
"the",
"line",
"defined",
"by",
"the",
"two",
"points",
"<code",
">",
"(",
"x0",
"y0",
")",
"<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3850-L3855 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/SequenceEntryUtils.java | SequenceEntryUtils.deleteDuplicatedQualfiier | public static boolean deleteDuplicatedQualfiier(Feature feature, String qualifierName) {
"""
Delete duplicated qualfiier.
@param feature
the feature
@param qualifierName
the qualifier name
"""
ArrayList<Qualifier> qualifiers = (ArrayList<Qualifier>) feature.getQualifiers(qualifierName);
Set<String> q... | java | public static boolean deleteDuplicatedQualfiier(Feature feature, String qualifierName)
{
ArrayList<Qualifier> qualifiers = (ArrayList<Qualifier>) feature.getQualifiers(qualifierName);
Set<String> qualifierValueSet = new HashSet<String>();
for (Qualifier qual : qualifiers)
{
if (qual.getValue() != null)
... | [
"public",
"static",
"boolean",
"deleteDuplicatedQualfiier",
"(",
"Feature",
"feature",
",",
"String",
"qualifierName",
")",
"{",
"ArrayList",
"<",
"Qualifier",
">",
"qualifiers",
"=",
"(",
"ArrayList",
"<",
"Qualifier",
">",
")",
"feature",
".",
"getQualifiers",
... | Delete duplicated qualfiier.
@param feature
the feature
@param qualifierName
the qualifier name | [
"Delete",
"duplicated",
"qualfiier",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/SequenceEntryUtils.java#L637-L656 |
alb-i986/selenium-tinafw | src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java | PageHelper.waitUntil | public static <T> T waitUntil(ExpectedCondition<T> expectedCondition, WebDriver driver) {
"""
Generic explicit wait, taking an {@link ExpectedCondition} as a parameter.
Times out after {@link #DEFAULT_EXPLICIT_WAIT_TIMEOUT_SECONDS} seconds.
@param expectedCondition
@param driver
@return whatever WebDriverWai... | java | public static <T> T waitUntil(ExpectedCondition<T> expectedCondition, WebDriver driver) {
return waitUntil(expectedCondition, driver, DEFAULT_EXPLICIT_WAIT_TIMEOUT_SECONDS);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"waitUntil",
"(",
"ExpectedCondition",
"<",
"T",
">",
"expectedCondition",
",",
"WebDriver",
"driver",
")",
"{",
"return",
"waitUntil",
"(",
"expectedCondition",
",",
"driver",
",",
"DEFAULT_EXPLICIT_WAIT_TIMEOUT_SECONDS",
"... | Generic explicit wait, taking an {@link ExpectedCondition} as a parameter.
Times out after {@link #DEFAULT_EXPLICIT_WAIT_TIMEOUT_SECONDS} seconds.
@param expectedCondition
@param driver
@return whatever WebDriverWait#until returns
@see #waitUntil(ExpectedCondition, WebDriver, long) | [
"Generic",
"explicit",
"wait",
"taking",
"an",
"{",
"@link",
"ExpectedCondition",
"}",
"as",
"a",
"parameter",
".",
"Times",
"out",
"after",
"{",
"@link",
"#DEFAULT_EXPLICIT_WAIT_TIMEOUT_SECONDS",
"}",
"seconds",
"."
] | train | https://github.com/alb-i986/selenium-tinafw/blob/91c66720cda9f69751f96c58c0a0624b2222186e/src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java#L41-L43 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java | XPathParser.parsePathExpr | private void parsePathExpr() throws TTXPathException {
"""
Parses the the rule PathExpr according to the following production rule:
<p>
[25] PathExpr ::= ("/" RelativePathExpr?) | ("//" RelativePathExpr) | RelativePathExpr .
</p>
@throws TTXPathException
"""
if (is(TokenType.SLASH, true)) {
... | java | private void parsePathExpr() throws TTXPathException {
if (is(TokenType.SLASH, true)) {
// path expression starts from the root
mPipeBuilder.addStep(new DocumentNodeAxis(getTransaction()));
final TokenType type = mToken.getType();
if (type != TokenType.END && ty... | [
"private",
"void",
"parsePathExpr",
"(",
")",
"throws",
"TTXPathException",
"{",
"if",
"(",
"is",
"(",
"TokenType",
".",
"SLASH",
",",
"true",
")",
")",
"{",
"// path expression starts from the root",
"mPipeBuilder",
".",
"addStep",
"(",
"new",
"DocumentNodeAxis",... | Parses the the rule PathExpr according to the following production rule:
<p>
[25] PathExpr ::= ("/" RelativePathExpr?) | ("//" RelativePathExpr) | RelativePathExpr .
</p>
@throws TTXPathException | [
"Parses",
"the",
"the",
"rule",
"PathExpr",
"according",
"to",
"the",
"following",
"production",
"rule",
":",
"<p",
">",
"[",
"25",
"]",
"PathExpr",
"::",
"=",
"(",
"/",
"RelativePathExpr?",
")",
"|",
"(",
"//",
"RelativePathExpr",
")",
"|",
"RelativePathE... | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L683-L711 |
wkgcass/Style | src/main/java/net/cassite/style/reflect/Reflect.java | Reflect.readOnly | public static <R> R readOnly(R toReadOnly) {
"""
Make an object which has interfaces to a read-only one.<br>
When an invocation comes, the InvocatinHandler will check the method.
<p>
<pre>
if methodName.contains elements in $.readOnlyToSearch
Check whether the method has ReadOnly annotation
if has
do invoki... | java | public static <R> R readOnly(R toReadOnly) {
return proxy((p, m, args) -> If((Method) $($.readOnlyToSearch).forEach(s -> {
if (m.getName().contains(s))
return BreakWithResult(m);
else
return n... | [
"public",
"static",
"<",
"R",
">",
"R",
"readOnly",
"(",
"R",
"toReadOnly",
")",
"{",
"return",
"proxy",
"(",
"(",
"p",
",",
"m",
",",
"args",
")",
"->",
"If",
"(",
"(",
"Method",
")",
"$",
"(",
"$",
".",
"readOnlyToSearch",
")",
".",
"forEach",
... | Make an object which has interfaces to a read-only one.<br>
When an invocation comes, the InvocatinHandler will check the method.
<p>
<pre>
if methodName.contains elements in $.readOnlyToSearch
Check whether the method has ReadOnly annotation
if has
do invoking
else
throw an exception(ModifyReadOnlyException)
else
Chec... | [
"Make",
"an",
"object",
"which",
"has",
"interfaces",
"to",
"a",
"read",
"-",
"only",
"one",
".",
"<br",
">",
"When",
"an",
"invocation",
"comes",
"the",
"InvocatinHandler",
"will",
"check",
"the",
"method",
".",
"<p",
">",
"<pre",
">",
"if",
"methodName... | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/reflect/Reflect.java#L138-L155 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Member.java | Member.getTotalDetailEstimate | public Double getTotalDetailEstimate(WorkitemFilter filter) {
"""
Return the total detail estimate for all workitems owned by this member
optionally filtered.
@param filter Criteria to filter workitems on.
@return total detail estimate of selected Workitems.
"""
filter = (filter != null) ? filter ... | java | public Double getTotalDetailEstimate(WorkitemFilter filter) {
filter = (filter != null) ? filter : new WorkitemFilter();
return getSum("OwnedWorkitems", filter, "DetailEstimate");
} | [
"public",
"Double",
"getTotalDetailEstimate",
"(",
"WorkitemFilter",
"filter",
")",
"{",
"filter",
"=",
"(",
"filter",
"!=",
"null",
")",
"?",
"filter",
":",
"new",
"WorkitemFilter",
"(",
")",
";",
"return",
"getSum",
"(",
"\"OwnedWorkitems\"",
",",
"filter",
... | Return the total detail estimate for all workitems owned by this member
optionally filtered.
@param filter Criteria to filter workitems on.
@return total detail estimate of selected Workitems. | [
"Return",
"the",
"total",
"detail",
"estimate",
"for",
"all",
"workitems",
"owned",
"by",
"this",
"member",
"optionally",
"filtered",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Member.java#L296-L300 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.appendSARLElementType | protected void appendSARLElementType(XtendTypeDeclaration source, JvmDeclaredType target) {
"""
Append the SARL element type as an annotation to the given container.
<p>The added annotation may be used by any underground platform for determining what is
the type of the SARL element without invoking the costly ... | java | protected void appendSARLElementType(XtendTypeDeclaration source, JvmDeclaredType target) {
addAnnotationSafe(target, SarlElementType.class, source.eClass().getClassifierID());
} | [
"protected",
"void",
"appendSARLElementType",
"(",
"XtendTypeDeclaration",
"source",
",",
"JvmDeclaredType",
"target",
")",
"{",
"addAnnotationSafe",
"(",
"target",
",",
"SarlElementType",
".",
"class",
",",
"source",
".",
"eClass",
"(",
")",
".",
"getClassifierID",... | Append the SARL element type as an annotation to the given container.
<p>The added annotation may be used by any underground platform for determining what is
the type of the SARL element without invoking the costly "instanceof" operations.
@param source the source object.
@param target the inferred JVM object. | [
"Append",
"the",
"SARL",
"element",
"type",
"as",
"an",
"annotation",
"to",
"the",
"given",
"container",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L2905-L2907 |
btaz/data-util | src/main/java/com/btaz/util/files/FileDeleter.java | FileDeleter.deleteFilesByExtension | public static void deleteFilesByExtension(File dir, String extension) {
"""
Delete files in a directory matching a file extension
@param dir directory
@param extension filename extension
"""
if(extension == null) {
throw new DataUtilException("Filename extension can not be a null value");... | java | public static void deleteFilesByExtension(File dir, String extension) {
if(extension == null) {
throw new DataUtilException("Filename extension can not be a null value");
}
FilenameFilter filter = new FileExtensionFilenameFilter(extension);
FileDeleter.deleteFiles(dir, filter... | [
"public",
"static",
"void",
"deleteFilesByExtension",
"(",
"File",
"dir",
",",
"String",
"extension",
")",
"{",
"if",
"(",
"extension",
"==",
"null",
")",
"{",
"throw",
"new",
"DataUtilException",
"(",
"\"Filename extension can not be a null value\"",
")",
";",
"}... | Delete files in a directory matching a file extension
@param dir directory
@param extension filename extension | [
"Delete",
"files",
"in",
"a",
"directory",
"matching",
"a",
"file",
"extension"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileDeleter.java#L17-L23 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/CoreJBossASClient.java | CoreJBossASClient.addSubsystem | public void addSubsystem(String name, ModelNode settings) throws Exception {
"""
Adds a new subsystem (along with some optional settings for that subsystem) to the core system
If settings is null, the subsystem will be created with no additional settings associated with it.
@param name the name of the new subs... | java | public void addSubsystem(String name, ModelNode settings) throws Exception {
// /subsystem=<name>:add()
final ModelNode request = createRequest(ADD, Address.root().add(SUBSYSTEM, name), settings);
final ModelNode response = execute(request);
if (!isSuccess(response)) {
throw ... | [
"public",
"void",
"addSubsystem",
"(",
"String",
"name",
",",
"ModelNode",
"settings",
")",
"throws",
"Exception",
"{",
"// /subsystem=<name>:add()",
"final",
"ModelNode",
"request",
"=",
"createRequest",
"(",
"ADD",
",",
"Address",
".",
"root",
"(",
")",
".",
... | Adds a new subsystem (along with some optional settings for that subsystem) to the core system
If settings is null, the subsystem will be created with no additional settings associated with it.
@param name the name of the new subsystem
@param settings a node with some additional settings used to initialize the subsyst... | [
"Adds",
"a",
"new",
"subsystem",
"(",
"along",
"with",
"some",
"optional",
"settings",
"for",
"that",
"subsystem",
")",
"to",
"the",
"core",
"system",
"If",
"settings",
"is",
"null",
"the",
"subsystem",
"will",
"be",
"created",
"with",
"no",
"additional",
... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/CoreJBossASClient.java#L331-L339 |
alkacon/opencms-core | src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java | CmsSiteManager.openDeleteDialog | public void openDeleteDialog(Set<String> data) {
"""
Opens the delete dialog for the given sites.<p>
@param data the site roots
"""
CmsDeleteSiteDialog form = new CmsDeleteSiteDialog(this, data);
openDialog(form, CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_0));
} | java | public void openDeleteDialog(Set<String> data) {
CmsDeleteSiteDialog form = new CmsDeleteSiteDialog(this, data);
openDialog(form, CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_0));
} | [
"public",
"void",
"openDeleteDialog",
"(",
"Set",
"<",
"String",
">",
"data",
")",
"{",
"CmsDeleteSiteDialog",
"form",
"=",
"new",
"CmsDeleteSiteDialog",
"(",
"this",
",",
"data",
")",
";",
"openDialog",
"(",
"form",
",",
"CmsVaadinUtils",
".",
"getMessageText... | Opens the delete dialog for the given sites.<p>
@param data the site roots | [
"Opens",
"the",
"delete",
"dialog",
"for",
"the",
"given",
"sites",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java#L292-L296 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java | ForkJoinPool.inactivate | private void inactivate(WorkQueue w, int ss) {
"""
If worker w exists and is active, enqueues and sets status to inactive.
@param w the worker
@param ss current (non-negative) scanState
"""
int ns = (ss + SS_SEQ) | UNSIGNALLED;
long lc = ns & SP_MASK, nc, c;
if (w != null) {
... | java | private void inactivate(WorkQueue w, int ss) {
int ns = (ss + SS_SEQ) | UNSIGNALLED;
long lc = ns & SP_MASK, nc, c;
if (w != null) {
w.scanState = ns;
do {
nc = lc | (UC_MASK & ((c = ctl) - AC_UNIT));
w.stackPred = (int)c;
} whi... | [
"private",
"void",
"inactivate",
"(",
"WorkQueue",
"w",
",",
"int",
"ss",
")",
"{",
"int",
"ns",
"=",
"(",
"ss",
"+",
"SS_SEQ",
")",
"|",
"UNSIGNALLED",
";",
"long",
"lc",
"=",
"ns",
"&",
"SP_MASK",
",",
"nc",
",",
"c",
";",
"if",
"(",
"w",
"!=... | If worker w exists and is active, enqueues and sets status to inactive.
@param w the worker
@param ss current (non-negative) scanState | [
"If",
"worker",
"w",
"exists",
"and",
"is",
"active",
"enqueues",
"and",
"sets",
"status",
"to",
"inactive",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java#L1775-L1785 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendBinaryBlocking | public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
"""
Sends a complete binary message using blocking IO
@param data The data to send
@param wsChannel The web socket channel
"""
sendBlockingInternal(data, WebSocketFrameType.BINARY, ws... | java | public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
sendBlockingInternal(data, WebSocketFrameType.BINARY, wsChannel);
} | [
"public",
"static",
"void",
"sendBinaryBlocking",
"(",
"final",
"ByteBuffer",
"data",
",",
"final",
"WebSocketChannel",
"wsChannel",
")",
"throws",
"IOException",
"{",
"sendBlockingInternal",
"(",
"data",
",",
"WebSocketFrameType",
".",
"BINARY",
",",
"wsChannel",
"... | Sends a complete binary message using blocking IO
@param data The data to send
@param wsChannel The web socket channel | [
"Sends",
"a",
"complete",
"binary",
"message",
"using",
"blocking",
"IO"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L736-L738 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/IndexTable.java | IndexTable.apply | public void apply(double[] target) {
"""
Applies this index table to the specified target, putting {@code target}
into the same ordering as this IndexTable.
@param target the array to re-order into the sorted order defined by this index table
@throws RuntimeException if the length of the target array is not t... | java | public void apply(double[] target)
{
//use DoubleList view b/d we are only using set ops, so we wont run into an issue of re-allocating the array
apply(DoubleList.view(target, target.length), new DoubleList(target.length));
} | [
"public",
"void",
"apply",
"(",
"double",
"[",
"]",
"target",
")",
"{",
"//use DoubleList view b/d we are only using set ops, so we wont run into an issue of re-allocating the array",
"apply",
"(",
"DoubleList",
".",
"view",
"(",
"target",
",",
"target",
".",
"length",
")... | Applies this index table to the specified target, putting {@code target}
into the same ordering as this IndexTable.
@param target the array to re-order into the sorted order defined by this index table
@throws RuntimeException if the length of the target array is not the same as the index table | [
"Applies",
"this",
"index",
"table",
"to",
"the",
"specified",
"target",
"putting",
"{",
"@code",
"target",
"}",
"into",
"the",
"same",
"ordering",
"as",
"this",
"IndexTable",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IndexTable.java#L268-L272 |
sahan/RoboZombie | robozombie/src/main/java/com/lonepulse/robozombie/executor/AsyncExecutionHandler.java | AsyncExecutionHandler.onError | @Override
public void onError(InvocationContext context, Exception error) {
"""
<p>If an {@link AsyncHandler} is defined, any exception which resulted in an error will be
available via the <i>onError</i> callback.</p>
<p>See {@link ExecutionHandler#onError(InvocationContext, Exception)}</p>
@param context
... | java | @Override
public void onError(InvocationContext context, Exception error) {
AsyncHandler<Object> asyncHandler = getAsyncHandler(context);
if(asyncHandler != null) {
try {
asyncHandler.onError(error instanceof InvocationException?
(InvocationException)error :InvocationException.newInstan... | [
"@",
"Override",
"public",
"void",
"onError",
"(",
"InvocationContext",
"context",
",",
"Exception",
"error",
")",
"{",
"AsyncHandler",
"<",
"Object",
">",
"asyncHandler",
"=",
"getAsyncHandler",
"(",
"context",
")",
";",
"if",
"(",
"asyncHandler",
"!=",
"null... | <p>If an {@link AsyncHandler} is defined, any exception which resulted in an error will be
available via the <i>onError</i> callback.</p>
<p>See {@link ExecutionHandler#onError(InvocationContext, Exception)}</p>
@param context
the {@link InvocationContext} with information on the proxy invocation
<br><br>
@param erro... | [
"<p",
">",
"If",
"an",
"{",
"@link",
"AsyncHandler",
"}",
"is",
"defined",
"any",
"exception",
"which",
"resulted",
"in",
"an",
"error",
"will",
"be",
"available",
"via",
"the",
"<i",
">",
"onError<",
"/",
"i",
">",
"callback",
".",
"<",
"/",
"p",
">... | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/executor/AsyncExecutionHandler.java#L178-L195 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.putLong | public final void putLong(Object parent, long offset, long value) {
"""
Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value long to be put
"""
THE_UNSAFE.putLong(parent, offset, value);
} | java | public final void putLong(Object parent, long offset, long value) {
THE_UNSAFE.putLong(parent, offset, value);
} | [
"public",
"final",
"void",
"putLong",
"(",
"Object",
"parent",
",",
"long",
"offset",
",",
"long",
"value",
")",
"{",
"THE_UNSAFE",
".",
"putLong",
"(",
"parent",
",",
"offset",
",",
"value",
")",
";",
"}"
] | Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value long to be put | [
"Puts",
"the",
"value",
"at",
"the",
"given",
"offset",
"of",
"the",
"supplied",
"parent",
"object"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L993-L995 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/ZipUtils.java | ZipUtils.unzip | public static void unzip(final File zip, final File patchDir) throws IOException {
"""
unpack...
@param zip the zip
@param patchDir the patch dir
@throws IOException
"""
try (final ZipFile zipFile = new ZipFile(zip)){
unzip(zipFile, patchDir);
}
} | java | public static void unzip(final File zip, final File patchDir) throws IOException {
try (final ZipFile zipFile = new ZipFile(zip)){
unzip(zipFile, patchDir);
}
} | [
"public",
"static",
"void",
"unzip",
"(",
"final",
"File",
"zip",
",",
"final",
"File",
"patchDir",
")",
"throws",
"IOException",
"{",
"try",
"(",
"final",
"ZipFile",
"zipFile",
"=",
"new",
"ZipFile",
"(",
"zip",
")",
")",
"{",
"unzip",
"(",
"zipFile",
... | unpack...
@param zip the zip
@param patchDir the patch dir
@throws IOException | [
"unpack",
"..."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/ZipUtils.java#L100-L104 |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/wrappers/matrix/PairSet.java | PairSet.retainAll | public boolean retainAll(Collection<T> trans, I item) {
"""
Retains the pairs obtained from the Cartesian product of transactions and
items
@param trans
collection of transactions
@param item
the item
@return <code>true</code> if the set set has been changed
"""
if (isEmpty())
return false;
i... | java | public boolean retainAll(Collection<T> trans, I item) {
if (isEmpty())
return false;
if (trans == null || trans.isEmpty() || item == null) {
clear();
return true;
}
return matrix.retainAll(allTransactions.convert(trans).indices(), itemToIndex(item));
} | [
"public",
"boolean",
"retainAll",
"(",
"Collection",
"<",
"T",
">",
"trans",
",",
"I",
"item",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"return",
"false",
";",
"if",
"(",
"trans",
"==",
"null",
"||",
"trans",
".",
"isEmpty",
"(",
")",
"||",
... | Retains the pairs obtained from the Cartesian product of transactions and
items
@param trans
collection of transactions
@param item
the item
@return <code>true</code> if the set set has been changed | [
"Retains",
"the",
"pairs",
"obtained",
"from",
"the",
"Cartesian",
"product",
"of",
"transactions",
"and",
"items"
] | train | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/wrappers/matrix/PairSet.java#L642-L650 |
twilio/twilio-java | src/main/java/com/twilio/rest/autopilot/v1/AssistantReader.java | AssistantReader.previousPage | @Override
public Page<Assistant> previousPage(final Page<Assistant> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Pa... | java | @Override
public Page<Assistant> previousPage(final Page<Assistant> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.AUTOPILOT.toString(),
cl... | [
"@",
"Override",
"public",
"Page",
"<",
"Assistant",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"Assistant",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/autopilot/v1/AssistantReader.java#L104-L115 |
apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/SingleInputPlanNode.java | SingleInputPlanNode.setDriverKeyInfo | public void setDriverKeyInfo(FieldList keys, int id) {
"""
Sets the key field indexes for the specified driver comparator.
@param keys The key field indexes for the specified driver comparator.
@param id The ID of the driver comparator.
"""
this.setDriverKeyInfo(keys, getTrueArray(keys.size()), id);
} | java | public void setDriverKeyInfo(FieldList keys, int id) {
this.setDriverKeyInfo(keys, getTrueArray(keys.size()), id);
} | [
"public",
"void",
"setDriverKeyInfo",
"(",
"FieldList",
"keys",
",",
"int",
"id",
")",
"{",
"this",
".",
"setDriverKeyInfo",
"(",
"keys",
",",
"getTrueArray",
"(",
"keys",
".",
"size",
"(",
")",
")",
",",
"id",
")",
";",
"}"
] | Sets the key field indexes for the specified driver comparator.
@param keys The key field indexes for the specified driver comparator.
@param id The ID of the driver comparator. | [
"Sets",
"the",
"key",
"field",
"indexes",
"for",
"the",
"specified",
"driver",
"comparator",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/SingleInputPlanNode.java#L132-L134 |
zanata/openprops | src/main/java/org/fedorahosted/openprops/Properties.java | Properties.setProperty | public synchronized Object setProperty(String key, String value) {
"""
Calls the <tt>Hashtable</tt> method <code>put</code>. Provided for
parallelism with the <tt>getProperty</tt> method. Enforces use of
strings for property keys and values. The value returned is the
result of the <tt>Hashtable</tt> call to <co... | java | public synchronized Object setProperty(String key, String value) {
if (key == null || value == null)
throw new NullPointerException();
Entry entry = props.get(key);
if (entry == null) {
entry = new Entry("", value);
props.put(key, entry);
return nu... | [
"public",
"synchronized",
"Object",
"setProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"Entry",
"entry",
"=",
"pr... | Calls the <tt>Hashtable</tt> method <code>put</code>. Provided for
parallelism with the <tt>getProperty</tt> method. Enforces use of
strings for property keys and values. The value returned is the
result of the <tt>Hashtable</tt> call to <code>put</code>.
@param key the key to be placed into this property list.
@param... | [
"Calls",
"the",
"<tt",
">",
"Hashtable<",
"/",
"tt",
">",
"method",
"<code",
">",
"put<",
"/",
"code",
">",
".",
"Provided",
"for",
"parallelism",
"with",
"the",
"<tt",
">",
"getProperty<",
"/",
"tt",
">",
"method",
".",
"Enforces",
"use",
"of",
"strin... | train | https://github.com/zanata/openprops/blob/46510e610a765e4a91b302fc0d6a2123ed589603/src/main/java/org/fedorahosted/openprops/Properties.java#L154-L167 |
FrodeRanders/java-vopn | src/main/java/org/gautelis/vopn/lang/Date.java | Date.validateDateFormat | public static boolean validateDateFormat(String date, Locale locale) {
"""
Validates the users inputted date value
@param date The Date in String form
@param locale Check format according to this locale
@return true if user inputted corect format, otherwise false
"""
SimpleDateFormat df;... | java | public static boolean validateDateFormat(String date, Locale locale) {
SimpleDateFormat df;
SimpleDateFormat sdf;
java.text.ParsePosition pos;
java.util.Date dbDate;
dbDate = null;
try {
if (date == null || date.equals("")) {
return f... | [
"public",
"static",
"boolean",
"validateDateFormat",
"(",
"String",
"date",
",",
"Locale",
"locale",
")",
"{",
"SimpleDateFormat",
"df",
";",
"SimpleDateFormat",
"sdf",
";",
"java",
".",
"text",
".",
"ParsePosition",
"pos",
";",
"java",
".",
"util",
".",
"Da... | Validates the users inputted date value
@param date The Date in String form
@param locale Check format according to this locale
@return true if user inputted corect format, otherwise false | [
"Validates",
"the",
"users",
"inputted",
"date",
"value"
] | train | https://github.com/FrodeRanders/java-vopn/blob/4c7b2f90201327af4eaa3cd46b3fee68f864e5cc/src/main/java/org/gautelis/vopn/lang/Date.java#L81-L108 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileSet.java | TileSet.getTileMirage | public Mirage getTileMirage (int tileIndex, Colorization[] zations) {
"""
Returns a prepared version of the image that would be used by the tile at the specified
index. Because tilesets are often used simply to provide access to a collection of uniform
images, this method is provided to bypass the creation of a ... | java | public Mirage getTileMirage (int tileIndex, Colorization[] zations)
{
Rectangle bounds = computeTileBounds(tileIndex, new Rectangle());
Mirage mirage = null;
if (checkTileIndex(tileIndex)) {
if (_improv == null) {
log.warning("Aiya! Tile set missing image provider... | [
"public",
"Mirage",
"getTileMirage",
"(",
"int",
"tileIndex",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"Rectangle",
"bounds",
"=",
"computeTileBounds",
"(",
"tileIndex",
",",
"new",
"Rectangle",
"(",
")",
")",
";",
"Mirage",
"mirage",
"=",
"null",... | Returns a prepared version of the image that would be used by the tile at the specified
index. Because tilesets are often used simply to provide access to a collection of uniform
images, this method is provided to bypass the creation of a {@link Tile} object when all
that is desired is access to the underlying image. | [
"Returns",
"a",
"prepared",
"version",
"of",
"the",
"image",
"that",
"would",
"be",
"used",
"by",
"the",
"tile",
"at",
"the",
"specified",
"index",
".",
"Because",
"tilesets",
"are",
"often",
"used",
"simply",
"to",
"provide",
"access",
"to",
"a",
"collect... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileSet.java#L266-L281 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.clickOnByJs | protected void clickOnByJs(Page page, String xpath) throws TechnicalException, FailureException {
"""
Click on html element by Javascript.
@param page
page target application
@param xpath
XPath of an element to evaluate
@throws TechnicalException
is thrown if you have a technical error (format, configurati... | java | protected void clickOnByJs(Page page, String xpath) throws TechnicalException, FailureException {
displayMessageAtTheBeginningOfMethod("clickOnByJs: %s in %s", xpath, page.getApplication());
try {
Context.waitUntil(ExpectedConditions.elementToBeClickable(By.xpath(xpath.replaceAll("\\\\'",... | [
"protected",
"void",
"clickOnByJs",
"(",
"Page",
"page",
",",
"String",
"xpath",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"displayMessageAtTheBeginningOfMethod",
"(",
"\"clickOnByJs: %s in %s\"",
",",
"xpath",
",",
"page",
".",
"getApplication"... | Click on html element by Javascript.
@param page
page target application
@param xpath
XPath of an element to evaluate
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_OPEN_ON_... | [
"Click",
"on",
"html",
"element",
"by",
"Javascript",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L161-L169 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.newWriter | public static Writer newWriter(OutputStream stream, String charset) throws UnsupportedEncodingException {
"""
Creates a writer for this stream using the given charset.
@param stream the stream which is used and then closed
@param charset the charset used
@return the newly created Writer
@throws UnsupportedEn... | java | public static Writer newWriter(OutputStream stream, String charset) throws UnsupportedEncodingException {
return new OutputStreamWriter(stream, charset);
} | [
"public",
"static",
"Writer",
"newWriter",
"(",
"OutputStream",
"stream",
",",
"String",
"charset",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"new",
"OutputStreamWriter",
"(",
"stream",
",",
"charset",
")",
";",
"}"
] | Creates a writer for this stream using the given charset.
@param stream the stream which is used and then closed
@param charset the charset used
@return the newly created Writer
@throws UnsupportedEncodingException if an encoding exception occurs.
@since 2.2.0 | [
"Creates",
"a",
"writer",
"for",
"this",
"stream",
"using",
"the",
"given",
"charset",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1281-L1283 |
mguymon/naether | src/main/java/com/tobedevoured/naether/util/Notation.java | Notation.getLocalPaths | public static List<String> getLocalPaths( String localRepoPath, List<String> notations ) throws NaetherException {
"""
Get local paths for notations
@param localRepoPath String path
@param notations List of notations
@return List of paths
@throws NaetherException exception
"""
DefaultServiceLocat... | java | public static List<String> getLocalPaths( String localRepoPath, List<String> notations ) throws NaetherException {
DefaultServiceLocator locator = new DefaultServiceLocator();
SimpleLocalRepositoryManagerFactory factory = new SimpleLocalRepositoryManagerFactory();
factory.initService( locator );... | [
"public",
"static",
"List",
"<",
"String",
">",
"getLocalPaths",
"(",
"String",
"localRepoPath",
",",
"List",
"<",
"String",
">",
"notations",
")",
"throws",
"NaetherException",
"{",
"DefaultServiceLocator",
"locator",
"=",
"new",
"DefaultServiceLocator",
"(",
")"... | Get local paths for notations
@param localRepoPath String path
@param notations List of notations
@return List of paths
@throws NaetherException exception | [
"Get",
"local",
"paths",
"for",
"notations"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/util/Notation.java#L211-L233 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MessagesApi.java | MessagesApi.getNormalizedMessagesAsync | public com.squareup.okhttp.Call getNormalizedMessagesAsync(String uid, String sdid, String mid, String fieldPresence, String filter, String offset, Integer count, Long startDate, Long endDate, String order, final ApiCallback<NormalizedMessagesEnvelope> callback) throws ApiException {
"""
Get Normalized Messages (a... | java | public com.squareup.okhttp.Call getNormalizedMessagesAsync(String uid, String sdid, String mid, String fieldPresence, String filter, String offset, Integer count, Long startDate, Long endDate, String order, final ApiCallback<NormalizedMessagesEnvelope> callback) throws ApiException {
ProgressResponseBody.Progr... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getNormalizedMessagesAsync",
"(",
"String",
"uid",
",",
"String",
"sdid",
",",
"String",
"mid",
",",
"String",
"fieldPresence",
",",
"String",
"filter",
",",
"String",
"offset",
",",
"Integer",
"... | Get Normalized Messages (asynchronously)
Get the messages normalized
@param uid User ID. If not specified, assume that of the current authenticated user. If specified, it must be that of a user for which the current authenticated user has read access to. (optional)
@param sdid Source device ID of the messages being sea... | [
"Get",
"Normalized",
"Messages",
"(",
"asynchronously",
")",
"Get",
"the",
"messages",
"normalized"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MessagesApi.java#L1044-L1069 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertClob | public static Object convertClob(Connection conn, byte[] value) throws SQLException {
"""
Transfers data from byte[] into sql.Clob
@param conn connection for which sql.Clob object would be created
@param value array of bytes
@return sql.Clob from array of bytes
@throws SQLException
"""
Object re... | java | public static Object convertClob(Connection conn, byte[] value) throws SQLException {
Object result = (Object) createClob(conn);
result = convertClob(result, value);
return result;
} | [
"public",
"static",
"Object",
"convertClob",
"(",
"Connection",
"conn",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"SQLException",
"{",
"Object",
"result",
"=",
"(",
"Object",
")",
"createClob",
"(",
"conn",
")",
";",
"result",
"=",
"convertClob",
"(",... | Transfers data from byte[] into sql.Clob
@param conn connection for which sql.Clob object would be created
@param value array of bytes
@return sql.Clob from array of bytes
@throws SQLException | [
"Transfers",
"data",
"from",
"byte",
"[]",
"into",
"sql",
".",
"Clob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L173-L179 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.partialIsVariable | boolean partialIsVariable(MultistepExprHolder testee, int lengthToTest) {
"""
Check if results of partial reduction will just be a variable, in
which case, skip it.
"""
if(1 == lengthToTest)
{
WalkingIterator wi = (WalkingIterator)testee.m_exprOwner.getExpression();
if(wi.getFirstWalker() instan... | java | boolean partialIsVariable(MultistepExprHolder testee, int lengthToTest)
{
if(1 == lengthToTest)
{
WalkingIterator wi = (WalkingIterator)testee.m_exprOwner.getExpression();
if(wi.getFirstWalker() instanceof FilterExprWalker)
return true;
}
return false;
} | [
"boolean",
"partialIsVariable",
"(",
"MultistepExprHolder",
"testee",
",",
"int",
"lengthToTest",
")",
"{",
"if",
"(",
"1",
"==",
"lengthToTest",
")",
"{",
"WalkingIterator",
"wi",
"=",
"(",
"WalkingIterator",
")",
"testee",
".",
"m_exprOwner",
".",
"getExpressi... | Check if results of partial reduction will just be a variable, in
which case, skip it. | [
"Check",
"if",
"results",
"of",
"partial",
"reduction",
"will",
"just",
"be",
"a",
"variable",
"in",
"which",
"case",
"skip",
"it",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L268-L277 |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java | MultipartParser.readLine | private String readLine() throws IOException {
"""
Read the next line of input.
@return a String containing the next line of input from the stream,
or null to indicate the end of the stream.
@exception IOException if an input or output exception has occurred.
"""
StringBuffer sbuf = new StringBuff... | java | private String readLine() throws IOException {
StringBuffer sbuf = new StringBuffer();
int result;
String line;
do {
result = in.readLine(buf, 0, buf.length); // does +=
if (result != -1) {
sbuf.append(new String(buf, 0, result, encoding));
}
} while (result == buf.length... | [
"private",
"String",
"readLine",
"(",
")",
"throws",
"IOException",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"int",
"result",
";",
"String",
"line",
";",
"do",
"{",
"result",
"=",
"in",
".",
"readLine",
"(",
"buf",
",",
"... | Read the next line of input.
@return a String containing the next line of input from the stream,
or null to indicate the end of the stream.
@exception IOException if an input or output exception has occurred. | [
"Read",
"the",
"next",
"line",
"of",
"input",
"."
] | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java#L459-L486 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java | SchemaTypeExtensionsChecker.checkUnionTypeExtensions | private void checkUnionTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
"""
/*
Union type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be a Union type.
The member types of a Union type extension must all be ... | java | private void checkUnionTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
typeRegistry.unionTypeExtensions()
.forEach((name, extensions) -> {
checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, UnionTypeDefinition.class... | [
"private",
"void",
"checkUnionTypeExtensions",
"(",
"List",
"<",
"GraphQLError",
">",
"errors",
",",
"TypeDefinitionRegistry",
"typeRegistry",
")",
"{",
"typeRegistry",
".",
"unionTypeExtensions",
"(",
")",
".",
"forEach",
"(",
"(",
"name",
",",
"extensions",
")",... | /*
Union type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be a Union type.
The member types of a Union type extension must all be Object base types; Scalar, Interface and Union types must not be member types of a Union. Similarly, wrapping types m... | [
"/",
"*",
"Union",
"type",
"extensions",
"have",
"the",
"potential",
"to",
"be",
"invalid",
"if",
"incorrectly",
"defined",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java#L174-L197 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.applyIntPropertyValue | public UnicodeSet applyIntPropertyValue(int prop, int value) {
"""
Modifies this set to contain those code points which have the
given value for the given binary or enumerated property, as
returned by UCharacter.getIntPropertyValue. Prior contents of
this set are lost.
@param prop a property in the range
U... | java | public UnicodeSet applyIntPropertyValue(int prop, int value) {
checkFrozen();
if (prop == UProperty.GENERAL_CATEGORY_MASK) {
applyFilter(new GeneralCategoryMaskFilter(value), UCharacterProperty.SRC_CHAR);
} else if (prop == UProperty.SCRIPT_EXTENSIONS) {
applyFilter(new S... | [
"public",
"UnicodeSet",
"applyIntPropertyValue",
"(",
"int",
"prop",
",",
"int",
"value",
")",
"{",
"checkFrozen",
"(",
")",
";",
"if",
"(",
"prop",
"==",
"UProperty",
".",
"GENERAL_CATEGORY_MASK",
")",
"{",
"applyFilter",
"(",
"new",
"GeneralCategoryMaskFilter"... | Modifies this set to contain those code points which have the
given value for the given binary or enumerated property, as
returned by UCharacter.getIntPropertyValue. Prior contents of
this set are lost.
@param prop a property in the range
UProperty.BIN_START..UProperty.BIN_LIMIT-1 or
UProperty.INT_START..UProperty.IN... | [
"Modifies",
"this",
"set",
"to",
"contain",
"those",
"code",
"points",
"which",
"have",
"the",
"given",
"value",
"for",
"the",
"given",
"binary",
"or",
"enumerated",
"property",
"as",
"returned",
"by",
"UCharacter",
".",
"getIntPropertyValue",
".",
"Prior",
"c... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L3310-L3320 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/SignatureSpi.java | SignatureSpi.engineVerify | protected boolean engineVerify(byte[] sigBytes, int offset, int length)
throws SignatureException {
"""
Verifies the passed-in signature in the specified array
of bytes, starting at the specified offset.
<p> Note: Subclasses should overwrite the default implementation.
@param sigBytes the signatur... | java | protected boolean engineVerify(byte[] sigBytes, int offset, int length)
throws SignatureException {
byte[] sigBytesCopy = new byte[length];
System.arraycopy(sigBytes, offset, sigBytesCopy, 0, length);
return engineVerify(sigBytesCopy);
} | [
"protected",
"boolean",
"engineVerify",
"(",
"byte",
"[",
"]",
"sigBytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"SignatureException",
"{",
"byte",
"[",
"]",
"sigBytesCopy",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"System",
".",
... | Verifies the passed-in signature in the specified array
of bytes, starting at the specified offset.
<p> Note: Subclasses should overwrite the default implementation.
@param sigBytes the signature bytes to be verified.
@param offset the offset to start from in the array of bytes.
@param length the number of bytes to ... | [
"Verifies",
"the",
"passed",
"-",
"in",
"signature",
"in",
"the",
"specified",
"array",
"of",
"bytes",
"starting",
"at",
"the",
"specified",
"offset",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/SignatureSpi.java#L275-L280 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Cursor.java | Cursor.setGrid | public void setGrid(int width, int height) {
"""
Set the grid size.
@param width The horizontal grid (strictly positive).
@param height The vertical grid (strictly positive).
@throws LionEngineException If grid is not strictly positive.
"""
Check.superiorStrict(width, 0);
Check.superiorStr... | java | public void setGrid(int width, int height)
{
Check.superiorStrict(width, 0);
Check.superiorStrict(height, 0);
gridWidth = width;
gridHeight = height;
} | [
"public",
"void",
"setGrid",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Check",
".",
"superiorStrict",
"(",
"width",
",",
"0",
")",
";",
"Check",
".",
"superiorStrict",
"(",
"height",
",",
"0",
")",
";",
"gridWidth",
"=",
"width",
";",
"gr... | Set the grid size.
@param width The horizontal grid (strictly positive).
@param height The vertical grid (strictly positive).
@throws LionEngineException If grid is not strictly positive. | [
"Set",
"the",
"grid",
"size",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Cursor.java#L229-L235 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/messaging/JMSManager.java | JMSManager.createDestination | public Destination createDestination(String name, DestinationType type)
throws MessagingException {
"""
Creates a Destination. This is a convenience method which is the
same as calling:
<code>createDestination(name, type, false, Session.AUTO_ACKNOWLEDGE)</code>
"""
return this.createDesti... | java | public Destination createDestination(String name, DestinationType type)
throws MessagingException {
return this.createDestination(name, type, false, Session.AUTO_ACKNOWLEDGE);
} | [
"public",
"Destination",
"createDestination",
"(",
"String",
"name",
",",
"DestinationType",
"type",
")",
"throws",
"MessagingException",
"{",
"return",
"this",
".",
"createDestination",
"(",
"name",
",",
"type",
",",
"false",
",",
"Session",
".",
"AUTO_ACKNOWLEDG... | Creates a Destination. This is a convenience method which is the
same as calling:
<code>createDestination(name, type, false, Session.AUTO_ACKNOWLEDGE)</code> | [
"Creates",
"a",
"Destination",
".",
"This",
"is",
"a",
"convenience",
"method",
"which",
"is",
"the",
"same",
"as",
"calling",
":",
"<code",
">",
"createDestination",
"(",
"name",
"type",
"false",
"Session",
".",
"AUTO_ACKNOWLEDGE",
")",
"<",
"/",
"code",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/messaging/JMSManager.java#L168-L171 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/PriorityQueue.java | PriorityQueue.siftDown | private void siftDown(int k, E x) {
"""
Inserts item x at position k, maintaining heap invariant by
demoting x down the tree repeatedly until it is less than or
equal to its children or is a leaf.
@param k the position to fill
@param x the item to insert
"""
if (comparator != null)
si... | java | private void siftDown(int k, E x) {
if (comparator != null)
siftDownUsingComparator(k, x);
else
siftDownComparable(k, x);
} | [
"private",
"void",
"siftDown",
"(",
"int",
"k",
",",
"E",
"x",
")",
"{",
"if",
"(",
"comparator",
"!=",
"null",
")",
"siftDownUsingComparator",
"(",
"k",
",",
"x",
")",
";",
"else",
"siftDownComparable",
"(",
"k",
",",
"x",
")",
";",
"}"
] | Inserts item x at position k, maintaining heap invariant by
demoting x down the tree repeatedly until it is less than or
equal to its children or is a leaf.
@param k the position to fill
@param x the item to insert | [
"Inserts",
"item",
"x",
"at",
"position",
"k",
"maintaining",
"heap",
"invariant",
"by",
"demoting",
"x",
"down",
"the",
"tree",
"repeatedly",
"until",
"it",
"is",
"less",
"than",
"or",
"equal",
"to",
"its",
"children",
"or",
"is",
"a",
"leaf",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/PriorityQueue.java#L685-L690 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readNewestUrlNameForId | public String readNewestUrlNameForId(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException {
"""
Reads the URL name which has been most recently mapped to the given structure id, or null
if no URL name is mapped to the id.<p>
@param dbc the current database context
@param id a structure id
@return the ... | java | public String readNewestUrlNameForId(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException {
List<CmsUrlNameMappingEntry> entries = getVfsDriver(dbc).readUrlNameMappingEntries(
dbc,
dbc.currentProject().isOnlineProject(),
CmsUrlNameMappingFilter.ALL.filterStructureId(i... | [
"public",
"String",
"readNewestUrlNameForId",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"id",
")",
"throws",
"CmsDataAccessException",
"{",
"List",
"<",
"CmsUrlNameMappingEntry",
">",
"entries",
"=",
"getVfsDriver",
"(",
"dbc",
")",
".",
"readUrlNameMappingEntries",... | Reads the URL name which has been most recently mapped to the given structure id, or null
if no URL name is mapped to the id.<p>
@param dbc the current database context
@param id a structure id
@return the name which has been most recently mapped to the given structure id
@throws CmsDataAccessException if something g... | [
"Reads",
"the",
"URL",
"name",
"which",
"has",
"been",
"most",
"recently",
"mapped",
"to",
"the",
"given",
"structure",
"id",
"or",
"null",
"if",
"no",
"URL",
"name",
"is",
"mapped",
"to",
"the",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7071-L7084 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java | TemplateMethodsBuilder.addTemplateMethodsToComponentExposedType | public void addTemplateMethodsToComponentExposedType(
ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateParserResult templateParserResult) {
"""
Add Template methods to @{@link IsVueComponent} ExposedType based on the result of the template
parser.
@param exposedTypeGenerator Class genera... | java | public void addTemplateMethodsToComponentExposedType(
ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateParserResult templateParserResult) {
// Compile the resulting HTML template String
compileTemplateString(exposedTypeGenerator, templateParserResult);
// Process the java expressions... | [
"public",
"void",
"addTemplateMethodsToComponentExposedType",
"(",
"ComponentExposedTypeGenerator",
"exposedTypeGenerator",
",",
"TemplateParserResult",
"templateParserResult",
")",
"{",
"// Compile the resulting HTML template String",
"compileTemplateString",
"(",
"exposedTypeGenerator"... | Add Template methods to @{@link IsVueComponent} ExposedType based on the result of the template
parser.
@param exposedTypeGenerator Class generating the ExposedType
@param templateParserResult The result of the HTML template parsed by {@link TemplateParser} | [
"Add",
"Template",
"methods",
"to",
"@",
"{",
"@link",
"IsVueComponent",
"}",
"ExposedType",
"based",
"on",
"the",
"result",
"of",
"the",
"template",
"parser",
"."
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java#L35-L43 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java | PropertiesFileConfiguration.getIntProperty | private int getIntProperty(Properties prop, String name) {
"""
Convert a string representation of a property to an integer type.
@param prop the {@link Properties} needs conversion.
@param name a name to evaluate in the property file.
@return an integer representation of the value associated with the property... | java | private int getIntProperty(Properties prop, String name) {
String propertyValue = prop.getProperty(name);
return Integer.parseInt(propertyValue);
} | [
"private",
"int",
"getIntProperty",
"(",
"Properties",
"prop",
",",
"String",
"name",
")",
"{",
"String",
"propertyValue",
"=",
"prop",
".",
"getProperty",
"(",
"name",
")",
";",
"return",
"Integer",
".",
"parseInt",
"(",
"propertyValue",
")",
";",
"}"
] | Convert a string representation of a property to an integer type.
@param prop the {@link Properties} needs conversion.
@param name a name to evaluate in the property file.
@return an integer representation of the value associated with the property name. | [
"Convert",
"a",
"string",
"representation",
"of",
"a",
"property",
"to",
"an",
"integer",
"type",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/configuration/PropertiesFileConfiguration.java#L280-L283 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/ActionContext.java | ActionContext.getParameterAsString | public String getParameterAsString(String name, String defaultValue) {
"""
Get request parameter as a String.
@param name Parameter name
@param defaultValue Parameter default value (can be null)
@return Parameter value
"""
return defaultValue(blankToNull(getParameter(name)), defaultValue);
} | java | public String getParameterAsString(String name, String defaultValue) {
return defaultValue(blankToNull(getParameter(name)), defaultValue);
} | [
"public",
"String",
"getParameterAsString",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"defaultValue",
"(",
"blankToNull",
"(",
"getParameter",
"(",
"name",
")",
")",
",",
"defaultValue",
")",
";",
"}"
] | Get request parameter as a String.
@param name Parameter name
@param defaultValue Parameter default value (can be null)
@return Parameter value | [
"Get",
"request",
"parameter",
"as",
"a",
"String",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/ActionContext.java#L129-L131 |
atomix/catalyst | serializer/src/main/java/io/atomix/catalyst/serializer/Serializer.java | Serializer.registerAbstract | public Serializer registerAbstract(Class<?> abstractType, Class<? extends TypeSerializer> serializer) {
"""
Registers an abstract type serializer for the given abstract type.
<p>
Abstract serializers allow abstract types to be serialized without explicitly registering a concrete type.
The concept of abstract se... | java | public Serializer registerAbstract(Class<?> abstractType, Class<? extends TypeSerializer> serializer) {
registry.registerAbstract(abstractType, serializer);
return this;
} | [
"public",
"Serializer",
"registerAbstract",
"(",
"Class",
"<",
"?",
">",
"abstractType",
",",
"Class",
"<",
"?",
"extends",
"TypeSerializer",
">",
"serializer",
")",
"{",
"registry",
".",
"registerAbstract",
"(",
"abstractType",
",",
"serializer",
")",
";",
"r... | Registers an abstract type serializer for the given abstract type.
<p>
Abstract serializers allow abstract types to be serialized without explicitly registering a concrete type.
The concept of abstract serializers differs from {@link #registerDefault(Class, TypeSerializerFactory) default serializers}
in that abstract s... | [
"Registers",
"an",
"abstract",
"type",
"serializer",
"for",
"the",
"given",
"abstract",
"type",
".",
"<p",
">",
"Abstract",
"serializers",
"allow",
"abstract",
"types",
"to",
"be",
"serialized",
"without",
"explicitly",
"registering",
"a",
"concrete",
"type",
".... | train | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/serializer/src/main/java/io/atomix/catalyst/serializer/Serializer.java#L504-L507 |
SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.compareCalendarDates | static int compareCalendarDates(@NonNull Calendar first, @NonNull Calendar second) {
"""
Compares the two given Calendar objects, only counting the date, not time.
@return -1 if first comes before second, 0 if both are the same day, 1 if second is before first.
"""
final int firstYear = first.get(Cale... | java | static int compareCalendarDates(@NonNull Calendar first, @NonNull Calendar second) {
final int firstYear = first.get(Calendar.YEAR);
final int secondYear = second.get(Calendar.YEAR);
final int firstDay = first.get(Calendar.DAY_OF_YEAR);
final int secondDay = second.get(Calendar.DAY_OF_YE... | [
"static",
"int",
"compareCalendarDates",
"(",
"@",
"NonNull",
"Calendar",
"first",
",",
"@",
"NonNull",
"Calendar",
"second",
")",
"{",
"final",
"int",
"firstYear",
"=",
"first",
".",
"get",
"(",
"Calendar",
".",
"YEAR",
")",
";",
"final",
"int",
"secondYe... | Compares the two given Calendar objects, only counting the date, not time.
@return -1 if first comes before second, 0 if both are the same day, 1 if second is before first. | [
"Compares",
"the",
"two",
"given",
"Calendar",
"objects",
"only",
"counting",
"the",
"date",
"not",
"time",
"."
] | train | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L438-L455 |
tvesalainen/util | rpm/src/main/java/org/vesalainen/pm/deb/DEBBuilder.java | DEBBuilder.addRequire | @Override
public DEBBuilder addRequire(String name, String version, Condition... dependency) {
"""
Add debian/control Depends field.
@param name
@param version
@param dependency
@return
"""
control.addDepends(release, version, dependency);
return this;
} | java | @Override
public DEBBuilder addRequire(String name, String version, Condition... dependency)
{
control.addDepends(release, version, dependency);
return this;
} | [
"@",
"Override",
"public",
"DEBBuilder",
"addRequire",
"(",
"String",
"name",
",",
"String",
"version",
",",
"Condition",
"...",
"dependency",
")",
"{",
"control",
".",
"addDepends",
"(",
"release",
",",
"version",
",",
"dependency",
")",
";",
"return",
"thi... | Add debian/control Depends field.
@param name
@param version
@param dependency
@return | [
"Add",
"debian",
"/",
"control",
"Depends",
"field",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/rpm/src/main/java/org/vesalainen/pm/deb/DEBBuilder.java#L174-L179 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/core/HeapCache.java | HeapCache.peekEntryInternal | final protected Entry<K, V> peekEntryInternal(K key) {
"""
Return the entry, if it is in the cache, without invoking the
cache source.
<p>The cache storage is asked whether the entry is present.
If the entry is not present, this result is cached in the local
cache.
"""
int hc = modifiedHash(key.hashC... | java | final protected Entry<K, V> peekEntryInternal(K key) {
int hc = modifiedHash(key.hashCode());
return peekEntryInternal(key, hc, extractIntKeyValue(key, hc));
} | [
"final",
"protected",
"Entry",
"<",
"K",
",",
"V",
">",
"peekEntryInternal",
"(",
"K",
"key",
")",
"{",
"int",
"hc",
"=",
"modifiedHash",
"(",
"key",
".",
"hashCode",
"(",
")",
")",
";",
"return",
"peekEntryInternal",
"(",
"key",
",",
"hc",
",",
"ext... | Return the entry, if it is in the cache, without invoking the
cache source.
<p>The cache storage is asked whether the entry is present.
If the entry is not present, this result is cached in the local
cache. | [
"Return",
"the",
"entry",
"if",
"it",
"is",
"in",
"the",
"cache",
"without",
"invoking",
"the",
"cache",
"source",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java#L813-L816 |
keyboardsurfer/Crouton | library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java | Crouton.make | public static Crouton make(Activity activity, View customView, ViewGroup viewGroup) {
"""
Creates a {@link Crouton} with provided text-resource and style for a given
activity.
@param activity
The {@link Activity} that represents the context in which the Crouton should exist.
@param customView
The custom {@l... | java | public static Crouton make(Activity activity, View customView, ViewGroup viewGroup) {
return new Crouton(activity, customView, viewGroup);
} | [
"public",
"static",
"Crouton",
"make",
"(",
"Activity",
"activity",
",",
"View",
"customView",
",",
"ViewGroup",
"viewGroup",
")",
"{",
"return",
"new",
"Crouton",
"(",
"activity",
",",
"customView",
",",
"viewGroup",
")",
";",
"}"
] | Creates a {@link Crouton} with provided text-resource and style for a given
activity.
@param activity
The {@link Activity} that represents the context in which the Crouton should exist.
@param customView
The custom {@link View} to display
@param viewGroup
The {@link ViewGroup} that this {@link Crouton} should be added... | [
"Creates",
"a",
"{",
"@link",
"Crouton",
"}",
"with",
"provided",
"text",
"-",
"resource",
"and",
"style",
"for",
"a",
"given",
"activity",
"."
] | train | https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java#L324-L326 |
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.retrieveDefaultDefinition | public FunctionInner retrieveDefaultDefinition(String resourceGroupName, String jobName, String functionName) {
"""
Retrieves the default definition of a function based on the parameters specified.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from... | java | public FunctionInner retrieveDefaultDefinition(String resourceGroupName, String jobName, String functionName) {
return retrieveDefaultDefinitionWithServiceResponseAsync(resourceGroupName, jobName, functionName).toBlocking().single().body();
} | [
"public",
"FunctionInner",
"retrieveDefaultDefinition",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"functionName",
")",
"{",
"return",
"retrieveDefaultDefinitionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
",",
"func... | Retrieves the default definition of a function based on the parameters specified.
@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 The name o... | [
"Retrieves",
"the",
"default",
"definition",
"of",
"a",
"function",
"based",
"on",
"the",
"parameters",
"specified",
"."
] | 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#L1300-L1302 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java | TriMarkers.getSteepestVector | public static Vector3D getSteepestVector(final Vector3D normal, final double epsilon) {
"""
Get the vector with the highest down slope in the plan.
@param normal
@param epsilon
@return the steepest vector.
"""
if (Math.abs(normal.getX()) < epsilon && Math.abs(normal.getY()) < epsilon) {
... | java | public static Vector3D getSteepestVector(final Vector3D normal, final double epsilon) {
if (Math.abs(normal.getX()) < epsilon && Math.abs(normal.getY()) < epsilon) {
return new Vector3D(0, 0, 0);
}
Vector3D slope;
if (Math.abs(normal.getX()) < epsilon) {
slope = n... | [
"public",
"static",
"Vector3D",
"getSteepestVector",
"(",
"final",
"Vector3D",
"normal",
",",
"final",
"double",
"epsilon",
")",
"{",
"if",
"(",
"Math",
".",
"abs",
"(",
"normal",
".",
"getX",
"(",
")",
")",
"<",
"epsilon",
"&&",
"Math",
".",
"abs",
"(... | Get the vector with the highest down slope in the plan.
@param normal
@param epsilon
@return the steepest vector. | [
"Get",
"the",
"vector",
"with",
"the",
"highest",
"down",
"slope",
"in",
"the",
"plan",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/TriMarkers.java#L190-L209 |
codegist/crest | core/src/main/java/org/codegist/crest/CRestBuilder.java | CRestBuilder.bindAnnotationHandler | public <A extends Annotation> CRestBuilder bindAnnotationHandler(Class<? extends AnnotationHandler<A>> handler, Class<A> annotationCls) {
"""
<p>Binds an annotation handler for the given annotation.</p>
<p>Can be used to tell <b>CRest</b> how to handle user-defined annotation used in interfaces.</p>
@param handl... | java | public <A extends Annotation> CRestBuilder bindAnnotationHandler(Class<? extends AnnotationHandler<A>> handler, Class<A> annotationCls){
return bindAnnotationHandler(handler, annotationCls, Collections.<String, Object>emptyMap());
} | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"CRestBuilder",
"bindAnnotationHandler",
"(",
"Class",
"<",
"?",
"extends",
"AnnotationHandler",
"<",
"A",
">",
">",
"handler",
",",
"Class",
"<",
"A",
">",
"annotationCls",
")",
"{",
"return",
"bindAnnotationH... | <p>Binds an annotation handler for the given annotation.</p>
<p>Can be used to tell <b>CRest</b> how to handle user-defined annotation used in interfaces.</p>
@param handler The user-defined annotation handler
@param annotationCls The user-defined annotation
@param <A> Used-defined annotation type
@return current build... | [
"<p",
">",
"Binds",
"an",
"annotation",
"handler",
"for",
"the",
"given",
"annotation",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Can",
"be",
"used",
"to",
"tell",
"<b",
">",
"CRest<",
"/",
"b",
">",
"how",
"to",
"handle",
"user",
"-",
"defined",
"annot... | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L481-L483 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapTileCircuitModel.java | MapTileCircuitModel.updateNeigbor | private void updateNeigbor(Tile tile, Tile neighbor) {
"""
Update neighbor.
@param tile The tile reference.
@param neighbor The neighbor reference.
"""
final String group = mapGroup.getGroup(tile);
final String neighborGroup = mapGroup.getGroup(neighbor);
final Circuit circuit = ... | java | private void updateNeigbor(Tile tile, Tile neighbor)
{
final String group = mapGroup.getGroup(tile);
final String neighborGroup = mapGroup.getGroup(neighbor);
final Circuit circuit = getCircuitOverTransition(extractor.getCircuit(neighbor), neighbor);
if (group.equals(neighborGro... | [
"private",
"void",
"updateNeigbor",
"(",
"Tile",
"tile",
",",
"Tile",
"neighbor",
")",
"{",
"final",
"String",
"group",
"=",
"mapGroup",
".",
"getGroup",
"(",
"tile",
")",
";",
"final",
"String",
"neighborGroup",
"=",
"mapGroup",
".",
"getGroup",
"(",
"nei... | Update neighbor.
@param tile The tile reference.
@param neighbor The neighbor reference. | [
"Update",
"neighbor",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapTileCircuitModel.java#L134-L147 |
wirecardBrasil/moip-sdk-java | src/main/java/br/com/moip/models/Connect.java | Connect.buildUrl | public String buildUrl(String clientId, String redirectUri, String[] scope, Setup setup) {
"""
This method is used to build the URL to request access permission for your seller.
@param clientId
{@code String} the APP ID.
@param redirectUri
{@code String} the address that you want to redirect your user ... | java | public String buildUrl(String clientId, String redirectUri, String[] scope, Setup setup) {
String url = setup.getEnvironment() + "/oauth/authorize";
url += String.format("?response_type=code&client_id=%s&redirect_uri=%s&scope=", clientId, redirectUri);
for (Integer index = 0; index < scope.le... | [
"public",
"String",
"buildUrl",
"(",
"String",
"clientId",
",",
"String",
"redirectUri",
",",
"String",
"[",
"]",
"scope",
",",
"Setup",
"setup",
")",
"{",
"String",
"url",
"=",
"setup",
".",
"getEnvironment",
"(",
")",
"+",
"\"/oauth/authorize\"",
";",
"u... | This method is used to build the URL to request access permission for your seller.
@param clientId
{@code String} the APP ID.
@param redirectUri
{@code String} the address that you want to redirect your user after they grant the permission.
@param scope
{@code String array} the array of permissions that you wa... | [
"This",
"method",
"is",
"used",
"to",
"build",
"the",
"URL",
"to",
"request",
"access",
"permission",
"for",
"your",
"seller",
"."
] | train | https://github.com/wirecardBrasil/moip-sdk-java/blob/5bee84fa9457d7becfd18954bf5105037f49829c/src/main/java/br/com/moip/models/Connect.java#L34-L47 |
agmip/ace-core | src/main/java/org/agmip/ace/AceComponent.java | AceComponent.getRawSubcomponent | public byte[] getRawSubcomponent(String key) throws IOException {
"""
Return the {@code byte[]} JSON object for the key in this component.
Like {@link #getValueOr} for subcomponents. This will grab the JSON
object for a subcomponent (for example: {@code initial_condition} for
{@link AceExperiment}). If the ke... | java | public byte[] getRawSubcomponent(String key) throws IOException {
JsonParser p = this.getParser();
JsonToken t = p.nextToken();
while (t != null) {
if (t == JsonToken.FIELD_NAME && p.getCurrentName().equals(key)) {
t = p.nextToken();
if (t == JsonToken.START_OBJECT) {
JsonGe... | [
"public",
"byte",
"[",
"]",
"getRawSubcomponent",
"(",
"String",
"key",
")",
"throws",
"IOException",
"{",
"JsonParser",
"p",
"=",
"this",
".",
"getParser",
"(",
")",
";",
"JsonToken",
"t",
"=",
"p",
".",
"nextToken",
"(",
")",
";",
"while",
"(",
"t",
... | Return the {@code byte[]} JSON object for the key in this component.
Like {@link #getValueOr} for subcomponents. This will grab the JSON
object for a subcomponent (for example: {@code initial_condition} for
{@link AceExperiment}). If the key is not found or is not a JSON object,
a blank subcomponent is returned.
@par... | [
"Return",
"the",
"{",
"@code",
"byte",
"[]",
"}",
"JSON",
"object",
"for",
"the",
"key",
"in",
"this",
"component",
"."
] | train | https://github.com/agmip/ace-core/blob/51957e79b4567d0083c52d0720f4a268c3a02f44/src/main/java/org/agmip/ace/AceComponent.java#L275-L300 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/transientcontainer/ExampleTablePanel.java | ExampleTablePanel.setData | public void setData(final List data) {
"""
Sets the table data.
@param data a list of {@link ExampleDataBean}s.
"""
// Bean properties to render
String[] properties = new String[]{"colour", "shape", "animal"};
simpleTable.setDataModel(new SimpleBeanListTableDataModel(properties, data));
} | java | public void setData(final List data) {
// Bean properties to render
String[] properties = new String[]{"colour", "shape", "animal"};
simpleTable.setDataModel(new SimpleBeanListTableDataModel(properties, data));
} | [
"public",
"void",
"setData",
"(",
"final",
"List",
"data",
")",
"{",
"// Bean properties to render",
"String",
"[",
"]",
"properties",
"=",
"new",
"String",
"[",
"]",
"{",
"\"colour\"",
",",
"\"shape\"",
",",
"\"animal\"",
"}",
";",
"simpleTable",
".",
"setD... | Sets the table data.
@param data a list of {@link ExampleDataBean}s. | [
"Sets",
"the",
"table",
"data",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/transientcontainer/ExampleTablePanel.java#L46-L51 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/SpanningTree.java | SpanningTree.getPath | public IAtomContainer getPath(IAtomContainer spt, IAtom atom1, IAtom atom2) throws NoSuchAtomException {
"""
Find a path connected <i>a1</i> and <i>a2</i> in the tree. If there was
an edge between <i>a1</i> and <i>a2</i> this path is a cycle.
@param spt spanning tree
@param atom1 start of path (source)
@par... | java | public IAtomContainer getPath(IAtomContainer spt, IAtom atom1, IAtom atom2) throws NoSuchAtomException {
IAtomContainer path = spt.getBuilder().newInstance(IAtomContainer.class);
PathTools.resetFlags(spt);
path.addAtom(atom1);
PathTools.depthFirstTargetSearch(spt, atom1, atom2, path);
... | [
"public",
"IAtomContainer",
"getPath",
"(",
"IAtomContainer",
"spt",
",",
"IAtom",
"atom1",
",",
"IAtom",
"atom2",
")",
"throws",
"NoSuchAtomException",
"{",
"IAtomContainer",
"path",
"=",
"spt",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IAtomContai... | Find a path connected <i>a1</i> and <i>a2</i> in the tree. If there was
an edge between <i>a1</i> and <i>a2</i> this path is a cycle.
@param spt spanning tree
@param atom1 start of path (source)
@param atom2 end of path (target)
@return a path through the spanning tree from the source to the target
@throws NoSuchAto... | [
"Find",
"a",
"path",
"connected",
"<i",
">",
"a1<",
"/",
"i",
">",
"and",
"<i",
">",
"a2<",
"/",
"i",
">",
"in",
"the",
"tree",
".",
"If",
"there",
"was",
"an",
"edge",
"between",
"<i",
">",
"a1<",
"/",
"i",
">",
"and",
"<i",
">",
"a2<",
"/",... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/SpanningTree.java#L200-L207 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java | DefaultBeanDescriptor.extractPropertyDescriptor | protected void extractPropertyDescriptor(Field field, Object defaultInstance) {
"""
Extract provided properties informations and insert it in {@link #parameterDescriptorMap}.
@param field the JAVA bean property descriptor.
@param defaultInstance the default instance of bean class.
"""
DefaultProper... | java | protected void extractPropertyDescriptor(Field field, Object defaultInstance)
{
DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor();
// is parameter hidden
PropertyHidden parameterHidden = field.getAnnotation(PropertyHidden.class);
if (parameterHidden == null) {
... | [
"protected",
"void",
"extractPropertyDescriptor",
"(",
"Field",
"field",
",",
"Object",
"defaultInstance",
")",
"{",
"DefaultPropertyDescriptor",
"desc",
"=",
"new",
"DefaultPropertyDescriptor",
"(",
")",
";",
"// is parameter hidden",
"PropertyHidden",
"parameterHidden",
... | Extract provided properties informations and insert it in {@link #parameterDescriptorMap}.
@param field the JAVA bean property descriptor.
@param defaultInstance the default instance of bean class. | [
"Extract",
"provided",
"properties",
"informations",
"and",
"insert",
"it",
"in",
"{",
"@link",
"#parameterDescriptorMap",
"}",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java#L212-L259 |
johncarl81/transfuse | transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java | Contract.sameSize | public static void sameSize(final Collection<?> collection1, final Collection<?> collection2, final String collection1Name, final String collection2Name) {
"""
Checks that the collections have the same number of elements, otherwise throws an exception
@param collection1 the first collection
@param collection2 th... | java | public static void sameSize(final Collection<?> collection1, final Collection<?> collection2, final String collection1Name, final String collection2Name) {
notNull(collection1, collection1Name);
notNull(collection2, collection2Name);
if (collection1.size() != collection2.size()) {
t... | [
"public",
"static",
"void",
"sameSize",
"(",
"final",
"Collection",
"<",
"?",
">",
"collection1",
",",
"final",
"Collection",
"<",
"?",
">",
"collection2",
",",
"final",
"String",
"collection1Name",
",",
"final",
"String",
"collection2Name",
")",
"{",
"notNull... | Checks that the collections have the same number of elements, otherwise throws an exception
@param collection1 the first collection
@param collection2 the second collection
@param collection1Name the name of the first collection
@param collection2Name the name of the second collection
@throws IllegalArgumentException i... | [
"Checks",
"that",
"the",
"collections",
"have",
"the",
"same",
"number",
"of",
"elements",
"otherwise",
"throws",
"an",
"exception"
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java#L51-L58 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.fetchByG_C | @Override
public CommerceCurrency fetchByG_C(long groupId, String code) {
"""
Returns the commerce currency where groupId = ? and code = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param code the code
@return the matching commerce curre... | java | @Override
public CommerceCurrency fetchByG_C(long groupId, String code) {
return fetchByG_C(groupId, code, true);
} | [
"@",
"Override",
"public",
"CommerceCurrency",
"fetchByG_C",
"(",
"long",
"groupId",
",",
"String",
"code",
")",
"{",
"return",
"fetchByG_C",
"(",
"groupId",
",",
"code",
",",
"true",
")",
";",
"}"
] | Returns the commerce currency where groupId = ? and code = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param code the code
@return the matching commerce currency, or <code>null</code> if a matching commerce currency could not be found | [
"Returns",
"the",
"commerce",
"currency",
"where",
"groupId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L2046-L2049 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/ringbuffer/impl/RingbufferContainer.java | RingbufferContainer.readMany | public long readMany(long beginSequence, ReadResultSetImpl result) {
"""
Reads multiple items from the ring buffer and adds them to {@code result}
in the stored format. If an item is not available, it will try and
load it from the ringbuffer store.
@param beginSequence the sequence of the first item to read.
... | java | public long readMany(long beginSequence, ReadResultSetImpl result) {
checkReadSequence(beginSequence);
long seq = beginSequence;
while (seq <= ringbuffer.tailSequence()) {
result.addItem(seq, readOrLoadItem(seq));
seq++;
if (result.isMaxSizeReached()) {
... | [
"public",
"long",
"readMany",
"(",
"long",
"beginSequence",
",",
"ReadResultSetImpl",
"result",
")",
"{",
"checkReadSequence",
"(",
"beginSequence",
")",
";",
"long",
"seq",
"=",
"beginSequence",
";",
"while",
"(",
"seq",
"<=",
"ringbuffer",
".",
"tailSequence",... | Reads multiple items from the ring buffer and adds them to {@code result}
in the stored format. If an item is not available, it will try and
load it from the ringbuffer store.
@param beginSequence the sequence of the first item to read.
@param result the List where the result are stored in.
@return returns the ... | [
"Reads",
"multiple",
"items",
"from",
"the",
"ring",
"buffer",
"and",
"adds",
"them",
"to",
"{",
"@code",
"result",
"}",
"in",
"the",
"stored",
"format",
".",
"If",
"an",
"item",
"is",
"not",
"available",
"it",
"will",
"try",
"and",
"load",
"it",
"from... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/ringbuffer/impl/RingbufferContainer.java#L407-L420 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.copyFile | public static File copyFile(File src, File dest, StandardCopyOption... options) throws IORuntimeException {
"""
通过JDK7+的 {@link Files#copy(Path, Path, CopyOption...)} 方法拷贝文件
@param src 源文件
@param dest 目标文件或目录,如果为目录使用与源文件相同的文件名
@param options {@link StandardCopyOption}
@return 目标文件
@throws IORuntimeException... | java | public static File copyFile(File src, File dest, StandardCopyOption... options) throws IORuntimeException {
// check
Assert.notNull(src, "Source File is null !");
if (false == src.exists()) {
throw new IORuntimeException("File not exist: " + src);
}
Assert.notNull(dest, "Destination File or directior... | [
"public",
"static",
"File",
"copyFile",
"(",
"File",
"src",
",",
"File",
"dest",
",",
"StandardCopyOption",
"...",
"options",
")",
"throws",
"IORuntimeException",
"{",
"// check\r",
"Assert",
".",
"notNull",
"(",
"src",
",",
"\"Source File is null !\"",
")",
";"... | 通过JDK7+的 {@link Files#copy(Path, Path, CopyOption...)} 方法拷贝文件
@param src 源文件
@param dest 目标文件或目录,如果为目录使用与源文件相同的文件名
@param options {@link StandardCopyOption}
@return 目标文件
@throws IORuntimeException IO异常 | [
"通过JDK7",
"+",
"的",
"{",
"@link",
"Files#copy",
"(",
"Path",
"Path",
"CopyOption",
"...",
")",
"}",
"方法拷贝文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L939-L950 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ValueDataUtil.java | ValueDataUtil.createValueData | public static PersistedValueData createValueData(int type, int orderNumber, byte[] data) throws IOException {
"""
Creates value data depending on its type. It avoids storing unnecessary bytes in memory
every time.
@param type
property data type, can be either {@link PropertyType} or {@link ExtendedPropertyTyp... | java | public static PersistedValueData createValueData(int type, int orderNumber, byte[] data) throws IOException
{
switch (type)
{
case PropertyType.BINARY :
case PropertyType.UNDEFINED :
return new ByteArrayPersistedValueData(orderNumber, data);
case PropertyType.BOOLE... | [
"public",
"static",
"PersistedValueData",
"createValueData",
"(",
"int",
"type",
",",
"int",
"orderNumber",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"PropertyType",
".",
"BINARY",
":",
"case",... | Creates value data depending on its type. It avoids storing unnecessary bytes in memory
every time.
@param type
property data type, can be either {@link PropertyType} or {@link ExtendedPropertyType}
@param orderNumber
value data order number
@param data
value data represented in array of bytes | [
"Creates",
"value",
"data",
"depending",
"on",
"its",
"type",
".",
"It",
"avoids",
"storing",
"unnecessary",
"bytes",
"in",
"memory",
"every",
"time",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ValueDataUtil.java#L243-L302 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/server/data/CreateVatIdMapConstantsClass.java | CreateVatIdMapConstantsClass.create | public static VatIdMapSharedConstants create() {
"""
Instantiates a class via deferred binding.
@return the new instance, which must be cast to the requested class
"""
if (vatIdMapConstants == null) { // NOPMD it's thread save!
synchronized (VatIdMapConstantsImpl.class) {
if (vatIdMapConst... | java | public static VatIdMapSharedConstants create() {
if (vatIdMapConstants == null) { // NOPMD it's thread save!
synchronized (VatIdMapConstantsImpl.class) {
if (vatIdMapConstants == null) {
vatIdMapConstants =
new VatIdMapConstantsImpl(readMapFromProperties("VatIdMapConstants", "v... | [
"public",
"static",
"VatIdMapSharedConstants",
"create",
"(",
")",
"{",
"if",
"(",
"vatIdMapConstants",
"==",
"null",
")",
"{",
"// NOPMD it's thread save!",
"synchronized",
"(",
"VatIdMapConstantsImpl",
".",
"class",
")",
"{",
"if",
"(",
"vatIdMapConstants",
"==",
... | Instantiates a class via deferred binding.
@return the new instance, which must be cast to the requested class | [
"Instantiates",
"a",
"class",
"via",
"deferred",
"binding",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/server/data/CreateVatIdMapConstantsClass.java#L35-L45 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.enumInit | @Deprecated
public static Object enumInit(Object value, Context cx, boolean enumValues) {
"""
For backwards compatibility with generated class files
@deprecated Use {@link #enumInit(Object, Context, Scriptable, int)} instead
"""
return enumInit(value, cx, enumValues ? ENUMERATE_VALUES
... | java | @Deprecated
public static Object enumInit(Object value, Context cx, boolean enumValues)
{
return enumInit(value, cx, enumValues ? ENUMERATE_VALUES
: ENUMERATE_KEYS);
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"enumInit",
"(",
"Object",
"value",
",",
"Context",
"cx",
",",
"boolean",
"enumValues",
")",
"{",
"return",
"enumInit",
"(",
"value",
",",
"cx",
",",
"enumValues",
"?",
"ENUMERATE_VALUES",
":",
"ENUMERATE_KEYS",... | For backwards compatibility with generated class files
@deprecated Use {@link #enumInit(Object, Context, Scriptable, int)} instead | [
"For",
"backwards",
"compatibility",
"with",
"generated",
"class",
"files"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2215-L2220 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/variant/css/CssSkinVariantResourceProviderStrategy.java | CssSkinVariantResourceProviderStrategy.initVariantProviderStrategy | @Override
public void initVariantProviderStrategy(GeneratorContext context, Map<String, VariantSet> variantsSetMap) {
"""
Initialize the variant resource provider strategy
@param context
the generator context
@param variantsSetMap
the variant set map for the current context path
"""
List<Map<String, ... | java | @Override
public void initVariantProviderStrategy(GeneratorContext context, Map<String, VariantSet> variantsSetMap) {
List<Map<String, String>> variantMapStrategies = new ArrayList<>();
Map<String, String> ctxVariantMap = context.getVariantMap();
VariantSet skinVariantSet = variantsSetMap.get(JawrConstant.SKIN_... | [
"@",
"Override",
"public",
"void",
"initVariantProviderStrategy",
"(",
"GeneratorContext",
"context",
",",
"Map",
"<",
"String",
",",
"VariantSet",
">",
"variantsSetMap",
")",
"{",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"variantMapStrategies... | Initialize the variant resource provider strategy
@param context
the generator context
@param variantsSetMap
the variant set map for the current context path | [
"Initialize",
"the",
"variant",
"resource",
"provider",
"strategy"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/variant/css/CssSkinVariantResourceProviderStrategy.java#L53-L75 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.scrollToSide | public void scrollToSide(int side, float scrollPosition, int stepCount) {
"""
Scrolls horizontally.
@param side the side to scroll; {@link #RIGHT} or {@link #LEFT}
@param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60
@param stepCount how many move steps to incl... | java | public void scrollToSide(int side, float scrollPosition, int stepCount) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollToSide("+side+", "+scrollPosition+", "+stepCount+")");
}
switch (side){
case RIGHT: scroller.scrollToSide(Scroller.Side.RIGHT, scrollPosition, stepCount); break;
ca... | [
"public",
"void",
"scrollToSide",
"(",
"int",
"side",
",",
"float",
"scrollPosition",
",",
"int",
"stepCount",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"scrollToSide(\"",... | Scrolls horizontally.
@param side the side to scroll; {@link #RIGHT} or {@link #LEFT}
@param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60
@param stepCount how many move steps to include in the scroll. Less steps results in a faster scroll | [
"Scrolls",
"horizontally",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2307-L2316 |
VoltDB/voltdb | src/frontend/org/voltcore/utils/CoreUtils.java | CoreUtils.getThreadFactory | public static ThreadFactory getThreadFactory(
final String groupName,
final String name,
final int stackSize,
final boolean incrementThreadNames,
final Queue<String> coreList) {
"""
Creates a thread factory that creates threads within a thread group if
t... | java | public static ThreadFactory getThreadFactory(
final String groupName,
final String name,
final int stackSize,
final boolean incrementThreadNames,
final Queue<String> coreList) {
ThreadGroup group = null;
if (groupName != null) {
gro... | [
"public",
"static",
"ThreadFactory",
"getThreadFactory",
"(",
"final",
"String",
"groupName",
",",
"final",
"String",
"name",
",",
"final",
"int",
"stackSize",
",",
"final",
"boolean",
"incrementThreadNames",
",",
"final",
"Queue",
"<",
"String",
">",
"coreList",
... | Creates a thread factory that creates threads within a thread group if
the group name is given. The threads created will catch any unhandled
exceptions and log them to the HOST logger.
@param groupName
@param name
@param stackSize
@return | [
"Creates",
"a",
"thread",
"factory",
"that",
"creates",
"threads",
"within",
"a",
"thread",
"group",
"if",
"the",
"group",
"name",
"is",
"given",
".",
"The",
"threads",
"created",
"will",
"catch",
"any",
"unhandled",
"exceptions",
"and",
"log",
"them",
"to",... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L706-L753 |
DataArt/CalculationEngine | calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/ConverterUtils.java | ConverterUtils.resolveCellValue | public static ICellValue resolveCellValue(org.apache.poi.ss.usermodel.CellValue cellval) {
"""
Returns the new {@link CellValue} from provided {@link org.apache.poi.ss.usermodel.CellValue}.
"""
if (cellval == null) { return CellValue.BLANK; }
switch (cellval.getCellType()) {
case C... | java | public static ICellValue resolveCellValue(org.apache.poi.ss.usermodel.CellValue cellval) {
if (cellval == null) { return CellValue.BLANK; }
switch (cellval.getCellType()) {
case CELL_TYPE_NUMERIC: { return CellValue.from(cellval.getNumberValue()); }
case CELL_TYPE_STRING: { retu... | [
"public",
"static",
"ICellValue",
"resolveCellValue",
"(",
"org",
".",
"apache",
".",
"poi",
".",
"ss",
".",
"usermodel",
".",
"CellValue",
"cellval",
")",
"{",
"if",
"(",
"cellval",
"==",
"null",
")",
"{",
"return",
"CellValue",
".",
"BLANK",
";",
"}",
... | Returns the new {@link CellValue} from provided {@link org.apache.poi.ss.usermodel.CellValue}. | [
"Returns",
"the",
"new",
"{"
] | train | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/ConverterUtils.java#L186-L198 |
jhy/jsoup | src/main/java/org/jsoup/parser/Parser.java | Parser.parseBodyFragment | public static Document parseBodyFragment(String bodyHtml, String baseUri) {
"""
Parse a fragment of HTML into the {@code body} of a Document.
@param bodyHtml fragment of HTML
@param baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
@return Document, with empty head, a... | java | public static Document parseBodyFragment(String bodyHtml, String baseUri) {
Document doc = Document.createShell(baseUri);
Element body = doc.body();
List<Node> nodeList = parseFragment(bodyHtml, body, baseUri);
Node[] nodes = nodeList.toArray(new Node[0]); // the node list gets modified ... | [
"public",
"static",
"Document",
"parseBodyFragment",
"(",
"String",
"bodyHtml",
",",
"String",
"baseUri",
")",
"{",
"Document",
"doc",
"=",
"Document",
".",
"createShell",
"(",
"baseUri",
")",
";",
"Element",
"body",
"=",
"doc",
".",
"body",
"(",
")",
";",... | Parse a fragment of HTML into the {@code body} of a Document.
@param bodyHtml fragment of HTML
@param baseUri base URI of document (i.e. original fetch location), for resolving relative URLs.
@return Document, with empty head, and HTML parsed into body | [
"Parse",
"a",
"fragment",
"of",
"HTML",
"into",
"the",
"{",
"@code",
"body",
"}",
"of",
"a",
"Document",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/parser/Parser.java#L163-L175 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/common/base/Objects.java | Objects.deepCopy | public static <T extends Serializable> T deepCopy(T original) {
"""
Provides a means to copy objects that do not implement Cloneable. Performs a deep copy where
the copied object has no references to the original object for any object that implements
Serializable. If the original is {@code null}, this method jus... | java | public static <T extends Serializable> T deepCopy(T original) {
if (original == null) {
return null;
}
try {
final ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
final ObjectOutputStream oas = new ObjectOutputStream(baos);
oas.writeO... | [
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"deepCopy",
"(",
"T",
"original",
")",
"{",
"if",
"(",
"original",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"final",
"ByteArrayOutputStream",
"baos",
"=",
"new",
... | Provides a means to copy objects that do not implement Cloneable. Performs a deep copy where
the copied object has no references to the original object for any object that implements
Serializable. If the original is {@code null}, this method just returns {@code null}.
@param <T> the type of the object to be cloned
@pa... | [
"Provides",
"a",
"means",
"to",
"copy",
"objects",
"that",
"do",
"not",
"implement",
"Cloneable",
".",
"Performs",
"a",
"deep",
"copy",
"where",
"the",
"copied",
"object",
"has",
"no",
"references",
"to",
"the",
"original",
"object",
"for",
"any",
"object",
... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/common/base/Objects.java#L61-L77 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/StringFunctions.java | StringFunctions.trim | public static Expression trim(Expression expression, String characters) {
"""
Returned expression results in the string with all leading and trailing chars removed
(any char in the characters string).
"""
return x("TRIM(" + expression.toString() + ", \"" + characters + "\")");
} | java | public static Expression trim(Expression expression, String characters) {
return x("TRIM(" + expression.toString() + ", \"" + characters + "\")");
} | [
"public",
"static",
"Expression",
"trim",
"(",
"Expression",
"expression",
",",
"String",
"characters",
")",
"{",
"return",
"x",
"(",
"\"TRIM(\"",
"+",
"expression",
".",
"toString",
"(",
")",
"+",
"\", \\\"\"",
"+",
"characters",
"+",
"\"\\\")\"",
")",
";",... | Returned expression results in the string with all leading and trailing chars removed
(any char in the characters string). | [
"Returned",
"expression",
"results",
"in",
"the",
"string",
"with",
"all",
"leading",
"and",
"trailing",
"chars",
"removed",
"(",
"any",
"char",
"in",
"the",
"characters",
"string",
")",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/StringFunctions.java#L317-L319 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java | StandardAlgConfigPanel.removeChildAndPrevious | protected static void removeChildAndPrevious( JComponent root , JComponent target ) {
"""
Searches inside the children of "root" for 'target'. If found it is removed and the
previous component.
"""
int N = root.getComponentCount();
for (int i = 0; i < N; i++) {
if( root.getComponent(i) == target ) {
... | java | protected static void removeChildAndPrevious( JComponent root , JComponent target ) {
int N = root.getComponentCount();
for (int i = 0; i < N; i++) {
if( root.getComponent(i) == target ) {
root.remove(i);
root.remove(i-1);
return;
}
}
throw new RuntimeException("Can't find component");
} | [
"protected",
"static",
"void",
"removeChildAndPrevious",
"(",
"JComponent",
"root",
",",
"JComponent",
"target",
")",
"{",
"int",
"N",
"=",
"root",
".",
"getComponentCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",... | Searches inside the children of "root" for 'target'. If found it is removed and the
previous component. | [
"Searches",
"inside",
"the",
"children",
"of",
"root",
"for",
"target",
".",
"If",
"found",
"it",
"is",
"removed",
"and",
"the",
"previous",
"component",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/StandardAlgConfigPanel.java#L284-L295 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CustomFieldValueReader9.java | CustomFieldValueReader9.populateContainer | private void populateContainer(FieldType field, byte[] values, byte[] descriptions) {
"""
Populate the container, converting raw data into Java types.
@param field custom field to which these values belong
@param values raw value data
@param descriptions raw description data
"""
CustomField config =... | java | private void populateContainer(FieldType field, byte[] values, byte[] descriptions)
{
CustomField config = m_container.getCustomField(field);
CustomFieldLookupTable table = config.getLookupTable();
List<Object> descriptionList = convertType(DataType.STRING, descriptions);
List<Object> valueL... | [
"private",
"void",
"populateContainer",
"(",
"FieldType",
"field",
",",
"byte",
"[",
"]",
"values",
",",
"byte",
"[",
"]",
"descriptions",
")",
"{",
"CustomField",
"config",
"=",
"m_container",
".",
"getCustomField",
"(",
"field",
")",
";",
"CustomFieldLookupT... | Populate the container, converting raw data into Java types.
@param field custom field to which these values belong
@param values raw value data
@param descriptions raw description data | [
"Populate",
"the",
"container",
"converting",
"raw",
"data",
"into",
"Java",
"types",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CustomFieldValueReader9.java#L204-L221 |
urbanairship/datacube | src/main/java/com/urbanairship/datacube/Util.java | Util.hashByteArray | public static byte hashByteArray(byte[] array, int startInclusive, int endExclusive) {
"""
A utility to allow hashing of a portion of an array without having to copy it.
@param array
@param startInclusive
@param endExclusive
@return hash byte
"""
if (array == null) {
return 0;
}... | java | public static byte hashByteArray(byte[] array, int startInclusive, int endExclusive) {
if (array == null) {
return 0;
}
int range = endExclusive - startInclusive;
if (range < 0) {
throw new IllegalArgumentException(startInclusive + " > " + endExclusive);
... | [
"public",
"static",
"byte",
"hashByteArray",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"startInclusive",
",",
"int",
"endExclusive",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"int",
"range",
"=",
"endExclusive",
"... | A utility to allow hashing of a portion of an array without having to copy it.
@param array
@param startInclusive
@param endExclusive
@return hash byte | [
"A",
"utility",
"to",
"allow",
"hashing",
"of",
"a",
"portion",
"of",
"an",
"array",
"without",
"having",
"to",
"copy",
"it",
"."
] | train | https://github.com/urbanairship/datacube/blob/89c6b68744cc384c8b49f921cdb0a0f9f414ada6/src/main/java/com/urbanairship/datacube/Util.java#L87-L103 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/views/AuthConfig.java | AuthConfig.getIdForResource | int getIdForResource(@NonNull Context context, @StyleableRes int index) {
"""
Retrieves the resource id of the given Style index.
@param context a valid Context
@param index The index to search on the Style definition.
@return the id if found or -1.
"""
final int[] attrs = new int[]{index};
... | java | int getIdForResource(@NonNull Context context, @StyleableRes int index) {
final int[] attrs = new int[]{index};
final TypedArray typedArray = context.getTheme().obtainStyledAttributes(styleRes, attrs);
int id = typedArray.getResourceId(0, -1);
typedArray.recycle();
return id;
... | [
"int",
"getIdForResource",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"StyleableRes",
"int",
"index",
")",
"{",
"final",
"int",
"[",
"]",
"attrs",
"=",
"new",
"int",
"[",
"]",
"{",
"index",
"}",
";",
"final",
"TypedArray",
"typedArray",
"=",
... | Retrieves the resource id of the given Style index.
@param context a valid Context
@param index The index to search on the Style definition.
@return the id if found or -1. | [
"Retrieves",
"the",
"resource",
"id",
"of",
"the",
"given",
"Style",
"index",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/views/AuthConfig.java#L65-L71 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/Where.java | Where.appendSql | void appendSql(String tableName, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException {
"""
Used by the internal classes to add the where SQL to the {@link StringBuilder}.
@param tableName
Name of the table to prepend to any column names or null to be ignored.
"""
if (clauseStackLeve... | java | void appendSql(String tableName, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException {
if (clauseStackLevel == 0) {
throw new IllegalStateException("No where clauses defined. Did you miss a where operation?");
}
if (clauseStackLevel != 1) {
throw new IllegalStateException(
"Both ... | [
"void",
"appendSql",
"(",
"String",
"tableName",
",",
"StringBuilder",
"sb",
",",
"List",
"<",
"ArgumentHolder",
">",
"columnArgList",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"clauseStackLevel",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException"... | Used by the internal classes to add the where SQL to the {@link StringBuilder}.
@param tableName
Name of the table to prepend to any column names or null to be ignored. | [
"Used",
"by",
"the",
"internal",
"classes",
"to",
"add",
"the",
"where",
"SQL",
"to",
"the",
"{",
"@link",
"StringBuilder",
"}",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L558-L573 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.followVar | private int followVar(char[] array, int currentIndex, boolean fullSyntax, VelocityParserContext context) {
"""
Get the right part of a Velocity variable (the methods and properties starting from the dot).
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param f... | java | private int followVar(char[] array, int currentIndex, boolean fullSyntax, VelocityParserContext context)
{
int i = currentIndex;
while (i < array.length) {
if (fullSyntax && array[i] == '}') {
++i;
break;
} else if (array[i] == '.') {
... | [
"private",
"int",
"followVar",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
",",
"boolean",
"fullSyntax",
",",
"VelocityParserContext",
"context",
")",
"{",
"int",
"i",
"=",
"currentIndex",
";",
"while",
"(",
"i",
"<",
"array",
".",
"length"... | Get the right part of a Velocity variable (the methods and properties starting from the dot).
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param fullSyntax indicate if it's between <code>{</code> and <code>}</code>
@param context the parser context to put some infor... | [
"Get",
"the",
"right",
"part",
"of",
"a",
"Velocity",
"variable",
"(",
"the",
"methods",
"and",
"properties",
"starting",
"from",
"the",
"dot",
")",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L446-L470 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/routes/RouterImpl.java | RouterImpl.matchStandard | private Route matchStandard(HttpMethod httpMethod, String requestUri, ActionInvoker invoker) throws ClassLoadException {
"""
Only to be used in DEV mode
@param httpMethod
@param requestUri
@param injector
@return
@throws ClassLoadException
"""
// find potential routes
for (InternalRoute in... | java | private Route matchStandard(HttpMethod httpMethod, String requestUri, ActionInvoker invoker) throws ClassLoadException {
// find potential routes
for (InternalRoute internalRoute : internalRoutes) {
if (internalRoute.matches(requestUri) ) {
Route deferred = deduceRoute(intern... | [
"private",
"Route",
"matchStandard",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"requestUri",
",",
"ActionInvoker",
"invoker",
")",
"throws",
"ClassLoadException",
"{",
"// find potential routes",
"for",
"(",
"InternalRoute",
"internalRoute",
":",
"internalRoutes",
... | Only to be used in DEV mode
@param httpMethod
@param requestUri
@param injector
@return
@throws ClassLoadException | [
"Only",
"to",
"be",
"used",
"in",
"DEV",
"mode"
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/routes/RouterImpl.java#L196-L205 |
apache/incubator-druid | extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java | WhiteListBasedConverter.getPrefixKey | private String getPrefixKey(String key, SortedMap<String, ?> whiteList) {
"""
@param key the metric name to lookup
@param whiteList
@return <tt>null</tt> if the key does not match with any of the prefixes keys in @code metricsWhiteList,
or the prefix in @code whiteListDimsMapper
"""
String prefi... | java | private String getPrefixKey(String key, SortedMap<String, ?> whiteList)
{
String prefixKey = null;
if (whiteList.containsKey(key)) {
return key;
}
SortedMap<String, ?> headMap = whiteList.headMap(key);
if (!headMap.isEmpty() && key.startsWith(headMap.lastKey())) {
prefixKey = headMap.l... | [
"private",
"String",
"getPrefixKey",
"(",
"String",
"key",
",",
"SortedMap",
"<",
"String",
",",
"?",
">",
"whiteList",
")",
"{",
"String",
"prefixKey",
"=",
"null",
";",
"if",
"(",
"whiteList",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
... | @param key the metric name to lookup
@param whiteList
@return <tt>null</tt> if the key does not match with any of the prefixes keys in @code metricsWhiteList,
or the prefix in @code whiteListDimsMapper | [
"@param",
"key",
"the",
"metric",
"name",
"to",
"lookup",
"@param",
"whiteList"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-contrib/graphite-emitter/src/main/java/org/apache/druid/emitter/graphite/WhiteListBasedConverter.java#L141-L152 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java | GVRShader.generateSignature | public String generateSignature(HashMap<String, Integer> defined, GVRLight[] lightlist) {
"""
Create a unique signature for this shader.
The signature for simple shaders is just the class name.
For the more complex shaders generated by GVRShaderTemplate
the signature includes information about the vertex attrib... | java | public String generateSignature(HashMap<String, Integer> defined, GVRLight[] lightlist)
{
return getClass().getSimpleName();
} | [
"public",
"String",
"generateSignature",
"(",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"defined",
",",
"GVRLight",
"[",
"]",
"lightlist",
")",
"{",
"return",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
";",
"}"
] | Create a unique signature for this shader.
The signature for simple shaders is just the class name.
For the more complex shaders generated by GVRShaderTemplate
the signature includes information about the vertex attributes,
uniforms, textures and lights used by the shader variant.
@param defined
names to be defined fo... | [
"Create",
"a",
"unique",
"signature",
"for",
"this",
"shader",
".",
"The",
"signature",
"for",
"simple",
"shaders",
"is",
"just",
"the",
"class",
"name",
".",
"For",
"the",
"more",
"complex",
"shaders",
"generated",
"by",
"GVRShaderTemplate",
"the",
"signature... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java#L244-L247 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java | GeneralizedCounter.incrementCount | public void incrementCount(List<K> l, K o, double count) {
"""
same as incrementCount(List, double) but as if Object o were at the end of the list
"""
if (l.size() != depth - 1) {
wrongDepth();
}
GeneralizedCounter<K> next = this;
for (K o2: l) {
next.addToTotal(count);
... | java | public void incrementCount(List<K> l, K o, double count) {
if (l.size() != depth - 1) {
wrongDepth();
}
GeneralizedCounter<K> next = this;
for (K o2: l) {
next.addToTotal(count);
next = next.conditionalizeHelper(o2);
}
next.addToTotal(count);
next.incrementCou... | [
"public",
"void",
"incrementCount",
"(",
"List",
"<",
"K",
">",
"l",
",",
"K",
"o",
",",
"double",
"count",
")",
"{",
"if",
"(",
"l",
".",
"size",
"(",
")",
"!=",
"depth",
"-",
"1",
")",
"{",
"wrongDepth",
"(",
")",
";",
"}",
"GeneralizedCounter"... | same as incrementCount(List, double) but as if Object o were at the end of the list | [
"same",
"as",
"incrementCount",
"(",
"List",
"double",
")",
"but",
"as",
"if",
"Object",
"o",
"were",
"at",
"the",
"end",
"of",
"the",
"list"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java#L439-L452 |
primefaces/primefaces | src/main/java/org/primefaces/component/organigram/OrganigramHelper.java | OrganigramHelper.findTreeNode | public static OrganigramNode findTreeNode(OrganigramNode searchRoot, String rowKey) {
"""
Finds a {@link OrganigramNode} for the given rowKey.
@param searchRoot The {@link OrganigramNode} to start the search.
@param rowKey The rowKey.
@return The {@link OrganigramNode} for the rowKey or <code>null</code>.... | java | public static OrganigramNode findTreeNode(OrganigramNode searchRoot, String rowKey) {
if (rowKey == null || searchRoot == null) {
return null;
}
if (searchRoot.getRowKey().equals(rowKey)) {
return searchRoot;
}
if (searchRoot.getChildren() != null) {
... | [
"public",
"static",
"OrganigramNode",
"findTreeNode",
"(",
"OrganigramNode",
"searchRoot",
",",
"String",
"rowKey",
")",
"{",
"if",
"(",
"rowKey",
"==",
"null",
"||",
"searchRoot",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"searchRoot",
... | Finds a {@link OrganigramNode} for the given rowKey.
@param searchRoot The {@link OrganigramNode} to start the search.
@param rowKey The rowKey.
@return The {@link OrganigramNode} for the rowKey or <code>null</code>. | [
"Finds",
"a",
"{",
"@link",
"OrganigramNode",
"}",
"for",
"the",
"given",
"rowKey",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/organigram/OrganigramHelper.java#L43-L63 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/CompHandshakeImpl.java | CompHandshakeImpl.compStartHandshake | public boolean compStartHandshake(CommsConnection conn, int version) {
"""
/*
This method will be invoked when a new connection between two JVMs is being
established; it is invoked on the sender-side of the connection.
We use this oppertunity to send our list of currently known schema ids to
the receiver and... | java | public boolean compStartHandshake(CommsConnection conn, int version) {
try {
SchemaManager.openLink(conn);
return true;
} catch (Exception ex) {
FFDCFilter.processException(ex, "compStartHandshake", "67", this);
return false;
}
} | [
"public",
"boolean",
"compStartHandshake",
"(",
"CommsConnection",
"conn",
",",
"int",
"version",
")",
"{",
"try",
"{",
"SchemaManager",
".",
"openLink",
"(",
"conn",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"FFDCFil... | /*
This method will be invoked when a new connection between two JVMs is being
established; it is invoked on the sender-side of the connection.
We use this oppertunity to send our list of currently known schema ids to
the receiver and to get back the receiver's list. | [
"/",
"*",
"This",
"method",
"will",
"be",
"invoked",
"when",
"a",
"new",
"connection",
"between",
"two",
"JVMs",
"is",
"being",
"established",
";",
"it",
"is",
"invoked",
"on",
"the",
"sender",
"-",
"side",
"of",
"the",
"connection",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/CompHandshakeImpl.java#L43-L51 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java | ConnectionManagerServiceImpl.validateProperty | private static final <E extends Enum<E>> E validateProperty(Map<String, Object> map, String propName, E defaultVal, Class<E> type, ConnectorService connectorSvc) {
"""
Method tests whether a property's value is valid or not.<p>
This method will also handle raising an exception or Tr message if the
property is ... | java | private static final <E extends Enum<E>> E validateProperty(Map<String, Object> map, String propName, E defaultVal, Class<E> type, ConnectorService connectorSvc) {
String strVal = (String) map.remove(propName);
if (strVal == null)
return defaultVal;
try {
return E.valueO... | [
"private",
"static",
"final",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"E",
"validateProperty",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"String",
"propName",
",",
"E",
"defaultVal",
",",
"Class",
"<",
"E",
">",
"type",
",",... | Method tests whether a property's value is valid or not.<p>
This method will also handle raising an exception or Tr message if the
property is invalid.
@param map map of configured properties
@param propName the name of the property being tested
@param defaultVal the default value
@param type enumeration consisting o... | [
"Method",
"tests",
"whether",
"a",
"property",
"s",
"value",
"is",
"valid",
"or",
"not",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java#L644-L658 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.executeBatch | public static int[] executeBatch(Connection conn, String... sqls) throws SQLException {
"""
批量执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sqls SQL列表
@return 每个SQL执行影响的行数
@throws SQLException SQL执行异常
@since 4.5.6
"""
return executeBatch(conn, new ArrayIter<String>(sqls)... | java | public static int[] executeBatch(Connection conn, String... sqls) throws SQLException {
return executeBatch(conn, new ArrayIter<String>(sqls));
} | [
"public",
"static",
"int",
"[",
"]",
"executeBatch",
"(",
"Connection",
"conn",
",",
"String",
"...",
"sqls",
")",
"throws",
"SQLException",
"{",
"return",
"executeBatch",
"(",
"conn",
",",
"new",
"ArrayIter",
"<",
"String",
">",
"(",
"sqls",
")",
")",
"... | 批量执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sqls SQL列表
@return 每个SQL执行影响的行数
@throws SQLException SQL执行异常
@since 4.5.6 | [
"批量执行非查询语句<br",
">",
"语句包括",
"插入、更新、删除<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L200-L202 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendPing | public static <T> void sendPing(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) {
"""
Sends a complete ping message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback ... | java | public static <T> void sendPing(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) {
sendInternal(mergeBuffers(data), WebSocketFrameType.PING, wsChannel, callback, context, -1);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"sendPing",
"(",
"final",
"ByteBuffer",
"[",
"]",
"data",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"T",
">",
"callback",
",",
"T",
"context",
")",
"{",
"sendInternal",
... | Sends a complete ping message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion
@param context The context object that will be passed to the callback on completion | [
"Sends",
"a",
"complete",
"ping",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L291-L293 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java | SparqlLogicConceptMatcher.listMatchesWithinRange | @Override
public Table<URI, URI, MatchResult> listMatchesWithinRange(Set<URI> origins, MatchType minType, MatchType maxType) {
"""
Obtain all the matching resources with the URIs of {@code origin} within the range of MatchTypes provided, both inclusive.
@param origins URIs to match
@param minType the minim... | java | @Override
public Table<URI, URI, MatchResult> listMatchesWithinRange(Set<URI> origins, MatchType minType, MatchType maxType) {
return obtainMatchResults(origins, minType, maxType);
} | [
"@",
"Override",
"public",
"Table",
"<",
"URI",
",",
"URI",
",",
"MatchResult",
">",
"listMatchesWithinRange",
"(",
"Set",
"<",
"URI",
">",
"origins",
",",
"MatchType",
"minType",
",",
"MatchType",
"maxType",
")",
"{",
"return",
"obtainMatchResults",
"(",
"o... | Obtain all the matching resources with the URIs of {@code origin} within the range of MatchTypes provided, both inclusive.
@param origins URIs to match
@param minType the minimum MatchType we want to obtain
@param maxType the maximum MatchType we want to obtain
@return a {@link com.google.common.collect.Table} with th... | [
"Obtain",
"all",
"the",
"matching",
"resources",
"with",
"the",
"URIs",
"of",
"{",
"@code",
"origin",
"}",
"within",
"the",
"range",
"of",
"MatchTypes",
"provided",
"both",
"inclusive",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java#L346-L349 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/GridTable.java | GridTable.findElement | public int findElement(Object bookmark, int iHandleType) {
"""
Find this bookmark in one of the lists.
@return int index in table; or -1 if not found.
@param bookmark java.lang.Object The bookmark to look for.
@param iHandleType The type of bookmark to look for.
"""
if (bookmark == null)
... | java | public int findElement(Object bookmark, int iHandleType)
{
if (bookmark == null)
return -1;
int iTargetPosition = m_gridBuffer.findElement(bookmark, iHandleType);
if (iTargetPosition == -1)
iTargetPosition = m_gridList.findElement(bookmark, iHandleType);
retur... | [
"public",
"int",
"findElement",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"{",
"if",
"(",
"bookmark",
"==",
"null",
")",
"return",
"-",
"1",
";",
"int",
"iTargetPosition",
"=",
"m_gridBuffer",
".",
"findElement",
"(",
"bookmark",
",",
"iHa... | Find this bookmark in one of the lists.
@return int index in table; or -1 if not found.
@param bookmark java.lang.Object The bookmark to look for.
@param iHandleType The type of bookmark to look for. | [
"Find",
"this",
"bookmark",
"in",
"one",
"of",
"the",
"lists",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/GridTable.java#L458-L466 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomDataWriter.java | AtomDataWriter.marshallPrimitive | private void marshallPrimitive(Object value, PrimitiveType primitiveType) throws XMLStreamException {
"""
Marshall a primitive value.
@param value The value to marshall. Can be {@code null}.
@param primitiveType The OData primitive type.
"""
LOG.trace("Primitive value: {} of type: {}", val... | java | private void marshallPrimitive(Object value, PrimitiveType primitiveType) throws XMLStreamException {
LOG.trace("Primitive value: {} of type: {}", value, primitiveType);
if (value != null) {
xmlWriter.writeCharacters(value.toString());
}
} | [
"private",
"void",
"marshallPrimitive",
"(",
"Object",
"value",
",",
"PrimitiveType",
"primitiveType",
")",
"throws",
"XMLStreamException",
"{",
"LOG",
".",
"trace",
"(",
"\"Primitive value: {} of type: {}\"",
",",
"value",
",",
"primitiveType",
")",
";",
"if",
"(",... | Marshall a primitive value.
@param value The value to marshall. Can be {@code null}.
@param primitiveType The OData primitive type. | [
"Marshall",
"a",
"primitive",
"value",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomDataWriter.java#L143-L149 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.lockImmutabilityPolicy | public ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) {
"""
Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation... | java | public ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) {
return lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body();
} | [
"public",
"ImmutabilityPolicyInner",
"lockImmutabilityPolicy",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"String",
"ifMatch",
")",
"{",
"return",
"lockImmutabilityPolicyWithServiceResponseAsync",
"(",
"resourceGroup... | Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name ... | [
"Sets",
"the",
"ImmutabilityPolicy",
"to",
"Locked",
"state",
".",
"The",
"only",
"action",
"allowed",
"on",
"a",
"Locked",
"policy",
"is",
"ExtendImmutabilityPolicy",
"action",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"required",
"for",
"this",
"operation... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L1486-L1488 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/filter/Filter.java | Filter.onAsyncResponse | public void onAsyncResponse(ConsumerConfig config, SofaRequest request, SofaResponse response, Throwable exception)
throws SofaRpcException {
"""
Do filtering after asynchronous respond, only supported in CONSUMER SIDE. <p>
Because when do async invoke, the code after invoke has been executed after invo... | java | public void onAsyncResponse(ConsumerConfig config, SofaRequest request, SofaResponse response, Throwable exception)
throws SofaRpcException {
} | [
"public",
"void",
"onAsyncResponse",
"(",
"ConsumerConfig",
"config",
",",
"SofaRequest",
"request",
",",
"SofaResponse",
"response",
",",
"Throwable",
"exception",
")",
"throws",
"SofaRpcException",
"{",
"}"
] | Do filtering after asynchronous respond, only supported in CONSUMER SIDE. <p>
Because when do async invoke, the code after invoke has been executed after invoker return dummy empty response.
We need execute filter code after get true response from server.<p>
NOTICE: The thread run {@link #onAsyncResponse} is differen... | [
"Do",
"filtering",
"after",
"asynchronous",
"respond",
"only",
"supported",
"in",
"CONSUMER",
"SIDE",
".",
"<p",
">"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/filter/Filter.java#L75-L77 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableConfig.java | PathfindableConfig.exportAllowedMovements | private static void exportAllowedMovements(Xml root, Collection<MovementTile> movements) {
"""
Export the allowed movements.
@param root The root node (must not be <code>null</code>).
@param movements The movements node (must not be <code>null</code>).
"""
for (final MovementTile movement : moveme... | java | private static void exportAllowedMovements(Xml root, Collection<MovementTile> movements)
{
for (final MovementTile movement : movements)
{
final Xml node = root.createChild(NODE_MOVEMENT);
node.setText(movement.name());
}
} | [
"private",
"static",
"void",
"exportAllowedMovements",
"(",
"Xml",
"root",
",",
"Collection",
"<",
"MovementTile",
">",
"movements",
")",
"{",
"for",
"(",
"final",
"MovementTile",
"movement",
":",
"movements",
")",
"{",
"final",
"Xml",
"node",
"=",
"root",
"... | Export the allowed movements.
@param root The root node (must not be <code>null</code>).
@param movements The movements node (must not be <code>null</code>). | [
"Export",
"the",
"allowed",
"movements",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableConfig.java#L177-L184 |
alkacon/opencms-core | src/org/opencms/jlan/CmsJlanDiskInterface.java | CmsJlanDiskInterface.tryUnlock | private void tryUnlock(CmsObjectWrapper cms, String path) {
"""
Tries to unlock the file at the given path.<p>
@param cms the CMS context wrapper
@param path the path of the resource to unlock
"""
try {
cms.unlockResource(path);
} catch (Throwable e) {
LOG.info... | java | private void tryUnlock(CmsObjectWrapper cms, String path) {
try {
cms.unlockResource(path);
} catch (Throwable e) {
LOG.info(e.getLocalizedMessage(), e);
}
} | [
"private",
"void",
"tryUnlock",
"(",
"CmsObjectWrapper",
"cms",
",",
"String",
"path",
")",
"{",
"try",
"{",
"cms",
".",
"unlockResource",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"LOG",
".",
"info",
"(",
"e",
".",
"getLo... | Tries to unlock the file at the given path.<p>
@param cms the CMS context wrapper
@param path the path of the resource to unlock | [
"Tries",
"to",
"unlock",
"the",
"file",
"at",
"the",
"given",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jlan/CmsJlanDiskInterface.java#L546-L554 |
erizet/SignalA | SignalA/src/main/java/com/zsoft/signala/Hubs/HubProxy.java | HubProxy.InvokeEvent | public void InvokeEvent(String eventName, JSONArray args) {
"""
K�r event lokalt som anropas fr�n servern och som registrerats i ON-metod.
"""
HubOnDataCallback subscription;
if(mSubscriptions.containsKey(eventName))
{
subscription = mSubscriptions.get(eventName);
s... | java | public void InvokeEvent(String eventName, JSONArray args)
{
HubOnDataCallback subscription;
if(mSubscriptions.containsKey(eventName))
{
subscription = mSubscriptions.get(eventName);
subscription.OnReceived(args);
}
} | [
"public",
"void",
"InvokeEvent",
"(",
"String",
"eventName",
",",
"JSONArray",
"args",
")",
"{",
"HubOnDataCallback",
"subscription",
";",
"if",
"(",
"mSubscriptions",
".",
"containsKey",
"(",
"eventName",
")",
")",
"{",
"subscription",
"=",
"mSubscriptions",
".... | K�r event lokalt som anropas fr�n servern och som registrerats i ON-metod. | [
"K�r",
"event",
"lokalt",
"som",
"anropas",
"fr�n",
"servern",
"och",
"som",
"registrerats",
"i",
"ON",
"-",
"metod",
"."
] | train | https://github.com/erizet/SignalA/blob/d33bf49dbcf7249f826c5dbb3411cfe4f5d97dd4/SignalA/src/main/java/com/zsoft/signala/Hubs/HubProxy.java#L94-L102 |
phax/ph-commons | ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java | AbstractMapBasedWALDAO.internalDeleteItem | @MustBeLocked (ELockType.WRITE)
@Nullable
protected final IMPLTYPE internalDeleteItem (@Nullable final String sID) {
"""
Delete the item by removing it from the map. If something was remove the
onDeleteItem callback is invoked. Must only be invoked inside a write-lock.
@param sID
The ID to be removed. May... | java | @MustBeLocked (ELockType.WRITE)
@Nullable
protected final IMPLTYPE internalDeleteItem (@Nullable final String sID)
{
return internalDeleteItem (sID, true);
} | [
"@",
"MustBeLocked",
"(",
"ELockType",
".",
"WRITE",
")",
"@",
"Nullable",
"protected",
"final",
"IMPLTYPE",
"internalDeleteItem",
"(",
"@",
"Nullable",
"final",
"String",
"sID",
")",
"{",
"return",
"internalDeleteItem",
"(",
"sID",
",",
"true",
")",
";",
"}... | Delete the item by removing it from the map. If something was remove the
onDeleteItem callback is invoked. Must only be invoked inside a write-lock.
@param sID
The ID to be removed. May be <code>null</code>.
@return The deleted item. If <code>null</code> no such item was found and
therefore nothing was removed. | [
"Delete",
"the",
"item",
"by",
"removing",
"it",
"from",
"the",
"map",
".",
"If",
"something",
"was",
"remove",
"the",
"onDeleteItem",
"callback",
"is",
"invoked",
".",
"Must",
"only",
"be",
"invoked",
"inside",
"a",
"write",
"-",
"lock",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java#L386-L391 |
apache/incubator-gobblin | gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java | JdbcExtractor.getTargetColumnName | private String getTargetColumnName(String sourceColumnName, String alias) {
"""
Get target column name if column is not found in metadata, then name it
as unknown column If alias is not found, target column is nothing but
source column
@param sourceColumnName
@param alias
@return targetColumnName
"""
... | java | private String getTargetColumnName(String sourceColumnName, String alias) {
String targetColumnName = alias;
Schema obj = this.getMetadataColumnMap().get(sourceColumnName.toLowerCase());
if (obj == null) {
targetColumnName = (targetColumnName == null ? "unknown" + this.unknownColumnCounter : targetCol... | [
"private",
"String",
"getTargetColumnName",
"(",
"String",
"sourceColumnName",
",",
"String",
"alias",
")",
"{",
"String",
"targetColumnName",
"=",
"alias",
";",
"Schema",
"obj",
"=",
"this",
".",
"getMetadataColumnMap",
"(",
")",
".",
"get",
"(",
"sourceColumnN... | Get target column name if column is not found in metadata, then name it
as unknown column If alias is not found, target column is nothing but
source column
@param sourceColumnName
@param alias
@return targetColumnName | [
"Get",
"target",
"column",
"name",
"if",
"column",
"is",
"not",
"found",
"in",
"metadata",
"then",
"name",
"it",
"as",
"unknown",
"column",
"If",
"alias",
"is",
"not",
"found",
"target",
"column",
"is",
"nothing",
"but",
"source",
"column"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java#L473-L484 |
google/closure-compiler | src/com/google/javascript/jscomp/JsMessageVisitor.java | JsMessageVisitor.isMessageName | boolean isMessageName(String identifier, boolean isNewStyleMessage) {
"""
Returns whether the given JS identifier is a valid JS message name.
"""
return identifier.startsWith(MSG_PREFIX) &&
(style == JsMessage.Style.CLOSURE || isNewStyleMessage ||
!identifier.endsWith(DESC_SUFFIX));
} | java | boolean isMessageName(String identifier, boolean isNewStyleMessage) {
return identifier.startsWith(MSG_PREFIX) &&
(style == JsMessage.Style.CLOSURE || isNewStyleMessage ||
!identifier.endsWith(DESC_SUFFIX));
} | [
"boolean",
"isMessageName",
"(",
"String",
"identifier",
",",
"boolean",
"isNewStyleMessage",
")",
"{",
"return",
"identifier",
".",
"startsWith",
"(",
"MSG_PREFIX",
")",
"&&",
"(",
"style",
"==",
"JsMessage",
".",
"Style",
".",
"CLOSURE",
"||",
"isNewStyleMessa... | Returns whether the given JS identifier is a valid JS message name. | [
"Returns",
"whether",
"the",
"given",
"JS",
"identifier",
"is",
"a",
"valid",
"JS",
"message",
"name",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JsMessageVisitor.java#L922-L926 |
nmdp-bioinformatics/ngs | range/src/main/java/org/nmdp/ngs/range/Ranges.java | Ranges.isGreaterThan | public static <C extends Comparable> boolean isGreaterThan(final Range<C> range, final C value) {
"""
Return true if the specified range is strictly greater than the specified value.
@param <C> range endpoint type
@param range range, must not be null
@param value value, must not be null
@return true if the s... | java | public static <C extends Comparable> boolean isGreaterThan(final Range<C> range, final C value) {
checkNotNull(range);
checkNotNull(value);
if (!range.hasLowerBound()) {
return false;
}
if (range.lowerBoundType() == BoundType.OPEN && range.lowerEndpoint().equals(valu... | [
"public",
"static",
"<",
"C",
"extends",
"Comparable",
">",
"boolean",
"isGreaterThan",
"(",
"final",
"Range",
"<",
"C",
">",
"range",
",",
"final",
"C",
"value",
")",
"{",
"checkNotNull",
"(",
"range",
")",
";",
"checkNotNull",
"(",
"value",
")",
";",
... | Return true if the specified range is strictly greater than the specified value.
@param <C> range endpoint type
@param range range, must not be null
@param value value, must not be null
@return true if the specified range is strictly greater than the specified value | [
"Return",
"true",
"if",
"the",
"specified",
"range",
"is",
"strictly",
"greater",
"than",
"the",
"specified",
"value",
"."
] | train | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/range/src/main/java/org/nmdp/ngs/range/Ranges.java#L131-L142 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.registerClonedEntity | public void registerClonedEntity(String sourceEntityId, String targetEntityId) {
"""
Registers a deep copy of the source entity with the given target entity id.<p>
@param sourceEntityId the source entity id
@param targetEntityId the target entity id
"""
CmsEntityBackend.getInstance().getEntity(s... | java | public void registerClonedEntity(String sourceEntityId, String targetEntityId) {
CmsEntityBackend.getInstance().getEntity(sourceEntityId).createDeepCopy(targetEntityId);
} | [
"public",
"void",
"registerClonedEntity",
"(",
"String",
"sourceEntityId",
",",
"String",
"targetEntityId",
")",
"{",
"CmsEntityBackend",
".",
"getInstance",
"(",
")",
".",
"getEntity",
"(",
"sourceEntityId",
")",
".",
"createDeepCopy",
"(",
"targetEntityId",
")",
... | Registers a deep copy of the source entity with the given target entity id.<p>
@param sourceEntityId the source entity id
@param targetEntityId the target entity id | [
"Registers",
"a",
"deep",
"copy",
"of",
"the",
"source",
"entity",
"with",
"the",
"given",
"target",
"entity",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L985-L988 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/WebPage.java | WebPage.doPostWithSearch | protected void doPostWithSearch(WebSiteRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException {
"""
Handles any search posts, sends everything else on to <code>doPost(WebSiteRequest,HttpServletResponse)</code>.
The search assumes the search parameters of <code>search_query</code... | java | protected void doPostWithSearch(WebSiteRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException {
String query=req.getParameter("search_query");
String searchTarget=req.getParameter("search_target");
WebPageLayout layout=getWebPageLayout(req);
if(query!=null && searchTarget!=nul... | [
"protected",
"void",
"doPostWithSearch",
"(",
"WebSiteRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
",",
"SQLException",
"{",
"String",
"query",
"=",
"req",
".",
"getParameter",
"(",
"\"search_query\"",
"... | Handles any search posts, sends everything else on to <code>doPost(WebSiteRequest,HttpServletResponse)</code>.
The search assumes the search parameters of <code>search_query</code> and <code>search_target</code>. Both
these values must be present for a search to be performed. Search target may be either <code>"this_a... | [
"Handles",
"any",
"search",
"posts",
"sends",
"everything",
"else",
"on",
"to",
"<code",
">",
"doPost",
"(",
"WebSiteRequest",
"HttpServletResponse",
")",
"<",
"/",
"code",
">",
".",
"The",
"search",
"assumes",
"the",
"search",
"parameters",
"of",
"<code",
"... | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L428-L459 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java | CommsUtils.checkFapLevel | public static void checkFapLevel(HandshakeProperties handShakeProps, short fapLevel)
throws SIIncorrectCallException {
"""
This method is used on API calls when checking to see if the call is supported for the current
FAP level. Before making a call in a method that is only supported in a particular FAP ve... | java | public static void checkFapLevel(HandshakeProperties handShakeProps, short fapLevel)
throws SIIncorrectCallException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkFapLevel", ""+fapLevel);
short actualFapVersion = handShakeProps.getFapLevel();
... | [
"public",
"static",
"void",
"checkFapLevel",
"(",
"HandshakeProperties",
"handShakeProps",
",",
"short",
"fapLevel",
")",
"throws",
"SIIncorrectCallException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
... | This method is used on API calls when checking to see if the call is supported for the current
FAP level. Before making a call in a method that is only supported in a particular FAP version
call this method passing in the lowest FAP version this method is supported in. If the current
negotiated FAP version is lower tha... | [
"This",
"method",
"is",
"used",
"on",
"API",
"calls",
"when",
"checking",
"to",
"see",
"if",
"the",
"call",
"is",
"supported",
"for",
"the",
"current",
"FAP",
"level",
".",
"Before",
"making",
"a",
"call",
"in",
"a",
"method",
"that",
"is",
"only",
"su... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L168-L186 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java | IDNA.convertIDNToUnicode | @Deprecated
public static StringBuffer convertIDNToUnicode(String src, int options)
throws StringPrepParseException {
"""
IDNA2003: Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".
... | java | @Deprecated
public static StringBuffer convertIDNToUnicode(String src, int options)
throws StringPrepParseException{
return IDNA2003.convertIDNToUnicode(src, options);
} | [
"@",
"Deprecated",
"public",
"static",
"StringBuffer",
"convertIDNToUnicode",
"(",
"String",
"src",
",",
"int",
"options",
")",
"throws",
"StringPrepParseException",
"{",
"return",
"IDNA2003",
".",
"convertIDNToUnicode",
"(",
"src",
",",
"options",
")",
";",
"}"
] | IDNA2003: Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".
<b>Note:</b> IDNA RFC specifies that a conformant application should divide a domain name
into separate labels, decide whether to apply allowUna... | [
"IDNA2003",
":",
"Convenience",
"function",
"that",
"implements",
"the",
"IDNToUnicode",
"operation",
"as",
"defined",
"in",
"the",
"IDNA",
"RFC",
".",
"This",
"operation",
"is",
"done",
"on",
"complete",
"domain",
"names",
"e",
".",
"g",
":",
"www",
".",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java#L846-L850 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXReader.java | MPXReader.populateRelationList | private void populateRelationList(Task task, TaskField field, String data) {
"""
Populates a relation list.
@param task parent task
@param field target task field
@param data MPX relation list data
"""
DeferredRelationship dr = new DeferredRelationship();
dr.setTask(task);
dr.setField(fi... | java | private void populateRelationList(Task task, TaskField field, String data)
{
DeferredRelationship dr = new DeferredRelationship();
dr.setTask(task);
dr.setField(field);
dr.setData(data);
m_deferredRelationships.add(dr);
} | [
"private",
"void",
"populateRelationList",
"(",
"Task",
"task",
",",
"TaskField",
"field",
",",
"String",
"data",
")",
"{",
"DeferredRelationship",
"dr",
"=",
"new",
"DeferredRelationship",
"(",
")",
";",
"dr",
".",
"setTask",
"(",
"task",
")",
";",
"dr",
... | Populates a relation list.
@param task parent task
@param field target task field
@param data MPX relation list data | [
"Populates",
"a",
"relation",
"list",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXReader.java#L878-L885 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.