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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/DataSet.java | DataSet.collect | public List<T> collect() throws Exception {
"""
Convenience method to get the elements of a DataSet as a List.
As DataSet can contain a lot of data, this method should be used with caution.
@return A List containing the elements of the DataSet
"""
final String id = new AbstractID().toString();
final Ty... | java | public List<T> collect() throws Exception {
final String id = new AbstractID().toString();
final TypeSerializer<T> serializer = getType().createSerializer(getExecutionEnvironment().getConfig());
this.output(new Utils.CollectHelper<>(id, serializer)).name("collect()");
JobExecutionResult res = getExecutionEnvir... | [
"public",
"List",
"<",
"T",
">",
"collect",
"(",
")",
"throws",
"Exception",
"{",
"final",
"String",
"id",
"=",
"new",
"AbstractID",
"(",
")",
".",
"toString",
"(",
")",
";",
"final",
"TypeSerializer",
"<",
"T",
">",
"serializer",
"=",
"getType",
"(",
... | Convenience method to get the elements of a DataSet as a List.
As DataSet can contain a lot of data, this method should be used with caution.
@return A List containing the elements of the DataSet | [
"Convenience",
"method",
"to",
"get",
"the",
"elements",
"of",
"a",
"DataSet",
"as",
"a",
"List",
".",
"As",
"DataSet",
"can",
"contain",
"a",
"lot",
"of",
"data",
"this",
"method",
"should",
"be",
"used",
"with",
"caution",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L408-L427 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/inventoryservice/GetAdUnitHierarchy.java | GetAdUnitHierarchy.buildAndDisplayAdUnitTree | private static void buildAndDisplayAdUnitTree(AdUnit root, List<AdUnit> adUnits) {
"""
Builds and displays an ad unit tree from ad units underneath the root ad unit.
@param root the root ad unit to build the tree under
@param adUnits the ad units.
"""
Map<String, List<AdUnit>> treeMap = new HashMap<Str... | java | private static void buildAndDisplayAdUnitTree(AdUnit root, List<AdUnit> adUnits) {
Map<String, List<AdUnit>> treeMap = new HashMap<String, List<AdUnit>>();
for (AdUnit adUnit : adUnits) {
if (adUnit.getParentId() != null) {
if (treeMap.get(adUnit.getParentId()) == null) {
treeMap.put(ad... | [
"private",
"static",
"void",
"buildAndDisplayAdUnitTree",
"(",
"AdUnit",
"root",
",",
"List",
"<",
"AdUnit",
">",
"adUnits",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"AdUnit",
">",
">",
"treeMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List... | Builds and displays an ad unit tree from ad units underneath the root ad unit.
@param root the root ad unit to build the tree under
@param adUnits the ad units. | [
"Builds",
"and",
"displays",
"an",
"ad",
"unit",
"tree",
"from",
"ad",
"units",
"underneath",
"the",
"root",
"ad",
"unit",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/inventoryservice/GetAdUnitHierarchy.java#L128-L146 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeDoubleObj | public static Double decodeDoubleObj(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a Double object from exactly 8 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Double object or null
"""
long bits = decodeDoubleBits(... | java | public static Double decodeDoubleObj(byte[] src, int srcOffset)
throws CorruptEncodingException
{
long bits = decodeDoubleBits(src, srcOffset);
bits ^= (bits < 0) ? 0x8000000000000000L : 0xffffffffffffffffL;
return bits == 0x7fffffffffffffffL ? null : Double.longBitsToDouble(bit... | [
"public",
"static",
"Double",
"decodeDoubleObj",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"long",
"bits",
"=",
"decodeDoubleBits",
"(",
"src",
",",
"srcOffset",
")",
";",
"bits",
"^=",
"(",
"bits"... | Decodes a Double object from exactly 8 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Double object or null | [
"Decodes",
"a",
"Double",
"object",
"from",
"exactly",
"8",
"bytes",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L349-L355 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java | QueryImpl.getEntityFieldValue | private Object getEntityFieldValue(EntityMetadata entityMetadata, Object entity, String field) {
"""
Gets the entity field value.
@param entityMetadata
the entity metadata
@param entity
the entity
@param field
the field
@return the entity field value
"""
Class clazz = entityMetadata.getEntityC... | java | private Object getEntityFieldValue(EntityMetadata entityMetadata, Object entity, String field)
{
Class clazz = entityMetadata.getEntityClazz();
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
entityMetadata.getPersistenceUnit());
... | [
"private",
"Object",
"getEntityFieldValue",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Object",
"entity",
",",
"String",
"field",
")",
"{",
"Class",
"clazz",
"=",
"entityMetadata",
".",
"getEntityClazz",
"(",
")",
";",
"MetamodelImpl",
"metaModel",
"=",
"(",
... | Gets the entity field value.
@param entityMetadata
the entity metadata
@param entity
the entity
@param field
the field
@return the entity field value | [
"Gets",
"the",
"entity",
"field",
"value",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java#L568-L595 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/io/StreamUtils.java | StreamUtils.dirToTarArchiveOutputStreamRecursive | private static void dirToTarArchiveOutputStreamRecursive(FileStatus dirFileStatus, FileSystem fs,
Optional<Path> destDir, TarArchiveOutputStream tarArchiveOutputStream) throws IOException {
"""
Helper method for {@link #tar(FileSystem, FileSystem, Path, Path)} that recursively adds a directory to a given
{@... | java | private static void dirToTarArchiveOutputStreamRecursive(FileStatus dirFileStatus, FileSystem fs,
Optional<Path> destDir, TarArchiveOutputStream tarArchiveOutputStream) throws IOException {
Preconditions.checkState(fs.isDirectory(dirFileStatus.getPath()));
Path dir = destDir.isPresent() ? new Path(destD... | [
"private",
"static",
"void",
"dirToTarArchiveOutputStreamRecursive",
"(",
"FileStatus",
"dirFileStatus",
",",
"FileSystem",
"fs",
",",
"Optional",
"<",
"Path",
">",
"destDir",
",",
"TarArchiveOutputStream",
"tarArchiveOutputStream",
")",
"throws",
"IOException",
"{",
"P... | Helper method for {@link #tar(FileSystem, FileSystem, Path, Path)} that recursively adds a directory to a given
{@link TarArchiveOutputStream}. | [
"Helper",
"method",
"for",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/io/StreamUtils.java#L131-L151 |
abel533/Mapper | core/src/main/java/tk/mybatis/mapper/util/OGNL.java | OGNL.checkExampleEntityClass | public static boolean checkExampleEntityClass(Object parameter, String entityFullName) {
"""
校验通用 Example 的 entityClass 和当前方法是否匹配
@param parameter
@param entityFullName
@return
"""
if (parameter != null && parameter instanceof Example && StringUtil.isNotEmpty(entityFullName)) {
Example... | java | public static boolean checkExampleEntityClass(Object parameter, String entityFullName) {
if (parameter != null && parameter instanceof Example && StringUtil.isNotEmpty(entityFullName)) {
Example example = (Example) parameter;
Class<?> entityClass = example.getEntityClass();
i... | [
"public",
"static",
"boolean",
"checkExampleEntityClass",
"(",
"Object",
"parameter",
",",
"String",
"entityFullName",
")",
"{",
"if",
"(",
"parameter",
"!=",
"null",
"&&",
"parameter",
"instanceof",
"Example",
"&&",
"StringUtil",
".",
"isNotEmpty",
"(",
"entityFu... | 校验通用 Example 的 entityClass 和当前方法是否匹配
@param parameter
@param entityFullName
@return | [
"校验通用",
"Example",
"的",
"entityClass",
"和当前方法是否匹配"
] | train | https://github.com/abel533/Mapper/blob/45c3d716583cba3680e03f1f6790fab5e1f4f668/core/src/main/java/tk/mybatis/mapper/util/OGNL.java#L54-L64 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java | VectorUtil.randomVector | public static <V extends NumberVector> V randomVector(NumberVector.Factory<V> factory, int dim) {
"""
Produce a new vector based on random numbers in [0:1].
@param factory Vector factory
@param dim desired dimensionality
@param <V> vector type
@return new instance
"""
return randomVector(factory, dim... | java | public static <V extends NumberVector> V randomVector(NumberVector.Factory<V> factory, int dim) {
return randomVector(factory, dim, new Random());
} | [
"public",
"static",
"<",
"V",
"extends",
"NumberVector",
">",
"V",
"randomVector",
"(",
"NumberVector",
".",
"Factory",
"<",
"V",
">",
"factory",
",",
"int",
"dim",
")",
"{",
"return",
"randomVector",
"(",
"factory",
",",
"dim",
",",
"new",
"Random",
"("... | Produce a new vector based on random numbers in [0:1].
@param factory Vector factory
@param dim desired dimensionality
@param <V> vector type
@return new instance | [
"Produce",
"a",
"new",
"vector",
"based",
"on",
"random",
"numbers",
"in",
"[",
"0",
":",
"1",
"]",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java#L82-L84 |
termsuite/termsuite-core | src/main/java/fr/univnantes/termsuite/utils/TermUtils.java | TermUtils.getLemmaLemmaKey | public static String getLemmaLemmaKey(Term term1, Term term2) {
"""
Return the term pair indexing key that is compliant with {@link TermValueProviders#ALLCOMP_PAIRS}.
@see TermValueProviders#ALLCOMP_PAIRS
@param term1
First term of the pair
@param term2
Second term of the pair
@return
The indexing key for... | java | public static String getLemmaLemmaKey(Term term1, Term term2) {
List<String> lemmas = new ArrayList<>(2);
lemmas.add(term1.getWords().get(0).getWord().getLemma());
lemmas.add(term2.getWords().get(0).getWord().getLemma());
Collections.sort(lemmas);
return String.format("%s+%s", lemmas.get(0), lemmas.get(1));
... | [
"public",
"static",
"String",
"getLemmaLemmaKey",
"(",
"Term",
"term1",
",",
"Term",
"term2",
")",
"{",
"List",
"<",
"String",
">",
"lemmas",
"=",
"new",
"ArrayList",
"<>",
"(",
"2",
")",
";",
"lemmas",
".",
"add",
"(",
"term1",
".",
"getWords",
"(",
... | Return the term pair indexing key that is compliant with {@link TermValueProviders#ALLCOMP_PAIRS}.
@see TermValueProviders#ALLCOMP_PAIRS
@param term1
First term of the pair
@param term2
Second term of the pair
@return
The indexing key for the given pair | [
"Return",
"the",
"term",
"pair",
"indexing",
"key",
"that",
"is",
"compliant",
"with",
"{",
"@link",
"TermValueProviders#ALLCOMP_PAIRS",
"}",
"."
] | train | https://github.com/termsuite/termsuite-core/blob/731e5d0bc7c14180713c01a9c7dffe1925f26130/src/main/java/fr/univnantes/termsuite/utils/TermUtils.java#L207-L213 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java | WTableRenderer.paintSortDetails | private void paintSortDetails(final WTable table, final XmlStringBuilder xml) {
"""
Paints the sort details.
@param table the table being rendered
@param xml the string builder in use
"""
int col = table.getSortColumnIndex();
boolean ascending = table.isSortAscending();
xml.appendTagOpen("ui:sort")... | java | private void paintSortDetails(final WTable table, final XmlStringBuilder xml) {
int col = table.getSortColumnIndex();
boolean ascending = table.isSortAscending();
xml.appendTagOpen("ui:sort");
if (col >= 0) {
// Allow for column order
int[] cols = table.getColumnOrder();
if (cols != null) {
for (... | [
"private",
"void",
"paintSortDetails",
"(",
"final",
"WTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"int",
"col",
"=",
"table",
".",
"getSortColumnIndex",
"(",
")",
";",
"boolean",
"ascending",
"=",
"table",
".",
"isSortAscending",
"(",
... | Paints the sort details.
@param table the table being rendered
@param xml the string builder in use | [
"Paints",
"the",
"sort",
"details",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java#L245-L275 |
grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java | GroovyPagesUriSupport.getAbsoluteViewURI | public String getAbsoluteViewURI(String viewName) {
"""
Obtains a view URI that is not relative to any given controller
@param viewName The name of the view
@return The view URI
"""
FastStringWriter buf = new FastStringWriter();
return getAbsoluteViewURIInternal(viewName, buf, true);
} | java | public String getAbsoluteViewURI(String viewName) {
FastStringWriter buf = new FastStringWriter();
return getAbsoluteViewURIInternal(viewName, buf, true);
} | [
"public",
"String",
"getAbsoluteViewURI",
"(",
"String",
"viewName",
")",
"{",
"FastStringWriter",
"buf",
"=",
"new",
"FastStringWriter",
"(",
")",
";",
"return",
"getAbsoluteViewURIInternal",
"(",
"viewName",
",",
"buf",
",",
"true",
")",
";",
"}"
] | Obtains a view URI that is not relative to any given controller
@param viewName The name of the view
@return The view URI | [
"Obtains",
"a",
"view",
"URI",
"that",
"is",
"not",
"relative",
"to",
"any",
"given",
"controller"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L198-L201 |
overturetool/overture | ide/ui/src/main/java/org/overture/ide/ui/internal/util/SWTUtil.java | SWTUtil.setAccessibilityText | public static void setAccessibilityText(Control control, final String text) {
"""
Adds an accessibility listener returning the given fixed name.
@param control the control to add the accessibility support to
@param text the name
"""
control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
... | java | public static void setAccessibilityText(Control control, final String text) {
control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
public void getName(AccessibleEvent e) {
e.result= text;
}
});
} | [
"public",
"static",
"void",
"setAccessibilityText",
"(",
"Control",
"control",
",",
"final",
"String",
"text",
")",
"{",
"control",
".",
"getAccessible",
"(",
")",
".",
"addAccessibleListener",
"(",
"new",
"AccessibleAdapter",
"(",
")",
"{",
"public",
"void",
... | Adds an accessibility listener returning the given fixed name.
@param control the control to add the accessibility support to
@param text the name | [
"Adds",
"an",
"accessibility",
"listener",
"returning",
"the",
"given",
"fixed",
"name",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/ui/src/main/java/org/overture/ide/ui/internal/util/SWTUtil.java#L145-L151 |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/SoftTFIDF.java | SoftTFIDF.explainScore | public String explainScore(StringWrapper s, StringWrapper t) {
"""
Explain how the distance was computed. In the output, the tokens in S and T are listed, and the common tokens are
marked with an asterisk.
"""
BagOfTokens sBag = (BagOfTokens) s;
BagOfTokens tBag = (BagOfTokens) t;
Stri... | java | public String explainScore(StringWrapper s, StringWrapper t) {
BagOfTokens sBag = (BagOfTokens) s;
BagOfTokens tBag = (BagOfTokens) t;
StringBuilder buf = new StringBuilder("");
PrintfFormat fmt = new PrintfFormat("%.3f");
buf.append("Common tokens: ");
for (Iterator<Toke... | [
"public",
"String",
"explainScore",
"(",
"StringWrapper",
"s",
",",
"StringWrapper",
"t",
")",
"{",
"BagOfTokens",
"sBag",
"=",
"(",
"BagOfTokens",
")",
"s",
";",
"BagOfTokens",
"tBag",
"=",
"(",
"BagOfTokens",
")",
"t",
";",
"StringBuilder",
"buf",
"=",
"... | Explain how the distance was computed. In the output, the tokens in S and T are listed, and the common tokens are
marked with an asterisk. | [
"Explain",
"how",
"the",
"distance",
"was",
"computed",
".",
"In",
"the",
"output",
"the",
"tokens",
"in",
"S",
"and",
"T",
"are",
"listed",
"and",
"the",
"common",
"tokens",
"are",
"marked",
"with",
"an",
"asterisk",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/SoftTFIDF.java#L128-L165 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderRole.java | LeaderRole.drainCommands | private void drainCommands(long sequenceNumber, RaftSession session) {
"""
Sequentially drains pending commands from the session's command request queue.
@param session the session for which to drain commands
"""
// First we need to drain any commands that exist in the queue *prior* to the next sequence... | java | private void drainCommands(long sequenceNumber, RaftSession session) {
// First we need to drain any commands that exist in the queue *prior* to the next sequence number. This is
// possible if commands from the prior term are committed after a leader change.
long nextSequence = session.nextRequestSequence(... | [
"private",
"void",
"drainCommands",
"(",
"long",
"sequenceNumber",
",",
"RaftSession",
"session",
")",
"{",
"// First we need to drain any commands that exist in the queue *prior* to the next sequence number. This is",
"// possible if commands from the prior term are committed after a leader... | Sequentially drains pending commands from the session's command request queue.
@param session the session for which to drain commands | [
"Sequentially",
"drains",
"pending",
"commands",
"from",
"the",
"session",
"s",
"command",
"request",
"queue",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderRole.java#L669-L688 |
vorburger/MariaDB4j | mariaDB4j-core/src/main/java/ch/vorburger/mariadb4j/DB.java | DB.unpackEmbeddedDb | protected void unpackEmbeddedDb() {
"""
Based on the current OS, unpacks the appropriate version of MariaDB to the file system based
on the configuration.
"""
if (configuration.getBinariesClassPathLocation() == null) {
logger.info("Not unpacking any embedded database (as BinariesClassPathL... | java | protected void unpackEmbeddedDb() {
if (configuration.getBinariesClassPathLocation() == null) {
logger.info("Not unpacking any embedded database (as BinariesClassPathLocation configuration is null)");
return;
}
try {
Util.extractFromClasspathToFile(configurat... | [
"protected",
"void",
"unpackEmbeddedDb",
"(",
")",
"{",
"if",
"(",
"configuration",
".",
"getBinariesClassPathLocation",
"(",
")",
"==",
"null",
")",
"{",
"logger",
".",
"info",
"(",
"\"Not unpacking any embedded database (as BinariesClassPathLocation configuration is null)... | Based on the current OS, unpacks the appropriate version of MariaDB to the file system based
on the configuration. | [
"Based",
"on",
"the",
"current",
"OS",
"unpacks",
"the",
"appropriate",
"version",
"of",
"MariaDB",
"to",
"the",
"file",
"system",
"based",
"on",
"the",
"configuration",
"."
] | train | https://github.com/vorburger/MariaDB4j/blob/ddc7aa2a3294c9c56b1127de11949fb33a81ad7b/mariaDB4j-core/src/main/java/ch/vorburger/mariadb4j/DB.java#L349-L368 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.scrollTo | public void scrollTo() {
"""
Scrolls the page to the element, making it displayed on the current
viewport, but only if the element is present. If that condition is not
met, the scroll action will be logged, but skipped and the test will
continue.
"""
String action = "Scrolling screen to " + prettyOu... | java | public void scrollTo() {
String action = "Scrolling screen to " + prettyOutput();
String expected = prettyOutputStart() + " is now within the current viewport";
try {
// wait for element to be present
if (isNotPresent(action, expected, CANT_SCROLL)) {
retu... | [
"public",
"void",
"scrollTo",
"(",
")",
"{",
"String",
"action",
"=",
"\"Scrolling screen to \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is now within the current viewport\"",
";",
"try",
"{",
"// wai... | Scrolls the page to the element, making it displayed on the current
viewport, but only if the element is present. If that condition is not
met, the scroll action will be logged, but skipped and the test will
continue. | [
"Scrolls",
"the",
"page",
"to",
"the",
"element",
"making",
"it",
"displayed",
"on",
"the",
"current",
"viewport",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
".",
"If",
"that",
"condition",
"is",
"not",
"met",
"the",
"scroll",
"action",
"will"... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1132-L1149 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/view/PieChartView.java | PieChartView.setChartRotation | public void setChartRotation(int rotation, boolean isAnimated) {
"""
Set pie chart rotation. Don't confuse with {@link View#getRotation()}.
@param rotation
@see #getChartRotation()
"""
if (isAnimated) {
rotationAnimator.cancelAnimation();
rotationAnimator.startAnimation(pieC... | java | public void setChartRotation(int rotation, boolean isAnimated) {
if (isAnimated) {
rotationAnimator.cancelAnimation();
rotationAnimator.startAnimation(pieChartRenderer.getChartRotation(), rotation);
} else {
pieChartRenderer.setChartRotation(rotation);
}
... | [
"public",
"void",
"setChartRotation",
"(",
"int",
"rotation",
",",
"boolean",
"isAnimated",
")",
"{",
"if",
"(",
"isAnimated",
")",
"{",
"rotationAnimator",
".",
"cancelAnimation",
"(",
")",
";",
"rotationAnimator",
".",
"startAnimation",
"(",
"pieChartRenderer",
... | Set pie chart rotation. Don't confuse with {@link View#getRotation()}.
@param rotation
@see #getChartRotation() | [
"Set",
"pie",
"chart",
"rotation",
".",
"Don",
"t",
"confuse",
"with",
"{",
"@link",
"View#getRotation",
"()",
"}",
"."
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/view/PieChartView.java#L141-L149 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/AsciiArtUtils.java | AsciiArtUtils.printAsciiArt | @SneakyThrows
public static void printAsciiArt(final PrintStream out, final String asciiArt, final String additional) {
"""
Print ascii art.
@param out the out
@param asciiArt the ascii art
@param additional the additional
"""
out.println(ANSI_CYAN);
if (StringUtils.isNotBlank... | java | @SneakyThrows
public static void printAsciiArt(final PrintStream out, final String asciiArt, final String additional) {
out.println(ANSI_CYAN);
if (StringUtils.isNotBlank(additional)) {
out.println(FigletFont.convertOneLine(asciiArt));
out.println(additional);
} else ... | [
"@",
"SneakyThrows",
"public",
"static",
"void",
"printAsciiArt",
"(",
"final",
"PrintStream",
"out",
",",
"final",
"String",
"asciiArt",
",",
"final",
"String",
"additional",
")",
"{",
"out",
".",
"println",
"(",
"ANSI_CYAN",
")",
";",
"if",
"(",
"StringUti... | Print ascii art.
@param out the out
@param asciiArt the ascii art
@param additional the additional | [
"Print",
"ascii",
"art",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/AsciiArtUtils.java#L39-L49 |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java | AmazonKinesisVideoPutMediaClient.applyUserAgent | private void applyUserAgent(PutMediaRequest request, Request<PutMediaRequest> marshalled) {
"""
Apply the user agent to the marshalled request (if not already present). Appends a custom marker to track usage of the
Netty based client.
"""
if (!marshalled.getHeaders().containsKey("User-Agent")) {
... | java | private void applyUserAgent(PutMediaRequest request, Request<PutMediaRequest> marshalled) {
if (!marshalled.getHeaders().containsKey("User-Agent")) {
marshalled.addHeader("User-Agent",
RuntimeHttpUtils.getUserAgent(new ClientConfiguration(),
... | [
"private",
"void",
"applyUserAgent",
"(",
"PutMediaRequest",
"request",
",",
"Request",
"<",
"PutMediaRequest",
">",
"marshalled",
")",
"{",
"if",
"(",
"!",
"marshalled",
".",
"getHeaders",
"(",
")",
".",
"containsKey",
"(",
"\"User-Agent\"",
")",
")",
"{",
... | Apply the user agent to the marshalled request (if not already present). Appends a custom marker to track usage of the
Netty based client. | [
"Apply",
"the",
"user",
"agent",
"to",
"the",
"marshalled",
"request",
"(",
"if",
"not",
"already",
"present",
")",
".",
"Appends",
"a",
"custom",
"marker",
"to",
"track",
"usage",
"of",
"the",
"Netty",
"based",
"client",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java#L136-L143 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.createPreset | public CreatePresetResponse createPreset(String presetName, String container) {
"""
Create a preset which only convert source media file to a different container format without changing the file
contents.
@param presetName The name of the new preset.
@param container The container type for the output file. Va... | java | public CreatePresetResponse createPreset(String presetName, String container) {
return createPreset(presetName, null, container, true, null, null, null, null, null);
} | [
"public",
"CreatePresetResponse",
"createPreset",
"(",
"String",
"presetName",
",",
"String",
"container",
")",
"{",
"return",
"createPreset",
"(",
"presetName",
",",
"null",
",",
"container",
",",
"true",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
... | Create a preset which only convert source media file to a different container format without changing the file
contents.
@param presetName The name of the new preset.
@param container The container type for the output file. Valid values include mp4, flv, hls, mp3, m4a. | [
"Create",
"a",
"preset",
"which",
"only",
"convert",
"source",
"media",
"file",
"to",
"a",
"different",
"container",
"format",
"without",
"changing",
"the",
"file",
"contents",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L833-L835 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.addChainDownloadStartedEventListener | public void addChainDownloadStartedEventListener(Executor executor, ChainDownloadStartedEventListener listener) {
"""
<p>Adds a listener that will be notified on the given executor when
chain download starts.</p>
"""
peersChainDownloadStartedEventListeners.add(new ListenerRegistration<>(checkNotNull(l... | java | public void addChainDownloadStartedEventListener(Executor executor, ChainDownloadStartedEventListener listener) {
peersChainDownloadStartedEventListeners.add(new ListenerRegistration<>(checkNotNull(listener), executor));
for (Peer peer : getConnectedPeers())
peer.addChainDownloadStartedEvent... | [
"public",
"void",
"addChainDownloadStartedEventListener",
"(",
"Executor",
"executor",
",",
"ChainDownloadStartedEventListener",
"listener",
")",
"{",
"peersChainDownloadStartedEventListeners",
".",
"add",
"(",
"new",
"ListenerRegistration",
"<>",
"(",
"checkNotNull",
"(",
... | <p>Adds a listener that will be notified on the given executor when
chain download starts.</p> | [
"<p",
">",
"Adds",
"a",
"listener",
"that",
"will",
"be",
"notified",
"on",
"the",
"given",
"executor",
"when",
"chain",
"download",
"starts",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L656-L662 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.redeemCoupon | public Redemption redeemCoupon(final String couponCode, final Redemption redemption) {
"""
Redeem a {@link Coupon} on an account.
@param couponCode redeemed coupon id
@return the {@link Coupon} object
"""
return doPOST(Coupon.COUPON_RESOURCE + "/" + couponCode + Redemption.REDEEM_RESOURCE,
... | java | public Redemption redeemCoupon(final String couponCode, final Redemption redemption) {
return doPOST(Coupon.COUPON_RESOURCE + "/" + couponCode + Redemption.REDEEM_RESOURCE,
redemption, Redemption.class);
} | [
"public",
"Redemption",
"redeemCoupon",
"(",
"final",
"String",
"couponCode",
",",
"final",
"Redemption",
"redemption",
")",
"{",
"return",
"doPOST",
"(",
"Coupon",
".",
"COUPON_RESOURCE",
"+",
"\"/\"",
"+",
"couponCode",
"+",
"Redemption",
".",
"REDEEM_RESOURCE",... | Redeem a {@link Coupon} on an account.
@param couponCode redeemed coupon id
@return the {@link Coupon} object | [
"Redeem",
"a",
"{",
"@link",
"Coupon",
"}",
"on",
"an",
"account",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1581-L1584 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/debug/LogMonitor.java | LogMonitor.startSession | public static void startSession(final Context context, final String appKey, final String appSignature) {
"""
Attempts to start a new troubleshooting session. First the SDK will check if there is
an existing session stored in the persistent storage and then check if the clipboard
contains a valid access token.
T... | java | public static void startSession(final Context context, final String appKey, final String appSignature) {
dispatchOnConversationQueue(new DispatchTask() {
@Override
protected void execute() {
try {
startSessionGuarded(context, appKey, appSignature);
} catch (Exception e) {
ApptentiveLog.e(TROUB... | [
"public",
"static",
"void",
"startSession",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"appKey",
",",
"final",
"String",
"appSignature",
")",
"{",
"dispatchOnConversationQueue",
"(",
"new",
"DispatchTask",
"(",
")",
"{",
"@",
"Override",
"protec... | Attempts to start a new troubleshooting session. First the SDK will check if there is
an existing session stored in the persistent storage and then check if the clipboard
contains a valid access token.
This call is async and returns immediately. | [
"Attempts",
"to",
"start",
"a",
"new",
"troubleshooting",
"session",
".",
"First",
"the",
"SDK",
"will",
"check",
"if",
"there",
"is",
"an",
"existing",
"session",
"stored",
"in",
"the",
"persistent",
"storage",
"and",
"then",
"check",
"if",
"the",
"clipboar... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/debug/LogMonitor.java#L61-L73 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java | LiveOutputsInner.getAsync | public Observable<LiveOutputInner> getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) {
"""
Get Live Output.
Gets a Live Output.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account... | java | public Observable<LiveOutputInner> getAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).map(new Func1<ServiceResponse<LiveOutputInner>, LiveOutputInner>() {
... | [
"public",
"Observable",
"<",
"LiveOutputInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"String",
"liveOutputName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName... | Get Live Output.
Gets a Live Output.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param liveOutputName The name of the Live Output.
@throws IllegalArgumentException thrown if ... | [
"Get",
"Live",
"Output",
".",
"Gets",
"a",
"Live",
"Output",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java#L274-L281 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java | ArgumentAttr.processArg | @SuppressWarnings("unchecked")
<T extends JCExpression, Z extends ArgumentType<T>> void processArg(T that, Supplier<Z> argumentTypeFactory) {
"""
Process a method argument; this method allows the caller to specify a custom speculative attribution
logic (this is used e.g. for lambdas).
"""
UniquePo... | java | @SuppressWarnings("unchecked")
<T extends JCExpression, Z extends ArgumentType<T>> void processArg(T that, Supplier<Z> argumentTypeFactory) {
UniquePos pos = new UniquePos(that);
Z cached = (Z)argumentTypeCache.get(pos);
if (cached != null) {
//dup existing speculative type
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"<",
"T",
"extends",
"JCExpression",
",",
"Z",
"extends",
"ArgumentType",
"<",
"T",
">",
">",
"void",
"processArg",
"(",
"T",
"that",
",",
"Supplier",
"<",
"Z",
">",
"argumentTypeFactory",
")",
"{",
"Uniq... | Process a method argument; this method allows the caller to specify a custom speculative attribution
logic (this is used e.g. for lambdas). | [
"Process",
"a",
"method",
"argument",
";",
"this",
"method",
"allows",
"the",
"caller",
"to",
"specify",
"a",
"custom",
"speculative",
"attribution",
"logic",
"(",
"this",
"is",
"used",
"e",
".",
"g",
".",
"for",
"lambdas",
")",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java#L230-L242 |
cwilper/fcrepo-misc | fcrepo-dto/fcrepo-dto-core/src/main/java/com/github/cwilper/fcrepo/dto/core/io/XMLUtil.java | XMLUtil.prettyPrint | public static byte[] prettyPrint(byte[] inBytes,
boolean omitXMLDeclaration)
throws IOException {
"""
Pretty-prints the given XML.
<p>
The input must be well-formed. The transformation has the following
effect:
<ul>
<li> Leading and trailing whitespace will be ... | java | public static byte[] prettyPrint(byte[] inBytes,
boolean omitXMLDeclaration)
throws IOException {
ByteArrayOutputStream sink = new ByteArrayOutputStream();
prettyPrint(new ByteArrayInputStream(inBytes),
new OutputStreamWriter(sink, "UTF-8"... | [
"public",
"static",
"byte",
"[",
"]",
"prettyPrint",
"(",
"byte",
"[",
"]",
"inBytes",
",",
"boolean",
"omitXMLDeclaration",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"sink",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"prettyPrint",
"(... | Pretty-prints the given XML.
<p>
The input must be well-formed. The transformation has the following
effect:
<ul>
<li> Leading and trailing whitespace will be removed.</li>
<li> All processing instructions and doctype declarations will be
removed.</li>
<li> If Xalan is the currently active XML transformer (true by
defa... | [
"Pretty",
"-",
"prints",
"the",
"given",
"XML",
".",
"<p",
">",
"The",
"input",
"must",
"be",
"well",
"-",
"formed",
".",
"The",
"transformation",
"has",
"the",
"following",
"effect",
":",
"<ul",
">",
"<li",
">",
"Leading",
"and",
"trailing",
"whitespace... | train | https://github.com/cwilper/fcrepo-misc/blob/3ed0e7025c5b1d4faaa373b699be229ed72465b6/fcrepo-dto/fcrepo-dto-core/src/main/java/com/github/cwilper/fcrepo/dto/core/io/XMLUtil.java#L98-L105 |
f2prateek/rx-preferences | rx-preferences/src/main/java/com/f2prateek/rx/preferences2/RxSharedPreferences.java | RxSharedPreferences.getLong | @CheckResult @NonNull
public Preference<Long> getLong(@NonNull String key) {
"""
Create a long preference for {@code key}. Default is {@code 0}.
"""
return getLong(key, DEFAULT_LONG);
} | java | @CheckResult @NonNull
public Preference<Long> getLong(@NonNull String key) {
return getLong(key, DEFAULT_LONG);
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"Preference",
"<",
"Long",
">",
"getLong",
"(",
"@",
"NonNull",
"String",
"key",
")",
"{",
"return",
"getLong",
"(",
"key",
",",
"DEFAULT_LONG",
")",
";",
"}"
] | Create a long preference for {@code key}. Default is {@code 0}. | [
"Create",
"a",
"long",
"preference",
"for",
"{"
] | train | https://github.com/f2prateek/rx-preferences/blob/e338b4e6cee9c0c7b850be86ab41ed7b39a3637e/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/RxSharedPreferences.java#L114-L117 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/concurrency/ThreadMethods.java | ThreadMethods.forkJoinExecution | public static <T> T forkJoinExecution(Callable<T> callable, ConcurrencyConfiguration concurrencyConfiguration, boolean parallelStream) {
"""
Alternative to parallelStreams() which executes a callable in a separate
pool.
@param <T>
@param callable
@param concurrencyConfiguration
@param parallelStream
@retur... | java | public static <T> T forkJoinExecution(Callable<T> callable, ConcurrencyConfiguration concurrencyConfiguration, boolean parallelStream) {
if(parallelStream && concurrencyConfiguration.isParallelized()) {
try {
ForkJoinPool pool = new ForkJoinPool(concurrencyConfiguration.getMaxNumberO... | [
"public",
"static",
"<",
"T",
">",
"T",
"forkJoinExecution",
"(",
"Callable",
"<",
"T",
">",
"callable",
",",
"ConcurrencyConfiguration",
"concurrencyConfiguration",
",",
"boolean",
"parallelStream",
")",
"{",
"if",
"(",
"parallelStream",
"&&",
"concurrencyConfigura... | Alternative to parallelStreams() which executes a callable in a separate
pool.
@param <T>
@param callable
@param concurrencyConfiguration
@param parallelStream
@return | [
"Alternative",
"to",
"parallelStreams",
"()",
"which",
"executes",
"a",
"callable",
"in",
"a",
"separate",
"pool",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/concurrency/ThreadMethods.java#L77-L98 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.eligibility_cities_GET | public ArrayList<OvhCity> eligibility_cities_GET(String zipCode) throws IOException {
"""
Get the cities from a zipCode
REST: GET /xdsl/eligibility/cities
@param zipCode [required] The zipCode of the city
@deprecated
"""
String qPath = "/xdsl/eligibility/cities";
StringBuilder sb = path(qPath);
quer... | java | public ArrayList<OvhCity> eligibility_cities_GET(String zipCode) throws IOException {
String qPath = "/xdsl/eligibility/cities";
StringBuilder sb = path(qPath);
query(sb, "zipCode", zipCode);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t2);
} | [
"public",
"ArrayList",
"<",
"OvhCity",
">",
"eligibility_cities_GET",
"(",
"String",
"zipCode",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/eligibility/cities\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"... | Get the cities from a zipCode
REST: GET /xdsl/eligibility/cities
@param zipCode [required] The zipCode of the city
@deprecated | [
"Get",
"the",
"cities",
"from",
"a",
"zipCode"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L175-L181 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/EntryListenerAdaptors.java | EntryListenerAdaptors.createListenerAdapter | private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) {
"""
Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}.
@param eventType an {@link com.hazelcast.core.EntryEventType}.
@param listener a {@link EntryListener} instan... | java | private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) {
final ConstructorFunction<EntryListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType);
if (constructorFunction == null) {
throw new IllegalArgumentException("First, ... | [
"private",
"static",
"ListenerAdapter",
"createListenerAdapter",
"(",
"EntryEventType",
"eventType",
",",
"EntryListener",
"listener",
")",
"{",
"final",
"ConstructorFunction",
"<",
"EntryListener",
",",
"ListenerAdapter",
">",
"constructorFunction",
"=",
"CONSTRUCTORS",
... | Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}.
@param eventType an {@link com.hazelcast.core.EntryEventType}.
@param listener a {@link EntryListener} instance.
@return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} | [
"Creates",
"a",
"{",
"@link",
"ListenerAdapter",
"}",
"for",
"a",
"specific",
"{",
"@link",
"com",
".",
"hazelcast",
".",
"core",
".",
"EntryEventType",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/EntryListenerAdaptors.java#L132-L138 |
sstrickx/yahoofinance-api | src/main/java/yahoofinance/quotes/csv/QuotesRequest.java | QuotesRequest.getResult | public List<T> getResult() throws IOException {
"""
Sends the request to Yahoo Finance and parses the result
@return List of parsed objects resulting from the Yahoo Finance request
@throws java.io.IOException when there's a connection problem or the request is incorrect
"""
List<T> result = new Arr... | java | public List<T> getResult() throws IOException {
List<T> result = new ArrayList<T>();
Map<String, String> params = new LinkedHashMap<String, String>();
params.put("s", this.query);
params.put("f", this.getFieldsString());
params.put("e", ".csv");
String url = YahooFinanc... | [
"public",
"List",
"<",
"T",
">",
"getResult",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"T",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"LinkedHas... | Sends the request to Yahoo Finance and parses the result
@return List of parsed objects resulting from the Yahoo Finance request
@throws java.io.IOException when there's a connection problem or the request is incorrect | [
"Sends",
"the",
"request",
"to",
"Yahoo",
"Finance",
"and",
"parses",
"the",
"result"
] | train | https://github.com/sstrickx/yahoofinance-api/blob/2766ba52fc5cccf9b4da5c06423d68059cf0a6e6/src/main/java/yahoofinance/quotes/csv/QuotesRequest.java#L74-L109 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Session.java | Session.updateLocalTable | public void updateLocalTable(HsqlName queryName, Type[] finalTypes) {
"""
Update the local table with new types. This is very dubious.
@param queryName
@param finalTypes
"""
assert(localTables != null);
Table tbl = getLocalTable(queryName.name);
assert (tbl != null);
TableU... | java | public void updateLocalTable(HsqlName queryName, Type[] finalTypes) {
assert(localTables != null);
Table tbl = getLocalTable(queryName.name);
assert (tbl != null);
TableUtil.updateColumnTypes(tbl, finalTypes);
} | [
"public",
"void",
"updateLocalTable",
"(",
"HsqlName",
"queryName",
",",
"Type",
"[",
"]",
"finalTypes",
")",
"{",
"assert",
"(",
"localTables",
"!=",
"null",
")",
";",
"Table",
"tbl",
"=",
"getLocalTable",
"(",
"queryName",
".",
"name",
")",
";",
"assert"... | Update the local table with new types. This is very dubious.
@param queryName
@param finalTypes | [
"Update",
"the",
"local",
"table",
"with",
"new",
"types",
".",
"This",
"is",
"very",
"dubious",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Session.java#L1884-L1889 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/Materialize.java | Materialize.keyboardSupportEnabled | public void keyboardSupportEnabled(Activity activity, boolean enable) {
"""
a helper method to enable the keyboardUtil for a specific activity
or disable it. note this will cause some frame drops because of the
listener.
@param activity
@param enable
"""
if (getContent() != null && getContent().g... | java | public void keyboardSupportEnabled(Activity activity, boolean enable) {
if (getContent() != null && getContent().getChildCount() > 0) {
if (mKeyboardUtil == null) {
mKeyboardUtil = new KeyboardUtil(activity, getContent().getChildAt(0));
mKeyboardUtil.disable();
... | [
"public",
"void",
"keyboardSupportEnabled",
"(",
"Activity",
"activity",
",",
"boolean",
"enable",
")",
"{",
"if",
"(",
"getContent",
"(",
")",
"!=",
"null",
"&&",
"getContent",
"(",
")",
".",
"getChildCount",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"... | a helper method to enable the keyboardUtil for a specific activity
or disable it. note this will cause some frame drops because of the
listener.
@param activity
@param enable | [
"a",
"helper",
"method",
"to",
"enable",
"the",
"keyboardUtil",
"for",
"a",
"specific",
"activity",
"or",
"disable",
"it",
".",
"note",
"this",
"will",
"cause",
"some",
"frame",
"drops",
"because",
"of",
"the",
"listener",
"."
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/Materialize.java#L99-L112 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriPath | public static void unescapeUriPath(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape ever... | java | public static void unescapeUriPath(final String text, final Writer writer)
throws IOException {
unescapeUriPath(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"unescapeUriPath",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"unescapeUriPath",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI path <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-enco... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encoding",
"writing",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1802-L1805 |
JavaMoney/jsr354-api | src/main/java/javax/money/convert/MonetaryConversions.java | MonetaryConversions.getConversion | public static CurrencyConversion getConversion(String termCurrencyCode, String... providers) {
"""
Access an instance of {@link CurrencyConversion} for the given providers.
Use {@link #getConversionProviderNames()}} to check, which are available.
@param termCurrencyCode the terminating or target currency code,... | java | public static CurrencyConversion getConversion(String termCurrencyCode, String... providers){
Objects.requireNonNull(termCurrencyCode, "Term currency code may not be null");
return getConversion(Monetary.getCurrency(termCurrencyCode), providers);
} | [
"public",
"static",
"CurrencyConversion",
"getConversion",
"(",
"String",
"termCurrencyCode",
",",
"String",
"...",
"providers",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"termCurrencyCode",
",",
"\"Term currency code may not be null\"",
")",
";",
"return",
"getC... | Access an instance of {@link CurrencyConversion} for the given providers.
Use {@link #getConversionProviderNames()}} to check, which are available.
@param termCurrencyCode the terminating or target currency code, not {@code null}
@param providers Additional providers, for building a provider chain
@return the e... | [
"Access",
"an",
"instance",
"of",
"{",
"@link",
"CurrencyConversion",
"}",
"for",
"the",
"given",
"providers",
".",
"Use",
"{",
"@link",
"#getConversionProviderNames",
"()",
"}}",
"to",
"check",
"which",
"are",
"available",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/convert/MonetaryConversions.java#L109-L112 |
bramp/unsafe | unsafe-helper/src/main/java/net/bramp/unsafe/UnsafeHelper.java | UnsafeHelper.hexDump | public static void hexDump(PrintStream out, Object obj) {
"""
Prints out the object (including header, padding, and all fields) as hex.
<p>Some examples:
<p><pre>
/**
* Longs are always 8 byte aligned, so 4 bytes of padding
* 0x00000000: 01 00 00 00 00 00 00 00 9B 81 61 DF 00 00 00 00
* 0x00000010: EF C... | java | public static void hexDump(PrintStream out, Object obj) {
// TODO Change this to use hexDumpAddress instead of toByteArray
byte[] bytes = toByteArray(obj);
hexDumpBytes(out, 0, bytes);
} | [
"public",
"static",
"void",
"hexDump",
"(",
"PrintStream",
"out",
",",
"Object",
"obj",
")",
"{",
"// TODO Change this to use hexDumpAddress instead of toByteArray",
"byte",
"[",
"]",
"bytes",
"=",
"toByteArray",
"(",
"obj",
")",
";",
"hexDumpBytes",
"(",
"out",
"... | Prints out the object (including header, padding, and all fields) as hex.
<p>Some examples:
<p><pre>
/**
* Longs are always 8 byte aligned, so 4 bytes of padding
* 0x00000000: 01 00 00 00 00 00 00 00 9B 81 61 DF 00 00 00 00
* 0x00000010: EF CD AB 89 67 45 23 01
*/
static class Class8 {
long l = 0x0123456789ABCDE... | [
"Prints",
"out",
"the",
"object",
"(",
"including",
"header",
"padding",
"and",
"all",
"fields",
")",
"as",
"hex",
"."
] | train | https://github.com/bramp/unsafe/blob/805f54e2a8aee905003329556135b6c4059b4418/unsafe-helper/src/main/java/net/bramp/unsafe/UnsafeHelper.java#L354-L358 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.removeByU_LtC_O | @Override
public void removeByU_LtC_O(long userId, Date createDate, int orderStatus) {
"""
Removes all the commerce orders where userId = ? and createDate < ? and orderStatus = ? from the database.
@param userId the user ID
@param createDate the create date
@param orderStatus the order status
... | java | @Override
public void removeByU_LtC_O(long userId, Date createDate, int orderStatus) {
for (CommerceOrder commerceOrder : findByU_LtC_O(userId, createDate,
orderStatus, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceOrder);
}
} | [
"@",
"Override",
"public",
"void",
"removeByU_LtC_O",
"(",
"long",
"userId",
",",
"Date",
"createDate",
",",
"int",
"orderStatus",
")",
"{",
"for",
"(",
"CommerceOrder",
"commerceOrder",
":",
"findByU_LtC_O",
"(",
"userId",
",",
"createDate",
",",
"orderStatus",... | Removes all the commerce orders where userId = ? and createDate < ? and orderStatus = ? from the database.
@param userId the user ID
@param createDate the create date
@param orderStatus the order status | [
"Removes",
"all",
"the",
"commerce",
"orders",
"where",
"userId",
"=",
"?",
";",
"and",
"createDate",
"<",
";",
"?",
";",
"and",
"orderStatus",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L5771-L5777 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_mailingList_mailingListAddress_member_account_memberAccountId_GET | public OvhExchangeDistributionGroupMember organizationName_service_exchangeService_mailingList_mailingListAddress_member_account_memberAccountId_GET(String organizationName, String exchangeService, String mailingListAddress, Long memberAccountId) throws IOException {
"""
Get this object properties
REST: GET /em... | java | public OvhExchangeDistributionGroupMember organizationName_service_exchangeService_mailingList_mailingListAddress_member_account_memberAccountId_GET(String organizationName, String exchangeService, String mailingListAddress, Long memberAccountId) throws IOException {
String qPath = "/email/exchange/{organizationName}... | [
"public",
"OvhExchangeDistributionGroupMember",
"organizationName_service_exchangeService_mailingList_mailingListAddress_member_account_memberAccountId_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"mailingListAddress",
",",
"Long",
"memberAcco... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account/{memberAccountId}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange ser... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L1096-L1101 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.castVirtual | public Binder castVirtual(Class<?> returnType, Class<?> firstType, Class<?>... restTypes) {
"""
Cast the incoming arguments to the given MethodType. The casts
applied are equivalent to those in MethodHandle.explicitCastArguments(MethodType).
@param returnType the target return type
@param firstType the first... | java | public Binder castVirtual(Class<?> returnType, Class<?> firstType, Class<?>... restTypes) {
return new Binder(this, new Cast(type()), MethodType.methodType(returnType, firstType, restTypes));
} | [
"public",
"Binder",
"castVirtual",
"(",
"Class",
"<",
"?",
">",
"returnType",
",",
"Class",
"<",
"?",
">",
"firstType",
",",
"Class",
"<",
"?",
">",
"...",
"restTypes",
")",
"{",
"return",
"new",
"Binder",
"(",
"this",
",",
"new",
"Cast",
"(",
"type"... | Cast the incoming arguments to the given MethodType. The casts
applied are equivalent to those in MethodHandle.explicitCastArguments(MethodType).
@param returnType the target return type
@param firstType the first argument type, usually a target type
@param restTypes the remaining target argument types
@return a new... | [
"Cast",
"the",
"incoming",
"arguments",
"to",
"the",
"given",
"MethodType",
".",
"The",
"casts",
"applied",
"are",
"equivalent",
"to",
"those",
"in",
"MethodHandle",
".",
"explicitCastArguments",
"(",
"MethodType",
")",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L832-L834 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ConversionSchemas.java | ConversionSchemas.v2Builder | public static Builder v2Builder(String name) {
"""
A ConversionSchema builder that defaults to building {@link #V2}.
"""
return new Builder(name, V2MarshallerSet.marshallers(), V2MarshallerSet.setMarshallers(),
StandardUnmarshallerSet.unmarshallers(),
... | java | public static Builder v2Builder(String name) {
return new Builder(name, V2MarshallerSet.marshallers(), V2MarshallerSet.setMarshallers(),
StandardUnmarshallerSet.unmarshallers(),
StandardUnmarshallerSet.setUnmarshallers());
} | [
"public",
"static",
"Builder",
"v2Builder",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"Builder",
"(",
"name",
",",
"V2MarshallerSet",
".",
"marshallers",
"(",
")",
",",
"V2MarshallerSet",
".",
"setMarshallers",
"(",
")",
",",
"StandardUnmarshallerSet",
... | A ConversionSchema builder that defaults to building {@link #V2}. | [
"A",
"ConversionSchema",
"builder",
"that",
"defaults",
"to",
"building",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ConversionSchemas.java#L175-L179 |
openbase/jul | exception/src/main/java/org/openbase/jul/exception/StackTracePrinter.java | StackTracePrinter.printStackTrace | public static void printStackTrace(final String message, final Logger logger, final LogLevel logLevel) {
"""
Method prints the stack trace of the calling thread in a human readable way.
@param message the reason for printing the stack trace.
@param logger the logger used for printing.
@param logLevel the l... | java | public static void printStackTrace(final String message, final Logger logger, final LogLevel logLevel) {
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
printStackTrace(message, Arrays.copyOfRange(stackTrace, 2, stackTrace.length), logger, logLevel);
} | [
"public",
"static",
"void",
"printStackTrace",
"(",
"final",
"String",
"message",
",",
"final",
"Logger",
"logger",
",",
"final",
"LogLevel",
"logLevel",
")",
"{",
"StackTraceElement",
"[",
"]",
"stackTrace",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",... | Method prints the stack trace of the calling thread in a human readable way.
@param message the reason for printing the stack trace.
@param logger the logger used for printing.
@param logLevel the log level used for logging the stack trace. | [
"Method",
"prints",
"the",
"stack",
"trace",
"of",
"the",
"calling",
"thread",
"in",
"a",
"human",
"readable",
"way",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/StackTracePrinter.java#L88-L91 |
ButterFaces/ButterFaces | components/src/main/java/org/butterfaces/context/StringHtmlEncoder.java | StringHtmlEncoder.encodeComponentWithSurroundingDiv | public static String encodeComponentWithSurroundingDiv(final FacesContext context,
final UIComponent component) throws IOException {
"""
Encodes complete component by calling {@link UIComponent#encodeAll(FacesContext)}.
@param component component
@para... | java | public static String encodeComponentWithSurroundingDiv(final FacesContext context,
final UIComponent component) throws IOException {
return encodeComponentWithSurroundingDiv(context, component, null);
} | [
"public",
"static",
"String",
"encodeComponentWithSurroundingDiv",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"return",
"encodeComponentWithSurroundingDiv",
"(",
"context",
",",
"component",
",",
... | Encodes complete component by calling {@link UIComponent#encodeAll(FacesContext)}.
@param component component
@param context {@link FacesContext}
@return the rendered string.
@throws IOException thrown by writer | [
"Encodes",
"complete",
"component",
"by",
"calling",
"{",
"@link",
"UIComponent#encodeAll",
"(",
"FacesContext",
")",
"}",
"."
] | train | https://github.com/ButterFaces/ButterFaces/blob/e8c2bb340c89dcdbac409fcfc7a2a0e07f2462fc/components/src/main/java/org/butterfaces/context/StringHtmlEncoder.java#L45-L48 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.beginStop | public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) {
"""
Stops a specified packet capture session.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the pack... | java | public void beginStop(String resourceGroupName, String networkWatcherName, String packetCaptureName) {
beginStopWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body();
} | [
"public",
"void",
"beginStop",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
")",
"{",
"beginStopWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkWatcherName",
",",
"packetCaptureName",
")",
"... | Stops a specified packet capture session.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseE... | [
"Stops",
"a",
"specified",
"packet",
"capture",
"session",
"."
] | 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/PacketCapturesInner.java#L625-L627 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java | Configuration.getLong | public long getLong(String key, long defaultValue) {
"""
Returns the value associated with the given key as a long.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value ... | java | public long getLong(String key, long defaultValue) {
String val = getStringInternal(key);
if (val == null) {
return defaultValue;
} else {
return Long.parseLong(val);
}
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"getStringInternal",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"else",
"{",
"retur... | Returns the value associated with the given key as a long.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"long",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java#L212-L219 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.projectedEnergy | private ProjectedEnergy projectedEnergy(Relation<V> relation, ORCLUSCluster c_i, ORCLUSCluster c_j, int i, int j, int dim) {
"""
Computes the projected energy of the specified clusters. The projected
energy is given by the mean square distance of the points to the centroid
of the union cluster c, when all points... | java | private ProjectedEnergy projectedEnergy(Relation<V> relation, ORCLUSCluster c_i, ORCLUSCluster c_j, int i, int j, int dim) {
NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC;
// union of cluster c_i and c_j
ORCLUSCluster c_ij = union(relation, c_i, c_j, dim);
d... | [
"private",
"ProjectedEnergy",
"projectedEnergy",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"ORCLUSCluster",
"c_i",
",",
"ORCLUSCluster",
"c_j",
",",
"int",
"i",
",",
"int",
"j",
",",
"int",
"dim",
")",
"{",
"NumberVectorDistanceFunction",
"<",
"?",
"s... | Computes the projected energy of the specified clusters. The projected
energy is given by the mean square distance of the points to the centroid
of the union cluster c, when all points in c are projected to the subspace
of c.
@param relation the relation holding the objects
@param c_i the first cluster
@param c_j the ... | [
"Computes",
"the",
"projected",
"energy",
"of",
"the",
"specified",
"clusters",
".",
"The",
"projected",
"energy",
"is",
"given",
"by",
"the",
"mean",
"square",
"distance",
"of",
"the",
"points",
"to",
"the",
"centroid",
"of",
"the",
"union",
"cluster",
"c",... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java#L343-L357 |
voostindie/sprox | src/main/java/nl/ulso/sprox/impl/ReflectionUtil.java | ReflectionUtil.resolveObjectClass | static Class resolveObjectClass(Type objectType) {
"""
Resolves the {@link Class} that corresponds with a {@link Type}.
<p>
{@code Class} is an implementation of {@code Type} but, of course, not every {@code Type} is a {@code Class}.
Case in point here are primitive types. These can appear as method parameters.... | java | static Class resolveObjectClass(Type objectType) {
final Class type = PRIMITIVE_PARAMETER_TYPES.get(objectType);
if (type != null) {
return type;
}
if (isOptionalType(objectType)) {
return resolveObjectClass(extractTypeFromOptional(objectType));
}
... | [
"static",
"Class",
"resolveObjectClass",
"(",
"Type",
"objectType",
")",
"{",
"final",
"Class",
"type",
"=",
"PRIMITIVE_PARAMETER_TYPES",
".",
"get",
"(",
"objectType",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"return",
"type",
";",
"}",
"if",
... | Resolves the {@link Class} that corresponds with a {@link Type}.
<p>
{@code Class} is an implementation of {@code Type} but, of course, not every {@code Type} is a {@code Class}.
Case in point here are primitive types. These can appear as method parameters.
@param objectType Type to resolve.
@return Corresponding clas... | [
"Resolves",
"the",
"{",
"@link",
"Class",
"}",
"that",
"corresponds",
"with",
"a",
"{",
"@link",
"Type",
"}",
".",
"<p",
">",
"{",
"@code",
"Class",
"}",
"is",
"an",
"implementation",
"of",
"{",
"@code",
"Type",
"}",
"but",
"of",
"course",
"not",
"ev... | train | https://github.com/voostindie/sprox/blob/8cde722ac6712008c82830fd2ef130e219232b8c/src/main/java/nl/ulso/sprox/impl/ReflectionUtil.java#L35-L48 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/PaxDate.java | PaxDate.plusYears | @Override
PaxDate plusYears(long yearsToAdd) {
"""
Returns a copy of this {@code PaxDate} with the specified period in years added.
<p>
This method adds the specified amount to the years field in two steps:
<ol>
<li>Add the input years to the year field</li>
<li>If necessary, shift the index to account fo... | java | @Override
PaxDate plusYears(long yearsToAdd) {
if (yearsToAdd == 0) {
return this;
}
int newYear = YEAR.checkValidIntValue(getProlepticYear() + yearsToAdd);
// Retain actual month (not index) in the case where a leap month is to be inserted.
if (month == MONTHS_IN... | [
"@",
"Override",
"PaxDate",
"plusYears",
"(",
"long",
"yearsToAdd",
")",
"{",
"if",
"(",
"yearsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"newYear",
"=",
"YEAR",
".",
"checkValidIntValue",
"(",
"getProlepticYear",
"(",
")",
"+",
"yea... | Returns a copy of this {@code PaxDate} with the specified period in years added.
<p>
This method adds the specified amount to the years field in two steps:
<ol>
<li>Add the input years to the year field</li>
<li>If necessary, shift the index to account for the inserted/deleted leap-month.</li>
</ol>
<p>
In the Pax Cale... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"PaxDate",
"}",
"with",
"the",
"specified",
"period",
"in",
"years",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"to",
"the",
"years",
"field",
"in",
"two",
"steps",... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/PaxDate.java#L560-L577 |
podio/podio-java | src/main/java/com/podio/space/SpaceAPI.java | SpaceAPI.getSpaceMembership | public SpaceMember getSpaceMembership(int spaceId, int userId) {
"""
Used to get the details of an active users membership of a space.
@param spaceId
The id of the space
@param userId
The ud of the user
@return The details about the space membership
"""
return getResourceFactory().getApiResource(
... | java | public SpaceMember getSpaceMembership(int spaceId, int userId) {
return getResourceFactory().getApiResource(
"/space/" + spaceId + "/member/" + userId).get(
SpaceMember.class);
} | [
"public",
"SpaceMember",
"getSpaceMembership",
"(",
"int",
"spaceId",
",",
"int",
"userId",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/space/\"",
"+",
"spaceId",
"+",
"\"/member/\"",
"+",
"userId",
")",
".",
"get",
"(",... | Used to get the details of an active users membership of a space.
@param spaceId
The id of the space
@param userId
The ud of the user
@return The details about the space membership | [
"Used",
"to",
"get",
"the",
"details",
"of",
"an",
"active",
"users",
"membership",
"of",
"a",
"space",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/space/SpaceAPI.java#L94-L98 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java | LocalNetworkGatewaysInner.createOrUpdate | public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) {
"""
Creates or updates a local network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName... | java | public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last().body();
} | [
"public",
"LocalNetworkGatewayInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"localNetworkGatewayName",
",",
"LocalNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loc... | Creates or updates a local network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network gateway.
@param parameters Parameters supplied to the create or update local network gateway operation.
@throws IllegalArgume... | [
"Creates",
"or",
"updates",
"a",
"local",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java#L118-L120 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/adv/MultiAdditionNeighbourhood.java | MultiAdditionNeighbourhood.getRandomMove | @Override
public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) {
"""
<p>
Generates a move for the given subset solution that adds a random subset of currently unselected IDs to the
selection. Possible fixed IDs are not considered to be selected. The maximum number of additions \(k\) and
maxi... | java | @Override
public SubsetMove getRandomMove(SubsetSolution solution, Random rnd) {
// get set of candidate IDs for addition (fixed IDs are discarded)
Set<Integer> addCandidates = getAddCandidates(solution);
// compute maximum number of adds
int curMaxAdds = maxAdditions(addCandidates, ... | [
"@",
"Override",
"public",
"SubsetMove",
"getRandomMove",
"(",
"SubsetSolution",
"solution",
",",
"Random",
"rnd",
")",
"{",
"// get set of candidate IDs for addition (fixed IDs are discarded)",
"Set",
"<",
"Integer",
">",
"addCandidates",
"=",
"getAddCandidates",
"(",
"s... | <p>
Generates a move for the given subset solution that adds a random subset of currently unselected IDs to the
selection. Possible fixed IDs are not considered to be selected. The maximum number of additions \(k\) and
maximum allowed subset size are respected. If no items can be added, <code>null</code> is returned.
<... | [
"<p",
">",
"Generates",
"a",
"move",
"for",
"the",
"given",
"subset",
"solution",
"that",
"adds",
"a",
"random",
"subset",
"of",
"currently",
"unselected",
"IDs",
"to",
"the",
"selection",
".",
"Possible",
"fixed",
"IDs",
"are",
"not",
"considered",
"to",
... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/adv/MultiAdditionNeighbourhood.java#L166-L182 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/VoiceApi.java | VoiceApi.switchToListenIn | public ApiSuccessResponse switchToListenIn(String id, MonitoringScopeData monitoringScopeData) throws ApiException {
"""
Switch to listen in
Switch to the listen in monitoring mode. When listen in is enabled and the agent receives a call, the supervisor is able to listen to the agent and the customer, but they ca... | java | public ApiSuccessResponse switchToListenIn(String id, MonitoringScopeData monitoringScopeData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = switchToListenInWithHttpInfo(id, monitoringScopeData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"switchToListenIn",
"(",
"String",
"id",
",",
"MonitoringScopeData",
"monitoringScopeData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"switchToListenInWithHttpInfo",
"(",
"id",
",",
"m... | Switch to listen in
Switch to the listen in monitoring mode. When listen in is enabled and the agent receives a call, the supervisor is able to listen to the agent and the customer, but they can't hear the supervisor.
@param id The connection ID of the call being monitored. (required)
@param monitoringScopeData (o... | [
"Switch",
"to",
"listen",
"in",
"Switch",
"to",
"the",
"listen",
"in",
"monitoring",
"mode",
".",
"When",
"listen",
"in",
"is",
"enabled",
"and",
"the",
"agent",
"receives",
"a",
"call",
"the",
"supervisor",
"is",
"able",
"to",
"listen",
"to",
"the",
"ag... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L5226-L5229 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/LinkOptionsExample.java | LinkOptionsExample.applySettings | private void applySettings() {
"""
this is were the majority of the work is done for building the link. Note that it is in a container that is
reset, effectively creating a new link. this is only done to enable to dynamically change the link to a button
and back.
"""
linkContainer.reset();
WLink exampleL... | java | private void applySettings() {
linkContainer.reset();
WLink exampleLink = new WLink();
exampleLink.setText(tfLinkLabel.getText());
final String url = tfUrlField.getValue();
if ("".equals(url) || !isValidUrl(url)) {
tfUrlField.setText(URL);
exampleLink.setUrl(URL);
} else {
exampleLink.setUrl(url);... | [
"private",
"void",
"applySettings",
"(",
")",
"{",
"linkContainer",
".",
"reset",
"(",
")",
";",
"WLink",
"exampleLink",
"=",
"new",
"WLink",
"(",
")",
";",
"exampleLink",
".",
"setText",
"(",
"tfLinkLabel",
".",
"getText",
"(",
")",
")",
";",
"final",
... | this is were the majority of the work is done for building the link. Note that it is in a container that is
reset, effectively creating a new link. this is only done to enable to dynamically change the link to a button
and back. | [
"this",
"is",
"were",
"the",
"majority",
"of",
"the",
"work",
"is",
"done",
"for",
"building",
"the",
"link",
".",
"Note",
"that",
"it",
"is",
"in",
"a",
"container",
"that",
"is",
"reset",
"effectively",
"creating",
"a",
"new",
"link",
".",
"this",
"i... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/LinkOptionsExample.java#L162-L198 |
liferay/com-liferay-commerce | commerce-notification-api/src/main/java/com/liferay/commerce/notification/service/persistence/CommerceNotificationTemplateUtil.java | CommerceNotificationTemplateUtil.countByG_T_E | public static int countByG_T_E(long groupId, String type, boolean enabled) {
"""
Returns the number of commerce notification templates where groupId = ? and type = ? and enabled = ?.
@param groupId the group ID
@param type the type
@param enabled the enabled
@return the number of matching commerc... | java | public static int countByG_T_E(long groupId, String type, boolean enabled) {
return getPersistence().countByG_T_E(groupId, type, enabled);
} | [
"public",
"static",
"int",
"countByG_T_E",
"(",
"long",
"groupId",
",",
"String",
"type",
",",
"boolean",
"enabled",
")",
"{",
"return",
"getPersistence",
"(",
")",
".",
"countByG_T_E",
"(",
"groupId",
",",
"type",
",",
"enabled",
")",
";",
"}"
] | Returns the number of commerce notification templates where groupId = ? and type = ? and enabled = ?.
@param groupId the group ID
@param type the type
@param enabled the enabled
@return the number of matching commerce notification templates | [
"Returns",
"the",
"number",
"of",
"commerce",
"notification",
"templates",
"where",
"groupId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"and",
"enabled",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/service/persistence/CommerceNotificationTemplateUtil.java#L1284-L1286 |
lets-blade/blade | src/main/java/com/blade/mvc/route/RouteMatcher.java | RouteMatcher.giveMatch | private void giveMatch(final String uri, List<Route> routes) {
"""
Sort of path
@param uri request uri
@param routes route list
"""
routes.stream().sorted((o1, o2) -> {
if (o2.getPath().equals(uri)) {
return o2.getPath().indexOf(uri);
}
return ... | java | private void giveMatch(final String uri, List<Route> routes) {
routes.stream().sorted((o1, o2) -> {
if (o2.getPath().equals(uri)) {
return o2.getPath().indexOf(uri);
}
return -1;
});
} | [
"private",
"void",
"giveMatch",
"(",
"final",
"String",
"uri",
",",
"List",
"<",
"Route",
">",
"routes",
")",
"{",
"routes",
".",
"stream",
"(",
")",
".",
"sorted",
"(",
"(",
"o1",
",",
"o2",
")",
"->",
"{",
"if",
"(",
"o2",
".",
"getPath",
"(",
... | Sort of path
@param uri request uri
@param routes route list | [
"Sort",
"of",
"path"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/mvc/route/RouteMatcher.java#L304-L311 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toElement | public static Element toElement(final String aFilePath, final String aPattern, final boolean aDeepTransformation)
throws FileNotFoundException {
"""
Returns an XML Element representing the file structure found at the supplied file system path. Files included
in the representation will match the suppli... | java | public static Element toElement(final String aFilePath, final String aPattern, final boolean aDeepTransformation)
throws FileNotFoundException {
final RegexFileFilter filter = new RegexFileFilter(aPattern);
final File file = new File(aFilePath);
if (file.exists() && file.canRead()) ... | [
"public",
"static",
"Element",
"toElement",
"(",
"final",
"String",
"aFilePath",
",",
"final",
"String",
"aPattern",
",",
"final",
"boolean",
"aDeepTransformation",
")",
"throws",
"FileNotFoundException",
"{",
"final",
"RegexFileFilter",
"filter",
"=",
"new",
"Regex... | Returns an XML Element representing the file structure found at the supplied file system path. Files included
in the representation will match the supplied regular expression pattern. This method doesn't descend through
the directory structure.
@param aFilePath The directory from which the structural representation sh... | [
"Returns",
"an",
"XML",
"Element",
"representing",
"the",
"file",
"structure",
"found",
"at",
"the",
"supplied",
"file",
"system",
"path",
".",
"Files",
"included",
"in",
"the",
"representation",
"will",
"match",
"the",
"supplied",
"regular",
"expression",
"patt... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L270-L280 |
httl/httl | httl/src/main/java/httl/Context.java | Context.pushContext | public static Context pushContext(Map<String, Object> current) {
"""
Push the current context to thread local.
@param current - current variables
"""
Context context = new Context(getContext(), current);
LOCAL.set(context);
return context;
} | java | public static Context pushContext(Map<String, Object> current) {
Context context = new Context(getContext(), current);
LOCAL.set(context);
return context;
} | [
"public",
"static",
"Context",
"pushContext",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"current",
")",
"{",
"Context",
"context",
"=",
"new",
"Context",
"(",
"getContext",
"(",
")",
",",
"current",
")",
";",
"LOCAL",
".",
"set",
"(",
"context",
"... | Push the current context to thread local.
@param current - current variables | [
"Push",
"the",
"current",
"context",
"to",
"thread",
"local",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Context.java#L104-L108 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/log/LogManager.java | LogManager.removeWriter | public void removeWriter(String logService, LogWriter writer) {
"""
Removes a log writer, either global or from a particular <code>logService</code>.
<p>
Note that for a writer to be removed global, it had to be added global before.
@param logService name of the log service of which the writer will be removed... | java | public void removeWriter(String logService, LogWriter writer)
{
if (logService != null && logService.length() > 0) {
final LogService l = (LogService) loggers.get(logService);
if (l != null)
l.removeWriter(writer);
}
else
synchronized (loggers) {
if (writers.remove(writer))
for (f... | [
"public",
"void",
"removeWriter",
"(",
"String",
"logService",
",",
"LogWriter",
"writer",
")",
"{",
"if",
"(",
"logService",
"!=",
"null",
"&&",
"logService",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"final",
"LogService",
"l",
"=",
"(",
"LogService... | Removes a log writer, either global or from a particular <code>logService</code>.
<p>
Note that for a writer to be removed global, it had to be added global before.
@param logService name of the log service of which the writer will be removed; to
remove the writer global, use an empty string or <code>null</code>
@para... | [
"Removes",
"a",
"log",
"writer",
"either",
"global",
"or",
"from",
"a",
"particular",
"<code",
">",
"logService<",
"/",
"code",
">",
".",
"<p",
">",
"Note",
"that",
"for",
"a",
"writer",
"to",
"be",
"removed",
"global",
"it",
"had",
"to",
"be",
"added"... | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/log/LogManager.java#L207-L220 |
apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newKeyword | public static Token newKeyword(String text, int startLine, int startColumn) {
"""
Creates a token that represents a keyword. Returns null if the
specified text isn't a keyword.
"""
int type = Types.lookupKeyword(text);
if (type != Types.UNKNOWN) {
return new Token(type, text, sta... | java | public static Token newKeyword(String text, int startLine, int startColumn) {
int type = Types.lookupKeyword(text);
if (type != Types.UNKNOWN) {
return new Token(type, text, startLine, startColumn);
}
return null;
} | [
"public",
"static",
"Token",
"newKeyword",
"(",
"String",
"text",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"int",
"type",
"=",
"Types",
".",
"lookupKeyword",
"(",
"text",
")",
";",
"if",
"(",
"type",
"!=",
"Types",
".",
"UNKNOWN",
... | Creates a token that represents a keyword. Returns null if the
specified text isn't a keyword. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"keyword",
".",
"Returns",
"null",
"if",
"the",
"specified",
"text",
"isn",
"t",
"a",
"keyword",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L220-L228 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.refuteToken | public static void refuteToken(int refutedType, LexerResults lexerResults) {
"""
To "refute" a token means to assert that it cannot be of the specified
type. This is useful, for example, when you want to assert that "x" will
not be recognized as an integer. Eventually, it may be recognized as an
identifier or s... | java | public static void refuteToken(int refutedType, LexerResults lexerResults)
{
try
{
if (refutedType == lexerResults.getToken().getType())
{
fail("scanned successfully as specified type");
}
}
catch (AssertionError e)
{
... | [
"public",
"static",
"void",
"refuteToken",
"(",
"int",
"refutedType",
",",
"LexerResults",
"lexerResults",
")",
"{",
"try",
"{",
"if",
"(",
"refutedType",
"==",
"lexerResults",
".",
"getToken",
"(",
")",
".",
"getType",
"(",
")",
")",
"{",
"fail",
"(",
"... | To "refute" a token means to assert that it cannot be of the specified
type. This is useful, for example, when you want to assert that "x" will
not be recognized as an integer. Eventually, it may be recognized as an
identifier or some other token, but you just want to assert that it's
definitely not an integer.
<p/>
<p... | [
"To",
"refute",
"a",
"token",
"means",
"to",
"assert",
"that",
"it",
"cannot",
"be",
"of",
"the",
"specified",
"type",
".",
"This",
"is",
"useful",
"for",
"example",
"when",
"you",
"want",
"to",
"assert",
"that",
"x",
"will",
"not",
"be",
"recognized",
... | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L163-L183 |
ISOBlue/isoblue-android | libISOBlue/src/org/isoblue/isoblue/ISOBlueDevice.java | ISOBlueDevice.createBufferedISOBUSSockets | public ISOBUSSocket[] createBufferedISOBUSSockets(Serializable fromId)
throws IOException, InterruptedException {
"""
Create a pair of {@link BufferedISOBUSSocket}s which will receive all
{@link Message}s stored by ISOBlue coming after the specified one. <br>
One socket will receive engine bus messag... | java | public ISOBUSSocket[] createBufferedISOBUSSockets(Serializable fromId)
throws IOException, InterruptedException {
BufferedISOBUSSocket[] socks = new BufferedISOBUSSocket[2];
Serializable toId;
toId = getStartId();
// Create socket for past engine messages
socks[0] =... | [
"public",
"ISOBUSSocket",
"[",
"]",
"createBufferedISOBUSSockets",
"(",
"Serializable",
"fromId",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"BufferedISOBUSSocket",
"[",
"]",
"socks",
"=",
"new",
"BufferedISOBUSSocket",
"[",
"2",
"]",
";",
"Seri... | Create a pair of {@link BufferedISOBUSSocket}s which will receive all
{@link Message}s stored by ISOBlue coming after the specified one. <br>
One socket will receive engine bus messages and the other will receive
implement bus messages.
@param fromId
the ID corresponding to the {@link Message} after which these
socket... | [
"Create",
"a",
"pair",
"of",
"{",
"@link",
"BufferedISOBUSSocket",
"}",
"s",
"which",
"will",
"receive",
"all",
"{",
"@link",
"Message",
"}",
"s",
"stored",
"by",
"ISOBlue",
"coming",
"after",
"the",
"specified",
"one",
".",
"<br",
">",
"One",
"socket",
... | train | https://github.com/ISOBlue/isoblue-android/blob/7eab6447f1ffb4d2ad4b7b0b60373d02f9646fcb/libISOBlue/src/org/isoblue/isoblue/ISOBlueDevice.java#L123-L142 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.toTimestampTz | public static Long toTimestampTz(String dateStr, String format, String tzStr) {
"""
Parse date time string to timestamp based on the given time zone string and format.
Returns null if parsing failed.
@param dateStr the date time string
@param format the date time string format
@param tzStr the time zone id s... | java | public static Long toTimestampTz(String dateStr, String format, String tzStr) {
TimeZone tz = TIMEZONE_CACHE.get(tzStr);
return toTimestamp(dateStr, format, tz);
} | [
"public",
"static",
"Long",
"toTimestampTz",
"(",
"String",
"dateStr",
",",
"String",
"format",
",",
"String",
"tzStr",
")",
"{",
"TimeZone",
"tz",
"=",
"TIMEZONE_CACHE",
".",
"get",
"(",
"tzStr",
")",
";",
"return",
"toTimestamp",
"(",
"dateStr",
",",
"fo... | Parse date time string to timestamp based on the given time zone string and format.
Returns null if parsing failed.
@param dateStr the date time string
@param format the date time string format
@param tzStr the time zone id string | [
"Parse",
"date",
"time",
"string",
"to",
"timestamp",
"based",
"on",
"the",
"given",
"time",
"zone",
"string",
"and",
"format",
".",
"Returns",
"null",
"if",
"parsing",
"failed",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L289-L292 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/XmlWriter.java | XmlWriter.writeLineElement | public void writeLineElement(String name, Object text) {
"""
Convenience method, same as doing a startLineElement(), writeText(text),
endLineElement().
"""
startLineElement(name);
writeText(text);
endLineElement(name);
} | java | public void writeLineElement(String name, Object text)
{
startLineElement(name);
writeText(text);
endLineElement(name);
} | [
"public",
"void",
"writeLineElement",
"(",
"String",
"name",
",",
"Object",
"text",
")",
"{",
"startLineElement",
"(",
"name",
")",
";",
"writeText",
"(",
"text",
")",
";",
"endLineElement",
"(",
"name",
")",
";",
"}"
] | Convenience method, same as doing a startLineElement(), writeText(text),
endLineElement(). | [
"Convenience",
"method",
"same",
"as",
"doing",
"a",
"startLineElement",
"()",
"writeText",
"(",
"text",
")",
"endLineElement",
"()",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/XmlWriter.java#L268-L273 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.join | public static String join(final String[] seq, final String delimiter) {
"""
将数组中的字符串,用delimiter串接起来.<br>
首尾不加delimiter
@param seq an array of {@link java.lang.String} objects.
@param delimiter a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
if (null == seq || seq.len... | java | public static String join(final String[] seq, final String delimiter) {
if (null == seq || seq.length < 1) return "";
Assert.notNull(delimiter);
StringBuilder aim = new StringBuilder();
for (int i = 0; i < seq.length; i++) {
if (aim.length() > 0) aim.append(delimiter);
aim.append(seq[i]);
... | [
"public",
"static",
"String",
"join",
"(",
"final",
"String",
"[",
"]",
"seq",
",",
"final",
"String",
"delimiter",
")",
"{",
"if",
"(",
"null",
"==",
"seq",
"||",
"seq",
".",
"length",
"<",
"1",
")",
"return",
"\"\"",
";",
"Assert",
".",
"notNull",
... | 将数组中的字符串,用delimiter串接起来.<br>
首尾不加delimiter
@param seq an array of {@link java.lang.String} objects.
@param delimiter a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"将数组中的字符串,用delimiter串接起来",
".",
"<br",
">",
"首尾不加delimiter"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L462-L471 |
apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java | CassandraSink.addSink | public static <IN> CassandraSinkBuilder<IN> addSink(DataStream<IN> input) {
"""
Writes a DataStream into a Cassandra database.
@param input input DataStream
@param <IN> input type
@return CassandraSinkBuilder, to further configure the sink
"""
TypeInformation<IN> typeInfo = input.getType();
if (typeI... | java | public static <IN> CassandraSinkBuilder<IN> addSink(DataStream<IN> input) {
TypeInformation<IN> typeInfo = input.getType();
if (typeInfo instanceof TupleTypeInfo) {
DataStream<Tuple> tupleInput = (DataStream<Tuple>) input;
return (CassandraSinkBuilder<IN>) new CassandraTupleSinkBuilder<>(tupleInput, tupleInpu... | [
"public",
"static",
"<",
"IN",
">",
"CassandraSinkBuilder",
"<",
"IN",
">",
"addSink",
"(",
"DataStream",
"<",
"IN",
">",
"input",
")",
"{",
"TypeInformation",
"<",
"IN",
">",
"typeInfo",
"=",
"input",
".",
"getType",
"(",
")",
";",
"if",
"(",
"typeInf... | Writes a DataStream into a Cassandra database.
@param input input DataStream
@param <IN> input type
@return CassandraSinkBuilder, to further configure the sink | [
"Writes",
"a",
"DataStream",
"into",
"a",
"Cassandra",
"database",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java#L212-L230 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaMetaCodeGen.java | RaMetaCodeGen.writeInfo | private void writeInfo(Definition def, Writer out, int indent) throws IOException {
"""
Output info method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Gets ... | java | private void writeInfo(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Gets the version of the resource adapter.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * @return String repr... | [
"private",
"void",
"writeInfo",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"indent",
... | Output info method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"info",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaMetaCodeGen.java#L93-L160 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java | Vector.insertElementAt | public synchronized void insertElementAt(E obj, int index) {
"""
Inserts the specified object as a component in this vector at the
specified {@code index}. Each component in this vector with
an index greater or equal to the specified {@code index} is
shifted upward to have an index one greater than the value it... | java | public synchronized void insertElementAt(E obj, int index) {
modCount++;
if (index > elementCount) {
throw new ArrayIndexOutOfBoundsException(index
+ " > " + elementCount);
}
ensureCapacityHelper(elementCount + 1);
... | [
"public",
"synchronized",
"void",
"insertElementAt",
"(",
"E",
"obj",
",",
"int",
"index",
")",
"{",
"modCount",
"++",
";",
"if",
"(",
"index",
">",
"elementCount",
")",
"{",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"index",
"+",
"\" > \"",
"+"... | Inserts the specified object as a component in this vector at the
specified {@code index}. Each component in this vector with
an index greater or equal to the specified {@code index} is
shifted upward to have an index one greater than the value it had
previously.
<p>The index must be a value greater than or equal to {... | [
"Inserts",
"the",
"specified",
"object",
"as",
"a",
"component",
"in",
"this",
"vector",
"at",
"the",
"specified",
"{",
"@code",
"index",
"}",
".",
"Each",
"component",
"in",
"this",
"vector",
"with",
"an",
"index",
"greater",
"or",
"equal",
"to",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Vector.java#L595-L605 |
calimero-project/calimero-core | src/tuwien/auto/calimero/xml/XmlInputFactory.java | XmlInputFactory.createXMLReader | public XmlReader createXMLReader(final String baseUri) throws KNXMLException {
"""
Creates a {@link XmlReader} to read the XML resource located by the specified identifier.
<p>
On closing the created XML reader, the {@link Reader} set as input for the XML reader will
get closed as well.
@param baseUri locati... | java | public XmlReader createXMLReader(final String baseUri) throws KNXMLException
{
final XmlResolver res = new XmlResolver();
final InputStream is = (InputStream) res.resolveEntity(null, null, baseUri, null);
return create(res, is);
} | [
"public",
"XmlReader",
"createXMLReader",
"(",
"final",
"String",
"baseUri",
")",
"throws",
"KNXMLException",
"{",
"final",
"XmlResolver",
"res",
"=",
"new",
"XmlResolver",
"(",
")",
";",
"final",
"InputStream",
"is",
"=",
"(",
"InputStream",
")",
"res",
".",
... | Creates a {@link XmlReader} to read the XML resource located by the specified identifier.
<p>
On closing the created XML reader, the {@link Reader} set as input for the XML reader will
get closed as well.
@param baseUri location identifier of the XML resource
@return XML reader
@throws KNXMLException if creation of th... | [
"Creates",
"a",
"{",
"@link",
"XmlReader",
"}",
"to",
"read",
"the",
"XML",
"resource",
"located",
"by",
"the",
"specified",
"identifier",
".",
"<p",
">",
"On",
"closing",
"the",
"created",
"XML",
"reader",
"the",
"{",
"@link",
"Reader",
"}",
"set",
"as"... | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/xml/XmlInputFactory.java#L86-L91 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/password/forgotten/AbstractPasswordForgottenPanel.java | AbstractPasswordForgottenPanel.newEmailTextField | protected Component newEmailTextField(final String id,
final IModel<PasswordForgottenModelBean> model) {
"""
Factory method for creating the EmailTextField for the email. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a EmailTe... | java | protected Component newEmailTextField(final String id,
final IModel<PasswordForgottenModelBean> model)
{
final IModel<String> labelModel = ResourceModelFactory.newResourceModel(
"password.forgotten.content.label", this, "Give email in the Textfield");
final IModel<String> placeholderModel = ResourceModelFacto... | [
"protected",
"Component",
"newEmailTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"PasswordForgottenModelBean",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"String",
">",
"labelModel",
"=",
"ResourceModelFactory",
".",
"newResourceModel",... | Factory method for creating the EmailTextField for the email. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a EmailTextField for the email.
@param id
the id
@param model
the model
@return the text field | [
"Factory",
"method",
"for",
"creating",
"the",
"EmailTextField",
"for",
"the",
"email",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/password/forgotten/AbstractPasswordForgottenPanel.java#L193-L228 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UniverseApi.java | UniverseApi.getUniverseGraphicsGraphicId | public GraphicResponse getUniverseGraphicsGraphicId(Integer graphicId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get graphic information Get information on a graphic --- This route
expires daily at 11:05
@param graphicId
graphic_id integer (required)
@param datasource
The ... | java | public GraphicResponse getUniverseGraphicsGraphicId(Integer graphicId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<GraphicResponse> resp = getUniverseGraphicsGraphicIdWithHttpInfo(graphicId, datasource, ifNoneMatch);
return resp.getData();
} | [
"public",
"GraphicResponse",
"getUniverseGraphicsGraphicId",
"(",
"Integer",
"graphicId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"GraphicResponse",
">",
"resp",
"=",
"getUniverseGraphicsGraphicIdW... | Get graphic information Get information on a graphic --- This route
expires daily at 11:05
@param graphicId
graphic_id integer (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be returned if this
matches... | [
"Get",
"graphic",
"information",
"Get",
"information",
"on",
"a",
"graphic",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UniverseApi.java#L1552-L1556 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamUserService.java | OsiamUserService.getCurrentUserBasic | @Deprecated
BasicUser getCurrentUserBasic(AccessToken accessToken) {
"""
See {@link OsiamConnector#getCurrentUserBasic(AccessToken)}
@deprecated The BasicUser class has been deprecated. Use {@link #getMe(AccessToken)} with OSIAM 3.x. This method
is going to go away with version 1.12 or 2.0.
"""
... | java | @Deprecated
BasicUser getCurrentUserBasic(AccessToken accessToken) {
checkAccessTokenIsNotNull(accessToken);
StatusType status;
String content;
try {
Response response = targetEndpoint.path("me").request(MediaType.APPLICATION_JSON)
.header("Authorizat... | [
"@",
"Deprecated",
"BasicUser",
"getCurrentUserBasic",
"(",
"AccessToken",
"accessToken",
")",
"{",
"checkAccessTokenIsNotNull",
"(",
"accessToken",
")",
";",
"StatusType",
"status",
";",
"String",
"content",
";",
"try",
"{",
"Response",
"response",
"=",
"targetEndp... | See {@link OsiamConnector#getCurrentUserBasic(AccessToken)}
@deprecated The BasicUser class has been deprecated. Use {@link #getMe(AccessToken)} with OSIAM 3.x. This method
is going to go away with version 1.12 or 2.0. | [
"See",
"{",
"@link",
"OsiamConnector#getCurrentUserBasic",
"(",
"AccessToken",
")",
"}"
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamUserService.java#L70-L92 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HBaseParserScreen.java | HBaseParserScreen.parseStreamPrintHtml | public void parseStreamPrintHtml(PrintWriter out, InputStream streamIn) {
"""
Output this screen using HTML.
@exception DBException File exception.
"""
XMLParser parser = ((BaseParserScreen)this.getScreenField()).getXMLParser();
if (parser != null)
{
parser.printHtmlData(ou... | java | public void parseStreamPrintHtml(PrintWriter out, InputStream streamIn)
{
XMLParser parser = ((BaseParserScreen)this.getScreenField()).getXMLParser();
if (parser != null)
{
parser.printHtmlData(out, streamIn);
parser.free();
parser = null;
}
... | [
"public",
"void",
"parseStreamPrintHtml",
"(",
"PrintWriter",
"out",
",",
"InputStream",
"streamIn",
")",
"{",
"XMLParser",
"parser",
"=",
"(",
"(",
"BaseParserScreen",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
".",
"getXMLParser",
"(",
")",
";",
"i... | Output this screen using HTML.
@exception DBException File exception. | [
"Output",
"this",
"screen",
"using",
"HTML",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HBaseParserScreen.java#L109-L122 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BoltNeo4jDialect.java | BoltNeo4jDialect.putAssociationOperation | private void putAssociationOperation(AssociationKey associationKey, AssociationOperation action, AssociationContext associationContext) {
"""
When dealing with some scenarios like, for example, a bidirectional association, OGM calls this method twice:
<p>
the first time with the information related to the owner ... | java | private void putAssociationOperation(AssociationKey associationKey, AssociationOperation action, AssociationContext associationContext) {
switch ( associationKey.getMetadata().getAssociationKind() ) {
case EMBEDDED_COLLECTION:
createRelationshipWithEmbeddedNode( associationKey, associationContext, action );
... | [
"private",
"void",
"putAssociationOperation",
"(",
"AssociationKey",
"associationKey",
",",
"AssociationOperation",
"action",
",",
"AssociationContext",
"associationContext",
")",
"{",
"switch",
"(",
"associationKey",
".",
"getMetadata",
"(",
")",
".",
"getAssociationKind... | When dealing with some scenarios like, for example, a bidirectional association, OGM calls this method twice:
<p>
the first time with the information related to the owner of the association and the {@link RowKey},
the second time using the same {@link RowKey} but with the {@link AssociationKey} referring to the other s... | [
"When",
"dealing",
"with",
"some",
"scenarios",
"like",
"for",
"example",
"a",
"bidirectional",
"association",
"OGM",
"calls",
"this",
"method",
"twice",
":",
"<p",
">",
"the",
"first",
"time",
"with",
"the",
"information",
"related",
"to",
"the",
"owner",
"... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BoltNeo4jDialect.java#L503-L514 |
alkacon/opencms-core | src/org/opencms/widgets/CmsHtmlWidgetOption.java | CmsHtmlWidgetOption.getButtonName | protected String getButtonName(String barItem, Map<String, String> buttonNamesLookUp) {
"""
Returns the real button name matched with the look up map.<p>
If no value is found in the look up map, the button name is returned unchanged.<p>
@param barItem the button bar item name to look up
@param buttonNamesLo... | java | protected String getButtonName(String barItem, Map<String, String> buttonNamesLookUp) {
String result = barItem;
if (buttonNamesLookUp != null) {
String translatedName = buttonNamesLookUp.get(barItem);
if (CmsStringUtil.isNotEmpty(translatedName)) {
result = tran... | [
"protected",
"String",
"getButtonName",
"(",
"String",
"barItem",
",",
"Map",
"<",
"String",
",",
"String",
">",
"buttonNamesLookUp",
")",
"{",
"String",
"result",
"=",
"barItem",
";",
"if",
"(",
"buttonNamesLookUp",
"!=",
"null",
")",
"{",
"String",
"transl... | Returns the real button name matched with the look up map.<p>
If no value is found in the look up map, the button name is returned unchanged.<p>
@param barItem the button bar item name to look up
@param buttonNamesLookUp the look up map containing the button names and/or separator name to use
@return the translated b... | [
"Returns",
"the",
"real",
"button",
"name",
"matched",
"with",
"the",
"look",
"up",
"map",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsHtmlWidgetOption.java#L1146-L1156 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeAssignmentExtendedAttributes | private void writeAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx) {
"""
This method writes extended attribute data for an assignment.
@param xml MSPDI assignment
@param mpx MPXJ assignment
"""
Project.Assignments.Assignment.ExtendedAttribute attrib;
List... | java | private void writeAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx)
{
Project.Assignments.Assignment.ExtendedAttribute attrib;
List<Project.Assignments.Assignment.ExtendedAttribute> extendedAttributes = xml.getExtendedAttribute();
for (AssignmentField mpxFiel... | [
"private",
"void",
"writeAssignmentExtendedAttributes",
"(",
"Project",
".",
"Assignments",
".",
"Assignment",
"xml",
",",
"ResourceAssignment",
"mpx",
")",
"{",
"Project",
".",
"Assignments",
".",
"Assignment",
".",
"ExtendedAttribute",
"attrib",
";",
"List",
"<",
... | This method writes extended attribute data for an assignment.
@param xml MSPDI assignment
@param mpx MPXJ assignment | [
"This",
"method",
"writes",
"extended",
"attribute",
"data",
"for",
"an",
"assignment",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L1674-L1696 |
alkacon/opencms-core | src/org/opencms/ui/contextmenu/CmsContextMenu.java | CmsContextMenu.openForTable | public void openForTable(ItemClickEvent event, Table table) {
"""
Opens the context menu of the given table.<p>
@param event the click event
@param table the table
"""
fireEvent(new ContextMenuOpenedOnTableRowEvent(this, table, event.getItemId(), event.getPropertyId()));
open(event.getClie... | java | public void openForTable(ItemClickEvent event, Table table) {
fireEvent(new ContextMenuOpenedOnTableRowEvent(this, table, event.getItemId(), event.getPropertyId()));
open(event.getClientX(), event.getClientY());
} | [
"public",
"void",
"openForTable",
"(",
"ItemClickEvent",
"event",
",",
"Table",
"table",
")",
"{",
"fireEvent",
"(",
"new",
"ContextMenuOpenedOnTableRowEvent",
"(",
"this",
",",
"table",
",",
"event",
".",
"getItemId",
"(",
")",
",",
"event",
".",
"getProperty... | Opens the context menu of the given table.<p>
@param event the click event
@param table the table | [
"Opens",
"the",
"context",
"menu",
"of",
"the",
"given",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/contextmenu/CmsContextMenu.java#L1148-L1153 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplDouble_CustomFieldSerializer.java | OWLLiteralImplDouble_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLLiteralImplDouble instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLLiteralImplDouble instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLLiteralImplDouble",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplDouble_CustomFieldSerializer.java#L67-L70 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupManager.java | PoolGroupManager.getPoolInfo | public static PoolInfo getPoolInfo(
Session session) {
"""
Get the pool name for a given session, using the default pool
information if the name is illegal. Redirection should happen prior to
this.
@param session the session to get the pool name for
@return the pool info that the session is running in... | java | public static PoolInfo getPoolInfo(
Session session) {
PoolInfo poolInfo = session.getPoolInfo();
// If there is no explicit pool info set, take user name.
if (poolInfo == null || poolInfo.getPoolName().equals("")) {
poolInfo = new PoolInfo(DEFAULT_POOL_GROUP, session.getUserId());
}
i... | [
"public",
"static",
"PoolInfo",
"getPoolInfo",
"(",
"Session",
"session",
")",
"{",
"PoolInfo",
"poolInfo",
"=",
"session",
".",
"getPoolInfo",
"(",
")",
";",
"// If there is no explicit pool info set, take user name.",
"if",
"(",
"poolInfo",
"==",
"null",
"||",
"po... | Get the pool name for a given session, using the default pool
information if the name is illegal. Redirection should happen prior to
this.
@param session the session to get the pool name for
@return the pool info that the session is running in | [
"Get",
"the",
"pool",
"name",
"for",
"a",
"given",
"session",
"using",
"the",
"default",
"pool",
"information",
"if",
"the",
"name",
"is",
"illegal",
".",
"Redirection",
"should",
"happen",
"prior",
"to",
"this",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupManager.java#L211-L226 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/collectors/CircuitBreakerMetricsCollector.java | CircuitBreakerMetricsCollector.ofSupplier | public static CircuitBreakerMetricsCollector ofSupplier(MetricNames names, Supplier<? extends Iterable<? extends CircuitBreaker>> supplier) {
"""
Creates a new collector with custom metric names and
using given {@code supplier} as source of circuit breakers.
@param names the custom metric names
@param supp... | java | public static CircuitBreakerMetricsCollector ofSupplier(MetricNames names, Supplier<? extends Iterable<? extends CircuitBreaker>> supplier) {
return new CircuitBreakerMetricsCollector(names, supplier);
} | [
"public",
"static",
"CircuitBreakerMetricsCollector",
"ofSupplier",
"(",
"MetricNames",
"names",
",",
"Supplier",
"<",
"?",
"extends",
"Iterable",
"<",
"?",
"extends",
"CircuitBreaker",
">",
">",
"supplier",
")",
"{",
"return",
"new",
"CircuitBreakerMetricsCollector",... | Creates a new collector with custom metric names and
using given {@code supplier} as source of circuit breakers.
@param names the custom metric names
@param supplier the supplier of circuit breakers, note that supplier will be called one every {@link #collect()} | [
"Creates",
"a",
"new",
"collector",
"with",
"custom",
"metric",
"names",
"and",
"using",
"given",
"{",
"@code",
"supplier",
"}",
"as",
"source",
"of",
"circuit",
"breakers",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/collectors/CircuitBreakerMetricsCollector.java#L42-L44 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java | Transliterator.getDisplayName | public static String getDisplayName(String id, Locale inLocale) {
"""
Returns a name for this transliterator that is appropriate for
display to the user in the given locale. This name is taken
from the locale resource data in the standard manner of the
<code>java.text</code> package.
<p>If no localized name... | java | public static String getDisplayName(String id, Locale inLocale) {
return getDisplayName(id, ULocale.forLocale(inLocale));
} | [
"public",
"static",
"String",
"getDisplayName",
"(",
"String",
"id",
",",
"Locale",
"inLocale",
")",
"{",
"return",
"getDisplayName",
"(",
"id",
",",
"ULocale",
".",
"forLocale",
"(",
"inLocale",
")",
")",
";",
"}"
] | Returns a name for this transliterator that is appropriate for
display to the user in the given locale. This name is taken
from the locale resource data in the standard manner of the
<code>java.text</code> package.
<p>If no localized names exist in the system resource bundles,
a name is synthesized using a localized
... | [
"Returns",
"a",
"name",
"for",
"this",
"transliterator",
"that",
"is",
"appropriate",
"for",
"display",
"to",
"the",
"user",
"in",
"the",
"given",
"locale",
".",
"This",
"name",
"is",
"taken",
"from",
"the",
"locale",
"resource",
"data",
"in",
"the",
"stan... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1173-L1175 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/utils/LocaleUtils.java | LocaleUtils.getNonEmptyLanguage | public String getNonEmptyLanguage(Context context, String language) {
"""
Returns the locale passed in if it is not null, otherwise returns the device locale
@param context to get device locale
@param language to check if it is null
@return a non-null locale, either the one passed in, or the device locale
... | java | public String getNonEmptyLanguage(Context context, String language) {
if (language == null) {
return inferDeviceLanguage(context);
}
return language;
} | [
"public",
"String",
"getNonEmptyLanguage",
"(",
"Context",
"context",
",",
"String",
"language",
")",
"{",
"if",
"(",
"language",
"==",
"null",
")",
"{",
"return",
"inferDeviceLanguage",
"(",
"context",
")",
";",
"}",
"return",
"language",
";",
"}"
] | Returns the locale passed in if it is not null, otherwise returns the device locale
@param context to get device locale
@param language to check if it is null
@return a non-null locale, either the one passed in, or the device locale | [
"Returns",
"the",
"locale",
"passed",
"in",
"if",
"it",
"is",
"not",
"null",
"otherwise",
"returns",
"the",
"device",
"locale"
] | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/utils/LocaleUtils.java#L63-L68 |
rholder/fauxflake | fauxflake-core/src/main/java/com/github/rholder/fauxflake/util/MacUtils.java | MacUtils.realMacAddress | public static byte[] realMacAddress() {
"""
Return a 6 byte array where each byte represents a value in the MAC
address of the first valid interface found or an
{@link UnsupportedOperationException} is thrown if an error occurs.
"""
byte[] mac = null;
try {
// enumerations are won... | java | public static byte[] realMacAddress() {
byte[] mac = null;
try {
// enumerations are wonky...
Enumeration<NetworkInterface> networkInterfaces = getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
NetworkInterface n = networkInterfaces... | [
"public",
"static",
"byte",
"[",
"]",
"realMacAddress",
"(",
")",
"{",
"byte",
"[",
"]",
"mac",
"=",
"null",
";",
"try",
"{",
"// enumerations are wonky...",
"Enumeration",
"<",
"NetworkInterface",
">",
"networkInterfaces",
"=",
"getNetworkInterfaces",
"(",
")",... | Return a 6 byte array where each byte represents a value in the MAC
address of the first valid interface found or an
{@link UnsupportedOperationException} is thrown if an error occurs. | [
"Return",
"a",
"6",
"byte",
"array",
"where",
"each",
"byte",
"represents",
"a",
"value",
"in",
"the",
"MAC",
"address",
"of",
"the",
"first",
"valid",
"interface",
"found",
"or",
"an",
"{"
] | train | https://github.com/rholder/fauxflake/blob/54631faefdaf6b0b4d27b365f18c085771575cb3/fauxflake-core/src/main/java/com/github/rholder/fauxflake/util/MacUtils.java#L66-L86 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.getUserStatistic | public UserStatListResult getUserStatistic(String startTime, int duration)
throws APIConnectionException, APIRequestException {
"""
Get user statistic, now time unit only supports DAY
@param startTime start time, format: yyyy-MM-dd
@param duration 0-60
@return {@link UserStatListResult}
@throws API... | java | public UserStatListResult getUserStatistic(String startTime, int duration)
throws APIConnectionException, APIRequestException {
return _reportClient.getUserStatistic(startTime, duration);
} | [
"public",
"UserStatListResult",
"getUserStatistic",
"(",
"String",
"startTime",
",",
"int",
"duration",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_reportClient",
".",
"getUserStatistic",
"(",
"startTime",
",",
"duration",
")",
... | Get user statistic, now time unit only supports DAY
@param startTime start time, format: yyyy-MM-dd
@param duration 0-60
@return {@link UserStatListResult}
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Get",
"user",
"statistic",
"now",
"time",
"unit",
"only",
"supports",
"DAY"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L996-L999 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSVariant.java | JSVariant.box | JSchema box(Map context) {
"""
includes a cyclic reference to a JSchema already under construction.
"""
if (boxed != null)
return boxed; // only do it once
JSVariant subTop = new JSVariant();
subTop.cases = cases;
subTop.boxedBy = this;
boxed = (JSchema)context.get(subTop);
if (bo... | java | JSchema box(Map context) {
if (boxed != null)
return boxed; // only do it once
JSVariant subTop = new JSVariant();
subTop.cases = cases;
subTop.boxedBy = this;
boxed = (JSchema)context.get(subTop);
if (boxed == null) {
boxed = new JSchema(subTop, context);
for (int i = 0; i < c... | [
"JSchema",
"box",
"(",
"Map",
"context",
")",
"{",
"if",
"(",
"boxed",
"!=",
"null",
")",
"return",
"boxed",
";",
"// only do it once",
"JSVariant",
"subTop",
"=",
"new",
"JSVariant",
"(",
")",
";",
"subTop",
".",
"cases",
"=",
"cases",
";",
"subTop",
... | includes a cyclic reference to a JSchema already under construction. | [
"includes",
"a",
"cyclic",
"reference",
"to",
"a",
"JSchema",
"already",
"under",
"construction",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSVariant.java#L195-L209 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/Where.java | Where.isNull | public Where<T, ID> isNull(String columnName) throws SQLException {
"""
Add a 'IS NULL' clause so the column must be null. '=' NULL does not work.
"""
addClause(new IsNull(columnName, findColumnFieldType(columnName)));
return this;
} | java | public Where<T, ID> isNull(String columnName) throws SQLException {
addClause(new IsNull(columnName, findColumnFieldType(columnName)));
return this;
} | [
"public",
"Where",
"<",
"T",
",",
"ID",
">",
"isNull",
"(",
"String",
"columnName",
")",
"throws",
"SQLException",
"{",
"addClause",
"(",
"new",
"IsNull",
"(",
"columnName",
",",
"findColumnFieldType",
"(",
"columnName",
")",
")",
")",
";",
"return",
"this... | Add a 'IS NULL' clause so the column must be null. '=' NULL does not work. | [
"Add",
"a",
"IS",
"NULL",
"clause",
"so",
"the",
"column",
"must",
"be",
"null",
".",
"=",
"NULL",
"does",
"not",
"work",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/Where.java#L283-L286 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_coupon_POST | public ArrayList<String> cart_cartId_coupon_POST(String cartId, String coupon) throws IOException {
"""
Add a new coupon to cart
REST: POST /order/cart/{cartId}/coupon
@param cartId [required] Cart identifier
@param coupon [required] Coupon identifier
"""
String qPath = "/order/cart/{cartId}/coupon";
... | java | public ArrayList<String> cart_cartId_coupon_POST(String cartId, String coupon) throws IOException {
String qPath = "/order/cart/{cartId}/coupon";
StringBuilder sb = path(qPath, cartId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "coupon", coupon);
String resp = execN(qPath, "POST", s... | [
"public",
"ArrayList",
"<",
"String",
">",
"cart_cartId_coupon_POST",
"(",
"String",
"cartId",
",",
"String",
"coupon",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/coupon\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | Add a new coupon to cart
REST: POST /order/cart/{cartId}/coupon
@param cartId [required] Cart identifier
@param coupon [required] Coupon identifier | [
"Add",
"a",
"new",
"coupon",
"to",
"cart"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L10002-L10009 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getDetailName | public String getDetailName(CmsResource res, Locale locale, List<Locale> defaultLocales) throws CmsException {
"""
Returns the detail name of a resource.<p>
The detail view URI of a content element consists of its detail page URI and the detail name returned by this
method.<p>
@param res the resource for wh... | java | public String getDetailName(CmsResource res, Locale locale, List<Locale> defaultLocales) throws CmsException {
String urlName = readBestUrlName(res.getStructureId(), locale, defaultLocales);
if (urlName == null) {
urlName = res.getStructureId().toString();
}
return urlName;
... | [
"public",
"String",
"getDetailName",
"(",
"CmsResource",
"res",
",",
"Locale",
"locale",
",",
"List",
"<",
"Locale",
">",
"defaultLocales",
")",
"throws",
"CmsException",
"{",
"String",
"urlName",
"=",
"readBestUrlName",
"(",
"res",
".",
"getStructureId",
"(",
... | Returns the detail name of a resource.<p>
The detail view URI of a content element consists of its detail page URI and the detail name returned by this
method.<p>
@param res the resource for which the detail name should be retrieved
@param locale the locale for the detail name
@param defaultLocales the default locale... | [
"Returns",
"the",
"detail",
"name",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1397-L1404 |
apache/groovy | src/main/groovy/groovy/lang/ExpandoMetaClass.java | ExpandoMetaClass.invokeMethod | public Object invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass) {
"""
Overrides default implementation just in case invokeMethod has been overridden by ExpandoMetaClass
@see groovy.lang.MetaClassImpl#invokeMethod(Class, Objec... | java | public Object invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass) {
if (invokeMethodMethod != null) {
MetaClassHelper.unwrap(originalArguments);
return invokeMethodMethod.invoke(object, new Object[]{meth... | [
"public",
"Object",
"invokeMethod",
"(",
"Class",
"sender",
",",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"originalArguments",
",",
"boolean",
"isCallToSuper",
",",
"boolean",
"fromInsideClass",
")",
"{",
"if",
"(",
"invokeMethod... | Overrides default implementation just in case invokeMethod has been overridden by ExpandoMetaClass
@see groovy.lang.MetaClassImpl#invokeMethod(Class, Object, String, Object[], boolean, boolean) | [
"Overrides",
"default",
"implementation",
"just",
"in",
"case",
"invokeMethod",
"has",
"been",
"overridden",
"by",
"ExpandoMetaClass"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ExpandoMetaClass.java#L1120-L1126 |
RestComm/Restcomm-Connect | restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/util/CallControlHelper.java | CallControlHelper.checkAuthentication | public static boolean checkAuthentication(SipServletRequest request, DaoManager storage, Sid organizationSid) throws IOException {
"""
Check if a client is authenticated. If so, return true. Otherwise request authentication and return false;
@param request
@param storage
@param organizationSid
@return
@throws... | java | public static boolean checkAuthentication(SipServletRequest request, DaoManager storage, Sid organizationSid) throws IOException {
// Make sure we force clients to authenticate.
final String authorization = request.getHeader("Proxy-Authorization");
final String method = request.getMethod();
... | [
"public",
"static",
"boolean",
"checkAuthentication",
"(",
"SipServletRequest",
"request",
",",
"DaoManager",
"storage",
",",
"Sid",
"organizationSid",
")",
"throws",
"IOException",
"{",
"// Make sure we force clients to authenticate.",
"final",
"String",
"authorization",
"... | Check if a client is authenticated. If so, return true. Otherwise request authentication and return false;
@param request
@param storage
@param organizationSid
@return
@throws IOException | [
"Check",
"if",
"a",
"client",
"is",
"authenticated",
".",
"If",
"so",
"return",
"true",
".",
"Otherwise",
"request",
"authentication",
"and",
"return",
"false",
";"
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/util/CallControlHelper.java#L102-L116 |
reactor/reactor-netty | src/main/java/reactor/netty/channel/BootstrapHandlers.java | BootstrapHandlers.connectionObserver | @SuppressWarnings("unchecked")
public static ConnectionObserver connectionObserver(AbstractBootstrap<?, ?> b) {
"""
Obtain and remove the current {@link ConnectionObserver} from the bootstrap.
@param b the bootstrap to scan
@return current {@link ConnectionObserver} or null
"""
Objects.requireNonNull(... | java | @SuppressWarnings("unchecked")
public static ConnectionObserver connectionObserver(AbstractBootstrap<?, ?> b) {
Objects.requireNonNull(b, "bootstrap");
ConnectionObserver obs =
(ConnectionObserver) b.config()
.options()
.get(OBSERVER_OPTION);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"ConnectionObserver",
"connectionObserver",
"(",
"AbstractBootstrap",
"<",
"?",
",",
"?",
">",
"b",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"b",
",",
"\"bootstrap\"",
")",
";",
"C... | Obtain and remove the current {@link ConnectionObserver} from the bootstrap.
@param b the bootstrap to scan
@return current {@link ConnectionObserver} or null | [
"Obtain",
"and",
"remove",
"the",
"current",
"{",
"@link",
"ConnectionObserver",
"}",
"from",
"the",
"bootstrap",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/channel/BootstrapHandlers.java#L248-L260 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/AssertUtils.java | AssertUtils.notEmpty | public static void notEmpty(Map<?, ?> map, String message) {
"""
Assert that a Map has entries; that is, it must not be <code>null</code>
and must have at least one entry.
<p/>
<pre class="code">
Assert.notEmpty(map, "Map must have entries");
</pre>
@param map the map to check
@param message... | java | public static void notEmpty(Map<?, ?> map, String message) {
if (map == null || map.isEmpty()) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"String",
"message",
")",
"{",
"if",
"(",
"map",
"==",
"null",
"||",
"map",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Assert that a Map has entries; that is, it must not be <code>null</code>
and must have at least one entry.
<p/>
<pre class="code">
Assert.notEmpty(map, "Map must have entries");
</pre>
@param map the map to check
@param message the exception message to use if the assertion fails
@throws IllegalArgumentEx... | [
"Assert",
"that",
"a",
"Map",
"has",
"entries",
";",
"that",
"is",
"it",
"must",
"not",
"be",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"must",
"have",
"at",
"least",
"one",
"entry",
".",
"<p",
"/",
">",
"<pre",
"class",
"=",
"code",
">",
"... | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/AssertUtils.java#L407-L411 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/MapOperator.java | MapOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
"""
Execute MAP operator. Extract content map using given property path and serialize every map entry using first two child
elements as key/value templates.
@para... | java | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) {
throw new TemplateException("Operand is property path but scope is not an object.");... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"propertyPath",
",",
"Object",
"...",
"arguments",
")",
"throws",
"IOException",
",",
"TemplateException",
"{",
"if",
"(",
"!",
"propertyPath",
... | Execute MAP operator. Extract content map using given property path and serialize every map entry using first two child
elements as key/value templates.
@param element context element,
@param scope scope object,
@param propertyPath property path,
@param arguments optional arguments, not used.
@return always returns nu... | [
"Execute",
"MAP",
"operator",
".",
"Extract",
"content",
"map",
"using",
"given",
"property",
"path",
"and",
"serialize",
"every",
"map",
"entry",
"using",
"first",
"two",
"child",
"elements",
"as",
"key",
"/",
"value",
"templates",
"."
] | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/MapOperator.java#L76-L95 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/JbcSrcJavaValue.java | JbcSrcJavaValue.of | static JbcSrcJavaValue of(Expression expr, Method method, JbcSrcValueErrorReporter reporter) {
"""
Constructs a JbcSrcJavaValue based on the Expression. The method is used to display helpful
error messages to the user if necessary. It is not invoked.
"""
checkNotNull(method);
if (expr instanceof SoyEx... | java | static JbcSrcJavaValue of(Expression expr, Method method, JbcSrcValueErrorReporter reporter) {
checkNotNull(method);
if (expr instanceof SoyExpression) {
return new JbcSrcJavaValue(
expr,
method,
/* allowedType= */ ((SoyExpression) expr).soyType(),
/* constantNull= ... | [
"static",
"JbcSrcJavaValue",
"of",
"(",
"Expression",
"expr",
",",
"Method",
"method",
",",
"JbcSrcValueErrorReporter",
"reporter",
")",
"{",
"checkNotNull",
"(",
"method",
")",
";",
"if",
"(",
"expr",
"instanceof",
"SoyExpression",
")",
"{",
"return",
"new",
... | Constructs a JbcSrcJavaValue based on the Expression. The method is used to display helpful
error messages to the user if necessary. It is not invoked. | [
"Constructs",
"a",
"JbcSrcJavaValue",
"based",
"on",
"the",
"Expression",
".",
"The",
"method",
"is",
"used",
"to",
"display",
"helpful",
"error",
"messages",
"to",
"the",
"user",
"if",
"necessary",
".",
"It",
"is",
"not",
"invoked",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/JbcSrcJavaValue.java#L73-L91 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuExceptionUtil.java | GosuExceptionUtil.findException | public static <T extends Throwable> T findException(Class<T> exceptionTypeToFind, Throwable t) {
"""
Given an Exception and an Exception type to look for, finds the exception of that type
or returns null if none of that type exist.
"""
Throwable cause = t;
while (cause != null)
{
if( excep... | java | public static <T extends Throwable> T findException(Class<T> exceptionTypeToFind, Throwable t) {
Throwable cause = t;
while (cause != null)
{
if( exceptionTypeToFind.isAssignableFrom( cause.getClass() ) )
{
//noinspection unchecked
return (T)cause;
}
if( cause == ca... | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"findException",
"(",
"Class",
"<",
"T",
">",
"exceptionTypeToFind",
",",
"Throwable",
"t",
")",
"{",
"Throwable",
"cause",
"=",
"t",
";",
"while",
"(",
"cause",
"!=",
"null",
")",
"{",
"i... | Given an Exception and an Exception type to look for, finds the exception of that type
or returns null if none of that type exist. | [
"Given",
"an",
"Exception",
"and",
"an",
"Exception",
"type",
"to",
"look",
"for",
"finds",
"the",
"exception",
"of",
"that",
"type",
"or",
"returns",
"null",
"if",
"none",
"of",
"that",
"type",
"exist",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuExceptionUtil.java#L91-L110 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeTypeEntry | protected void writeTypeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write statement type.
<p>default: Type: Prepared,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3
"""
s... | java | protected void writeTypeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Type:");
sb.append(getStatementType(execInfo.getStatementType()));
sb.append(", ");
} | [
"protected",
"void",
"writeTypeEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Type:\"",
")",
";",
"sb",
".",
"append",
"(",
"getStatementType",
... | Write statement type.
<p>default: Type: Prepared,
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"statement",
"type",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L158-L162 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.scaleEquals | public static Atom scaleEquals(Atom a, double s) {
"""
Multiply elements of a by s (in place)
@param a
@param s
@return the modified a
"""
double x = a.getX();
double y = a.getY();
double z = a.getZ();
x *= s;
y *= s;
z *= s;
//Atom b = new AtomImpl();
a.setX(x);
a.setY(y);
a.setZ(z)... | java | public static Atom scaleEquals(Atom a, double s) {
double x = a.getX();
double y = a.getY();
double z = a.getZ();
x *= s;
y *= s;
z *= s;
//Atom b = new AtomImpl();
a.setX(x);
a.setY(y);
a.setZ(z);
return a;
} | [
"public",
"static",
"Atom",
"scaleEquals",
"(",
"Atom",
"a",
",",
"double",
"s",
")",
"{",
"double",
"x",
"=",
"a",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"a",
".",
"getY",
"(",
")",
";",
"double",
"z",
"=",
"a",
".",
"getZ",
"(",
")... | Multiply elements of a by s (in place)
@param a
@param s
@return the modified a | [
"Multiply",
"elements",
"of",
"a",
"by",
"s",
"(",
"in",
"place",
")"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L830-L845 |
JOML-CI/JOML | src/org/joml/Matrix3x2f.java | Matrix3x2f.transformDirection | public Vector2f transformDirection(float x, float y, Vector2f dest) {
"""
Transform/multiply the given 2D-vector <code>(x, y)</code>, as if it was a 3D-vector with z=0, by
this matrix and store the result in <code>dest</code>.
<p>
The given 2D-vector is treated as a 3D-vector with its z-component being <code>0.... | java | public Vector2f transformDirection(float x, float y, Vector2f dest) {
return dest.set(m00 * x + m10 * y, m01 * x + m11 * y);
} | [
"public",
"Vector2f",
"transformDirection",
"(",
"float",
"x",
",",
"float",
"y",
",",
"Vector2f",
"dest",
")",
"{",
"return",
"dest",
".",
"set",
"(",
"m00",
"*",
"x",
"+",
"m10",
"*",
"y",
",",
"m01",
"*",
"x",
"+",
"m11",
"*",
"y",
")",
";",
... | Transform/multiply the given 2D-vector <code>(x, y)</code>, as if it was a 3D-vector with z=0, by
this matrix and store the result in <code>dest</code>.
<p>
The given 2D-vector is treated as a 3D-vector with its z-component being <code>0.0</code>, so it
will represent a direction in 2D-space rather than a position. Thi... | [
"Transform",
"/",
"multiply",
"the",
"given",
"2D",
"-",
"vector",
"<code",
">",
"(",
"x",
"y",
")",
"<",
"/",
"code",
">",
"as",
"if",
"it",
"was",
"a",
"3D",
"-",
"vector",
"with",
"z",
"=",
"0",
"by",
"this",
"matrix",
"and",
"store",
"the",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2f.java#L1803-L1805 |
aws/aws-sdk-java | jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java | JmesPathEvaluationVisitor.visit | @Override
public JsonNode visit(JmesPathSubExpression subExpression, JsonNode input) throws InvalidTypeException {
"""
Evaluates a subexpression by evaluating the expression on
the left with the original JSON document and then evaluating
the expression on the right with the result of the left
expression eva... | java | @Override
public JsonNode visit(JmesPathSubExpression subExpression, JsonNode input) throws InvalidTypeException {
JsonNode prelimnaryResult = subExpression.getExpressions().get(0).accept(this, input);
for (int i = 1; i < subExpression.getExpressions().size(); i++) {
prelimnaryResult = s... | [
"@",
"Override",
"public",
"JsonNode",
"visit",
"(",
"JmesPathSubExpression",
"subExpression",
",",
"JsonNode",
"input",
")",
"throws",
"InvalidTypeException",
"{",
"JsonNode",
"prelimnaryResult",
"=",
"subExpression",
".",
"getExpressions",
"(",
")",
".",
"get",
"(... | Evaluates a subexpression by evaluating the expression on
the left with the original JSON document and then evaluating
the expression on the right with the result of the left
expression evaluation.
@param subExpression JmesPath subexpression type
@param input Input json node against which evaluation is done
@r... | [
"Evaluates",
"a",
"subexpression",
"by",
"evaluating",
"the",
"expression",
"on",
"the",
"left",
"with",
"the",
"original",
"JSON",
"document",
"and",
"then",
"evaluating",
"the",
"expression",
"on",
"the",
"right",
"with",
"the",
"result",
"of",
"the",
"left"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java#L39-L46 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java | ProbeManagerImpl.addInterestedByClass | synchronized void addInterestedByClass(Class<?> clazz, Collection<ProbeListener> newListeners) {
"""
Associate the collection of listeners with {@link ProbeFilter}s that
match the specified class with the specified class.
@param clazz the probe source candidate
@param newListeners listeners with filters that ... | java | synchronized void addInterestedByClass(Class<?> clazz, Collection<ProbeListener> newListeners) {
Set<ProbeListener> currentListeners = listenersByClass.get(clazz);
if (currentListeners == null) {
currentListeners = new HashSet<ProbeListener>();
listenersByClass.put(clazz, current... | [
"synchronized",
"void",
"addInterestedByClass",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Collection",
"<",
"ProbeListener",
">",
"newListeners",
")",
"{",
"Set",
"<",
"ProbeListener",
">",
"currentListeners",
"=",
"listenersByClass",
".",
"get",
"(",
"clazz",... | Associate the collection of listeners with {@link ProbeFilter}s that
match the specified class with the specified class.
@param clazz the probe source candidate
@param newListeners listeners with filters that match {@code clazz} | [
"Associate",
"the",
"collection",
"of",
"listeners",
"with",
"{",
"@link",
"ProbeFilter",
"}",
"s",
"that",
"match",
"the",
"specified",
"class",
"with",
"the",
"specified",
"class",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java#L564-L571 |
EdwardRaff/JSAT | JSAT/src/jsat/io/JSATData.java | JSATData.writeData | public static <Type extends DataSet<Type>> void writeData(DataSet<Type> dataset, OutputStream outRaw) throws IOException {
"""
This method writes out a JSAT dataset to a binary format that can be read
in again later, and could be read in other languages.<br>
<br>
The format that is used will understand both
{@... | java | public static <Type extends DataSet<Type>> void writeData(DataSet<Type> dataset, OutputStream outRaw) throws IOException
{
writeData(dataset, outRaw, FloatStorageMethod.AUTO);
} | [
"public",
"static",
"<",
"Type",
"extends",
"DataSet",
"<",
"Type",
">",
">",
"void",
"writeData",
"(",
"DataSet",
"<",
"Type",
">",
"dataset",
",",
"OutputStream",
"outRaw",
")",
"throws",
"IOException",
"{",
"writeData",
"(",
"dataset",
",",
"outRaw",
",... | This method writes out a JSAT dataset to a binary format that can be read
in again later, and could be read in other languages.<br>
<br>
The format that is used will understand both
{@link ClassificationDataSet} and {@link RegressionDataSet} datasets as
special cases, and will store the target values in the binary file... | [
"This",
"method",
"writes",
"out",
"a",
"JSAT",
"dataset",
"to",
"a",
"binary",
"format",
"that",
"can",
"be",
"read",
"in",
"again",
"later",
"and",
"could",
"be",
"read",
"in",
"other",
"languages",
".",
"<br",
">",
"<br",
">",
"The",
"format",
"that... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/JSATData.java#L297-L300 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java | CheckArg.containsNoNulls | public static void containsNoNulls( Iterable<?> argument,
String name ) {
"""
Check that the collection is not null and contains no nulls
@param argument Array
@param name The name of the argument
@throws IllegalArgumentException If array is null or has null values
... | java | public static void containsNoNulls( Iterable<?> argument,
String name ) {
isNotNull(argument, name);
int i = 0;
for (Object object : argument) {
if (object == null) {
throw new IllegalArgumentException(CommonI18n.argumentMayNotC... | [
"public",
"static",
"void",
"containsNoNulls",
"(",
"Iterable",
"<",
"?",
">",
"argument",
",",
"String",
"name",
")",
"{",
"isNotNull",
"(",
"argument",
",",
"name",
")",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"Object",
"object",
":",
"argument",... | Check that the collection is not null and contains no nulls
@param argument Array
@param name The name of the argument
@throws IllegalArgumentException If array is null or has null values | [
"Check",
"that",
"the",
"collection",
"is",
"not",
"null",
"and",
"contains",
"no",
"nulls"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java#L684-L694 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.isNotEqual | public static BooleanIsNotEqual isNotEqual(ComparableExpression<Boolean> left, ComparableExpression<Boolean> right) {
"""
Creates an BooleanIsNotEqual expression from the given expressions.
@param left The left expression.
@param right The right expression.
@return A new BooleanIsNotEqual binary expression.
... | java | public static BooleanIsNotEqual isNotEqual(ComparableExpression<Boolean> left, ComparableExpression<Boolean> right) {
return new BooleanIsNotEqual(left, right);
} | [
"public",
"static",
"BooleanIsNotEqual",
"isNotEqual",
"(",
"ComparableExpression",
"<",
"Boolean",
">",
"left",
",",
"ComparableExpression",
"<",
"Boolean",
">",
"right",
")",
"{",
"return",
"new",
"BooleanIsNotEqual",
"(",
"left",
",",
"right",
")",
";",
"}"
] | Creates an BooleanIsNotEqual expression from the given expressions.
@param left The left expression.
@param right The right expression.
@return A new BooleanIsNotEqual binary expression. | [
"Creates",
"an",
"BooleanIsNotEqual",
"expression",
"from",
"the",
"given",
"expressions",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L487-L489 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.