repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/DatabaseManager.java | DatabaseManager.deRegisterServer | private static void deRegisterServer(Server server, Database db) {
Iterator it = serverMap.values().iterator();
for (; it.hasNext(); ) {
HashSet databases = (HashSet) it.next();
databases.remove(db);
if (databases.isEmpty()) {
it.remove();
... | java | private static void deRegisterServer(Server server, Database db) {
Iterator it = serverMap.values().iterator();
for (; it.hasNext(); ) {
HashSet databases = (HashSet) it.next();
databases.remove(db);
if (databases.isEmpty()) {
it.remove();
... | [
"private",
"static",
"void",
"deRegisterServer",
"(",
"Server",
"server",
",",
"Database",
"db",
")",
"{",
"Iterator",
"it",
"=",
"serverMap",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"for",
"(",
";",
"it",
".",
"hasNext",
"(",
")",
"... | Deregisters a server as serving a given database. Not yet used. | [
"Deregisters",
"a",
"server",
"as",
"serving",
"a",
"given",
"database",
".",
"Not",
"yet",
"used",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/DatabaseManager.java#L449-L462 |
demidenko05/beigesoft-webstore | src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java | PrcRefreshItemsInList.findFirstIdxFor | protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) {
int j = 0;
while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) {
j++;
}
return j;
} | java | protected final <T extends AItemSpecifics<?, ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) {
int j = 0;
while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) {
j++;
}
return j;
} | [
"protected",
"final",
"<",
"T",
"extends",
"AItemSpecifics",
"<",
"?",
",",
"?",
">",
">",
"int",
"findFirstIdxFor",
"(",
"final",
"List",
"<",
"T",
">",
"pOutdGdSpList",
",",
"final",
"IHasIdLongVersionName",
"pItem",
")",
"{",
"int",
"j",
"=",
"0",
";"... | <p>Find the first index of specific with given item.</p>
@param <T> item specifics type
@param pOutdGdSpList GS list
@param pItem Goods
@return the first index of specific with given item
it throws Exception - if out of bounds | [
"<p",
">",
"Find",
"the",
"first",
"index",
"of",
"specific",
"with",
"given",
"item",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-webstore/blob/41ed2e2f1c640d37951d5fb235f26856008b87e1/src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java#L1170-L1176 |
apache/fluo-recipes | modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java | RecordingTransactionBase.wrap | public static RecordingTransactionBase wrap(TransactionBase txb, Predicate<LogEntry> filter) {
return new RecordingTransactionBase(txb, filter);
} | java | public static RecordingTransactionBase wrap(TransactionBase txb, Predicate<LogEntry> filter) {
return new RecordingTransactionBase(txb, filter);
} | [
"public",
"static",
"RecordingTransactionBase",
"wrap",
"(",
"TransactionBase",
"txb",
",",
"Predicate",
"<",
"LogEntry",
">",
"filter",
")",
"{",
"return",
"new",
"RecordingTransactionBase",
"(",
"txb",
",",
"filter",
")",
";",
"}"
] | Creates a RecordingTransactionBase using the provided LogEntry filter function and existing
TransactionBase | [
"Creates",
"a",
"RecordingTransactionBase",
"using",
"the",
"provided",
"LogEntry",
"filter",
"function",
"and",
"existing",
"TransactionBase"
] | train | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/core/src/main/java/org/apache/fluo/recipes/core/transaction/RecordingTransactionBase.java#L310-L312 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/json/PJsonArray.java | PJsonArray.getFloat | @Override
public final float getFloat(final int i) {
double val = this.array.optDouble(i, Double.MAX_VALUE);
if (val == Double.MAX_VALUE) {
throw new ObjectMissingException(this, "[" + i + "]");
}
return (float) val;
} | java | @Override
public final float getFloat(final int i) {
double val = this.array.optDouble(i, Double.MAX_VALUE);
if (val == Double.MAX_VALUE) {
throw new ObjectMissingException(this, "[" + i + "]");
}
return (float) val;
} | [
"@",
"Override",
"public",
"final",
"float",
"getFloat",
"(",
"final",
"int",
"i",
")",
"{",
"double",
"val",
"=",
"this",
".",
"array",
".",
"optDouble",
"(",
"i",
",",
"Double",
".",
"MAX_VALUE",
")",
";",
"if",
"(",
"val",
"==",
"Double",
".",
"... | Get the element at the index as a float.
@param i the index of the element to access | [
"Get",
"the",
"element",
"at",
"the",
"index",
"as",
"a",
"float",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/json/PJsonArray.java#L113-L120 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.encodeObject | @Nonnull
public static String encodeObject (@Nonnull final Serializable aSerializableObject,
final int nOptions) throws IOException
{
ValueEnforcer.notNull (aSerializableObject, "Object");
// ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream
final NonB... | java | @Nonnull
public static String encodeObject (@Nonnull final Serializable aSerializableObject,
final int nOptions) throws IOException
{
ValueEnforcer.notNull (aSerializableObject, "Object");
// ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream
final NonB... | [
"@",
"Nonnull",
"public",
"static",
"String",
"encodeObject",
"(",
"@",
"Nonnull",
"final",
"Serializable",
"aSerializableObject",
",",
"final",
"int",
"nOptions",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSerializableObject",
",",
... | Serializes an object and returns the Base64-encoded version of that
serialized object.
<p>
As of v 2.3, if the object cannot be serialized or there is another error,
the method will throw an IOException. <b>This is new to v2.3!</b> In
earlier versions, it just returned a null value, but in retrospect that's a
pretty po... | [
"Serializes",
"an",
"object",
"and",
"returns",
"the",
"Base64",
"-",
"encoded",
"version",
"of",
"that",
"serialized",
"object",
".",
"<p",
">",
"As",
"of",
"v",
"2",
".",
"3",
"if",
"the",
"object",
"cannot",
"be",
"serialized",
"or",
"there",
"is",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L1602-L1633 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/core/Config.java | Config.getInt | public int getInt(String key, int defaultValue) {
final String value = this.props.getValue(key);
if (StringUtils.isBlank(value)) {
return defaultValue;
}
return Integer.parseInt(value);
} | java | public int getInt(String key, int defaultValue) {
final String value = this.props.getValue(key);
if (StringUtils.isBlank(value)) {
return defaultValue;
}
return Integer.parseInt(value);
} | [
"public",
"int",
"getInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"this",
".",
"props",
".",
"getValue",
"(",
"key",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"value",
")",
")",
"{"... | Retrieves a configuration value with the given key
@param key The key of the configuration value (e.g. application.name)
@param defaultValue The default value to return of no key is found
@return The configured value as int or the passed defautlValue if the key is not configured | [
"Retrieves",
"a",
"configuration",
"value",
"with",
"the",
"given",
"key"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Config.java#L221-L228 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/EntityUtils.java | EntityUtils.spawnEjectedItem | public static void spawnEjectedItem(World world, BlockPos pos, ItemStack itemStack)
{
if (itemStack == null || world.isRemote)
return;
float rx = world.rand.nextFloat() * 0.8F + 0.1F;
float ry = world.rand.nextFloat() * 0.8F + 0.1F;
float rz = world.rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem ... | java | public static void spawnEjectedItem(World world, BlockPos pos, ItemStack itemStack)
{
if (itemStack == null || world.isRemote)
return;
float rx = world.rand.nextFloat() * 0.8F + 0.1F;
float ry = world.rand.nextFloat() * 0.8F + 0.1F;
float rz = world.rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem ... | [
"public",
"static",
"void",
"spawnEjectedItem",
"(",
"World",
"world",
",",
"BlockPos",
"pos",
",",
"ItemStack",
"itemStack",
")",
"{",
"if",
"(",
"itemStack",
"==",
"null",
"||",
"world",
".",
"isRemote",
")",
"return",
";",
"float",
"rx",
"=",
"world",
... | Eject a new item corresponding to the {@link ItemStack}.
@param world the world
@param pos the pos
@param itemStack the item stack | [
"Eject",
"a",
"new",
"item",
"corresponding",
"to",
"the",
"{",
"@link",
"ItemStack",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/EntityUtils.java#L101-L118 |
michel-kraemer/gradle-download-task | src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java | DownloadAction.makeDestFile | private File makeDestFile(URL src) {
if (dest == null) {
throw new IllegalArgumentException("Please provide a download destination");
}
File destFile = dest;
if (destFile.isDirectory()) {
//guess name from URL
String name = src.toString();
... | java | private File makeDestFile(URL src) {
if (dest == null) {
throw new IllegalArgumentException("Please provide a download destination");
}
File destFile = dest;
if (destFile.isDirectory()) {
//guess name from URL
String name = src.toString();
... | [
"private",
"File",
"makeDestFile",
"(",
"URL",
"src",
")",
"{",
"if",
"(",
"dest",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Please provide a download destination\"",
")",
";",
"}",
"File",
"destFile",
"=",
"dest",
";",
"if",
... | Generates the path to an output file for a given source URL. Creates
all necessary parent directories for the destination file.
@param src the source
@return the path to the output file | [
"Generates",
"the",
"path",
"to",
"an",
"output",
"file",
"for",
"a",
"given",
"source",
"URL",
".",
"Creates",
"all",
"necessary",
"parent",
"directories",
"for",
"the",
"destination",
"file",
"."
] | train | https://github.com/michel-kraemer/gradle-download-task/blob/a20c7f29c15ccb699700518f860373692148e3fc/src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java#L517-L539 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getDateParam | protected Date getDateParam(String paramName, String errorMessage) throws IOException {
return getDateParam(paramName, errorMessage, (Map<String, Object>) inputParams.get());
} | java | protected Date getDateParam(String paramName, String errorMessage) throws IOException {
return getDateParam(paramName, errorMessage, (Map<String, Object>) inputParams.get());
} | [
"protected",
"Date",
"getDateParam",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
")",
"throws",
"IOException",
"{",
"return",
"getDateParam",
"(",
"paramName",
",",
"errorMessage",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"inputP... | Parses a date from either dd/MM/yyyy or yyyy-MM-dd format. Uses the default parameter inputmap.
@param paramName the name of the parameter containing the date
@param errorMessage the message to put in an error if one occurs
@return a date object correcponding with the jsonobject
@throws IOException If something wen... | [
"Parses",
"a",
"date",
"from",
"either",
"dd",
"/",
"MM",
"/",
"yyyy",
"or",
"yyyy",
"-",
"MM",
"-",
"dd",
"format",
".",
"Uses",
"the",
"default",
"parameter",
"inputmap",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L391-L393 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/Util.java | Util.validateParamsPresence | protected static void validateParamsPresence(Map params, String... keys) {
for (String name : keys) {
if (!params.containsKey(name)) {
throw new IllegalArgumentException("parameter: '" + name + "' is missing");
}
}
} | java | protected static void validateParamsPresence(Map params, String... keys) {
for (String name : keys) {
if (!params.containsKey(name)) {
throw new IllegalArgumentException("parameter: '" + name + "' is missing");
}
}
} | [
"protected",
"static",
"void",
"validateParamsPresence",
"(",
"Map",
"params",
",",
"String",
"...",
"keys",
")",
"{",
"for",
"(",
"String",
"name",
":",
"keys",
")",
"{",
"if",
"(",
"!",
"params",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"throw... | Will throw {@link IllegalArgumentException} if a key in the map is missing.
If a map does nto have all the passed in keys in it, this method will throw exception.
@param params map with values
@param keys list of keys to check | [
"Will",
"throw",
"{",
"@link",
"IllegalArgumentException",
"}",
"if",
"a",
"key",
"in",
"the",
"map",
"is",
"missing",
".",
"If",
"a",
"map",
"does",
"nto",
"have",
"all",
"the",
"passed",
"in",
"keys",
"in",
"it",
"this",
"method",
"will",
"throw",
"e... | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/Util.java#L35-L41 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setSteps | public static int[] setSteps(Last[][][] traceback, int[][][] scores, List<Step> sx, List<Step> sy) {
int xMax = scores.length - 1, yMax = scores[xMax].length - 1;
boolean linear = (traceback[xMax][yMax].length == 1);
Last last =
linear ?
traceback[xMax][yMax][0] :
(scores[xMax][yMax][1] > scores[xMa... | java | public static int[] setSteps(Last[][][] traceback, int[][][] scores, List<Step> sx, List<Step> sy) {
int xMax = scores.length - 1, yMax = scores[xMax].length - 1;
boolean linear = (traceback[xMax][yMax].length == 1);
Last last =
linear ?
traceback[xMax][yMax][0] :
(scores[xMax][yMax][1] > scores[xMa... | [
"public",
"static",
"int",
"[",
"]",
"setSteps",
"(",
"Last",
"[",
"]",
"[",
"]",
"[",
"]",
"traceback",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"scores",
",",
"List",
"<",
"Step",
">",
"sx",
",",
"List",
"<",
"Step",
">",
"sy",
")",
"{",
... | Find global alignment path through traceback matrix
@param traceback
@param scores
@param sx
@param sy
@return | [
"Find",
"global",
"alignment",
"path",
"through",
"traceback",
"matrix"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L652-L671 |
twilio/twilio-java | src/main/java/com/twilio/rest/monitor/v1/AlertReader.java | AlertReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<Alert> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.MONITOR.toString(),
"/v1/Alerts",
client.getRegion()
);
addQueryParam... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<Alert> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.MONITOR.toString(),
"/v1/Alerts",
client.getRegion()
);
addQueryParam... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"Alert",
">",
"firstPage",
"(",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
... | Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return Alert ResourceSet | [
"Make",
"the",
"request",
"to",
"the",
"Twilio",
"API",
"to",
"perform",
"the",
"read",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/monitor/v1/AlertReader.java#L88-L100 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/properties/PropertiesManagerCore.java | PropertiesManagerCore.deleteValue | public int deleteValue(String property, String value) {
int count = 0;
for (String geoPackage : propertiesMap.keySet()) {
if (deleteValue(geoPackage, property, value)) {
count++;
}
}
return count;
} | java | public int deleteValue(String property, String value) {
int count = 0;
for (String geoPackage : propertiesMap.keySet()) {
if (deleteValue(geoPackage, property, value)) {
count++;
}
}
return count;
} | [
"public",
"int",
"deleteValue",
"(",
"String",
"property",
",",
"String",
"value",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"String",
"geoPackage",
":",
"propertiesMap",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"deleteValue",
"(",
"geo... | Delete the property value from all GeoPackages
@param property
property name
@param value
property value
@return number of GeoPackages deleted from | [
"Delete",
"the",
"property",
"value",
"from",
"all",
"GeoPackages"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/properties/PropertiesManagerCore.java#L471-L479 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/std/XTimeExtension.java | XTimeExtension.assignTimestamp | public void assignTimestamp(XEvent event, long time) {
XAttributeTimestamp attr = (XAttributeTimestamp) ATTR_TIMESTAMP.clone();
attr.setValueMillis(time);
event.getAttributes().put(KEY_TIMESTAMP, attr);
} | java | public void assignTimestamp(XEvent event, long time) {
XAttributeTimestamp attr = (XAttributeTimestamp) ATTR_TIMESTAMP.clone();
attr.setValueMillis(time);
event.getAttributes().put(KEY_TIMESTAMP, attr);
} | [
"public",
"void",
"assignTimestamp",
"(",
"XEvent",
"event",
",",
"long",
"time",
")",
"{",
"XAttributeTimestamp",
"attr",
"=",
"(",
"XAttributeTimestamp",
")",
"ATTR_TIMESTAMP",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValueMillis",
"(",
"time",
")",
"... | Assigns to a given event its timestamp.
@param event
Event to be modified.
@param time
Timestamp, as a long of milliseconds in UNIX time. | [
"Assigns",
"to",
"a",
"given",
"event",
"its",
"timestamp",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XTimeExtension.java#L163-L167 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPage.java | CmsXmlContainerPage.writeContainerPage | public void writeContainerPage(CmsObject cms, CmsContainerPageBean cntPage) throws CmsException {
// keep unused containers
CmsContainerPageBean savePage = cleanupContainersContainers(cms, cntPage);
savePage = removeEmptyContainers(cntPage);
// Replace existing locales with master local... | java | public void writeContainerPage(CmsObject cms, CmsContainerPageBean cntPage) throws CmsException {
// keep unused containers
CmsContainerPageBean savePage = cleanupContainersContainers(cms, cntPage);
savePage = removeEmptyContainers(cntPage);
// Replace existing locales with master local... | [
"public",
"void",
"writeContainerPage",
"(",
"CmsObject",
"cms",
",",
"CmsContainerPageBean",
"cntPage",
")",
"throws",
"CmsException",
"{",
"// keep unused containers",
"CmsContainerPageBean",
"savePage",
"=",
"cleanupContainersContainers",
"(",
"cms",
",",
"cntPage",
")... | Saves a container page in in-memory XML structure.<p>
@param cms the current CMS context
@param cntPage the container page bean to save
@throws CmsException if something goes wrong | [
"Saves",
"a",
"container",
"page",
"in",
"in",
"-",
"memory",
"XML",
"structure",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java#L311-L327 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/FilterMatcher.java | FilterMatcher.valueConstantsMatch | private static boolean valueConstantsMatch(AbstractExpression e1, AbstractExpression e2) {
return (e1 instanceof ParameterValueExpression && e2 instanceof ConstantValueExpression ||
e1 instanceof ConstantValueExpression && e2 instanceof ParameterValueExpression) &&
equalsAsCVE(e1... | java | private static boolean valueConstantsMatch(AbstractExpression e1, AbstractExpression e2) {
return (e1 instanceof ParameterValueExpression && e2 instanceof ConstantValueExpression ||
e1 instanceof ConstantValueExpression && e2 instanceof ParameterValueExpression) &&
equalsAsCVE(e1... | [
"private",
"static",
"boolean",
"valueConstantsMatch",
"(",
"AbstractExpression",
"e1",
",",
"AbstractExpression",
"e2",
")",
"{",
"return",
"(",
"e1",
"instanceof",
"ParameterValueExpression",
"&&",
"e2",
"instanceof",
"ConstantValueExpression",
"||",
"e1",
"instanceof... | Value comparison between one CVE and one PVE.
@param e1 first expression
@param e2 second expression
@return whether one is CVE, the other is PVE, and their values equal. | [
"Value",
"comparison",
"between",
"one",
"CVE",
"and",
"one",
"PVE",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/FilterMatcher.java#L124-L128 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java | IntTuples.incrementLexicographically | private static boolean incrementLexicographically(
MutableIntTuple current, IntTuple min, IntTuple max, int index)
{
if (index == -1)
{
return false;
}
int oldValue = current.get(index);
int newValue = oldValue + 1;
current.set(index, newV... | java | private static boolean incrementLexicographically(
MutableIntTuple current, IntTuple min, IntTuple max, int index)
{
if (index == -1)
{
return false;
}
int oldValue = current.get(index);
int newValue = oldValue + 1;
current.set(index, newV... | [
"private",
"static",
"boolean",
"incrementLexicographically",
"(",
"MutableIntTuple",
"current",
",",
"IntTuple",
"min",
",",
"IntTuple",
"max",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"int"... | Recursively increment the given tuple lexicographically, starting at
the given index.
@param current The tuple to increment
@param min The minimum values
@param max The maximum values
@param index The index
@return Whether the tuple could be incremented | [
"Recursively",
"increment",
"the",
"given",
"tuple",
"lexicographically",
"starting",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java#L1557-L1573 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.beginDelete | public void beginDelete(String resourceGroupName, String publicIpAddressName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body();
} | java | public void beginDelete(String resourceGroupName, String publicIpAddressName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"publicIpAddressName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"publicIpAddressName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",... | Deletes the specified public IP address.
@param resourceGroupName The name of the resource group.
@param publicIpAddressName The name of the subnet.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all ... | [
"Deletes",
"the",
"specified",
"public",
"IP",
"address",
"."
] | 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/PublicIPAddressesInner.java#L211-L213 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.minusRetainScale | public BigMoney minusRetainScale(BigDecimal amountToSubtract, RoundingMode roundingMode) {
MoneyUtils.checkNotNull(amountToSubtract, "Amount must not be null");
if (amountToSubtract.compareTo(BigDecimal.ZERO) == 0) {
return this;
}
BigDecimal newAmount = amount.subtract(... | java | public BigMoney minusRetainScale(BigDecimal amountToSubtract, RoundingMode roundingMode) {
MoneyUtils.checkNotNull(amountToSubtract, "Amount must not be null");
if (amountToSubtract.compareTo(BigDecimal.ZERO) == 0) {
return this;
}
BigDecimal newAmount = amount.subtract(... | [
"public",
"BigMoney",
"minusRetainScale",
"(",
"BigDecimal",
"amountToSubtract",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"MoneyUtils",
".",
"checkNotNull",
"(",
"amountToSubtract",
",",
"\"Amount must not be null\"",
")",
";",
"if",
"(",
"amountToSubtract",
".",
... | Returns a copy of this monetary value with the amount subtracted retaining
the scale by rounding the result.
<p>
The scale of the result will be the same as the scale of this instance.
For example,'USD 25.95' minus '3.029' gives 'USD 22.92' with most rounding modes.
<p>
This instance is immutable and unaffected by this... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"amount",
"subtracted",
"retaining",
"the",
"scale",
"by",
"rounding",
"the",
"result",
".",
"<p",
">",
"The",
"scale",
"of",
"the",
"result",
"will",
"be",
"the",
"same",
"as",
"t... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1197-L1205 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.enlistResource | public boolean enlistResource(XAResource xaRes, int recoveryIndex) throws RollbackException, IllegalStateException, SystemException {
return enlistResource(xaRes, recoveryIndex, XAResource.TMNOFLAGS);
} | java | public boolean enlistResource(XAResource xaRes, int recoveryIndex) throws RollbackException, IllegalStateException, SystemException {
return enlistResource(xaRes, recoveryIndex, XAResource.TMNOFLAGS);
} | [
"public",
"boolean",
"enlistResource",
"(",
"XAResource",
"xaRes",
",",
"int",
"recoveryIndex",
")",
"throws",
"RollbackException",
",",
"IllegalStateException",
",",
"SystemException",
"{",
"return",
"enlistResource",
"(",
"xaRes",
",",
"recoveryIndex",
",",
"XAResou... | Enlist the resouce with the transaction associated with the target
TransactionImpl object.
This is the implementation version of the method and does take in the
XA resource class name and info objects required during recovery. If
these fields are provided (ie are not passed in as nulls) the resource
will be logged and... | [
"Enlist",
"the",
"resouce",
"with",
"the",
"transaction",
"associated",
"with",
"the",
"target",
"TransactionImpl",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2033-L2035 |
unic/neba | spring/src/main/java/io/neba/spring/mvc/BundleSpecificDispatcherServlet.java | BundleSpecificDispatcherServlet.onApplicationEvent | @Override
public void onApplicationEvent(@Nonnull ApplicationEvent event) {
if (event instanceof ContextRefreshedEvent) {
synchronized (this) {
ApplicationContext applicationContext = ((ContextRefreshedEvent) event).getApplicationContext();
setApplicationContext(n... | java | @Override
public void onApplicationEvent(@Nonnull ApplicationEvent event) {
if (event instanceof ContextRefreshedEvent) {
synchronized (this) {
ApplicationContext applicationContext = ((ContextRefreshedEvent) event).getApplicationContext();
setApplicationContext(n... | [
"@",
"Override",
"public",
"void",
"onApplicationEvent",
"(",
"@",
"Nonnull",
"ApplicationEvent",
"event",
")",
"{",
"if",
"(",
"event",
"instanceof",
"ContextRefreshedEvent",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"ApplicationContext",
"applicationContext... | Configures the context's bean factory with MVC infrastructure beans.
@param event can be <code>null</code>, in which case the event is ignored. | [
"Configures",
"the",
"context",
"s",
"bean",
"factory",
"with",
"MVC",
"infrastructure",
"beans",
"."
] | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/spring/src/main/java/io/neba/spring/mvc/BundleSpecificDispatcherServlet.java#L109-L130 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java | GeometryFactory.createLineString | public LineString createLineString(Coordinate[] coordinates) {
if (coordinates == null) {
return new LineString(srid, precision);
}
Coordinate[] clones = new Coordinate[coordinates.length];
for (int i = 0; i < coordinates.length; i++) {
clones[i] = (Coordinate) coordinates[i].clone();
}
return new Lin... | java | public LineString createLineString(Coordinate[] coordinates) {
if (coordinates == null) {
return new LineString(srid, precision);
}
Coordinate[] clones = new Coordinate[coordinates.length];
for (int i = 0; i < coordinates.length; i++) {
clones[i] = (Coordinate) coordinates[i].clone();
}
return new Lin... | [
"public",
"LineString",
"createLineString",
"(",
"Coordinate",
"[",
"]",
"coordinates",
")",
"{",
"if",
"(",
"coordinates",
"==",
"null",
")",
"{",
"return",
"new",
"LineString",
"(",
"srid",
",",
"precision",
")",
";",
"}",
"Coordinate",
"[",
"]",
"clones... | Create a new {@link LineString}, given an array of coordinates.
@param coordinates
An array of {@link Coordinate} objects.
@return Returns a {@link LineString} object. | [
"Create",
"a",
"new",
"{",
"@link",
"LineString",
"}",
"given",
"an",
"array",
"of",
"coordinates",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java#L90-L99 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.listSubtasksAsync | public Observable<CloudTaskListSubtasksResult> listSubtasksAsync(String jobId, String taskId, TaskListSubtasksOptions taskListSubtasksOptions) {
return listSubtasksWithServiceResponseAsync(jobId, taskId, taskListSubtasksOptions).map(new Func1<ServiceResponseWithHeaders<CloudTaskListSubtasksResult, TaskListSubta... | java | public Observable<CloudTaskListSubtasksResult> listSubtasksAsync(String jobId, String taskId, TaskListSubtasksOptions taskListSubtasksOptions) {
return listSubtasksWithServiceResponseAsync(jobId, taskId, taskListSubtasksOptions).map(new Func1<ServiceResponseWithHeaders<CloudTaskListSubtasksResult, TaskListSubta... | [
"public",
"Observable",
"<",
"CloudTaskListSubtasksResult",
">",
"listSubtasksAsync",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"TaskListSubtasksOptions",
"taskListSubtasksOptions",
")",
"{",
"return",
"listSubtasksWithServiceResponseAsync",
"(",
"jobId",
",",
... | Lists all of the subtasks that are associated with the specified multi-instance task.
If the task is not a multi-instance task then this returns an empty collection.
@param jobId The ID of the job.
@param taskId The ID of the task.
@param taskListSubtasksOptions Additional parameters for the operation
@throws IllegalA... | [
"Lists",
"all",
"of",
"the",
"subtasks",
"that",
"are",
"associated",
"with",
"the",
"specified",
"multi",
"-",
"instance",
"task",
".",
"If",
"the",
"task",
"is",
"not",
"a",
"multi",
"-",
"instance",
"task",
"then",
"this",
"returns",
"an",
"empty",
"c... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L1748-L1755 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlot.java | TaskSlot.generateSlotOffer | public SlotOffer generateSlotOffer() {
Preconditions.checkState(TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state,
"The task slot is not in state active or allocated.");
Preconditions.checkState(allocationId != null, "The task slot are not allocated");
return new SlotOffer(allocationId, index,... | java | public SlotOffer generateSlotOffer() {
Preconditions.checkState(TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state,
"The task slot is not in state active or allocated.");
Preconditions.checkState(allocationId != null, "The task slot are not allocated");
return new SlotOffer(allocationId, index,... | [
"public",
"SlotOffer",
"generateSlotOffer",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"TaskSlotState",
".",
"ACTIVE",
"==",
"state",
"||",
"TaskSlotState",
".",
"ALLOCATED",
"==",
"state",
",",
"\"The task slot is not in state active or allocated.\"",
")",... | Generate the slot offer from this TaskSlot.
@return The sot offer which this task slot can provide | [
"Generate",
"the",
"slot",
"offer",
"from",
"this",
"TaskSlot",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlot.java#L295-L301 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/ReflectionUtils.java | ReflectionUtils.declaresException | public static boolean declaresException(Method method, Class<?> exceptionType) {
BeanBoxException.assureNotNull(method, "Method must not be null");
Class<?>[] declaredExceptions = method.getExceptionTypes();
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(exceptio... | java | public static boolean declaresException(Method method, Class<?> exceptionType) {
BeanBoxException.assureNotNull(method, "Method must not be null");
Class<?>[] declaredExceptions = method.getExceptionTypes();
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(exceptio... | [
"public",
"static",
"boolean",
"declaresException",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"exceptionType",
")",
"{",
"BeanBoxException",
".",
"assureNotNull",
"(",
"method",
",",
"\"Method must not be null\"",
")",
";",
"Class",
"<",
"?",
">",
... | Determine whether the given method explicitly declares the given exception or one of its superclasses, which
means that an exception of that type can be propagated as-is within a reflective invocation.
@param method
the declaring method
@param exceptionType
the exception to throw
@return {@code true} if the exception ... | [
"Determine",
"whether",
"the",
"given",
"method",
"explicitly",
"declares",
"the",
"given",
"exception",
"or",
"one",
"of",
"its",
"superclasses",
"which",
"means",
"that",
"an",
"exception",
"of",
"that",
"type",
"can",
"be",
"propagated",
"as",
"-",
"is",
... | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/ReflectionUtils.java#L379-L388 |
SahaginOrg/sahagin-java | src/main/java/org/sahagin/share/yaml/YamlUtils.java | YamlUtils.getBooleanValue | public static Boolean getBooleanValue(Map<String, Object> yamlObject, String key, boolean allowsEmpty)
throws YamlConvertException {
Object obj = getObjectValue(yamlObject, key, allowsEmpty);
if (obj == null) {
if (allowsEmpty) {
return null;
} else {
... | java | public static Boolean getBooleanValue(Map<String, Object> yamlObject, String key, boolean allowsEmpty)
throws YamlConvertException {
Object obj = getObjectValue(yamlObject, key, allowsEmpty);
if (obj == null) {
if (allowsEmpty) {
return null;
} else {
... | [
"public",
"static",
"Boolean",
"getBooleanValue",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"yamlObject",
",",
"String",
"key",
",",
"boolean",
"allowsEmpty",
")",
"throws",
"YamlConvertException",
"{",
"Object",
"obj",
"=",
"getObjectValue",
"(",
"yamlObje... | if allowsEmpty, returns null for the case no key entry or null value | [
"if",
"allowsEmpty",
"returns",
"null",
"for",
"the",
"case",
"no",
"key",
"entry",
"or",
"null",
"value"
] | train | https://github.com/SahaginOrg/sahagin-java/blob/7ace428adebe3466ceb5826bc9681f8e3d52be68/src/main/java/org/sahagin/share/yaml/YamlUtils.java#L50-L66 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/OperatorFactory.java | OperatorFactory.geInstance | @SuppressWarnings("unchecked")
public <T extends Operator> T geInstance(Opcode opcode) {
Operator operator = this.operators.get(opcode);
if (operator == null) {
throw new TemplateException("Operator |%s| is not implemented.", opcode);
}
return (T) operator;
} | java | @SuppressWarnings("unchecked")
public <T extends Operator> T geInstance(Opcode opcode) {
Operator operator = this.operators.get(opcode);
if (operator == null) {
throw new TemplateException("Operator |%s| is not implemented.", opcode);
}
return (T) operator;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"Operator",
">",
"T",
"geInstance",
"(",
"Opcode",
"opcode",
")",
"{",
"Operator",
"operator",
"=",
"this",
".",
"operators",
".",
"get",
"(",
"opcode",
")",
";",
"if",
"(... | Get operator instance for requested opcode.
@param opcode requested operator opcode.
@return operator instance.
@throws TemplateException if operator is not implemented. | [
"Get",
"operator",
"instance",
"for",
"requested",
"opcode",
"."
] | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/OperatorFactory.java#L58-L65 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.generatevpnclientpackage | public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body();
} | java | public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().body();
} | [
"public",
"String",
"generatevpnclientpackage",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VpnClientParameters",
"parameters",
")",
"{",
"return",
"generatevpnclientpackageWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virt... | Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to the generate virtual network gateway VP... | [
"Generates",
"VPN",
"client",
"package",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1465-L1467 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.dateTimeTemplate | public static <T extends Comparable<?>> DateTimeTemplate<T> dateTimeTemplate(Class<? extends T> cl,
String template, Object... args) {
return dateTimeTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
} | java | public static <T extends Comparable<?>> DateTimeTemplate<T> dateTimeTemplate(Class<? extends T> cl,
String template, Object... args) {
return dateTimeTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
">",
">",
"DateTimeTemplate",
"<",
"T",
">",
"dateTimeTemplate",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"cl",
",",
"String",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"ret... | Create a new Template expression
@param cl type of expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L562-L565 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsResourceTable.java | CmsResourceTable.fillTable | public void fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter) {
fillTable(cms, resources, clearFilter, true);
} | java | public void fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter) {
fillTable(cms, resources, clearFilter, true);
} | [
"public",
"void",
"fillTable",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"resources",
",",
"boolean",
"clearFilter",
")",
"{",
"fillTable",
"(",
"cms",
",",
"resources",
",",
"clearFilter",
",",
"true",
")",
";",
"}"
] | Fills the resource table.<p>
@param cms the current CMS context
@param resources the resources which should be displayed in the table
@param clearFilter <code>true</code> to clear the search filter | [
"Fills",
"the",
"resource",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsResourceTable.java#L583-L586 |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java | Murmur2Hash.hash64 | public static long hash64(final String text) {
final byte[] bytes = text.getBytes();
return hash64(bytes, bytes.length);
} | java | public static long hash64(final String text) {
final byte[] bytes = text.getBytes();
return hash64(bytes, bytes.length);
} | [
"public",
"static",
"long",
"hash64",
"(",
"final",
"String",
"text",
")",
"{",
"final",
"byte",
"[",
"]",
"bytes",
"=",
"text",
".",
"getBytes",
"(",
")",
";",
"return",
"hash64",
"(",
"bytes",
",",
"bytes",
".",
"length",
")",
";",
"}"
] | Generates 64 bit hash from a string.
@param text string to hash
@return 64 bit hash of the given string | [
"Generates",
"64",
"bit",
"hash",
"from",
"a",
"string",
"."
] | train | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L184-L187 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java | JobAgentsInner.beginUpdate | public JobAgentInner beginUpdate(String resourceGroupName, String serverName, String jobAgentName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, tags).toBlocking().single().body();
} | java | public JobAgentInner beginUpdate(String resourceGroupName, String serverName, String jobAgentName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, tags).toBlocking().single().body();
} | [
"public",
"JobAgentInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resource... | Updates a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent to be updated.
@param tags Resource tags.
@throws... | [
"Updates",
"a",
"job",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java#L939-L941 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/Statistics.java | Statistics.registerSince | public void registerSince( @Nonnull final StatsType statsType, final long startInMillis ) {
register( statsType, System.currentTimeMillis() - startInMillis );
} | java | public void registerSince( @Nonnull final StatsType statsType, final long startInMillis ) {
register( statsType, System.currentTimeMillis() - startInMillis );
} | [
"public",
"void",
"registerSince",
"(",
"@",
"Nonnull",
"final",
"StatsType",
"statsType",
",",
"final",
"long",
"startInMillis",
")",
"{",
"register",
"(",
"statsType",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"startInMillis",
")",
";",
"}"
] | A utility method that calculates the difference of the time
between the given <code>startInMillis</code> and {@link System#currentTimeMillis()}
and registers the difference via {@link #register(long)} for the probe of the given {@link StatsType}.
@param statsType the specific execution type that is measured.
@param sta... | [
"A",
"utility",
"method",
"that",
"calculates",
"the",
"difference",
"of",
"the",
"time",
"between",
"the",
"given",
"<code",
">",
"startInMillis<",
"/",
"code",
">",
"and",
"{"
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/Statistics.java#L77-L79 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxWPaginationExample.java | AjaxWPaginationExample.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
List<Serializable> items = new ArrayList<>();
items.add(new SimpleTableBean("A", "none", "thing"));
items.add(new SimpleTableBean("B", "some", "thing2"));
items.add(new... | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
List<Serializable> items = new ArrayList<>();
items.add(new SimpleTableBean("A", "none", "thing"));
items.add(new SimpleTableBean("B", "some", "thing2"));
items.add(new... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"List",
"<",
"Serializable",
">... | Override preparePaintComponent in order to set up the example data the first time through.
@param request the request being responded to. | [
"Override",
"preparePaintComponent",
"in",
"order",
"to",
"set",
"up",
"the",
"example",
"data",
"the",
"first",
"time",
"through",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/ajax/AjaxWPaginationExample.java#L50-L73 |
VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/vnode/builder/VNodeBuilder.java | VNodeBuilder.el | public VNode el(String tag, Object... children) {
return this.function.create(tag, children, null);
} | java | public VNode el(String tag, Object... children) {
return this.function.create(tag, children, null);
} | [
"public",
"VNode",
"el",
"(",
"String",
"tag",
",",
"Object",
"...",
"children",
")",
"{",
"return",
"this",
".",
"function",
".",
"create",
"(",
"tag",
",",
"children",
",",
"null",
")",
";",
"}"
] | Create a VNode with the given HTML tag
@param tag HTML tag for the new VNode
@param children Children
@return a new VNode of this tag | [
"Create",
"a",
"VNode",
"with",
"the",
"given",
"HTML",
"tag"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/vnode/builder/VNodeBuilder.java#L36-L38 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java | CommerceSubscriptionEntryPersistenceImpl.findByGroupId | @Override
public List<CommerceSubscriptionEntry> findByGroupId(long groupId,
int start, int end) {
return findByGroupId(groupId, start, end, null);
} | java | @Override
public List<CommerceSubscriptionEntry> findByGroupId(long groupId,
int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceSubscriptionEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",... | Returns a range of all the commerce subscription entries where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"subscription",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L1553-L1557 |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.withCommitProperty | public QueryBuilder withCommitProperty(String name, String value) {
Validate.argumentsAreNotNull(name, value);
queryParamsBuilder.commitProperty(name, value);
return this;
} | java | public QueryBuilder withCommitProperty(String name, String value) {
Validate.argumentsAreNotNull(name, value);
queryParamsBuilder.commitProperty(name, value);
return this;
} | [
"public",
"QueryBuilder",
"withCommitProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"name",
",",
"value",
")",
";",
"queryParamsBuilder",
".",
"commitProperty",
"(",
"name",
",",
"value",
")",
"... | Only snapshots with a given commit property.
<br/><br/
If this method is called multiple times,
<b>all</b> given properties must match with persisted commit properties.
@since 2.0 | [
"Only",
"snapshots",
"with",
"a",
"given",
"commit",
"property",
".",
"<br",
"/",
">",
"<br",
"/"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L383-L387 |
Daytron/SimpleDialogFX | src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java | Dialog.setFontSize | public void setFontSize(int header_font_size, int details_font_size) {
this.headerLabel
.setStyle("-fx-font-size:" + Integer.toString(header_font_size) + "px;");
this.detailsLabel
.setStyle("-fx-font-size:" + Integer.toString(details_font_size) + "px;");
} | java | public void setFontSize(int header_font_size, int details_font_size) {
this.headerLabel
.setStyle("-fx-font-size:" + Integer.toString(header_font_size) + "px;");
this.detailsLabel
.setStyle("-fx-font-size:" + Integer.toString(details_font_size) + "px;");
} | [
"public",
"void",
"setFontSize",
"(",
"int",
"header_font_size",
",",
"int",
"details_font_size",
")",
"{",
"this",
".",
"headerLabel",
".",
"setStyle",
"(",
"\"-fx-font-size:\"",
"+",
"Integer",
".",
"toString",
"(",
"header_font_size",
")",
"+",
"\"px;\"",
")"... | Sets both font sizes in pixels for the header and the details label with
two font sizes <code>integer</code> parameters given.
@param header_font_size The header font size in pixels
@param details_font_size The details font size in pixels | [
"Sets",
"both",
"font",
"sizes",
"in",
"pixels",
"for",
"the",
"header",
"and",
"the",
"details",
"label",
"with",
"two",
"font",
"sizes",
"<code",
">",
"integer<",
"/",
"code",
">",
"parameters",
"given",
"."
] | train | https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L746-L751 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java | CommunicationManager.addTorrent | public TorrentManager addTorrent(String dotTorrentFilePath, String downloadDirPath, List<TorrentListener> listeners) throws IOException {
return addTorrent(dotTorrentFilePath, downloadDirPath, FairPieceStorageFactory.INSTANCE, listeners);
} | java | public TorrentManager addTorrent(String dotTorrentFilePath, String downloadDirPath, List<TorrentListener> listeners) throws IOException {
return addTorrent(dotTorrentFilePath, downloadDirPath, FairPieceStorageFactory.INSTANCE, listeners);
} | [
"public",
"TorrentManager",
"addTorrent",
"(",
"String",
"dotTorrentFilePath",
",",
"String",
"downloadDirPath",
",",
"List",
"<",
"TorrentListener",
">",
"listeners",
")",
"throws",
"IOException",
"{",
"return",
"addTorrent",
"(",
"dotTorrentFilePath",
",",
"download... | Adds torrent to storage with specified listeners, validate downloaded files and start seeding and leeching the torrent
@param dotTorrentFilePath path to torrent metadata file
@param downloadDirPath path to directory where downloaded files are placed
@param listeners specified listeners
@return {@link Torre... | [
"Adds",
"torrent",
"to",
"storage",
"with",
"specified",
"listeners",
"validate",
"downloaded",
"files",
"and",
"start",
"seeding",
"and",
"leeching",
"the",
"torrent"
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L142-L144 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET | public OvhOvhPabxDialplan billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET(String billingAccount, String serviceName, Long dialplanId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, ... | java | public OvhOvhPabxDialplan billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET(String billingAccount, String serviceName, Long dialplanId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, ... | [
"public",
"OvhOvhPabxDialplan",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/ovhP... | Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param dialplanId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7371-L7376 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.safeDecodeAsString | @Nullable
public static String safeDecodeAsString (@Nullable final byte [] aEncodedBytes,
@Nonnegative final int nOfs,
@Nonnegative final int nLength,
@Nonnull final Charset aCharset)
{
... | java | @Nullable
public static String safeDecodeAsString (@Nullable final byte [] aEncodedBytes,
@Nonnegative final int nOfs,
@Nonnegative final int nLength,
@Nonnull final Charset aCharset)
{
... | [
"@",
"Nullable",
"public",
"static",
"String",
"safeDecodeAsString",
"(",
"@",
"Nullable",
"final",
"byte",
"[",
"]",
"aEncodedBytes",
",",
"@",
"Nonnegative",
"final",
"int",
"nOfs",
",",
"@",
"Nonnegative",
"final",
"int",
"nLength",
",",
"@",
"Nonnull",
"... | Decode the byte array and convert it to a string.
@param aEncodedBytes
The encoded byte array.
@param nOfs
Offset into array
@param nLength
Number of bytes to decode.
@param aCharset
The character set to be used.
@return <code>null</code> if decoding failed. | [
"Decode",
"the",
"byte",
"array",
"and",
"convert",
"it",
"to",
"a",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L2711-L2729 |
aws/aws-sdk-java | aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/Job.java | Job.withUserMetadata | public Job withUserMetadata(java.util.Map<String, String> userMetadata) {
setUserMetadata(userMetadata);
return this;
} | java | public Job withUserMetadata(java.util.Map<String, String> userMetadata) {
setUserMetadata(userMetadata);
return this;
} | [
"public",
"Job",
"withUserMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"userMetadata",
")",
"{",
"setUserMetadata",
"(",
"userMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in
<code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder
does not guarantee that <code>key/value</code> pairs are returned in the same order in which you sp... | [
"<p",
">",
"User",
"-",
"defined",
"metadata",
"that",
"you",
"want",
"to",
"associate",
"with",
"an",
"Elastic",
"Transcoder",
"job",
".",
"You",
"specify",
"metadata",
"in",
"<code",
">",
"key",
"/",
"value<",
"/",
"code",
">",
"pairs",
"and",
"you",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/Job.java#L1094-L1097 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_group_POST | public OvhInstanceGroup project_serviceName_instance_group_POST(String serviceName, String name, String region, OvhInstanceGroupTypeEnum type) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/group";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Stri... | java | public OvhInstanceGroup project_serviceName_instance_group_POST(String serviceName, String name, String region, OvhInstanceGroupTypeEnum type) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/group";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Stri... | [
"public",
"OvhInstanceGroup",
"project_serviceName_instance_group_POST",
"(",
"String",
"serviceName",
",",
"String",
"name",
",",
"String",
"region",
",",
"OvhInstanceGroupTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{se... | Create a group
REST: POST /cloud/project/{serviceName}/instance/group
@param name [required] instance group name
@param region [required] Instance region
@param serviceName [required] Project name
@param type [required] Instance group type | [
"Create",
"a",
"group"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2134-L2143 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tdStyleHtmlContent | public static String tdStyleHtmlContent(String style, String... content) {
return tagStyleHtmlContent(Html.Tag.TD, style, content);
} | java | public static String tdStyleHtmlContent(String style, String... content) {
return tagStyleHtmlContent(Html.Tag.TD, style, content);
} | [
"public",
"static",
"String",
"tdStyleHtmlContent",
"(",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagStyleHtmlContent",
"(",
"Html",
".",
"Tag",
".",
"TD",
",",
"style",
",",
"content",
")",
";",
"}"
] | Build a HTML TableData with given CSS style attributes for a string.
Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for td element
@param content content string
@return HTML td element as string | [
"Build",
"a",
"HTML",
"TableData",
"with",
"given",
"CSS",
"style",
"attributes",
"for",
"a",
"string",
".",
"Use",
"this",
"method",
"if",
"given",
"content",
"contains",
"HTML",
"snippets",
"prepared",
"with",
"{",
"@link",
"HtmlBuilder#htmlEncode",
"(",
"St... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L177-L179 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/PBConstraint.java | PBConstraint.evaluateCoeffs | static Tristate evaluateCoeffs(final int minValue, final int maxValue, final int rhs, final CType comparator) {
int status = 0;
if (rhs >= minValue)
status++;
if (rhs > minValue)
status++;
if (rhs >= maxValue)
status++;
if (rhs > maxValue)
status++;
switch (comparator) {... | java | static Tristate evaluateCoeffs(final int minValue, final int maxValue, final int rhs, final CType comparator) {
int status = 0;
if (rhs >= minValue)
status++;
if (rhs > minValue)
status++;
if (rhs >= maxValue)
status++;
if (rhs > maxValue)
status++;
switch (comparator) {... | [
"static",
"Tristate",
"evaluateCoeffs",
"(",
"final",
"int",
"minValue",
",",
"final",
"int",
"maxValue",
",",
"final",
"int",
"rhs",
",",
"final",
"CType",
"comparator",
")",
"{",
"int",
"status",
"=",
"0",
";",
"if",
"(",
"rhs",
">=",
"minValue",
")",
... | Internal helper for checking if a given coefficient-sum min- and max-value can comply with a given right-hand-side
according to this PBConstraint's comparator.
@param minValue the minimum coefficient sum
@param maxValue the maximum coefficient sum
@param rhs the right-hand-side
@param comparator the comparat... | [
"Internal",
"helper",
"for",
"checking",
"if",
"a",
"given",
"coefficient",
"-",
"sum",
"min",
"-",
"and",
"max",
"-",
"value",
"can",
"comply",
"with",
"a",
"given",
"right",
"-",
"hand",
"-",
"side",
"according",
"to",
"this",
"PBConstraint",
"s",
"com... | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/PBConstraint.java#L170-L195 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.setInt | public void setInt(int index, int value)
{
checkIndexLength(index, SizeOf.SIZE_OF_INT);
unsafe.putInt(base, address + index, value);
} | java | public void setInt(int index, int value)
{
checkIndexLength(index, SizeOf.SIZE_OF_INT);
unsafe.putInt(base, address + index, value);
} | [
"public",
"void",
"setInt",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"checkIndexLength",
"(",
"index",
",",
"SizeOf",
".",
"SIZE_OF_INT",
")",
";",
"unsafe",
".",
"putInt",
"(",
"base",
",",
"address",
"+",
"index",
",",
"value",
")",
";",
... | Sets the specified 32-bit integer at the specified absolute
{@code index} in this buffer.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 4} is greater than {@code this.length()} | [
"Sets",
"the",
"specified",
"32",
"-",
"bit",
"integer",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"in",
"this",
"buffer",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L433-L437 |
reactor/reactor-netty | src/main/java/reactor/netty/udp/UdpClient.java | UdpClient.runOn | public final UdpClient runOn(LoopResources channelResources, InternetProtocolFamily family) {
return new UdpClientRunOn(this, channelResources, false, family);
} | java | public final UdpClient runOn(LoopResources channelResources, InternetProtocolFamily family) {
return new UdpClientRunOn(this, channelResources, false, family);
} | [
"public",
"final",
"UdpClient",
"runOn",
"(",
"LoopResources",
"channelResources",
",",
"InternetProtocolFamily",
"family",
")",
"{",
"return",
"new",
"UdpClientRunOn",
"(",
"this",
",",
"channelResources",
",",
"false",
",",
"family",
")",
";",
"}"
] | Run IO loops on a supplied {@link EventLoopGroup} from the {@link LoopResources}
container.
@param channelResources a {@link LoopResources} accepting native runtime
expectation and returning an eventLoopGroup.
@param family a specific {@link InternetProtocolFamily} to run with
@return a new {@link UdpClient} | [
"Run",
"IO",
"loops",
"on",
"a",
"supplied",
"{",
"@link",
"EventLoopGroup",
"}",
"from",
"the",
"{",
"@link",
"LoopResources",
"}",
"container",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/udp/UdpClient.java#L353-L355 |
h2oai/h2o-3 | h2o-core/src/main/java/water/jdbc/SQLManager.java | SQLManager.buildSelectSingleRowSql | static String buildSelectSingleRowSql(String databaseType, String table, String columns) {
switch(databaseType) {
case SQL_SERVER_DB_TYPE: //syntax supported since SQLServer 2008
return "SELECT TOP(1) " + columns + " FROM " + table;
case ORACLE_DB_TYPE:
return "SELECT " + columns + " F... | java | static String buildSelectSingleRowSql(String databaseType, String table, String columns) {
switch(databaseType) {
case SQL_SERVER_DB_TYPE: //syntax supported since SQLServer 2008
return "SELECT TOP(1) " + columns + " FROM " + table;
case ORACLE_DB_TYPE:
return "SELECT " + columns + " F... | [
"static",
"String",
"buildSelectSingleRowSql",
"(",
"String",
"databaseType",
",",
"String",
"table",
",",
"String",
"columns",
")",
"{",
"switch",
"(",
"databaseType",
")",
"{",
"case",
"SQL_SERVER_DB_TYPE",
":",
"//syntax supported since SQLServer 2008",
"return",
"... | Builds SQL SELECT to retrieve single row from a table based on type of database
@param databaseType
@param table
@param columns
@return String SQL SELECT statement | [
"Builds",
"SQL",
"SELECT",
"to",
"retrieve",
"single",
"row",
"from",
"a",
"table",
"based",
"on",
"type",
"of",
"database"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/jdbc/SQLManager.java#L308-L323 |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java | MediaModuleGenerator.generateResponses | private void generateResponses(final Metadata m, final Element e) {
if (m.getResponses() == null || m.getResponses().length == 0) {
return;
}
final Element responsesElements = new Element("responses", NS);
for (final String response : m.getResponses()) {
addNotNul... | java | private void generateResponses(final Metadata m, final Element e) {
if (m.getResponses() == null || m.getResponses().length == 0) {
return;
}
final Element responsesElements = new Element("responses", NS);
for (final String response : m.getResponses()) {
addNotNul... | [
"private",
"void",
"generateResponses",
"(",
"final",
"Metadata",
"m",
",",
"final",
"Element",
"e",
")",
"{",
"if",
"(",
"m",
".",
"getResponses",
"(",
")",
"==",
"null",
"||",
"m",
".",
"getResponses",
"(",
")",
".",
"length",
"==",
"0",
")",
"{",
... | Generation of responses tag.
@param m source
@param e element to attach new element to | [
"Generation",
"of",
"responses",
"tag",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java#L493-L502 |
TheHortonMachine/hortonmachine | extras/sideprojects/gpextras/src/main/java/org/hortonmachine/gpextras/tiles/MapsforgeTilesGenerator.java | MapsforgeTilesGenerator.getTile4LatLon | public <T> T getTile4LatLon( double lon, double lat, int zoom, Class<T> adaptee ) throws IOException {
final int ty = MercatorProjection.latitudeToTileY(lat, (byte) zoom);
final int tx = MercatorProjection.longitudeToTileX(lon, (byte) zoom);
return getTile4TileCoordinate(ty, tx, zoom, adaptee);
... | java | public <T> T getTile4LatLon( double lon, double lat, int zoom, Class<T> adaptee ) throws IOException {
final int ty = MercatorProjection.latitudeToTileY(lat, (byte) zoom);
final int tx = MercatorProjection.longitudeToTileX(lon, (byte) zoom);
return getTile4TileCoordinate(ty, tx, zoom, adaptee);
... | [
"public",
"<",
"T",
">",
"T",
"getTile4LatLon",
"(",
"double",
"lon",
",",
"double",
"lat",
",",
"int",
"zoom",
",",
"Class",
"<",
"T",
">",
"adaptee",
")",
"throws",
"IOException",
"{",
"final",
"int",
"ty",
"=",
"MercatorProjection",
".",
"latitudeToTi... | Get tile data for a given lat/lon/zoomlevel.
@param lon the WGS84 longitude.
@param lat the WGS84 latitude.
@param zoom the zoomlevel
@param adaptee the class to adapt to.
@return the generated data.
@throws IOException | [
"Get",
"tile",
"data",
"for",
"a",
"given",
"lat",
"/",
"lon",
"/",
"zoomlevel",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/extras/sideprojects/gpextras/src/main/java/org/hortonmachine/gpextras/tiles/MapsforgeTilesGenerator.java#L153-L157 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.assignTimestampsAndWatermarks | public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks(
AssignerWithPeriodicWatermarks<T> timestampAndWatermarkAssigner) {
// match parallelism to input, otherwise dop=1 sources could lead to some strange
// behaviour: the watermark will creep along very slowly because the elements
// from the sou... | java | public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks(
AssignerWithPeriodicWatermarks<T> timestampAndWatermarkAssigner) {
// match parallelism to input, otherwise dop=1 sources could lead to some strange
// behaviour: the watermark will creep along very slowly because the elements
// from the sou... | [
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"assignTimestampsAndWatermarks",
"(",
"AssignerWithPeriodicWatermarks",
"<",
"T",
">",
"timestampAndWatermarkAssigner",
")",
"{",
"// match parallelism to input, otherwise dop=1 sources could lead to some strange",
"// behaviour: t... | Assigns timestamps to the elements in the data stream and periodically creates
watermarks to signal event time progress.
<p>This method creates watermarks periodically (for example every second), based
on the watermarks indicated by the given watermark generator. Even when no new elements
in the stream arrive, the giv... | [
"Assigns",
"timestamps",
"to",
"the",
"elements",
"in",
"the",
"data",
"stream",
"and",
"periodically",
"creates",
"watermarks",
"to",
"signal",
"event",
"time",
"progress",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L883-L897 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/bingspellcheck/src/main/java/com/microsoft/azure/cognitiveservices/language/spellcheck/implementation/BingSpellCheckOperationsImpl.java | BingSpellCheckOperationsImpl.spellChecker | public SpellCheck spellChecker(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) {
return spellCheckerWithServiceResponseAsync(text, spellCheckerOptionalParameter).toBlocking().single().body();
} | java | public SpellCheck spellChecker(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) {
return spellCheckerWithServiceResponseAsync(text, spellCheckerOptionalParameter).toBlocking().single().body();
} | [
"public",
"SpellCheck",
"spellChecker",
"(",
"String",
"text",
",",
"SpellCheckerOptionalParameter",
"spellCheckerOptionalParameter",
")",
"{",
"return",
"spellCheckerWithServiceResponseAsync",
"(",
"text",
",",
"spellCheckerOptionalParameter",
")",
".",
"toBlocking",
"(",
... | The Bing Spell Check API lets you perform contextual grammar and spell checking. Bing has developed a web-based spell-checker that leverages machine learning and statistical machine translation to dynamically train a constantly evolving and highly contextual algorithm. The spell-checker is based on a massive corpus of ... | [
"The",
"Bing",
"Spell",
"Check",
"API",
"lets",
"you",
"perform",
"contextual",
"grammar",
"and",
"spell",
"checking",
".",
"Bing",
"has",
"developed",
"a",
"web",
"-",
"based",
"spell",
"-",
"checker",
"that",
"leverages",
"machine",
"learning",
"and",
"sta... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/bingspellcheck/src/main/java/com/microsoft/azure/cognitiveservices/language/spellcheck/implementation/BingSpellCheckOperationsImpl.java#L75-L77 |
FINRAOS/DataGenerator | dg-example-hadoop/src/main/java/org/finra/datagenerator/samples/consumer/ContextWriter.java | ContextWriter.writeOutput | public void writeOutput(DataPipe cr) {
try {
context.write(NullWritable.get(), new Text(cr.getPipeDelimited(outTemplate)));
} catch (Exception e) {
throw new RuntimeException("Exception occurred while writing to Context", e);
}
} | java | public void writeOutput(DataPipe cr) {
try {
context.write(NullWritable.get(), new Text(cr.getPipeDelimited(outTemplate)));
} catch (Exception e) {
throw new RuntimeException("Exception occurred while writing to Context", e);
}
} | [
"public",
"void",
"writeOutput",
"(",
"DataPipe",
"cr",
")",
"{",
"try",
"{",
"context",
".",
"write",
"(",
"NullWritable",
".",
"get",
"(",
")",
",",
"new",
"Text",
"(",
"cr",
".",
"getPipeDelimited",
"(",
"outTemplate",
")",
")",
")",
";",
"}",
"ca... | Write to a context. Uses NullWritable for key so that only value of output string is ultimately written
@param cr the DataPipe to write to | [
"Write",
"to",
"a",
"context",
".",
"Uses",
"NullWritable",
"for",
"key",
"so",
"that",
"only",
"value",
"of",
"output",
"string",
"is",
"ultimately",
"written"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-example-hadoop/src/main/java/org/finra/datagenerator/samples/consumer/ContextWriter.java#L49-L55 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.viewRecording | public RecordingResponse viewRecording(String callID, String legId, String recordingId) throws NotFoundException, GeneralException, UnauthorizedException {
if (callID == null) {
throw new IllegalArgumentException("Voice call ID must be specified.");
}
if (legId == null) {
... | java | public RecordingResponse viewRecording(String callID, String legId, String recordingId) throws NotFoundException, GeneralException, UnauthorizedException {
if (callID == null) {
throw new IllegalArgumentException("Voice call ID must be specified.");
}
if (legId == null) {
... | [
"public",
"RecordingResponse",
"viewRecording",
"(",
"String",
"callID",
",",
"String",
"legId",
",",
"String",
"recordingId",
")",
"throws",
"NotFoundException",
",",
"GeneralException",
",",
"UnauthorizedException",
"{",
"if",
"(",
"callID",
"==",
"null",
")",
"... | Function to view recording by call id , leg id and recording id
@param callID Voice call ID
@param legId Leg ID
@param recordingId Recording ID
@return Recording
@throws NotFoundException not found with callId and legId
@throws UnauthorizedException if client is unauthorized
@throws GeneralException ... | [
"Function",
"to",
"view",
"recording",
"by",
"call",
"id",
"leg",
"id",
"and",
"recording",
"id"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L1051-L1071 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java | SegmentKeyCache.setLastIndexedOffset | void setLastIndexedOffset(long currentLastIndexedOffset, int cacheGeneration) {
val candidates = new ArrayList<MigrationCandidate>();
synchronized (this) {
// Update stored last indexed offset.
Preconditions.checkArgument(currentLastIndexedOffset >= this.lastIndexedOffset,
... | java | void setLastIndexedOffset(long currentLastIndexedOffset, int cacheGeneration) {
val candidates = new ArrayList<MigrationCandidate>();
synchronized (this) {
// Update stored last indexed offset.
Preconditions.checkArgument(currentLastIndexedOffset >= this.lastIndexedOffset,
... | [
"void",
"setLastIndexedOffset",
"(",
"long",
"currentLastIndexedOffset",
",",
"int",
"cacheGeneration",
")",
"{",
"val",
"candidates",
"=",
"new",
"ArrayList",
"<",
"MigrationCandidate",
">",
"(",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"// Update stored ... | Updates the Last Indexed Offset (cached value of the Segment's {@link TableAttributes#INDEX_OFFSET} attribute).
Clears out any backpointers whose source offsets will be smaller than the new value for Last Indexed Offset. | [
"Updates",
"the",
"Last",
"Indexed",
"Offset",
"(",
"cached",
"value",
"of",
"the",
"Segment",
"s",
"{"
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java#L238-L266 |
haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java | ExTagSupport.getInitParameter | public String getInitParameter(String pName, int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameter(pName);
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameter(pName);
... | java | public String getInitParameter(String pName, int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameter(pName);
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameter(pName);
... | [
"public",
"String",
"getInitParameter",
"(",
"String",
"pName",
",",
"int",
"pScope",
")",
"{",
"switch",
"(",
"pScope",
")",
"{",
"case",
"PageContext",
".",
"PAGE_SCOPE",
":",
"return",
"getServletConfig",
"(",
")",
".",
"getInitParameter",
"(",
"pName",
"... | Returns the initialisation parameter from the scope specified with the
name specified.
@param pName The name of the initialisation parameter to return the
value for.
@param pScope The scope to search for the initialisation parameter
within.
@return The value of the parameter found. If no parameter with the
name speci... | [
"Returns",
"the",
"initialisation",
"parameter",
"from",
"the",
"scope",
"specified",
"with",
"the",
"name",
"specified",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#L211-L220 |
uoa-group-applications/morc | src/main/java/nz/ac/auckland/morc/MorcBuilder.java | MorcBuilder.addPredicates | public Builder addPredicates(int index, Predicate... predicates) {
while (index >= this.predicates.size()) {
this.predicates.add(new ArrayList<>());
}
this.predicates.get(index).addAll(new ArrayList<>(Arrays.asList(predicates)));
return self();
} | java | public Builder addPredicates(int index, Predicate... predicates) {
while (index >= this.predicates.size()) {
this.predicates.add(new ArrayList<>());
}
this.predicates.get(index).addAll(new ArrayList<>(Arrays.asList(predicates)));
return self();
} | [
"public",
"Builder",
"addPredicates",
"(",
"int",
"index",
",",
"Predicate",
"...",
"predicates",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"predicates",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"predicates",
".",
"add",
"(",
"new",
"Arr... | Add a set of predicates to validate an exchange at a particular offset (n'th message)
@param index The exchange offset that these predicates should be validated against
@param predicates The set of predicates that will do the validation of the exchange | [
"Add",
"a",
"set",
"of",
"predicates",
"to",
"validate",
"an",
"exchange",
"at",
"a",
"particular",
"offset",
"(",
"n",
"th",
"message",
")"
] | train | https://github.com/uoa-group-applications/morc/blob/3add6308b1fbfc98187364ac73007c83012ea8ba/src/main/java/nz/ac/auckland/morc/MorcBuilder.java#L118-L124 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/ApiStage.java | ApiStage.withThrottle | public ApiStage withThrottle(java.util.Map<String, ThrottleSettings> throttle) {
setThrottle(throttle);
return this;
} | java | public ApiStage withThrottle(java.util.Map<String, ThrottleSettings> throttle) {
setThrottle(throttle);
return this;
} | [
"public",
"ApiStage",
"withThrottle",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"ThrottleSettings",
">",
"throttle",
")",
"{",
"setThrottle",
"(",
"throttle",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Map containing method level throttling information for API stage in a usage plan.
</p>
@param throttle
Map containing method level throttling information for API stage in a usage plan.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Map",
"containing",
"method",
"level",
"throttling",
"information",
"for",
"API",
"stage",
"in",
"a",
"usage",
"plan",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/ApiStage.java#L162-L165 |
pravega/pravega | client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java | FlowHandler.createConnectionWithFlowDisabled | public ClientConnection createConnectionWithFlowDisabled(final ReplyProcessor rp) {
Exceptions.checkNotClosed(closed.get(), this);
Preconditions.checkState(!disableFlow.getAndSet(true), "Flows are disabled, incorrect usage pattern.");
log.info("Creating a new connection with flow disabled for en... | java | public ClientConnection createConnectionWithFlowDisabled(final ReplyProcessor rp) {
Exceptions.checkNotClosed(closed.get(), this);
Preconditions.checkState(!disableFlow.getAndSet(true), "Flows are disabled, incorrect usage pattern.");
log.info("Creating a new connection with flow disabled for en... | [
"public",
"ClientConnection",
"createConnectionWithFlowDisabled",
"(",
"final",
"ReplyProcessor",
"rp",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"closed",
".",
"get",
"(",
")",
",",
"this",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"disa... | Create a {@link ClientConnection} where flows are disabled. This implies that there is only one flow on the underlying
network connection.
@param rp The ReplyProcessor.
@return Client Connection object. | [
"Create",
"a",
"{"
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java#L80-L86 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJChronology.java | GJChronology.getInstance | public static GJChronology getInstance(
DateTimeZone zone,
ReadableInstant gregorianCutover,
int minDaysInFirstWeek) {
zone = DateTimeUtils.getZone(zone);
Instant cutoverInstant;
if (gregorianCutover == null) {
cutoverInstant = DEFAULT_CUT... | java | public static GJChronology getInstance(
DateTimeZone zone,
ReadableInstant gregorianCutover,
int minDaysInFirstWeek) {
zone = DateTimeUtils.getZone(zone);
Instant cutoverInstant;
if (gregorianCutover == null) {
cutoverInstant = DEFAULT_CUT... | [
"public",
"static",
"GJChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
",",
"ReadableInstant",
"gregorianCutover",
",",
"int",
"minDaysInFirstWeek",
")",
"{",
"zone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"zone",
")",
";",
"Instant",
"cutoverInstant",
... | Factory method returns instances of the GJ cutover chronology. Any
cutover date may be specified.
@param zone the time zone to use, null is default
@param gregorianCutover the cutover to use, null means default
@param minDaysInFirstWeek minimum number of days in first week of the year; default is 4 | [
"Factory",
"method",
"returns",
"instances",
"of",
"the",
"GJ",
"cutover",
"chronology",
".",
"Any",
"cutover",
"date",
"may",
"be",
"specified",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJChronology.java#L183-L222 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/NotFound.java | NotFound.of | public static NotFound of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(NOT_FOUND));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | java | public static NotFound of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(NOT_FOUND));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"NotFound",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"NOT_FOUND",
")",
")",
";",
"}",
"else",
"{",
"touchPayload",
"(",
... | Returns a static NotFound instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static NotFound instance as described above | [
"Returns",
"a",
"static",
"NotFound",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/NotFound.java#L132-L139 |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.move | public void move(Robot robot) {
if (!robotsPosition.containsKey(robot)) {
throw new IllegalArgumentException("Robot doesn't exist");
}
if (!robot.getData().isMobile()) {
throw new IllegalArgumentException("Robot can't move");
}
Point newPosition = getReferenceField(robot, 1);
if (!isOccupied(newPositio... | java | public void move(Robot robot) {
if (!robotsPosition.containsKey(robot)) {
throw new IllegalArgumentException("Robot doesn't exist");
}
if (!robot.getData().isMobile()) {
throw new IllegalArgumentException("Robot can't move");
}
Point newPosition = getReferenceField(robot, 1);
if (!isOccupied(newPositio... | [
"public",
"void",
"move",
"(",
"Robot",
"robot",
")",
"{",
"if",
"(",
"!",
"robotsPosition",
".",
"containsKey",
"(",
"robot",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Robot doesn't exist\"",
")",
";",
"}",
"if",
"(",
"!",
"robot"... | Changes the position of a robot to its current reference field
@param robot the robot | [
"Changes",
"the",
"position",
"of",
"a",
"robot",
"to",
"its",
"current",
"reference",
"field"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L188-L203 |
guppy4j/libraries | static/src/main/java/org/guppy4j/Objects.java | Objects.castIfSameClass | public static <T> T castIfSameClass(Object o, Class<T> c) {
return o != null && o.getClass() == c ? c.cast(o) : null;
} | java | public static <T> T castIfSameClass(Object o, Class<T> c) {
return o != null && o.getClass() == c ? c.cast(o) : null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"castIfSameClass",
"(",
"Object",
"o",
",",
"Class",
"<",
"T",
">",
"c",
")",
"{",
"return",
"o",
"!=",
"null",
"&&",
"o",
".",
"getClass",
"(",
")",
"==",
"c",
"?",
"c",
".",
"cast",
"(",
"o",
")",
":"... | Conditional casting, useful for typical equals() implementations
@param o The other object
@param c The class to check for
@param <T> The generic type of the target class
@return The object cast as a T, or null if o.getClass() is not c | [
"Conditional",
"casting",
"useful",
"for",
"typical",
"equals",
"()",
"implementations"
] | train | https://github.com/guppy4j/libraries/blob/5d7a0a7b3fe1ad5c907a5c232b8187727f51f474/static/src/main/java/org/guppy4j/Objects.java#L20-L22 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java | MimeMessageHelper.setReplyTo | static void setReplyTo(final Email email, final Message message)
throws UnsupportedEncodingException, MessagingException {
final Recipient replyToRecipient = email.getReplyToRecipient();
if (replyToRecipient != null) {
final InternetAddress replyToAddress = new InternetAddress(replyToRecipient.getAddress(), r... | java | static void setReplyTo(final Email email, final Message message)
throws UnsupportedEncodingException, MessagingException {
final Recipient replyToRecipient = email.getReplyToRecipient();
if (replyToRecipient != null) {
final InternetAddress replyToAddress = new InternetAddress(replyToRecipient.getAddress(), r... | [
"static",
"void",
"setReplyTo",
"(",
"final",
"Email",
"email",
",",
"final",
"Message",
"message",
")",
"throws",
"UnsupportedEncodingException",
",",
"MessagingException",
"{",
"final",
"Recipient",
"replyToRecipient",
"=",
"email",
".",
"getReplyToRecipient",
"(",
... | Fills the {@link Message} instance with reply-to address.
@param email The message in which the recipients are defined.
@param message The javax message that needs to be filled with reply-to address.
@throws UnsupportedEncodingException See {@link InternetAddress#InternetAddress(String, String)}.
@throws MessagingEx... | [
"Fills",
"the",
"{",
"@link",
"Message",
"}",
"instance",
"with",
"reply",
"-",
"to",
"address",
"."
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java#L79-L87 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateReturn | private Context translateReturn(WyilFile.Stmt.Return stmt, Context context) {
//
Tuple<WyilFile.Expr> returns = stmt.getReturns();
//
if (returns.size() > 0) {
// There is at least one return value. Therefore, we need to check
// any preconditions for those return expressions and, potentially,
// ensur... | java | private Context translateReturn(WyilFile.Stmt.Return stmt, Context context) {
//
Tuple<WyilFile.Expr> returns = stmt.getReturns();
//
if (returns.size() > 0) {
// There is at least one return value. Therefore, we need to check
// any preconditions for those return expressions and, potentially,
// ensur... | [
"private",
"Context",
"translateReturn",
"(",
"WyilFile",
".",
"Stmt",
".",
"Return",
"stmt",
",",
"Context",
"context",
")",
"{",
"//",
"Tuple",
"<",
"WyilFile",
".",
"Expr",
">",
"returns",
"=",
"stmt",
".",
"getReturns",
"(",
")",
";",
"//",
"if",
"... | Translate a return statement. If a return value is given, then this must
ensure that the post-condition of the enclosing function or method is met
@param stmt
@param wyalFile | [
"Translate",
"a",
"return",
"statement",
".",
"If",
"a",
"return",
"value",
"is",
"given",
"then",
"this",
"must",
"ensure",
"that",
"the",
"post",
"-",
"condition",
"of",
"the",
"enclosing",
"function",
"or",
"method",
"is",
"met"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L880-L899 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/EncodingSupport.java | EncodingSupport.encodeBase64 | public static String encodeBase64(byte[] rawData, int lineLength) {
if (rawData == null) {
return "";
}
StringBuffer retval = new StringBuffer();
int i = 0;
int n = 0;
for (; i < rawData.length - 2; i += 3) {
if (lineLength > 0 && i > 0 && i % lineLength == 0) {
retval.append("\n");
}
//n is... | java | public static String encodeBase64(byte[] rawData, int lineLength) {
if (rawData == null) {
return "";
}
StringBuffer retval = new StringBuffer();
int i = 0;
int n = 0;
for (; i < rawData.length - 2; i += 3) {
if (lineLength > 0 && i > 0 && i % lineLength == 0) {
retval.append("\n");
}
//n is... | [
"public",
"static",
"String",
"encodeBase64",
"(",
"byte",
"[",
"]",
"rawData",
",",
"int",
"lineLength",
")",
"{",
"if",
"(",
"rawData",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuffer",
"retval",
"=",
"new",
"StringBuffer",
"(",
")",
... | Converts a chunk of data into base 64 encoding.
@param rawData
@param lineLength optional length of lines in return value
@return | [
"Converts",
"a",
"chunk",
"of",
"data",
"into",
"base",
"64",
"encoding",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/EncodingSupport.java#L51-L91 |
google/closure-compiler | src/com/google/javascript/jscomp/ReplaceStrings.java | ReplaceStrings.replaceExpression | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | java | private Node replaceExpression(NodeTraversal t, Node expr, Node parent) {
Node replacement;
String key = null;
String replacementString;
switch (expr.getToken()) {
case STRING:
key = expr.getString();
replacementString = getReplacement(key);
replacement = IR.string(replacem... | [
"private",
"Node",
"replaceExpression",
"(",
"NodeTraversal",
"t",
",",
"Node",
"expr",
",",
"Node",
"parent",
")",
"{",
"Node",
"replacement",
";",
"String",
"key",
"=",
"null",
";",
"String",
"replacementString",
";",
"switch",
"(",
"expr",
".",
"getToken"... | Replaces a string expression with a short encoded string expression.
@param t The traversal
@param expr The expression node
@param parent The expression node's parent
@return The replacement node (or the original expression if no replacement is made) | [
"Replaces",
"a",
"string",
"expression",
"with",
"a",
"short",
"encoded",
"string",
"expression",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceStrings.java#L316-L355 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java | RepositoryResolutionException.getMinimumVersionForMissingProduct | public String getMinimumVersionForMissingProduct(String productId, String version, String edition) {
Collection<LibertyVersionRange> filteredRanges = filterVersionRanges(productId, edition);
Collection<LibertyVersion> minimumVersions = new HashSet<LibertyVersion>();
for (LibertyVersionRange rang... | java | public String getMinimumVersionForMissingProduct(String productId, String version, String edition) {
Collection<LibertyVersionRange> filteredRanges = filterVersionRanges(productId, edition);
Collection<LibertyVersion> minimumVersions = new HashSet<LibertyVersion>();
for (LibertyVersionRange rang... | [
"public",
"String",
"getMinimumVersionForMissingProduct",
"(",
"String",
"productId",
",",
"String",
"version",
",",
"String",
"edition",
")",
"{",
"Collection",
"<",
"LibertyVersionRange",
">",
"filteredRanges",
"=",
"filterVersionRanges",
"(",
"productId",
",",
"edi... | This will iterate through the products that couldn't be found as supplied by {@link #getMissingProducts()} and look for the minimum version that was searched for. It will
limit it to products that match the supplied <code>productId</code>, major, minor and micro <code>version</code>, and <code>edition</code>. Note that... | [
"This",
"will",
"iterate",
"through",
"the",
"products",
"that",
"couldn",
"t",
"be",
"found",
"as",
"supplied",
"by",
"{",
"@link",
"#getMissingProducts",
"()",
"}",
"and",
"look",
"for",
"the",
"minimum",
"version",
"that",
"was",
"searched",
"for",
".",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java#L102-L116 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java | SOD.subspaceOutlierDegree | private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) {
final int card = BitsUtil.cardinality(weightVector);
if(card == 0) {
return 0;
}
final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(weightVector);
return df.distance(quer... | java | private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) {
final int card = BitsUtil.cardinality(weightVector);
if(card == 0) {
return 0;
}
final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(weightVector);
return df.distance(quer... | [
"private",
"double",
"subspaceOutlierDegree",
"(",
"V",
"queryObject",
",",
"double",
"[",
"]",
"center",
",",
"long",
"[",
"]",
"weightVector",
")",
"{",
"final",
"int",
"card",
"=",
"BitsUtil",
".",
"cardinality",
"(",
"weightVector",
")",
";",
"if",
"("... | Compute SOD score.
@param queryObject Query object
@param center Center vector
@param weightVector Weight vector
@return sod score | [
"Compute",
"SOD",
"score",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java#L251-L258 |
qzagarese/hyaline-dto | hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java | Hyaline.dtoFromScratch | public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException {
return dtoFromScratch(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis());
} | java | public static <T> T dtoFromScratch(T entity, DTO dtoTemplate) throws HyalineException {
return dtoFromScratch(entity, dtoTemplate, "Hyaline$Proxy$" + System.currentTimeMillis());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"dtoFromScratch",
"(",
"T",
"entity",
",",
"DTO",
"dtoTemplate",
")",
"throws",
"HyalineException",
"{",
"return",
"dtoFromScratch",
"(",
"entity",
",",
"dtoTemplate",
",",
"\"Hyaline$Proxy$\"",
"+",
"System",
".",
"curr... | It lets you create a new DTO from scratch. This means that any annotation
from JAXB, Jackson or whatever serialization framework you are using on
your entity T will be ignored. The only annotation-based configuration
that will be used is the one you are defining in this invocation.
@param <T>
the generic type
@param e... | [
"It",
"lets",
"you",
"create",
"a",
"new",
"DTO",
"from",
"scratch",
".",
"This",
"means",
"that",
"any",
"annotation",
"from",
"JAXB",
"Jackson",
"or",
"whatever",
"serialization",
"framework",
"you",
"are",
"using",
"on",
"your",
"entity",
"T",
"will",
"... | train | https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L77-L79 |
duracloud/duracloud | synctool/src/main/java/org/duracloud/sync/mgmt/SyncManager.java | SyncManager.handleChangedFile | public synchronized boolean handleChangedFile(ChangedFile changedFile) {
File watchDir = getWatchDir(changedFile.getFile());
SyncWorker worker = new SyncWorker(changedFile, watchDir, endpoint);
try {
addToWorkerList(worker);
workerPool.execute(worker);
return... | java | public synchronized boolean handleChangedFile(ChangedFile changedFile) {
File watchDir = getWatchDir(changedFile.getFile());
SyncWorker worker = new SyncWorker(changedFile, watchDir, endpoint);
try {
addToWorkerList(worker);
workerPool.execute(worker);
return... | [
"public",
"synchronized",
"boolean",
"handleChangedFile",
"(",
"ChangedFile",
"changedFile",
")",
"{",
"File",
"watchDir",
"=",
"getWatchDir",
"(",
"changedFile",
".",
"getFile",
"(",
")",
")",
";",
"SyncWorker",
"worker",
"=",
"new",
"SyncWorker",
"(",
"changed... | Notifies the SyncManager that a file has changed
@param changedFile the changed file
@returns true if file accepted for processing, false otherwise | [
"Notifies",
"the",
"SyncManager",
"that",
"a",
"file",
"has",
"changed"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/synctool/src/main/java/org/duracloud/sync/mgmt/SyncManager.java#L106-L118 |
stephenc/java-iso-tools | loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/util/LittleEndian.java | LittleEndian.getUInt32 | public static long getUInt32(byte[] src, int offset) {
final long v0 = src[offset] & 0xFF;
final long v1 = src[offset + 1] & 0xFF;
final long v2 = src[offset + 2] & 0xFF;
final long v3 = src[offset + 3] & 0xFF;
return ((v3 << 24) | (v2 << 16) | (v1 << 8) | v0);
} | java | public static long getUInt32(byte[] src, int offset) {
final long v0 = src[offset] & 0xFF;
final long v1 = src[offset + 1] & 0xFF;
final long v2 = src[offset + 2] & 0xFF;
final long v3 = src[offset + 3] & 0xFF;
return ((v3 << 24) | (v2 << 16) | (v1 << 8) | v0);
} | [
"public",
"static",
"long",
"getUInt32",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"offset",
")",
"{",
"final",
"long",
"v0",
"=",
"src",
"[",
"offset",
"]",
"&",
"0xFF",
";",
"final",
"long",
"v1",
"=",
"src",
"[",
"offset",
"+",
"1",
"]",
"&",
... | Gets a 32-bit unsigned integer from the given byte array at the given offset. | [
"Gets",
"a",
"32",
"-",
"bit",
"unsigned",
"integer",
"from",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/util/LittleEndian.java#L53-L59 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.getTableData | public StreamReader getTableData(String name) throws IOException
{
InputStream stream = new ByteArrayInputStream(m_tableData.get(name));
if (m_majorVersion > 5)
{
byte[] header = new byte[24];
stream.read(header);
SynchroLogger.log("TABLE HEADER", header);
}... | java | public StreamReader getTableData(String name) throws IOException
{
InputStream stream = new ByteArrayInputStream(m_tableData.get(name));
if (m_majorVersion > 5)
{
byte[] header = new byte[24];
stream.read(header);
SynchroLogger.log("TABLE HEADER", header);
}... | [
"public",
"StreamReader",
"getTableData",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"InputStream",
"stream",
"=",
"new",
"ByteArrayInputStream",
"(",
"m_tableData",
".",
"get",
"(",
"name",
")",
")",
";",
"if",
"(",
"m_majorVersion",
">",
"5",
... | Return an input stream to read the data from the named table.
@param name table name
@return InputStream instance
@throws IOException | [
"Return",
"an",
"input",
"stream",
"to",
"read",
"the",
"data",
"from",
"the",
"named",
"table",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L69-L79 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/environment/locale/LocaleFacet.java | LocaleFacet.findOptimumLocale | @SuppressWarnings("All")
public static Locale findOptimumLocale(final String language, final String country, final String variant) {
final boolean hasCountry = country != null && !country.isEmpty();
final boolean hasVariant = variant != null && !variant.isEmpty();
final Locale[] availableL... | java | @SuppressWarnings("All")
public static Locale findOptimumLocale(final String language, final String country, final String variant) {
final boolean hasCountry = country != null && !country.isEmpty();
final boolean hasVariant = variant != null && !variant.isEmpty();
final Locale[] availableL... | [
"@",
"SuppressWarnings",
"(",
"\"All\"",
")",
"public",
"static",
"Locale",
"findOptimumLocale",
"(",
"final",
"String",
"language",
",",
"final",
"String",
"country",
",",
"final",
"String",
"variant",
")",
"{",
"final",
"boolean",
"hasCountry",
"=",
"country",... | Helper method to find the best matching locale, implying a workaround for problematic
case-sensitive Locale detection within the JDK. (C.f. Issue #112).
@param language The given Language.
@param country The given Country. May be null or empty to indicate that the Locale returned should not
contain a Country definiti... | [
"Helper",
"method",
"to",
"find",
"the",
"best",
"matching",
"locale",
"implying",
"a",
"workaround",
"for",
"problematic",
"case",
"-",
"sensitive",
"Locale",
"detection",
"within",
"the",
"JDK",
".",
"(",
"C",
".",
"f",
".",
"Issue",
"#112",
")",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/environment/locale/LocaleFacet.java#L140-L170 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/buffers/DefaultInputBuffer.java | DefaultInputBuffer.getLine0 | private static int getLine0(int[] newlines, int index) {
int j = Arrays.binarySearch(newlines, index);
return j >= 0 ? j : -(j + 1);
} | java | private static int getLine0(int[] newlines, int index) {
int j = Arrays.binarySearch(newlines, index);
return j >= 0 ? j : -(j + 1);
} | [
"private",
"static",
"int",
"getLine0",
"(",
"int",
"[",
"]",
"newlines",
",",
"int",
"index",
")",
"{",
"int",
"j",
"=",
"Arrays",
".",
"binarySearch",
"(",
"newlines",
",",
"index",
")",
";",
"return",
"j",
">=",
"0",
"?",
"j",
":",
"-",
"(",
"... | returns the zero based input line number the character with the given index is found in | [
"returns",
"the",
"zero",
"based",
"input",
"line",
"number",
"the",
"character",
"with",
"the",
"given",
"index",
"is",
"found",
"in"
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/buffers/DefaultInputBuffer.java#L98-L101 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.resolveForElement | protected PatchEntry resolveForElement(final PatchElement element) throws PatchingException {
assert state == State.NEW;
final PatchElementProvider provider = element.getProvider();
final String layerName = provider.getName();
final LayerType layerType = provider.getLayerType();
... | java | protected PatchEntry resolveForElement(final PatchElement element) throws PatchingException {
assert state == State.NEW;
final PatchElementProvider provider = element.getProvider();
final String layerName = provider.getName();
final LayerType layerType = provider.getLayerType();
... | [
"protected",
"PatchEntry",
"resolveForElement",
"(",
"final",
"PatchElement",
"element",
")",
"throws",
"PatchingException",
"{",
"assert",
"state",
"==",
"State",
".",
"NEW",
";",
"final",
"PatchElementProvider",
"provider",
"=",
"element",
".",
"getProvider",
"(",... | Get the target entry for a given patch element.
@param element the patch element
@return the patch entry
@throws PatchingException | [
"Get",
"the",
"target",
"entry",
"for",
"a",
"given",
"patch",
"element",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L226-L250 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java | MetricQueryService.createMetricQueryService | public static MetricQueryService createMetricQueryService(
RpcService rpcService,
ResourceID resourceID,
long maximumFrameSize) {
String endpointId = resourceID == null
? METRIC_QUERY_SERVICE_NAME
: METRIC_QUERY_SERVICE_NAME + "_" + resourceID.getResourceIdString();
return new MetricQueryService(rpcSe... | java | public static MetricQueryService createMetricQueryService(
RpcService rpcService,
ResourceID resourceID,
long maximumFrameSize) {
String endpointId = resourceID == null
? METRIC_QUERY_SERVICE_NAME
: METRIC_QUERY_SERVICE_NAME + "_" + resourceID.getResourceIdString();
return new MetricQueryService(rpcSe... | [
"public",
"static",
"MetricQueryService",
"createMetricQueryService",
"(",
"RpcService",
"rpcService",
",",
"ResourceID",
"resourceID",
",",
"long",
"maximumFrameSize",
")",
"{",
"String",
"endpointId",
"=",
"resourceID",
"==",
"null",
"?",
"METRIC_QUERY_SERVICE_NAME",
... | Starts the MetricQueryService actor in the given actor system.
@param rpcService The rpcService running the MetricQueryService
@param resourceID resource ID to disambiguate the actor name
@return actor reference to the MetricQueryService | [
"Starts",
"the",
"MetricQueryService",
"actor",
"in",
"the",
"given",
"actor",
"system",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java#L243-L253 |
pravega/pravega | shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java | MetricsNames.metricKey | public static MetricKey metricKey(String metric, String... tags) {
if (tags == null || tags.length == 0) { //if no tags supplied, the original metric name is used for both cache key and registry key.
return new MetricKey(metric, metric);
} else { //if tag is supplied, append tag value to f... | java | public static MetricKey metricKey(String metric, String... tags) {
if (tags == null || tags.length == 0) { //if no tags supplied, the original metric name is used for both cache key and registry key.
return new MetricKey(metric, metric);
} else { //if tag is supplied, append tag value to f... | [
"public",
"static",
"MetricKey",
"metricKey",
"(",
"String",
"metric",
",",
"String",
"...",
"tags",
")",
"{",
"if",
"(",
"tags",
"==",
"null",
"||",
"tags",
".",
"length",
"==",
"0",
")",
"{",
"//if no tags supplied, the original metric name is used for both cach... | Create an MetricKey object based on metric name, metric type and tags associated.
The MetricKey object contains cache key for cache lookup and registry key for registry lookup.
@param metric the metric name.
@param tags the tag(s) associated with the metric.
@return the MetricKey object contains cache lookup key and m... | [
"Create",
"an",
"MetricKey",
"object",
"based",
"on",
"metric",
"name",
"metric",
"type",
"and",
"tags",
"associated",
".",
"The",
"MetricKey",
"object",
"contains",
"cache",
"key",
"for",
"cache",
"lookup",
"and",
"registry",
"key",
"for",
"registry",
"lookup... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java#L244-L257 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.addSSOCookiesToResponse | @Override
public void addSSOCookiesToResponse(Subject subject, HttpServletRequest req, HttpServletResponse resp) {
if (!allowToAddCookieToResponse(req))
return;
addJwtSsoCookiesToResponse(subject, req, resp);
if (!JwtSSOTokenHelper.shouldAlsoIncludeLtpaCookie()) {
r... | java | @Override
public void addSSOCookiesToResponse(Subject subject, HttpServletRequest req, HttpServletResponse resp) {
if (!allowToAddCookieToResponse(req))
return;
addJwtSsoCookiesToResponse(subject, req, resp);
if (!JwtSSOTokenHelper.shouldAlsoIncludeLtpaCookie()) {
r... | [
"@",
"Override",
"public",
"void",
"addSSOCookiesToResponse",
"(",
"Subject",
"subject",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"if",
"(",
"!",
"allowToAddCookieToResponse",
"(",
"req",
")",
")",
"return",
";",
"addJwtSsoCo... | Set-Cookie: <name>=<value>[; <name>=<value>]...
[; expires=<date>][; domain=<domain_name>]
[; path=<some_path>][; secure][; httponly] | [
"Set",
"-",
"Cookie",
":",
"<name",
">",
"=",
"<value",
">",
"[",
";",
"<name",
">",
"=",
"<value",
">",
"]",
"...",
"[",
";",
"expires",
"=",
"<date",
">",
"]",
"[",
";",
"domain",
"=",
"<domain_name",
">",
"]",
"[",
";",
"path",
"=",
"<some_p... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L73-L103 |
AKSW/RDFUnit | rdfunit-validate/src/main/java/org/aksw/rdfunit/validate/ws/AbstractRDFUnitWebService.java | AbstractRDFUnitWebService.handleRequestAndRespond | private void handleRequestAndRespond(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
RDFUnitConfiguration configuration = null;
try {
configuration = getConfiguration(httpServletRequest);
} catch (ParameterException e) {
... | java | private void handleRequestAndRespond(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
RDFUnitConfiguration configuration = null;
try {
configuration = getConfiguration(httpServletRequest);
} catch (ParameterException e) {
... | [
"private",
"void",
"handleRequestAndRespond",
"(",
"HttpServletRequest",
"httpServletRequest",
",",
"HttpServletResponse",
"httpServletResponse",
")",
"throws",
"IOException",
"{",
"RDFUnitConfiguration",
"configuration",
"=",
"null",
";",
"try",
"{",
"configuration",
"=",
... | Has all the workflow logic for getting the parameters, performing a validation and writing the output | [
"Has",
"all",
"the",
"workflow",
"logic",
"for",
"getting",
"the",
"parameters",
"performing",
"a",
"validation",
"and",
"writing",
"the",
"output"
] | train | https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-validate/src/main/java/org/aksw/rdfunit/validate/ws/AbstractRDFUnitWebService.java#L45-L78 |
gocd/gocd | config/config-api/src/main/java/com/thoughtworks/go/config/materials/IgnoredFiles.java | IgnoredFiles.shouldIgnore | public boolean shouldIgnore(MaterialConfig materialConfig, String name) {
return materialConfig.matches(FilenameUtils.separatorsToUnix(name), processedPattern());
} | java | public boolean shouldIgnore(MaterialConfig materialConfig, String name) {
return materialConfig.matches(FilenameUtils.separatorsToUnix(name), processedPattern());
} | [
"public",
"boolean",
"shouldIgnore",
"(",
"MaterialConfig",
"materialConfig",
",",
"String",
"name",
")",
"{",
"return",
"materialConfig",
".",
"matches",
"(",
"FilenameUtils",
".",
"separatorsToUnix",
"(",
"name",
")",
",",
"processedPattern",
"(",
")",
")",
";... | our algorithom is replace the ** with ([^/]*/)* and replace the * with [^/]* | [
"our",
"algorithom",
"is",
"replace",
"the",
"**",
"with",
"(",
"[",
"^",
"/",
"]",
"*",
"/",
")",
"*",
"and",
"replace",
"the",
"*",
"with",
"[",
"^",
"/",
"]",
"*"
] | train | https://github.com/gocd/gocd/blob/59a8480e23d6c06de39127635108dff57603cb71/config/config-api/src/main/java/com/thoughtworks/go/config/materials/IgnoredFiles.java#L63-L65 |
alkacon/opencms-core | src/org/opencms/security/CmsRoleManager.java | CmsRoleManager.hasRoleForResource | public boolean hasRoleForResource(CmsObject cms, CmsRole role, CmsResource resource) {
return m_securityManager.hasRoleForResource(
cms.getRequestContext(),
cms.getRequestContext().getCurrentUser(),
role,
resource);
} | java | public boolean hasRoleForResource(CmsObject cms, CmsRole role, CmsResource resource) {
return m_securityManager.hasRoleForResource(
cms.getRequestContext(),
cms.getRequestContext().getCurrentUser(),
role,
resource);
} | [
"public",
"boolean",
"hasRoleForResource",
"(",
"CmsObject",
"cms",
",",
"CmsRole",
"role",
",",
"CmsResource",
"resource",
")",
"{",
"return",
"m_securityManager",
".",
"hasRoleForResource",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
",",
"cms",
".",
"getR... | Checks if the given context user has the given role for the given resource.<p>
@param cms the opencms context
@param role the role to check
@param resource the resource to check
@return <code>true</code> if the given context user has the given role for the given resource | [
"Checks",
"if",
"the",
"given",
"context",
"user",
"has",
"the",
"given",
"role",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsRoleManager.java#L461-L468 |
puniverse/galaxy | src/main/java/co/paralleluniverse/galaxy/Grid.java | Grid.getInstance | public static Grid getInstance(URL configFile, URL propertiesFile) throws InterruptedException {
return getInstance(new UrlResource(configFile), propertiesFile);
} | java | public static Grid getInstance(URL configFile, URL propertiesFile) throws InterruptedException {
return getInstance(new UrlResource(configFile), propertiesFile);
} | [
"public",
"static",
"Grid",
"getInstance",
"(",
"URL",
"configFile",
",",
"URL",
"propertiesFile",
")",
"throws",
"InterruptedException",
"{",
"return",
"getInstance",
"(",
"new",
"UrlResource",
"(",
"configFile",
")",
",",
"propertiesFile",
")",
";",
"}"
] | Retrieves the grid instance, as defined in the given configuration file.
@param configFile The name of the configuration file containing the grid definition.
@param propertiesFile The name of the properties file containing the grid's properties. You may, of course use Spring's {@code <context:property-placeholder loca... | [
"Retrieves",
"the",
"grid",
"instance",
"as",
"defined",
"in",
"the",
"given",
"configuration",
"file",
"."
] | train | https://github.com/puniverse/galaxy/blob/1d077532c4a5bcd6c52ff670770c31e98420ff63/src/main/java/co/paralleluniverse/galaxy/Grid.java#L86-L88 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/PairtreeUtils.java | PairtreeUtils.removeBasePath | public static String removeBasePath(final String aBasePath, final String aPtPath) {
Objects.requireNonNull(aBasePath, LOGGER.getMessage(MessageCodes.PT_007));
Objects.requireNonNull(aPtPath, LOGGER.getMessage(MessageCodes.PT_003));
String newPath = aPtPath;
if (aPtPath.startsWith(aBase... | java | public static String removeBasePath(final String aBasePath, final String aPtPath) {
Objects.requireNonNull(aBasePath, LOGGER.getMessage(MessageCodes.PT_007));
Objects.requireNonNull(aPtPath, LOGGER.getMessage(MessageCodes.PT_003));
String newPath = aPtPath;
if (aPtPath.startsWith(aBase... | [
"public",
"static",
"String",
"removeBasePath",
"(",
"final",
"String",
"aBasePath",
",",
"final",
"String",
"aPtPath",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"aBasePath",
",",
"LOGGER",
".",
"getMessage",
"(",
"MessageCodes",
".",
"PT_007",
")",
")"... | Removes the base path from the supplied Pairtree path.
@param aBasePath A base path for a Pairtree path
@param aPtPath A Pairtree path
@return The Pairtree path without the base path
@throws PairtreeRuntimeException If the supplied base path or Pairtree path are null | [
"Removes",
"the",
"base",
"path",
"from",
"the",
"supplied",
"Pairtree",
"path",
"."
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/PairtreeUtils.java#L366-L381 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsServlet.java | OpenCmsServlet.openErrorHandler | protected void openErrorHandler(HttpServletRequest req, HttpServletResponse res, int errorCode)
throws IOException, ServletException {
String handlerUri = (new StringBuffer(64)).append(HANDLE_VFS_PATH).append(errorCode).append(
HANDLE_VFS_SUFFIX).toString();
// provide the original erro... | java | protected void openErrorHandler(HttpServletRequest req, HttpServletResponse res, int errorCode)
throws IOException, ServletException {
String handlerUri = (new StringBuffer(64)).append(HANDLE_VFS_PATH).append(errorCode).append(
HANDLE_VFS_SUFFIX).toString();
// provide the original erro... | [
"protected",
"void",
"openErrorHandler",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"int",
"errorCode",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"handlerUri",
"=",
"(",
"new",
"StringBuffer",
"(",
"64",
"... | Displays an error code handler loaded from the OpenCms VFS,
or if such a page does not exist,
displays the default servlet container error code.<p>
@param req the current request
@param res the current response
@param errorCode the error code to display
@throws IOException if something goes wrong
@throws ServletExcept... | [
"Displays",
"an",
"error",
"code",
"handler",
"loaded",
"from",
"the",
"OpenCms",
"VFS",
"or",
"if",
"such",
"a",
"page",
"does",
"not",
"exist",
"displays",
"the",
"default",
"servlet",
"container",
"error",
"code",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsServlet.java#L309-L354 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.checkDimension | private void checkDimension(DiagnosticPosition pos, Type t) {
switch (t.getTag()) {
case METHOD:
checkDimension(pos, t.getReturnType());
for (List<Type> args = t.getParameterTypes(); args.nonEmpty(); args = args.tail)
checkDimension(pos, args.head);
br... | java | private void checkDimension(DiagnosticPosition pos, Type t) {
switch (t.getTag()) {
case METHOD:
checkDimension(pos, t.getReturnType());
for (List<Type> args = t.getParameterTypes(); args.nonEmpty(); args = args.tail)
checkDimension(pos, args.head);
br... | [
"private",
"void",
"checkDimension",
"(",
"DiagnosticPosition",
"pos",
",",
"Type",
"t",
")",
"{",
"switch",
"(",
"t",
".",
"getTag",
"(",
")",
")",
"{",
"case",
"METHOD",
":",
"checkDimension",
"(",
"pos",
",",
"t",
".",
"getReturnType",
"(",
")",
")"... | Check if the given type is an array with too many dimensions. | [
"Check",
"if",
"the",
"given",
"type",
"is",
"an",
"array",
"with",
"too",
"many",
"dimensions",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L263-L279 |
Bedework/bw-util | bw-util-jms/src/main/java/org/bedework/util/jms/NotificationsHandlerFactory.java | NotificationsHandlerFactory.getHandler | private static NotificationsHandler getHandler(final String queueName,
final Properties pr) throws NotificationException {
if (handler != null) {
return handler;
}
synchronized (synchit) {
handler = new JmsNotificationsHandlerImpl(queueName, pr);... | java | private static NotificationsHandler getHandler(final String queueName,
final Properties pr) throws NotificationException {
if (handler != null) {
return handler;
}
synchronized (synchit) {
handler = new JmsNotificationsHandlerImpl(queueName, pr);... | [
"private",
"static",
"NotificationsHandler",
"getHandler",
"(",
"final",
"String",
"queueName",
",",
"final",
"Properties",
"pr",
")",
"throws",
"NotificationException",
"{",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"return",
"handler",
";",
"}",
"synchroni... | Return a handler for the system event
@param queueName our queue
@param pr jms properties
@return NotificationsHandler
@throws NotificationException | [
"Return",
"a",
"handler",
"for",
"the",
"system",
"event"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jms/src/main/java/org/bedework/util/jms/NotificationsHandlerFactory.java#L43-L54 |
iipc/webarchive-commons | src/main/java/org/archive/hadoop/FilenameInputFormat.java | FilenameInputFormat.getRecordReader | public RecordReader<Text, Text> getRecordReader( InputSplit genericSplit,
JobConf job,
Reporter reporter)
throws IOException
{
reporter.setStatus(genericSplit.toString());
FileSplit split =... | java | public RecordReader<Text, Text> getRecordReader( InputSplit genericSplit,
JobConf job,
Reporter reporter)
throws IOException
{
reporter.setStatus(genericSplit.toString());
FileSplit split =... | [
"public",
"RecordReader",
"<",
"Text",
",",
"Text",
">",
"getRecordReader",
"(",
"InputSplit",
"genericSplit",
",",
"JobConf",
"job",
",",
"Reporter",
"reporter",
")",
"throws",
"IOException",
"{",
"reporter",
".",
"setStatus",
"(",
"genericSplit",
".",
"toStrin... | Return a RecordReader which returns 1 record: the file path from
the InputSplit. | [
"Return",
"a",
"RecordReader",
"which",
"returns",
"1",
"record",
":",
"the",
"file",
"path",
"from",
"the",
"InputSplit",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/hadoop/FilenameInputFormat.java#L64-L115 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.getByResourceGroup | public WorkflowInner getByResourceGroup(String resourceGroupName, String workflowName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workflowName).toBlocking().single().body();
} | java | public WorkflowInner getByResourceGroup(String resourceGroupName, String workflowName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workflowName).toBlocking().single().body();
} | [
"public",
"WorkflowInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
")",
".",
"toBlocking",
"(",
")",
".",
"s... | Gets a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the req... | [
"Gets",
"a",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L607-L609 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/XOR.java | XOR.satisfies | @Override
public boolean satisfies(Match match, int... ind)
{
int x = -1;
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) x *= -1;
}
return x == 1;
} | java | @Override
public boolean satisfies(Match match, int... ind)
{
int x = -1;
for (MappedConst mc : con)
{
if (mc.satisfies(match, ind)) x *= -1;
}
return x == 1;
} | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"int",
"x",
"=",
"-",
"1",
";",
"for",
"(",
"MappedConst",
"mc",
":",
"con",
")",
"{",
"if",
"(",
"mc",
".",
"satisfies",
"(",
"match",
... | Checks if constraints satisfy in xor pattern.
@param match match to validate
@param ind mapped indices
@return true if all satisfy | [
"Checks",
"if",
"constraints",
"satisfy",
"in",
"xor",
"pattern",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/XOR.java#L34-L43 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java | WrappedByteBuffer.putBufferAt | public WrappedByteBuffer putBufferAt(int index, WrappedByteBuffer v) {
// TODO: I believe this method incorrectly moves the position!
// Can't change it without a code analysis - and this is a public API!
int pos = _buf.position();
_buf.position(index);
_buf.put(v._buf);
... | java | public WrappedByteBuffer putBufferAt(int index, WrappedByteBuffer v) {
// TODO: I believe this method incorrectly moves the position!
// Can't change it without a code analysis - and this is a public API!
int pos = _buf.position();
_buf.position(index);
_buf.put(v._buf);
... | [
"public",
"WrappedByteBuffer",
"putBufferAt",
"(",
"int",
"index",
",",
"WrappedByteBuffer",
"v",
")",
"{",
"// TODO: I believe this method incorrectly moves the position!",
"// Can't change it without a code analysis - and this is a public API!",
"int",
"pos",
"=",
"_buf",
".",
... | Puts a buffer into the buffer at the specified index.
@param index the index
@param v the WrappedByteBuffer
@return the buffer | [
"Puts",
"a",
"buffer",
"into",
"the",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java#L665-L673 |
morimekta/utils | android-util/src/main/java/android/util/Base64.java | Base64.encodeToString | public static String encodeToString(byte[] source, int off, int len, int options) {
byte[] encoded = encode(source, off, len, options);
return new String(encoded, UTF_8);
} | java | public static String encodeToString(byte[] source, int off, int len, int options) {
byte[] encoded = encode(source, off, len, options);
return new String(encoded, UTF_8);
} | [
"public",
"static",
"String",
"encodeToString",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"len",
",",
"int",
"options",
")",
"{",
"byte",
"[",
"]",
"encoded",
"=",
"encode",
"(",
"source",
",",
"off",
",",
"len",
",",
"options",... | Encodes a byte array into Base64 notation.
@param source The data to convert
@param off Offset in array where conversion should begin
@param len Length of data to convert
@param options Specified options
@return The Base64-encoded data as a String
@see Base64#NO_WRAP
@throws NullPointerException if source array is nul... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"notation",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/android-util/src/main/java/android/util/Base64.java#L348-L351 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java | MethodBuilder.buildMethodComments | public void buildMethodComments(XMLNode node, Content methodDocTree) {
if (!configuration.nocomment) {
ExecutableElement method = currentMethod;
if (utils.getFullBody(currentMethod).isEmpty()) {
DocFinder.Output docs = DocFinder.search(configuration,
... | java | public void buildMethodComments(XMLNode node, Content methodDocTree) {
if (!configuration.nocomment) {
ExecutableElement method = currentMethod;
if (utils.getFullBody(currentMethod).isEmpty()) {
DocFinder.Output docs = DocFinder.search(configuration,
... | [
"public",
"void",
"buildMethodComments",
"(",
"XMLNode",
"node",
",",
"Content",
"methodDocTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"ExecutableElement",
"method",
"=",
"currentMethod",
";",
"if",
"(",
"utils",
".",
"getFull... | Build the comments for the method. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"comments",
"for",
"the",
"method",
".",
"Do",
"nothing",
"if",
"{",
"@link",
"Configuration#nocomment",
"}",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java#L186-L198 |
bohnman/squiggly-java | src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java | SquigglyUtils.collectify | public static <E> Collection<E> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<E> targetElementType) {
CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(targetCollectionType, targetElementType);
return objectify(mapper... | java | public static <E> Collection<E> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<E> targetElementType) {
CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(targetCollectionType, targetElementType);
return objectify(mapper... | [
"public",
"static",
"<",
"E",
">",
"Collection",
"<",
"E",
">",
"collectify",
"(",
"ObjectMapper",
"mapper",
",",
"Object",
"source",
",",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"targetCollectionType",
",",
"Class",
"<",
"E",
">",
"targetElementTyp... | Convert an object to a collection.
@param mapper the object mapper
@param source the source object
@param targetCollectionType the target collection type
@param targetElementType the target collection element type
@return collection | [
"Convert",
"an",
"object",
"to",
"a",
"collection",
"."
] | train | https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L45-L48 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java | AdvancedImpl.style | @Override
public <E> E style(E element, Object data) throws VectorPrintException {
if (getValue(DYNAMICDATA, Boolean.class)) {
setData(convert(data));
}
return element;
} | java | @Override
public <E> E style(E element, Object data) throws VectorPrintException {
if (getValue(DYNAMICDATA, Boolean.class)) {
setData(convert(data));
}
return element;
} | [
"@",
"Override",
"public",
"<",
"E",
">",
"E",
"style",
"(",
"E",
"element",
",",
"Object",
"data",
")",
"throws",
"VectorPrintException",
"{",
"if",
"(",
"getValue",
"(",
"DYNAMICDATA",
",",
"Boolean",
".",
"class",
")",
")",
"{",
"setData",
"(",
"con... | when {@link #DYNAMICDATA} is true call {@link #setData(java.lang.Object) } with {@link #convert(java.lang.Object)
}.
@param <E>
@param element the element to be returned
@param data
@return
@throws VectorPrintException | [
"when",
"{",
"@link",
"#DYNAMICDATA",
"}",
"is",
"true",
"call",
"{",
"@link",
"#setData",
"(",
"java",
".",
"lang",
".",
"Object",
")",
"}",
"with",
"{",
"@link",
"#convert",
"(",
"java",
".",
"lang",
".",
"Object",
")",
"}",
"."
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java#L203-L209 |
eurekaclinical/javautil | src/main/java/org/arp/javautil/collections/Collections.java | Collections.putSetAll | public static <K, V> void putSetAll(Map<K, Set<V>> map, Map<K, Set<V>> other) {
for (Map.Entry<K, Set<V>> me : other.entrySet()) {
putSetMult(map, me.getKey(), me.getValue());
}
} | java | public static <K, V> void putSetAll(Map<K, Set<V>> map, Map<K, Set<V>> other) {
for (Map.Entry<K, Set<V>> me : other.entrySet()) {
putSetMult(map, me.getKey(), me.getValue());
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"putSetAll",
"(",
"Map",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"map",
",",
"Map",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"other",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
... | Copies all of the mappings from the second map to the first. The value
for each key is the union of the first and second maps' values for that
key.
@param <K>
@param <V>
@param map the first {@link Map}.
@param other the second {@link Map}. | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"second",
"map",
"to",
"the",
"first",
".",
"The",
"value",
"for",
"each",
"key",
"is",
"the",
"union",
"of",
"the",
"first",
"and",
"second",
"maps",
"values",
"for",
"that",
"key",
"."
] | train | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/collections/Collections.java#L117-L121 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java | ProcessContext.addDataUsageForAll | public void addDataUsageForAll(Collection<String> activities, String attribute, DataUsage dataUsage) {
Validate.notNull(activities);
Validate.notEmpty(activities);
for (String activity : activities) {
addDataUsageFor(activity, attribute, dataUsage)... | java | public void addDataUsageForAll(Collection<String> activities, String attribute, DataUsage dataUsage) {
Validate.notNull(activities);
Validate.notEmpty(activities);
for (String activity : activities) {
addDataUsageFor(activity, attribute, dataUsage)... | [
"public",
"void",
"addDataUsageForAll",
"(",
"Collection",
"<",
"String",
">",
"activities",
",",
"String",
"attribute",
",",
"DataUsage",
"dataUsage",
")",
"{",
"Validate",
".",
"notNull",
"(",
"activities",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"activi... | Adds a data attribute for all given activities together with its
usage.<br>
The given activities/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param activities Activities for which the attribute usage is set.
@param attribute Attribute used by the given activities.
@par... | [
"Adds",
"a",
"data",
"attribute",
"for",
"all",
"given",
"activities",
"together",
"with",
"its",
"usage",
".",
"<br",
">",
"The",
"given",
"activities",
"/",
"attributes",
"have",
"to",
"be",
"known",
"by",
"the",
"context",
"i",
".",
"e",
".",
"be",
... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java#L705-L711 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.findAll | @Override
public List<CPAttachmentFileEntry> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPAttachmentFileEntry> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPAttachmentFileEntry",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp attachment file entries.
@return the cp attachment file entries | [
"Returns",
"all",
"the",
"cp",
"attachment",
"file",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L5772-L5775 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_conference_serviceName_participants_id_GET | public OvhConferenceParticipants billingAccount_conference_serviceName_participants_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/participants/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id)... | java | public OvhConferenceParticipants billingAccount_conference_serviceName_participants_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/participants/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id)... | [
"public",
"OvhConferenceParticipants",
"billingAccount_conference_serviceName_participants_id_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/confer... | Get this object properties
REST: GET /telephony/{billingAccount}/conference/{serviceName}/participants/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4886-L4891 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.viewCallLegsByCallId | public VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException {
if (callId == null) {
throw new IllegalArgumentException("Voice call ID must be specified.");
}
String url =... | java | public VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException {
if (callId == null) {
throw new IllegalArgumentException("Voice call ID must be specified.");
}
String url =... | [
"public",
"VoiceCallLegResponse",
"viewCallLegsByCallId",
"(",
"String",
"callId",
",",
"Integer",
"page",
",",
"Integer",
"pageSize",
")",
"throws",
"UnsupportedEncodingException",
",",
"UnauthorizedException",
",",
"GeneralException",
"{",
"if",
"(",
"callId",
"==",
... | Retrieves a listing of all legs.
@param callId Voice call ID
@param page page to fetch (can be null - will return first page), number of first page is 1
@param pageSize page size
@return VoiceCallLegResponse
@throws UnsupportedEncodingException no UTF8 supported url
@throws UnauthorizedException if client... | [
"Retrieves",
"a",
"listing",
"of",
"all",
"legs",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L984-L997 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.