repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 201 | func_name stringlengths 4 126 | whole_func_string stringlengths 75 3.57k | language stringclasses 1
value | func_code_string stringlengths 75 3.57k | func_code_tokens listlengths 21 599 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
buschmais/jqa-core-framework | plugin/src/main/java/com/buschmais/jqassistant/core/plugin/impl/PluginConfigurationReaderImpl.java | PluginConfigurationReaderImpl.getPlugins | @Override
public List<JqassistantPlugin> getPlugins() {
if (this.plugins == null) {
final Enumeration<URL> resources;
try {
resources = pluginClassLoader.getResources(PLUGIN_RESOURCE);
} catch (IOException e) {
throw new IllegalStateExcepti... | java | @Override
public List<JqassistantPlugin> getPlugins() {
if (this.plugins == null) {
final Enumeration<URL> resources;
try {
resources = pluginClassLoader.getResources(PLUGIN_RESOURCE);
} catch (IOException e) {
throw new IllegalStateExcepti... | [
"@",
"Override",
"public",
"List",
"<",
"JqassistantPlugin",
">",
"getPlugins",
"(",
")",
"{",
"if",
"(",
"this",
".",
"plugins",
"==",
"null",
")",
"{",
"final",
"Enumeration",
"<",
"URL",
">",
"resources",
";",
"try",
"{",
"resources",
"=",
"pluginClas... | Returns an {@link Iterable} over all plugins which can be resolved from
the current classpath.
@return The plugins which can be resolved from the current classpath. | [
"Returns",
"an",
"{",
"@link",
"Iterable",
"}",
"over",
"all",
"plugins",
"which",
"can",
"be",
"resolved",
"from",
"the",
"current",
"classpath",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/plugin/src/main/java/com/buschmais/jqassistant/core/plugin/impl/PluginConfigurationReaderImpl.java#L82-L104 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.getOrCreateAggregatedAppend | private AggregatedAppendOperation getOrCreateAggregatedAppend(long operationOffset, long operationSequenceNumber) {
AggregatedAppendOperation aggregatedAppend = null;
if (this.operations.size() > 0) {
StorageOperation last = this.operations.getLast();
if (last.getLength() < this.... | java | private AggregatedAppendOperation getOrCreateAggregatedAppend(long operationOffset, long operationSequenceNumber) {
AggregatedAppendOperation aggregatedAppend = null;
if (this.operations.size() > 0) {
StorageOperation last = this.operations.getLast();
if (last.getLength() < this.... | [
"private",
"AggregatedAppendOperation",
"getOrCreateAggregatedAppend",
"(",
"long",
"operationOffset",
",",
"long",
"operationSequenceNumber",
")",
"{",
"AggregatedAppendOperation",
"aggregatedAppend",
"=",
"null",
";",
"if",
"(",
"this",
".",
"operations",
".",
"size",
... | Gets an existing AggregatedAppendOperation or creates a new one to add the given operation to.
An existing AggregatedAppend will be returned if it meets the following criteria:
* It is the last operation in the operation queue.
* Its size is smaller than maxLength.
* It is not sealed (already flushed).
<p>
If at least ... | [
"Gets",
"an",
"existing",
"AggregatedAppendOperation",
"or",
"creates",
"a",
"new",
"one",
"to",
"add",
"the",
"given",
"operation",
"to",
".",
"An",
"existing",
"AggregatedAppend",
"will",
"be",
"returned",
"if",
"it",
"meets",
"the",
"following",
"criteria",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L504-L525 |
google/truth | core/src/main/java/com/google/common/truth/Correspondence.java | Correspondence.safeFormatDiff | @NullableDecl
final String safeFormatDiff(
@NullableDecl A actual, @NullableDecl E expected, ExceptionStore exceptions) {
try {
return formatDiff(actual, expected);
} catch (RuntimeException e) {
exceptions.addFormatDiffException(Correspondence.class, e, actual, expected);
return null;... | java | @NullableDecl
final String safeFormatDiff(
@NullableDecl A actual, @NullableDecl E expected, ExceptionStore exceptions) {
try {
return formatDiff(actual, expected);
} catch (RuntimeException e) {
exceptions.addFormatDiffException(Correspondence.class, e, actual, expected);
return null;... | [
"@",
"NullableDecl",
"final",
"String",
"safeFormatDiff",
"(",
"@",
"NullableDecl",
"A",
"actual",
",",
"@",
"NullableDecl",
"E",
"expected",
",",
"ExceptionStore",
"exceptions",
")",
"{",
"try",
"{",
"return",
"formatDiff",
"(",
"actual",
",",
"expected",
")"... | Invokes {@link #formatDiff}, catching any exceptions. If the comparison does not throw, returns
the result. If it does throw, adds the exception to the given {@link ExceptionStore} and
returns null. | [
"Invokes",
"{"
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/Correspondence.java#L719-L728 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayCounter.java | ArrayCounter.calcInterval | static long calcInterval(int segments, int start, int limit) {
long range = limit - start;
if (range < 0) {
return 0;
}
int partSegment = (range % segments) == 0 ? 0
: 1;
return (range / segments) + partSegment;
... | java | static long calcInterval(int segments, int start, int limit) {
long range = limit - start;
if (range < 0) {
return 0;
}
int partSegment = (range % segments) == 0 ? 0
: 1;
return (range / segments) + partSegment;
... | [
"static",
"long",
"calcInterval",
"(",
"int",
"segments",
",",
"int",
"start",
",",
"int",
"limit",
")",
"{",
"long",
"range",
"=",
"limit",
"-",
"start",
";",
"if",
"(",
"range",
"<",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"partSegment",
"... | Helper method to calculate the span of the sub-interval. Simply returns
the cieling of ((limit - start) / segments) and accounts for invalid
start and limit combinations. | [
"Helper",
"method",
"to",
"calculate",
"the",
"span",
"of",
"the",
"sub",
"-",
"interval",
".",
"Simply",
"returns",
"the",
"cieling",
"of",
"((",
"limit",
"-",
"start",
")",
"/",
"segments",
")",
"and",
"accounts",
"for",
"invalid",
"start",
"and",
"lim... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayCounter.java#L139-L151 |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/SingleNodeRateLimiterComponent.java | SingleNodeRateLimiterComponent.startBucketSavingThread | private void startBucketSavingThread(Map<String, String> config) {
String delay = config.get("persistence.delay"); //$NON-NLS-1$
if (delay == null) {
delay = "30"; //$NON-NLS-1$
}
String period = config.get("persistence.period"); //$NON-NLS-1$
if (period == null) {
... | java | private void startBucketSavingThread(Map<String, String> config) {
String delay = config.get("persistence.delay"); //$NON-NLS-1$
if (delay == null) {
delay = "30"; //$NON-NLS-1$
}
String period = config.get("persistence.period"); //$NON-NLS-1$
if (period == null) {
... | [
"private",
"void",
"startBucketSavingThread",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"config",
")",
"{",
"String",
"delay",
"=",
"config",
".",
"get",
"(",
"\"persistence.delay\"",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"delay",
"==",
"null",
")",
"... | Save the buckets to file (persist them) from time to time. This is done
in a thread so that it does not impact performance of the rate limits.
@param config | [
"Save",
"the",
"buckets",
"to",
"file",
"(",
"persist",
"them",
")",
"from",
"time",
"to",
"time",
".",
"This",
"is",
"done",
"in",
"a",
"thread",
"so",
"that",
"it",
"does",
"not",
"impact",
"performance",
"of",
"the",
"rate",
"limits",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/SingleNodeRateLimiterComponent.java#L111-L135 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/ShapeRenderer.java | ShapeRenderer.textureFit | public static final void textureFit(Shape shape, final Image image, final float scaleX, final float scaleY) {
if (!validFill(shape)) {
return;
}
float points[] = shape.getPoints();
Texture t = TextureImpl.getLastBind();
image.getTexture().bind();
... | java | public static final void textureFit(Shape shape, final Image image, final float scaleX, final float scaleY) {
if (!validFill(shape)) {
return;
}
float points[] = shape.getPoints();
Texture t = TextureImpl.getLastBind();
image.getTexture().bind();
... | [
"public",
"static",
"final",
"void",
"textureFit",
"(",
"Shape",
"shape",
",",
"final",
"Image",
"image",
",",
"final",
"float",
"scaleX",
",",
"final",
"float",
"scaleY",
")",
"{",
"if",
"(",
"!",
"validFill",
"(",
"shape",
")",
")",
"{",
"return",
";... | Draw the the given shape filled in with a texture. Only the vertices are set.
The colour has to be set independently of this method. This method is required to
fit the texture scaleX times across the shape and scaleY times down the shape.
@param shape The shape to texture.
@param image The image to tile across the sh... | [
"Draw",
"the",
"the",
"given",
"shape",
"filled",
"in",
"with",
"a",
"texture",
".",
"Only",
"the",
"vertices",
"are",
"set",
".",
"The",
"colour",
"has",
"to",
"be",
"set",
"independently",
"of",
"this",
"method",
".",
"This",
"method",
"is",
"required"... | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/ShapeRenderer.java#L226-L265 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/maxent/LogLinearXYData.java | LogLinearXYData.addExStrFeats | public void addExStrFeats(double weight, Object xObj, Object yObj, List<String>[] fvStrs) {
FeatureVector[] fvs = new FeatureVector[fvStrs.length];
for (int i=0; i<fvs.length; i++) {
fvs[i] = new FeatureVector();
for (String featName : fvStrs[i]) {
fvs[i].add(feat... | java | public void addExStrFeats(double weight, Object xObj, Object yObj, List<String>[] fvStrs) {
FeatureVector[] fvs = new FeatureVector[fvStrs.length];
for (int i=0; i<fvs.length; i++) {
fvs[i] = new FeatureVector();
for (String featName : fvStrs[i]) {
fvs[i].add(feat... | [
"public",
"void",
"addExStrFeats",
"(",
"double",
"weight",
",",
"Object",
"xObj",
",",
"Object",
"yObj",
",",
"List",
"<",
"String",
">",
"[",
"]",
"fvStrs",
")",
"{",
"FeatureVector",
"[",
"]",
"fvs",
"=",
"new",
"FeatureVector",
"[",
"fvStrs",
".",
... | Adds a new log-linear model instance.
@param weight The weight of this example.
@param x The observation, x.
@param y The prediction, y.
@param fvs The binary features on the observations, x, for all possible labels, y'. Indexed by y'. | [
"Adds",
"a",
"new",
"log",
"-",
"linear",
"model",
"instance",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/maxent/LogLinearXYData.java#L112-L121 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java | IOUtil.bufferedWriteWithFlush | public static void bufferedWriteWithFlush(final OutputStream output, final byte[] content) throws IOException {
final int size = 4096;
int offset = 0;
while (content.length - offset > size) {
output.write(content, offset, size);
offset += size;
}
output.wr... | java | public static void bufferedWriteWithFlush(final OutputStream output, final byte[] content) throws IOException {
final int size = 4096;
int offset = 0;
while (content.length - offset > size) {
output.write(content, offset, size);
offset += size;
}
output.wr... | [
"public",
"static",
"void",
"bufferedWriteWithFlush",
"(",
"final",
"OutputStream",
"output",
",",
"final",
"byte",
"[",
"]",
"content",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"4096",
";",
"int",
"offset",
"=",
"0",
";",
"while",
"... | Writing the specified contents to the specified OutputStream using an internal buffer. Flushing the stream when
completed. Caller is responsible for opening and closing the specified stream.
@param output
The OutputStream
@param content
The content to write to the specified stream
@throws IOException
If a problem occu... | [
"Writing",
"the",
"specified",
"contents",
"to",
"the",
"specified",
"OutputStream",
"using",
"an",
"internal",
"buffer",
".",
"Flushing",
"the",
"stream",
"when",
"completed",
".",
"Caller",
"is",
"responsible",
"for",
"opening",
"and",
"closing",
"the",
"speci... | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java#L182-L191 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.mergeCoverages | public static GridCoverage2D mergeCoverages( GridCoverage2D valuesMap, GridCoverage2D onMap ) {
RegionMap valuesRegionMap = getRegionParamsFromGridCoverage(valuesMap);
int cs = valuesRegionMap.getCols();
int rs = valuesRegionMap.getRows();
RegionMap onRegionMap = getRegionParamsFromGridC... | java | public static GridCoverage2D mergeCoverages( GridCoverage2D valuesMap, GridCoverage2D onMap ) {
RegionMap valuesRegionMap = getRegionParamsFromGridCoverage(valuesMap);
int cs = valuesRegionMap.getCols();
int rs = valuesRegionMap.getRows();
RegionMap onRegionMap = getRegionParamsFromGridC... | [
"public",
"static",
"GridCoverage2D",
"mergeCoverages",
"(",
"GridCoverage2D",
"valuesMap",
",",
"GridCoverage2D",
"onMap",
")",
"{",
"RegionMap",
"valuesRegionMap",
"=",
"getRegionParamsFromGridCoverage",
"(",
"valuesMap",
")",
";",
"int",
"cs",
"=",
"valuesRegionMap",... | Coverage merger.
<p>Values from valuesMap are placed into the onMap coverage, if they are valid.</p>
@param valuesMap the map from which to take teh valid values to place in the output map.
@param onMap the base map on which to place the valuesMap values.
@return the merged map of valuesMap over onMap. | [
"Coverage",
"merger",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1408-L1434 |
workplacesystems/queuj | src/main/java/com/workplacesystems/queuj/Resilience.java | Resilience.createRunOnceResilience | public static Resilience createRunOnceResilience(int retry_count, int retry_interval)
{
Resilience resilience = new RunOnlyOnce();
RunFiniteTimes failure_occurrence = new RunFiniteTimes(retry_count);
resilience.setFailureSchedule(failure_occurrence);
for (int i=0 ; i < retry_count ;... | java | public static Resilience createRunOnceResilience(int retry_count, int retry_interval)
{
Resilience resilience = new RunOnlyOnce();
RunFiniteTimes failure_occurrence = new RunFiniteTimes(retry_count);
resilience.setFailureSchedule(failure_occurrence);
for (int i=0 ; i < retry_count ;... | [
"public",
"static",
"Resilience",
"createRunOnceResilience",
"(",
"int",
"retry_count",
",",
"int",
"retry_interval",
")",
"{",
"Resilience",
"resilience",
"=",
"new",
"RunOnlyOnce",
"(",
")",
";",
"RunFiniteTimes",
"failure_occurrence",
"=",
"new",
"RunFiniteTimes",
... | create a simple Resilience object so process can restart - runs once, with retries as parameters | [
"create",
"a",
"simple",
"Resilience",
"object",
"so",
"process",
"can",
"restart",
"-",
"runs",
"once",
"with",
"retries",
"as",
"parameters"
] | train | https://github.com/workplacesystems/queuj/blob/4293116b412b4a20ead99963b9b05a135812c501/src/main/java/com/workplacesystems/queuj/Resilience.java#L57-L71 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/report/config/ConfigOptionBuilder.java | ConfigOptionBuilder.setCommandLineOptionWithArgument | public ConfigOptionBuilder setCommandLineOptionWithArgument( CommandLineOption commandLineOption, StringConverter converter ) {
co.setCommandLineOption( commandLineOption );
return setStringConverter( converter );
} | java | public ConfigOptionBuilder setCommandLineOptionWithArgument( CommandLineOption commandLineOption, StringConverter converter ) {
co.setCommandLineOption( commandLineOption );
return setStringConverter( converter );
} | [
"public",
"ConfigOptionBuilder",
"setCommandLineOptionWithArgument",
"(",
"CommandLineOption",
"commandLineOption",
",",
"StringConverter",
"converter",
")",
"{",
"co",
".",
"setCommandLineOption",
"(",
"commandLineOption",
")",
";",
"return",
"setStringConverter",
"(",
"co... | if you want to parse an argument, you need a converter from String to Object
@param commandLineOption specification of the command line options
@param converter how to convert your String value to a castable Object | [
"if",
"you",
"want",
"to",
"parse",
"an",
"argument",
"you",
"need",
"a",
"converter",
"from",
"String",
"to",
"Object"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/config/ConfigOptionBuilder.java#L30-L33 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.setPlaceholderText | public static <B extends TextBoxBase> B setPlaceholderText (B box, String placeholder)
{
return _formSupport.setPlaceholderText(box, placeholder);
} | java | public static <B extends TextBoxBase> B setPlaceholderText (B box, String placeholder)
{
return _formSupport.setPlaceholderText(box, placeholder);
} | [
"public",
"static",
"<",
"B",
"extends",
"TextBoxBase",
">",
"B",
"setPlaceholderText",
"(",
"B",
"box",
",",
"String",
"placeholder",
")",
"{",
"return",
"_formSupport",
".",
"setPlaceholderText",
"(",
"box",
",",
"placeholder",
")",
";",
"}"
] | Set the placeholder text to use on the specified form field.
This text will be shown when the field is blank and unfocused.
Note: To safely read the text from this TextBox on all browsers, use
getText(TextBoxBase, placeholder). This is because on legacy browsers that don't support
HTML5 form awesomeness, the text will... | [
"Set",
"the",
"placeholder",
"text",
"to",
"use",
"on",
"the",
"specified",
"form",
"field",
".",
"This",
"text",
"will",
"be",
"shown",
"when",
"the",
"field",
"is",
"blank",
"and",
"unfocused",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L337-L340 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.StructArray | public JBBPDslBuilder StructArray(final String name, final String sizeExpression) {
final Item item = new Item(BinType.STRUCT_ARRAY, name, this.byteOrder);
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
this.openedStructCounter++;
return this;
} | java | public JBBPDslBuilder StructArray(final String name, final String sizeExpression) {
final Item item = new Item(BinType.STRUCT_ARRAY, name, this.byteOrder);
item.sizeExpression = assertExpressionChars(sizeExpression);
this.addItem(item);
this.openedStructCounter++;
return this;
} | [
"public",
"JBBPDslBuilder",
"StructArray",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"sizeExpression",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"STRUCT_ARRAY",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
... | Create named structure array which size calculated by expression.
@param name name of the structure array, can be null for anonymous one
@param sizeExpression expression to calculate array length, must not be null.
@return the builder instance, must not be null | [
"Create",
"named",
"structure",
"array",
"which",
"size",
"calculated",
"by",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L377-L383 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/Img.java | Img.fixRectangle | private Rectangle fixRectangle(Rectangle rectangle, int baseWidth, int baseHeight) {
if (this.positionBaseCentre) {
// 修正图片位置从背景的中心计算
rectangle.setLocation(//
rectangle.x + (int) (Math.abs(baseWidth - rectangle.width) / 2), //
rectangle.y + (int) (Math.abs(baseHeight - rectangle.height) / 2)//
... | java | private Rectangle fixRectangle(Rectangle rectangle, int baseWidth, int baseHeight) {
if (this.positionBaseCentre) {
// 修正图片位置从背景的中心计算
rectangle.setLocation(//
rectangle.x + (int) (Math.abs(baseWidth - rectangle.width) / 2), //
rectangle.y + (int) (Math.abs(baseHeight - rectangle.height) / 2)//
... | [
"private",
"Rectangle",
"fixRectangle",
"(",
"Rectangle",
"rectangle",
",",
"int",
"baseWidth",
",",
"int",
"baseHeight",
")",
"{",
"if",
"(",
"this",
".",
"positionBaseCentre",
")",
"{",
"// 修正图片位置从背景的中心计算\r",
"rectangle",
".",
"setLocation",
"(",
"//\r",
"rect... | 修正矩形框位置,如果{@link Img#setPositionFromCentre(boolean)} 设为{@code true},则坐标修正为基于图形中心,否则基于左上角
@param rectangle 矩形
@param baseWidth 参考宽
@param baseHeight 参考高
@return 修正后的{@link Rectangle}
@since 4.1.15 | [
"修正矩形框位置,如果",
"{",
"@link",
"Img#setPositionFromCentre",
"(",
"boolean",
")",
"}",
"设为",
"{",
"@code",
"true",
"}",
",则坐标修正为基于图形中心,否则基于左上角"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/Img.java#L616-L625 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getImage | public BufferedImage getImage (ImageKey key, Colorization[] zations)
{
CacheRecord crec = null;
synchronized (_ccache) {
crec = _ccache.get(key);
}
if (crec != null) {
// log.info("Cache hit", "key", key, "crec", crec);
return crec.getImage(zations... | java | public BufferedImage getImage (ImageKey key, Colorization[] zations)
{
CacheRecord crec = null;
synchronized (_ccache) {
crec = _ccache.get(key);
}
if (crec != null) {
// log.info("Cache hit", "key", key, "crec", crec);
return crec.getImage(zations... | [
"public",
"BufferedImage",
"getImage",
"(",
"ImageKey",
"key",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"CacheRecord",
"crec",
"=",
"null",
";",
"synchronized",
"(",
"_ccache",
")",
"{",
"crec",
"=",
"_ccache",
".",
"get",
"(",
"key",
")",
";"... | Obtains the image identified by the specified key, caching if possible. The image will be
recolored using the supplied colorizations if requested. | [
"Obtains",
"the",
"image",
"identified",
"by",
"the",
"specified",
"key",
"caching",
"if",
"possible",
".",
"The",
"image",
"will",
"be",
"recolored",
"using",
"the",
"supplied",
"colorizations",
"if",
"requested",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L280-L314 |
roboconf/roboconf-platform | miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java | ProjectUtils.completeProjectCreation | private static void completeProjectCreation(
File targetDirectory,
String descriptorContent,
CreationBean creationBean )
throws IOException {
// Create a sample graph file
File f = new File( targetDirectory, Constants.PROJECT_DIR_GRAPH + "/" + GRAPH_EP );
InputStream in = ProjectUtils.class.getResource... | java | private static void completeProjectCreation(
File targetDirectory,
String descriptorContent,
CreationBean creationBean )
throws IOException {
// Create a sample graph file
File f = new File( targetDirectory, Constants.PROJECT_DIR_GRAPH + "/" + GRAPH_EP );
InputStream in = ProjectUtils.class.getResource... | [
"private",
"static",
"void",
"completeProjectCreation",
"(",
"File",
"targetDirectory",
",",
"String",
"descriptorContent",
",",
"CreationBean",
"creationBean",
")",
"throws",
"IOException",
"{",
"// Create a sample graph file",
"File",
"f",
"=",
"new",
"File",
"(",
"... | Completes the creation of a Roboconf project.
@param targetDirectory the directory into which the Roboconf files must be copied
@param descriptorContent the descriptor's content
@param creationBean the creation options
@throws IOException if something went wrong | [
"Completes",
"the",
"creation",
"of",
"a",
"Roboconf",
"project",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-tooling-core/src/main/java/net/roboconf/tooling/core/ProjectUtils.java#L226-L249 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/io/FileUtils.java | FileUtils.changeLocalFilePermission | public static void changeLocalFilePermission(String filePath, String perms) throws IOException {
Files.setPosixFilePermissions(Paths.get(filePath), PosixFilePermissions.fromString(perms));
} | java | public static void changeLocalFilePermission(String filePath, String perms) throws IOException {
Files.setPosixFilePermissions(Paths.get(filePath), PosixFilePermissions.fromString(perms));
} | [
"public",
"static",
"void",
"changeLocalFilePermission",
"(",
"String",
"filePath",
",",
"String",
"perms",
")",
"throws",
"IOException",
"{",
"Files",
".",
"setPosixFilePermissions",
"(",
"Paths",
".",
"get",
"(",
"filePath",
")",
",",
"PosixFilePermissions",
"."... | Changes local file's permission.
@param filePath that will change permission
@param perms the permission, e.g. "rwxr--r--" | [
"Changes",
"local",
"file",
"s",
"permission",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L73-L75 |
greese/dasein-util | src/main/java/org/dasein/util/ConcurrentCache.java | ConcurrentCache.putAll | public void putAll(Map<? extends K, ? extends V> map) {
//synchronized( this ) {
for(K key : map.keySet() ) {
put(key, map.get(key));
}
//}
} | java | public void putAll(Map<? extends K, ? extends V> map) {
//synchronized( this ) {
for(K key : map.keySet() ) {
put(key, map.get(key));
}
//}
} | [
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"map",
")",
"{",
"//synchronized( this ) {",
"for",
"(",
"K",
"key",
":",
"map",
".",
"keySet",
"(",
")",
")",
"{",
"put",
"(",
"key",
",",
"map",
".... | Places all elements in the specified map into this cache.
@param map the map to store in this cache. | [
"Places",
"all",
"elements",
"in",
"the",
"specified",
"map",
"into",
"this",
"cache",
"."
] | train | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentCache.java#L282-L288 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxUploader.java | DbxUploader.uploadAndFinish | public R uploadAndFinish(InputStream in) throws X, DbxException, IOException {
return uploadAndFinish(in, null);
} | java | public R uploadAndFinish(InputStream in) throws X, DbxException, IOException {
return uploadAndFinish(in, null);
} | [
"public",
"R",
"uploadAndFinish",
"(",
"InputStream",
"in",
")",
"throws",
"X",
",",
"DbxException",
",",
"IOException",
"{",
"return",
"uploadAndFinish",
"(",
"in",
",",
"null",
")",
";",
"}"
] | Uploads all bytes read from the given {@link InputStream} and returns the response.
This method manages closing this uploader's resources, so no further calls to {@link #close}
are necessary. The underlying {@code OutputStream} returned by {@link #getOutputStream}
will be closed by this method.
This method is the equ... | [
"Uploads",
"all",
"bytes",
"read",
"from",
"the",
"given",
"{",
"@link",
"InputStream",
"}",
"and",
"returns",
"the",
"response",
"."
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxUploader.java#L95-L97 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.showInstallPrompt | public static boolean showInstallPrompt(@NonNull Activity activity, int requestCode, @NonNull BranchUniversalObject buo) {
if (buo != null) {
String shortUrl = buo.getShortUrl(activity, new LinkProperties());
String installReferrerString = Defines.Jsonkey.ReferringLink.getKey() + "=" + s... | java | public static boolean showInstallPrompt(@NonNull Activity activity, int requestCode, @NonNull BranchUniversalObject buo) {
if (buo != null) {
String shortUrl = buo.getShortUrl(activity, new LinkProperties());
String installReferrerString = Defines.Jsonkey.ReferringLink.getKey() + "=" + s... | [
"public",
"static",
"boolean",
"showInstallPrompt",
"(",
"@",
"NonNull",
"Activity",
"activity",
",",
"int",
"requestCode",
",",
"@",
"NonNull",
"BranchUniversalObject",
"buo",
")",
"{",
"if",
"(",
"buo",
"!=",
"null",
")",
"{",
"String",
"shortUrl",
"=",
"b... | Method shows play store install prompt for the full app. Use this method only if you want the full app to receive a custom {@link BranchUniversalObject} to do deferred deep link.
Please see {@link #showInstallPrompt(Activity, int)}
NOTE :
This method will do a synchronous generation of Branch short link for the BUO. So... | [
"Method",
"shows",
"play",
"store",
"install",
"prompt",
"for",
"the",
"full",
"app",
".",
"Use",
"this",
"method",
"only",
"if",
"you",
"want",
"the",
"full",
"app",
"to",
"receive",
"a",
"custom",
"{",
"@link",
"BranchUniversalObject",
"}",
"to",
"do",
... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L4020-L4031 |
m-m-m/util | scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java | CharSequenceScanner.getReplaced | public String getReplaced(String substitute, int start, int end) {
int restLength = this.limit - end;
StringBuilder builder = builder(null);
builder.append(this.buffer, this.initialOffset, start);
builder.append(substitute);
builder.append(this.buffer, this.initialOffset + end, restLength);
... | java | public String getReplaced(String substitute, int start, int end) {
int restLength = this.limit - end;
StringBuilder builder = builder(null);
builder.append(this.buffer, this.initialOffset, start);
builder.append(substitute);
builder.append(this.buffer, this.initialOffset + end, restLength);
... | [
"public",
"String",
"getReplaced",
"(",
"String",
"substitute",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"restLength",
"=",
"this",
".",
"limit",
"-",
"end",
";",
"StringBuilder",
"builder",
"=",
"builder",
"(",
"null",
")",
";",
"builder... | This method gets the {@link #getOriginalString() original string} where the {@link #substring(int, int)
substring} specified by {@code start} and {@code end} is replaced by {@code substitute}.
@param substitute is the string used as replacement.
@param start is the inclusive start index of the substring to replace.
@p... | [
"This",
"method",
"gets",
"the",
"{",
"@link",
"#getOriginalString",
"()",
"original",
"string",
"}",
"where",
"the",
"{",
"@link",
"#substring",
"(",
"int",
"int",
")",
"substring",
"}",
"specified",
"by",
"{",
"@code",
"start",
"}",
"and",
"{",
"@code",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java#L129-L137 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java | Configuration.createImageUrl | public URL createImageUrl(String imagePath, String requiredSize) throws MovieDbException {
if (!isValidSize(requiredSize)) {
throw new MovieDbException(ApiExceptionType.INVALID_IMAGE, "Required size '" + requiredSize + "' is not valid");
}
StringBuilder sb = new StringBuilder(getBas... | java | public URL createImageUrl(String imagePath, String requiredSize) throws MovieDbException {
if (!isValidSize(requiredSize)) {
throw new MovieDbException(ApiExceptionType.INVALID_IMAGE, "Required size '" + requiredSize + "' is not valid");
}
StringBuilder sb = new StringBuilder(getBas... | [
"public",
"URL",
"createImageUrl",
"(",
"String",
"imagePath",
",",
"String",
"requiredSize",
")",
"throws",
"MovieDbException",
"{",
"if",
"(",
"!",
"isValidSize",
"(",
"requiredSize",
")",
")",
"{",
"throw",
"new",
"MovieDbException",
"(",
"ApiExceptionType",
... | Generate the full image URL from the size and image path
@param imagePath
@param requiredSize
@return
@throws MovieDbException | [
"Generate",
"the",
"full",
"image",
"URL",
"from",
"the",
"size",
"and",
"image",
"path"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L196-L209 |
aws/aws-sdk-java | aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeRobotResult.java | DescribeRobotResult.withTags | public DescribeRobotResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | java | public DescribeRobotResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"DescribeRobotResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The list of all tags added to the specified robot.
</p>
@param tags
The list of all tags added to the specified robot.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"list",
"of",
"all",
"tags",
"added",
"to",
"the",
"specified",
"robot",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeRobotResult.java#L520-L523 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java | KNXAddress.save | public void save(XMLWriter w) throws KNXMLException
{
final List att = new ArrayList();
att.add(new Attribute(ATTR_TYPE, getType()));
w.writeElement(TAG_ADDRESS, att, Integer.toString(address));
w.endElement();
} | java | public void save(XMLWriter w) throws KNXMLException
{
final List att = new ArrayList();
att.add(new Attribute(ATTR_TYPE, getType()));
w.writeElement(TAG_ADDRESS, att, Integer.toString(address));
w.endElement();
} | [
"public",
"void",
"save",
"(",
"XMLWriter",
"w",
")",
"throws",
"KNXMLException",
"{",
"final",
"List",
"att",
"=",
"new",
"ArrayList",
"(",
")",
";",
"att",
".",
"add",
"(",
"new",
"Attribute",
"(",
"ATTR_TYPE",
",",
"getType",
"(",
")",
")",
")",
"... | Writes the KNX address in XML format to the supplied writer.
<p>
@param w a XML writer
@throws KNXMLException on output error | [
"Writes",
"the",
"KNX",
"address",
"in",
"XML",
"format",
"to",
"the",
"supplied",
"writer",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/KNXAddress.java#L224-L230 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java | IconProviderBuilder.withValue | public IconProviderBuilder withValue(Object value, String iconName)
{
return withValue(value, icon(iconName));
} | java | public IconProviderBuilder withValue(Object value, String iconName)
{
return withValue(value, icon(iconName));
} | [
"public",
"IconProviderBuilder",
"withValue",
"(",
"Object",
"value",
",",
"String",
"iconName",
")",
"{",
"return",
"withValue",
"(",
"value",
",",
"icon",
"(",
"iconName",
")",
")",
";",
"}"
] | Sets the {@link Icon} to use for the state value.<br>
{@link #forProperty(IProperty)} must be called before with the corresponding {@link IProperty}.
@param value the value
@param iconName the icon name
@return the icon provider builder | [
"Sets",
"the",
"{",
"@link",
"Icon",
"}",
"to",
"use",
"for",
"the",
"state",
"value",
".",
"<br",
">",
"{",
"@link",
"#forProperty",
"(",
"IProperty",
")",
"}",
"must",
"be",
"called",
"before",
"with",
"the",
"corresponding",
"{",
"@link",
"IProperty",... | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java#L229-L232 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updatePatternAnyEntityModel | public OperationStatus updatePatternAnyEntityModel(UUID appId, String versionId, UUID entityId, PatternAnyModelUpdateObject patternAnyUpdateObject) {
return updatePatternAnyEntityModelWithServiceResponseAsync(appId, versionId, entityId, patternAnyUpdateObject).toBlocking().single().body();
} | java | public OperationStatus updatePatternAnyEntityModel(UUID appId, String versionId, UUID entityId, PatternAnyModelUpdateObject patternAnyUpdateObject) {
return updatePatternAnyEntityModelWithServiceResponseAsync(appId, versionId, entityId, patternAnyUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updatePatternAnyEntityModel",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"PatternAnyModelUpdateObject",
"patternAnyUpdateObject",
")",
"{",
"return",
"updatePatternAnyEntityModelWithServiceResponseAsync",
"(",
... | Updates the name and explicit list of a Pattern.Any entity model.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@param patternAnyUpdateObject An object containing the explicit list of the Pattern.Any entity.
@throws IllegalArgumentException throw... | [
"Updates",
"the",
"name",
"and",
"explicit",
"list",
"of",
"a",
"Pattern",
".",
"Any",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10552-L10554 |
alkacon/opencms-core | src/org/opencms/search/documents/A_CmsVfsDocument.java | A_CmsVfsDocument.logContentExtraction | protected void logContentExtraction(CmsResource resource, I_CmsSearchIndex index) {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_EXTRACT_CONTENT_2,
resource.getRootPath(),
index.getNam... | java | protected void logContentExtraction(CmsResource resource, I_CmsSearchIndex index) {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_EXTRACT_CONTENT_2,
resource.getRootPath(),
index.getNam... | [
"protected",
"void",
"logContentExtraction",
"(",
"CmsResource",
"resource",
",",
"I_CmsSearchIndex",
"index",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"Messages",
".",
"get",
"(",
")",
".",
"getBundl... | Logs content extraction for the specified resource and index.<p>
@param resource the resource to log content extraction for
@param index the search index to log content extraction for | [
"Logs",
"content",
"extraction",
"for",
"the",
"specified",
"resource",
"and",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/A_CmsVfsDocument.java#L228-L237 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java | PMContext.getPair | public ContextPair getPair(String key) {
if (!this.contains(key)) {
return null;
}
return new ContextPair(key, get(key));
} | java | public ContextPair getPair(String key) {
if (!this.contains(key)) {
return null;
}
return new ContextPair(key, get(key));
} | [
"public",
"ContextPair",
"getPair",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"!",
"this",
".",
"contains",
"(",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"ContextPair",
"(",
"key",
",",
"get",
"(",
"key",
")",
")",
";",
... | Obtains a pair based on the given key. In there is no key, this method
returns null
@param key The key
@return the ContextPair for the given key. | [
"Obtains",
"a",
"pair",
"based",
"on",
"the",
"given",
"key",
".",
"In",
"there",
"is",
"no",
"key",
"this",
"method",
"returns",
"null"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PMContext.java#L333-L338 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchParameters.java | CmsSearchParameters.toSeparatedString | private String toSeparatedString(List<String> stringList, char separator) {
StringBuffer result = new StringBuffer();
Iterator<String> it = stringList.iterator();
while (it.hasNext()) {
result.append(it.next());
if (it.hasNext()) {
result.append(separator... | java | private String toSeparatedString(List<String> stringList, char separator) {
StringBuffer result = new StringBuffer();
Iterator<String> it = stringList.iterator();
while (it.hasNext()) {
result.append(it.next());
if (it.hasNext()) {
result.append(separator... | [
"private",
"String",
"toSeparatedString",
"(",
"List",
"<",
"String",
">",
"stringList",
",",
"char",
"separator",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"it",
"=",
"stringList",
".",
... | Concatenates the elements of the string list separated by the given separator character.<p>
@param stringList the list
@param separator the separator
@return the concatenated string | [
"Concatenates",
"the",
"elements",
"of",
"the",
"string",
"list",
"separated",
"by",
"the",
"given",
"separator",
"character",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchParameters.java#L1264-L1275 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.createMessage | protected Message createMessage(ConnectionContext context, BasicMessage basicMessage) throws JMSException {
return createMessage(context, basicMessage, null);
} | java | protected Message createMessage(ConnectionContext context, BasicMessage basicMessage) throws JMSException {
return createMessage(context, basicMessage, null);
} | [
"protected",
"Message",
"createMessage",
"(",
"ConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
")",
"throws",
"JMSException",
"{",
"return",
"createMessage",
"(",
"context",
",",
"basicMessage",
",",
"null",
")",
";",
"}"
] | Same as {@link #createMessage(ConnectionContext, BasicMessage, Map)} with <code>null</code> headers. | [
"Same",
"as",
"{"
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L344-L346 |
EdwardRaff/JSAT | JSAT/src/jsat/clustering/MeanShift.java | MeanShift.setScaleBandwidthFactor | public void setScaleBandwidthFactor(double scaleBandwidthFactor)
{
if(Double.isNaN(scaleBandwidthFactor) || Double.isInfinite(scaleBandwidthFactor))
throw new ArithmeticException("Invalid scale factor, " + scaleBandwidthFactor);
this.scaleBandwidthFactor = scaleBandwidthFactor;
... | java | public void setScaleBandwidthFactor(double scaleBandwidthFactor)
{
if(Double.isNaN(scaleBandwidthFactor) || Double.isInfinite(scaleBandwidthFactor))
throw new ArithmeticException("Invalid scale factor, " + scaleBandwidthFactor);
this.scaleBandwidthFactor = scaleBandwidthFactor;
... | [
"public",
"void",
"setScaleBandwidthFactor",
"(",
"double",
"scaleBandwidthFactor",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"scaleBandwidthFactor",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"scaleBandwidthFactor",
")",
")",
"throw",
"new",
"Arithmetic... | Sets the value by which the bandwidth of the {@link MultivariateKDE} will
be scaled by.
@param scaleBandwidthFactor the value to scale bandwidth by
@throws ArithmeticException if the value given is {@link Double#NaN NaN }
or {@link Double#POSITIVE_INFINITY infinity} | [
"Sets",
"the",
"value",
"by",
"which",
"the",
"bandwidth",
"of",
"the",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/clustering/MeanShift.java#L134-L139 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/client/MetaDataService.java | MetaDataService.addGroupEntities | public boolean addGroupEntities(String entityGroupName, Boolean createEntities, Entity... entities) {
checkEntityGroupIsEmpty(entityGroupName);
List<String> entitiesNames = new ArrayList<>();
for (Entity entity : entities) {
entitiesNames.add(entity.getName());
}
Quer... | java | public boolean addGroupEntities(String entityGroupName, Boolean createEntities, Entity... entities) {
checkEntityGroupIsEmpty(entityGroupName);
List<String> entitiesNames = new ArrayList<>();
for (Entity entity : entities) {
entitiesNames.add(entity.getName());
}
Quer... | [
"public",
"boolean",
"addGroupEntities",
"(",
"String",
"entityGroupName",
",",
"Boolean",
"createEntities",
",",
"Entity",
"...",
"entities",
")",
"{",
"checkEntityGroupIsEmpty",
"(",
"entityGroupName",
")",
";",
"List",
"<",
"String",
">",
"entitiesNames",
"=",
... | Add specified entities to entity group.
@param entityGroupName Entity group name.
@param createEntities Automatically create new entities from the submitted list if such entities don't already exist.
@param entities Entities to create.
@return {@code true} if entities added.
@throws AtsdClientException raised ... | [
"Add",
"specified",
"entities",
"to",
"entity",
"group",
"."
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/client/MetaDataService.java#L508-L519 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/GeometryEngine.java | GeometryEngine.isSimple | static boolean isSimple(Geometry geometry, SpatialReference spatialReference) {
OperatorSimplify op = (OperatorSimplify) factory
.getOperator(Operator.Type.Simplify);
boolean result = op.isSimpleAsFeature(geometry, spatialReference, null);
return result;
} | java | static boolean isSimple(Geometry geometry, SpatialReference spatialReference) {
OperatorSimplify op = (OperatorSimplify) factory
.getOperator(Operator.Type.Simplify);
boolean result = op.isSimpleAsFeature(geometry, spatialReference, null);
return result;
} | [
"static",
"boolean",
"isSimple",
"(",
"Geometry",
"geometry",
",",
"SpatialReference",
"spatialReference",
")",
"{",
"OperatorSimplify",
"op",
"=",
"(",
"OperatorSimplify",
")",
"factory",
".",
"getOperator",
"(",
"Operator",
".",
"Type",
".",
"Simplify",
")",
"... | Checks if the Geometry is simple.
See OperatorSimplify.
@param geometry
The geometry to be checked.
@param spatialReference
The spatial reference of the geometry.
@return TRUE if the geometry is simple. | [
"Checks",
"if",
"the",
"Geometry",
"is",
"simple",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/GeometryEngine.java#L890-L895 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.anySatisfy | @Deprecated
public static boolean anySatisfy(String string, CharPredicate predicate)
{
return StringIterate.anySatisfyChar(string, predicate);
} | java | @Deprecated
public static boolean anySatisfy(String string, CharPredicate predicate)
{
return StringIterate.anySatisfyChar(string, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"anySatisfy",
"(",
"String",
"string",
",",
"CharPredicate",
"predicate",
")",
"{",
"return",
"StringIterate",
".",
"anySatisfyChar",
"(",
"string",
",",
"predicate",
")",
";",
"}"
] | @return true if any of the characters in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #anySatisfyChar(String, CharPredicate)} instead. | [
"@return",
"true",
"if",
"any",
"of",
"the",
"characters",
"in",
"the",
"{",
"@code",
"string",
"}",
"answer",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L791-L795 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRGraph.java | CDKRGraph.buildB | private BitSet buildB(BitSet sourceBitSet, BitSet targetBitSet) throws CDKException {
this.setSourceBitSet(sourceBitSet);
this.setTargetBitSet(targetBitSet);
BitSet bistSet = new BitSet();
// only nodes that fulfill the initial constrains
// are allowed in the initial extension... | java | private BitSet buildB(BitSet sourceBitSet, BitSet targetBitSet) throws CDKException {
this.setSourceBitSet(sourceBitSet);
this.setTargetBitSet(targetBitSet);
BitSet bistSet = new BitSet();
// only nodes that fulfill the initial constrains
// are allowed in the initial extension... | [
"private",
"BitSet",
"buildB",
"(",
"BitSet",
"sourceBitSet",
",",
"BitSet",
"targetBitSet",
")",
"throws",
"CDKException",
"{",
"this",
".",
"setSourceBitSet",
"(",
"sourceBitSet",
")",
";",
"this",
".",
"setTargetBitSet",
"(",
"targetBitSet",
")",
";",
"BitSet... | Builds the initial extension set. This is the
set of node that may be used as seed for the
CDKRGraph parsing. This set depends on the constrains
defined by the user.
@param sourceBitSet constraint in the graph G1
@param targetBitSet constraint in the graph G2
@return | [
"Builds",
"the",
"initial",
"extension",
"set",
".",
"This",
"is",
"the",
"set",
"of",
"node",
"that",
"may",
"be",
"used",
"as",
"seed",
"for",
"the",
"CDKRGraph",
"parsing",
".",
"This",
"set",
"depends",
"on",
"the",
"constrains",
"defined",
"by",
"th... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRGraph.java#L426-L445 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java | DatabaseClientFactory.newClient | @Deprecated
static public DatabaseClient newClient(String host, int port, String database, String user, String password, Authentication type, SSLContext context, SSLHostnameVerifier verifier) {
return newClient(host, port, database, makeSecurityContext(user, password, type, context, verifier), null);
} | java | @Deprecated
static public DatabaseClient newClient(String host, int port, String database, String user, String password, Authentication type, SSLContext context, SSLHostnameVerifier verifier) {
return newClient(host, port, database, makeSecurityContext(user, password, type, context, verifier), null);
} | [
"@",
"Deprecated",
"static",
"public",
"DatabaseClient",
"newClient",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"database",
",",
"String",
"user",
",",
"String",
"password",
",",
"Authentication",
"type",
",",
"SSLContext",
"context",
",",
"SSL... | Creates a client to access the database by means of a REST server.
The CallManager interface can only call an endpoint for the configured content database
of the appserver. You cannot specify the database when constructing a client for working
with a CallManager.
@param host the host with the REST server
@param port ... | [
"Creates",
"a",
"client",
"to",
"access",
"the",
"database",
"by",
"means",
"of",
"a",
"REST",
"server",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java#L1364-L1367 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java | Vector.removeRange | protected synchronized void removeRange(int fromIndex, int toIndex) {
modCount++;
int numMoved = elementCount - toIndex;
System.arraycopy(elementData, toIndex, elementData, fromIndex,
numMoved);
// Let gc do its work
int newElementCount = elementCount - ... | java | protected synchronized void removeRange(int fromIndex, int toIndex) {
modCount++;
int numMoved = elementCount - toIndex;
System.arraycopy(elementData, toIndex, elementData, fromIndex,
numMoved);
// Let gc do its work
int newElementCount = elementCount - ... | [
"protected",
"synchronized",
"void",
"removeRange",
"(",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"modCount",
"++",
";",
"int",
"numMoved",
"=",
"elementCount",
"-",
"toIndex",
";",
"System",
".",
"arraycopy",
"(",
"elementData",
",",
"toIndex",
... | Removes from this list all of the elements whose index is between
{@code fromIndex}, inclusive, and {@code toIndex}, exclusive.
Shifts any succeeding elements to the left (reduces their index).
This call shortens the list by {@code (toIndex - fromIndex)} elements.
(If {@code toIndex==fromIndex}, this operation has no e... | [
"Removes",
"from",
"this",
"list",
"all",
"of",
"the",
"elements",
"whose",
"index",
"is",
"between",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java#L1049-L1059 |
ansell/restlet-utils | src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java | FixedRedirectCookieAuthenticator.authenticate | @Override
protected boolean authenticate(final Request request, final Response response)
{
// Restore credentials from the cookie
final Cookie credentialsCookie = request.getCookies().getFirst(this.getCookieName());
if(credentialsCookie != null)
{
ChallengeRe... | java | @Override
protected boolean authenticate(final Request request, final Response response)
{
// Restore credentials from the cookie
final Cookie credentialsCookie = request.getCookies().getFirst(this.getCookieName());
if(credentialsCookie != null)
{
ChallengeRe... | [
"@",
"Override",
"protected",
"boolean",
"authenticate",
"(",
"final",
"Request",
"request",
",",
"final",
"Response",
"response",
")",
"{",
"// Restore credentials from the cookie",
"final",
"Cookie",
"credentialsCookie",
"=",
"request",
".",
"getCookies",
"(",
")",
... | Restores credentials from the cookie named {@link #getCookieName()} if available. The usual
processing is the followed. | [
"Restores",
"credentials",
"from",
"the",
"cookie",
"named",
"{"
] | train | https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java#L230-L251 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.notifyChildRangeInserted | @UiThread
public void notifyChildRangeInserted(int parentPosition, int childPositionStart, int itemCount) {
int flatParentPosition = getFlatParentPosition(parentPosition);
ExpandableWrapper<P, C> parentWrapper = mFlatItemList.get(flatParentPosition);
parentWrapper.setParent(mParentList.get(... | java | @UiThread
public void notifyChildRangeInserted(int parentPosition, int childPositionStart, int itemCount) {
int flatParentPosition = getFlatParentPosition(parentPosition);
ExpandableWrapper<P, C> parentWrapper = mFlatItemList.get(flatParentPosition);
parentWrapper.setParent(mParentList.get(... | [
"@",
"UiThread",
"public",
"void",
"notifyChildRangeInserted",
"(",
"int",
"parentPosition",
",",
"int",
"childPositionStart",
",",
"int",
"itemCount",
")",
"{",
"int",
"flatParentPosition",
"=",
"getFlatParentPosition",
"(",
"parentPosition",
")",
";",
"ExpandableWra... | Notify any registered observers that the parent reflected at {@code parentPosition}
has {@code itemCount} child list items that have been newly inserted at {@code childPositionStart}.
The child list item previously at {@code childPositionStart} and beyond are now at
position {@code childPositionStart + itemCount}.
<p>
... | [
"Notify",
"any",
"registered",
"observers",
"that",
"the",
"parent",
"reflected",
"at",
"{",
"@code",
"parentPosition",
"}",
"has",
"{",
"@code",
"itemCount",
"}",
"child",
"list",
"items",
"that",
"have",
"been",
"newly",
"inserted",
"at",
"{",
"@code",
"ch... | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L1157-L1171 |
xm-online/xm-commons | xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/service/PermissionCheckService.java | PermissionCheckService.hasPermission | public boolean hasPermission(Authentication authentication,
Object resource,
Object privilege) {
boolean logPermission = isLogPermission(resource);
return checkRole(authentication, privilege, logPermission)
|| checkPermission(... | java | public boolean hasPermission(Authentication authentication,
Object resource,
Object privilege) {
boolean logPermission = isLogPermission(resource);
return checkRole(authentication, privilege, logPermission)
|| checkPermission(... | [
"public",
"boolean",
"hasPermission",
"(",
"Authentication",
"authentication",
",",
"Object",
"resource",
",",
"Object",
"privilege",
")",
"{",
"boolean",
"logPermission",
"=",
"isLogPermission",
"(",
"resource",
")",
";",
"return",
"checkRole",
"(",
"authentication... | Check permission for role, privilege key and resource condition.
@param authentication the authentication
@param resource the resource
@param privilege the privilege key
@return true if permitted | [
"Check",
"permission",
"for",
"role",
"privilege",
"key",
"and",
"resource",
"condition",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/service/PermissionCheckService.java#L68-L74 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java | Operators.resolveBinary | OperatorSymbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) {
return resolve(tag,
binaryOperators,
binop -> binop.test(op1, op2),
binop -> binop.resolve(op1, op2),
() -> reportErrorIfNeeded(pos, tag, op1, op2));
} | java | OperatorSymbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) {
return resolve(tag,
binaryOperators,
binop -> binop.test(op1, op2),
binop -> binop.resolve(op1, op2),
() -> reportErrorIfNeeded(pos, tag, op1, op2));
} | [
"OperatorSymbol",
"resolveBinary",
"(",
"DiagnosticPosition",
"pos",
",",
"JCTree",
".",
"Tag",
"tag",
",",
"Type",
"op1",
",",
"Type",
"op2",
")",
"{",
"return",
"resolve",
"(",
"tag",
",",
"binaryOperators",
",",
"binop",
"->",
"binop",
".",
"test",
"(",... | Entry point for resolving a binary operator given an operator tag and a pair of argument types. | [
"Entry",
"point",
"for",
"resolving",
"a",
"binary",
"operator",
"given",
"an",
"operator",
"tag",
"and",
"a",
"pair",
"of",
"argument",
"types",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java#L160-L166 |
primefaces/primefaces | src/main/java/org/primefaces/component/organigram/OrganigramHelper.java | OrganigramHelper.findTreeNode | public static OrganigramNode findTreeNode(OrganigramNode searchRoot, OrganigramNode selection) {
if (selection == null || searchRoot == null) {
return null;
}
if (searchRoot.equals(selection)) {
return searchRoot;
}
if (searchRoot.getChildren() != null) ... | java | public static OrganigramNode findTreeNode(OrganigramNode searchRoot, OrganigramNode selection) {
if (selection == null || searchRoot == null) {
return null;
}
if (searchRoot.equals(selection)) {
return searchRoot;
}
if (searchRoot.getChildren() != null) ... | [
"public",
"static",
"OrganigramNode",
"findTreeNode",
"(",
"OrganigramNode",
"searchRoot",
",",
"OrganigramNode",
"selection",
")",
"{",
"if",
"(",
"selection",
"==",
"null",
"||",
"searchRoot",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
... | Finds a {@link OrganigramNode} for the given selection.
@param searchRoot The {@link OrganigramNode} to start the search.
@param selection The selection.
@return The {@link OrganigramNode} for the selection or <code>null</code>. | [
"Finds",
"a",
"{",
"@link",
"OrganigramNode",
"}",
"for",
"the",
"given",
"selection",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/organigram/OrganigramHelper.java#L72-L91 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/QueryStatisticsInner.java | QueryStatisticsInner.listByQueryAsync | public Observable<List<QueryStatisticInner>> listByQueryAsync(String resourceGroupName, String serverName, String databaseName, String queryId) {
return listByQueryWithServiceResponseAsync(resourceGroupName, serverName, databaseName, queryId).map(new Func1<ServiceResponse<List<QueryStatisticInner>>, List<QueryS... | java | public Observable<List<QueryStatisticInner>> listByQueryAsync(String resourceGroupName, String serverName, String databaseName, String queryId) {
return listByQueryWithServiceResponseAsync(resourceGroupName, serverName, databaseName, queryId).map(new Func1<ServiceResponse<List<QueryStatisticInner>>, List<QueryS... | [
"public",
"Observable",
"<",
"List",
"<",
"QueryStatisticInner",
">",
">",
"listByQueryAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"queryId",
")",
"{",
"return",
"listByQueryWithServiceResponse... | Lists a query's statistics.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param queryId The id of the query
@throws... | [
"Lists",
"a",
"query",
"s",
"statistics",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/QueryStatisticsInner.java#L102-L109 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/ocnn/OCNNOutputLayer.java | OCNNOutputLayer.computeScore | @Override
public double computeScore(double fullNetRegTerm, boolean training, LayerWorkspaceMgr workspaceMgr) {
if (input == null)
throw new IllegalStateException("Cannot calculate score without input and labels " + layerId());
INDArray preOut = preOutput2d(training, workspaceMgr);
... | java | @Override
public double computeScore(double fullNetRegTerm, boolean training, LayerWorkspaceMgr workspaceMgr) {
if (input == null)
throw new IllegalStateException("Cannot calculate score without input and labels " + layerId());
INDArray preOut = preOutput2d(training, workspaceMgr);
... | [
"@",
"Override",
"public",
"double",
"computeScore",
"(",
"double",
"fullNetRegTerm",
",",
"boolean",
"training",
",",
"LayerWorkspaceMgr",
"workspaceMgr",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot cal... | Compute score after labels and input have been set.
@param fullNetRegTerm Regularization score term for the entire network
@param training whether score should be calculated at train or test time (this affects things like application of
dropout, etc)
@return score (loss function) | [
"Compute",
"score",
"after",
"labels",
"and",
"input",
"have",
"been",
"set",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/ocnn/OCNNOutputLayer.java#L86-L102 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.resumeAsync | public Observable<Void> resumeAsync(String resourceGroupName, String serverName, String databaseName) {
return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> respo... | java | public Observable<Void> resumeAsync(String resourceGroupName, String serverName, String databaseName) {
return resumeWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> respo... | [
"public",
"Observable",
"<",
"Void",
">",
"resumeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"resumeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"databaseNa... | Resumes a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the data warehouse to resume.
@throws IllegalArgumentExcep... | [
"Resumes",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L364-L371 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_staticIP_GET | public ArrayList<String> dedicated_server_serviceName_staticIP_GET(String serviceName, OvhIpStaticCountryEnum country) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/staticIP";
StringBuilder sb = path(qPath, serviceName);
query(sb, "country", country);
String resp = exec(qPath, "GET"... | java | public ArrayList<String> dedicated_server_serviceName_staticIP_GET(String serviceName, OvhIpStaticCountryEnum country) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/staticIP";
StringBuilder sb = path(qPath, serviceName);
query(sb, "country", country);
String resp = exec(qPath, "GET"... | [
"public",
"ArrayList",
"<",
"String",
">",
"dedicated_server_serviceName_staticIP_GET",
"(",
"String",
"serviceName",
",",
"OvhIpStaticCountryEnum",
"country",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicated/server/{serviceName}/staticIP\"",
";"... | Get allowed durations for 'staticIP' option
REST: GET /order/dedicated/server/{serviceName}/staticIP
@param country [required] Ip localization
@param serviceName [required] The internal name of your dedicated server | [
"Get",
"allowed",
"durations",
"for",
"staticIP",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2322-L2328 |
canoo/dolphin-platform | platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/Assert.java | Assert.requireNonBlank | public static String requireNonBlank(final String str, final String argumentName) {
requireNonNull(str, argumentName);
if (isBlank(str)) {
throw new IllegalArgumentException(String.format(NOT_EMPTY_MSG_FORMAT, argumentName));
}
return str;
} | java | public static String requireNonBlank(final String str, final String argumentName) {
requireNonNull(str, argumentName);
if (isBlank(str)) {
throw new IllegalArgumentException(String.format(NOT_EMPTY_MSG_FORMAT, argumentName));
}
return str;
} | [
"public",
"static",
"String",
"requireNonBlank",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"argumentName",
")",
"{",
"requireNonNull",
"(",
"str",
",",
"argumentName",
")",
";",
"if",
"(",
"isBlank",
"(",
"str",
")",
")",
"{",
"throw",
"new",
... | Checks that the specified {@code str} {@code blank}, throws {@link IllegalArgumentException} with a customized error message if it is.
@param str the value to be checked.
@param argumentName the name of the argument to be used in the error message.
@return the {@code str}.
@throws java.lang.NullPointerExcepti... | [
"Checks",
"that",
"the",
"specified",
"{",
"@code",
"str",
"}",
"{",
"@code",
"blank",
"}",
"throws",
"{",
"@link",
"IllegalArgumentException",
"}",
"with",
"a",
"customized",
"error",
"message",
"if",
"it",
"is",
"."
] | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/Assert.java#L65-L71 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/NullAway.java | NullAway.checkOverriding | private Description checkOverriding(
Symbol.MethodSymbol overriddenMethod,
Symbol.MethodSymbol overridingMethod,
@Nullable MemberReferenceTree memberReferenceTree,
VisitorState state) {
final boolean isOverridenMethodUnannotated =
NullabilityUtil.isUnannotated(overriddenMethod, confi... | java | private Description checkOverriding(
Symbol.MethodSymbol overriddenMethod,
Symbol.MethodSymbol overridingMethod,
@Nullable MemberReferenceTree memberReferenceTree,
VisitorState state) {
final boolean isOverridenMethodUnannotated =
NullabilityUtil.isUnannotated(overriddenMethod, confi... | [
"private",
"Description",
"checkOverriding",
"(",
"Symbol",
".",
"MethodSymbol",
"overriddenMethod",
",",
"Symbol",
".",
"MethodSymbol",
"overridingMethod",
",",
"@",
"Nullable",
"MemberReferenceTree",
"memberReferenceTree",
",",
"VisitorState",
"state",
")",
"{",
"fina... | check that nullability annotations of an overriding method are consistent with those in the
overridden method (both return and parameters)
@param overriddenMethod method being overridden
@param overridingMethod overriding method
@param memberReferenceTree if override is via a method reference, the relevant {@link
Memb... | [
"check",
"that",
"nullability",
"annotations",
"of",
"an",
"overriding",
"method",
"are",
"consistent",
"with",
"those",
"in",
"the",
"overridden",
"method",
"(",
"both",
"return",
"and",
"parameters",
")"
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/NullAway.java#L716-L764 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllProcedureArguments | public void forAllProcedureArguments(String template, Properties attributes) throws XDocletException
{
String argNameList = _curProcedureDef.getProperty(PropertyHelper.OJB_PROPERTY_ARGUMENTS);
for (CommaListIterator it = new CommaListIterator(argNameList); it.hasNext();)
{
... | java | public void forAllProcedureArguments(String template, Properties attributes) throws XDocletException
{
String argNameList = _curProcedureDef.getProperty(PropertyHelper.OJB_PROPERTY_ARGUMENTS);
for (CommaListIterator it = new CommaListIterator(argNameList); it.hasNext();)
{
... | [
"public",
"void",
"forAllProcedureArguments",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"String",
"argNameList",
"=",
"_curProcedureDef",
".",
"getProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_ARGUMENTS",
... | Processes the template for all procedure arguments of the current procedure.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"all",
"procedure",
"arguments",
"of",
"the",
"current",
"procedure",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L624-L634 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java | TemplateElasticsearchUpdater.createTemplateWithJsonInElasticsearch | private static void createTemplateWithJsonInElasticsearch(RestClient client, String template, String json) throws Exception {
logger.trace("createTemplate([{}])", template);
assert client != null;
assert template != null;
Request request = new Request("PUT", "/_template/" + template);
request.setJsonEntity(... | java | private static void createTemplateWithJsonInElasticsearch(RestClient client, String template, String json) throws Exception {
logger.trace("createTemplate([{}])", template);
assert client != null;
assert template != null;
Request request = new Request("PUT", "/_template/" + template);
request.setJsonEntity(... | [
"private",
"static",
"void",
"createTemplateWithJsonInElasticsearch",
"(",
"RestClient",
"client",
",",
"String",
"template",
",",
"String",
"json",
")",
"throws",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"createTemplate([{}])\"",
",",
"template",
")",
";",
... | Create a new index in Elasticsearch
@param client Elasticsearch client
@param template Template name
@param json JSon content for the template
@throws Exception if something goes wrong | [
"Create",
"a",
"new",
"index",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/template/TemplateElasticsearchUpdater.java#L205-L221 |
alkacon/opencms-core | src/org/opencms/workplace/tools/CmsIdentifiableObjectContainer.java | CmsIdentifiableObjectContainer.addIdentifiableObject | public void addIdentifiableObject(String id, T idObject) {
m_cache = null;
if (m_uniqueIds && (m_objectsById.get(id) != null)) {
removeObject(id);
}
if (m_relativeOrdered) {
float pos = 1;
if (!m_orderedObjectList.isEmpty()) {
pos = m_... | java | public void addIdentifiableObject(String id, T idObject) {
m_cache = null;
if (m_uniqueIds && (m_objectsById.get(id) != null)) {
removeObject(id);
}
if (m_relativeOrdered) {
float pos = 1;
if (!m_orderedObjectList.isEmpty()) {
pos = m_... | [
"public",
"void",
"addIdentifiableObject",
"(",
"String",
"id",
",",
"T",
"idObject",
")",
"{",
"m_cache",
"=",
"null",
";",
"if",
"(",
"m_uniqueIds",
"&&",
"(",
"m_objectsById",
".",
"get",
"(",
"id",
")",
"!=",
"null",
")",
")",
"{",
"removeObject",
... | Appends the specified object to the end of this container. <p>
@param id the object identifier
@param idObject the object add to the container
@see java.util.List#add(Object) | [
"Appends",
"the",
"specified",
"object",
"to",
"the",
"end",
"of",
"this",
"container",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsIdentifiableObjectContainer.java#L139-L167 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/utils/ESResponseWrapper.java | ESResponseWrapper.onId | private Object onId(Object key, Attribute attribute, Object fieldValue)
{
if (SingularAttribute.class.isAssignableFrom(attribute.getClass()) && ((SingularAttribute) attribute).isId())
{
key = fieldValue;
}
return key;
} | java | private Object onId(Object key, Attribute attribute, Object fieldValue)
{
if (SingularAttribute.class.isAssignableFrom(attribute.getClass()) && ((SingularAttribute) attribute).isId())
{
key = fieldValue;
}
return key;
} | [
"private",
"Object",
"onId",
"(",
"Object",
"key",
",",
"Attribute",
"attribute",
",",
"Object",
"fieldValue",
")",
"{",
"if",
"(",
"SingularAttribute",
".",
"class",
".",
"isAssignableFrom",
"(",
"attribute",
".",
"getClass",
"(",
")",
")",
"&&",
"(",
"("... | On id.
@param key
the key
@param attribute
the attribute
@param fieldValue
the field value
@return the object | [
"On",
"id",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/utils/ESResponseWrapper.java#L715-L722 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/PELoader.java | PELoader.loadSectionTable | private SectionTable loadSectionTable(PESignature pesig,
COFFFileHeader coff, RandomAccessFile raf) throws IOException {
// offset is the start of the optional header + SizeOfOptionalHeader
long offset = pesig.getOffset() + PESignature.PE_SIG.length
+ COFFFileHeader.HEADER_SI... | java | private SectionTable loadSectionTable(PESignature pesig,
COFFFileHeader coff, RandomAccessFile raf) throws IOException {
// offset is the start of the optional header + SizeOfOptionalHeader
long offset = pesig.getOffset() + PESignature.PE_SIG.length
+ COFFFileHeader.HEADER_SI... | [
"private",
"SectionTable",
"loadSectionTable",
"(",
"PESignature",
"pesig",
",",
"COFFFileHeader",
"coff",
",",
"RandomAccessFile",
"raf",
")",
"throws",
"IOException",
"{",
"// offset is the start of the optional header + SizeOfOptionalHeader",
"long",
"offset",
"=",
"pesig"... | Loads the section table. Presumes a valid PE file.
@param pesig
pe signature
@param coff
coff file header
@param raf
the random access file instance
@return section table
@throws IOException
if unable to read header | [
"Loads",
"the",
"section",
"table",
".",
"Presumes",
"a",
"valid",
"PE",
"file",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/PELoader.java#L207-L227 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/BridgeMethodResolver.java | BridgeMethodResolver.isBridgeMethodFor | static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Map<TypeVariable, Type> typeVariableMap) {
if (isResolvedTypeMatch(candidateMethod, bridgeMethod, typeVariableMap)) {
return true;
}
Method method = findGenericDeclaration(bridgeMethod);
return (method != null && isResolvedTypeMatc... | java | static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Map<TypeVariable, Type> typeVariableMap) {
if (isResolvedTypeMatch(candidateMethod, bridgeMethod, typeVariableMap)) {
return true;
}
Method method = findGenericDeclaration(bridgeMethod);
return (method != null && isResolvedTypeMatc... | [
"static",
"boolean",
"isBridgeMethodFor",
"(",
"Method",
"bridgeMethod",
",",
"Method",
"candidateMethod",
",",
"Map",
"<",
"TypeVariable",
",",
"Type",
">",
"typeVariableMap",
")",
"{",
"if",
"(",
"isResolvedTypeMatch",
"(",
"candidateMethod",
",",
"bridgeMethod",
... | Determines whether or not the bridge {@link Method} is the bridge for the
supplied candidate {@link Method}. | [
"Determines",
"whether",
"or",
"not",
"the",
"bridge",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/BridgeMethodResolver.java#L131-L137 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_antiSpams_ip_evidences_GET | public OvhEvidencesInfo serviceName_antiSpams_ip_evidences_GET(String serviceName, String ip) throws IOException {
String qPath = "/xdsl/{serviceName}/antiSpams/{ip}/evidences";
StringBuilder sb = path(qPath, serviceName, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhEvid... | java | public OvhEvidencesInfo serviceName_antiSpams_ip_evidences_GET(String serviceName, String ip) throws IOException {
String qPath = "/xdsl/{serviceName}/antiSpams/{ip}/evidences";
StringBuilder sb = path(qPath, serviceName, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhEvid... | [
"public",
"OvhEvidencesInfo",
"serviceName_antiSpams_ip_evidences_GET",
"(",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/antiSpams/{ip}/evidences\"",
";",
"StringBuilder",
"sb",
"=",
"path",... | List of evidences stored on PCS for this ip
REST: GET /xdsl/{serviceName}/antiSpams/{ip}/evidences
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] IP which spam | [
"List",
"of",
"evidences",
"stored",
"on",
"PCS",
"for",
"this",
"ip"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1534-L1539 |
finmath/finmath-lib | src/main/java/net/finmath/functions/LinearAlgebra.java | LinearAlgebra.solveLinearEquationLeastSquare | public static double[][] solveLinearEquationLeastSquare(double[][] matrix, double[][] rhs) {
// We use the linear algebra package apache commons math
DecompositionSolver solver = new SingularValueDecomposition(new Array2DRowRealMatrix(matrix, false)).getSolver();
return solver.solve(new Array2DRowRealMatrix(rhs))... | java | public static double[][] solveLinearEquationLeastSquare(double[][] matrix, double[][] rhs) {
// We use the linear algebra package apache commons math
DecompositionSolver solver = new SingularValueDecomposition(new Array2DRowRealMatrix(matrix, false)).getSolver();
return solver.solve(new Array2DRowRealMatrix(rhs))... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"solveLinearEquationLeastSquare",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"double",
"[",
"]",
"[",
"]",
"rhs",
")",
"{",
"// We use the linear algebra package apache commons math",
"DecompositionSolver",
... | Find a solution of the linear equation A X = B in the least square sense where
<ul>
<li>A is an n x m - matrix given as double[n][m]</li>
<li>B is an m x k - matrix given as double[m][k],</li>
<li>X is an n x k - matrix given as double[n][k],</li>
</ul>
@param matrix The matrix A (left hand side of the linear equation... | [
"Find",
"a",
"solution",
"of",
"the",
"linear",
"equation",
"A",
"X",
"=",
"B",
"in",
"the",
"least",
"square",
"sense",
"where",
"<ul",
">",
"<li",
">",
"A",
"is",
"an",
"n",
"x",
"m",
"-",
"matrix",
"given",
"as",
"double",
"[",
"n",
"]",
"[",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/functions/LinearAlgebra.java#L339-L343 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java | AbstractSelectCodeGenerator.generateMethodSignature | protected void generateMethodSignature(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, TypeName returnTypeName, ParameterSpec... additionalParameterSpec) {
boolean finalParameter = false;
if (method.hasLiveData() && returnTypeName.equals(method.liveDataReturnClass)) {
finalParameter = true;
}
//... | java | protected void generateMethodSignature(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, TypeName returnTypeName, ParameterSpec... additionalParameterSpec) {
boolean finalParameter = false;
if (method.hasLiveData() && returnTypeName.equals(method.liveDataReturnClass)) {
finalParameter = true;
}
//... | [
"protected",
"void",
"generateMethodSignature",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"TypeName",
"returnTypeName",
",",
"ParameterSpec",
"...",
"additionalParameterSpec",
")",
"{",
"boolean",
"finalParameter",
"=",
... | Generate method signature.
@param method
the method
@param methodBuilder
the method builder
@param returnTypeName
the return type name
@param additionalParameterSpec
the additional parameter spec | [
"Generate",
"method",
"signature",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L724-L748 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchemaInterpreterImpl.java | JSchemaInterpreterImpl.getMessageMap | static public synchronized MessageMap getMessageMap(JSchema sfs, BigInteger code) {
// This method must be synchronized since some of the work done when constructing
// a new MessageMap is not thread safe.
MessageMapTable maps = (MessageMapTable)sfs.getInterpreterCache(JMFRegistry.JMF_ENCODING_VERSION);
... | java | static public synchronized MessageMap getMessageMap(JSchema sfs, BigInteger code) {
// This method must be synchronized since some of the work done when constructing
// a new MessageMap is not thread safe.
MessageMapTable maps = (MessageMapTable)sfs.getInterpreterCache(JMFRegistry.JMF_ENCODING_VERSION);
... | [
"static",
"public",
"synchronized",
"MessageMap",
"getMessageMap",
"(",
"JSchema",
"sfs",
",",
"BigInteger",
"code",
")",
"{",
"// This method must be synchronized since some of the work done when constructing",
"// a new MessageMap is not thread safe.",
"MessageMapTable",
"maps",
... | Method to retrieve (and possibly construct) the MessageMap for a particular
multiChoice code | [
"Method",
"to",
"retrieve",
"(",
"and",
"possibly",
"construct",
")",
"the",
"MessageMap",
"for",
"a",
"particular",
"multiChoice",
"code"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchemaInterpreterImpl.java#L114-L127 |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/Keys.java | Keys.canUseStrongKeys | public static boolean canUseStrongKeys() {
try {
int maxKeyLen = Cipher.getMaxAllowedKeyLength(Crypto.CIPHER_ALGORITHM);
return maxKeyLen > 128;
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("Algorithm unavailable: " + Crypto.CIPHER_ALGOR... | java | public static boolean canUseStrongKeys() {
try {
int maxKeyLen = Cipher.getMaxAllowedKeyLength(Crypto.CIPHER_ALGORITHM);
return maxKeyLen > 128;
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("Algorithm unavailable: " + Crypto.CIPHER_ALGOR... | [
"public",
"static",
"boolean",
"canUseStrongKeys",
"(",
")",
"{",
"try",
"{",
"int",
"maxKeyLen",
"=",
"Cipher",
".",
"getMaxAllowedKeyLength",
"(",
"Crypto",
".",
"CIPHER_ALGORITHM",
")",
";",
"return",
"maxKeyLen",
">",
"128",
";",
"}",
"catch",
"(",
"NoSu... | Tests whether the
"Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files" is
correctly installed.
@return If strong keys can be used, true, otherwise false. | [
"Tests",
"whether",
"the",
"Java",
"Cryptography",
"Extension",
"(",
"JCE",
")",
"Unlimited",
"Strength",
"Jurisdiction",
"Policy",
"Files",
"is",
"correctly",
"installed",
"."
] | train | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/Keys.java#L277-L284 |
stanfy/goro | goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java | GoroService.taskIntent | public static <T extends Callable<?> & Parcelable> Intent taskIntent(final Context context,
final String queueName,
final T task) {
// XXX http://code.google.com/p/android/is... | java | public static <T extends Callable<?> & Parcelable> Intent taskIntent(final Context context,
final String queueName,
final T task) {
// XXX http://code.google.com/p/android/is... | [
"public",
"static",
"<",
"T",
"extends",
"Callable",
"<",
"?",
">",
"&",
"Parcelable",
">",
"Intent",
"taskIntent",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"queueName",
",",
"final",
"T",
"task",
")",
"{",
"// XXX http://code.google.com/p/a... | Create an intent that contains a task that should be scheduled
on a defined queue.
Intent can be used as an argument for
{@link android.content.Context#startService(android.content.Intent)}.
@param context context instance
@param task task instance
@param queueName queue name
@param <T> task type | [
"Create",
"an",
"intent",
"that",
"contains",
"a",
"task",
"that",
"should",
"be",
"scheduled",
"on",
"a",
"defined",
"queue",
".",
"Intent",
"can",
"be",
"used",
"as",
"an",
"argument",
"for",
"{",
"@link",
"android",
".",
"content",
".",
"Context#startSe... | train | https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java#L178-L187 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentScansInner.java | DatabaseVulnerabilityAssessmentScansInner.exportAsync | public Observable<DatabaseVulnerabilityAssessmentScansExportInner> exportAsync(String resourceGroupName, String serverName, String databaseName, String scanId) {
return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, scanId).map(new Func1<ServiceResponse<DatabaseVulnerabilityAssessme... | java | public Observable<DatabaseVulnerabilityAssessmentScansExportInner> exportAsync(String resourceGroupName, String serverName, String databaseName, String scanId) {
return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, scanId).map(new Func1<ServiceResponse<DatabaseVulnerabilityAssessme... | [
"public",
"Observable",
"<",
"DatabaseVulnerabilityAssessmentScansExportInner",
">",
"exportAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"scanId",
")",
"{",
"return",
"exportWithServiceResponseAsync",... | Convert an existing scan result to a human readable format. If already exists nothing happens.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName T... | [
"Convert",
"an",
"existing",
"scan",
"result",
"to",
"a",
"human",
"readable",
"format",
".",
"If",
"already",
"exists",
"nothing",
"happens",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabaseVulnerabilityAssessmentScansInner.java#L545-L552 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java | EventHubConnectionsInner.listByDatabaseAsync | public Observable<List<EventHubConnectionInner>> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) {
return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1<ServiceResponse<List<EventHubConnectionInner>>, List<EventHubConnect... | java | public Observable<List<EventHubConnectionInner>> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) {
return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1<ServiceResponse<List<EventHubConnectionInner>>, List<EventHubConnect... | [
"public",
"Observable",
"<",
"List",
"<",
"EventHubConnectionInner",
">",
">",
"listByDatabaseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
")",
"{",
"return",
"listByDatabaseWithServiceResponseAsync",
"(",
"res... | Returns the list of Event Hub connections of the given Kusto database.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@throws IllegalArgumentException thrown if pa... | [
"Returns",
"the",
"list",
"of",
"Event",
"Hub",
"connections",
"of",
"the",
"given",
"Kusto",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L139-L146 |
joniles/mpxj | src/main/java/net/sf/mpxj/utility/DataExportUtility.java | DataExportUtility.process | public void process(Connection connection, String directory) throws Exception
{
connection.setAutoCommit(true);
//
// Retrieve meta data about the connection
//
DatabaseMetaData dmd = connection.getMetaData();
String[] types =
{
"TABLE"
};
FileWriter ... | java | public void process(Connection connection, String directory) throws Exception
{
connection.setAutoCommit(true);
//
// Retrieve meta data about the connection
//
DatabaseMetaData dmd = connection.getMetaData();
String[] types =
{
"TABLE"
};
FileWriter ... | [
"public",
"void",
"process",
"(",
"Connection",
"connection",
",",
"String",
"directory",
")",
"throws",
"Exception",
"{",
"connection",
".",
"setAutoCommit",
"(",
"true",
")",
";",
"//",
"// Retrieve meta data about the connection",
"//",
"DatabaseMetaData",
"dmd",
... | Export data base contents to a directory using supplied connection.
@param connection database connection
@param directory target directory
@throws Exception | [
"Export",
"data",
"base",
"contents",
"to",
"a",
"directory",
"using",
"supplied",
"connection",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/utility/DataExportUtility.java#L103-L135 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java | MyfacesLogger.entering | public void entering(String sourceClass, String sourceMethod, Object params[])
{
_log.entering(sourceClass, sourceMethod, params);
} | java | public void entering(String sourceClass, String sourceMethod, Object params[])
{
_log.entering(sourceClass, sourceMethod, params);
} | [
"public",
"void",
"entering",
"(",
"String",
"sourceClass",
",",
"String",
"sourceMethod",
",",
"Object",
"params",
"[",
"]",
")",
"{",
"_log",
".",
"entering",
"(",
"sourceClass",
",",
"sourceMethod",
",",
"params",
")",
";",
"}"
] | Log a method entry, with an array of parameters.
<p>
This is a convenience method that can be used to log entry
to a method. A LogRecord with message "ENTRY" (followed by a
format {N} indicator for each entry in the parameter array),
log level FINER, and the given sourceMethod, sourceClass, and
parameters is logged.
<... | [
"Log",
"a",
"method",
"entry",
"with",
"an",
"array",
"of",
"parameters",
".",
"<p",
">",
"This",
"is",
"a",
"convenience",
"method",
"that",
"can",
"be",
"used",
"to",
"log",
"entry",
"to",
"a",
"method",
".",
"A",
"LogRecord",
"with",
"message",
"ENT... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java#L741-L744 |
allure-framework/allure-java | allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java | AllureLifecycle.startStep | public void startStep(final String uuid, final StepResult result) {
final Optional<String> current = threadContext.getCurrent();
if (!current.isPresent()) {
LOGGER.error("Could not start step: no test case running");
return;
}
final String parentUuid = current.get... | java | public void startStep(final String uuid, final StepResult result) {
final Optional<String> current = threadContext.getCurrent();
if (!current.isPresent()) {
LOGGER.error("Could not start step: no test case running");
return;
}
final String parentUuid = current.get... | [
"public",
"void",
"startStep",
"(",
"final",
"String",
"uuid",
",",
"final",
"StepResult",
"result",
")",
"{",
"final",
"Optional",
"<",
"String",
">",
"current",
"=",
"threadContext",
".",
"getCurrent",
"(",
")",
";",
"if",
"(",
"!",
"current",
".",
"is... | Start a new step as child step of current running test case or step. Shortcut
for {@link #startStep(String, String, StepResult)}.
@param uuid the uuid of step.
@param result the step. | [
"Start",
"a",
"new",
"step",
"as",
"child",
"step",
"of",
"current",
"running",
"test",
"case",
"or",
"step",
".",
"Shortcut",
"for",
"{",
"@link",
"#startStep",
"(",
"String",
"String",
"StepResult",
")",
"}",
"."
] | train | https://github.com/allure-framework/allure-java/blob/64015ca2b789aa6f7b19c793f1512e2f11d0174e/allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java#L454-L462 |
redkale/redkale | src/org/redkale/convert/json/JsonByteBufferReader.java | JsonByteBufferReader.hasNext | @Override
public boolean hasNext(int startPosition, int contentLength) {
char ch = nextGoodChar();
if (ch == ',') return true;
if (ch == '}' || ch == ']' || ch == 0) return false;
backChar(ch); // { [ 交由 readObjectB 或 readMapB 或 readArrayB 读取
return true;
} | java | @Override
public boolean hasNext(int startPosition, int contentLength) {
char ch = nextGoodChar();
if (ch == ',') return true;
if (ch == '}' || ch == ']' || ch == 0) return false;
backChar(ch); // { [ 交由 readObjectB 或 readMapB 或 readArrayB 读取
return true;
} | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
"int",
"startPosition",
",",
"int",
"contentLength",
")",
"{",
"char",
"ch",
"=",
"nextGoodChar",
"(",
")",
";",
"if",
"(",
"ch",
"==",
"'",
"'",
")",
"return",
"true",
";",
"if",
"(",
"ch",
"==",... | 判断对象是否存在下一个属性或者数组是否存在下一个元素
@param startPosition 起始位置
@param contentLength 内容大小, 不确定的传-1
@return 是否存在 | [
"判断对象是否存在下一个属性或者数组是否存在下一个元素"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/convert/json/JsonByteBufferReader.java#L189-L196 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.selectTerm | public Term selectTerm(final long id) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Timer.Context ctx = metrics.selectTermTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStatement(select... | java | public Term selectTerm(final long id) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
Timer.Context ctx = metrics.selectTermTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStatement(select... | [
"public",
"Term",
"selectTerm",
"(",
"final",
"long",
"id",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"Timer",
".",
"Context",
"ctx",
"=",... | Selects a term by id.
@param id The id.
@return The term or {@code null} if none.
@throws SQLException on database error. | [
"Selects",
"a",
"term",
"by",
"id",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L2179-L2194 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java | Histogram_F64.setRange | public void setRange( int dimension , double min , double max ) {
valueMin[dimension] = min;
valueMax[dimension] = max;
} | java | public void setRange( int dimension , double min , double max ) {
valueMin[dimension] = min;
valueMax[dimension] = max;
} | [
"public",
"void",
"setRange",
"(",
"int",
"dimension",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"valueMin",
"[",
"dimension",
"]",
"=",
"min",
";",
"valueMax",
"[",
"dimension",
"]",
"=",
"max",
";",
"}"
] | Specifies the minimum and maximum values for a specific dimension
@param dimension Which dimension
@param min The minimum value
@param max The maximum value | [
"Specifies",
"the",
"minimum",
"and",
"maximum",
"values",
"for",
"a",
"specific",
"dimension"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/color/Histogram_F64.java#L115-L118 |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.confirmationMatches | public void confirmationMatches(double seconds, String expectedConfirmationPattern) {
try {
double timeTook = popup(seconds);
timeTook = popupMatches(seconds - timeTook, expectedConfirmationPattern);
checkConfirmationMatches(expectedConfirmationPattern, seconds, timeTook);
... | java | public void confirmationMatches(double seconds, String expectedConfirmationPattern) {
try {
double timeTook = popup(seconds);
timeTook = popupMatches(seconds - timeTook, expectedConfirmationPattern);
checkConfirmationMatches(expectedConfirmationPattern, seconds, timeTook);
... | [
"public",
"void",
"confirmationMatches",
"(",
"double",
"seconds",
",",
"String",
"expectedConfirmationPattern",
")",
"{",
"try",
"{",
"double",
"timeTook",
"=",
"popup",
"(",
"seconds",
")",
";",
"timeTook",
"=",
"popupMatches",
"(",
"seconds",
"-",
"timeTook",... | Waits up to the provided wait time for a confirmation present on the page has content matching the
expected text. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param expectedConfirmationPattern the expected text of the confirmation
@param seconds ... | [
"Waits",
"up",
"to",
"the",
"provided",
"wait",
"time",
"for",
"a",
"confirmation",
"present",
"on",
"the",
"page",
"has",
"content",
"matching",
"the",
"expected",
"text",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L578-L586 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PhysicalDatabaseParent.java | PhysicalDatabaseParent.init | public void init(Map<String,Object> mapParams)
{
m_htDBList = new Hashtable<Object,PDatabase>();
m_mapParams = mapParams;
Object strMinutes = this.getProperty(TIME);
int iMinutes = -1; // Default time
try {
if (strMinutes instanceof String)
iMin... | java | public void init(Map<String,Object> mapParams)
{
m_htDBList = new Hashtable<Object,PDatabase>();
m_mapParams = mapParams;
Object strMinutes = this.getProperty(TIME);
int iMinutes = -1; // Default time
try {
if (strMinutes instanceof String)
iMin... | [
"public",
"void",
"init",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"mapParams",
")",
"{",
"m_htDBList",
"=",
"new",
"Hashtable",
"<",
"Object",
",",
"PDatabase",
">",
"(",
")",
";",
"m_mapParams",
"=",
"mapParams",
";",
"Object",
"strMinutes",
"=",... | Constructor
@param mapParams time The default cache review interval.
@param mapParams prefix The prefix on the physical file name.
@param mapParams suffix The suffix on the physical file name.
@param mapParams app The application object (The application object is used by databases that need information about the locati... | [
"Constructor"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PhysicalDatabaseParent.java#L94-L107 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java | IOUtil.setChannelOptions | public static void setChannelOptions(Channel channel, EndpointConfig config) {
ChannelOptions options = channel.options();
options.setOption(DIRECT_BUF, config.isSocketBufferDirect())
.setOption(TCP_NODELAY, config.isSocketTcpNoDelay())
.setOption(SO_KEEPALIVE, config.isSoc... | java | public static void setChannelOptions(Channel channel, EndpointConfig config) {
ChannelOptions options = channel.options();
options.setOption(DIRECT_BUF, config.isSocketBufferDirect())
.setOption(TCP_NODELAY, config.isSocketTcpNoDelay())
.setOption(SO_KEEPALIVE, config.isSoc... | [
"public",
"static",
"void",
"setChannelOptions",
"(",
"Channel",
"channel",
",",
"EndpointConfig",
"config",
")",
"{",
"ChannelOptions",
"options",
"=",
"channel",
".",
"options",
"(",
")",
";",
"options",
".",
"setOption",
"(",
"DIRECT_BUF",
",",
"config",
".... | Sets configured channel options on given {@link Channel}.
@param channel the {@link Channel} on which options will be set
@param config the endpoint configuration | [
"Sets",
"configured",
"channel",
"options",
"on",
"given",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java#L671-L679 |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java | FileUtil.getRelativePath | public static String getRelativePath(File file, File srcDir) {
String base = srcDir.getPath();
String filePath = file.getPath();
String relativePath = new File(base).toURI()
.relativize(new File(filePath).toURI()).getPath();
return relativePath;
} | java | public static String getRelativePath(File file, File srcDir) {
String base = srcDir.getPath();
String filePath = file.getPath();
String relativePath = new File(base).toURI()
.relativize(new File(filePath).toURI()).getPath();
return relativePath;
} | [
"public",
"static",
"String",
"getRelativePath",
"(",
"File",
"file",
",",
"File",
"srcDir",
")",
"{",
"String",
"base",
"=",
"srcDir",
".",
"getPath",
"(",
")",
";",
"String",
"filePath",
"=",
"file",
".",
"getPath",
"(",
")",
";",
"String",
"relativePa... | Returns the relative path.
@param file
@param srcDir
@return the relative path | [
"Returns",
"the",
"relative",
"path",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java#L63-L71 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Replacer.java | Replacer.by | public MultiPos<String, String, String> by(final Object replacement) {
return new MultiPos<String, String, String>(checkNotNull(replacement).toString(), null) {
@Override protected String result() {
return findingReplacing(left, Character.class.isInstance(replacement) ? 'C' : 'S', pos, position);
}
};
} | java | public MultiPos<String, String, String> by(final Object replacement) {
return new MultiPos<String, String, String>(checkNotNull(replacement).toString(), null) {
@Override protected String result() {
return findingReplacing(left, Character.class.isInstance(replacement) ? 'C' : 'S', pos, position);
}
};
} | [
"public",
"MultiPos",
"<",
"String",
",",
"String",
",",
"String",
">",
"by",
"(",
"final",
"Object",
"replacement",
")",
"{",
"return",
"new",
"MultiPos",
"<",
"String",
",",
"String",
",",
"String",
">",
"(",
"checkNotNull",
"(",
"replacement",
")",
".... | Returns a MultiPos instance with all occurrences with given replacement
@param replacement
@return | [
"Returns",
"a",
"MultiPos",
"instance",
"with",
"all",
"occurrences",
"with",
"given",
"replacement"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Replacer.java#L95-L102 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeRestrictionImpl_CustomFieldSerializer.java | OWLDatatypeRestrictionImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDatatypeRestrictionImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDatatypeRestrictionImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDatatypeRestrictionImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeRestrictionImpl_CustomFieldSerializer.java#L74-L77 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/App.java | App.isAllowedImplicitly | final boolean isAllowedImplicitly(String subjectid, String resourcePath, String httpMethod) {
if (StringUtils.isBlank(subjectid) || StringUtils.isBlank(resourcePath) || StringUtils.isBlank(httpMethod)) {
return false;
}
if (resourcePath.endsWith("/" + subjectid)) {
// implicit permissions: a user can read/u... | java | final boolean isAllowedImplicitly(String subjectid, String resourcePath, String httpMethod) {
if (StringUtils.isBlank(subjectid) || StringUtils.isBlank(resourcePath) || StringUtils.isBlank(httpMethod)) {
return false;
}
if (resourcePath.endsWith("/" + subjectid)) {
// implicit permissions: a user can read/u... | [
"final",
"boolean",
"isAllowedImplicitly",
"(",
"String",
"subjectid",
",",
"String",
"resourcePath",
",",
"String",
"httpMethod",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"subjectid",
")",
"||",
"StringUtils",
".",
"isBlank",
"(",
"resourcePath"... | Check if a request comes from a signed in user who try to read/update themselves.
@param subjectid subject id
@param resourcePath resource path or object type
@param httpMethod HTTP method name
@return true if request is GET, PATCH or PUT and the subject id matches the object id | [
"Check",
"if",
"a",
"request",
"comes",
"from",
"a",
"signed",
"in",
"user",
"who",
"try",
"to",
"read",
"/",
"update",
"themselves",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L823-L832 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/OrderByPlanNode.java | OrderByPlanNode.addSortExpressions | public void addSortExpressions(List<AbstractExpression> sortExprs, List<SortDirectionType> sortDirs) {
assert(sortExprs.size() == sortDirs.size());
for (int i = 0; i < sortExprs.size(); ++i) {
addSortExpression(sortExprs.get(i), sortDirs.get(i));
}
} | java | public void addSortExpressions(List<AbstractExpression> sortExprs, List<SortDirectionType> sortDirs) {
assert(sortExprs.size() == sortDirs.size());
for (int i = 0; i < sortExprs.size(); ++i) {
addSortExpression(sortExprs.get(i), sortDirs.get(i));
}
} | [
"public",
"void",
"addSortExpressions",
"(",
"List",
"<",
"AbstractExpression",
">",
"sortExprs",
",",
"List",
"<",
"SortDirectionType",
">",
"sortDirs",
")",
"{",
"assert",
"(",
"sortExprs",
".",
"size",
"(",
")",
"==",
"sortDirs",
".",
"size",
"(",
")",
... | Add multiple sort expressions to the order-by
@param sortExprs List of the input expression on which to order the rows
@param sortDirs List of the corresponding sort order for each input expression | [
"Add",
"multiple",
"sort",
"expressions",
"to",
"the",
"order",
"-",
"by"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/OrderByPlanNode.java#L87-L92 |
elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/NNDescent.java | NNDescent.sampleNew | private int sampleNew(DBIDs ids, WritableDataStore<HashSetModifiableDBIDs> sampleNewNeighbors, WritableDataStore<HashSetModifiableDBIDs> newNeighborHash, int items) {
int t = 0;
for(DBIDIter iditer = ids.iter(); iditer.valid(); iditer.advance()) {
KNNHeap realNeighbors = store.get(iditer);
HashSetMo... | java | private int sampleNew(DBIDs ids, WritableDataStore<HashSetModifiableDBIDs> sampleNewNeighbors, WritableDataStore<HashSetModifiableDBIDs> newNeighborHash, int items) {
int t = 0;
for(DBIDIter iditer = ids.iter(); iditer.valid(); iditer.advance()) {
KNNHeap realNeighbors = store.get(iditer);
HashSetMo... | [
"private",
"int",
"sampleNew",
"(",
"DBIDs",
"ids",
",",
"WritableDataStore",
"<",
"HashSetModifiableDBIDs",
">",
"sampleNewNeighbors",
",",
"WritableDataStore",
"<",
"HashSetModifiableDBIDs",
">",
"newNeighborHash",
",",
"int",
"items",
")",
"{",
"int",
"t",
"=",
... | samples newNeighbors for every object
@param ids All ids
@param sampleNewNeighbors Output of sampled new neighbors
@param newNeighborHash - new neighbors for every object
@param items Number of items to collect
@return Number of new neighbors | [
"samples",
"newNeighbors",
"for",
"every",
"object"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/NNDescent.java#L416-L435 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java | Debugger.printWarn | public static void printWarn(Object caller, Object message)
{
StringBuilder text = new StringBuilder();
Class<?> c = callerBuilder(caller, text);
if(message instanceof Throwable)
getLog(c).warn(text.append(stackTrace((Throwable)message)));
else
getLog(c).warn(text.append(message));
} | java | public static void printWarn(Object caller, Object message)
{
StringBuilder text = new StringBuilder();
Class<?> c = callerBuilder(caller, text);
if(message instanceof Throwable)
getLog(c).warn(text.append(stackTrace((Throwable)message)));
else
getLog(c).warn(text.append(message));
} | [
"public",
"static",
"void",
"printWarn",
"(",
"Object",
"caller",
",",
"Object",
"message",
")",
"{",
"StringBuilder",
"text",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Class",
"<",
"?",
">",
"c",
"=",
"callerBuilder",
"(",
"caller",
",",
"text",
")",... | Print a warning level message.
The stack trace will be printed if
the given message is an exception.
@param caller the calling object
@param message the message to print | [
"Print",
"a",
"warning",
"level",
"message",
".",
"The",
"stack",
"trace",
"will",
"be",
"printed",
"if",
"the",
"given",
"message",
"is",
"an",
"exception",
"."
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java#L531-L543 |
beanshell/beanshell | src/main/java/bsh/NameSpace.java | NameSpace.getPropertyValue | Object getPropertyValue(final String propName, final Interpreter interp)
throws UtilEvalError {
String accessorName = Reflect.accessorName(Reflect.GET_PREFIX, propName);
final Class<?>[] classArray = Reflect.ZERO_TYPES;
BshMethod m = this.getMethod(accessorName, classArray);
... | java | Object getPropertyValue(final String propName, final Interpreter interp)
throws UtilEvalError {
String accessorName = Reflect.accessorName(Reflect.GET_PREFIX, propName);
final Class<?>[] classArray = Reflect.ZERO_TYPES;
BshMethod m = this.getMethod(accessorName, classArray);
... | [
"Object",
"getPropertyValue",
"(",
"final",
"String",
"propName",
",",
"final",
"Interpreter",
"interp",
")",
"throws",
"UtilEvalError",
"{",
"String",
"accessorName",
"=",
"Reflect",
".",
"accessorName",
"(",
"Reflect",
".",
"GET_PREFIX",
",",
"propName",
")",
... | Get a property from a scripted object or Primitive.VOID if no such
property exists.
@param propName the prop name
@param interp the interp
@return the property value
@throws UtilEvalError the util eval error | [
"Get",
"a",
"property",
"from",
"a",
"scripted",
"object",
"or",
"Primitive",
".",
"VOID",
"if",
"no",
"such",
"property",
"exists",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1401-L1418 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Cartographer.java | Cartographer.toJson | public String toJson(Map<?, ?> map) {
StringWriter stringWriter = new StringWriter();
try {
toJson(map, stringWriter);
} catch (IOException e) {
throw new AssertionError(e); // No I/O writing to a Buffer.
}
return stringWriter.toString();
} | java | public String toJson(Map<?, ?> map) {
StringWriter stringWriter = new StringWriter();
try {
toJson(map, stringWriter);
} catch (IOException e) {
throw new AssertionError(e); // No I/O writing to a Buffer.
}
return stringWriter.toString();
} | [
"public",
"String",
"toJson",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
")",
"{",
"StringWriter",
"stringWriter",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"toJson",
"(",
"map",
",",
"stringWriter",
")",
";",
"}",
"catch",
"(",
"IOExce... | Serializes the map into it's json representation and returns it as a String. If you want to
write the json to {@link Writer} instead of retrieving it as a String, use {@link #toJson(Map,
Writer)} instead. | [
"Serializes",
"the",
"map",
"into",
"it",
"s",
"json",
"representation",
"and",
"returns",
"it",
"as",
"a",
"String",
".",
"If",
"you",
"want",
"to",
"write",
"the",
"json",
"to",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Cartographer.java#L91-L99 |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/CommonDataProvider.java | CommonDataProvider.writeDataResult | public void writeDataResult(String column, int line, String value) {
logger.debug("Write Data result => column:{} line:{} value:{}", column, line, value);
writeValue(column, line, value);
} | java | public void writeDataResult(String column, int line, String value) {
logger.debug("Write Data result => column:{} line:{} value:{}", column, line, value);
writeValue(column, line, value);
} | [
"public",
"void",
"writeDataResult",
"(",
"String",
"column",
",",
"int",
"line",
",",
"String",
"value",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Write Data result => column:{} line:{} value:{}\"",
",",
"column",
",",
"line",
",",
"value",
")",
";",
"writeValu... | Writes some data as result.
@param column
The column name
@param line
The line number
@param value
The data value | [
"Writes",
"some",
"data",
"as",
"result",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/CommonDataProvider.java#L182-L185 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java | LegacyBehavior.migrateMultiInstanceJobDefinitions | public static void migrateMultiInstanceJobDefinitions(ProcessDefinitionEntity processDefinition, List<JobDefinitionEntity> jobDefinitions) {
for (JobDefinitionEntity jobDefinition : jobDefinitions) {
String activityId = jobDefinition.getActivityId();
if (activityId != null) {
ActivityImpl activ... | java | public static void migrateMultiInstanceJobDefinitions(ProcessDefinitionEntity processDefinition, List<JobDefinitionEntity> jobDefinitions) {
for (JobDefinitionEntity jobDefinition : jobDefinitions) {
String activityId = jobDefinition.getActivityId();
if (activityId != null) {
ActivityImpl activ... | [
"public",
"static",
"void",
"migrateMultiInstanceJobDefinitions",
"(",
"ProcessDefinitionEntity",
"processDefinition",
",",
"List",
"<",
"JobDefinitionEntity",
">",
"jobDefinitions",
")",
"{",
"for",
"(",
"JobDefinitionEntity",
"jobDefinition",
":",
"jobDefinitions",
")",
... | When deploying an async job definition for an activity wrapped in an miBody, set the activity id to the
miBody except the wrapped activity is marked as async.
Background: in <= 7.2 async job definitions were created for the inner activity, although the
semantics are that they are executed before the miBody is entered | [
"When",
"deploying",
"an",
"async",
"job",
"definition",
"for",
"an",
"activity",
"wrapped",
"in",
"an",
"miBody",
"set",
"the",
"activity",
"id",
"to",
"the",
"miBody",
"except",
"the",
"wrapped",
"activity",
"is",
"marked",
"as",
"async",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L525-L537 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.generateThumbnailInStreamWithServiceResponseAsync | public Observable<ServiceResponse<InputStream>> generateThumbnailInStreamWithServiceResponseAsync(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Pa... | java | public Observable<ServiceResponse<InputStream>> generateThumbnailInStreamWithServiceResponseAsync(int width, int height, byte[] image, GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Pa... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"InputStream",
">",
">",
"generateThumbnailInStreamWithServiceResponseAsync",
"(",
"int",
"width",
",",
"int",
"height",
",",
"byte",
"[",
"]",
"image",
",",
"GenerateThumbnailInStreamOptionalParameter",
"generateThumbn... | This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input i... | [
"This",
"operation",
"generates",
"a",
"thumbnail",
"image",
"with",
"the",
"user",
"-",
"specified",
"width",
"and",
"height",
".",
"By",
"default",
"the",
"service",
"analyzes",
"the",
"image",
"identifies",
"the",
"region",
"of",
"interest",
"(",
"ROI",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L953-L963 |
google/closure-compiler | src/com/google/javascript/jscomp/deps/DefaultDependencyResolver.java | DefaultDependencyResolver.getDependencies | @Override
public List<String> getDependencies(Collection<String> symbols)
throws ServiceException {
return getDependencies(symbols, new HashSet<String>());
} | java | @Override
public List<String> getDependencies(Collection<String> symbols)
throws ServiceException {
return getDependencies(symbols, new HashSet<String>());
} | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getDependencies",
"(",
"Collection",
"<",
"String",
">",
"symbols",
")",
"throws",
"ServiceException",
"{",
"return",
"getDependencies",
"(",
"symbols",
",",
"new",
"HashSet",
"<",
"String",
">",
"(",
"... | Gets a list of dependencies for the provided list of symbols. | [
"Gets",
"a",
"list",
"of",
"dependencies",
"for",
"the",
"provided",
"list",
"of",
"symbols",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DefaultDependencyResolver.java#L78-L82 |
grandstaish/paperparcel | paperparcel/src/main/java/paperparcel/internal/Utils.java | Utils.nullSafeClone | public static <T> TypeAdapter<T> nullSafeClone(@NonNull final TypeAdapter<T> delegate) {
return new TypeAdapter<T>() {
@Nullable @Override public T readFromParcel(@NonNull Parcel source) {
return readNullable(source, delegate);
}
@Override public void writeToParcel(@Nullable T value, @Non... | java | public static <T> TypeAdapter<T> nullSafeClone(@NonNull final TypeAdapter<T> delegate) {
return new TypeAdapter<T>() {
@Nullable @Override public T readFromParcel(@NonNull Parcel source) {
return readNullable(source, delegate);
}
@Override public void writeToParcel(@Nullable T value, @Non... | [
"public",
"static",
"<",
"T",
">",
"TypeAdapter",
"<",
"T",
">",
"nullSafeClone",
"(",
"@",
"NonNull",
"final",
"TypeAdapter",
"<",
"T",
">",
"delegate",
")",
"{",
"return",
"new",
"TypeAdapter",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Nullable",
"@",
"O... | Returns a type adapter equal to this type adapter, but with support for reading and writing
{@code null} values. | [
"Returns",
"a",
"type",
"adapter",
"equal",
"to",
"this",
"type",
"adapter",
"but",
"with",
"support",
"for",
"reading",
"and",
"writing",
"{"
] | train | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel/src/main/java/paperparcel/internal/Utils.java#L85-L95 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/thread_pool/ThreadPoolManager.java | ThreadPoolManager.schedule | public static ScheduledFuture schedule(Runnable runnable, long delayInMilli, String msgId) {
if (StringUtil.isEmpty(msgId)) {
throw new IllegalArgumentException("You must specify a $msgId for the the one-shot action.");
}
Runnable proxy = wrapRunnable(runnable, msgId);
return... | java | public static ScheduledFuture schedule(Runnable runnable, long delayInMilli, String msgId) {
if (StringUtil.isEmpty(msgId)) {
throw new IllegalArgumentException("You must specify a $msgId for the the one-shot action.");
}
Runnable proxy = wrapRunnable(runnable, msgId);
return... | [
"public",
"static",
"ScheduledFuture",
"schedule",
"(",
"Runnable",
"runnable",
",",
"long",
"delayInMilli",
",",
"String",
"msgId",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"msgId",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Creates and executes a one-shot action that becomes enabled after the given delay.
@param runnable a java runnable object you want to submit
@param delayInMilli the delay in milliseconds
@param msgId the message id. Not null.
@return the future | [
"Creates",
"and",
"executes",
"a",
"one",
"-",
"shot",
"action",
"that",
"becomes",
"enabled",
"after",
"the",
"given",
"delay",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/thread_pool/ThreadPoolManager.java#L279-L285 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java | Check.inferiorOrEqual | public static void inferiorOrEqual(int a, int b)
{
if (a > b)
{
throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_INFERIOR + String.valueOf(b));
}
} | java | public static void inferiorOrEqual(int a, int b)
{
if (a > b)
{
throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_INFERIOR + String.valueOf(b));
}
} | [
"public",
"static",
"void",
"inferiorOrEqual",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"if",
"(",
"a",
">",
"b",
")",
"{",
"throw",
"new",
"LionEngineException",
"(",
"ERROR_ARGUMENT",
"+",
"String",
".",
"valueOf",
"(",
"a",
")",
"+",
"ERROR_INFER... | Check if <code>a</code> is inferior to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed. | [
"Check",
"if",
"<code",
">",
"a<",
"/",
"code",
">",
"is",
"inferior",
"to",
"<code",
">",
"b<",
"/",
"code",
">",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java#L118-L124 |
icode/ameba-utils | src/main/java/ameba/util/Cookies.java | Cookies.newDeletedCookie | public static NewCookie newDeletedCookie(String name) {
/**
* Create a new instance.
*
* @param name the name of the cookie
* @param value the value of the cookie
* @param path the URI path for which the cookie is valid
* @param domain the host ... | java | public static NewCookie newDeletedCookie(String name) {
/**
* Create a new instance.
*
* @param name the name of the cookie
* @param value the value of the cookie
* @param path the URI path for which the cookie is valid
* @param domain the host ... | [
"public",
"static",
"NewCookie",
"newDeletedCookie",
"(",
"String",
"name",
")",
"{",
"/**\n * Create a new instance.\n *\n * @param name the name of the cookie\n * @param value the value of the cookie\n * @param path the URI path for which the co... | <p>newDeletedCookie.</p>
@param name a {@link java.lang.String} object.
@return a {@link javax.ws.rs.core.NewCookie} object. | [
"<p",
">",
"newDeletedCookie",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/Cookies.java#L29-L47 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotGet | public static Optional<Object> dotGet(final Map map, final String pathString) {
return dotGet(map, Object.class, pathString);
} | java | public static Optional<Object> dotGet(final Map map, final String pathString) {
return dotGet(map, Object.class, pathString);
} | [
"public",
"static",
"Optional",
"<",
"Object",
">",
"dotGet",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
")",
"{",
"return",
"dotGet",
"(",
"map",
",",
"Object",
".",
"class",
",",
"pathString",
")",
";",
"}"
] | Get object value by path.
@param map subject
@param pathString nodes to walk in map
@return value | [
"Get",
"object",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L106-L108 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.isFalse | public static void isFalse (@Nonnull final BooleanSupplier aValue, final String sMsg)
{
if (isEnabled ())
isFalse (aValue, () -> sMsg);
} | java | public static void isFalse (@Nonnull final BooleanSupplier aValue, final String sMsg)
{
if (isEnabled ())
isFalse (aValue, () -> sMsg);
} | [
"public",
"static",
"void",
"isFalse",
"(",
"@",
"Nonnull",
"final",
"BooleanSupplier",
"aValue",
",",
"final",
"String",
"sMsg",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"isFalse",
"(",
"aValue",
",",
"(",
")",
"->",
"sMsg",
")",
";",
"}"
] | Check that the passed value is <code>false</code>.
@param aValue
The value to check.
@param sMsg
The message to be emitted in case the value is <code>true</code>
@throws IllegalArgumentException
if the passed value is not <code>null</code>. | [
"Check",
"that",
"the",
"passed",
"value",
"is",
"<code",
">",
"false<",
"/",
"code",
">",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L185-L189 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java | FilesInner.readWriteAsync | public Observable<FileStorageInfoInner> readWriteAsync(String groupName, String serviceName, String projectName, String fileName) {
return readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1<ServiceResponse<FileStorageInfoInner>, FileStorageInfoInner>() {
@... | java | public Observable<FileStorageInfoInner> readWriteAsync(String groupName, String serviceName, String projectName, String fileName) {
return readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1<ServiceResponse<FileStorageInfoInner>, FileStorageInfoInner>() {
@... | [
"public",
"Observable",
"<",
"FileStorageInfoInner",
">",
"readWriteAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"fileName",
")",
"{",
"return",
"readWriteWithServiceResponseAsync",
"(",
"groupName",
",... | Request information for reading and writing file content.
This method is used for requesting information for reading and writing the file content.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name of the File
@throws IllegalAr... | [
"Request",
"information",
"for",
"reading",
"and",
"writing",
"file",
"content",
".",
"This",
"method",
"is",
"used",
"for",
"requesting",
"information",
"for",
"reading",
"and",
"writing",
"the",
"file",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L817-L824 |
ragunathjawahar/adapter-kit | samples/src/com/mobsandgeeks/adapters/samples/TabListener.java | TabListener.onTabSelected | public void onTabSelected(Tab tab, FragmentTransaction ft) {
// Check if the fragment is already initialized
if (mFragment == null) {
// If not, instantiate and add it to the activity
mFragment = Fragment.instantiate(mActivity, mClass.getName());
ft.add(android.R.id.content, mFragment, mTag);
} else {
... | java | public void onTabSelected(Tab tab, FragmentTransaction ft) {
// Check if the fragment is already initialized
if (mFragment == null) {
// If not, instantiate and add it to the activity
mFragment = Fragment.instantiate(mActivity, mClass.getName());
ft.add(android.R.id.content, mFragment, mTag);
} else {
... | [
"public",
"void",
"onTabSelected",
"(",
"Tab",
"tab",
",",
"FragmentTransaction",
"ft",
")",
"{",
"// Check if the fragment is already initialized",
"if",
"(",
"mFragment",
"==",
"null",
")",
"{",
"// If not, instantiate and add it to the activity",
"mFragment",
"=",
"Fra... | /* The following are each of the ActionBar.TabListener callbacks | [
"/",
"*",
"The",
"following",
"are",
"each",
"of",
"the",
"ActionBar",
".",
"TabListener",
"callbacks"
] | train | https://github.com/ragunathjawahar/adapter-kit/blob/e5c13458c7f6dcc1c61410f9cfb55cd24bd31ca2/samples/src/com/mobsandgeeks/adapters/samples/TabListener.java#L33-L43 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.replaceFirst | public StrBuilder replaceFirst(final char search, final char replace) {
if (search != replace) {
for (int i = 0; i < size; i++) {
if (buffer[i] == search) {
buffer[i] = replace;
break;
}
}
}
return th... | java | public StrBuilder replaceFirst(final char search, final char replace) {
if (search != replace) {
for (int i = 0; i < size; i++) {
if (buffer[i] == search) {
buffer[i] = replace;
break;
}
}
}
return th... | [
"public",
"StrBuilder",
"replaceFirst",
"(",
"final",
"char",
"search",
",",
"final",
"char",
"replace",
")",
"{",
"if",
"(",
"search",
"!=",
"replace",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
... | Replaces the first instance of the search character with the
replace character in the builder.
@param search the search character
@param replace the replace character
@return this, to enable chaining | [
"Replaces",
"the",
"first",
"instance",
"of",
"the",
"search",
"character",
"with",
"the",
"replace",
"character",
"in",
"the",
"builder",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1986-L1996 |
Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonPipelineZADD | public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
String zKey = z_key_prefix + key;
int success = 0;
long returnOp = 0;
for (int i = 0; i < max_score; i++) {
returnOp = jedisClient.get().... | java | public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
String zKey = z_key_prefix + key;
int success = 0;
long returnOp = 0;
for (int i = 0; i < max_score; i++) {
returnOp = jedisClient.get().... | [
"public",
"String",
"nonPipelineZADD",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
",",
"String",
"z_key_prefix",
",",
"int",
"max_score",
")",
"throws",
"Exception",
"{",
"String",
"zKey",
"=",
"z_key_prefix",
"+",
"key",
";",
"int",
"success",... | This adds MAX_SCORE of elements in a sorted set
@param key
@return "OK" if all write operations have succeeded
@throws Exception | [
"This",
"adds",
"MAX_SCORE",
"of",
"elements",
"in",
"a",
"sorted",
"set"
] | train | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L238-L253 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/bytebuffer/WsByteBufferUtils.java | WsByteBufferUtils.asString | public static final String asString(WsByteBuffer[] list, int[] positions, int[] limits) {
byte[] data = asByteArray(list, positions, limits);
return (null != data) ? new String(data) : null;
} | java | public static final String asString(WsByteBuffer[] list, int[] positions, int[] limits) {
byte[] data = asByteArray(list, positions, limits);
return (null != data) ? new String(data) : null;
} | [
"public",
"static",
"final",
"String",
"asString",
"(",
"WsByteBuffer",
"[",
"]",
"list",
",",
"int",
"[",
"]",
"positions",
",",
"int",
"[",
"]",
"limits",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"asByteArray",
"(",
"list",
",",
"positions",
",",
"... | Convert an array of buffers to a string using the input starting positions
and ending limits.
@param list
@param positions
@param limits
@return String | [
"Convert",
"an",
"array",
"of",
"buffers",
"to",
"a",
"string",
"using",
"the",
"input",
"starting",
"positions",
"and",
"ending",
"limits",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/bytebuffer/WsByteBufferUtils.java#L106-L109 |
EdwardRaff/JSAT | JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java | OnlineLDAsvi.setEta | public void setEta(double eta)
{
if(eta <= 0 || Double.isInfinite(eta) || Double.isNaN(eta))
throw new IllegalArgumentException("Eta must be a positive constant, not " + eta);
this.eta = eta;
} | java | public void setEta(double eta)
{
if(eta <= 0 || Double.isInfinite(eta) || Double.isNaN(eta))
throw new IllegalArgumentException("Eta must be a positive constant, not " + eta);
this.eta = eta;
} | [
"public",
"void",
"setEta",
"(",
"double",
"eta",
")",
"{",
"if",
"(",
"eta",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"eta",
")",
"||",
"Double",
".",
"isNaN",
"(",
"eta",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Eta mus... | Prior on topics. 1/{@link #setK(int) K} is a common choice.
@param eta the positive prior for topics | [
"Prior",
"on",
"topics",
".",
"1",
"/",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java#L277-L282 |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java | SphericalUtil.distanceRadians | private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) {
return arcHav(havDistance(lat1, lat2, lng1 - lng2));
} | java | private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) {
return arcHav(havDistance(lat1, lat2, lng1 - lng2));
} | [
"private",
"static",
"double",
"distanceRadians",
"(",
"double",
"lat1",
",",
"double",
"lng1",
",",
"double",
"lat2",
",",
"double",
"lng2",
")",
"{",
"return",
"arcHav",
"(",
"havDistance",
"(",
"lat1",
",",
"lat2",
",",
"lng1",
"-",
"lng2",
")",
")",
... | Returns distance on the unit sphere; the arguments are in radians. | [
"Returns",
"distance",
"on",
"the",
"unit",
"sphere",
";",
"the",
"arguments",
"are",
"in",
"radians",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L257-L259 |
googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java | AtomContent.forFeed | public static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed) {
return new AtomContent(namespaceDictionary, feed, false);
} | java | public static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed) {
return new AtomContent(namespaceDictionary, feed, false);
} | [
"public",
"static",
"AtomContent",
"forFeed",
"(",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"Object",
"feed",
")",
"{",
"return",
"new",
"AtomContent",
"(",
"namespaceDictionary",
",",
"feed",
",",
"false",
")",
";",
"}"
] | Returns a new instance of HTTP content for an Atom feed.
@param namespaceDictionary XML namespace dictionary
@param feed data key/value pair for the Atom feed
@since 1.5 | [
"Returns",
"a",
"new",
"instance",
"of",
"HTTP",
"content",
"for",
"an",
"Atom",
"feed",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java#L91-L93 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/MultiPartOutputStream.java | MultiPartOutputStream.startPart | public void startPart(String contentType, String[] headers) throws IOException {
if (inPart)
out.write(__CRLF);
inPart = true;
out.write(__DASHDASH);
out.write(boundaryBytes);
out.write(__CRLF);
if (contentType != null)
out.write(("Content-Type: " ... | java | public void startPart(String contentType, String[] headers) throws IOException {
if (inPart)
out.write(__CRLF);
inPart = true;
out.write(__DASHDASH);
out.write(boundaryBytes);
out.write(__CRLF);
if (contentType != null)
out.write(("Content-Type: " ... | [
"public",
"void",
"startPart",
"(",
"String",
"contentType",
",",
"String",
"[",
"]",
"headers",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inPart",
")",
"out",
".",
"write",
"(",
"__CRLF",
")",
";",
"inPart",
"=",
"true",
";",
"out",
".",
"write",... | Start creation of the next Content.
@param contentType the content type of the part
@param headers the part headers
@throws IOException if unable to write the part | [
"Start",
"creation",
"of",
"the",
"next",
"Content",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MultiPartOutputStream.java#L89-L104 |
apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java | SchedulerStateManagerAdaptor.setPackingPlan | public Boolean setPackingPlan(PackingPlans.PackingPlan packingPlan, String topologyName) {
return awaitResult(delegate.setPackingPlan(packingPlan, topologyName));
} | java | public Boolean setPackingPlan(PackingPlans.PackingPlan packingPlan, String topologyName) {
return awaitResult(delegate.setPackingPlan(packingPlan, topologyName));
} | [
"public",
"Boolean",
"setPackingPlan",
"(",
"PackingPlans",
".",
"PackingPlan",
"packingPlan",
",",
"String",
"topologyName",
")",
"{",
"return",
"awaitResult",
"(",
"delegate",
".",
"setPackingPlan",
"(",
"packingPlan",
",",
"topologyName",
")",
")",
";",
"}"
] | Set the packing plan for the given topology
@param packingPlan the packing plan of the topology
@return Boolean - Success or Failure | [
"Set",
"the",
"packing",
"plan",
"for",
"the",
"given",
"topology"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java#L153-L155 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.