repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/gwt/shared/CmsListInfoBean.java | CmsListInfoBean.addAdditionalInfo | public void addAdditionalInfo(String name, String value) {
"""
Sets a new additional info.<p>
@param name the additional info name
@param value the additional info value
"""
getAdditionalInfo().add(new CmsAdditionalInfoBean(name, value, null));
} | java | public void addAdditionalInfo(String name, String value) {
getAdditionalInfo().add(new CmsAdditionalInfoBean(name, value, null));
} | [
"public",
"void",
"addAdditionalInfo",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"getAdditionalInfo",
"(",
")",
".",
"add",
"(",
"new",
"CmsAdditionalInfoBean",
"(",
"name",
",",
"value",
",",
"null",
")",
")",
";",
"}"
] | Sets a new additional info.<p>
@param name the additional info name
@param value the additional info value | [
"Sets",
"a",
"new",
"additional",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/shared/CmsListInfoBean.java#L135-L138 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/StreamUtils.java | StreamUtils.iteratorToStream | public static <T> Stream<T> iteratorToStream(final Iterator<T> iterator) {
"""
Convert an Iterator to a Stream
@param iterator the iterator
@param <T> the type of the Stream
@return the stream
"""
return iteratorToStream(iterator, enableParallel);
} | java | public static <T> Stream<T> iteratorToStream(final Iterator<T> iterator) {
return iteratorToStream(iterator, enableParallel);
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"iteratorToStream",
"(",
"final",
"Iterator",
"<",
"T",
">",
"iterator",
")",
"{",
"return",
"iteratorToStream",
"(",
"iterator",
",",
"enableParallel",
")",
";",
"}"
] | Convert an Iterator to a Stream
@param iterator the iterator
@param <T> the type of the Stream
@return the stream | [
"Convert",
"an",
"Iterator",
"to",
"a",
"Stream"
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/StreamUtils.java#L64-L66 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/PreambleUtil.java | PreambleUtil.preambleToString | static String preambleToString(final Memory mem) {
"""
Returns a human readable string summary of the preamble state of the given Memory.
Note: other than making sure that the given Memory size is large
enough for just the preamble, this does not do much value checking of the contents of the
preamble as this is... | java | static String preambleToString(final Memory mem) {
final int preLongs = getAndCheckPreLongs(mem); // make sure we can get the assumed preamble
final Family family = Family.idToFamily(mem.getByte(FAMILY_BYTE));
switch (family) {
case RESERVOIR:
case VAROPT:
return sketchPreambleToStrin... | [
"static",
"String",
"preambleToString",
"(",
"final",
"Memory",
"mem",
")",
"{",
"final",
"int",
"preLongs",
"=",
"getAndCheckPreLongs",
"(",
"mem",
")",
";",
"// make sure we can get the assumed preamble",
"final",
"Family",
"family",
"=",
"Family",
".",
"idToFamil... | Returns a human readable string summary of the preamble state of the given Memory.
Note: other than making sure that the given Memory size is large
enough for just the preamble, this does not do much value checking of the contents of the
preamble as this is primarily a tool for debugging the preamble visually.
@param ... | [
"Returns",
"a",
"human",
"readable",
"string",
"summary",
"of",
"the",
"preamble",
"state",
"of",
"the",
"given",
"Memory",
".",
"Note",
":",
"other",
"than",
"making",
"sure",
"that",
"the",
"given",
"Memory",
"size",
"is",
"large",
"enough",
"for",
"just... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/PreambleUtil.java#L176-L192 |
OpenTSDB/opentsdb | src/meta/TSMeta.java | TSMeta.getFromStorage | private static Deferred<TSMeta> getFromStorage(final TSDB tsdb,
final byte[] tsuid) {
"""
Attempts to fetch the timeseries meta data from storage.
This method will fetch the {@code counter} and {@code meta} columns.
<b>Note:</b> This method will not load the UIDMeta objects.
@param tsdb The TSDB to use f... | java | private static Deferred<TSMeta> getFromStorage(final TSDB tsdb,
final byte[] tsuid) {
/**
* Called after executing the GetRequest to parse the meta data.
*/
final class GetCB implements Callback<Deferred<TSMeta>, ArrayList<KeyValue>> {
/**
* @return Null if the meta did not e... | [
"private",
"static",
"Deferred",
"<",
"TSMeta",
">",
"getFromStorage",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"byte",
"[",
"]",
"tsuid",
")",
"{",
"/**\n * Called after executing the GetRequest to parse the meta data.\n */",
"final",
"class",
"GetCB",
"impl... | Attempts to fetch the timeseries meta data from storage.
This method will fetch the {@code counter} and {@code meta} columns.
<b>Note:</b> This method will not load the UIDMeta objects.
@param tsdb The TSDB to use for storage access
@param tsuid The UID of the meta to fetch
@return A TSMeta object if found, null if not... | [
"Attempts",
"to",
"fetch",
"the",
"timeseries",
"meta",
"data",
"from",
"storage",
".",
"This",
"method",
"will",
"fetch",
"the",
"{"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSMeta.java#L695-L743 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java | ExpressionSelectors.makeExprEvalSelector | public static ColumnValueSelector<ExprEval> makeExprEvalSelector(
ColumnSelectorFactory columnSelectorFactory,
Expr expression
) {
"""
Makes a ColumnValueSelector whose getObject method returns an {@link ExprEval}.
@see ExpressionSelectors#makeColumnValueSelector(ColumnSelectorFactory, Expr)
"... | java | public static ColumnValueSelector<ExprEval> makeExprEvalSelector(
ColumnSelectorFactory columnSelectorFactory,
Expr expression
)
{
final List<String> columns = Parser.findRequiredBindings(expression);
if (columns.size() == 1) {
final String column = Iterables.getOnlyElement(columns);
... | [
"public",
"static",
"ColumnValueSelector",
"<",
"ExprEval",
">",
"makeExprEvalSelector",
"(",
"ColumnSelectorFactory",
"columnSelectorFactory",
",",
"Expr",
"expression",
")",
"{",
"final",
"List",
"<",
"String",
">",
"columns",
"=",
"Parser",
".",
"findRequiredBindin... | Makes a ColumnValueSelector whose getObject method returns an {@link ExprEval}.
@see ExpressionSelectors#makeColumnValueSelector(ColumnSelectorFactory, Expr) | [
"Makes",
"a",
"ColumnValueSelector",
"whose",
"getObject",
"method",
"returns",
"an",
"{",
"@link",
"ExprEval",
"}",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/segment/virtual/ExpressionSelectors.java#L129-L167 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/base64/Base64Slow.java | Base64Slow.isBase64 | public static boolean isBase64(String string, String enc) throws UnsupportedEncodingException {
"""
Determines if the String is in base64 format.
<p>
Data will be considered to be in base64 format if it contains only base64 characters and white
space with equals sign padding on the end so that the number of bas... | java | public static boolean isBase64(String string, String enc) throws UnsupportedEncodingException {
return isBase64(string.getBytes(enc));
} | [
"public",
"static",
"boolean",
"isBase64",
"(",
"String",
"string",
",",
"String",
"enc",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"isBase64",
"(",
"string",
".",
"getBytes",
"(",
"enc",
")",
")",
";",
"}"
] | Determines if the String is in base64 format.
<p>
Data will be considered to be in base64 format if it contains only base64 characters and white
space with equals sign padding on the end so that the number of base64 characters is divisible
by four.
<p>
It is possible for data to be in base64 format but for it to not me... | [
"Determines",
"if",
"the",
"String",
"is",
"in",
"base64",
"format",
".",
"<p",
">",
"Data",
"will",
"be",
"considered",
"to",
"be",
"in",
"base64",
"format",
"if",
"it",
"contains",
"only",
"base64",
"characters",
"and",
"white",
"space",
"with",
"equals"... | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/base64/Base64Slow.java#L892-L894 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/TraceOptions.java | TraceOptions.copyBytesTo | public void copyBytesTo(byte[] dest, int destOffset) {
"""
Copies the byte representations of the {@code TraceOptions} into the {@code dest} beginning at
the {@code destOffset} offset.
<p>Equivalent with (but faster because it avoids any new allocations):
<pre>{@code
System.arraycopy(getBytes(), 0, dest, d... | java | public void copyBytesTo(byte[] dest, int destOffset) {
Utils.checkIndex(destOffset, dest.length);
dest[destOffset] = options;
} | [
"public",
"void",
"copyBytesTo",
"(",
"byte",
"[",
"]",
"dest",
",",
"int",
"destOffset",
")",
"{",
"Utils",
".",
"checkIndex",
"(",
"destOffset",
",",
"dest",
".",
"length",
")",
";",
"dest",
"[",
"destOffset",
"]",
"=",
"options",
";",
"}"
] | Copies the byte representations of the {@code TraceOptions} into the {@code dest} beginning at
the {@code destOffset} offset.
<p>Equivalent with (but faster because it avoids any new allocations):
<pre>{@code
System.arraycopy(getBytes(), 0, dest, destOffset, TraceOptions.SIZE);
}</pre>
@param dest the destination bu... | [
"Copies",
"the",
"byte",
"representations",
"of",
"the",
"{",
"@code",
"TraceOptions",
"}",
"into",
"the",
"{",
"@code",
"dest",
"}",
"beginning",
"at",
"the",
"{",
"@code",
"destOffset",
"}",
"offset",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/TraceOptions.java#L176-L179 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/ControlFlow.java | ControlFlow.ifElseChain | static Statement ifElseChain(final List<IfBlock> ifs, final Optional<Statement> elseBlock) {
"""
Returns a statement that encodes the given sequence of {@link IfBlock if blocks} as an
if-elseif-else chain.
"""
checkArgument(!ifs.isEmpty());
return new Statement() {
@Override
protected void... | java | static Statement ifElseChain(final List<IfBlock> ifs, final Optional<Statement> elseBlock) {
checkArgument(!ifs.isEmpty());
return new Statement() {
@Override
protected void doGen(CodeBuilder adapter) {
Label end = new Label();
Label next;
for (int i = 0; i < ifs.size(); i++)... | [
"static",
"Statement",
"ifElseChain",
"(",
"final",
"List",
"<",
"IfBlock",
">",
"ifs",
",",
"final",
"Optional",
"<",
"Statement",
">",
"elseBlock",
")",
"{",
"checkArgument",
"(",
"!",
"ifs",
".",
"isEmpty",
"(",
")",
")",
";",
"return",
"new",
"Statem... | Returns a statement that encodes the given sequence of {@link IfBlock if blocks} as an
if-elseif-else chain. | [
"Returns",
"a",
"statement",
"that",
"encodes",
"the",
"given",
"sequence",
"of",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/ControlFlow.java#L57-L86 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.maxamise | static Matching maxamise(Matching matching, int[][] graph, BitSet subset) {
"""
Attempt to maximise the provided matching over a subset of vertices in a
graph.
@param matching the independent edge set to maximise
@param graph adjacency list graph representation
@param subset subset of vertices
@return ... | java | static Matching maxamise(Matching matching, int[][] graph, BitSet subset) {
new EdmondsMaximumMatching(graph, matching, subset);
return matching;
} | [
"static",
"Matching",
"maxamise",
"(",
"Matching",
"matching",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
",",
"BitSet",
"subset",
")",
"{",
"new",
"EdmondsMaximumMatching",
"(",
"graph",
",",
"matching",
",",
"subset",
")",
";",
"return",
"matching",
";",
... | Attempt to maximise the provided matching over a subset of vertices in a
graph.
@param matching the independent edge set to maximise
@param graph adjacency list graph representation
@param subset subset of vertices
@return the matching | [
"Attempt",
"to",
"maximise",
"the",
"provided",
"matching",
"over",
"a",
"subset",
"of",
"vertices",
"in",
"a",
"graph",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L391-L394 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputSemanticProperties.java | DualInputSemanticProperties.addReadFields | public void addReadFields(int input, FieldSet readFields) {
"""
Adds, to the existing information, field(s) that are read in
the source record(s) from the first input.
@param input the input of the read fields
@param readFields the position(s) in the source record(s)
"""
if (input != 0 && input != 1) {... | java | public void addReadFields(int input, FieldSet readFields) {
if (input != 0 && input != 1) {
throw new IndexOutOfBoundsException();
} else if (input == 0) {
this.readFields1 = (this.readFields1 == null) ? readFields.clone() : this.readFields1.addFields(readFields);
} else {
this.readFields2 = (this.readF... | [
"public",
"void",
"addReadFields",
"(",
"int",
"input",
",",
"FieldSet",
"readFields",
")",
"{",
"if",
"(",
"input",
"!=",
"0",
"&&",
"input",
"!=",
"1",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"else",
"if",
"(",
"inp... | Adds, to the existing information, field(s) that are read in
the source record(s) from the first input.
@param input the input of the read fields
@param readFields the position(s) in the source record(s) | [
"Adds",
"to",
"the",
"existing",
"information",
"field",
"(",
"s",
")",
"that",
"are",
"read",
"in",
"the",
"source",
"record",
"(",
"s",
")",
"from",
"the",
"first",
"input",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/DualInputSemanticProperties.java#L163-L172 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ElevationUtil.java | ElevationUtil.createElevationShadow | public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation,
@NonNull final Orientation orientation,
final boolean parallelLight) {
"""
Creates and returns a bitmap, which can be used to... | java | public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation,
@NonNull final Orientation orientation,
final boolean parallelLight) {
Condition.INSTANCE.ensureNotNull(context, "The cont... | [
"public",
"static",
"Bitmap",
"createElevationShadow",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"elevation",
",",
"@",
"NonNull",
"final",
"Orientation",
"orientation",
",",
"final",
"boolean",
"parallelLight",
")",
"{",
"Condition"... | Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on
pre-Lollipop devices. This method furthermore allows to specify, whether parallel
illumination of the view should be emulated, which causes the shadows at all of its sides to
appear identically.
@param context
The context, which... | [
"Creates",
"and",
"returns",
"a",
"bitmap",
"which",
"can",
"be",
"used",
"to",
"emulate",
"a",
"shadow",
"of",
"an",
"elevated",
"view",
"on",
"pre",
"-",
"Lollipop",
"devices",
".",
"This",
"method",
"furthermore",
"allows",
"to",
"specify",
"whether",
"... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L820-L843 |
tvbarthel/Cheerleader | library/src/main/java/fr/tvbarthel/cheerleader/library/media/MediaSessionWrapper.java | MediaSessionWrapper.setMetaData | @SuppressWarnings("deprecation")
public void setMetaData(SoundCloudTrack track, Bitmap artwork) {
"""
Update meta data used by the remote control client and the media session.
@param track track currently played.
@param artwork track artwork.
"""
if (Build.VERSION.SDK_INT < Build.VERSION_CODE... | java | @SuppressWarnings("deprecation")
public void setMetaData(SoundCloudTrack track, Bitmap artwork) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
// set meta data on the lock screen for pre lollipop.
mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTA... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"void",
"setMetaData",
"(",
"SoundCloudTrack",
"track",
",",
"Bitmap",
"artwork",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",... | Update meta data used by the remote control client and the media session.
@param track track currently played.
@param artwork track artwork. | [
"Update",
"meta",
"data",
"used",
"by",
"the",
"remote",
"control",
"client",
"and",
"the",
"media",
"session",
"."
] | train | https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/media/MediaSessionWrapper.java#L208-L234 |
grails/grails-core | grails-core/src/main/groovy/org/grails/core/lifecycle/ShutdownOperations.java | ShutdownOperations.addOperation | public static synchronized void addOperation(Runnable runnable, boolean preserveForNextShutdown) {
"""
Adds a shutdown operation
@param runnable The runnable operation
@param preserveForNextShutdown should preserve the operation for subsequent shutdowns, useful in tests
"""
shutdownOperations.add(run... | java | public static synchronized void addOperation(Runnable runnable, boolean preserveForNextShutdown) {
shutdownOperations.add(runnable);
if(preserveForNextShutdown) {
preservedShutdownOperations.add(runnable);
}
} | [
"public",
"static",
"synchronized",
"void",
"addOperation",
"(",
"Runnable",
"runnable",
",",
"boolean",
"preserveForNextShutdown",
")",
"{",
"shutdownOperations",
".",
"add",
"(",
"runnable",
")",
";",
"if",
"(",
"preserveForNextShutdown",
")",
"{",
"preservedShutd... | Adds a shutdown operation
@param runnable The runnable operation
@param preserveForNextShutdown should preserve the operation for subsequent shutdowns, useful in tests | [
"Adds",
"a",
"shutdown",
"operation"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/lifecycle/ShutdownOperations.java#L73-L78 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Minimum.java | Minimum.call | public Object call(Object comparable1, Object comparable2) {
"""
Return the minimum of two Comparable objects.
@param comparable1
the first comparable
@param comparable2
the second comparable
@return the minimum
"""
int result = COMPARATOR.compare(comparable1,
comparable2);
if (result < 0) {
... | java | public Object call(Object comparable1, Object comparable2) {
int result = COMPARATOR.compare(comparable1,
comparable2);
if (result < 0) {
return comparable1;
}
else if (result > 0) {
return comparable2;
}
return comparable1;
} | [
"public",
"Object",
"call",
"(",
"Object",
"comparable1",
",",
"Object",
"comparable2",
")",
"{",
"int",
"result",
"=",
"COMPARATOR",
".",
"compare",
"(",
"comparable1",
",",
"comparable2",
")",
";",
"if",
"(",
"result",
"<",
"0",
")",
"{",
"return",
"co... | Return the minimum of two Comparable objects.
@param comparable1
the first comparable
@param comparable2
the second comparable
@return the minimum | [
"Return",
"the",
"minimum",
"of",
"two",
"Comparable",
"objects",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Minimum.java#L53-L63 |
gosu-lang/gosu-lang | gosu-lab/src/main/java/editor/GosuDocument.java | GosuDocument.getStyleCodeAtPosition | public Integer getStyleCodeAtPosition( int iPosition ) {
"""
Returns a style code for the absolute position in the document or null if
no code is mapped.
"""
if( _locations == null || _locations.isEmpty() )
{
return null;
}
IParseTree l;
try
{
l = IParseTree.Search.getDeepe... | java | public Integer getStyleCodeAtPosition( int iPosition )
{
if( _locations == null || _locations.isEmpty() )
{
return null;
}
IParseTree l;
try
{
l = IParseTree.Search.getDeepestLocation( _locations, iPosition - _locationsOffset, true );
}
catch( Throwable t )
{
// O... | [
"public",
"Integer",
"getStyleCodeAtPosition",
"(",
"int",
"iPosition",
")",
"{",
"if",
"(",
"_locations",
"==",
"null",
"||",
"_locations",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"IParseTree",
"l",
";",
"try",
"{",
"l",
"=",
"... | Returns a style code for the absolute position in the document or null if
no code is mapped. | [
"Returns",
"a",
"style",
"code",
"for",
"the",
"absolute",
"position",
"in",
"the",
"document",
"or",
"null",
"if",
"no",
"code",
"is",
"mapped",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-lab/src/main/java/editor/GosuDocument.java#L151-L193 |
selenide/selenide | src/main/java/com/codeborne/selenide/SelenideTargetLocator.java | SelenideTargetLocator.innerFrame | public WebDriver innerFrame(String... frames) {
"""
Switch to the inner frame (last child frame in given sequence)
"""
delegate.defaultContent();
for (String frame : frames) {
try {
String selector = String.format("frame#%1$s,frame[name=%1$s],iframe#%1$s,iframe[name=%1$s]", frame);
... | java | public WebDriver innerFrame(String... frames) {
delegate.defaultContent();
for (String frame : frames) {
try {
String selector = String.format("frame#%1$s,frame[name=%1$s],iframe#%1$s,iframe[name=%1$s]", frame);
Wait().until(frameToBeAvailableAndSwitchToIt_fixed(By.cssSelector(selector)))... | [
"public",
"WebDriver",
"innerFrame",
"(",
"String",
"...",
"frames",
")",
"{",
"delegate",
".",
"defaultContent",
"(",
")",
";",
"for",
"(",
"String",
"frame",
":",
"frames",
")",
"{",
"try",
"{",
"String",
"selector",
"=",
"String",
".",
"format",
"(",
... | Switch to the inner frame (last child frame in given sequence) | [
"Switch",
"to",
"the",
"inner",
"frame",
"(",
"last",
"child",
"frame",
"in",
"given",
"sequence",
")"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/SelenideTargetLocator.java#L99-L113 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/neighborhood/util/TwoDimensionalMesh.java | TwoDimensionalMesh.getNeighbor | private int getNeighbor(int solution, int [] neighbor) {
"""
Returns the neighbor of solution
@param solution Represents the location of the solution
@param neighbor Represents the neighbor we want to get as a shift of solution. The first component
represents the shift on rows, and the second the shift on colum... | java | private int getNeighbor(int solution, int [] neighbor) {
int row = getRow(solution) ;
int col = getColumn((solution)) ;
int r ;
int c ;
r = (row + neighbor[0]) % this.rows ;
if (r < 0)
r = rows - 1;
c = (col + neighbor[1]) % this.columns ;
if (c < 0)
c = columns - 1 ;
... | [
"private",
"int",
"getNeighbor",
"(",
"int",
"solution",
",",
"int",
"[",
"]",
"neighbor",
")",
"{",
"int",
"row",
"=",
"getRow",
"(",
"solution",
")",
";",
"int",
"col",
"=",
"getColumn",
"(",
"(",
"solution",
")",
")",
";",
"int",
"r",
";",
"int"... | Returns the neighbor of solution
@param solution Represents the location of the solution
@param neighbor Represents the neighbor we want to get as a shift of solution. The first component
represents the shift on rows, and the second the shift on column
@return | [
"Returns",
"the",
"neighbor",
"of",
"solution"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/neighborhood/util/TwoDimensionalMesh.java#L77-L93 |
mattbertolini/Hermes | src/main/java/com/mattbertolini/hermes/Hermes.java | Hermes.getPropertiesFile | private static <T> InputStream getPropertiesFile(Class<T> clazz, ULocale locale) {
"""
Get the properties file associated with the given interface and locale
as an InputStream. Use the return value in an InputStream reader to load
the properties file data into a Properties object.
@param clazz The Class repre... | java | private static <T> InputStream getPropertiesFile(Class<T> clazz, ULocale locale) {
String localeStr = "";
if(locale != null) {
localeStr = '_' + locale.getName();
}
String filePath = clazz.getName().replace(DOT, SLASH) + localeStr + PROPERTIES_EXT;
return clazz.... | [
"private",
"static",
"<",
"T",
">",
"InputStream",
"getPropertiesFile",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"ULocale",
"locale",
")",
"{",
"String",
"localeStr",
"=",
"\"\"",
";",
"if",
"(",
"locale",
"!=",
"null",
")",
"{",
"localeStr",
"=",
"'... | Get the properties file associated with the given interface and locale
as an InputStream. Use the return value in an InputStream reader to load
the properties file data into a Properties object.
@param clazz The Class representing one of the i18n interface.
@param locale The locale to get the properties for.
@return R... | [
"Get",
"the",
"properties",
"file",
"associated",
"with",
"the",
"given",
"interface",
"and",
"locale",
"as",
"an",
"InputStream",
".",
"Use",
"the",
"return",
"value",
"in",
"an",
"InputStream",
"reader",
"to",
"load",
"the",
"properties",
"file",
"data",
"... | train | https://github.com/mattbertolini/Hermes/blob/2f99ac6c358bef39bccfde93185bd72ac7de7201/src/main/java/com/mattbertolini/hermes/Hermes.java#L146-L153 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.userToForm | Form userToForm(User user, Integer projectsLimit, CharSequence password, Boolean resetPassword, boolean create) {
"""
Populate the REST form with data from the User instance.
@param user the User instance to populate the Form instance with
@param projectsLimit the maximum number of projects the user i... | java | Form userToForm(User user, Integer projectsLimit, CharSequence password, Boolean resetPassword, boolean create) {
if (create) {
if ((password == null || password.toString().trim().isEmpty()) && !resetPassword) {
throw new IllegalArgumentException("either password or reset_password m... | [
"Form",
"userToForm",
"(",
"User",
"user",
",",
"Integer",
"projectsLimit",
",",
"CharSequence",
"password",
",",
"Boolean",
"resetPassword",
",",
"boolean",
"create",
")",
"{",
"if",
"(",
"create",
")",
"{",
"if",
"(",
"(",
"password",
"==",
"null",
"||",... | Populate the REST form with data from the User instance.
@param user the User instance to populate the Form instance with
@param projectsLimit the maximum number of projects the user is allowed (optional)
@param password the password, required when creating a new user
@param create whether the for... | [
"Populate",
"the",
"REST",
"form",
"with",
"data",
"from",
"the",
"User",
"instance",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L853-L885 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getFieldValue | public static Object getFieldValue(Object obj, String fieldName) throws UtilException {
"""
获取字段值
@param obj 对象
@param fieldName 字段名
@return 字段值
@throws UtilException 包装IllegalAccessException异常
"""
if (null == obj || StrUtil.isBlank(fieldName)) {
return null;
}
return getFieldValue(obj, getF... | java | public static Object getFieldValue(Object obj, String fieldName) throws UtilException {
if (null == obj || StrUtil.isBlank(fieldName)) {
return null;
}
return getFieldValue(obj, getField(obj.getClass(), fieldName));
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"obj",
",",
"String",
"fieldName",
")",
"throws",
"UtilException",
"{",
"if",
"(",
"null",
"==",
"obj",
"||",
"StrUtil",
".",
"isBlank",
"(",
"fieldName",
")",
")",
"{",
"return",
"null",
";",
... | 获取字段值
@param obj 对象
@param fieldName 字段名
@return 字段值
@throws UtilException 包装IllegalAccessException异常 | [
"获取字段值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L179-L184 |
jscep/jscep | src/main/java/org/jscep/client/Client.java | Client.getRevocationList | @SuppressWarnings("unchecked")
public X509CRL getRevocationList(final X509Certificate identity,
final PrivateKey key, final X500Principal issuer,
final BigInteger serial, final String profile)
throws ClientException, OperationFailureException {
"""
Returns the certificate re... | java | @SuppressWarnings("unchecked")
public X509CRL getRevocationList(final X509Certificate identity,
final PrivateKey key, final X500Principal issuer,
final BigInteger serial, final String profile)
throws ClientException, OperationFailureException {
LOGGER.debug("Retriving CRL... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"X509CRL",
"getRevocationList",
"(",
"final",
"X509Certificate",
"identity",
",",
"final",
"PrivateKey",
"key",
",",
"final",
"X500Principal",
"issuer",
",",
"final",
"BigInteger",
"serial",
",",
"final",... | Returns the certificate revocation list a given issuer and serial number.
<p>
This method requests a CRL for a certificate as identified by the issuer
name and the certificate serial number.
<p>
This method provides support for SCEP servers with multiple profiles.
@param identity
the identity of the client.
@param key... | [
"Returns",
"the",
"certificate",
"revocation",
"list",
"a",
"given",
"issuer",
"and",
"serial",
"number",
".",
"<p",
">",
"This",
"method",
"requests",
"a",
"CRL",
"for",
"a",
"certificate",
"as",
"identified",
"by",
"the",
"issuer",
"name",
"and",
"the",
... | train | https://github.com/jscep/jscep/blob/d2c602f8b3adb774704c24eaf62f6b8654a40e35/src/main/java/org/jscep/client/Client.java#L425-L464 |
btaz/data-util | src/main/java/com/btaz/util/files/FileTracker.java | FileTracker.createFile | public File createFile(File dir, String filename) throws DataUtilException {
"""
Create a new tracked file
@param dir file directory
@param filename filename
@return file new file
@throws DataUtilException data util exception
"""
if(dir == null) {
throw new DataUtilException("The direct... | java | public File createFile(File dir, String filename) throws DataUtilException {
if(dir == null) {
throw new DataUtilException("The directory parameter can't be a null value");
}
try {
File file = new File(dir, filename);
return createFile(file);
} catch (... | [
"public",
"File",
"createFile",
"(",
"File",
"dir",
",",
"String",
"filename",
")",
"throws",
"DataUtilException",
"{",
"if",
"(",
"dir",
"==",
"null",
")",
"{",
"throw",
"new",
"DataUtilException",
"(",
"\"The directory parameter can't be a null value\"",
")",
";... | Create a new tracked file
@param dir file directory
@param filename filename
@return file new file
@throws DataUtilException data util exception | [
"Create",
"a",
"new",
"tracked",
"file"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileTracker.java#L69-L79 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.addFieldInto | protected void addFieldInto(int[] values, DurationFieldType field, int value) {
"""
Adds the value of a field in this period.
@param values the array of values to update
@param field the field to set
@param value the value to set
@throws IllegalArgumentException if field is is null or not supported.
"... | java | protected void addFieldInto(int[] values, DurationFieldType field, int value) {
int index = indexOf(field);
if (index == -1) {
if (value != 0 || field == null) {
throw new IllegalArgumentException(
"Period does not support field '" + field + "'");
... | [
"protected",
"void",
"addFieldInto",
"(",
"int",
"[",
"]",
"values",
",",
"DurationFieldType",
"field",
",",
"int",
"value",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"field",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
... | Adds the value of a field in this period.
@param values the array of values to update
@param field the field to set
@param value the value to set
@throws IllegalArgumentException if field is is null or not supported. | [
"Adds",
"the",
"value",
"of",
"a",
"field",
"in",
"this",
"period",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L516-L526 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/session/SessionManager.java | SessionManager.getNewSession | public ExtWebDriver getNewSession(Map<String, String> override) throws Exception {
"""
Create and return a new ExtWebDriver instance. The instance is
constructed with default options, with the provided Map of key/value
pairs overriding the corresponding pairs in the options. This new
ExtWebDriver instance will ... | java | public ExtWebDriver getNewSession(Map<String, String> override) throws Exception {
return getNewSession(override, true);
} | [
"public",
"ExtWebDriver",
"getNewSession",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"override",
")",
"throws",
"Exception",
"{",
"return",
"getNewSession",
"(",
"override",
",",
"true",
")",
";",
"}"
] | Create and return a new ExtWebDriver instance. The instance is
constructed with default options, with the provided Map of key/value
pairs overriding the corresponding pairs in the options. This new
ExtWebDriver instance will then become the current session.
@param override
A Map of options to be overridden
@return A n... | [
"Create",
"and",
"return",
"a",
"new",
"ExtWebDriver",
"instance",
".",
"The",
"instance",
"is",
"constructed",
"with",
"default",
"options",
"with",
"the",
"provided",
"Map",
"of",
"key",
"/",
"value",
"pairs",
"overriding",
"the",
"corresponding",
"pairs",
"... | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/session/SessionManager.java#L318-L320 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayKeyword | public static String getDisplayKeyword(String keyword, String displayLocaleID) {
"""
<strong>[icu]</strong> Returns a keyword localized for display in the specified locale.
@param keyword the keyword to be displayed.
@param displayLocaleID the id of the locale in which to display the keyword.
@return the locali... | java | public static String getDisplayKeyword(String keyword, String displayLocaleID) {
return getDisplayKeywordInternal(keyword, new ULocale(displayLocaleID));
} | [
"public",
"static",
"String",
"getDisplayKeyword",
"(",
"String",
"keyword",
",",
"String",
"displayLocaleID",
")",
"{",
"return",
"getDisplayKeywordInternal",
"(",
"keyword",
",",
"new",
"ULocale",
"(",
"displayLocaleID",
")",
")",
";",
"}"
] | <strong>[icu]</strong> Returns a keyword localized for display in the specified locale.
@param keyword the keyword to be displayed.
@param displayLocaleID the id of the locale in which to display the keyword.
@return the localized keyword name.
@see #getKeywords(String) | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"keyword",
"localized",
"for",
"display",
"in",
"the",
"specified",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1679-L1681 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAGNode.java | MDAGNode.addOutgoingTransition | public MDAGNode addOutgoingTransition(char letter, boolean targetAcceptStateStatus) {
"""
新建一个转移目标<br>
Creates an outgoing _transition labeled with a
given char that has a new node as its target.
@param letter a char representing the desired label of the _transition
@param targetAccept... | java | public MDAGNode addOutgoingTransition(char letter, boolean targetAcceptStateStatus)
{
MDAGNode newTargetNode = new MDAGNode(targetAcceptStateStatus);
newTargetNode.incomingTransitionCount++;
outgoingTransitionTreeMap.put(letter, newTargetNode);
return newTargetNode;
} | [
"public",
"MDAGNode",
"addOutgoingTransition",
"(",
"char",
"letter",
",",
"boolean",
"targetAcceptStateStatus",
")",
"{",
"MDAGNode",
"newTargetNode",
"=",
"new",
"MDAGNode",
"(",
"targetAcceptStateStatus",
")",
";",
"newTargetNode",
".",
"incomingTransitionCount",
"++... | 新建一个转移目标<br>
Creates an outgoing _transition labeled with a
given char that has a new node as its target.
@param letter a char representing the desired label of the _transition
@param targetAcceptStateStatus a boolean representing to-be-created _transition target node's accept status
@retu... | [
"新建一个转移目标<br",
">",
"Creates",
"an",
"outgoing",
"_transition",
"labeled",
"with",
"a",
"given",
"char",
"that",
"has",
"a",
"new",
"node",
"as",
"its",
"target",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAGNode.java#L406-L413 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/helpers/POJOHelper.java | POJOHelper.setCommonJSONElements | private static OrderedJSONObject setCommonJSONElements(OrderedJSONObject obj, Object representation, String description) {
"""
Sets common structure to JSON objects
{
"Representation": "string",
"Description": "For a leaf (primitive, BigInteger/Decimal, Date, etc.)"
}
@param OrderedJSONObject objects to be ... | java | private static OrderedJSONObject setCommonJSONElements(OrderedJSONObject obj, Object representation, String description) {
obj.put("Representation", representation);
obj.put("Description", description);
return obj;
} | [
"private",
"static",
"OrderedJSONObject",
"setCommonJSONElements",
"(",
"OrderedJSONObject",
"obj",
",",
"Object",
"representation",
",",
"String",
"description",
")",
"{",
"obj",
".",
"put",
"(",
"\"Representation\"",
",",
"representation",
")",
";",
"obj",
".",
... | Sets common structure to JSON objects
{
"Representation": "string",
"Description": "For a leaf (primitive, BigInteger/Decimal, Date, etc.)"
}
@param OrderedJSONObject objects to be added here
@param representation Value of representation element
@param description Value of description
@return OrderedJSONObject | [
"Sets",
"common",
"structure",
"to",
"JSON",
"objects",
"{",
"Representation",
":",
"string",
"Description",
":",
"For",
"a",
"leaf",
"(",
"primitive",
"BigInteger",
"/",
"Decimal",
"Date",
"etc",
".",
")",
"}"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/helpers/POJOHelper.java#L236-L241 |
google/closure-compiler | src/com/google/javascript/jscomp/Compiler.java | Compiler.toSource | @Override
public String toSource(Node n) {
"""
Generates JavaScript source code for an AST, doesn't generate source
map info.
"""
initCompilerOptionsIfTesting();
return toSource(n, null, true);
} | java | @Override
public String toSource(Node n) {
initCompilerOptionsIfTesting();
return toSource(n, null, true);
} | [
"@",
"Override",
"public",
"String",
"toSource",
"(",
"Node",
"n",
")",
"{",
"initCompilerOptionsIfTesting",
"(",
")",
";",
"return",
"toSource",
"(",
"n",
",",
"null",
",",
"true",
")",
";",
"}"
] | Generates JavaScript source code for an AST, doesn't generate source
map info. | [
"Generates",
"JavaScript",
"source",
"code",
"for",
"an",
"AST",
"doesn",
"t",
"generate",
"source",
"map",
"info",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L2224-L2228 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/PromotionUtils.java | PromotionUtils.validatePromotionSuccessful | public static void validatePromotionSuccessful(HttpResponse response, boolean dryRun, boolean failFast, TaskListener listener) throws IOException {
"""
Checks the status of promotion response and return true on success
@param response
@param dryRun
@param failFast
@param listener
@return
"""
Sta... | java | public static void validatePromotionSuccessful(HttpResponse response, boolean dryRun, boolean failFast, TaskListener listener) throws IOException {
StatusLine status = response.getStatusLine();
String content;
try {
content = ExtractorUtils.entityToString(response.getEntity());
... | [
"public",
"static",
"void",
"validatePromotionSuccessful",
"(",
"HttpResponse",
"response",
",",
"boolean",
"dryRun",
",",
"boolean",
"failFast",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
"{",
"StatusLine",
"status",
"=",
"response",
".",
"getSt... | Checks the status of promotion response and return true on success
@param response
@param dryRun
@param failFast
@param listener
@return | [
"Checks",
"the",
"status",
"of",
"promotion",
"response",
"and",
"return",
"true",
"on",
"success"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/PromotionUtils.java#L66-L81 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/service/CoinbaseTradeServiceRaw.java | CoinbaseTradeServiceRaw.getCoinbaseTransfers | public CoinbaseTransfers getCoinbaseTransfers(Integer page, final Integer limit)
throws IOException {
"""
Authenticated resource which returns the user’s Bitcoin purchases and sells. Sorted in
descending order by creation date.
@param page Optional parameter to request a desired page of results. Will ret... | java | public CoinbaseTransfers getCoinbaseTransfers(Integer page, final Integer limit)
throws IOException {
final CoinbaseTransfers transfers =
coinbase.getTransfers(
page,
limit,
exchange.getExchangeSpecification().getApiKey(),
signatureCreator,
... | [
"public",
"CoinbaseTransfers",
"getCoinbaseTransfers",
"(",
"Integer",
"page",
",",
"final",
"Integer",
"limit",
")",
"throws",
"IOException",
"{",
"final",
"CoinbaseTransfers",
"transfers",
"=",
"coinbase",
".",
"getTransfers",
"(",
"page",
",",
"limit",
",",
"ex... | Authenticated resource which returns the user’s Bitcoin purchases and sells. Sorted in
descending order by creation date.
@param page Optional parameter to request a desired page of results. Will return page 1 if the
supplied page is null or less than 1.
@param limit Optional parameter to limit the maximum number of r... | [
"Authenticated",
"resource",
"which",
"returns",
"the",
"user’s",
"Bitcoin",
"purchases",
"and",
"sells",
".",
"Sorted",
"in",
"descending",
"order",
"by",
"creation",
"date",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/service/CoinbaseTradeServiceRaw.java#L120-L131 |
DataArt/CalculationEngine | calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/ConverterUtils.java | ConverterUtils.resolveCellValue | public static ICellValue resolveCellValue(Cell c) {
"""
Returns the new {@link CellValue} from provided {@link Cell}.
"""
if (c == null) { return CellValue.BLANK; }
switch (c.getCellType()) {
case CELL_TYPE_NUMERIC: { return CellValue.from(c.getNumericCellValue()); }
... | java | public static ICellValue resolveCellValue(Cell c) {
if (c == null) { return CellValue.BLANK; }
switch (c.getCellType()) {
case CELL_TYPE_NUMERIC: { return CellValue.from(c.getNumericCellValue()); }
case CELL_TYPE_STRING: { return CellValue.from(c.getStringCellValue()); }... | [
"public",
"static",
"ICellValue",
"resolveCellValue",
"(",
"Cell",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"return",
"CellValue",
".",
"BLANK",
";",
"}",
"switch",
"(",
"c",
".",
"getCellType",
"(",
")",
")",
"{",
"case",
"CELL_TYPE_NUME... | Returns the new {@link CellValue} from provided {@link Cell}. | [
"Returns",
"the",
"new",
"{"
] | train | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/ConverterUtils.java#L171-L183 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java | GVRShadowMap.setPerspShadowMatrix | void setPerspShadowMatrix(Matrix4f modelMtx, GVRLight light) {
"""
Sets the shadow matrix for the spot light from the input model/view
matrix and the shadow camera projection matrix.
@param modelMtx light model transform (to world coordinates)
@param light spot light component to update
"""
GVR... | java | void setPerspShadowMatrix(Matrix4f modelMtx, GVRLight light)
{
GVRPerspectiveCamera camera = (GVRPerspectiveCamera) getCamera();
if (camera == null)
{
return;
}
float angle = light.getFloat("outer_cone_angle");
float near = camera.getNearClippingDistance(... | [
"void",
"setPerspShadowMatrix",
"(",
"Matrix4f",
"modelMtx",
",",
"GVRLight",
"light",
")",
"{",
"GVRPerspectiveCamera",
"camera",
"=",
"(",
"GVRPerspectiveCamera",
")",
"getCamera",
"(",
")",
";",
"if",
"(",
"camera",
"==",
"null",
")",
"{",
"return",
";",
... | Sets the shadow matrix for the spot light from the input model/view
matrix and the shadow camera projection matrix.
@param modelMtx light model transform (to world coordinates)
@param light spot light component to update | [
"Sets",
"the",
"shadow",
"matrix",
"for",
"the",
"spot",
"light",
"from",
"the",
"input",
"model",
"/",
"view",
"matrix",
"and",
"the",
"shadow",
"camera",
"projection",
"matrix",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java#L135-L163 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/DenseMatrix.java | DenseMatrix.from1DArray | public static DenseMatrix from1DArray(int rows, int columns, double[] array) {
"""
Creates a {@link DenseMatrix} of the given 1D {@code array} w/o
copying the underlying array.
"""
return Basic1DMatrix.from1DArray(rows, columns, array);
} | java | public static DenseMatrix from1DArray(int rows, int columns, double[] array) {
return Basic1DMatrix.from1DArray(rows, columns, array);
} | [
"public",
"static",
"DenseMatrix",
"from1DArray",
"(",
"int",
"rows",
",",
"int",
"columns",
",",
"double",
"[",
"]",
"array",
")",
"{",
"return",
"Basic1DMatrix",
".",
"from1DArray",
"(",
"rows",
",",
"columns",
",",
"array",
")",
";",
"}"
] | Creates a {@link DenseMatrix} of the given 1D {@code array} w/o
copying the underlying array. | [
"Creates",
"a",
"{"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/DenseMatrix.java#L102-L104 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java | DfuServiceInitiator.setZip | public DfuServiceInitiator setZip(@NonNull final Uri uri) {
"""
Sets the URI to the Distribution packet (ZIP) or to a ZIP file matching the deprecated naming
convention.
@param uri the URI of the file
@return the builder
@see #setZip(String)
@see #setZip(int)
"""
return init(uri, null, 0, DfuBaseServi... | java | public DfuServiceInitiator setZip(@NonNull final Uri uri) {
return init(uri, null, 0, DfuBaseService.TYPE_AUTO, DfuBaseService.MIME_TYPE_ZIP);
} | [
"public",
"DfuServiceInitiator",
"setZip",
"(",
"@",
"NonNull",
"final",
"Uri",
"uri",
")",
"{",
"return",
"init",
"(",
"uri",
",",
"null",
",",
"0",
",",
"DfuBaseService",
".",
"TYPE_AUTO",
",",
"DfuBaseService",
".",
"MIME_TYPE_ZIP",
")",
";",
"}"
] | Sets the URI to the Distribution packet (ZIP) or to a ZIP file matching the deprecated naming
convention.
@param uri the URI of the file
@return the builder
@see #setZip(String)
@see #setZip(int) | [
"Sets",
"the",
"URI",
"to",
"the",
"Distribution",
"packet",
"(",
"ZIP",
")",
"or",
"to",
"a",
"ZIP",
"file",
"matching",
"the",
"deprecated",
"naming",
"convention",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L565-L567 |
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.desaturate | public static Expression desaturate(Generator generator, FunctionCall input) {
"""
Decreases the saturation of the given color by N percent.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation
"""
Color color = input.getExp... | java | public static Expression desaturate(Generator generator, FunctionCall input) {
Color color = input.getExpectedColorParam(0);
int decrease = input.getExpectedIntParam(1);
return changeSaturation(color, -decrease);
} | [
"public",
"static",
"Expression",
"desaturate",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"Color",
"color",
"=",
"input",
".",
"getExpectedColorParam",
"(",
"0",
")",
";",
"int",
"decrease",
"=",
"input",
".",
"getExpectedIntParam",
... | Decreases the saturation of the given color by N percent.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Decreases",
"the",
"saturation",
"of",
"the",
"given",
"color",
"by",
"N",
"percent",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L156-L160 |
sagiegurari/fax4j | src/main/java/org/fax4j/FaxClientFactory.java | FaxClientFactory.createFaxClient | public static FaxClient createFaxClient(String type,Properties configuration) {
"""
This function creates a new fax client based on the provided configuration.
@param type
The fax client type (may be null for default type)
@param configuration
The fax client configuration (may be null)
@return The fax ... | java | public static FaxClient createFaxClient(String type,Properties configuration)
{
return FaxClientFactory.createFaxClientImpl(type,configuration);
} | [
"public",
"static",
"FaxClient",
"createFaxClient",
"(",
"String",
"type",
",",
"Properties",
"configuration",
")",
"{",
"return",
"FaxClientFactory",
".",
"createFaxClientImpl",
"(",
"type",
",",
"configuration",
")",
";",
"}"
] | This function creates a new fax client based on the provided configuration.
@param type
The fax client type (may be null for default type)
@param configuration
The fax client configuration (may be null)
@return The fax client instance | [
"This",
"function",
"creates",
"a",
"new",
"fax",
"client",
"based",
"on",
"the",
"provided",
"configuration",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/FaxClientFactory.java#L174-L177 |
reactor/reactor-netty | src/main/java/reactor/netty/channel/BootstrapHandlers.java | BootstrapHandlers.finalizeHandler | public static void finalizeHandler(Bootstrap b,
ChannelOperations.OnSetup opsFactory,
ConnectionObserver listener) {
"""
Finalize a bootstrap pipeline configuration by turning it into a
{@link ChannelInitializer} to safely initialize each child channel.
@param b a bootstrap
@param opsFactory an operatio... | java | public static void finalizeHandler(Bootstrap b,
ChannelOperations.OnSetup opsFactory,
ConnectionObserver listener) {
Objects.requireNonNull(b, "bootstrap");
Objects.requireNonNull(listener, "listener");
BootstrapPipelineHandler pipeline = null;
ChannelHandler handler = b.config().handler();
if (handler... | [
"public",
"static",
"void",
"finalizeHandler",
"(",
"Bootstrap",
"b",
",",
"ChannelOperations",
".",
"OnSetup",
"opsFactory",
",",
"ConnectionObserver",
"listener",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"b",
",",
"\"bootstrap\"",
")",
";",
"Objects",
... | Finalize a bootstrap pipeline configuration by turning it into a
{@link ChannelInitializer} to safely initialize each child channel.
@param b a bootstrap
@param opsFactory an operation factory
@param listener a connection observer | [
"Finalize",
"a",
"bootstrap",
"pipeline",
"configuration",
"by",
"turning",
"it",
"into",
"a",
"{",
"@link",
"ChannelInitializer",
"}",
"to",
"safely",
"initialize",
"each",
"child",
"channel",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/channel/BootstrapHandlers.java#L101-L128 |
apereo/cas | support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/SecurityTokenServiceClientBuilder.java | SecurityTokenServiceClientBuilder.buildClientForRelyingPartyTokenResponses | public SecurityTokenServiceClient buildClientForRelyingPartyTokenResponses(final SecurityToken securityToken,
final WSFederationRegisteredService service) {
"""
Build client for relying party token responses.
@param securityToken the... | java | public SecurityTokenServiceClient buildClientForRelyingPartyTokenResponses(final SecurityToken securityToken,
final WSFederationRegisteredService service) {
val cxfBus = BusFactory.getDefaultBus();
val sts = new SecurityToken... | [
"public",
"SecurityTokenServiceClient",
"buildClientForRelyingPartyTokenResponses",
"(",
"final",
"SecurityToken",
"securityToken",
",",
"final",
"WSFederationRegisteredService",
"service",
")",
"{",
"val",
"cxfBus",
"=",
"BusFactory",
".",
"getDefaultBus",
"(",
")",
";",
... | Build client for relying party token responses.
@param securityToken the security token
@param service the service
@return the security token service client | [
"Build",
"client",
"for",
"relying",
"party",
"token",
"responses",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/SecurityTokenServiceClientBuilder.java#L66-L85 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/CellValue.java | CellValue.fromTypeAndObject | public static CellValue fromTypeAndObject(final TableCell.Type type, final Object o) {
"""
Converts a value to a CellValue
@param type a hint
@param o the value
@return the CellValue
"""
// TODO: use the type hint, with a switch...
return CellValue.fromObject(o);
} | java | public static CellValue fromTypeAndObject(final TableCell.Type type, final Object o) {
// TODO: use the type hint, with a switch...
return CellValue.fromObject(o);
} | [
"public",
"static",
"CellValue",
"fromTypeAndObject",
"(",
"final",
"TableCell",
".",
"Type",
"type",
",",
"final",
"Object",
"o",
")",
"{",
"// TODO: use the type hint, with a switch...",
"return",
"CellValue",
".",
"fromObject",
"(",
"o",
")",
";",
"}"
] | Converts a value to a CellValue
@param type a hint
@param o the value
@return the CellValue | [
"Converts",
"a",
"value",
"to",
"a",
"CellValue"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/CellValue.java#L64-L67 |
ggrandes/packer | src/main/java/org/javastack/packer/Packer.java | Packer.getStringCollection | @SuppressWarnings( {
"""
Get Collection<String> stored in UTF-8 format
@param clazz
to instantiate
@return
@see #putStringCollection(Collection)
"""
"unchecked", "rawtypes"
})
public Collection<String> getStringCollection(final Class<? extends Collection> clazz) {
try {
final Collection<String>... | java | @SuppressWarnings({
"unchecked", "rawtypes"
})
public Collection<String> getStringCollection(final Class<? extends Collection> clazz) {
try {
final Collection<String> collection = clazz.newInstance();
final int len = getVInt();
for (int i = 0; i < len; i++) {
collection.add(getString());
}
ret... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"Collection",
"<",
"String",
">",
"getStringCollection",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"clazz",
")",
"{",
"try",
"{",
"final",
"Coll... | Get Collection<String> stored in UTF-8 format
@param clazz
to instantiate
@return
@see #putStringCollection(Collection) | [
"Get",
"Collection<String",
">",
"stored",
"in",
"UTF",
"-",
"8",
"format"
] | train | https://github.com/ggrandes/packer/blob/0b37b286a3d0555050eb2e65419dd74f8d8d3e78/src/main/java/org/javastack/packer/Packer.java#L1154-L1170 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeObjectInstance | public void writeObjectInstance(OutputStream out, ObjectInstanceWrapper value) throws IOException {
"""
Encode an ObjectInstanceWrapper instance as JSON:
{
"objectName" : ObjectName,
"className" : String,
"URL" : URL,
}
@param out The stream to write JSON to
@param value The ObjectInstanceWrapper instance... | java | public void writeObjectInstance(OutputStream out, ObjectInstanceWrapper value) throws IOException {
// ObjectInstance has no known sub-class.
writeStartObject(out);
writeObjectNameField(out, OM_OBJECTNAME, value.objectInstance.getObjectName());
writeStringField(out, OM_CLASSNAME, value.o... | [
"public",
"void",
"writeObjectInstance",
"(",
"OutputStream",
"out",
",",
"ObjectInstanceWrapper",
"value",
")",
"throws",
"IOException",
"{",
"// ObjectInstance has no known sub-class.",
"writeStartObject",
"(",
"out",
")",
";",
"writeObjectNameField",
"(",
"out",
",",
... | Encode an ObjectInstanceWrapper instance as JSON:
{
"objectName" : ObjectName,
"className" : String,
"URL" : URL,
}
@param out The stream to write JSON to
@param value The ObjectInstanceWrapper instance to encode.
The value and value.objectInstance can't be null.
@throws IOException If an I/O error occurs
@see #readOb... | [
"Encode",
"an",
"ObjectInstanceWrapper",
"instance",
"as",
"JSON",
":",
"{",
"objectName",
":",
"ObjectName",
"className",
":",
"String",
"URL",
":",
"URL",
"}"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1019-L1026 |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/reflect/ReflectionUtil.java | ReflectionUtil.getAccessibleMethodByName | public static Method getAccessibleMethodByName(final Class clazz, final String methodName) {
"""
循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
如向上转型到Object仍无法找到, 返回null.
只匹配函数名, 如果有多个同名函数返回第一个
方法需要被多次调用时,先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
因为getMethod() 不能获取父类的private函数, 因此采用循环向上的get... | java | public static Method getAccessibleMethodByName(final Class clazz, final String methodName) {
Validate.notNull(clazz, "clazz can't be null");
Validate.notEmpty(methodName, "methodName can't be blank");
for (Class<?> searchType = clazz; searchType != Object.class; searchType = searchType.getSuperclass()) {
Meth... | [
"public",
"static",
"Method",
"getAccessibleMethodByName",
"(",
"final",
"Class",
"clazz",
",",
"final",
"String",
"methodName",
")",
"{",
"Validate",
".",
"notNull",
"(",
"clazz",
",",
"\"clazz can't be null\"",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"meth... | 循环向上转型, 获取对象的DeclaredMethod,并强制设置为可访问.
如向上转型到Object仍无法找到, 返回null.
只匹配函数名, 如果有多个同名函数返回第一个
方法需要被多次调用时,先使用本函数先取得Method,然后调用Method.invoke(Object obj, Object... args)
因为getMethod() 不能获取父类的private函数, 因此采用循环向上的getDeclaredMethods() | [
"循环向上转型",
"获取对象的DeclaredMethod",
"并强制设置为可访问",
"."
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/reflect/ReflectionUtil.java#L94-L108 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.getVirtualMachineScaleSetIpConfiguration | public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) {
"""
Get the specified network interface ip configuration in a virtual machine scal... | java | public NetworkInterfaceIPConfigurationInner getVirtualMachineScaleSetIpConfiguration(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName) {
return getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync(resourc... | [
"public",
"NetworkInterfaceIPConfigurationInner",
"getVirtualMachineScaleSetIpConfiguration",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualMachineScaleSetName",
",",
"String",
"virtualmachineIndex",
",",
"String",
"networkInterfaceName",
",",
"String",
"ipConfiguratio... | Get the specified network interface ip configuration in a virtual machine scale set.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@param virtualmachineIndex The virtual machine index.
@param networkInterfaceName The name of the ne... | [
"Get",
"the",
"specified",
"network",
"interface",
"ip",
"configuration",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L2216-L2218 |
derari/cthul | xml/src/main/java/org/cthul/resolve/ResolvingException.java | ResolvingException.againAs | public <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable>
RuntimeException againAs(Class<T1> t1, Class<T2> t2, Class<T3> t3)
throws T1, T2, T3 {
"""
Throws the {@linkplain #getResolvingCause() cause} if it is one of the
specified types, otherwise returns a
{@li... | java | public <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable>
RuntimeException againAs(Class<T1> t1, Class<T2> t2, Class<T3> t3)
throws T1, T2, T3 {
return againAs(t1, t2, t3, NULL_EX);
} | [
"public",
"<",
"T1",
"extends",
"Throwable",
",",
"T2",
"extends",
"Throwable",
",",
"T3",
"extends",
"Throwable",
">",
"RuntimeException",
"againAs",
"(",
"Class",
"<",
"T1",
">",
"t1",
",",
"Class",
"<",
"T2",
">",
"t2",
",",
"Class",
"<",
"T3",
">",... | Throws the {@linkplain #getResolvingCause() cause} if it is one of the
specified types, otherwise returns a
{@linkplain #asRuntimeException() runtime exception}.
<p>
Intended to be written as {@code throw e.againAs(IOException.class)}.
@param <T1>
@param <T2>
@param <T3>
@param t1
@param t2
@param t3
@return runtime ex... | [
"Throws",
"the",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/ResolvingException.java#L186-L190 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.zincrby | @Override
public Double zincrby(final byte[] key, final double increment, final byte[] member) {
"""
If member already exists in the sorted set adds the increment to its score and updates the
position of the element in the sorted set accordingly. If member does not already exist in the
sorted set it is added w... | java | @Override
public Double zincrby(final byte[] key, final double increment, final byte[] member) {
checkIsInMultiOrPipeline();
client.zincrby(key, increment, member);
return BuilderFactory.DOUBLE.build(client.getOne());
} | [
"@",
"Override",
"public",
"Double",
"zincrby",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"double",
"increment",
",",
"final",
"byte",
"[",
"]",
"member",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"zincrby",
"(",
"key... | If member already exists in the sorted set adds the increment to its score and updates the
position of the element in the sorted set accordingly. If member does not already exist in the
sorted set it is added with increment as score (that is, like if the previous score was
virtually zero). If key does not exist a new s... | [
"If",
"member",
"already",
"exists",
"in",
"the",
"sorted",
"set",
"adds",
"the",
"increment",
"to",
"its",
"score",
"and",
"updates",
"the",
"position",
"of",
"the",
"element",
"in",
"the",
"sorted",
"set",
"accordingly",
".",
"If",
"member",
"does",
"not... | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1730-L1735 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixInvalidFiringEventType | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_FIRING_EVENT_TYPE)
public void fixInvalidFiringEventType(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Invalid firing event type".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
FiredEventRemoveModification.... | java | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_FIRING_EVENT_TYPE)
public void fixInvalidFiringEventType(final Issue issue, IssueResolutionAcceptor acceptor) {
FiredEventRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"INVALID_FIRING_EVENT_TYPE",
")",
"public",
"void",
"fixInvalidFiringEventType",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"Fi... | Quick fix for "Invalid firing event type".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Invalid",
"firing",
"event",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L795-L798 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java | SqlGeneratorDefaultImpl.getInsertMNStatement | public String getInsertMNStatement(String table, String[] pkColumns1, String[] pkColumns2) {
"""
generate an INSERT-Statement for M:N indirection table
@param table
@param pkColumns1
@param pkColumns2
"""
SqlStatement sql;
String result;
String[] cols = new String[pkColumns1.l... | java | public String getInsertMNStatement(String table, String[] pkColumns1, String[] pkColumns2)
{
SqlStatement sql;
String result;
String[] cols = new String[pkColumns1.length + pkColumns2.length];
System.arraycopy(pkColumns1, 0, cols, 0, pkColumns1.length);
System.arrayco... | [
"public",
"String",
"getInsertMNStatement",
"(",
"String",
"table",
",",
"String",
"[",
"]",
"pkColumns1",
",",
"String",
"[",
"]",
"pkColumns2",
")",
"{",
"SqlStatement",
"sql",
";",
"String",
"result",
";",
"String",
"[",
"]",
"cols",
"=",
"new",
"String... | generate an INSERT-Statement for M:N indirection table
@param table
@param pkColumns1
@param pkColumns2 | [
"generate",
"an",
"INSERT",
"-",
"Statement",
"for",
"M",
":",
"N",
"indirection",
"table"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java#L235-L252 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.updateIndices | public void updateIndices(ApiType oldObj, ApiType newObj, String key) {
"""
updateIndices modifies the objects location in the managed indexes, if this is an update, you
must provide an oldObj.
<p>Note: updateIndices must be called from a function that already has a lock on the cache.
@param oldObj the old ... | java | public void updateIndices(ApiType oldObj, ApiType newObj, String key) {
// if we got an old object, we need to remove it before we can add
// it again.
if (oldObj != null) {
deleteFromIndices(oldObj, key);
}
for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : indexers.entrySet... | [
"public",
"void",
"updateIndices",
"(",
"ApiType",
"oldObj",
",",
"ApiType",
"newObj",
",",
"String",
"key",
")",
"{",
"// if we got an old object, we need to remove it before we can add",
"// it again.",
"if",
"(",
"oldObj",
"!=",
"null",
")",
"{",
"deleteFromIndices",... | updateIndices modifies the objects location in the managed indexes, if this is an update, you
must provide an oldObj.
<p>Note: updateIndices must be called from a function that already has a lock on the cache.
@param oldObj the old obj
@param newObj the new obj
@param key the key | [
"updateIndices",
"modifies",
"the",
"objects",
"location",
"in",
"the",
"managed",
"indexes",
"if",
"this",
"is",
"an",
"update",
"you",
"must",
"provide",
"an",
"oldObj",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L326-L347 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/ExistPolicyIndex.java | ExistPolicyIndex.nodeToByte | @Deprecated
protected static byte[] nodeToByte(Node node) throws PolicyIndexException {
"""
get XML document supplied as w3c dom Node as bytes
@param node
@return
@throws PolicyIndexException
"""
ByteArrayOutputStream out = new ByteArrayOutputStream();
Writer output = new OutputStreamW... | java | @Deprecated
protected static byte[] nodeToByte(Node node) throws PolicyIndexException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
Writer output = new OutputStreamWriter(out, Charset.forName("UTF-8"));
try {
SunXmlSerializers.writePrettyPrintWithDecl(node, output);... | [
"@",
"Deprecated",
"protected",
"static",
"byte",
"[",
"]",
"nodeToByte",
"(",
"Node",
"node",
")",
"throws",
"PolicyIndexException",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"Writer",
"output",
"=",
"new",
"Output... | get XML document supplied as w3c dom Node as bytes
@param node
@return
@throws PolicyIndexException | [
"get",
"XML",
"document",
"supplied",
"as",
"w3c",
"dom",
"Node",
"as",
"bytes"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/ExistPolicyIndex.java#L304-L316 |
rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Line.java | Line.countCharsStart | private int countCharsStart(final char ch, final boolean allowSpaces) {
"""
Counts the amount of 'ch' at the start of this line optionally ignoring
spaces.
@param ch
The char to count.
@param allowSpaces
Whether to allow spaces or not
@return Number of characters found.
@since 0.12
"""
int cou... | java | private int countCharsStart(final char ch, final boolean allowSpaces)
{
int count = 0;
for (int i = 0; i < this.value.length(); i++)
{
final char c = this.value.charAt(i);
if (c == ' ' && allowSpaces)
{
continue;
}
i... | [
"private",
"int",
"countCharsStart",
"(",
"final",
"char",
"ch",
",",
"final",
"boolean",
"allowSpaces",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"value",
".",
"length",
"(",
")",
";",
... | Counts the amount of 'ch' at the start of this line optionally ignoring
spaces.
@param ch
The char to count.
@param allowSpaces
Whether to allow spaces or not
@return Number of characters found.
@since 0.12 | [
"Counts",
"the",
"amount",
"of",
"ch",
"at",
"the",
"start",
"of",
"this",
"line",
"optionally",
"ignoring",
"spaces",
"."
] | train | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Line.java#L247-L267 |
d-michail/jheaps | src/main/java/org/jheaps/tree/FibonacciHeap.java | FibonacciHeap.forceDecreaseKeyToMinimum | private void forceDecreaseKeyToMinimum(Node<K, V> n) {
"""
/*
Decrease the key of a node to the minimum. Helper function for performing
a delete operation. Does not change the node's actual key, but behaves as
the key is the minimum key in the heap.
"""
// if not root
Node<K, V> y = n.parent... | java | private void forceDecreaseKeyToMinimum(Node<K, V> n) {
// if not root
Node<K, V> y = n.parent;
if (y != null) {
cut(n, y);
cascadingCut(y);
}
minRoot = n;
} | [
"private",
"void",
"forceDecreaseKeyToMinimum",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"// if not root",
"Node",
"<",
"K",
",",
"V",
">",
"y",
"=",
"n",
".",
"parent",
";",
"if",
"(",
"y",
"!=",
"null",
")",
"{",
"cut",
"(",
"n",
... | /*
Decrease the key of a node to the minimum. Helper function for performing
a delete operation. Does not change the node's actual key, but behaves as
the key is the minimum key in the heap. | [
"/",
"*",
"Decrease",
"the",
"key",
"of",
"a",
"node",
"to",
"the",
"minimum",
".",
"Helper",
"function",
"for",
"performing",
"a",
"delete",
"operation",
".",
"Does",
"not",
"change",
"the",
"node",
"s",
"actual",
"key",
"but",
"behaves",
"as",
"the",
... | train | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/FibonacciHeap.java#L552-L560 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.createOrUpdateAsync | public Observable<SignalRResourceInner> createOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) {
"""
Create a new SignalR service and update an exiting SignalR service.
@param resourceGroupName The name of the resource group that contains the resource. You can obt... | java | public Observable<SignalRResourceInner> createOrUpdateAsync(String resourceGroupName, String resourceName, SignalRCreateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResourceInner>()... | [
"public",
"Observable",
"<",
"SignalRResourceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"SignalRCreateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupN... | Create a new SignalR service and update an exiting SignalR service.
@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 resourceName The name of the SignalR resource.
@param parameters Parameters for the... | [
"Create",
"a",
"new",
"SignalR",
"service",
"and",
"update",
"an",
"exiting",
"SignalR",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L1087-L1094 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/ExceptionTableSensitiveMethodVisitor.java | ExceptionTableSensitiveMethodVisitor.onVisitLookupSwitchInsn | protected void onVisitLookupSwitchInsn(Label defaultTarget, int[] key, Label[] label) {
"""
Visits a lookup switch instruction.
@param defaultTarget The default option.
@param key The key values.
@param label The targets for each key.
"""
super.visitLookupSwitchInsn(defaultTarge... | java | protected void onVisitLookupSwitchInsn(Label defaultTarget, int[] key, Label[] label) {
super.visitLookupSwitchInsn(defaultTarget, key, label);
} | [
"protected",
"void",
"onVisitLookupSwitchInsn",
"(",
"Label",
"defaultTarget",
",",
"int",
"[",
"]",
"key",
",",
"Label",
"[",
"]",
"label",
")",
"{",
"super",
".",
"visitLookupSwitchInsn",
"(",
"defaultTarget",
",",
"key",
",",
"label",
")",
";",
"}"
] | Visits a lookup switch instruction.
@param defaultTarget The default option.
@param key The key values.
@param label The targets for each key. | [
"Visits",
"a",
"lookup",
"switch",
"instruction",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/ExceptionTableSensitiveMethodVisitor.java#L279-L281 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpService.java | AnnotatedHttpService.serve0 | private CompletionStage<HttpResponse> serve0(ServiceRequestContext ctx, HttpRequest req) {
"""
Executes the service method in different ways regarding its return type and whether the request is
required to be aggregated. If the return type of the method is not a {@link CompletionStage} or
{@link HttpResponse}, i... | java | private CompletionStage<HttpResponse> serve0(ServiceRequestContext ctx, HttpRequest req) {
final CompletableFuture<AggregatedHttpMessage> f =
aggregationRequired(aggregationStrategy, req) ? req.aggregate()
: CompletableFuture.complete... | [
"private",
"CompletionStage",
"<",
"HttpResponse",
">",
"serve0",
"(",
"ServiceRequestContext",
"ctx",
",",
"HttpRequest",
"req",
")",
"{",
"final",
"CompletableFuture",
"<",
"AggregatedHttpMessage",
">",
"f",
"=",
"aggregationRequired",
"(",
"aggregationStrategy",
",... | Executes the service method in different ways regarding its return type and whether the request is
required to be aggregated. If the return type of the method is not a {@link CompletionStage} or
{@link HttpResponse}, it will be executed in the blocking task executor. | [
"Executes",
"the",
"service",
"method",
"in",
"different",
"ways",
"regarding",
"its",
"return",
"type",
"and",
"whether",
"the",
"request",
"is",
"required",
"to",
"be",
"aggregated",
".",
"If",
"the",
"return",
"type",
"of",
"the",
"method",
"is",
"not",
... | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpService.java#L221-L245 |
zzsrv/torrent-utils | src/main/java/cc/vcode/util/SHA1Hasher.java | SHA1Hasher.update | public void update( byte[] data, int pos, int len ) {
"""
Start or continue a hash calculation with the given data,
starting at the given position, for the given length.
@param data input
@param pos start position
@param len length
"""
update( ByteBuffer.wrap( data, pos, len ));
} | java | public void update( byte[] data, int pos, int len ) {
update( ByteBuffer.wrap( data, pos, len ));
} | [
"public",
"void",
"update",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"pos",
",",
"int",
"len",
")",
"{",
"update",
"(",
"ByteBuffer",
".",
"wrap",
"(",
"data",
",",
"pos",
",",
"len",
")",
")",
";",
"}"
] | Start or continue a hash calculation with the given data,
starting at the given position, for the given length.
@param data input
@param pos start position
@param len length | [
"Start",
"or",
"continue",
"a",
"hash",
"calculation",
"with",
"the",
"given",
"data",
"starting",
"at",
"the",
"given",
"position",
"for",
"the",
"given",
"length",
"."
] | train | https://github.com/zzsrv/torrent-utils/blob/70ba8bccd5af1ed7a18c42c61ad409256e9865f3/src/main/java/cc/vcode/util/SHA1Hasher.java#L66-L68 |
mapbox/mapbox-plugins-android | plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/OfflineRegionSelector.java | OfflineRegionSelector.getOfflineDownloadOptions | public static OfflineDownloadOptions getOfflineDownloadOptions(final Intent data, byte[] metadata) {
"""
Use this method to take the returning {@link Intent} data and construct a {@link OfflineDownloadOptions}
instance which can be used for starting a new offline region download.
@param data the {@link Act... | java | public static OfflineDownloadOptions getOfflineDownloadOptions(final Intent data, byte[] metadata) {
return OfflineDownloadOptions.builder()
.definition(getRegionDefinition(data))
.regionName(getRegionName(data))
.metadata(metadata)
.build();
} | [
"public",
"static",
"OfflineDownloadOptions",
"getOfflineDownloadOptions",
"(",
"final",
"Intent",
"data",
",",
"byte",
"[",
"]",
"metadata",
")",
"{",
"return",
"OfflineDownloadOptions",
".",
"builder",
"(",
")",
".",
"definition",
"(",
"getRegionDefinition",
"(",
... | Use this method to take the returning {@link Intent} data and construct a {@link OfflineDownloadOptions}
instance which can be used for starting a new offline region download.
@param data the {@link Activity#startActivityForResult(Intent, int)} which this method should
be used in provides the returning intent whic... | [
"Use",
"this",
"method",
"to",
"take",
"the",
"returning",
"{",
"@link",
"Intent",
"}",
"data",
"and",
"construct",
"a",
"{",
"@link",
"OfflineDownloadOptions",
"}",
"instance",
"which",
"can",
"be",
"used",
"for",
"starting",
"a",
"new",
"offline",
"region"... | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/OfflineRegionSelector.java#L61-L67 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getSimpleName | public static String getSimpleName(final Class<?> cls, String valueIfNull) {
"""
<p>Null-safe version of <code>aClass.getSimpleName()</code></p>
@param cls the class for which to get the simple name; may be null
@param valueIfNull the value to return if null
@return the simple class name or {@code valueIfNul... | java | public static String getSimpleName(final Class<?> cls, String valueIfNull) {
return cls == null ? valueIfNull : cls.getSimpleName();
} | [
"public",
"static",
"String",
"getSimpleName",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"valueIfNull",
")",
"{",
"return",
"cls",
"==",
"null",
"?",
"valueIfNull",
":",
"cls",
".",
"getSimpleName",
"(",
")",
";",
"}"
] | <p>Null-safe version of <code>aClass.getSimpleName()</code></p>
@param cls the class for which to get the simple name; may be null
@param valueIfNull the value to return if null
@return the simple class name or {@code valueIfNull}
@since 3.0
@see Class#getSimpleName() | [
"<p",
">",
"Null",
"-",
"safe",
"version",
"of",
"<code",
">",
"aClass",
".",
"getSimpleName",
"()",
"<",
"/",
"code",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L266-L268 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/widget/tabbedpane/TabbedPane.java | TabbedPane.disableTab | public void disableTab (Tab tab, boolean disable) {
"""
Disables or enables given tab.
<p>
When disabling, if tab is currently selected, TabbedPane will switch to first available enabled Tab. If there is no any
other enabled Tab, listener {@link TabbedPaneListener#switchedTab(Tab)} with null Tab will be called.... | java | public void disableTab (Tab tab, boolean disable) {
checkIfTabsBelongsToThisPane(tab);
TabButtonTable buttonTable = tabsButtonMap.get(tab);
buttonTable.button.setDisabled(disable);
if (activeTab == tab && disable) {
if (selectFirstEnabledTab()) {
return;
}
// there isn't any tab we can switch to... | [
"public",
"void",
"disableTab",
"(",
"Tab",
"tab",
",",
"boolean",
"disable",
")",
"{",
"checkIfTabsBelongsToThisPane",
"(",
"tab",
")",
";",
"TabButtonTable",
"buttonTable",
"=",
"tabsButtonMap",
".",
"get",
"(",
"tab",
")",
";",
"buttonTable",
".",
"button",... | Disables or enables given tab.
<p>
When disabling, if tab is currently selected, TabbedPane will switch to first available enabled Tab. If there is no any
other enabled Tab, listener {@link TabbedPaneListener#switchedTab(Tab)} with null Tab will be called.
<p>
When enabling Tab and there isn't any others Tab enabled an... | [
"Disables",
"or",
"enables",
"given",
"tab",
".",
"<p",
">",
"When",
"disabling",
"if",
"tab",
"is",
"currently",
"selected",
"TabbedPane",
"will",
"switch",
"to",
"first",
"available",
"enabled",
"Tab",
".",
"If",
"there",
"is",
"no",
"any",
"other",
"ena... | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/widget/tabbedpane/TabbedPane.java#L282-L301 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickLongOnTextAndPress | public void clickLongOnTextAndPress(String text, int index) {
"""
Long clicks on a specific {@link TextView} and then selects
an item from the context menu that appears. Will automatically scroll when needed.
@param text the text that should be clicked on. The parameter <strong>will</strong> be interpreted as ... | java | public void clickLongOnTextAndPress(String text, int index)
{
clickOnText(text, true, 0, true, 0);
dialogUtils.waitForDialogToOpen(Timeout.getSmallTimeout(), true);
try{
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
}catch(SecurityException e){
Assert.fail("Can not press the context menu!");
}
... | [
"public",
"void",
"clickLongOnTextAndPress",
"(",
"String",
"text",
",",
"int",
"index",
")",
"{",
"clickOnText",
"(",
"text",
",",
"true",
",",
"0",
",",
"true",
",",
"0",
")",
";",
"dialogUtils",
".",
"waitForDialogToOpen",
"(",
"Timeout",
".",
"getSmall... | Long clicks on a specific {@link TextView} and then selects
an item from the context menu that appears. Will automatically scroll when needed.
@param text the text that should be clicked on. The parameter <strong>will</strong> be interpreted as a regular expression.
@param index the index of the menu item that should ... | [
"Long",
"clicks",
"on",
"a",
"specific",
"{",
"@link",
"TextView",
"}",
"and",
"then",
"selects",
"an",
"item",
"from",
"the",
"context",
"menu",
"that",
"appears",
".",
"Will",
"automatically",
"scroll",
"when",
"needed",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L253-L268 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.overTheBox_offer_offerName_GET | public OvhPrice overTheBox_offer_offerName_GET(net.minidev.ovh.api.price.overthebox.OvhOfferEnum offerName) throws IOException {
"""
Get the price of overTheBox offers
REST: GET /price/overTheBox/offer/{offerName}
@param offerName [required] The name of the offer
"""
String qPath = "/price/overTheBox/off... | java | public OvhPrice overTheBox_offer_offerName_GET(net.minidev.ovh.api.price.overthebox.OvhOfferEnum offerName) throws IOException {
String qPath = "/price/overTheBox/offer/{offerName}";
StringBuilder sb = path(qPath, offerName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice... | [
"public",
"OvhPrice",
"overTheBox_offer_offerName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"overthebox",
".",
"OvhOfferEnum",
"offerName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/overTheBox/offer/{offe... | Get the price of overTheBox offers
REST: GET /price/overTheBox/offer/{offerName}
@param offerName [required] The name of the offer | [
"Get",
"the",
"price",
"of",
"overTheBox",
"offers"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L167-L172 |
jbundle/jbundle | thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHelpPane.java | JHelpPane.doAction | public boolean doAction(String strAction, int iOptions) {
"""
Process this action.
Override this for functionality.
@param strAction The action command or message.
@return true if handled.
"""
if (Constants.CLOSE.equalsIgnoreCase(strAction))
{
this.linkActivated(null, null);
... | java | public boolean doAction(String strAction, int iOptions)
{
if (Constants.CLOSE.equalsIgnoreCase(strAction))
{
this.linkActivated(null, null);
return true; // Don't let anyone else handle my actions
}
return super.doAction(strAction, iOptions);
} | [
"public",
"boolean",
"doAction",
"(",
"String",
"strAction",
",",
"int",
"iOptions",
")",
"{",
"if",
"(",
"Constants",
".",
"CLOSE",
".",
"equalsIgnoreCase",
"(",
"strAction",
")",
")",
"{",
"this",
".",
"linkActivated",
"(",
"null",
",",
"null",
")",
";... | Process this action.
Override this for functionality.
@param strAction The action command or message.
@return true if handled. | [
"Process",
"this",
"action",
".",
"Override",
"this",
"for",
"functionality",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHelpPane.java#L120-L128 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java | MetricBuilder.withMinValue | public MetricBuilder withMinValue(Number value, String prettyPrintFormat) {
"""
Sets the minimum value of the metric to be built.
@param value the minimum value of the metric
@param prettyPrintFormat the format of the output (@see {@link DecimalFormat})
@return this
"""
min = new MetricValue(value... | java | public MetricBuilder withMinValue(Number value, String prettyPrintFormat) {
min = new MetricValue(value.toString(), prettyPrintFormat);
return this;
} | [
"public",
"MetricBuilder",
"withMinValue",
"(",
"Number",
"value",
",",
"String",
"prettyPrintFormat",
")",
"{",
"min",
"=",
"new",
"MetricValue",
"(",
"value",
".",
"toString",
"(",
")",
",",
"prettyPrintFormat",
")",
";",
"return",
"this",
";",
"}"
] | Sets the minimum value of the metric to be built.
@param value the minimum value of the metric
@param prettyPrintFormat the format of the output (@see {@link DecimalFormat})
@return this | [
"Sets",
"the",
"minimum",
"value",
"of",
"the",
"metric",
"to",
"be",
"built",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java#L104-L107 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java | MapTileTransitionModel.updateTile | private void updateTile(Collection<Tile> resolved, Collection<Tile> toResolve, Tile tile, int ox, int oy) {
"""
Update tile.
@param resolved The resolved tiles.
@param toResolve Tiles to resolve after.
@param tile The tile reference.
@param ox The horizontal offset to update.
@param oy The vertical offset t... | java | private void updateTile(Collection<Tile> resolved, Collection<Tile> toResolve, Tile tile, int ox, int oy)
{
final int tx = tile.getInTileX();
final int ty = tile.getInTileY();
final Tile neighbor = map.getTile(tx + ox, ty + oy);
if (neighbor != null)
{
up... | [
"private",
"void",
"updateTile",
"(",
"Collection",
"<",
"Tile",
">",
"resolved",
",",
"Collection",
"<",
"Tile",
">",
"toResolve",
",",
"Tile",
"tile",
",",
"int",
"ox",
",",
"int",
"oy",
")",
"{",
"final",
"int",
"tx",
"=",
"tile",
".",
"getInTileX",... | Update tile.
@param resolved The resolved tiles.
@param toResolve Tiles to resolve after.
@param tile The tile reference.
@param ox The horizontal offset to update.
@param oy The vertical offset to update. | [
"Update",
"tile",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java#L198-L208 |
apache/incubator-druid | core/src/main/java/org/apache/druid/timeline/SegmentId.java | SegmentId.tryParse | @Nullable
public static SegmentId tryParse(String dataSource, String segmentId) {
"""
Tries to parse a segment id from the given String representation, or returns null on failure. If returns a non-null
{@code SegmentId} object, calling {@link #toString()} on the latter is guaranteed to return a string equal to ... | java | @Nullable
public static SegmentId tryParse(String dataSource, String segmentId)
{
List<SegmentId> possibleParsings = iteratePossibleParsingsWithDataSource(dataSource, segmentId);
return possibleParsings.isEmpty() ? null : possibleParsings.get(0);
} | [
"@",
"Nullable",
"public",
"static",
"SegmentId",
"tryParse",
"(",
"String",
"dataSource",
",",
"String",
"segmentId",
")",
"{",
"List",
"<",
"SegmentId",
">",
"possibleParsings",
"=",
"iteratePossibleParsingsWithDataSource",
"(",
"dataSource",
",",
"segmentId",
")"... | Tries to parse a segment id from the given String representation, or returns null on failure. If returns a non-null
{@code SegmentId} object, calling {@link #toString()} on the latter is guaranteed to return a string equal to the
argument string of the {@code tryParse()} call.
It is possible that this method may incor... | [
"Tries",
"to",
"parse",
"a",
"segment",
"id",
"from",
"the",
"given",
"String",
"representation",
"or",
"returns",
"null",
"on",
"failure",
".",
"If",
"returns",
"a",
"non",
"-",
"null",
"{",
"@code",
"SegmentId",
"}",
"object",
"calling",
"{",
"@link",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/timeline/SegmentId.java#L119-L124 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java | XmlStringBuilder.optIntAttribute | public XmlStringBuilder optIntAttribute(String name, int value) {
"""
Add the given attribute if {@code value => 0}.
@param name
@param value
@return a reference to this object
"""
if (value >= 0) {
attribute(name, Integer.toString(value));
}
return this;
} | java | public XmlStringBuilder optIntAttribute(String name, int value) {
if (value >= 0) {
attribute(name, Integer.toString(value));
}
return this;
} | [
"public",
"XmlStringBuilder",
"optIntAttribute",
"(",
"String",
"name",
",",
"int",
"value",
")",
"{",
"if",
"(",
"value",
">=",
"0",
")",
"{",
"attribute",
"(",
"name",
",",
"Integer",
".",
"toString",
"(",
"value",
")",
")",
";",
"}",
"return",
"this... | Add the given attribute if {@code value => 0}.
@param name
@param value
@return a reference to this object | [
"Add",
"the",
"given",
"attribute",
"if",
"{",
"@code",
"value",
"=",
">",
"0",
"}",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java#L337-L342 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java | AbstractJobLauncher.prepareWorkUnits | private WorkUnitStream prepareWorkUnits(WorkUnitStream workUnits, JobState jobState) {
"""
Prepare the flattened {@link WorkUnit}s for execution by populating the job and task IDs.
"""
return workUnits.transform(new WorkUnitPreparator(this.jobContext.getJobId()));
} | java | private WorkUnitStream prepareWorkUnits(WorkUnitStream workUnits, JobState jobState) {
return workUnits.transform(new WorkUnitPreparator(this.jobContext.getJobId()));
} | [
"private",
"WorkUnitStream",
"prepareWorkUnits",
"(",
"WorkUnitStream",
"workUnits",
",",
"JobState",
"jobState",
")",
"{",
"return",
"workUnits",
".",
"transform",
"(",
"new",
"WorkUnitPreparator",
"(",
"this",
".",
"jobContext",
".",
"getJobId",
"(",
")",
")",
... | Prepare the flattened {@link WorkUnit}s for execution by populating the job and task IDs. | [
"Prepare",
"the",
"flattened",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java#L699-L701 |
voldemort/voldemort | src/java/voldemort/server/protocol/admin/AsyncOperationService.java | AsyncOperationService.isComplete | public synchronized boolean isComplete(int requestId, boolean remove) {
"""
Check if the an operation is done or not.
@param requestId Id of the request
@param remove Whether remove the request out of the list if it is done.
@return True if request is complete, false otherwise
"""
if (!operations.... | java | public synchronized boolean isComplete(int requestId, boolean remove) {
if (!operations.containsKey(requestId))
throw new VoldemortException("No operation with id " + requestId + " found");
if (operations.get(requestId).getStatus().isComplete()) {
if (logger.isDebugEnabled())
... | [
"public",
"synchronized",
"boolean",
"isComplete",
"(",
"int",
"requestId",
",",
"boolean",
"remove",
")",
"{",
"if",
"(",
"!",
"operations",
".",
"containsKey",
"(",
"requestId",
")",
")",
"throw",
"new",
"VoldemortException",
"(",
"\"No operation with id \"",
... | Check if the an operation is done or not.
@param requestId Id of the request
@param remove Whether remove the request out of the list if it is done.
@return True if request is complete, false otherwise | [
"Check",
"if",
"the",
"an",
"operation",
"is",
"done",
"or",
"not",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/protocol/admin/AsyncOperationService.java#L85-L100 |
borball/weixin-sdk | weixin-common/src/main/java/com/riversoft/weixin/common/util/JsonMapper.java | JsonMapper.convert | public <T> T convert(Object object, Class<T> clazz) {
"""
把object转出clazz对象, 比如POJO和Map互换,字符串转换成Date
@param object 原对象
@param clazz 目标类型
@param <T>
@return
"""
if (object == null) {
return null;
}
return mapper.convertValue(object, clazz);
} | java | public <T> T convert(Object object, Class<T> clazz) {
if (object == null) {
return null;
}
return mapper.convertValue(object, clazz);
} | [
"public",
"<",
"T",
">",
"T",
"convert",
"(",
"Object",
"object",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"mapper",
".",
"convertValue",
"(",
"object",
",",
... | 把object转出clazz对象, 比如POJO和Map互换,字符串转换成Date
@param object 原对象
@param clazz 目标类型
@param <T>
@return | [
"把object转出clazz对象,",
"比如POJO和Map互换,字符串转换成Date"
] | train | https://github.com/borball/weixin-sdk/blob/32bf5e45cdd8d0d28074e83954e1ec62dcf25cb7/weixin-common/src/main/java/com/riversoft/weixin/common/util/JsonMapper.java#L152-L158 |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.copyPicturesFromTemplateToResult | protected void copyPicturesFromTemplateToResult(HSSFSheet templateSheet, HSSFSheet resultSheet) {
"""
Copies all pictures from template sheet to result sheet, shift picture depending on area dependencies
@param templateSheet - template sheet
@param resultSheet - result sheet
"""
List<HSSFClientAn... | java | protected void copyPicturesFromTemplateToResult(HSSFSheet templateSheet, HSSFSheet resultSheet) {
List<HSSFClientAnchor> list = getAllAnchors(getEscherAggregate(templateSheet));
int i = 0;
if (CollectionUtils.isNotEmpty(orderedPicturesId)) {//just a shitty workaround for anchors without picture... | [
"protected",
"void",
"copyPicturesFromTemplateToResult",
"(",
"HSSFSheet",
"templateSheet",
",",
"HSSFSheet",
"resultSheet",
")",
"{",
"List",
"<",
"HSSFClientAnchor",
">",
"list",
"=",
"getAllAnchors",
"(",
"getEscherAggregate",
"(",
"templateSheet",
")",
")",
";",
... | Copies all pictures from template sheet to result sheet, shift picture depending on area dependencies
@param templateSheet - template sheet
@param resultSheet - result sheet | [
"Copies",
"all",
"pictures",
"from",
"template",
"sheet",
"to",
"result",
"sheet",
"shift",
"picture",
"depending",
"on",
"area",
"dependencies"
] | train | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L799-L818 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writeDateField | private void writeDateField(String fieldName, Object value) throws IOException {
"""
Write a date field to the JSON file.
@param fieldName field name
@param value field value
"""
if (value instanceof String)
{
m_writer.writeNameValuePair(fieldName + "_text", (String) value);
}
... | java | private void writeDateField(String fieldName, Object value) throws IOException
{
if (value instanceof String)
{
m_writer.writeNameValuePair(fieldName + "_text", (String) value);
}
else
{
Date val = (Date) value;
m_writer.writeNameValuePair(fieldName, val);
... | [
"private",
"void",
"writeDateField",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"m_writer",
".",
"writeNameValuePair",
"(",
"fieldName",
"+",
"\"_text\"",
",",
"(... | Write a date field to the JSON file.
@param fieldName field name
@param value field value | [
"Write",
"a",
"date",
"field",
"to",
"the",
"JSON",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L439-L450 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcMoisture33Kpa | public static String calcMoisture33Kpa(String slsnd, String slcly, String omPct) {
"""
Equation 2 for 33 kPa moisture, normal density, %v
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,1... | java | public static String calcMoisture33Kpa(String slsnd, String slcly, String omPct) {
String ret;
if ((slsnd = checkPctVal(slsnd)) == null
|| (slcly = checkPctVal(slcly)) == null
|| (omPct = checkPctVal(omPct)) == null) {
LOG.error("Invalid input parameters for ... | [
"public",
"static",
"String",
"calcMoisture33Kpa",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
")",
"{",
"String",
"ret",
";",
"if",
"(",
"(",
"slsnd",
"=",
"checkPctVal",
"(",
"slsnd",
")",
")",
"==",
"null",
"||",
"(",
"sl... | Equation 2 for 33 kPa moisture, normal density, %v
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72) | [
"Equation",
"2",
"for",
"33",
"kPa",
"moisture",
"normal",
"density",
"%v"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L144-L158 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java | KDTree.addInstanceToTree | protected void addInstanceToTree(Instance inst, KDTreeNode node)
throws Exception {
"""
Recursively adds an instance to the tree starting from
the supplied KDTreeNode.
NOTE: This should not be called by outside classes,
outside classes should instead call update(Instance)
method.
@param inst The insta... | java | protected void addInstanceToTree(Instance inst, KDTreeNode node)
throws Exception {
if (node.isALeaf()) {
int instList[] = new int[m_Instances.numInstances()];
try {
System.arraycopy(m_InstList, 0, instList, 0, node.m_End + 1); // m_InstList.squeezeIn(m_End,
... | [
"protected",
"void",
"addInstanceToTree",
"(",
"Instance",
"inst",
",",
"KDTreeNode",
"node",
")",
"throws",
"Exception",
"{",
"if",
"(",
"node",
".",
"isALeaf",
"(",
")",
")",
"{",
"int",
"instList",
"[",
"]",
"=",
"new",
"int",
"[",
"m_Instances",
".",... | Recursively adds an instance to the tree starting from
the supplied KDTreeNode.
NOTE: This should not be called by outside classes,
outside classes should instead call update(Instance)
method.
@param inst The instance to add to the tree
@param node The node to start the recursive search
from, for the leaf node where t... | [
"Recursively",
"adds",
"an",
"instance",
"to",
"the",
"tree",
"starting",
"from",
"the",
"supplied",
"KDTreeNode",
".",
"NOTE",
":",
"This",
"should",
"not",
"be",
"called",
"by",
"outside",
"classes",
"outside",
"classes",
"should",
"instead",
"call",
"update... | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/KDTree.java#L440-L486 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/ExamplesCustomizer.java | ExamplesCustomizer.applyShapeModifier | private JsonNode applyShapeModifier(JsonNode node, ShapeModifier modifier) {
"""
Apply any shape modifiers to the JSON value. This only takes care of
'exclude' and 'emitPropertyName'.
@param node The JSON node.
@param modifier The shape modifier.
@return The modified node.
"""
if (node == null ||... | java | private JsonNode applyShapeModifier(JsonNode node, ShapeModifier modifier) {
if (node == null || modifier == null) {
return node;
}
if (modifier.getExclude() == null && modifier.getModify() == null) {
return node;
}
if (!node.isObject()) return node;
... | [
"private",
"JsonNode",
"applyShapeModifier",
"(",
"JsonNode",
"node",
",",
"ShapeModifier",
"modifier",
")",
"{",
"if",
"(",
"node",
"==",
"null",
"||",
"modifier",
"==",
"null",
")",
"{",
"return",
"node",
";",
"}",
"if",
"(",
"modifier",
".",
"getExclude... | Apply any shape modifiers to the JSON value. This only takes care of
'exclude' and 'emitPropertyName'.
@param node The JSON node.
@param modifier The shape modifier.
@return The modified node. | [
"Apply",
"any",
"shape",
"modifiers",
"to",
"the",
"JSON",
"value",
".",
"This",
"only",
"takes",
"care",
"of",
"exclude",
"and",
"emitPropertyName",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/ExamplesCustomizer.java#L212-L249 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ObjectUtils.java | ObjectUtils.identityToString | @Deprecated
public static void identityToString(final StrBuilder builder, final Object object) {
"""
<p>Appends the toString that would be produced by {@code Object}
if a class did not override toString itself. {@code null}
will throw a NullPointerException for either of the two parameters. </p>
<pre>
Ob... | java | @Deprecated
public static void identityToString(final StrBuilder builder, final Object object) {
Validate.notNull(object, "Cannot get the toString of a null identity");
builder.append(object.getClass().getName())
.append('@')
.append(Integer.toHexString(System.identityHas... | [
"@",
"Deprecated",
"public",
"static",
"void",
"identityToString",
"(",
"final",
"StrBuilder",
"builder",
",",
"final",
"Object",
"object",
")",
"{",
"Validate",
".",
"notNull",
"(",
"object",
",",
"\"Cannot get the toString of a null identity\"",
")",
";",
"builder... | <p>Appends the toString that would be produced by {@code Object}
if a class did not override toString itself. {@code null}
will throw a NullPointerException for either of the two parameters. </p>
<pre>
ObjectUtils.identityToString(builder, "") = builder.append("java.lang.String@1e23"
ObjectUtils.identityToS... | [
"<p",
">",
"Appends",
"the",
"toString",
"that",
"would",
"be",
"produced",
"by",
"{",
"@code",
"Object",
"}",
"if",
"a",
"class",
"did",
"not",
"override",
"toString",
"itself",
".",
"{",
"@code",
"null",
"}",
"will",
"throw",
"a",
"NullPointerException",... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ObjectUtils.java#L381-L387 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/ArtifactoryAnalyzer.java | ArtifactoryAnalyzer.processPom | private void processPom(Dependency dependency, MavenArtifact ma) throws IOException, AnalysisException {
"""
If necessary, downloads the pom.xml from Central and adds the evidence to
the dependency.
@param dependency the dependency to download and process the pom.xml
@param ma the Maven artifact coordinates
... | java | private void processPom(Dependency dependency, MavenArtifact ma) throws IOException, AnalysisException {
File pomFile = null;
try {
final File baseDir = getSettings().getTempDirectory();
pomFile = File.createTempFile("pom", ".xml", baseDir);
Files.delete(pomFile.toPat... | [
"private",
"void",
"processPom",
"(",
"Dependency",
"dependency",
",",
"MavenArtifact",
"ma",
")",
"throws",
"IOException",
",",
"AnalysisException",
"{",
"File",
"pomFile",
"=",
"null",
";",
"try",
"{",
"final",
"File",
"baseDir",
"=",
"getSettings",
"(",
")"... | If necessary, downloads the pom.xml from Central and adds the evidence to
the dependency.
@param dependency the dependency to download and process the pom.xml
@param ma the Maven artifact coordinates
@throws IOException thrown if there is an I/O error
@throws AnalysisException thrown if there is an error analyzing the... | [
"If",
"necessary",
"downloads",
"the",
"pom",
".",
"xml",
"from",
"Central",
"and",
"adds",
"the",
"evidence",
"to",
"the",
"dependency",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/ArtifactoryAnalyzer.java#L232-L252 |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java | CFMLExpressionInterpreter.andOp | private Ref andOp() throws PageException {
"""
Transfomiert eine And (and) Operation. Im Gegensatz zu CFMX , werden "&&" Zeichen auch als And
Operatoren anerkannt. <br />
EBNF:<br />
<code>notOp {("and" | "&&") spaces notOp}; (* "&&" Existiert in CFMX nicht *)</code>
@return CFXD Element
@throws PageExcepti... | java | private Ref andOp() throws PageException {
Ref ref = notOp();
while (cfml.isValidIndex() && (cfml.forwardIfCurrent("&&") || cfml.forwardIfCurrent("and"))) {
cfml.removeSpace();
ref = new And(ref, notOp(), limited);
}
return ref;
} | [
"private",
"Ref",
"andOp",
"(",
")",
"throws",
"PageException",
"{",
"Ref",
"ref",
"=",
"notOp",
"(",
")",
";",
"while",
"(",
"cfml",
".",
"isValidIndex",
"(",
")",
"&&",
"(",
"cfml",
".",
"forwardIfCurrent",
"(",
"\"&&\"",
")",
"||",
"cfml",
".",
"f... | Transfomiert eine And (and) Operation. Im Gegensatz zu CFMX , werden "&&" Zeichen auch als And
Operatoren anerkannt. <br />
EBNF:<br />
<code>notOp {("and" | "&&") spaces notOp}; (* "&&" Existiert in CFMX nicht *)</code>
@return CFXD Element
@throws PageException | [
"Transfomiert",
"eine",
"And",
"(",
"and",
")",
"Operation",
".",
"Im",
"Gegensatz",
"zu",
"CFMX",
"werden",
"&&",
"Zeichen",
"auch",
"als",
"And",
"Operatoren",
"anerkannt",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"notOp",
"{... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java#L416-L423 |
facebookarchive/hadoop-20 | src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/HadoopLogParser.java | HadoopLogParser.parseLine | public EventRecord parseLine(String line) throws IOException {
"""
Parses one line of the log. If the line contains a valid
log entry, then an appropriate EventRecord is returned, after all
relevant fields have been parsed.
@param line the log line to be parsed
@return the EventRecord representing the log ... | java | public EventRecord parseLine(String line) throws IOException {
EventRecord retval = null;
if (line != null) {
// process line
String patternStr = "(" + dateformat + ")";
patternStr += "\\s+";
patternStr += "(" + timeformat + ")";
patternStr += ".{4}\\s(\\w*)\\s"; // for logLevel
... | [
"public",
"EventRecord",
"parseLine",
"(",
"String",
"line",
")",
"throws",
"IOException",
"{",
"EventRecord",
"retval",
"=",
"null",
";",
"if",
"(",
"line",
"!=",
"null",
")",
"{",
"// process line",
"String",
"patternStr",
"=",
"\"(\"",
"+",
"dateformat",
... | Parses one line of the log. If the line contains a valid
log entry, then an appropriate EventRecord is returned, after all
relevant fields have been parsed.
@param line the log line to be parsed
@return the EventRecord representing the log entry of the line. If
the line does not contain a valid log entry, then the Ev... | [
"Parses",
"one",
"line",
"of",
"the",
"log",
".",
"If",
"the",
"line",
"contains",
"a",
"valid",
"log",
"entry",
"then",
"an",
"appropriate",
"EventRecord",
"is",
"returned",
"after",
"all",
"relevant",
"fields",
"have",
"been",
"parsed",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/HadoopLogParser.java#L60-L87 |
sahan/IckleBot | icklebot/src/main/java/com/lonepulse/icklebot/injector/resolver/ImplicitInjectionResolver.java | ImplicitInjectionResolver.isCategoryResourceColor | private boolean isCategoryResourceColor(Context context, Field field) {
"""
<p>Determines if this {@link Field} injection falls into
{@link InjectionCategory#RESOURCE_COLOR}.</p>
@param context
the context from which the injection resolution is requested
@param field
the {@link Field} whose {@link Injecti... | java | private boolean isCategoryResourceColor(Context context, Field field) {
return ((Integer.class.isAssignableFrom(field.getType())
|| int.class.isAssignableFrom(field.getType()))
&& ((ReflectiveR.color(context, field.getName())) != 0))? true : false;
} | [
"private",
"boolean",
"isCategoryResourceColor",
"(",
"Context",
"context",
",",
"Field",
"field",
")",
"{",
"return",
"(",
"(",
"Integer",
".",
"class",
".",
"isAssignableFrom",
"(",
"field",
".",
"getType",
"(",
")",
")",
"||",
"int",
".",
"class",
".",
... | <p>Determines if this {@link Field} injection falls into
{@link InjectionCategory#RESOURCE_COLOR}.</p>
@param context
the context from which the injection resolution is requested
@param field
the {@link Field} whose {@link InjectionCategory} is to
be resolved
<br><br>
@return {@code true} if it's {@link InjectionCate... | [
"<p",
">",
"Determines",
"if",
"this",
"{",
"@link",
"Field",
"}",
"injection",
"falls",
"into",
"{",
"@link",
"InjectionCategory#RESOURCE_COLOR",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/injector/resolver/ImplicitInjectionResolver.java#L186-L191 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/PersistableSlicedData.java | PersistableSlicedData.readObject | public void readObject(DataInputStream dataInputStream, ObjectManagerState objectManagerState) throws ObjectManagerException, IOException {
"""
Simplified deserialization.
@param dataInputStream
containing the serialized Object.
@param objectManagerState
of the objectManager reconstructing the serialized Obj... | java | public void readObject(DataInputStream dataInputStream, ObjectManagerState objectManagerState) throws ObjectManagerException, IOException
{
super.readObject(dataInputStream, objectManagerState);
// Read in the serialVersionUID
dataInputStream.readLong();
// Read in the number of sl... | [
"public",
"void",
"readObject",
"(",
"DataInputStream",
"dataInputStream",
",",
"ObjectManagerState",
"objectManagerState",
")",
"throws",
"ObjectManagerException",
",",
"IOException",
"{",
"super",
".",
"readObject",
"(",
"dataInputStream",
",",
"objectManagerState",
")"... | Simplified deserialization.
@param dataInputStream
containing the serialized Object.
@param objectManagerState
of the objectManager reconstructing the serialized Object.
@exception ObjectManagerException
@exception IOException | [
"Simplified",
"deserialization",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/PersistableSlicedData.java#L206-L230 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.collectAttributeValues | public static void collectAttributeValues(Attributes attributes, String name, Collection<Object> collection) {
"""
Collect all the values of a the specified attribute from the supplied
Attributes.
@param attributes The Attributes; not <code>null</code>.
@param name The name of the Attribute to get values for.... | java | public static void collectAttributeValues(Attributes attributes, String name, Collection<Object> collection) {
collectAttributeValues(attributes, name, collection, Object.class);
} | [
"public",
"static",
"void",
"collectAttributeValues",
"(",
"Attributes",
"attributes",
",",
"String",
"name",
",",
"Collection",
"<",
"Object",
">",
"collection",
")",
"{",
"collectAttributeValues",
"(",
"attributes",
",",
"name",
",",
"collection",
",",
"Object",... | Collect all the values of a the specified attribute from the supplied
Attributes.
@param attributes The Attributes; not <code>null</code>.
@param name The name of the Attribute to get values for.
@param collection the collection to collect the values in.
@throws NoSuchAttributeException if no attribute with the specif... | [
"Collect",
"all",
"the",
"values",
"of",
"a",
"the",
"specified",
"attribute",
"from",
"the",
"supplied",
"Attributes",
"."
] | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L258-L260 |
square/picasso | picasso/src/main/java/com/squareup/picasso3/PicassoDrawable.java | PicassoDrawable.setPlaceholder | static void setPlaceholder(ImageView target, @Nullable Drawable placeholderDrawable) {
"""
Create or update the drawable on the target {@link ImageView} to display the supplied
placeholder image.
"""
target.setImageDrawable(placeholderDrawable);
if (target.getDrawable() instanceof Animatable) {
... | java | static void setPlaceholder(ImageView target, @Nullable Drawable placeholderDrawable) {
target.setImageDrawable(placeholderDrawable);
if (target.getDrawable() instanceof Animatable) {
((Animatable) target.getDrawable()).start();
}
} | [
"static",
"void",
"setPlaceholder",
"(",
"ImageView",
"target",
",",
"@",
"Nullable",
"Drawable",
"placeholderDrawable",
")",
"{",
"target",
".",
"setImageDrawable",
"(",
"placeholderDrawable",
")",
";",
"if",
"(",
"target",
".",
"getDrawable",
"(",
")",
"instan... | Create or update the drawable on the target {@link ImageView} to display the supplied
placeholder image. | [
"Create",
"or",
"update",
"the",
"drawable",
"on",
"the",
"target",
"{"
] | train | https://github.com/square/picasso/blob/89f55b76e3be2b65e5997b7698f782f16f8547e3/picasso/src/main/java/com/squareup/picasso3/PicassoDrawable.java#L73-L78 |
mariosotil/river-framework | river-core/src/main/java/org/riverframework/core/AbstractDocument.java | AbstractDocument.setFieldIfNecessary | protected boolean setFieldIfNecessary(String field, Object value) {
"""
Verifies if the new value is different from the field's old value. It's
useful, for example, in NoSQL databases that replicates data between
servers. This verification prevents to mark a field as modified and to be
replicated needlessly.
... | java | protected boolean setFieldIfNecessary(String field, Object value) {
if (!isOpen())
throw new ClosedObjectException("The Document object is closed.");
if (!compareFieldValue(field, value)) {
_doc.setField(field, value);
return true;
}
return false;
} | [
"protected",
"boolean",
"setFieldIfNecessary",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"isOpen",
"(",
")",
")",
"throw",
"new",
"ClosedObjectException",
"(",
"\"The Document object is closed.\"",
")",
";",
"if",
"(",
"!",
"com... | Verifies if the new value is different from the field's old value. It's
useful, for example, in NoSQL databases that replicates data between
servers. This verification prevents to mark a field as modified and to be
replicated needlessly.
@param field
the field that we are checking before to be modified
@param value
th... | [
"Verifies",
"if",
"the",
"new",
"value",
"is",
"different",
"from",
"the",
"field",
"s",
"old",
"value",
".",
"It",
"s",
"useful",
"for",
"example",
"in",
"NoSQL",
"databases",
"that",
"replicates",
"data",
"between",
"servers",
".",
"This",
"verification",
... | train | https://github.com/mariosotil/river-framework/blob/e8c3ae3b0a956ec9cb4e14a81376ba8e8370b44e/river-core/src/main/java/org/riverframework/core/AbstractDocument.java#L143-L153 |
alkacon/opencms-core | src/org/opencms/loader/CmsImageLoader.java | CmsImageLoader.getScaledImage | protected CmsFile getScaledImage(CmsObject cms, CmsResource resource, CmsImageScaler scaler)
throws IOException, CmsException {
"""
Returns a scaled version of the given OpenCms VFS image resource.<p>
All results are cached in disk.
If the scaled version does not exist in the cache, it is created.
Unscale... | java | protected CmsFile getScaledImage(CmsObject cms, CmsResource resource, CmsImageScaler scaler)
throws IOException, CmsException {
String cacheParam = scaler.isValid() ? scaler.toString() : null;
String cacheName = m_vfsDiskCache.getCacheName(resource, cacheParam);
byte[] content = m_vfsDiskCa... | [
"protected",
"CmsFile",
"getScaledImage",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"CmsImageScaler",
"scaler",
")",
"throws",
"IOException",
",",
"CmsException",
"{",
"String",
"cacheParam",
"=",
"scaler",
".",
"isValid",
"(",
")",
"?",
"sca... | Returns a scaled version of the given OpenCms VFS image resource.<p>
All results are cached in disk.
If the scaled version does not exist in the cache, it is created.
Unscaled versions of the images are also stored in the cache.<p>
@param cms the current users OpenCms context
@param resource the base VFS resource for... | [
"Returns",
"a",
"scaled",
"version",
"of",
"the",
"given",
"OpenCms",
"VFS",
"image",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsImageLoader.java#L342-L378 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/xpath/XPathUtils.java | XPathUtils.evaluateAsNode | public static Node evaluateAsNode(Node node, String xPathExpression, NamespaceContext nsContext) {
"""
Evaluate XPath expression with result type Node.
@param node
@param xPathExpression
@param nsContext
@return
"""
Node result = (Node) evaluateExpression(node, xPathExpression, nsContext, XPathCons... | java | public static Node evaluateAsNode(Node node, String xPathExpression, NamespaceContext nsContext) {
Node result = (Node) evaluateExpression(node, xPathExpression, nsContext, XPathConstants.NODE);
if (result == null) {
throw new CitrusRuntimeException("No result for XPath expression: '" + xPa... | [
"public",
"static",
"Node",
"evaluateAsNode",
"(",
"Node",
"node",
",",
"String",
"xPathExpression",
",",
"NamespaceContext",
"nsContext",
")",
"{",
"Node",
"result",
"=",
"(",
"Node",
")",
"evaluateExpression",
"(",
"node",
",",
"xPathExpression",
",",
"nsConte... | Evaluate XPath expression with result type Node.
@param node
@param xPathExpression
@param nsContext
@return | [
"Evaluate",
"XPath",
"expression",
"with",
"result",
"type",
"Node",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/xpath/XPathUtils.java#L181-L189 |
isisaddons-legacy/isis-module-excel | dom/src/main/java/org/isisaddons/module/excel/dom/util/ExcelServiceImpl.java | ExcelServiceImpl.toExcel | @Programmatic
public Blob toExcel(final List<WorksheetContent> worksheetContents, final String fileName) {
"""
As {@link #toExcel(WorksheetContent, String)}, but with multiple sheets.
"""
try {
final File file = newExcelConverter().appendSheet(worksheetContents);
return exce... | java | @Programmatic
public Blob toExcel(final List<WorksheetContent> worksheetContents, final String fileName) {
try {
final File file = newExcelConverter().appendSheet(worksheetContents);
return excelFileBlobConverter.toBlob(fileName, file);
} catch (final IOException ex) {
... | [
"@",
"Programmatic",
"public",
"Blob",
"toExcel",
"(",
"final",
"List",
"<",
"WorksheetContent",
">",
"worksheetContents",
",",
"final",
"String",
"fileName",
")",
"{",
"try",
"{",
"final",
"File",
"file",
"=",
"newExcelConverter",
"(",
")",
".",
"appendSheet"... | As {@link #toExcel(WorksheetContent, String)}, but with multiple sheets. | [
"As",
"{"
] | train | https://github.com/isisaddons-legacy/isis-module-excel/blob/a3b92b1797ab2ed609667933d4164e9fb54b9f25/dom/src/main/java/org/isisaddons/module/excel/dom/util/ExcelServiceImpl.java#L80-L88 |
groupon/odo | client/src/main/java/com/groupon/odo/client/PathValueClient.java | PathValueClient.removeDefaultCustomResponse | public static boolean removeDefaultCustomResponse(String pathValue, String requestType) {
"""
Remove any overrides for an endpoint on the default profile, client
@param pathValue path (endpoint) value
@param requestType path request type. "GET", "POST", etc
@return true if success, false otherwise
"""
... | java | public static boolean removeDefaultCustomResponse(String pathValue, String requestType) {
try {
JSONObject profile = getDefaultProfile();
String profileName = profile.getString("name");
PathValueClient client = new PathValueClient(profileName, false);
return clien... | [
"public",
"static",
"boolean",
"removeDefaultCustomResponse",
"(",
"String",
"pathValue",
",",
"String",
"requestType",
")",
"{",
"try",
"{",
"JSONObject",
"profile",
"=",
"getDefaultProfile",
"(",
")",
";",
"String",
"profileName",
"=",
"profile",
".",
"getString... | Remove any overrides for an endpoint on the default profile, client
@param pathValue path (endpoint) value
@param requestType path request type. "GET", "POST", etc
@return true if success, false otherwise | [
"Remove",
"any",
"overrides",
"for",
"an",
"endpoint",
"on",
"the",
"default",
"profile",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L84-L94 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryRoundingsSingletonSpi.java | BaseMonetaryRoundingsSingletonSpi.isRoundingAvailable | public boolean isRoundingAvailable(CurrencyUnit currencyUnit, String... providers) {
"""
Checks if a {@link javax.money.MonetaryRounding} is available given a {@link javax.money.CurrencyUnit}.
@param currencyUnit The currency, which determines the required precision. As {@link java.math.RoundingMode},
by defau... | java | public boolean isRoundingAvailable(CurrencyUnit currencyUnit, String... providers) {
return isRoundingAvailable(RoundingQueryBuilder.of().setProviderNames(providers).setCurrency(currencyUnit).build());
} | [
"public",
"boolean",
"isRoundingAvailable",
"(",
"CurrencyUnit",
"currencyUnit",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"isRoundingAvailable",
"(",
"RoundingQueryBuilder",
".",
"of",
"(",
")",
".",
"setProviderNames",
"(",
"providers",
")",
".",
"s... | Checks if a {@link javax.money.MonetaryRounding} is available given a {@link javax.money.CurrencyUnit}.
@param currencyUnit The currency, which determines the required precision. As {@link java.math.RoundingMode},
by default, {@link java.math.RoundingMode#HALF_UP} is used.
@param providers the providers and orderin... | [
"Checks",
"if",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"MonetaryRounding",
"}",
"is",
"available",
"given",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"CurrencyUnit",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryRoundingsSingletonSpi.java#L127-L129 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.findActualTypeByGenericsPlaceholderName | public static ClassNode findActualTypeByGenericsPlaceholderName(String placeholderName, Map<GenericsType, GenericsType> genericsPlaceholderAndTypeMap) {
"""
Get the actual type according to the placeholder name
@param placeholderName the placeholder name, e.g. T, E
@param genericsPlaceholderAndTypeMap the resu... | java | public static ClassNode findActualTypeByGenericsPlaceholderName(String placeholderName, Map<GenericsType, GenericsType> genericsPlaceholderAndTypeMap) {
for (Map.Entry<GenericsType, GenericsType> entry : genericsPlaceholderAndTypeMap.entrySet()) {
GenericsType declaringGenericsType = entry.getKey();... | [
"public",
"static",
"ClassNode",
"findActualTypeByGenericsPlaceholderName",
"(",
"String",
"placeholderName",
",",
"Map",
"<",
"GenericsType",
",",
"GenericsType",
">",
"genericsPlaceholderAndTypeMap",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"GenericsType",
",... | Get the actual type according to the placeholder name
@param placeholderName the placeholder name, e.g. T, E
@param genericsPlaceholderAndTypeMap the result of {@link #makeDeclaringAndActualGenericsTypeMap(ClassNode, ClassNode)}
@return the actual type | [
"Get",
"the",
"actual",
"type",
"according",
"to",
"the",
"placeholder",
"name"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L991-L1001 |
indeedeng/util | io/src/main/java/com/indeed/util/io/SafeFiles.java | SafeFiles.createAtomicFile | @Nonnull
public static SafeOutputStream createAtomicFile(final Path path) throws IOException {
"""
This is just like a lazy variation of {@link SafeFiles#write}. It opens a temp file
and proxies writes through to the underlying file.
<p>
Upon calling {@link SafeOutputStream#commit()} the rest of the safe... | java | @Nonnull
public static SafeOutputStream createAtomicFile(final Path path) throws IOException {
final Path dir = path.getParent();
final Path name = path.getFileName();
final Path tempFile = Files.createTempFile(
dir,
name.toString(),
".tmp",
... | [
"@",
"Nonnull",
"public",
"static",
"SafeOutputStream",
"createAtomicFile",
"(",
"final",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"final",
"Path",
"dir",
"=",
"path",
".",
"getParent",
"(",
")",
";",
"final",
"Path",
"name",
"=",
"path",
".",
"g... | This is just like a lazy variation of {@link SafeFiles#write}. It opens a temp file
and proxies writes through to the underlying file.
<p>
Upon calling {@link SafeOutputStream#commit()} the rest of the safety behaviors kick in:
</p>
<ul>
<li>flush</li>
<li>fsync temp file</li>
<li>close temp file</li>
<li>atomic ren... | [
"This",
"is",
"just",
"like",
"a",
"lazy",
"variation",
"of",
"{",
"@link",
"SafeFiles#write",
"}",
".",
"It",
"opens",
"a",
"temp",
"file",
"and",
"proxies",
"writes",
"through",
"to",
"the",
"underlying",
"file",
"."
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/io/src/main/java/com/indeed/util/io/SafeFiles.java#L226-L257 |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/map/MapDataHistoryDao.java | MapDataHistoryDao.getRelationHistory | public void getRelationHistory(long id, Handler<Relation> handler) {
"""
Feeds all versions of the given relation to the handler. The elements are sorted by version,
the oldest version is the first, the newest version is the last element.<br>
If not logged in, the Changeset for each returned element will be null... | java | public void getRelationHistory(long id, Handler<Relation> handler)
{
MapDataHandler mapDataHandler = new WrapperOsmElementHandler<>(Relation.class, handler);
boolean authenticate = osm.getOAuth() != null;
osm.makeRequest(RELATION + "/" + id + "/" + HISTORY, authenticate,
new MapDataParser(mapDataHandler, fac... | [
"public",
"void",
"getRelationHistory",
"(",
"long",
"id",
",",
"Handler",
"<",
"Relation",
">",
"handler",
")",
"{",
"MapDataHandler",
"mapDataHandler",
"=",
"new",
"WrapperOsmElementHandler",
"<>",
"(",
"Relation",
".",
"class",
",",
"handler",
")",
";",
"bo... | Feeds all versions of the given relation to the handler. The elements are sorted by version,
the oldest version is the first, the newest version is the last element.<br>
If not logged in, the Changeset for each returned element will be null
@throws OsmNotFoundException if the node has not been found. | [
"Feeds",
"all",
"versions",
"of",
"the",
"given",
"relation",
"to",
"the",
"handler",
".",
"The",
"elements",
"are",
"sorted",
"by",
"version",
"the",
"oldest",
"version",
"is",
"the",
"first",
"the",
"newest",
"version",
"is",
"the",
"last",
"element",
".... | train | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/MapDataHistoryDao.java#L73-L79 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.listGlobalByResourceGroupForTopicTypeAsync | public Observable<List<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeAsync(String resourceGroupName, String topicTypeName) {
"""
List all global event subscriptions under a resource group for a topic type.
List all global event subscriptions under a resource group for a specific topic type.
@pa... | java | public Observable<List<EventSubscriptionInner>> listGlobalByResourceGroupForTopicTypeAsync(String resourceGroupName, String topicTypeName) {
return listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, topicTypeName).map(new Func1<ServiceResponse<List<EventSubscriptionInner>>, List<Ev... | [
"public",
"Observable",
"<",
"List",
"<",
"EventSubscriptionInner",
">",
">",
"listGlobalByResourceGroupForTopicTypeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicTypeName",
")",
"{",
"return",
"listGlobalByResourceGroupForTopicTypeWithServiceResponseAsync",
"... | List all global event subscriptions under a resource group for a topic type.
List all global event subscriptions under a resource group for a specific topic type.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicTypeName Name of the topic type
@throws IllegalArgumentE... | [
"List",
"all",
"global",
"event",
"subscriptions",
"under",
"a",
"resource",
"group",
"for",
"a",
"topic",
"type",
".",
"List",
"all",
"global",
"event",
"subscriptions",
"under",
"a",
"resource",
"group",
"for",
"a",
"specific",
"topic",
"type",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L1116-L1123 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextArray | public <T> T[] nextArray(@NonNull Class<T> elementType) throws IOException {
"""
Reads the next array
@param <T> the component type of the array
@param elementType class information for the component type
@return the array
@throws IOException Something went wrong reading the array
"""
retur... | java | public <T> T[] nextArray(@NonNull Class<T> elementType) throws IOException {
return nextArray(StringUtils.EMPTY, elementType);
} | [
"public",
"<",
"T",
">",
"T",
"[",
"]",
"nextArray",
"(",
"@",
"NonNull",
"Class",
"<",
"T",
">",
"elementType",
")",
"throws",
"IOException",
"{",
"return",
"nextArray",
"(",
"StringUtils",
".",
"EMPTY",
",",
"elementType",
")",
";",
"}"
] | Reads the next array
@param <T> the component type of the array
@param elementType class information for the component type
@return the array
@throws IOException Something went wrong reading the array | [
"Reads",
"the",
"next",
"array"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L346-L348 |
h2oai/h2o-3 | h2o-core/src/main/java/water/api/FramesHandler.java | FramesHandler.deleteAll | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 deleteAll(int version, FramesV3 frames) {
"""
Remove ALL an unlocked frames. Throws IAE for all deletes that failed
(perhaps because the Frames were locked & in-use).
"""
final Key[] keys = KeySnapshot.globalKeysO... | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 deleteAll(int version, FramesV3 frames) {
final Key[] keys = KeySnapshot.globalKeysOfClass(Frame.class);
ArrayList<String> missing = new ArrayList<>();
Futures fs = new Futures();
for (Key key : keys) {
tr... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"FramesV3",
"deleteAll",
"(",
"int",
"version",
",",
"FramesV3",
"frames",
")",
"{",
"final",
"Key",
"[",
"]",
"keys",
"=",
"KeySnapshot",
".",
"globalKeysOfC... | Remove ALL an unlocked frames. Throws IAE for all deletes that failed
(perhaps because the Frames were locked & in-use). | [
"Remove",
"ALL",
"an",
"unlocked",
"frames",
".",
"Throws",
"IAE",
"for",
"all",
"deletes",
"that",
"failed",
"(",
"perhaps",
"because",
"the",
"Frames",
"were",
"locked",
"&",
"in",
"-",
"use",
")",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/FramesHandler.java#L284-L300 |
networknt/light-4j | mask/src/main/java/com/networknt/mask/Mask.java | Mask.maskJson | public static String maskJson(String input, String key) {
"""
Replace values in JSON using json path
@param input String The source of the string that needs to be masked
@param key String The key maps to a list of json path for masking
@return String Masked result
"""
DocumentContext ctx = JsonPath.... | java | public static String maskJson(String input, String key) {
DocumentContext ctx = JsonPath.parse(input);
return maskJson(ctx, key);
} | [
"public",
"static",
"String",
"maskJson",
"(",
"String",
"input",
",",
"String",
"key",
")",
"{",
"DocumentContext",
"ctx",
"=",
"JsonPath",
".",
"parse",
"(",
"input",
")",
";",
"return",
"maskJson",
"(",
"ctx",
",",
"key",
")",
";",
"}"
] | Replace values in JSON using json path
@param input String The source of the string that needs to be masked
@param key String The key maps to a list of json path for masking
@return String Masked result | [
"Replace",
"values",
"in",
"JSON",
"using",
"json",
"path"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/mask/src/main/java/com/networknt/mask/Mask.java#L142-L145 |
kochedykov/jlibmodbus | src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java | ModbusMaster.writeMultipleRegisters | final public void writeMultipleRegisters(int serverAddress, int startAddress, int[] registers) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
"""
This function code is used to write a block of contiguous registers (1 to 123 registers) in a
remote device.
The requested writ... | java | final public void writeMultipleRegisters(int serverAddress, int startAddress, int[] registers) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
processRequest(ModbusRequestBuilder.getInstance().buildWriteMultipleRegisters(serverAddress, startAddress, registers));
} | [
"final",
"public",
"void",
"writeMultipleRegisters",
"(",
"int",
"serverAddress",
",",
"int",
"startAddress",
",",
"int",
"[",
"]",
"registers",
")",
"throws",
"ModbusProtocolException",
",",
"ModbusNumberException",
",",
"ModbusIOException",
"{",
"processRequest",
"(... | This function code is used to write a block of contiguous registers (1 to 123 registers) in a
remote device.
The requested written values are specified in the request data field. Data is packed as two
bytes per register.
@param serverAddress a slave address
@param startAddress the address of the registers to be writt... | [
"This",
"function",
"code",
"is",
"used",
"to",
"write",
"a",
"block",
"of",
"contiguous",
"registers",
"(",
"1",
"to",
"123",
"registers",
")",
"in",
"a",
"remote",
"device",
".",
"The",
"requested",
"written",
"values",
"are",
"specified",
"in",
"the",
... | train | https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java#L338-L341 |
m-m-m/util | gwt/src/main/resources/net/sf/mmm/util/gwt/supersource/net/sf/mmm/util/exception/api/NlsRuntimeException.java | NlsRuntimeException.printStackTraceCause | private static void printStackTraceCause(Throwable nested, Locale locale, Appendable buffer) throws IOException {
"""
@see NlsThrowable#printStackTrace(Locale, Appendable)
@param nested is the {@link Throwable} to print.
@param locale is the {@link Locale} to translate to.
@param buffer is where to write the ... | java | private static void printStackTraceCause(Throwable nested, Locale locale, Appendable buffer) throws IOException {
if (nested instanceof NlsThrowable) {
((NlsThrowable) nested).printStackTrace(locale, buffer);
} else {
for (StackTraceElement element : nested.getStackTrace()) {
buffer.append(... | [
"private",
"static",
"void",
"printStackTraceCause",
"(",
"Throwable",
"nested",
",",
"Locale",
"locale",
",",
"Appendable",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"nested",
"instanceof",
"NlsThrowable",
")",
"{",
"(",
"(",
"NlsThrowable",
")",
... | @see NlsThrowable#printStackTrace(Locale, Appendable)
@param nested is the {@link Throwable} to print.
@param locale is the {@link Locale} to translate to.
@param buffer is where to write the stack trace to.
@throws IOException if caused by {@code buffer}. | [
"@see",
"NlsThrowable#printStackTrace",
"(",
"Locale",
"Appendable",
")"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/resources/net/sf/mmm/util/gwt/supersource/net/sf/mmm/util/exception/api/NlsRuntimeException.java#L184-L201 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/FileStorage.java | FileStorage.mapBlock | public ArrayList<FileSlice> mapBlock(int piece, long offset, int size) {
"""
Returns a list of {@link com.frostwire.jlibtorrent.FileSlice} objects representing the portions of
files the specified piece index, byte offset and size range overlaps.
<p>
This is the inverse mapping of {@link #mapFile(int, long, int)... | java | public ArrayList<FileSlice> mapBlock(int piece, long offset, int size) {
return mapBlock(fs.map_block(piece, offset, size));
} | [
"public",
"ArrayList",
"<",
"FileSlice",
">",
"mapBlock",
"(",
"int",
"piece",
",",
"long",
"offset",
",",
"int",
"size",
")",
"{",
"return",
"mapBlock",
"(",
"fs",
".",
"map_block",
"(",
"piece",
",",
"offset",
",",
"size",
")",
")",
";",
"}"
] | Returns a list of {@link com.frostwire.jlibtorrent.FileSlice} objects representing the portions of
files the specified piece index, byte offset and size range overlaps.
<p>
This is the inverse mapping of {@link #mapFile(int, long, int)}.
@param piece
@param offset
@param size
@return | [
"Returns",
"a",
"list",
"of",
"{",
"@link",
"com",
".",
"frostwire",
".",
"jlibtorrent",
".",
"FileSlice",
"}",
"objects",
"representing",
"the",
"portions",
"of",
"files",
"the",
"specified",
"piece",
"index",
"byte",
"offset",
"and",
"size",
"range",
"over... | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/FileStorage.java#L193-L195 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java | DBFEngine.feedTableDataFromHeader | public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableData data) throws IOException {
"""
Parse the DBF file then init the provided data structure
@param header dbf header
@param data Data to initialise
@throws java.io.IOException
"""
for (int i = 0; i < header.getNumFields()... | java | public static void feedTableDataFromHeader(DbaseFileHeader header, CreateTableData data) throws IOException {
for (int i = 0; i < header.getNumFields(); i++) {
String fieldsName = header.getFieldName(i);
final int type = dbfTypeToH2Type(header,i);
Column column = new Column(f... | [
"public",
"static",
"void",
"feedTableDataFromHeader",
"(",
"DbaseFileHeader",
"header",
",",
"CreateTableData",
"data",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"header",
".",
"getNumFields",
"(",
")",
";",
"i",
... | Parse the DBF file then init the provided data structure
@param header dbf header
@param data Data to initialise
@throws java.io.IOException | [
"Parse",
"the",
"DBF",
"file",
"then",
"init",
"the",
"provided",
"data",
"structure"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/dbf/DBFEngine.java#L59-L67 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableArray.java | MutableArray.setDate | @NonNull
@Override
public MutableArray setDate(int index, Date value) {
"""
Sets a Date object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the Date object
@return The self object
"""
return setValue(index, value);
} | java | @NonNull
@Override
public MutableArray setDate(int index, Date value) {
return setValue(index, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableArray",
"setDate",
"(",
"int",
"index",
",",
"Date",
"value",
")",
"{",
"return",
"setValue",
"(",
"index",
",",
"value",
")",
";",
"}"
] | Sets a Date object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the Date object
@return The self object | [
"Sets",
"a",
"Date",
"object",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L221-L225 |
twitter/cloudhopper-commons | ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/GsmUtil.java | GsmUtil.getShortMessageUserData | static public byte[] getShortMessageUserData(byte[] shortMessage) throws IllegalArgumentException {
"""
Gets the "User Data" part of a short message byte array. Only call this
method if the short message contains a user data header. This method will
take the value of the first byte ("N") as the length of the use... | java | static public byte[] getShortMessageUserData(byte[] shortMessage) throws IllegalArgumentException {
if (shortMessage == null) {
return null;
}
if (shortMessage.length == 0) {
return shortMessage;
}
// the entire length of UDH is the first byte + the leng... | [
"static",
"public",
"byte",
"[",
"]",
"getShortMessageUserData",
"(",
"byte",
"[",
"]",
"shortMessage",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"shortMessage",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"shortMessage",
... | Gets the "User Data" part of a short message byte array. Only call this
method if the short message contains a user data header. This method will
take the value of the first byte ("N") as the length of the user
data header, then remove ("N+1") bytes from the the short message and
return the remaining bytes as the "User... | [
"Gets",
"the",
"User",
"Data",
"part",
"of",
"a",
"short",
"message",
"byte",
"array",
".",
"Only",
"call",
"this",
"method",
"if",
"the",
"short",
"message",
"contains",
"a",
"user",
"data",
"header",
".",
"This",
"method",
"will",
"take",
"the",
"value... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/GsmUtil.java#L172-L196 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.