repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
liferay/com-liferay-commerce | commerce-price-list-api/src/main/java/com/liferay/commerce/price/list/service/persistence/CommerceTierPriceEntryUtil.java | CommerceTierPriceEntryUtil.findByUuid_First | public static CommerceTierPriceEntry findByUuid_First(String uuid,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws com.liferay.commerce.price.list.exception.NoSuchTierPriceEntryException {
return getPersistence().findByUuid_First(uuid, orderByComparator);
} | java | public static CommerceTierPriceEntry findByUuid_First(String uuid,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws com.liferay.commerce.price.list.exception.NoSuchTierPriceEntryException {
return getPersistence().findByUuid_First(uuid, orderByComparator);
} | [
"public",
"static",
"CommerceTierPriceEntry",
"findByUuid_First",
"(",
"String",
"uuid",
",",
"OrderByComparator",
"<",
"CommerceTierPriceEntry",
">",
"orderByComparator",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"price",
".",
"list",
".",
"except... | Returns the first commerce tier price entry in the ordered set where uuid = ?.
@param uuid the uuid
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the first matching commerce tier price entry
@throws NoSuchTierPriceEntryException if a matching commerce tier price... | [
"Returns",
"the",
"first",
"commerce",
"tier",
"price",
"entry",
"in",
"the",
"ordered",
"set",
"where",
"uuid",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-api/src/main/java/com/liferay/commerce/price/list/service/persistence/CommerceTierPriceEntryUtil.java#L194-L198 | train | Returns the first commerce tier price entry matching the UUID and sorts the ordered set. | Of course, here is the Java code you requested:
```java
public static CommerceTierPriceEntry findByUuid_First(String uuid,
OrderByComparator<CommerceTierPriceEntry> orderByComparator)
throws com.liferay.commerce.price.list.exception.NoSuchTierPriceEntryException {
return getPersistence().findByUuid_First(uuid, o... |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java | CompositeHandler.withQueryHandler | public CompositeHandler withQueryHandler(final QueryHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
handler,
... | java | public CompositeHandler withQueryHandler(final QueryHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
handler,
... | [
"public",
"CompositeHandler",
"withQueryHandler",
"(",
"final",
"QueryHandler",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// end of if",
"// ---",
"return",
"new",
"Composi... | Returns a new handler based on this one,
but with given query |handler| appended.
@param handler Query handler
@return a new composite handler with given query handler
@throws IllegalArgumentException if handler is null | [
"Returns",
"a",
"new",
"handler",
"based",
"on",
"this",
"one",
"but",
"with",
"given",
"query",
"|handler|",
"appended",
"."
] | a383dff20fadc08ec9306f2f1f24b2a7e0047449 | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/CompositeHandler.java#L61-L72 | train | Creates a new composite handler with the specified query handler. | Of course, here is the Java code you requested:
```java
public CompositeHandler withQueryHandler(final QueryHandler handler) {
if (handler == null) {
throw new IllegalArgumentException();
} // end of if
// ---
return new CompositeHandler(this.queryDetection,
... |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getYAsOppositeTileFormat | public static int getYAsOppositeTileFormat(int zoom, int y) {
int tilesPerSide = tilesPerSide(zoom);
int oppositeY = tilesPerSide - y - 1;
return oppositeY;
} | java | public static int getYAsOppositeTileFormat(int zoom, int y) {
int tilesPerSide = tilesPerSide(zoom);
int oppositeY = tilesPerSide - y - 1;
return oppositeY;
} | [
"public",
"static",
"int",
"getYAsOppositeTileFormat",
"(",
"int",
"zoom",
",",
"int",
"y",
")",
"{",
"int",
"tilesPerSide",
"=",
"tilesPerSide",
"(",
"zoom",
")",
";",
"int",
"oppositeY",
"=",
"tilesPerSide",
"-",
"y",
"-",
"1",
";",
"return",
"oppositeY"... | Get the standard y tile location as TMS or a TMS y location as standard
@param zoom
zoom level
@param y
y coordinate
@return opposite tile format y | [
"Get",
"the",
"standard",
"y",
"tile",
"location",
"as",
"TMS",
"or",
"a",
"TMS",
"y",
"location",
"as",
"standard"
] | 6431c3b041a45b7f3802904ea4156b4082a72daa | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L768-L772 | train | Get the y coordinate of the tile in the zoom level as the opposite tile format. | Of course, here is the Java code you requested:
```java
public static int getYAsOppositeTileFormat(int zoom, int y) {
int tilesPerSide = tilesPerSide(zoom);
int oppositeY = tilesPerSide - y - 1;
return oppositeY;
}
```
Hope this helps! |
j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java | ServletContextResourceReaderHandler.initReader | private void initReader(Object obj) {
if (obj instanceof WorkingDirectoryLocationAware) {
((WorkingDirectoryLocationAware) obj).setWorkingDirectory(workingDirectory);
}
if (obj instanceof ServletContextAware) {
((ServletContextAware) obj).setServletContext(servletContext);
}
if (obj instanceof Resource... | java | private void initReader(Object obj) {
if (obj instanceof WorkingDirectoryLocationAware) {
((WorkingDirectoryLocationAware) obj).setWorkingDirectory(workingDirectory);
}
if (obj instanceof ServletContextAware) {
((ServletContextAware) obj).setServletContext(servletContext);
}
if (obj instanceof Resource... | [
"private",
"void",
"initReader",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"WorkingDirectoryLocationAware",
")",
"{",
"(",
"(",
"WorkingDirectoryLocationAware",
")",
"obj",
")",
".",
"setWorkingDirectory",
"(",
"workingDirectory",
")",
";",
... | Initialize the reader
@param obj
the reader to initialize | [
"Initialize",
"the",
"reader"
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java#L185-L196 | train | Initialize the reader. | Of course, here is the Java code you requested:
```java
private void initReader(Object obj) {
if (obj instanceof WorkingDirectoryLocationAware) {
((WorkingDirectoryLocationAware) obj).setWorkingDirectory(workingDirectory);
}
if (obj instanceof ServletContextAware) {
((ServletContextAware) obj).setServletCo... |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/StreamCharBuffer.java | StreamCharBuffer.reset | public final void reset(boolean resetChunkSize)
{
firstChunk = null;
lastChunk = null;
totalCharsInList = 0;
totalCharsInDynamicChunks = -1;
sizeAtLeast = -1;
if (resetChunkSize)
{
chunkSize = firstChunkSize;
totalChunkSize = 0;
... | java | public final void reset(boolean resetChunkSize)
{
firstChunk = null;
lastChunk = null;
totalCharsInList = 0;
totalCharsInDynamicChunks = -1;
sizeAtLeast = -1;
if (resetChunkSize)
{
chunkSize = firstChunkSize;
totalChunkSize = 0;
... | [
"public",
"final",
"void",
"reset",
"(",
"boolean",
"resetChunkSize",
")",
"{",
"firstChunk",
"=",
"null",
";",
"lastChunk",
"=",
"null",
";",
"totalCharsInList",
"=",
"0",
";",
"totalCharsInDynamicChunks",
"=",
"-",
"1",
";",
"sizeAtLeast",
"=",
"-",
"1",
... | resets the state of this buffer (empties it)
@param resetChunkSize | [
"resets",
"the",
"state",
"of",
"this",
"buffer",
"(",
"empties",
"it",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/StreamCharBuffer.java#L328-L342 | train | Resets the internal state of the internal state. | Of course, here is the Java code you requested:
```java
public final void reset(boolean resetChunkSize)
{
firstChunk = null;
lastChunk = null;
totalCharsInList = 0;
totalCharsInDynamicChunks = -1;
sizeAtLeast = -1;
if (resetChunkSize)
{
chunkSize ... |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveTask.java | HiveTask.addFile | public static void addFile(State state, String file) {
state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
} | java | public static void addFile(State state, String file) {
state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
} | [
"public",
"static",
"void",
"addFile",
"(",
"State",
"state",
",",
"String",
"file",
")",
"{",
"state",
".",
"setProp",
"(",
"ADD_FILES",
",",
"state",
".",
"getProp",
"(",
"ADD_FILES",
",",
"\"\"",
")",
"+",
"\",\"",
"+",
"file",
")",
";",
"}"
] | Add the input file to the Hive session before running the task. | [
"Add",
"the",
"input",
"file",
"to",
"the",
"Hive",
"session",
"before",
"running",
"the",
"task",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveTask.java#L73-L75 | train | Add a file to the state. | Of course, here is the Java code you requested:
```java
public static void addFile(State state, String file) {
state.setProp(ADD_FILES, state.getProp(ADD_FILES, "") + "," + file);
}
```
Hope this helps! |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.chop | public static String chop(String target) {
if (isEmpty(target)) { return EMPTY; }
int len = target.length(), lastIdx = -1;
if (len >= 2 && target.charAt(len - 1) == LF && target.charAt(len - 2) == CR) {
if (len == 2) { return EMPTY; } lastIdx = -2;
}
return replace(target).afters(lastIdx).byNone().last();... | java | public static String chop(String target) {
if (isEmpty(target)) { return EMPTY; }
int len = target.length(), lastIdx = -1;
if (len >= 2 && target.charAt(len - 1) == LF && target.charAt(len - 2) == CR) {
if (len == 2) { return EMPTY; } lastIdx = -2;
}
return replace(target).afters(lastIdx).byNone().last();... | [
"public",
"static",
"String",
"chop",
"(",
"String",
"target",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"target",
")",
")",
"{",
"return",
"EMPTY",
";",
"}",
"int",
"len",
"=",
"target",
".",
"length",
"(",
")",
",",
"lastIdx",
"=",
"-",
"1",
";",
"i... | <p>Remove the last character from a String.</p>
<p>If the String ends in {@code \r\n}, then remove both of them.</p>
@param target
@return | [
"<p",
">",
"Remove",
"the",
"last",
"character",
"from",
"a",
"String",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"the",
"String",
"ends",
"in",
"{",
"@code",
"\\",
"r",
"\\",
"n",
"}",
"then",
"remove",
"both",
"of",
"them",
".",
"<",
"/",
"p"... | 7585152e10e4cac07b4274c65f1c72ad7061ae69 | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L222-L229 | train | Chop off the last character of the target string. | Of course, here is the Java code you requested:
```java
public static String chop(String target) {
if (isEmpty(target)) { return EMPTY; }
int len = target.length(), lastIdx = -1;
if (len >= 2 && target.charAt(len - 1) == LF && target.charAt(len - 2) == CR) {
if (len == 2) { return EMPTY; } lastIdx = -2;
}
... |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/util/ExpiringCache.java | ExpiringCache.computeIfAbsent | private Entry<V> computeIfAbsent(K key) {
Entry<V> v = map.get(key);
if (v == null) {
Entry<V> tmp = entryGetter.apply(key);
v = map.putIfAbsent(key, tmp);
if (v == null) {
v = tmp;
}
}
return v;
} | java | private Entry<V> computeIfAbsent(K key) {
Entry<V> v = map.get(key);
if (v == null) {
Entry<V> tmp = entryGetter.apply(key);
v = map.putIfAbsent(key, tmp);
if (v == null) {
v = tmp;
}
}
return v;
} | [
"private",
"Entry",
"<",
"V",
">",
"computeIfAbsent",
"(",
"K",
"key",
")",
"{",
"Entry",
"<",
"V",
">",
"v",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"v",
"==",
"null",
")",
"{",
"Entry",
"<",
"V",
">",
"tmp",
"=",
"entryGett... | This method should be used instead of the
{@link ConcurrentHashMap#computeIfAbsent(Object, Function)} call to minimize
thread contention. This method does not require locking for the common case
where the key exists, but potentially performs additional computation when
absent. | [
"This",
"method",
"should",
"be",
"used",
"instead",
"of",
"the",
"{"
] | d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815 | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/util/ExpiringCache.java#L135-L145 | train | Compute the entry for the given key. | Of course, here is the Java code you requested:
```java
private Entry<V> computeIfAbsent(K key) {
Entry<V> v = map.get(key);
if (v == null) {
Entry<V> tmp = entryGetter.apply(key);
v = map.putIfAbsent(key, tmp);
if (v == null) {
v = tmp;
}
}
return v;
}
```
Hope this ... |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/core/layout/ClassicLayoutManager.java | ClassicLayoutManager.generateTitleBand | protected void generateTitleBand() {
log.debug("Generating title band...");
JRDesignBand band = (JRDesignBand) getDesign().getPageHeader();
int yOffset = 0;
//If title is not present then subtitle will be ignored
if (getReport().getTitle() == null)
return;
if (band != null && !getDesign().isTitleNewPag... | java | protected void generateTitleBand() {
log.debug("Generating title band...");
JRDesignBand band = (JRDesignBand) getDesign().getPageHeader();
int yOffset = 0;
//If title is not present then subtitle will be ignored
if (getReport().getTitle() == null)
return;
if (band != null && !getDesign().isTitleNewPag... | [
"protected",
"void",
"generateTitleBand",
"(",
")",
"{",
"log",
".",
"debug",
"(",
"\"Generating title band...\"",
")",
";",
"JRDesignBand",
"band",
"=",
"(",
"JRDesignBand",
")",
"getDesign",
"(",
")",
".",
"getPageHeader",
"(",
")",
";",
"int",
"yOffset",
... | Adds title and subtitle to the TitleBand when it applies.
If title is not present then subtitle will be ignored | [
"Adds",
"title",
"and",
"subtitle",
"to",
"the",
"TitleBand",
"when",
"it",
"applies",
".",
"If",
"title",
"is",
"not",
"present",
"then",
"subtitle",
"will",
"be",
"ignored"
] | 63919574cc401ae40574d13129f628e66d1682a3 | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/core/layout/ClassicLayoutManager.java#L370-L430 | train | Generate title band | Of course, here is the Java code you requested:
```java
protected void generateTitleBand() {
log.debug("Generating title band...");
JRDesignBand band = (JRDesignBand) getDesign().getPageHeader();
int yOffset = 0;
//If title is not present then subtitle will be ignored
if (getReport().getTitle() == null)
... |
ArpNetworking/logback-steno | src/main/java/com/arpnetworking/logback/BaseLoggingEncoder.java | BaseLoggingEncoder.isArrayJsonStenoEvent | protected boolean isArrayJsonStenoEvent(@Nullable final Marker marker) {
return marker != null && marker.contains(StenoMarker.ARRAY_JSON_MARKER);
} | java | protected boolean isArrayJsonStenoEvent(@Nullable final Marker marker) {
return marker != null && marker.contains(StenoMarker.ARRAY_JSON_MARKER);
} | [
"protected",
"boolean",
"isArrayJsonStenoEvent",
"(",
"@",
"Nullable",
"final",
"Marker",
"marker",
")",
"{",
"return",
"marker",
"!=",
"null",
"&&",
"marker",
".",
"contains",
"(",
"StenoMarker",
".",
"ARRAY_JSON_MARKER",
")",
";",
"}"
] | Determine whether the <code>marker</code> represents a JSON array event.
@since 1.0.4
@param marker The <code>Marker</code> instance to evaluate.
@return True if and only if <code>marker</code> represents a JSON array event. | [
"Determine",
"whether",
"the",
"<code",
">",
"marker<",
"/",
"code",
">",
"represents",
"a",
"JSON",
"array",
"event",
"."
] | abd5c68ce7d42c39f80ffbad6d162d5fed3a346e | https://github.com/ArpNetworking/logback-steno/blob/abd5c68ce7d42c39f80ffbad6d162d5fed3a346e/src/main/java/com/arpnetworking/logback/BaseLoggingEncoder.java#L234-L236 | test | Check if the given marker is an array json event. | Of course, here is the Java code you requested:
```java
protected boolean isArrayJsonStenoEvent(@Nullable final Marker marker) {
return marker != null && marker.contains(StenoMarker.ARRAY_JSON_MARKER);
}
```
Hope this helps! |
apereo/person-directory | person-directory-impl/src/main/java/org/apereo/services/persondir/support/web/RequestAttributeSourceFilter.java | RequestAttributeSourceFilter.addRequestHeaders | protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) {
final String headerName = headerAttributeEntry.getKey();
... | java | protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) {
final String headerName = headerAttributeEntry.getKey();
... | [
"protected",
"void",
"addRequestHeaders",
"(",
"final",
"HttpServletRequest",
"httpServletRequest",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attributes",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
","... | Add request headers to the attributes map
@param httpServletRequest Http Servlet Request
@param attributes Map of attributes to add additional attributes to from the Http Request | [
"Add",
"request",
"headers",
"to",
"the",
"attributes",
"map"
] | 331200c0878aec202b8aff12a732402d6ba7681f | https://github.com/apereo/person-directory/blob/331200c0878aec202b8aff12a732402d6ba7681f/person-directory-impl/src/main/java/org/apereo/services/persondir/support/web/RequestAttributeSourceFilter.java#L458-L472 | train | Add request headers. | Of course, here is the Java code you requested:
```java
protected void addRequestHeaders(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
for (final Map.Entry<String, Set<String>> headerAttributeEntry : this.headerAttributeMapping.entrySet()) {
final String... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver.java | lbvserver.get | public static lbvserver get(nitro_service service, String name) throws Exception{
lbvserver obj = new lbvserver();
obj.set_name(name);
lbvserver response = (lbvserver) obj.get_resource(service);
return response;
} | java | public static lbvserver get(nitro_service service, String name) throws Exception{
lbvserver obj = new lbvserver();
obj.set_name(name);
lbvserver response = (lbvserver) obj.get_resource(service);
return response;
} | [
"public",
"static",
"lbvserver",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"lbvserver",
"obj",
"=",
"new",
"lbvserver",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"lbvserver",
"respon... | Use this API to fetch lbvserver resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"lbvserver",
"resource",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver.java#L3052-L3057 | train | Use this API to fetch lbvserver resource of given name. | Of course, here is the Java code you requested:
```java
public static lbvserver get(nitro_service service, String name) throws Exception{
lbvserver obj = new lbvserver();
obj.set_name(name);
lbvserver response = (lbvserver) obj.get_resource(service);
return response;
}
```
Hope this helps! |
Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java | AlluxioFuse.parseOptions | private static AlluxioFuseOptions parseOptions(String[] args, AlluxioConfiguration alluxioConf) {
final Options opts = new Options();
final Option mntPoint = Option.builder("m")
.hasArg()
.required(true)
.longOpt("mount-point")
.desc("Desired local mount point for alluxio-fuse.")... | java | private static AlluxioFuseOptions parseOptions(String[] args, AlluxioConfiguration alluxioConf) {
final Options opts = new Options();
final Option mntPoint = Option.builder("m")
.hasArg()
.required(true)
.longOpt("mount-point")
.desc("Desired local mount point for alluxio-fuse.")... | [
"private",
"static",
"AlluxioFuseOptions",
"parseOptions",
"(",
"String",
"[",
"]",
"args",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"{",
"final",
"Options",
"opts",
"=",
"new",
"Options",
"(",
")",
";",
"final",
"Option",
"mntPoint",
"=",
"Option",
".... | Parses CLI options.
@param args CLI args
@return Alluxio-FUSE configuration options | [
"Parses",
"CLI",
"options",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java#L84-L159 | train | Parses the command line options. | Of course, here is the Java code you requested:
```java
private static AlluxioFuseOptions parseOptions(String[] args, AlluxioConfiguration alluxioConf) {
final Options opts = new Options();
final Option mntPoint = Option.builder("m")
.hasArg()
.required(true)
.longOpt("mount-point")
... |
feedzai/fos-weka | src/main/java/com/feedzai/fos/impl/weka/config/WekaModelConfig.java | WekaModelConfig.getPoolConfiguration | @NotNull
public Map<Object, Object> getPoolConfiguration() {
return ConfigurationConverter.getMap(configuration.subset(GenericObjectPoolConfig.class.getName()));
} | java | @NotNull
public Map<Object, Object> getPoolConfiguration() {
return ConfigurationConverter.getMap(configuration.subset(GenericObjectPoolConfig.class.getName()));
} | [
"@",
"NotNull",
"public",
"Map",
"<",
"Object",
",",
"Object",
">",
"getPoolConfiguration",
"(",
")",
"{",
"return",
"ConfigurationConverter",
".",
"getMap",
"(",
"configuration",
".",
"subset",
"(",
"GenericObjectPoolConfig",
".",
"class",
".",
"getName",
"(",
... | Returns the pool configuration of the scorer.
@return a map from configuration key to configuration value | [
"Returns",
"the",
"pool",
"configuration",
"of",
"the",
"scorer",
"."
] | 130213aa58dfef770382a59727afb9e5f7bc4a3c | https://github.com/feedzai/fos-weka/blob/130213aa58dfef770382a59727afb9e5f7bc4a3c/src/main/java/com/feedzai/fos/impl/weka/config/WekaModelConfig.java#L152-L155 | valid | Get the configuration of the object pool. | Of course, here is the Java code you requested:
```java
@NotNull
public Map<Object, Object> getPoolConfiguration() {
return ConfigurationConverter.getMap(configuration.subset(GenericObjectPoolConfig.class.getName()));
}
```
Hope this helps! |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java | BasicPathFinder.interconnect | @Override
public SimplePath[] interconnect(KamNode[] sources) {
if (sources == null || sources.length < 2) {
throw new InvalidArgument(
"Source kam nodes cannot be null and must contain at least two source nodes.");
}
// build out target set, check that each ... | java | @Override
public SimplePath[] interconnect(KamNode[] sources) {
if (sources == null || sources.length < 2) {
throw new InvalidArgument(
"Source kam nodes cannot be null and must contain at least two source nodes.");
}
// build out target set, check that each ... | [
"@",
"Override",
"public",
"SimplePath",
"[",
"]",
"interconnect",
"(",
"KamNode",
"[",
"]",
"sources",
")",
"{",
"if",
"(",
"sources",
"==",
"null",
"||",
"sources",
".",
"length",
"<",
"2",
")",
"{",
"throw",
"new",
"InvalidArgument",
"(",
"\"Source ka... | {@inheritDoc} | [
"{"
] | 149f80b1d6eabb15ab15815b6f745b0afa9fd2d3 | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java#L179-L206 | train | Interconnect method. | Of course, here is the Java code you requested:
```java
@Override
public SimplePath[] interconnect(KamNode[] sources) {
if (sources == null || sources.length < 2) {
throw new InvalidArgument(
"Source kam nodes cannot be null and must contain at least two source nodes.");
... |
alkacon/opencms-core | src/org/opencms/ui/apps/dbmanager/CmsPropertyTable.java | CmsPropertyTable.getMenuEntries | List<I_CmsSimpleContextMenuEntry<Set<String>>> getMenuEntries() {
if (m_menuEntries == null) {
m_menuEntries = new ArrayList<I_CmsSimpleContextMenuEntry<Set<String>>>();
m_menuEntries.add(new EntryResources());
m_menuEntries.add(new EntryDelete());
}
return m... | java | List<I_CmsSimpleContextMenuEntry<Set<String>>> getMenuEntries() {
if (m_menuEntries == null) {
m_menuEntries = new ArrayList<I_CmsSimpleContextMenuEntry<Set<String>>>();
m_menuEntries.add(new EntryResources());
m_menuEntries.add(new EntryDelete());
}
return m... | [
"List",
"<",
"I_CmsSimpleContextMenuEntry",
"<",
"Set",
"<",
"String",
">",
">",
">",
"getMenuEntries",
"(",
")",
"{",
"if",
"(",
"m_menuEntries",
"==",
"null",
")",
"{",
"m_menuEntries",
"=",
"new",
"ArrayList",
"<",
"I_CmsSimpleContextMenuEntry",
"<",
"Set",... | Returns the available menu entries.<p>
@return the menu entries | [
"Returns",
"the",
"available",
"menu",
"entries",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/dbmanager/CmsPropertyTable.java#L365-L373 | train | Gets the menu entries. | Of course, here is the Java code you requested:
```java
List<I_CmsSimpleContextMenuEntry<Set<String>>> getMenuEntries() {
if (m_menuEntries == null) {
m_menuEntries = new ArrayList<I_CmsSimpleContextMenuEntry<Set<String>>>();
m_menuEntries.add(new EntryResources());
m_menuE... |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toLineString | public LineString toLineString(List<LatLng> latLngs, boolean hasZ,
boolean hasM) {
LineString lineString = new LineString(hasZ, hasM);
populateLineString(lineString, latLngs);
return lineString;
} | java | public LineString toLineString(List<LatLng> latLngs, boolean hasZ,
boolean hasM) {
LineString lineString = new LineString(hasZ, hasM);
populateLineString(lineString, latLngs);
return lineString;
} | [
"public",
"LineString",
"toLineString",
"(",
"List",
"<",
"LatLng",
">",
"latLngs",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"LineString",
"lineString",
"=",
"new",
"LineString",
"(",
"hasZ",
",",
"hasM",
")",
";",
"populateLineString",
"(",... | Convert a list of {@link LatLng} to a {@link LineString}
@param latLngs lat lngs
@param hasZ has z flag
@param hasM has m flag
@return line string | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"LatLng",
"}",
"to",
"a",
"{",
"@link",
"LineString",
"}"
] | 634d78468a5c52d2bc98791cc7ff03981ebf573b | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L347-L355 | train | Converts a list of latLngs to a LineString. | Of course, here is the Java code you requested:
```java
public LineString toLineString(List<LatLng> latLngs, boolean hasZ,
boolean hasM) {
LineString lineString = new LineString(hasZ, hasM);
populateLineString(lineString, latLngs);
return lineString;
}
... |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryTransactionByID | public TransactionInfo queryTransactionByID(Peer peer, String txID) throws ProposalException, InvalidArgumentException {
return queryTransactionByID(Collections.singleton(peer), txID, client.getUserContext());
} | java | public TransactionInfo queryTransactionByID(Peer peer, String txID) throws ProposalException, InvalidArgumentException {
return queryTransactionByID(Collections.singleton(peer), txID, client.getUserContext());
} | [
"public",
"TransactionInfo",
"queryTransactionByID",
"(",
"Peer",
"peer",
",",
"String",
"txID",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"return",
"queryTransactionByID",
"(",
"Collections",
".",
"singleton",
"(",
"peer",
")",
",",
... | Query for a Fabric Transaction given its transactionID
<STRONG>This method may not be thread safe if client context is changed!</STRONG>
@param txID the ID of the transaction
@param peer the peer to send the request to
@return a {@link TransactionInfo}
@throws ProposalException
@throws InvalidArgumentException | [
"Query",
"for",
"a",
"Fabric",
"Transaction",
"given",
"its",
"transactionID"
] | 4a2d7b3408b8b0a1ed812aa36942c438159c37a0 | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L3196-L3198 | train | Query a transaction by ID | Of course, here is the Java code you requested:
```java
public TransactionInfo queryTransactionByID(Peer peer, String txID) throws ProposalException, InvalidArgumentException {
return queryTransactionByID(Collections.singleton(peer), txID, client.getUserContext());
}
```
Hope this helps! |
sematext/ActionGenerator | ag-player/src/main/java/com/sematext/ag/PlayerConfig.java | PlayerConfig.get | public String get(String key) {
if (properties.get(key) != null) {
return properties.get(key);
} else {
return getConfigurationValue(key);
}
} | java | public String get(String key) {
if (properties.get(key) != null) {
return properties.get(key);
} else {
return getConfigurationValue(key);
}
} | [
"public",
"String",
"get",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"properties",
".",
"get",
"(",
"key",
")",
"!=",
"null",
")",
"{",
"return",
"properties",
".",
"get",
"(",
"key",
")",
";",
"}",
"else",
"{",
"return",
"getConfigurationValue",
"(... | Return property value for a given name.
@param key
property name
@return property value | [
"Return",
"property",
"value",
"for",
"a",
"given",
"name",
"."
] | 10f4a3e680f20d7d151f5d40e6758aeb072d474f | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player/src/main/java/com/sematext/ag/PlayerConfig.java#L104-L110 | train | Get the value of the specified key. | Of course, here is the Java code you requested:
```java
public String get(String key) {
if (properties.get(key) != null) {
return properties.get(key);
} else {
return getConfigurationValue(key);
}
}
```
Hope this helps! |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.doubleToLongFunction | public static DoubleToLongFunction doubleToLongFunction(CheckedDoubleToLongFunction function, Consumer<Throwable> handler) {
return t -> {
try {
return function.applyAsLong(t);
}
catch (Throwable e) {
handler.accept(e);
throw n... | java | public static DoubleToLongFunction doubleToLongFunction(CheckedDoubleToLongFunction function, Consumer<Throwable> handler) {
return t -> {
try {
return function.applyAsLong(t);
}
catch (Throwable e) {
handler.accept(e);
throw n... | [
"public",
"static",
"DoubleToLongFunction",
"doubleToLongFunction",
"(",
"CheckedDoubleToLongFunction",
"function",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"t",
"->",
"{",
"try",
"{",
"return",
"function",
".",
"applyAsLong",
"(",
"t... | Wrap a {@link CheckedDoubleToLongFunction} in a {@link DoubleToLongFunction} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
DoubleStream.of(1.0, 2.0, 3.0).mapToLong(Unchecked.doubleToLongFunction(
d -> {
if (d < 0.0)
throw new Exception("Only positive numbers allowed");
return (long) d;
},
e... | [
"Wrap",
"a",
"{",
"@link",
"CheckedDoubleToLongFunction",
"}",
"in",
"a",
"{",
"@link",
"DoubleToLongFunction",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"DoubleStream",
... | 889d87c85ca57bafd4eddd78e0f7ae2804d2ee86 | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1451-L1462 | train | Double to long function. | Of course, here is the Java code you requested:
```java
public static DoubleToLongFunction doubleToLongFunction(CheckedDoubleToLongFunction function, Consumer<Throwable> handler) {
return t -> {
try {
return function.applyAsLong(t);
}
catch (Throwable e) {
... |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.get | public static Searcher get(String variant) {
final Searcher searcher = instances.get(variant);
if (searcher == null) {
throw new IllegalStateException(Errors.SEARCHER_GET_BEFORE_CREATE);
}
return searcher;
} | java | public static Searcher get(String variant) {
final Searcher searcher = instances.get(variant);
if (searcher == null) {
throw new IllegalStateException(Errors.SEARCHER_GET_BEFORE_CREATE);
}
return searcher;
} | [
"public",
"static",
"Searcher",
"get",
"(",
"String",
"variant",
")",
"{",
"final",
"Searcher",
"searcher",
"=",
"instances",
".",
"get",
"(",
"variant",
")",
";",
"if",
"(",
"searcher",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",... | Gets the Searcher for a given variant.
@param variant an identifier to differentiate this Searcher from eventual others.
@return the corresponding Searcher instance.
@throws IllegalStateException if no searcher was {@link #create(Searchable) created} before for this {@code variant}. | [
"Gets",
"the",
"Searcher",
"for",
"a",
"given",
"variant",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L166-L172 | train | Get a Searcher for the specified variant. | Of course, here is the Java code you requested:
```java
public static Searcher get(String variant) {
final Searcher searcher = instances.get(variant);
if (searcher == null) {
throw new IllegalStateException(Errors.SEARCHER_GET_BEFORE_CREATE);
}
return searcher;
}
```
Ho... |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc4/impl/IfcRecurrencePatternImpl.java | IfcRecurrencePatternImpl.getTimePeriods | @SuppressWarnings("unchecked")
@Override
public EList<IfcTimePeriod> getTimePeriods() {
return (EList<IfcTimePeriod>) eGet(Ifc4Package.Literals.IFC_RECURRENCE_PATTERN__TIME_PERIODS, true);
} | java | @SuppressWarnings("unchecked")
@Override
public EList<IfcTimePeriod> getTimePeriods() {
return (EList<IfcTimePeriod>) eGet(Ifc4Package.Literals.IFC_RECURRENCE_PATTERN__TIME_PERIODS, true);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"EList",
"<",
"IfcTimePeriod",
">",
"getTimePeriods",
"(",
")",
"{",
"return",
"(",
"EList",
"<",
"IfcTimePeriod",
">",
")",
"eGet",
"(",
"Ifc4Package",
".",
"Literals",
".",
"IFC... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/IfcRecurrencePatternImpl.java#L332-L336 | train | Gets the list of time periods in this RecurringPattern. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override
public EList<IfcTimePeriod> getTimePeriods() {
return (EList<IfcTimePeriod>) eGet(Ifc4Package.Literals.IFC_RECURRENCE_PATTERN__TIME_PERIODS, true);
}
```
Hope this helps! |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java | JspRuntimeContext.threadStart | protected void threadStart() {
// Has the background thread already been started?
if (thread != null) {
return;
}
// Start the background thread
threadDone = false;
thread = new Thread(this, threadName);
thread.setDaemon(true);
thread.start()... | java | protected void threadStart() {
// Has the background thread already been started?
if (thread != null) {
return;
}
// Start the background thread
threadDone = false;
thread = new Thread(this, threadName);
thread.setDaemon(true);
thread.start()... | [
"protected",
"void",
"threadStart",
"(",
")",
"{",
"// Has the background thread already been started?",
"if",
"(",
"thread",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"// Start the background thread",
"threadDone",
"=",
"false",
";",
"thread",
"=",
"new",
"Thread... | Start the background thread that will periodically check for
changes to compile time included files in a JSP.
@exception IllegalStateException if we should not be starting
a background thread now | [
"Start",
"the",
"background",
"thread",
"that",
"will",
"periodically",
"check",
"for",
"changes",
"to",
"compile",
"time",
"included",
"files",
"in",
"a",
"JSP",
"."
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspRuntimeContext.java#L628-L641 | test | Start the background thread. | Of course, here is the Java code you requested:
```java
protected void threadStart() {
// Has the background thread already been started?
if (thread != null) {
return;
}
// Start the background thread
threadDone = false;
thread = new Thread(this, threadName... |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java | LanguageServiceClient.analyzeEntitySentiment | public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
Document document, EncodingType encodingType) {
AnalyzeEntitySentimentRequest request =
AnalyzeEntitySentimentRequest.newBuilder()
.setDocument(document)
.setEncodingType(encodingType)
.build();
... | java | public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
Document document, EncodingType encodingType) {
AnalyzeEntitySentimentRequest request =
AnalyzeEntitySentimentRequest.newBuilder()
.setDocument(document)
.setEncodingType(encodingType)
.build();
... | [
"public",
"final",
"AnalyzeEntitySentimentResponse",
"analyzeEntitySentiment",
"(",
"Document",
"document",
",",
"EncodingType",
"encodingType",
")",
"{",
"AnalyzeEntitySentimentRequest",
"request",
"=",
"AnalyzeEntitySentimentRequest",
".",
"newBuilder",
"(",
")",
".",
"se... | Finds entities, similar to
[AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text
and analyzes sentiment associated with each entity and its mentions.
<p>Sample code:
<pre><code>
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
Document documen... | [
"Finds",
"entities",
"similar",
"to",
"[",
"AnalyzeEntities",
"]",
"[",
"google",
".",
"cloud",
".",
"language",
".",
"v1beta2",
".",
"LanguageService",
".",
"AnalyzeEntities",
"]",
"in",
"the",
"text",
"and",
"analyzes",
"sentiment",
"associated",
"with",
"ea... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java#L316-L325 | train | Analyze an entity sentiment document. | Of course, here is the Java code you requested:
```java
public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
Document document, EncodingType encodingType) {
AnalyzeEntitySentimentRequest request =
AnalyzeEntitySentimentRequest.newBuilder()
.setDocument(document)
... |
robeio/robe | robe-admin/src/main/java/io/robe/admin/resources/UserResource.java | UserResource.merge | @RobeService(group = "User", description = "Updates a single User matches with the given id.")
@PATCH
@UnitOfWork
@Path("{id}")
public User merge(@RobeAuth Credentials credentials, @PathParam("id") String id, User model) {
if (!id.equals(model.getOid()))
throw new WebApplicationExcep... | java | @RobeService(group = "User", description = "Updates a single User matches with the given id.")
@PATCH
@UnitOfWork
@Path("{id}")
public User merge(@RobeAuth Credentials credentials, @PathParam("id") String id, User model) {
if (!id.equals(model.getOid()))
throw new WebApplicationExcep... | [
"@",
"RobeService",
"(",
"group",
"=",
"\"User\"",
",",
"description",
"=",
"\"Updates a single User matches with the given id.\"",
")",
"@",
"PATCH",
"@",
"UnitOfWork",
"@",
"Path",
"(",
"\"{id}\"",
")",
"public",
"User",
"merge",
"(",
"@",
"RobeAuth",
"Credentia... | Updates a single {@link User} matches with the given id.
<p>
Status Code:
Not Found 404
Not Matches 412
@param credentials injected by {@link RobeAuth} annotation for authentication.
@param id This is the oid of {@link User}
@param model data of {@link User}
@return Updates a single {@link User} matche... | [
"Updates",
"a",
"single",
"{",
"@link",
"User",
"}",
"matches",
"with",
"the",
"given",
"id",
".",
"<p",
">",
"Status",
"Code",
":",
"Not",
"Found",
"404",
"Not",
"Matches",
"412"
] | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-admin/src/main/java/io/robe/admin/resources/UserResource.java#L128-L141 | test | Updates a single User in the database. | Of course, here is the Java code you requested:
```java
@RobeService(group = "User", description = "Updates a single User matches with the given id.")
@PATCH
@UnitOfWork
@Path("{id}")
public User merge(@RobeAuth Credentials credentials, @PathParam("id") String id, User model) {
if (!id.equals(m... |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/UDPConnLink.java | UDPConnLink.getLocalAddress | @Override
public InetAddress getLocalAddress() {
InetAddress address = null;
if (udpNetworkLayer != null) {
address = udpNetworkLayer.getDatagramSocket().getLocalAddress();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
if (address == null... | java | @Override
public InetAddress getLocalAddress() {
InetAddress address = null;
if (udpNetworkLayer != null) {
address = udpNetworkLayer.getDatagramSocket().getLocalAddress();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
if (address == null... | [
"@",
"Override",
"public",
"InetAddress",
"getLocalAddress",
"(",
")",
"{",
"InetAddress",
"address",
"=",
"null",
";",
"if",
"(",
"udpNetworkLayer",
"!=",
"null",
")",
"{",
"address",
"=",
"udpNetworkLayer",
".",
"getDatagramSocket",
"(",
")",
".",
"getLocalA... | /*
@see com.ibm.wsspi.udpchannel.UDPContext#getLocalAddress() | [
"/",
"*"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/UDPConnLink.java#L190-L207 | train | This method is used to get the local address of the local socket. | Of course, here is the Java code you requested:
```java
@Override
public InetAddress getLocalAddress() {
InetAddress address = null;
if (udpNetworkLayer != null) {
address = udpNetworkLayer.getDatagramSocket().getLocalAddress();
if (TraceComponent.isAnyTracingEnabled() && t... |
qiujuer/OkHttpPacker | okhttp/src/main/java/net/qiujuer/common/okhttp/cookie/PersistentCookieStore.java | PersistentCookieStore.encodeCookie | protected String encodeCookie(SerializableHttpCookie cookie) {
if (cookie == null)
return null;
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
ObjectOutputStream outputStream = new ObjectOutputStream(os);
outputStream.writeObject(cookie);
... | java | protected String encodeCookie(SerializableHttpCookie cookie) {
if (cookie == null)
return null;
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
ObjectOutputStream outputStream = new ObjectOutputStream(os);
outputStream.writeObject(cookie);
... | [
"protected",
"String",
"encodeCookie",
"(",
"SerializableHttpCookie",
"cookie",
")",
"{",
"if",
"(",
"cookie",
"==",
"null",
")",
"return",
"null",
";",
"ByteArrayOutputStream",
"os",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"ObjectOutputS... | Serializes Cookie object into String
@param cookie cookie to be encoded, can be null
@return cookie encoded as String | [
"Serializes",
"Cookie",
"object",
"into",
"String"
] | d2d484facb66b7e11e6cbbfeb78025f76ce25ebd | https://github.com/qiujuer/OkHttpPacker/blob/d2d484facb66b7e11e6cbbfeb78025f76ce25ebd/okhttp/src/main/java/net/qiujuer/common/okhttp/cookie/PersistentCookieStore.java#L177-L190 | train | Encode a SerializableHttpCookie object into a String. | Of course, here is the Java code you requested:
```java
protected String encodeCookie(SerializableHttpCookie cookie) {
if (cookie == null)
return null;
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
ObjectOutputStream outputStream = new ObjectOutputStream(... |
andrehertwig/admintool | admin-tools-core/src/main/java/de/chandre/admintool/core/utils/AdminToolMenuUtils.java | AdminToolMenuUtils.getMenuName | public String getMenuName(HttpServletRequest request, String overrideName) {
if (!StringUtils.isEmpty(overrideName)) {
return overrideName;
}
String name = request.getRequestURI().replaceFirst(AdminTool.ROOTCONTEXT, "");
if (!StringUtils.isEmpty(request.getContextPath())) {
name = name.replaceFirst(reques... | java | public String getMenuName(HttpServletRequest request, String overrideName) {
if (!StringUtils.isEmpty(overrideName)) {
return overrideName;
}
String name = request.getRequestURI().replaceFirst(AdminTool.ROOTCONTEXT, "");
if (!StringUtils.isEmpty(request.getContextPath())) {
name = name.replaceFirst(reques... | [
"public",
"String",
"getMenuName",
"(",
"HttpServletRequest",
"request",
",",
"String",
"overrideName",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"overrideName",
")",
")",
"{",
"return",
"overrideName",
";",
"}",
"String",
"name",
"=",
"r... | retuns the menu name for given requestUrl or the overrideName if set.
@param request
@param overrideName (optional)
@return | [
"retuns",
"the",
"menu",
"name",
"for",
"given",
"requestUrl",
"or",
"the",
"overrideName",
"if",
"set",
"."
] | 6d391e2d26969b70e3ccabfc34202abe8d915080 | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/utils/AdminToolMenuUtils.java#L77-L89 | train | Get the menu name from the request. | Of course, here is the Java code you requested:
```java
public String getMenuName(HttpServletRequest request, String overrideName) {
if (!StringUtils.isEmpty(overrideName)) {
return overrideName;
}
String name = request.getRequestURI().replaceFirst(AdminTool.ROOTCONTEXT, "");
if (!StringUtils.isEmpty(reques... |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/rendering/worker/PortletResourceExecutionWorker.java | PortletResourceExecutionWorker.callInternal | @Override
protected Long callInternal() throws Exception {
return portletRenderer.doServeResource(
portletWindowId, request, response, new ResourcePortletOutputHandler(response));
} | java | @Override
protected Long callInternal() throws Exception {
return portletRenderer.doServeResource(
portletWindowId, request, response, new ResourcePortletOutputHandler(response));
} | [
"@",
"Override",
"protected",
"Long",
"callInternal",
"(",
")",
"throws",
"Exception",
"{",
"return",
"portletRenderer",
".",
"doServeResource",
"(",
"portletWindowId",
",",
"request",
",",
"response",
",",
"new",
"ResourcePortletOutputHandler",
"(",
"response",
")"... | /* (non-Javadoc)
@see org.apereo.portal.portlet.rendering.PortletExecutionManager.PortletExecutionWorker#callInternal() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/rendering/worker/PortletResourceExecutionWorker.java#L59-L63 | train | Override internal method to call the base implementation of the method. | Of course, here is the Java code you requested:
```java
@Override
protected Long callInternal() throws Exception {
return portletRenderer.doServeResource(
portletWindowId, request, response, new ResourcePortletOutputHandler(response));
}
```
Hope this helps! |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/JobScheduleGetOptions.java | JobScheduleGetOptions.withIfUnmodifiedSince | public JobScheduleGetOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) {
if (ifUnmodifiedSince == null) {
this.ifUnmodifiedSince = null;
} else {
this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince);
}
return this;
} | java | public JobScheduleGetOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) {
if (ifUnmodifiedSince == null) {
this.ifUnmodifiedSince = null;
} else {
this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince);
}
return this;
} | [
"public",
"JobScheduleGetOptions",
"withIfUnmodifiedSince",
"(",
"DateTime",
"ifUnmodifiedSince",
")",
"{",
"if",
"(",
"ifUnmodifiedSince",
"==",
"null",
")",
"{",
"this",
".",
"ifUnmodifiedSince",
"=",
"null",
";",
"}",
"else",
"{",
"this",
".",
"ifUnmodifiedSinc... | Set a timestamp indicating the last modified time of the resource known to the client. The operation will be performed only if the resource on the service has not been modified since the specified time.
@param ifUnmodifiedSince the ifUnmodifiedSince value to set
@return the JobScheduleGetOptions object itself. | [
"Set",
"a",
"timestamp",
"indicating",
"the",
"last",
"modified",
"time",
"of",
"the",
"resource",
"known",
"to",
"the",
"client",
".",
"The",
"operation",
"will",
"be",
"performed",
"only",
"if",
"the",
"resource",
"on",
"the",
"service",
"has",
"not",
"b... | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/models/JobScheduleGetOptions.java#L301-L308 | train | Sets the ifUnmodifiedSince value. | Of course, here is the Java code you requested:
```java
public JobScheduleGetOptions withIfUnmodifiedSince(DateTime ifUnmodifiedSince) {
if (ifUnmodifiedSince == null) {
this.ifUnmodifiedSince = null;
} else {
this.ifUnmodifiedSince = new DateTimeRfc1123(ifUnmodifiedSince);
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/TableConfigurerImpl.java | TableConfigurerImpl.matchAxisTypeAndDimension | protected String matchAxisTypeAndDimension(NetcdfDataset ds, AxisType type, final Dimension outer, final Dimension inner) {
Variable var = CoordSysEvaluator.findCoordByType(ds, type, new CoordSysEvaluator.Predicate() {
@Override
public boolean match(CoordinateAxis axis) {
return ((axis.getRa... | java | protected String matchAxisTypeAndDimension(NetcdfDataset ds, AxisType type, final Dimension outer, final Dimension inner) {
Variable var = CoordSysEvaluator.findCoordByType(ds, type, new CoordSysEvaluator.Predicate() {
@Override
public boolean match(CoordinateAxis axis) {
return ((axis.getRa... | [
"protected",
"String",
"matchAxisTypeAndDimension",
"(",
"NetcdfDataset",
"ds",
",",
"AxisType",
"type",
",",
"final",
"Dimension",
"outer",
",",
"final",
"Dimension",
"inner",
")",
"{",
"Variable",
"var",
"=",
"CoordSysEvaluator",
".",
"findCoordByType",
"(",
"ds... | /* protected Variable findVariableWithStandardNameAndNotDimension(NetcdfDataset ds, String standard_name, Dimension outer, Formatter errlog) {
for (Variable v : ds.getVariables()) {
String stdName = ds.findAttValueIgnoreCase(v, CF.STANDARD_NAME, null);
if ((stdName != null) && stdName.equals(standard_name) && v.getRank... | [
"/",
"*",
"protected",
"Variable",
"findVariableWithStandardNameAndNotDimension",
"(",
"NetcdfDataset",
"ds",
"String",
"standard_name",
"Dimension",
"outer",
"Formatter",
"errlog",
")",
"{",
"for",
"(",
"Variable",
"v",
":",
"ds",
".",
"getVariables",
"()",
")",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/TableConfigurerImpl.java#L68-L77 | test | Returns the name of the first coordinate axis with the specified type and dimension. | Of course, here is the Java code you requested:
```java
protected String matchAxisTypeAndDimension(NetcdfDataset ds, AxisType type, final Dimension outer, final Dimension inner) {
Variable var = CoordSysEvaluator.findCoordByType(ds, type, new CoordSysEvaluator.Predicate() {
@Override
public boolean ... |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java | Ifc2x3tc1FactoryImpl.createIfcLampTypeEnumFromString | public IfcLampTypeEnum createIfcLampTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcLampTypeEnum result = IfcLampTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() +... | java | public IfcLampTypeEnum createIfcLampTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcLampTypeEnum result = IfcLampTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() +... | [
"public",
"IfcLampTypeEnum",
"createIfcLampTypeEnumFromString",
"(",
"EDataType",
"eDataType",
",",
"String",
"initialValue",
")",
"{",
"IfcLampTypeEnum",
"result",
"=",
"IfcLampTypeEnum",
".",
"get",
"(",
"initialValue",
")",
";",
"if",
"(",
"result",
"==",
"null",... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1FactoryImpl.java#L11866-L11872 | train | Create an IfcLampTypeEnum from a String value. | Of course, here is the Java code you requested:
```java
public IfcLampTypeEnum createIfcLampTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcLampTypeEnum result = IfcLampTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "... |
twitter/hbc | hbc-core/src/main/java/com/twitter/hbc/core/endpoint/UserstreamEndpoint.java | UserstreamEndpoint.withFollowings | public void withFollowings(boolean followings) {
if (followings) {
addQueryParameter(Constants.WITH_PARAM, Constants.WITH_FOLLOWINGS);
} else {
removeQueryParameter(Constants.WITH_PARAM);
}
} | java | public void withFollowings(boolean followings) {
if (followings) {
addQueryParameter(Constants.WITH_PARAM, Constants.WITH_FOLLOWINGS);
} else {
removeQueryParameter(Constants.WITH_PARAM);
}
} | [
"public",
"void",
"withFollowings",
"(",
"boolean",
"followings",
")",
"{",
"if",
"(",
"followings",
")",
"{",
"addQueryParameter",
"(",
"Constants",
".",
"WITH_PARAM",
",",
"Constants",
".",
"WITH_FOLLOWINGS",
")",
";",
"}",
"else",
"{",
"removeQueryParameter",... | Corresponds to setting `with=followings` when true.
See https://dev.twitter.com/docs/streaming-apis/parameters#with | [
"Corresponds",
"to",
"setting",
"with",
"=",
"followings",
"when",
"true",
".",
"See",
"https",
":",
"//",
"dev",
".",
"twitter",
".",
"com",
"/",
"docs",
"/",
"streaming",
"-",
"apis",
"/",
"parameters#with"
] | 72a8d0b44ba824a722cf4ee7ed9f9bc34d02d92c | https://github.com/twitter/hbc/blob/72a8d0b44ba824a722cf4ee7ed9f9bc34d02d92c/hbc-core/src/main/java/com/twitter/hbc/core/endpoint/UserstreamEndpoint.java#L35-L41 | train | Add followings to the query parameter. | Of course, here is the Java code you requested:
```java
public void withFollowings(boolean followings) {
if (followings) {
addQueryParameter(Constants.WITH_PARAM, Constants.WITH_FOLLOWINGS);
} else {
removeQueryParameter(Constants.WITH_PARAM);
}
}
```
Hope this helps! |
hellojavaer/ddal | ddal-ddr/src/main/java/org/hellojavaer/ddal/ddr/datasource/jdbc/DDRStatementImpl.java | DDRStatementImpl.setMaxFieldSize | @Override
public void setMaxFieldSize(int max) throws SQLException {
if (statement != null) {
statement.setMaxFieldSize(max);
} else {
tag.setMaxFieldSize(true);
prop.setMaxFieldSize(max);
}
} | java | @Override
public void setMaxFieldSize(int max) throws SQLException {
if (statement != null) {
statement.setMaxFieldSize(max);
} else {
tag.setMaxFieldSize(true);
prop.setMaxFieldSize(max);
}
} | [
"@",
"Override",
"public",
"void",
"setMaxFieldSize",
"(",
"int",
"max",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"statement",
"!=",
"null",
")",
"{",
"statement",
".",
"setMaxFieldSize",
"(",
"max",
")",
";",
"}",
"else",
"{",
"tag",
".",
"setMaxF... | 未初始化前可以调用的方法 | [
"未初始化前可以调用的方法"
] | 876dc32ece8bb983df64e94bdcc9045f0ee5cc3b | https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-ddr/src/main/java/org/hellojavaer/ddal/ddr/datasource/jdbc/DDRStatementImpl.java#L359-L367 | train | Sets the maximum field size for a single SELECTION. | Of course, here is the Java code you requested:
```java
@Override
public void setMaxFieldSize(int max) throws SQLException {
if (statement != null) {
statement.setMaxFieldSize(max);
} else {
tag.setMaxFieldSize(true);
prop.setMaxFieldSize(max);
}
}
``... |
paypal/SeLion | server/src/main/java/com/paypal/selion/node/servlets/LogServlet.java | LogServlet.process | protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
throws IOException {
// TODO put this html code in a template
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
response.setStatus(200);
FileB... | java | protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
throws IOException {
// TODO put this html code in a template
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
response.setStatus(200);
FileB... | [
"protected",
"void",
"process",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"// TODO put this html code in a template",
"response",
".",
"setContentType",
"(",
"\"text/html\"",
... | This method display the log file content
@param request
HttpServletRequest
@param response
HttpServletResponse
@param fileName
To display the log file content in the web page.
@throws IOException | [
"This",
"method",
"display",
"the",
"log",
"file",
"content"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/node/servlets/LogServlet.java#L149-L173 | train | Process the request. | Of course, here is the Java code you requested:
```java
protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
throws IOException {
// TODO put this html code in a template
response.setContentType("text/html");
response.setCharacterEncoding... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java | Parser.parseAttributeValue | private String parseAttributeValue(String watch) throws JasperException {
Mark start = reader.mark();
Mark stop = reader.skipUntilIgnoreEsc(watch);
if (stop == null) {
err.jspError(start, "jsp.error.attribute.unterminated", watch);
}
String ret = parseQuoted(reader.getText(start, stop));
if (watch.length() ... | java | private String parseAttributeValue(String watch) throws JasperException {
Mark start = reader.mark();
Mark stop = reader.skipUntilIgnoreEsc(watch);
if (stop == null) {
err.jspError(start, "jsp.error.attribute.unterminated", watch);
}
String ret = parseQuoted(reader.getText(start, stop));
if (watch.length() ... | [
"private",
"String",
"parseAttributeValue",
"(",
"String",
"watch",
")",
"throws",
"JasperException",
"{",
"Mark",
"start",
"=",
"reader",
".",
"mark",
"(",
")",
";",
"Mark",
"stop",
"=",
"reader",
".",
"skipUntilIgnoreEsc",
"(",
"watch",
")",
";",
"if",
"... | AttributeValueDouble ::= (QuotedChar - '"')*
('"' | <TRANSLATION_ERROR>)
RTAttributeValueDouble ::= ((QuotedChar - '"')* - ((QuotedChar-'"')'%>"')
('%>"' | TRANSLATION_ERROR) | [
"AttributeValueDouble",
"::",
"=",
"(",
"QuotedChar",
"-",
")",
"*",
"(",
"|",
"<TRANSLATION_ERROR",
">",
")",
"RTAttributeValueDouble",
"::",
"=",
"((",
"QuotedChar",
"-",
")",
"*",
"-",
"((",
"QuotedChar",
"-",
")",
"%",
">",
")",
"(",
"%",
">",
"|",... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java#L297-L311 | test | Parse an attribute value. | Of course, here is the Java code you requested:
```java
private String parseAttributeValue(String watch) throws JasperException {
Mark start = reader.mark();
Mark stop = reader.skipUntilIgnoreEsc(watch);
if (stop == null) {
err.jspError(start, "jsp.error.attribute.unterminated", watch);
}
String ret = parse... |
Hygieia/Hygieia | api-audit/src/main/java/com/capitalone/dashboard/evaluator/CodeQualityEvaluator.java | CodeQualityEvaluator.auditStatusWhenQualityGateDetailsFound | private void auditStatusWhenQualityGateDetailsFound(Map condition, CodeQualityAuditResponse codeQualityAuditResponse) {
if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.BLOCKER_VIOLATIONS.getType())) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAudit... | java | private void auditStatusWhenQualityGateDetailsFound(Map condition, CodeQualityAuditResponse codeQualityAuditResponse) {
if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.BLOCKER_VIOLATIONS.getType())) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAudit... | [
"private",
"void",
"auditStatusWhenQualityGateDetailsFound",
"(",
"Map",
"condition",
",",
"CodeQualityAuditResponse",
"codeQualityAuditResponse",
")",
"{",
"if",
"(",
"StringUtils",
".",
"equalsIgnoreCase",
"(",
"condition",
".",
"get",
"(",
"\"metric\"",
")",
".",
"... | Sets audit status when code quality gate details are found. Sonar 6.7 style data.
@param condition
@param codeQualityAuditResponse | [
"Sets",
"audit",
"status",
"when",
"code",
"quality",
"gate",
"details",
"are",
"found",
".",
"Sonar",
"6",
".",
"7",
"style",
"data",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api-audit/src/main/java/com/capitalone/dashboard/evaluator/CodeQualityEvaluator.java#L223-L246 | train | Audit status when quality gate details found. | Of course, here is the Java code you requested:
```java
private void auditStatusWhenQualityGateDetailsFound(Map condition, CodeQualityAuditResponse codeQualityAuditResponse) {
if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.BLOCKER_VIOLATIONS.getType())) {
... |
qubole/qds-sdk-java | src/main/java/com/qubole/qds/sdk/java/client/ResultLatch.java | ResultLatch.callback | public void callback(final Callback callback)
{
Runnable runnable = new Runnable()
{
@Override
public void run()
{
try
{
callback.result(queryId, awaitResult());
}
catch (Exception... | java | public void callback(final Callback callback)
{
Runnable runnable = new Runnable()
{
@Override
public void run()
{
try
{
callback.result(queryId, awaitResult());
}
catch (Exception... | [
"public",
"void",
"callback",
"(",
"final",
"Callback",
"callback",
")",
"{",
"Runnable",
"runnable",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"callback",
".",
"result",
"(",
"queryId",
... | This method returns immediately and polls asynchronously for the result.
When the result is retrieved (or there is an error) the callback is called
@param callback callback | [
"This",
"method",
"returns",
"immediately",
"and",
"polls",
"asynchronously",
"for",
"the",
"result",
".",
"When",
"the",
"result",
"is",
"retrieved",
"(",
"or",
"there",
"is",
"an",
"error",
")",
"the",
"callback",
"is",
"called"
] | c652374075c7b72071f73db960f5f3a43f922afd | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/src/main/java/com/qubole/qds/sdk/java/client/ResultLatch.java#L118-L136 | train | Await result and callback for a single appid | Of course, here is the Java code you requested:
```java
public void callback(final Callback callback)
{
Runnable runnable = new Runnable()
{
@Override
public void run()
{
try
{
callback.result(queryId, awaitResu... |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/base/CommerceCurrencyLocalServiceBaseImpl.java | CommerceCurrencyLocalServiceBaseImpl.getCommerceCurrenciesByUuidAndCompanyId | @Override
public List<CommerceCurrency> getCommerceCurrenciesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CommerceCurrency> orderByComparator) {
return commerceCurrencyPersistence.findByUuid_C(uuid, companyId, start,
end, orderByComparator);
} | java | @Override
public List<CommerceCurrency> getCommerceCurrenciesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CommerceCurrency> orderByComparator) {
return commerceCurrencyPersistence.findByUuid_C(uuid, companyId, start,
end, orderByComparator);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceCurrency",
">",
"getCommerceCurrenciesByUuidAndCompanyId",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceCurrency",
">",
"orderByCompa... | Returns a range of commerce currencies matching the UUID and company.
@param uuid the UUID of the commerce currencies
@param companyId the primary key of the company
@param start the lower bound of the range of commerce currencies
@param end the upper bound of the range of commerce currencies (not inclusive)
@param or... | [
"Returns",
"a",
"range",
"of",
"commerce",
"currencies",
"matching",
"the",
"UUID",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/base/CommerceCurrencyLocalServiceBaseImpl.java#L380-L386 | train | Returns a range of commerce currencies matching the UUID and company. | Of course, here is the Java code you requested:
```java
@Override
public List<CommerceCurrency> getCommerceCurrenciesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CommerceCurrency> orderByComparator) {
return commerceCurrencyPersistence.findByUuid_C(uuid, companyId, star... |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withLoaderWriter | public CacheConfigurationBuilder<K, V> withLoaderWriter(Class<CacheLoaderWriter<K, V>> loaderWriterClass, Object... arguments) {
return addOrReplaceConfiguration(new DefaultCacheLoaderWriterConfiguration(requireNonNull(loaderWriterClass, "Null loaderWriterClass"), arguments));
} | java | public CacheConfigurationBuilder<K, V> withLoaderWriter(Class<CacheLoaderWriter<K, V>> loaderWriterClass, Object... arguments) {
return addOrReplaceConfiguration(new DefaultCacheLoaderWriterConfiguration(requireNonNull(loaderWriterClass, "Null loaderWriterClass"), arguments));
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withLoaderWriter",
"(",
"Class",
"<",
"CacheLoaderWriter",
"<",
"K",
",",
"V",
">",
">",
"loaderWriterClass",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"addOrReplaceConfiguration",
"("... | Adds a {@link CacheLoaderWriter} configured through a class and optional constructor arguments to the configured
builder.
<p>
Configuration of a {@link CacheLoaderWriter} is what enables cache-through patterns.
@param loaderWriterClass the loaderwrite class
@param arguments optional constructor arguments
@return a new... | [
"Adds",
"a",
"{",
"@link",
"CacheLoaderWriter",
"}",
"configured",
"through",
"a",
"class",
"and",
"optional",
"constructor",
"arguments",
"to",
"the",
"configured",
"builder",
".",
"<p",
">",
"Configuration",
"of",
"a",
"{",
"@link",
"CacheLoaderWriter",
"}",
... | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L351-L353 | train | Add a loader writer configuration. | Of course, here is the Java code you requested:
```java
public CacheConfigurationBuilder<K, V> withLoaderWriter(Class<CacheLoaderWriter<K, V>> loaderWriterClass, Object... arguments) {
return addOrReplaceConfiguration(new DefaultCacheLoaderWriterConfiguration(requireNonNull(loaderWriterClass, "Null loaderWriterCla... |
liferay/com-liferay-commerce | commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRateAddressRelPersistenceImpl.java | CommerceTaxFixedRateAddressRelPersistenceImpl.cacheResult | @Override
public void cacheResult(
CommerceTaxFixedRateAddressRel commerceTaxFixedRateAddressRel) {
entityCache.putResult(CommerceTaxFixedRateAddressRelModelImpl.ENTITY_CACHE_ENABLED,
CommerceTaxFixedRateAddressRelImpl.class,
commerceTaxFixedRateAddressRel.getPrimaryKey(),
commerceTaxFixedRateAddressRel);... | java | @Override
public void cacheResult(
CommerceTaxFixedRateAddressRel commerceTaxFixedRateAddressRel) {
entityCache.putResult(CommerceTaxFixedRateAddressRelModelImpl.ENTITY_CACHE_ENABLED,
CommerceTaxFixedRateAddressRelImpl.class,
commerceTaxFixedRateAddressRel.getPrimaryKey(),
commerceTaxFixedRateAddressRel);... | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CommerceTaxFixedRateAddressRel",
"commerceTaxFixedRateAddressRel",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CommerceTaxFixedRateAddressRelModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceTaxFixedRateAddressRelI... | Caches the commerce tax fixed rate address rel in the entity cache if it is enabled.
@param commerceTaxFixedRateAddressRel the commerce tax fixed rate address rel | [
"Caches",
"the",
"commerce",
"tax",
"fixed",
"rate",
"address",
"rel",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-engine-fixed-service/src/main/java/com/liferay/commerce/tax/engine/fixed/service/persistence/impl/CommerceTaxFixedRateAddressRelPersistenceImpl.java#L1183-L1192 | train | Caches the commerce tax fixed rate address rel in the entity cache if it is enabled. | Of course, here is the Java code you requested:
```java
@Override
public void cacheResult(
CommerceTaxFixedRateAddressRel commerceTaxFixedRateAddressRel) {
entityCache.putResult(CommerceTaxFixedRateAddressRelModelImpl.ENTITY_CACHE_ENABLED,
CommerceTaxFixedRateAddressRelImpl.class,
commerceTaxFixedRateAddres... |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastNDay | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... | java | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... | [
"public",
"static",
"Date",
"getLastNDay",
"(",
"Date",
"d",
",",
"int",
"n",
",",
"int",
"unitType",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"("... | Get date with n unitType before
@param d date
@param n number of units
@param unitType unit type : one of Calendar.DAY_OF_YEAR, Calendar.WEEK_OF_YEAR, Calendar.MONTH, Calendar.YEAR;
@return | [
"Get",
"date",
"with",
"n",
"unitType",
"before"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L755-L764 | train | Get the last n days of the date. | Of course, here is the Java code you requested:
```java
public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calend... |
aws/aws-sdk-java | aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/model/DescribeSecretResult.java | DescribeSecretResult.withVersionIdsToStages | public DescribeSecretResult withVersionIdsToStages(java.util.Map<String, java.util.List<String>> versionIdsToStages) {
setVersionIdsToStages(versionIdsToStages);
return this;
} | java | public DescribeSecretResult withVersionIdsToStages(java.util.Map<String, java.util.List<String>> versionIdsToStages) {
setVersionIdsToStages(versionIdsToStages);
return this;
} | [
"public",
"DescribeSecretResult",
"withVersionIdsToStages",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"versionIdsToStages",
")",
"{",
"setVersionIdsToStages",
"(",
"versionIdsToStages",
"... | <p>
A list of all of the currently assigned <code>VersionStage</code> staging labels and the <code>VersionId</code>
that each is attached to. Staging labels are used to keep track of the different versions during the rotation
process.
</p>
<note>
<p>
A version that does not have any staging labels attached is considere... | [
"<p",
">",
"A",
"list",
"of",
"all",
"of",
"the",
"currently",
"assigned",
"<code",
">",
"VersionStage<",
"/",
"code",
">",
"staging",
"labels",
"and",
"the",
"<code",
">",
"VersionId<",
"/",
"code",
">",
"that",
"each",
"is",
"attached",
"to",
".",
"S... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/model/DescribeSecretResult.java#L827-L830 | train | A map of version IDs to stages. | Of course, here is the Java code you requested:
```java
public DescribeSecretResult withVersionIdsToStages(java.util.Map<String, java.util.List<String>> versionIdsToStages) {
setVersionIdsToStages(versionIdsToStages);
return this;
}
```
Hope this helps! |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.assignRoleToUser | public Boolean assignRoleToUser(long id, List<Long> roleIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder ur... | java | public Boolean assignRoleToUser(long id, List<Long> roleIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder ur... | [
"public",
"Boolean",
"assignRoleToUser",
"(",
"long",
"id",
",",
"List",
"<",
"Long",
">",
"roleIds",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",... | Assigns Role to User
@param id
Id of the user to be modified
@param roleIds
Set to an array of one or more role IDs.
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the Onelogin... | [
"Assigns",
"Role",
"to",
"User"
] | 1570b78033dcc1c7387099e77fe41b6b0638df8c | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1075-L1105 | train | Assigns a list of roles to a user. | Of course, here is the Java code you requested:
```java
public Boolean assignRoleToUser(long id, List<Long> roleIds) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oA... |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putCharLittleEndian | public final void putCharLittleEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, value);
} else {
putChar(index, Character.reverseBytes(value));
}
} | java | public final void putCharLittleEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, value);
} else {
putChar(index, Character.reverseBytes(value));
}
} | [
"public",
"final",
"void",
"putCharLittleEndian",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putChar",
"(",
"index",
",",
"value",
")",
";",
"}",
"else",
"{",
"putChar",
"(",
"index",
",",
"Character",
"... | Writes the given character (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putChar(int, char)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffice... | [
"Writes",
"the",
"given",
"character",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"little",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L515-L521 | train | Puts a char value into the buffer at the given index in little - endian order. | Of course, here is the Java code you requested:
```java
public final void putCharLittleEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, value);
} else {
putChar(index, Character.reverseBytes(value));
}
}
```
Hope this helps! |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/Base64.java | Base64.decode | public static byte[] decode(InputStream in) {
try {
return IOUtils.toByteArray(decodeToStream(in));
} catch (IOException e) {
e.printStackTrace();
return null;
}
} | java | public static byte[] decode(InputStream in) {
try {
return IOUtils.toByteArray(decodeToStream(in));
} catch (IOException e) {
e.printStackTrace();
return null;
}
} | [
"public",
"static",
"byte",
"[",
"]",
"decode",
"(",
"InputStream",
"in",
")",
"{",
"try",
"{",
"return",
"IOUtils",
".",
"toByteArray",
"(",
"decodeToStream",
"(",
"in",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"e",
".",
"prin... | Decode an input stream of b64-encoded data to an array of bytes.
@param in
@return the decoded bytes, or null if there was an error reading the bytes | [
"Decode",
"an",
"input",
"stream",
"of",
"b64",
"-",
"encoded",
"data",
"to",
"an",
"array",
"of",
"bytes",
"."
] | 37df51b9b857fd12c6ab8269820d406c3c4ad774 | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/Base64.java#L119-L126 | train | Decode a byte array from an input stream. | Of course, here is the Java code you requested:
```java
public static byte[] decode(InputStream in) {
try {
return IOUtils.toByteArray(decodeToStream(in));
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
```
Hope this helps! |
janus-project/guava.janusproject.io | guava/src/com/google/common/base/Equivalence.java | Equivalence.equivalentTo | @Beta
public final Predicate<T> equivalentTo(@Nullable T target) {
return new EquivalentToPredicate<T>(this, target);
} | java | @Beta
public final Predicate<T> equivalentTo(@Nullable T target) {
return new EquivalentToPredicate<T>(this, target);
} | [
"@",
"Beta",
"public",
"final",
"Predicate",
"<",
"T",
">",
"equivalentTo",
"(",
"@",
"Nullable",
"T",
"target",
")",
"{",
"return",
"new",
"EquivalentToPredicate",
"<",
"T",
">",
"(",
"this",
",",
"target",
")",
";",
"}"
] | Returns a predicate that evaluates to true if and only if the input is
equivalent to {@code target} according to this equivalence relation.
@since 10.0 | [
"Returns",
"a",
"predicate",
"that",
"evaluates",
"to",
"true",
"if",
"and",
"only",
"if",
"the",
"input",
"is",
"equivalent",
"to",
"{",
"@code",
"target",
"}",
"according",
"to",
"this",
"equivalence",
"relation",
"."
] | 1c48fb672c9fdfddf276970570f703fa1115f588 | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/Equivalence.java#L253-L256 | train | Returns a predicate that returns true if the given target object is equivalent to this object. | Of course, here is the Java code you requested:
```java
@Beta
public final Predicate<T> equivalentTo(@Nullable T target) {
return new EquivalentToPredicate<T>(this, target);
}
```
Hope this helps! |
vvakame/JsonPullParser | jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java | AptUtil.getPackageName | public static String getPackageName(Elements elementUtils, Types typeUtils, TypeMirror type) {
TypeVisitor<DeclaredType, Object> tv = new SimpleTypeVisitor6<DeclaredType, Object>() {
@Override
public DeclaredType visitDeclared(DeclaredType t, Object p) {
return t;
}
};
DeclaredType dt = type.accept(... | java | public static String getPackageName(Elements elementUtils, Types typeUtils, TypeMirror type) {
TypeVisitor<DeclaredType, Object> tv = new SimpleTypeVisitor6<DeclaredType, Object>() {
@Override
public DeclaredType visitDeclared(DeclaredType t, Object p) {
return t;
}
};
DeclaredType dt = type.accept(... | [
"public",
"static",
"String",
"getPackageName",
"(",
"Elements",
"elementUtils",
",",
"Types",
"typeUtils",
",",
"TypeMirror",
"type",
")",
"{",
"TypeVisitor",
"<",
"DeclaredType",
",",
"Object",
">",
"tv",
"=",
"new",
"SimpleTypeVisitor6",
"<",
"DeclaredType",
... | Returns the package name of the given {@link TypeMirror}.
@param elementUtils
@param typeUtils
@param type
@return the package name
@author backpaper0
@author vvakame | [
"Returns",
"the",
"package",
"name",
"of",
"the",
"given",
"{"
] | fce183ca66354723323a77f2ae8cb5222b5836bc | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-apt/src/main/java/net/vvakame/apt/AptUtil.java#L200-L224 | train | Get the package name of a type. | Of course, here is the Java code you requested:
```java
public static String getPackageName(Elements elementUtils, Types typeUtils, TypeMirror type) {
TypeVisitor<DeclaredType, Object> tv = new SimpleTypeVisitor6<DeclaredType, Object>() {
@Override
public DeclaredType visitDeclared(DeclaredType t, Object p) {... |
meertensinstituut/mtas | src/main/java/mtas/codec/util/CodecCollector.java | CodecCollector.validateTermWithStartValue | private static boolean validateTermWithStartValue(BytesRef term,
ComponentTermVector termVector) {
if (termVector.startValue == null) {
return true;
} else if (termVector.subComponentFunction.sortType
.equals(CodecUtil.SORT_TERM)) {
if (term.length > termVector.startValue.length) {
... | java | private static boolean validateTermWithStartValue(BytesRef term,
ComponentTermVector termVector) {
if (termVector.startValue == null) {
return true;
} else if (termVector.subComponentFunction.sortType
.equals(CodecUtil.SORT_TERM)) {
if (term.length > termVector.startValue.length) {
... | [
"private",
"static",
"boolean",
"validateTermWithStartValue",
"(",
"BytesRef",
"term",
",",
"ComponentTermVector",
"termVector",
")",
"{",
"if",
"(",
"termVector",
".",
"startValue",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"termV... | Validate term with start value.
@param term
the term
@param termVector
the term vector
@return true, if successful | [
"Validate",
"term",
"with",
"start",
"value",
"."
] | f02ae730848616bd88b553efa7f9eddc32818e64 | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecCollector.java#L3630-L3661 | train | Validate the term with the start value. | Of course, here is the Java code you requested:
```java
private static boolean validateTermWithStartValue(BytesRef term,
ComponentTermVector termVector) {
if (termVector.startValue == null) {
return true;
} else if (termVector.subComponentFunction.sortType
.equals(CodecUtil.SORT_TERM)) {
... |
Netflix/ndbench | ndbench-cockroachdb-plugins/src/main/java/com/netflix/ndbench/plugin/cockroachdb/operations/CockroachDBPluginBase.java | CockroachDBPluginBase.getConnectionInfo | @Override
public String getConnectionInfo() throws Exception
{
Connection connection = ds.getConnection();
String info = String.format("Connected to database: %s using driver: %s as user :%s",
connection.getMetaData().getDatabaseProductName(),
... | java | @Override
public String getConnectionInfo() throws Exception
{
Connection connection = ds.getConnection();
String info = String.format("Connected to database: %s using driver: %s as user :%s",
connection.getMetaData().getDatabaseProductName(),
... | [
"@",
"Override",
"public",
"String",
"getConnectionInfo",
"(",
")",
"throws",
"Exception",
"{",
"Connection",
"connection",
"=",
"ds",
".",
"getConnection",
"(",
")",
";",
"String",
"info",
"=",
"String",
".",
"format",
"(",
"\"Connected to database: %s using driv... | Get connection info | [
"Get",
"connection",
"info"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-cockroachdb-plugins/src/main/java/com/netflix/ndbench/plugin/cockroachdb/operations/CockroachDBPluginBase.java#L100-L113 | train | Get connection info. | Of course, here is the Java code you requested:
```java
@Override
public String getConnectionInfo() throws Exception
{
Connection connection = ds.getConnection();
String info = String.format("Connected to database: %s using driver: %s as user :%s",
connection.getM... |
dkharrat/NexusDialog | nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FragmentActivityHelper.java | FragmentActivityHelper.getFormModelFragment | public static FormModelFragment getFormModelFragment(FragmentActivity enclosing) {
// find the retained fragment on activity restarts
FragmentManager fm = enclosing.getSupportFragmentManager();
FormModelFragment formModelFragment = (FormModelFragment) fm.findFragmentByTag(FormModelFragment.TAG);... | java | public static FormModelFragment getFormModelFragment(FragmentActivity enclosing) {
// find the retained fragment on activity restarts
FragmentManager fm = enclosing.getSupportFragmentManager();
FormModelFragment formModelFragment = (FormModelFragment) fm.findFragmentByTag(FormModelFragment.TAG);... | [
"public",
"static",
"FormModelFragment",
"getFormModelFragment",
"(",
"FragmentActivity",
"enclosing",
")",
"{",
"// find the retained fragment on activity restarts",
"FragmentManager",
"fm",
"=",
"enclosing",
".",
"getSupportFragmentManager",
"(",
")",
";",
"FormModelFragment"... | Returns a retained Fragment that stores the FormModel. The Fragment is associated with the specified <code>FragmentActivity</code>.
If the Fragment does not exist yet, an instance will be created and added to the <code>FragmentActivity</code>
@param enclosing the <code>FragmentActivity</code> that stores the Fragment | [
"Returns",
"a",
"retained",
"Fragment",
"that",
"stores",
"the",
"FormModel",
".",
"The",
"Fragment",
"is",
"associated",
"with",
"the",
"specified",
"<code",
">",
"FragmentActivity<",
"/",
"code",
">",
".",
"If",
"the",
"Fragment",
"does",
"not",
"exist",
"... | f43a6a07940cced12286c622140f3a8ae3d178a1 | https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/FragmentActivityHelper.java#L14-L27 | train | Get the FormModelFragment from the FragmentManager. | Of course, here is the Java code you requested:
```java
public static FormModelFragment getFormModelFragment(FragmentActivity enclosing) {
// find the retained fragment on activity restarts
FragmentManager fm = enclosing.getSupportFragmentManager();
FormModelFragment formModelFragment = (FormMo... |
morimekta/utils | io-util/src/main/java/net/morimekta/util/Strings.java | Strings.isConsolePrintable | public static boolean isConsolePrintable(int cp) {
return (cp >= 0x20 && cp < 0x7F) || // main printable ascii
Character.isDefined(cp) &&
!((cp < 0x0020 && cp != '\n') ||
(0x007F <= cp && cp < 0x00A0) ||
Character.isIdentifierIgnorable(cp) ||
... | java | public static boolean isConsolePrintable(int cp) {
return (cp >= 0x20 && cp < 0x7F) || // main printable ascii
Character.isDefined(cp) &&
!((cp < 0x0020 && cp != '\n') ||
(0x007F <= cp && cp < 0x00A0) ||
Character.isIdentifierIgnorable(cp) ||
... | [
"public",
"static",
"boolean",
"isConsolePrintable",
"(",
"int",
"cp",
")",
"{",
"return",
"(",
"cp",
">=",
"0x20",
"&&",
"cp",
"<",
"0x7F",
")",
"||",
"// main printable ascii",
"Character",
".",
"isDefined",
"(",
"cp",
")",
"&&",
"!",
"(",
"(",
"cp",
... | Utility to figure out if a character is printable to the console as
a character. Returns false if one of:
<ul>
<li>The character is a control character.
<li>The character is not defined.
<li>The character does not have a known representation.
</ul>
@param cp The character unicode code point.
@return If it is printable... | [
"Utility",
"to",
"figure",
"out",
"if",
"a",
"character",
"is",
"printable",
"to",
"the",
"console",
"as",
"a",
"character",
".",
"Returns",
"false",
"if",
"one",
"of",
":",
"<ul",
">",
"<li",
">",
"The",
"character",
"is",
"a",
"control",
"character",
... | dc987485902f1a7d58169c89c61db97425a6226d | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Strings.java#L142-L213 | train | Returns true if the given code point is a printable code point. | Of course, here is the Java code you requested:
```java
public static boolean isConsolePrintable(int cp) {
return (cp >= 0x20 && cp < 0x7F) || // main printable ascii
Character.isDefined(cp) &&
!((cp < 0x0020 && cp != '\n') ||
(0x007F <= cp && cp < 0x00A0) ||
... |
windup/windup | graph/api/src/main/java/org/jboss/windup/graph/service/ArchiveService.java | ArchiveService.getChildFile | public FileModel getChildFile(ArchiveModel archiveModel, String filePath)
{
filePath = FilenameUtils.separatorsToUnix(filePath);
StringTokenizer stk = new StringTokenizer(filePath, "/");
FileModel currentFileModel = archiveModel;
while (stk.hasMoreTokens() && currentFileModel != nul... | java | public FileModel getChildFile(ArchiveModel archiveModel, String filePath)
{
filePath = FilenameUtils.separatorsToUnix(filePath);
StringTokenizer stk = new StringTokenizer(filePath, "/");
FileModel currentFileModel = archiveModel;
while (stk.hasMoreTokens() && currentFileModel != nul... | [
"public",
"FileModel",
"getChildFile",
"(",
"ArchiveModel",
"archiveModel",
",",
"String",
"filePath",
")",
"{",
"filePath",
"=",
"FilenameUtils",
".",
"separatorsToUnix",
"(",
"filePath",
")",
";",
"StringTokenizer",
"stk",
"=",
"new",
"StringTokenizer",
"(",
"fi... | Finds the file at the provided path within the archive.
Eg, getChildFile(ArchiveModel, "/META-INF/MANIFEST.MF") will return a {@link FileModel} if a file named
/META-INF/MANIFEST.MF exists within the archive
@return Returns the located {@link FileModel} or null if no file with this path could be located | [
"Finds",
"the",
"file",
"at",
"the",
"provided",
"path",
"within",
"the",
"archive",
"."
] | 6668f09e7f012d24a0b4212ada8809417225b2ad | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/ArchiveService.java#L50-L63 | train | Get the FileModel for the given path. | Of course, here is the Java code you requested:
```java
public FileModel getChildFile(ArchiveModel archiveModel, String filePath)
{
filePath = FilenameUtils.separatorsToUnix(filePath);
StringTokenizer stk = new StringTokenizer(filePath, "/");
FileModel currentFileModel = archiveModel;
... |
eFaps/eFaps-Kernel | src/main/java/org/efaps/init/StartupDatabaseConnection.java | StartupDatabaseConnection.startup | public static void startup(final String _bootstrapPath,
final String _bootstrapFile)
throws StartupException
{
// evaluate bootstrap path
final File bsPath;
if (_bootstrapPath != null) {
bsPath = new File(_bootstrapPath);
} else {
... | java | public static void startup(final String _bootstrapPath,
final String _bootstrapFile)
throws StartupException
{
// evaluate bootstrap path
final File bsPath;
if (_bootstrapPath != null) {
bsPath = new File(_bootstrapPath);
} else {
... | [
"public",
"static",
"void",
"startup",
"(",
"final",
"String",
"_bootstrapPath",
",",
"final",
"String",
"_bootstrapFile",
")",
"throws",
"StartupException",
"{",
"// evaluate bootstrap path",
"final",
"File",
"bsPath",
";",
"if",
"(",
"_bootstrapPath",
"!=",
"null"... | <p>
Startups he kernel depending on a bootstrap definition.
</p>
<p>
Following rules applies for the bootstrap path:
<ul>
<li>if <code>_bootstrapPath</code> is not <code>null</code>, <code>_bootstrapPath</code> is used as bootstrap
path</li>
<li>if in the system environment the shell variable {@link #ENV_PATH} is defi... | [
"<p",
">",
"Startups",
"he",
"kernel",
"depending",
"on",
"a",
"bootstrap",
"definition",
".",
"<",
"/",
"p",
">"
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/init/StartupDatabaseConnection.java#L179-L237 | train | Startup method. | Of course, here is the Java code you requested:
```java
public static void startup(final String _bootstrapPath,
final String _bootstrapFile)
throws StartupException
{
// evaluate bootstrap path
final File bsPath;
if (_bootstrapPath != null) {
... |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.initializeBeamSearchChart | private void initializeBeamSearchChart(List<Object> terminals, BeamSearchCfgParseChart chart,
long[] treeEncodingOffsets) {
Variable terminalListValue = terminalVar.getOnlyVariable();
// Adding this to a tree key indicates that the tree is a terminal.
long terminalSignal = ((long) chart.chartSize()) ... | java | private void initializeBeamSearchChart(List<Object> terminals, BeamSearchCfgParseChart chart,
long[] treeEncodingOffsets) {
Variable terminalListValue = terminalVar.getOnlyVariable();
// Adding this to a tree key indicates that the tree is a terminal.
long terminalSignal = ((long) chart.chartSize()) ... | [
"private",
"void",
"initializeBeamSearchChart",
"(",
"List",
"<",
"Object",
">",
"terminals",
",",
"BeamSearchCfgParseChart",
"chart",
",",
"long",
"[",
"]",
"treeEncodingOffsets",
")",
"{",
"Variable",
"terminalListValue",
"=",
"terminalVar",
".",
"getOnlyVariable",
... | Initializes a beam search chart using the terminal production distribution.
@param terminals
@param chart | [
"Initializes",
"a",
"beam",
"search",
"chart",
"using",
"the",
"terminal",
"production",
"distribution",
"."
] | d27532ca83e212d51066cf28f52621acc3fd44cc | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L661-L687 | train | Initialize the BeamSearchCfgParseChart object. | Of course, here is the Java code you requested:
```java
private void initializeBeamSearchChart(List<Object> terminals, BeamSearchCfgParseChart chart,
long[] treeEncodingOffsets) {
Variable terminalListValue = terminalVar.getOnlyVariable();
// Adding this to a tree key indicates that the tree is a termin... |
aws/aws-sdk-java | aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/transform/AffectedEntityMarshaller.java | AffectedEntityMarshaller.marshall | public void marshall(AffectedEntity affectedEntity, ProtocolMarshaller protocolMarshaller) {
if (affectedEntity == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(affectedEntity.getEntityArn(), ENTITY... | java | public void marshall(AffectedEntity affectedEntity, ProtocolMarshaller protocolMarshaller) {
if (affectedEntity == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(affectedEntity.getEntityArn(), ENTITY... | [
"public",
"void",
"marshall",
"(",
"AffectedEntity",
"affectedEntity",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"affectedEntity",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\""... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/transform/AffectedEntityMarshaller.java#L58-L76 | train | marshalls the given affectedEntity to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(AffectedEntity affectedEntity, ProtocolMarshaller protocolMarshaller) {
if (affectedEntity == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocol... |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java | DistributedFileSystem.setPermission | public void setPermission(Path p, FsPermission permission
) throws IOException {
dfs.setPermission(getPathName(p), permission);
} | java | public void setPermission(Path p, FsPermission permission
) throws IOException {
dfs.setPermission(getPathName(p), permission);
} | [
"public",
"void",
"setPermission",
"(",
"Path",
"p",
",",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"dfs",
".",
"setPermission",
"(",
"getPathName",
"(",
"p",
")",
",",
"permission",
")",
";",
"}"
] | {@inheritDoc } | [
"{"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java#L844-L847 | train | Set the permission of a file. | Of course, here is the Java code you requested:
```java
public void setPermission(Path p, FsPermission permission
) throws IOException {
dfs.setPermission(getPathName(p), permission);
}
```
Hope this helps! |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldTable.java | FieldTable.setHandle | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
if (this.doSetHandle(bookmark, iHandleType))
return this.getRecord();
else
return null;
} | java | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
if (this.doSetHandle(bookmark, iHandleType))
return this.getRecord();
else
return null;
} | [
"public",
"FieldList",
"setHandle",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"if",
"(",
"this",
".",
"doSetHandle",
"(",
"bookmark",
",",
"iHandleType",
")",
")",
"return",
"this",
".",
"getRecord",
"(",
")",
... | Reposition to this record Using this bookmark.
@param Object bookmark Bookmark.
@param int iHandleType Type of handle (see getHandle).
@exception FILE_NOT_OPEN.
@return record if found/null - record not found. | [
"Reposition",
"to",
"this",
"record",
"Using",
"this",
"bookmark",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldTable.java#L477-L483 | train | Set the handle field. | Of course, here is the Java code you requested:
```java
public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
if (this.doSetHandle(bookmark, iHandleType))
return this.getRecord();
else
return null;
}
```
Hope this helps! |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/ruts/multipart/MultipartRequestWrapper.java | MultipartRequestWrapper.getParameter | @Override
public String getParameter(String name) {
String value = wrapped.getParameter(name);
if (value == null) {
final String[] multipleValue = parameters.get(name);
if ((multipleValue != null) && (multipleValue.length > 0)) {
value = multipleValue[0];
... | java | @Override
public String getParameter(String name) {
String value = wrapped.getParameter(name);
if (value == null) {
final String[] multipleValue = parameters.get(name);
if ((multipleValue != null) && (multipleValue.length > 0)) {
value = multipleValue[0];
... | [
"@",
"Override",
"public",
"String",
"getParameter",
"(",
"String",
"name",
")",
"{",
"String",
"value",
"=",
"wrapped",
".",
"getParameter",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"final",
"String",
"[",
"]",
"multipleValue",... | ============== | [
"=============="
] | 17b56dda8322e4c6d79043532c1dda917d6b60a8 | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/ruts/multipart/MultipartRequestWrapper.java#L73-L83 | train | Gets the value of the parameter with the given name. | Of course, here is the Java code you requested:
```java
@Override
public String getParameter(String name) {
String value = wrapped.getParameter(name);
if (value == null) {
final String[] multipleValue = parameters.get(name);
if ((multipleValue != null) && (multipleValue.leng... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/header/writers/HpkpHeaderWriter.java | HpkpHeaderWriter.setPins | public void setPins(Map<String, String> pins) {
Assert.notNull(pins, "pins cannot be null");
this.pins = pins;
updateHpkpHeaderValue();
} | java | public void setPins(Map<String, String> pins) {
Assert.notNull(pins, "pins cannot be null");
this.pins = pins;
updateHpkpHeaderValue();
} | [
"public",
"void",
"setPins",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"pins",
")",
"{",
"Assert",
".",
"notNull",
"(",
"pins",
",",
"\"pins cannot be null\"",
")",
";",
"this",
".",
"pins",
"=",
"pins",
";",
"updateHpkpHeaderValue",
"(",
")",
";",
... | <p>
Sets the value for the pin- directive of the Public-Key-Pins header.
</p>
<p>
The pin directive specifies a way for web host operators to indicate
a cryptographic identity that should be bound to a given web host.
See <a href="https://tools.ietf.org/html/rfc7469#section-2.1.1">Section 2.1.1</a> for additional deta... | [
"<p",
">",
"Sets",
"the",
"value",
"for",
"the",
"pin",
"-",
"directive",
"of",
"the",
"Public",
"-",
"Key",
"-",
"Pins",
"header",
".",
"<",
"/",
"p",
">"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/header/writers/HpkpHeaderWriter.java#L221-L225 | test | Sets the pins for the HPKP header. | Of course, here is the Java code you requested:
```java
public void setPins(Map<String, String> pins) {
Assert.notNull(pins, "pins cannot be null");
this.pins = pins;
updateHpkpHeaderValue();
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetOpenIDConnectProviderResult.java | GetOpenIDConnectProviderResult.withClientIDList | public GetOpenIDConnectProviderResult withClientIDList(String... clientIDList) {
if (this.clientIDList == null) {
setClientIDList(new com.amazonaws.internal.SdkInternalList<String>(clientIDList.length));
}
for (String ele : clientIDList) {
this.clientIDList.add(ele);
... | java | public GetOpenIDConnectProviderResult withClientIDList(String... clientIDList) {
if (this.clientIDList == null) {
setClientIDList(new com.amazonaws.internal.SdkInternalList<String>(clientIDList.length));
}
for (String ele : clientIDList) {
this.clientIDList.add(ele);
... | [
"public",
"GetOpenIDConnectProviderResult",
"withClientIDList",
"(",
"String",
"...",
"clientIDList",
")",
"{",
"if",
"(",
"this",
".",
"clientIDList",
"==",
"null",
")",
"{",
"setClientIDList",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInte... | <p>
A list of client IDs (also known as audiences) that are associated with the specified IAM OIDC provider resource
object. For more information, see <a>CreateOpenIDConnectProvider</a>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setClientIDList(java.util.Collection)... | [
"<p",
">",
"A",
"list",
"of",
"client",
"IDs",
"(",
"also",
"known",
"as",
"audiences",
")",
"that",
"are",
"associated",
"with",
"the",
"specified",
"IAM",
"OIDC",
"provider",
"resource",
"object",
".",
"For",
"more",
"information",
"see",
"<a",
">",
"C... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetOpenIDConnectProviderResult.java#L157-L165 | train | Sets the clientIDList value for the OpenIDConnectProvider. | Of course, here is the Java code you requested:
```java
public GetOpenIDConnectProviderResult withClientIDList(String... clientIDList) {
if (this.clientIDList == null) {
setClientIDList(new com.amazonaws.internal.SdkInternalList<String>(clientIDList.length));
}
for (String ele : cli... |
hypercube1024/firefly | firefly/src/main/java/com/firefly/client/http2/SimpleHTTPClient.java | SimpleHTTPClient.removeConnectionPool | public void removeConnectionPool(URL url) {
RequestBuilder req = new RequestBuilder();
req.host = url.getHost();
req.port = url.getPort() < 0 ? url.getDefaultPort() : url.getPort();
removePool(req);
} | java | public void removeConnectionPool(URL url) {
RequestBuilder req = new RequestBuilder();
req.host = url.getHost();
req.port = url.getPort() < 0 ? url.getDefaultPort() : url.getPort();
removePool(req);
} | [
"public",
"void",
"removeConnectionPool",
"(",
"URL",
"url",
")",
"{",
"RequestBuilder",
"req",
"=",
"new",
"RequestBuilder",
"(",
")",
";",
"req",
".",
"host",
"=",
"url",
".",
"getHost",
"(",
")",
";",
"req",
".",
"port",
"=",
"url",
".",
"getPort",
... | Remove the HTTP connection pool.
@param url The host URL. | [
"Remove",
"the",
"HTTP",
"connection",
"pool",
"."
] | ed3fc75b7c54a65b1e7d8141d01b49144bb423a3 | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/client/http2/SimpleHTTPClient.java#L712-L717 | train | Remove a connection pool from the cache. | Of course, here is the Java code you requested:
```java
public void removeConnectionPool(URL url) {
RequestBuilder req = new RequestBuilder();
req.host = url.getHost();
req.port = url.getPort() < 0 ? url.getDefaultPort() : url.getPort();
removePool(req);
}
```
Hope this helps! |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/utils/PathUtils.java | PathUtils.toPathOperationsList | public static List<PathOperation> toPathOperationsList(String path, Path pathModel) {
List<PathOperation> pathOperations = new ArrayList<>();
getOperationMap(pathModel).forEach((httpMethod, operation) ->
pathOperations.add(new PathOperation(httpMethod, path, operation)));
return ... | java | public static List<PathOperation> toPathOperationsList(String path, Path pathModel) {
List<PathOperation> pathOperations = new ArrayList<>();
getOperationMap(pathModel).forEach((httpMethod, operation) ->
pathOperations.add(new PathOperation(httpMethod, path, operation)));
return ... | [
"public",
"static",
"List",
"<",
"PathOperation",
">",
"toPathOperationsList",
"(",
"String",
"path",
",",
"Path",
"pathModel",
")",
"{",
"List",
"<",
"PathOperation",
">",
"pathOperations",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"getOperationMap",
"(",... | Converts a Swagger path into a PathOperation.
@param path the path
@param pathModel the Swagger Path model
@return the path operations | [
"Converts",
"a",
"Swagger",
"path",
"into",
"a",
"PathOperation",
"."
] | da83465f19a2f8a0f1fba873b5762bca8587896b | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/utils/PathUtils.java#L91-L96 | train | Converts a path to a list of PathOperations. | Of course, here is the Java code you requested:
```java
public static List<PathOperation> toPathOperationsList(String path, Path pathModel) {
List<PathOperation> pathOperations = new ArrayList<>();
getOperationMap(pathModel).forEach((httpMethod, operation) ->
pathOperations.add(new Path... |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.zip | public static <A, B, C, R> Stream<R> zip(final A[] a, final B[] b, final C[] c, final TriFunction<? super A, ? super B, ? super C, R> zipFunction) {
return zip(ObjIteratorEx.of(a), ObjIteratorEx.of(b), ObjIteratorEx.of(c), zipFunction);
} | java | public static <A, B, C, R> Stream<R> zip(final A[] a, final B[] b, final C[] c, final TriFunction<? super A, ? super B, ? super C, R> zipFunction) {
return zip(ObjIteratorEx.of(a), ObjIteratorEx.of(b), ObjIteratorEx.of(c), zipFunction);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
",",
"R",
">",
"Stream",
"<",
"R",
">",
"zip",
"(",
"final",
"A",
"[",
"]",
"a",
",",
"final",
"B",
"[",
"]",
"b",
",",
"final",
"C",
"[",
"]",
"c",
",",
"final",
"TriFunction",
"<",
"?",
... | Zip together the "a", "b" and "c" arrays until one of them runs out of values.
Each triple of values is combined into a single value using the supplied zipFunction function.
@param a
@param b
@return | [
"Zip",
"together",
"the",
"a",
"b",
"and",
"c",
"arrays",
"until",
"one",
"of",
"them",
"runs",
"out",
"of",
"values",
".",
"Each",
"triple",
"of",
"values",
"is",
"combined",
"into",
"a",
"single",
"value",
"using",
"the",
"supplied",
"zipFunction",
"fu... | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L6915-L6917 | train | Creates a stream that returns the results of applying the supplied zip function to each element of the first stream. | Of course, here is the Java code you requested:
```java
public static <A, B, C, R> Stream<R> zip(final A[] a, final B[] b, final C[] c, final TriFunction<? super A, ? super B, ? super C, R> zipFunction) {
return zip(ObjIteratorEx.of(a), ObjIteratorEx.of(b), ObjIteratorEx.of(c), zipFunction);
}
```
Hope ... |
diegossilveira/jcors | src/main/java/org/jcors/config/ConfigLoader.java | ConfigLoader.findFileInClasspath | private static InputStream findFileInClasspath(String fileName) {
InputStream is = null;
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
is = classLoader.getResourceAsStream(fileName);
return is;
} catch (Exception ex) {
log.error(String.format("Error while reading... | java | private static InputStream findFileInClasspath(String fileName) {
InputStream is = null;
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
is = classLoader.getResourceAsStream(fileName);
return is;
} catch (Exception ex) {
log.error(String.format("Error while reading... | [
"private",
"static",
"InputStream",
"findFileInClasspath",
"(",
"String",
"fileName",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"ClassLoader",
"classLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")"... | Finds a file by name in classpath
@param fileName
@return | [
"Finds",
"a",
"file",
"by",
"name",
"in",
"classpath"
] | cd56a9e2055d629baa42f93b27dd5615ced9632f | https://github.com/diegossilveira/jcors/blob/cd56a9e2055d629baa42f93b27dd5615ced9632f/src/main/java/org/jcors/config/ConfigLoader.java#L59-L75 | train | Find file in classpath. | Of course, here is the Java code you requested:
```java
private static InputStream findFileInClasspath(String fileName) {
InputStream is = null;
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
is = classLoader.getResourceAsStream(fileName);
return is;
} catch (Excepti... |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBContentTables.java | CmsUpdateDBContentTables.createContentsTable | protected void createContentsTable(CmsSetupDb dbCon) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (!dbCon.hasTableOrColumn(TABLE_CMS_CONTENTS, null)) {
String query = readQuery(QUERY_CREATE_CMS_CONTENTS_TABLE);
dbCon.updateSqlStatem... | java | protected void createContentsTable(CmsSetupDb dbCon) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (!dbCon.hasTableOrColumn(TABLE_CMS_CONTENTS, null)) {
String query = readQuery(QUERY_CREATE_CMS_CONTENTS_TABLE);
dbCon.updateSqlStatem... | [
"protected",
"void",
"createContentsTable",
"(",
"CmsSetupDb",
"dbCon",
")",
"throws",
"SQLException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"Exception",
"(",
")",
".",
"getStackTrace",
"(",
")",
"[",
"0",
"]",
".",
"toString",
"(",
")",
... | Creates the CMS_CONTENTS table if it does not exist yet.<p>
@param dbCon the db connection interface
@throws SQLException if something goes wrong | [
"Creates",
"the",
"CMS_CONTENTS",
"table",
"if",
"it",
"does",
"not",
"exist",
"yet",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBContentTables.java#L96-L105 | train | Creates the contents table. | Of course, here is the Java code you requested:
```java
protected void createContentsTable(CmsSetupDb dbCon) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (!dbCon.hasTableOrColumn(TABLE_CMS_CONTENTS, null)) {
String query = readQuery(QUERY_CREA... |
wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/AbstractBaseMojo.java | AbstractBaseMojo.getGeneratedResourcesDirectory | protected File getGeneratedResourcesDirectory() {
if (generatedResourcesFolder == null) {
String generatedResourcesFolderAbsolutePath = this.project.getBuild().getDirectory() + "/" + getGeneratedResourcesDirectoryPath();
generatedResourcesFolder = new File(generatedResourcesFolderAbsolutePath);
if... | java | protected File getGeneratedResourcesDirectory() {
if (generatedResourcesFolder == null) {
String generatedResourcesFolderAbsolutePath = this.project.getBuild().getDirectory() + "/" + getGeneratedResourcesDirectoryPath();
generatedResourcesFolder = new File(generatedResourcesFolderAbsolutePath);
if... | [
"protected",
"File",
"getGeneratedResourcesDirectory",
"(",
")",
"{",
"if",
"(",
"generatedResourcesFolder",
"==",
"null",
")",
"{",
"String",
"generatedResourcesFolderAbsolutePath",
"=",
"this",
".",
"project",
".",
"getBuild",
"(",
")",
".",
"getDirectory",
"(",
... | Get folder to temporarily generate the resources to.
@return Folder | [
"Get",
"folder",
"to",
"temporarily",
"generate",
"the",
"resources",
"to",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/AbstractBaseMojo.java#L84-L93 | train | Get the generated resources directory | Of course, here is the Java code you requested:
```java
protected File getGeneratedResourcesDirectory() {
if (generatedResourcesFolder == null) {
String generatedResourcesFolderAbsolutePath = this.project.getBuild().getDirectory() + "/" + getGeneratedResourcesDirectoryPath();
generatedResourcesFolder =... |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/deepwater/DeepWater.java | DeepWater.haveBackend | public static boolean haveBackend() {
for (DeepWaterParameters.Backend b : DeepWaterParameters.Backend.values()) {
if (DeepwaterMojoModel.createDeepWaterBackend(b.toString()) != null) return true;
}
return false;
} | java | public static boolean haveBackend() {
for (DeepWaterParameters.Backend b : DeepWaterParameters.Backend.values()) {
if (DeepwaterMojoModel.createDeepWaterBackend(b.toString()) != null) return true;
}
return false;
} | [
"public",
"static",
"boolean",
"haveBackend",
"(",
")",
"{",
"for",
"(",
"DeepWaterParameters",
".",
"Backend",
"b",
":",
"DeepWaterParameters",
".",
"Backend",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"DeepwaterMojoModel",
".",
"createDeepWaterBackend",
... | Check whether we have any Deep Water native backends available | [
"Check",
"whether",
"we",
"have",
"any",
"Deep",
"Water",
"native",
"backends",
"available"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/deepwater/DeepWater.java#L40-L45 | train | Checks if the DeepWater parameters have a backend. | Of course, here is the Java code you requested:
```java
public static boolean haveBackend() {
for (DeepWaterParameters.Backend b : DeepWaterParameters.Backend.values()) {
if (DeepwaterMojoModel.createDeepWaterBackend(b.toString()) != null) return true;
}
return false;
}
```
Hope this helps! |
MenoData/Time4J | base/src/main/java/net/time4j/clock/SntpConnector.java | SntpConnector.currentTimeInMicros | public long currentTimeInMicros() {
if (!this.isRunning()) {
Moment m = this.currentTime();
return (
m.getPosixTime() * MIO
+ m.getNanosecond() / 1000
);
}
long micros = SystemClock.MONOTONIC.currentTimeInMicros();
re... | java | public long currentTimeInMicros() {
if (!this.isRunning()) {
Moment m = this.currentTime();
return (
m.getPosixTime() * MIO
+ m.getNanosecond() / 1000
);
}
long micros = SystemClock.MONOTONIC.currentTimeInMicros();
re... | [
"public",
"long",
"currentTimeInMicros",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isRunning",
"(",
")",
")",
"{",
"Moment",
"m",
"=",
"this",
".",
"currentTime",
"(",
")",
";",
"return",
"(",
"m",
".",
"getPosixTime",
"(",
")",
"*",
"MIO",
"+",... | /*[deutsch]
<p>Liefert die aktuelle Zeit in Mikrosekunden seit dem Beginn der
UNIX-Epoche, nämlich [1970-01-01T00:00:00,000000Z]. </p>
<p>Es handelt sich immer um eine Zeitangabe ohne UTC-Schaltsekunden. </p>
@return count of microseconds since UNIX-epoch without leap seconds
@since 2.1 | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Liefert",
"die",
"aktuelle",
"Zeit",
"in",
"Mikrosekunden",
"seit",
"dem",
"Beginn",
"der",
"UNIX",
"-",
"Epoche",
"nä",
";",
"mlich",
"[",
"1970",
"-",
"01",
"-",
"01T00",
":",
"00",
":",
"00",
"000000Z... | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/clock/SntpConnector.java#L203-L217 | train | Get the current time in microseconds. | Of course, here is the Java code you requested:
```java
public long currentTimeInMicros() {
if (!this.isRunning()) {
Moment m = this.currentTime();
return (
m.getPosixTime() * MIO
+ m.getNanosecond() / 1000
);
}
long micros ... |
apache/incubator-zipkin | zipkin-server/src/main/java/zipkin2/server/internal/prometheus/ZipkinPrometheusMetricsConfiguration.java | ZipkinPrometheusMetricsConfiguration.getPathInfo | static String getPathInfo(RequestLog requestLog) {
String uri = requestLog.path();
if (!StringUtils.hasText(uri)) return "/";
return uri.replaceAll("//+", "/")
.replaceAll("/$", "");
} | java | static String getPathInfo(RequestLog requestLog) {
String uri = requestLog.path();
if (!StringUtils.hasText(uri)) return "/";
return uri.replaceAll("//+", "/")
.replaceAll("/$", "");
} | [
"static",
"String",
"getPathInfo",
"(",
"RequestLog",
"requestLog",
")",
"{",
"String",
"uri",
"=",
"requestLog",
".",
"path",
"(",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"uri",
")",
")",
"return",
"\"/\"",
";",
"return",
"uri",
... | from io.micrometer.spring.web.servlet.WebMvcTags | [
"from",
"io",
".",
"micrometer",
".",
"spring",
".",
"web",
".",
"servlet",
".",
"WebMvcTags"
] | 89b2fab983fc626b3be32ce9d7cf64b3f01f1a87 | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin-server/src/main/java/zipkin2/server/internal/prometheus/ZipkinPrometheusMetricsConfiguration.java#L166-L171 | train | Get the path info from the request log | Of course, here is the Java code you requested:
```java
static String getPathInfo(RequestLog requestLog) {
String uri = requestLog.path();
if (!StringUtils.hasText(uri)) return "/";
return uri.replaceAll("//+", "/")
.replaceAll("/$", "");
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/staticvalue/StaticValue.java | StaticValue.createStaticValue | @FFDCIgnore(Exception.class)
public static <T> StaticValue<T> createStaticValue(Callable<T> initializer) {
if (multiplex) {
return new Multiplexed<T>(initializer);
}
try {
return new FinalSingleton<T>(initializer == null ? null : initializer.call());
} catch (... | java | @FFDCIgnore(Exception.class)
public static <T> StaticValue<T> createStaticValue(Callable<T> initializer) {
if (multiplex) {
return new Multiplexed<T>(initializer);
}
try {
return new FinalSingleton<T>(initializer == null ? null : initializer.call());
} catch (... | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"public",
"static",
"<",
"T",
">",
"StaticValue",
"<",
"T",
">",
"createStaticValue",
"(",
"Callable",
"<",
"T",
">",
"initializer",
")",
"{",
"if",
"(",
"multiplex",
")",
"{",
"return",
"new",
"M... | Creates a new StaticValue and uses the initializer callable to obtain the
initial value when {@link #get()} is called. Note that when not multiplexing
the initializer is called immediately.
@param initializer the callable to obtain the initial value. A {@code null} value
is used to indicate no initial value. In this... | [
"Creates",
"a",
"new",
"StaticValue",
"and",
"uses",
"the",
"initializer",
"callable",
"to",
"obtain",
"the",
"initial",
"value",
"when",
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/staticvalue/StaticValue.java#L56-L66 | train | Create a static value from a callable. | Of course, here is the Java code you requested:
```java
@FFDCIgnore(Exception.class)
public static <T> StaticValue<T> createStaticValue(Callable<T> initializer) {
if (multiplex) {
return new Multiplexed<T>(initializer);
}
try {
return new FinalSingleton<T>(initialize... |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.getEventDispatcherRequired | @SuppressWarnings("unchecked")
protected <E> EventDispatcher<E> getEventDispatcherRequired(Class<E> eventType) {
return getEventDispatcher(eventType, true);
} | java | @SuppressWarnings("unchecked")
protected <E> EventDispatcher<E> getEventDispatcherRequired(Class<E> eventType) {
return getEventDispatcher(eventType, true);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"E",
">",
"EventDispatcher",
"<",
"E",
">",
"getEventDispatcherRequired",
"(",
"Class",
"<",
"E",
">",
"eventType",
")",
"{",
"return",
"getEventDispatcher",
"(",
"eventType",
",",
"true",
"... | Gets or creates the {@link EventDispatcher} for the given {@code eventType}.
@param <E> is the generic type of {@code eventType}.
@param eventType is the {@link Class} reflecting the {@link net.sf.mmm.util.event.api.Event event}.
@return the {@link EventDispatcher} responsible for the given {@code eventType}. | [
"Gets",
"or",
"creates",
"the",
"{",
"@link",
"EventDispatcher",
"}",
"for",
"the",
"given",
"{",
"@code",
"eventType",
"}",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L179-L183 | train | Returns the dispatcher required to dispatch the specified event type. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
protected <E> EventDispatcher<E> getEventDispatcherRequired(Class<E> eventType) {
return getEventDispatcher(eventType, true);
}
```
Hope this helps! |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/GPixelMath.java | GPixelMath.boundImage | public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
if( input instanceof ImageGray ) {
if (GrayU8.class == input.getClass()) {
PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
} else if (GrayS8.class == input.getClass()) {
PixelMath.boundImage((GrayS8)... | java | public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
if( input instanceof ImageGray ) {
if (GrayU8.class == input.getClass()) {
PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
} else if (GrayS8.class == input.getClass()) {
PixelMath.boundImage((GrayS8)... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"void",
"boundImage",
"(",
"T",
"input",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"if",
"(",
"input",
"instanceof",
"ImageGray",
")",
"{",
"if",
"(",
"GrayU8",
"."... | Bounds image pixels to be between these two values.
@param input Input image.
@param min minimum value. Inclusive.
@param max maximum value. Inclusive. | [
"Bounds",
"image",
"pixels",
"to",
"be",
"between",
"these",
"two",
"values",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/GPixelMath.java#L1039-L1067 | train | Computes the pixel - wise bound of the image. | Of course, here is the Java code you requested:
```java
public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
if( input instanceof ImageGray ) {
if (GrayU8.class == input.getClass()) {
PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
} else if (GrayS8.class... |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java | LockFile.closeRAF | private final void closeRAF() throws LockFile.UnexpectedFileIOException {
if (raf != null) {
try {
raf.close();
} catch (IOException ex) {
throw new UnexpectedFileIOException(this, "closeRAF", ex);
} finally {
raf = null;
... | java | private final void closeRAF() throws LockFile.UnexpectedFileIOException {
if (raf != null) {
try {
raf.close();
} catch (IOException ex) {
throw new UnexpectedFileIOException(this, "closeRAF", ex);
} finally {
raf = null;
... | [
"private",
"final",
"void",
"closeRAF",
"(",
")",
"throws",
"LockFile",
".",
"UnexpectedFileIOException",
"{",
"if",
"(",
"raf",
"!=",
"null",
")",
"{",
"try",
"{",
"raf",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
... | Closes this object's {@link #raf RandomAccessFile}. <p>
As a side-effect, the associated <tt>FileChannel</tt> object, if any,
is closed as well.
@throws UnexpectedFileIOException if an <tt>IOException</tt> is thrown | [
"Closes",
"this",
"object",
"s",
"{",
"@link",
"#raf",
"RandomAccessFile",
"}",
".",
"<p",
">"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java#L870-L881 | train | Close the RAF. | Of course, here is the Java code you requested:
```java
private final void closeRAF() throws LockFile.UnexpectedFileIOException {
if (raf != null) {
try {
raf.close();
} catch (IOException ex) {
throw new UnexpectedFileIOException(this, "closeRAF", ex);
... |
btc-ag/redg | redg-jpa-providers/src/main/java/com/btc/redg/jpa/JpaMetamodelRedGProvider.java | JpaMetamodelRedGProvider.setupBindInfoPackage | private static void setupBindInfoPackage() {
String nsuri = "http://www.hibernate.org/xsd/orm/hbm";
String packageInfoClassName = "org.hibernate.boot.jaxb.hbm.spi.package-info";
try {
final Class<?> packageInfoClass = Class
.forName(packageInfoClassName);
final XmlSchema xmlSchema = packageInfoCl... | java | private static void setupBindInfoPackage() {
String nsuri = "http://www.hibernate.org/xsd/orm/hbm";
String packageInfoClassName = "org.hibernate.boot.jaxb.hbm.spi.package-info";
try {
final Class<?> packageInfoClass = Class
.forName(packageInfoClassName);
final XmlSchema xmlSchema = packageInfoCl... | [
"private",
"static",
"void",
"setupBindInfoPackage",
"(",
")",
"{",
"String",
"nsuri",
"=",
"\"http://www.hibernate.org/xsd/orm/hbm\"",
";",
"String",
"packageInfoClassName",
"=",
"\"org.hibernate.boot.jaxb.hbm.spi.package-info\"",
";",
"try",
"{",
"final",
"Class",
"<",
... | workaround for hibernate bug from a comment of https://hibernate.atlassian.net/browse/HHH-12893
(JAXB exception using SchemaExport with Envers and Java 9+) | [
"workaround",
"for",
"hibernate",
"bug",
"from",
"a",
"comment",
"of",
"https",
":",
"//",
"hibernate",
".",
"atlassian",
".",
"net",
"/",
"browse",
"/",
"HHH",
"-",
"12893",
"(",
"JAXB",
"exception",
"using",
"SchemaExport",
"with",
"Envers",
"and",
"Java... | 416a68639d002512cabfebff09afd2e1909e27df | https://github.com/btc-ag/redg/blob/416a68639d002512cabfebff09afd2e1909e27df/redg-jpa-providers/src/main/java/com/btc/redg/jpa/JpaMetamodelRedGProvider.java#L90-L115 | train | Setup the BindInfo package. | Of course, here is the Java code you requested:
```java
private static void setupBindInfoPackage() {
String nsuri = "http://www.hibernate.org/xsd/orm/hbm";
String packageInfoClassName = "org.hibernate.boot.jaxb.hbm.spi.package-info";
try {
final Class<?> packageInfoClass = Class
.forName(packageInfo... |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.getTVExternalIDs | public ExternalID getTVExternalIDs(int tvID, String language) throws MovieDbException {
return tmdbTv.getTVExternalIDs(tvID, language);
} | java | public ExternalID getTVExternalIDs(int tvID, String language) throws MovieDbException {
return tmdbTv.getTVExternalIDs(tvID, language);
} | [
"public",
"ExternalID",
"getTVExternalIDs",
"(",
"int",
"tvID",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbTv",
".",
"getTVExternalIDs",
"(",
"tvID",
",",
"language",
")",
";",
"}"
] | Get the external ids that we have stored for a TV series.
@param tvID tvID
@param language language
@return
@throws com.omertron.themoviedbapi.MovieDbException | [
"Get",
"the",
"external",
"ids",
"that",
"we",
"have",
"stored",
"for",
"a",
"TV",
"series",
"."
] | bf132d7c7271734e13b58ba3bc92bba46f220118 | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1509-L1511 | train | Get the external IDs for a TV record. | Of course, here is the Java code you requested:
```java
public ExternalID getTVExternalIDs(int tvID, String language) throws MovieDbException {
return tmdbTv.getTVExternalIDs(tvID, language);
}
```
Hope this helps! |
actframework/actframework | src/main/java/act/event/EventBus.java | EventBus.emit | public EventBus emit(String event, Object... args) {
return _emitWithOnceBus(eventContext(event, args));
} | java | public EventBus emit(String event, Object... args) {
return _emitWithOnceBus(eventContext(event, args));
} | [
"public",
"EventBus",
"emit",
"(",
"String",
"event",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"_emitWithOnceBus",
"(",
"eventContext",
"(",
"event",
",",
"args",
")",
")",
";",
"}"
] | Emit a string event with parameters.
This will invoke all {@link SimpleEventListener} bound to the specified
string value given the listeners has the matching argument list.
For example, suppose we have the following simple event listener methods:
```java
{@literal @}On("USER-LOGIN")
public void logUserLogin(User us... | [
"Emit",
"a",
"string",
"event",
"with",
"parameters",
"."
] | 55a8f8b45e71159a79ec6e157c02f71700f8cd54 | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/event/EventBus.java#L909-L911 | train | Emit an event with parameters. | Of course, here is the Java code you requested:
```java
public EventBus emit(String event, Object... args) {
return _emitWithOnceBus(eventContext(event, args));
}
```
Hope this helps! |
ModeShape/modeshape | sequencers/modeshape-sequencer-epub/src/main/java/org/modeshape/sequencer/epub/EpubMetadata.java | EpubMetadata.check | public boolean check() throws Exception {
// we need to create a copy of the file, because the container file
// might be at the end of the stream.
File fileCopy = File.createTempFile("modeshape-sequencer-epub", ".tmp");
IoUtil.write(in, new BufferedOutputStream(new FileOutputStream(file... | java | public boolean check() throws Exception {
// we need to create a copy of the file, because the container file
// might be at the end of the stream.
File fileCopy = File.createTempFile("modeshape-sequencer-epub", ".tmp");
IoUtil.write(in, new BufferedOutputStream(new FileOutputStream(file... | [
"public",
"boolean",
"check",
"(",
")",
"throws",
"Exception",
"{",
"// we need to create a copy of the file, because the container file",
"// might be at the end of the stream.",
"File",
"fileCopy",
"=",
"File",
".",
"createTempFile",
"(",
"\"modeshape-sequencer-epub\"",
",",
... | /*
Check that given file is supported by this sequencer.
The sequencer first examines the container to get the list of all rootfiles.
Then it process each rootfile and extracts the metadata. | [
"/",
"*",
"Check",
"that",
"given",
"file",
"is",
"supported",
"by",
"this",
"sequencer",
".",
"The",
"sequencer",
"first",
"examines",
"the",
"container",
"to",
"get",
"the",
"list",
"of",
"all",
"rootfiles",
".",
"Then",
"it",
"process",
"each",
"rootfil... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-epub/src/main/java/org/modeshape/sequencer/epub/EpubMetadata.java#L82-L121 | train | Check the EPUB file. | Of course, here is the Java code you requested:
```java
public boolean check() throws Exception {
// we need to create a copy of the file, because the container file
// might be at the end of the stream.
File fileCopy = File.createTempFile("modeshape-sequencer-epub", ".tmp");
IoUtil.wri... |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/HessianFactory.java | HessianFactory.createHessian2Output | public Hessian2Output createHessian2Output(OutputStream os)
{
Hessian2Output out = createHessian2Output();
out.init(os);
return out;
} | java | public Hessian2Output createHessian2Output(OutputStream os)
{
Hessian2Output out = createHessian2Output();
out.init(os);
return out;
} | [
"public",
"Hessian2Output",
"createHessian2Output",
"(",
"OutputStream",
"os",
")",
"{",
"Hessian2Output",
"out",
"=",
"createHessian2Output",
"(",
")",
";",
"out",
".",
"init",
"(",
"os",
")",
";",
"return",
"out",
";",
"}"
] | Creates a new Hessian 2.0 serializer. | [
"Creates",
"a",
"new",
"Hessian",
"2",
".",
"0",
"serializer",
"."
] | 89e4f5af28602101dab7b498995018871616357b | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianFactory.java#L171-L178 | train | Create a Hessian2Output object. | Of course, here is the Java code you requested:
```java
public Hessian2Output createHessian2Output(OutputStream os)
{
Hessian2Output out = createHessian2Output();
out.init(os);
return out;
}
```
Hope this helps! |
kiegroup/droolsjbpm-integration | kie-camel/src/main/java/org/kie/camel/embedded/component/KiePolicy.java | KiePolicy.setPermissions | private static void setPermissions(DataFormatDefinition dformatDefinition) {
// Use Java Reflection to get the method setPermissions. This is done to allow compatibility between fuse 6.3 and fuse 6.2.1
// The xstream library differs on version between the 6.2.1 and 6.3 version of fuse.
Method se... | java | private static void setPermissions(DataFormatDefinition dformatDefinition) {
// Use Java Reflection to get the method setPermissions. This is done to allow compatibility between fuse 6.3 and fuse 6.2.1
// The xstream library differs on version between the 6.2.1 and 6.3 version of fuse.
Method se... | [
"private",
"static",
"void",
"setPermissions",
"(",
"DataFormatDefinition",
"dformatDefinition",
")",
"{",
"// Use Java Reflection to get the method setPermissions. This is done to allow compatibility between fuse 6.3 and fuse 6.2.1",
"// The xstream library differs on version between the 6.2.1 ... | Sets the permissions on the DataFormatDefinition object in case the setPermitions method exists inside of the DataFormatDefinition class. As this KiePolicy class could
be used in different environments (Fuse 6.2.1, Fuse 6.3), the XStream library could not have this method in their API.
@param dformatDefinition the dat... | [
"Sets",
"the",
"permissions",
"on",
"the",
"DataFormatDefinition",
"object",
"in",
"case",
"the",
"setPermitions",
"method",
"exists",
"inside",
"of",
"the",
"DataFormatDefinition",
"class",
".",
"As",
"this",
"KiePolicy",
"class",
"could",
"be",
"used",
"in",
"... | 6c26200ab03855dbb92b56ca0c6363cdec0eaf2c | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-camel/src/main/java/org/kie/camel/embedded/component/KiePolicy.java#L137-L152 | train | Set permissions for a data format definition. | Of course, here is the Java code you requested:
```java
private static void setPermissions(DataFormatDefinition dformatDefinition) {
// Use Java Reflection to get the method setPermissions. This is done to allow compatibility between fuse 6.3 and fuse 6.2.1
// The xstream library differs on version bet... |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Sneaky.java | Sneaky.toIntBiFunction | public static <T, U> ToIntBiFunction<T, U> toIntBiFunction(CheckedToIntBiFunction<T, U> function) {
return Unchecked.toIntBiFunction(function, Unchecked.RETHROW_ALL);
} | java | public static <T, U> ToIntBiFunction<T, U> toIntBiFunction(CheckedToIntBiFunction<T, U> function) {
return Unchecked.toIntBiFunction(function, Unchecked.RETHROW_ALL);
} | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"ToIntBiFunction",
"<",
"T",
",",
"U",
">",
"toIntBiFunction",
"(",
"CheckedToIntBiFunction",
"<",
"T",
",",
"U",
">",
"function",
")",
"{",
"return",
"Unchecked",
".",
"toIntBiFunction",
"(",
"function",
",",
... | Wrap a {@link CheckedToIntBiFunction} in a {@link ToIntBiFunction}. | [
"Wrap",
"a",
"{"
] | 889d87c85ca57bafd4eddd78e0f7ae2804d2ee86 | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Sneaky.java#L155-L157 | train | Get a ToIntBiFunction from a CheckedToIntBiFunction. | Of course, here is the Java code you requested:
```java
public static <T, U> ToIntBiFunction<T, U> toIntBiFunction(CheckedToIntBiFunction<T, U> function) {
return Unchecked.toIntBiFunction(function, Unchecked.RETHROW_ALL);
}
```
Hope this helps! |
lagom/lagom | service/javadsl/server/src/main/java/com/lightbend/lagom/javadsl/server/status/Latency.java | Latency.copyOf | public static Latency copyOf(AbstractLatency instance) {
if (instance instanceof Latency) {
return (Latency) instance;
}
return Latency.builder()
.from(instance)
.build();
} | java | public static Latency copyOf(AbstractLatency instance) {
if (instance instanceof Latency) {
return (Latency) instance;
}
return Latency.builder()
.from(instance)
.build();
} | [
"public",
"static",
"Latency",
"copyOf",
"(",
"AbstractLatency",
"instance",
")",
"{",
"if",
"(",
"instance",
"instanceof",
"Latency",
")",
"{",
"return",
"(",
"Latency",
")",
"instance",
";",
"}",
"return",
"Latency",
".",
"builder",
"(",
")",
".",
"from"... | Creates an immutable copy of a {@link AbstractLatency} value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.
@param instance The instance to copy
@return A copied immutable Latency instance | [
"Creates",
"an",
"immutable",
"copy",
"of",
"a",
"{"
] | 3763055a9d1aace793a5d970f4e688aea61b1a5a | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/server/src/main/java/com/lightbend/lagom/javadsl/server/status/Latency.java#L370-L377 | train | Creates a copy of the given Latency object. | Of course, here is the Java code you requested:
```java
public static Latency copyOf(AbstractLatency instance) {
if (instance instanceof Latency) {
return (Latency) instance;
}
return Latency.builder()
.from(instance)
.build();
}
```
Hope this helps! |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/PostgreConnectionFactory.java | PostgreConnectionFactory.openConnection | @Override
public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
{
try
{
if (this.containerConfig.dbStructureType.isMultiDatabase())
{
return new PostgreMultiDbJDBCConnection(getJdbcConnection(readOnly), readOnly, containerCon... | java | @Override
public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
{
try
{
if (this.containerConfig.dbStructureType.isMultiDatabase())
{
return new PostgreMultiDbJDBCConnection(getJdbcConnection(readOnly), readOnly, containerCon... | [
"@",
"Override",
"public",
"WorkspaceStorageConnection",
"openConnection",
"(",
"boolean",
"readOnly",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"containerConfig",
".",
"dbStructureType",
".",
"isMultiDatabase",
"(",
")",
")",
... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/PostgreConnectionFactory.java#L49-L65 | train | Override openConnection to create a new instance of the
class. | Of course, here is the Java code you requested:
```java
@Override
public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
{
try
{
if (this.containerConfig.dbStructureType.isMultiDatabase())
{
return new PostgreMultiDbJDBCConne... |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.getTyping | @NotNull
@ObjectiveCName("getTypingWithUid:")
public ValueModel<Boolean> getTyping(int uid) {
return modules.getTypingModule().getTyping(uid).getTyping();
} | java | @NotNull
@ObjectiveCName("getTypingWithUid:")
public ValueModel<Boolean> getTyping(int uid) {
return modules.getTypingModule().getTyping(uid).getTyping();
} | [
"@",
"NotNull",
"@",
"ObjectiveCName",
"(",
"\"getTypingWithUid:\"",
")",
"public",
"ValueModel",
"<",
"Boolean",
">",
"getTyping",
"(",
"int",
"uid",
")",
"{",
"return",
"modules",
".",
"getTypingModule",
"(",
")",
".",
"getTyping",
"(",
"uid",
")",
".",
... | Get private chat ViewModel
@param uid chat's User Id
@return ValueModel of Boolean for typing state | [
"Get",
"private",
"chat",
"ViewModel"
] | 5123c1584757c6eeea0ed2a0e7e043629871a0c6 | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L515-L519 | train | Gets the typing object for a specific node. | Of course, here is the Java code you requested:
```java
@NotNull
@ObjectiveCName("getTypingWithUid:")
public ValueModel<Boolean> getTyping(int uid) {
return modules.getTypingModule().getTyping(uid).getTyping();
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/GBSIterator.java | GBSIterator.next | public Object next()
{
_current1.reset();
if (_last1.key() == null)
findFirst(_dstack);
else
{
findNext(_dstack);
if (_current1.key() == null)
_eof = true;
}
if (_current1.key() != null)
_last1.setLocati... | java | public Object next()
{
_current1.reset();
if (_last1.key() == null)
findFirst(_dstack);
else
{
findNext(_dstack);
if (_current1.key() == null)
_eof = true;
}
if (_current1.key() != null)
_last1.setLocati... | [
"public",
"Object",
"next",
"(",
")",
"{",
"_current1",
".",
"reset",
"(",
")",
";",
"if",
"(",
"_last1",
".",
"key",
"(",
")",
"==",
"null",
")",
"findFirst",
"(",
"_dstack",
")",
";",
"else",
"{",
"findNext",
"(",
"_dstack",
")",
";",
"if",
"("... | Return the next element in the collection. | [
"Return",
"the",
"next",
"element",
"in",
"the",
"collection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/GBSIterator.java#L731-L747 | train | Method to get the next key from the iterator. | Of course, here is the Java code you requested:
```java
public Object next()
{
_current1.reset();
if (_last1.key() == null)
findFirst(_dstack);
else
{
findNext(_dstack);
if (_current1.key() == null)
_eof = true;
}
... |
akarnokd/ixjava | src/main/java/ix/Ix.java | Ix.distinctUntilChanged | public final <K> Ix<T> distinctUntilChanged(IxFunction<? super T, K> keySelector) {
return new IxDistinctUntilChanged<T, K>(this, keySelector, EqualityHelper.INSTANCE);
} | java | public final <K> Ix<T> distinctUntilChanged(IxFunction<? super T, K> keySelector) {
return new IxDistinctUntilChanged<T, K>(this, keySelector, EqualityHelper.INSTANCE);
} | [
"public",
"final",
"<",
"K",
">",
"Ix",
"<",
"T",
">",
"distinctUntilChanged",
"(",
"IxFunction",
"<",
"?",
"super",
"T",
",",
"K",
">",
"keySelector",
")",
"{",
"return",
"new",
"IxDistinctUntilChanged",
"<",
"T",
",",
"K",
">",
"(",
"this",
",",
"k... | Emits elements from this sequence if each element is different from the previous element
(according to a null-safe equals() of the extracted key), dropping elements that evaluate
to the same as the previous.
<p>
The result's iterator() doesn't support remove().
@param <K> the key type
@param keySelector the function th... | [
"Emits",
"elements",
"from",
"this",
"sequence",
"if",
"each",
"element",
"is",
"different",
"from",
"the",
"previous",
"element",
"(",
"according",
"to",
"a",
"null",
"-",
"safe",
"equals",
"()",
"of",
"the",
"extracted",
"key",
")",
"dropping",
"elements",... | add721bba550c36541faa450e40a975bb65e78d7 | https://github.com/akarnokd/ixjava/blob/add721bba550c36541faa450e40a975bb65e78d7/src/main/java/ix/Ix.java#L1189-L1191 | train | Create an Ix object that selects the distinct elements until the key selector returns true. | Of course, here is the Java code you requested:
```java
public final <K> Ix<T> distinctUntilChanged(IxFunction<? super T, K> keySelector) {
return new IxDistinctUntilChanged<T, K>(this, keySelector, EqualityHelper.INSTANCE);
}
```
Hope this helps! |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/adapter/TextAdapterActivity.java | TextAdapterActivity.isSynchronous | @Override
public boolean isSynchronous() {
if (canBeSynchronous()) {
if (this.canBeAsynchronous()) {
String attr = this.getAttributeValue(PROP_SYNCHRONOUS_RESPONSE);
return (attr!=null && attr.equalsIgnoreCase("true"));
} else return true;
} el... | java | @Override
public boolean isSynchronous() {
if (canBeSynchronous()) {
if (this.canBeAsynchronous()) {
String attr = this.getAttributeValue(PROP_SYNCHRONOUS_RESPONSE);
return (attr!=null && attr.equalsIgnoreCase("true"));
} else return true;
} el... | [
"@",
"Override",
"public",
"boolean",
"isSynchronous",
"(",
")",
"{",
"if",
"(",
"canBeSynchronous",
"(",
")",
")",
"{",
"if",
"(",
"this",
".",
"canBeAsynchronous",
"(",
")",
")",
"{",
"String",
"attr",
"=",
"this",
".",
"getAttributeValue",
"(",
"PROP_... | The method is used to determine if the current usage is synchronous (waiting for response) or not.
The method is used only when both canBeSynchronous() and canBeAsynchronous() are true | [
"The",
"method",
"is",
"used",
"to",
"determine",
"if",
"the",
"current",
"usage",
"is",
"synchronous",
"(",
"waiting",
"for",
"response",
")",
"or",
"not",
".",
"The",
"method",
"is",
"used",
"only",
"when",
"both",
"canBeSynchronous",
"()",
"and",
"canBe... | 91167fe65a25a5d7022cdcf8b0fae8506f5b87ce | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/adapter/TextAdapterActivity.java#L153-L161 | train | Is the record a synchronous record? | Of course, here is the Java code you requested:
```java
@Override
public boolean isSynchronous() {
if (canBeSynchronous()) {
if (this.canBeAsynchronous()) {
String attr = this.getAttributeValue(PROP_SYNCHRONOUS_RESPONSE);
return (attr!=null && attr.equalsIgnoreCa... |
Kadvin/spring-component-framework | sustain/src/main/java/net/happyonroad/component/container/AppLauncher.java | AppLauncher.exit | public void exit() {
if (exiting()) {
logger.debug("Another thread is shutting down");
return;
}
final long start = System.currentTimeMillis();
//noinspection finally
File exitingSignal = getSignal("exiting");
try {
logger.info(banner("... | java | public void exit() {
if (exiting()) {
logger.debug("Another thread is shutting down");
return;
}
final long start = System.currentTimeMillis();
//noinspection finally
File exitingSignal = getSignal("exiting");
try {
logger.info(banner("... | [
"public",
"void",
"exit",
"(",
")",
"{",
"if",
"(",
"exiting",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Another thread is shutting down\"",
")",
";",
"return",
";",
"}",
"final",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
"... | 退出 | [
"退出"
] | 07432d0aef6781d9943c80a0c15957b08433b5bd | https://github.com/Kadvin/spring-component-framework/blob/07432d0aef6781d9943c80a0c15957b08433b5bd/sustain/src/main/java/net/happyonroad/component/container/AppLauncher.java#L128-L154 | valid | Exit the application. | Of course, here is the Java code you requested:
```java
public void exit() {
if (exiting()) {
logger.debug("Another thread is shutting down");
return;
}
final long start = System.currentTimeMillis();
//noinspection finally
File exitingSignal = getSignal("... |
schaloner/deadbolt-2-java | code/app/be/objectify/deadbolt/java/actions/AbstractDeadboltAction.java | AbstractDeadboltAction.onAuthFailure | protected CompletionStage<Result> onAuthFailure(final DeadboltHandler deadboltHandler,
final Optional<String> content,
final Http.RequestHeader request)
{
LOGGER.info("Deadbolt: Access failure on [{}]",
... | java | protected CompletionStage<Result> onAuthFailure(final DeadboltHandler deadboltHandler,
final Optional<String> content,
final Http.RequestHeader request)
{
LOGGER.info("Deadbolt: Access failure on [{}]",
... | [
"protected",
"CompletionStage",
"<",
"Result",
">",
"onAuthFailure",
"(",
"final",
"DeadboltHandler",
"deadboltHandler",
",",
"final",
"Optional",
"<",
"String",
">",
"content",
",",
"final",
"Http",
".",
"RequestHeader",
"request",
")",
"{",
"LOGGER",
".",
"inf... | Wrapper for {@link DeadboltHandler#onAuthFailure} to ensure the access failure is logged.
@param deadboltHandler the Deadbolt handler
@param content the content type hint
@param request the request
@return the result of {@link DeadboltHandler#onAuthFailure} | [
"Wrapper",
"for",
"{",
"@link",
"DeadboltHandler#onAuthFailure",
"}",
"to",
"ensure",
"the",
"access",
"failure",
"is",
"logged",
"."
] | 84890eb4565fb6172b7d8e824f64d547ddacfcc7 | https://github.com/schaloner/deadbolt-2-java/blob/84890eb4565fb6172b7d8e824f64d547ddacfcc7/code/app/be/objectify/deadbolt/java/actions/AbstractDeadboltAction.java#L165-L185 | valid | On auth failure. | Of course, here is the Java code you requested:
```java
protected CompletionStage<Result> onAuthFailure(final DeadboltHandler deadboltHandler,
final Optional<String> content,
final Http.RequestHeader request)
{
... |
HubSpot/Baragon | BaragonClient/src/main/java/com/hubspot/baragon/client/BaragonServiceClient.java | BaragonServiceClient.getLoadBalancerGroups | public Collection<String> getLoadBalancerGroups() {
final String requestUri = String.format(LOAD_BALANCER_FORMAT, getBaseUrl());
return getCollection(requestUri, "load balancer groups", STRING_COLLECTION);
} | java | public Collection<String> getLoadBalancerGroups() {
final String requestUri = String.format(LOAD_BALANCER_FORMAT, getBaseUrl());
return getCollection(requestUri, "load balancer groups", STRING_COLLECTION);
} | [
"public",
"Collection",
"<",
"String",
">",
"getLoadBalancerGroups",
"(",
")",
"{",
"final",
"String",
"requestUri",
"=",
"String",
".",
"format",
"(",
"LOAD_BALANCER_FORMAT",
",",
"getBaseUrl",
"(",
")",
")",
";",
"return",
"getCollection",
"(",
"requestUri",
... | BaragonService load balancer group actions | [
"BaragonService",
"load",
"balancer",
"group",
"actions"
] | e02e1c960a2b93e146ee5cafaa6eb0853ec9bacb | https://github.com/HubSpot/Baragon/blob/e02e1c960a2b93e146ee5cafaa6eb0853ec9bacb/BaragonClient/src/main/java/com/hubspot/baragon/client/BaragonServiceClient.java#L310-L313 | valid | Get load balancer groups | Of course, here is the Java code you requested:
```java
public Collection<String> getLoadBalancerGroups() {
final String requestUri = String.format(LOAD_BALANCER_FORMAT, getBaseUrl());
return getCollection(requestUri, "load balancer groups", STRING_COLLECTION);
}
```
Hope this helps! |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java | DeviceManagerClient.createDeviceRegistry | public final DeviceRegistry createDeviceRegistry(
LocationName parent, DeviceRegistry deviceRegistry) {
CreateDeviceRegistryRequest request =
CreateDeviceRegistryRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setDeviceRegistry(deviceRegistry)
... | java | public final DeviceRegistry createDeviceRegistry(
LocationName parent, DeviceRegistry deviceRegistry) {
CreateDeviceRegistryRequest request =
CreateDeviceRegistryRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setDeviceRegistry(deviceRegistry)
... | [
"public",
"final",
"DeviceRegistry",
"createDeviceRegistry",
"(",
"LocationName",
"parent",
",",
"DeviceRegistry",
"deviceRegistry",
")",
"{",
"CreateDeviceRegistryRequest",
"request",
"=",
"CreateDeviceRegistryRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",... | Creates a device registry that contains devices.
<p>Sample code:
<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
DeviceRegistry deviceRegistry = DeviceRegistry.newBuilder().build();
DeviceRegistry response = d... | [
"Creates",
"a",
"device",
"registry",
"that",
"contains",
"devices",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java#L185-L194 | train | Create a DeviceRegistry object. | Of course, here is the Java code you requested:
```java
public final DeviceRegistry createDeviceRegistry(
LocationName parent, DeviceRegistry deviceRegistry) {
CreateDeviceRegistryRequest request =
CreateDeviceRegistryRequest.newBuilder()
.setParent(parent == null ? null : parent.toStrin... |
jenetics/jenetics | jenetics.ext/src/main/java/io/jenetics/ext/internal/util/TreePattern.java | TreePattern.expand | public TreeNode<String> expand(final Map<String, Tree<String, ?>> variables) {
return expand(variables, Function.identity());
} | java | public TreeNode<String> expand(final Map<String, Tree<String, ?>> variables) {
return expand(variables, Function.identity());
} | [
"public",
"TreeNode",
"<",
"String",
">",
"expand",
"(",
"final",
"Map",
"<",
"String",
",",
"Tree",
"<",
"String",
",",
"?",
">",
">",
"variables",
")",
"{",
"return",
"expand",
"(",
"variables",
",",
"Function",
".",
"identity",
"(",
")",
")",
";",... | Expands {@code this} pattern with the given variable mapping.
@param variables the variables to use for expanding {@code this} pattern
@return the expanded tree pattern
@throws NullPointerException if the variables mapping is {@code null}
@throws IllegalArgumentException if not all needed variables are part
of the {@c... | [
"Expands",
"{",
"@code",
"this",
"}",
"pattern",
"with",
"the",
"given",
"variable",
"mapping",
"."
] | ee516770c65ef529b27deb283f071c85f344eff4 | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.ext/src/main/java/io/jenetics/ext/internal/util/TreePattern.java#L294-L296 | train | Expand the tree. | Of course, here is the Java code you requested:
```java
public TreeNode<String> expand(final Map<String, Tree<String, ?>> variables) {
return expand(variables, Function.identity());
}
```
Hope this helps! |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.latitudeToTileY | public static int latitudeToTileY(double latitude, byte zoomLevel) {
return pixelYToTileY(latitudeToPixelY(latitude, zoomLevel, DUMMY_TILE_SIZE), zoomLevel, DUMMY_TILE_SIZE);
} | java | public static int latitudeToTileY(double latitude, byte zoomLevel) {
return pixelYToTileY(latitudeToPixelY(latitude, zoomLevel, DUMMY_TILE_SIZE), zoomLevel, DUMMY_TILE_SIZE);
} | [
"public",
"static",
"int",
"latitudeToTileY",
"(",
"double",
"latitude",
",",
"byte",
"zoomLevel",
")",
"{",
"return",
"pixelYToTileY",
"(",
"latitudeToPixelY",
"(",
"latitude",
",",
"zoomLevel",
",",
"DUMMY_TILE_SIZE",
")",
",",
"zoomLevel",
",",
"DUMMY_TILE_SIZE... | Converts a latitude coordinate (in degrees) to a tile Y number at a certain zoom level.
@param latitude the latitude coordinate that should be converted.
@param zoomLevel the zoom level at which the coordinate should be converted.
@return the tile Y number of the latitude value. | [
"Converts",
"a",
"latitude",
"coordinate",
"(",
"in",
"degrees",
")",
"to",
"a",
"tile",
"Y",
"number",
"at",
"a",
"certain",
"zoom",
"level",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L242-L244 | train | Get the tile Y coordinate for a latitude and zoom level. | Of course, here is the Java code you requested:
```java
public static int latitudeToTileY(double latitude, byte zoomLevel) {
return pixelYToTileY(latitudeToPixelY(latitude, zoomLevel, DUMMY_TILE_SIZE), zoomLevel, DUMMY_TILE_SIZE);
}
```
Hope this helps! |
virgo47/javasimon | core/src/main/java/org/javasimon/CounterSample.java | CounterSample.simonToString | public synchronized String simonToString() {
return "Simon Counter: counter=" + counter +
", max=" + SimonUtils.presentMinMaxCount(max) +
", min=" + SimonUtils.presentMinMaxCount(min) +
simonToStringCommon();
} | java | public synchronized String simonToString() {
return "Simon Counter: counter=" + counter +
", max=" + SimonUtils.presentMinMaxCount(max) +
", min=" + SimonUtils.presentMinMaxCount(min) +
simonToStringCommon();
} | [
"public",
"synchronized",
"String",
"simonToString",
"(",
")",
"{",
"return",
"\"Simon Counter: counter=\"",
"+",
"counter",
"+",
"\", max=\"",
"+",
"SimonUtils",
".",
"presentMinMaxCount",
"(",
"max",
")",
"+",
"\", min=\"",
"+",
"SimonUtils",
".",
"presentMinMaxCo... | Equivalent to {@link org.javasimon.CounterImpl#toString()} without state. | [
"Equivalent",
"to",
"{"
] | 17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/CounterSample.java#L183-L188 | train | Returns a string representation of the Simon Counter. | Of course, here is the Java code you requested:
```java
public synchronized String simonToString() {
return "Simon Counter: counter=" + counter +
", max=" + SimonUtils.presentMinMaxCount(max) +
", min=" + SimonUtils.presentMinMaxCount(min) +
simonToStringCommon();
}
```
Hope this helps! |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/httpsessions/HttpSessionsPanel.java | HttpSessionsPanel.getSelectedSession | public HttpSession getSelectedSession() {
final int selectedRow = this.sessionsTable.getSelectedRow();
if (selectedRow == -1) {
// No row selected
return null;
}
final int rowIndex = sessionsTable.convertRowIndexToModel(selectedRow);
return this.sessionsModel.getHttpSessionAt(rowIndex);
} | java | public HttpSession getSelectedSession() {
final int selectedRow = this.sessionsTable.getSelectedRow();
if (selectedRow == -1) {
// No row selected
return null;
}
final int rowIndex = sessionsTable.convertRowIndexToModel(selectedRow);
return this.sessionsModel.getHttpSessionAt(rowIndex);
} | [
"public",
"HttpSession",
"getSelectedSession",
"(",
")",
"{",
"final",
"int",
"selectedRow",
"=",
"this",
".",
"sessionsTable",
".",
"getSelectedRow",
"(",
")",
";",
"if",
"(",
"selectedRow",
"==",
"-",
"1",
")",
"{",
"// No row selected\r",
"return",
"null",
... | Gets the selected http session.
@return the selected session, or null if nothing is selected | [
"Gets",
"the",
"selected",
"http",
"session",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsPanel.java#L497-L505 | train | Gets the selected session. | Of course, here is the Java code you requested:
```java
public HttpSession getSelectedSession() {
final int selectedRow = this.sessionsTable.getSelectedRow();
if (selectedRow == -1) {
// No row selected
return null;
}
final int rowIndex = sessionsTable.convertRowIndexToModel(selectedRow);
return... |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/connect/ConnectionParams.java | ConnectionParams.getHost | public String getHost() {
String host = getAsNullableString("host");
host = host != null ? host : getAsNullableString("ip");
return host;
} | java | public String getHost() {
String host = getAsNullableString("host");
host = host != null ? host : getAsNullableString("ip");
return host;
} | [
"public",
"String",
"getHost",
"(",
")",
"{",
"String",
"host",
"=",
"getAsNullableString",
"(",
"\"host\"",
")",
";",
"host",
"=",
"host",
"!=",
"null",
"?",
"host",
":",
"getAsNullableString",
"(",
"\"ip\"",
")",
";",
"return",
"host",
";",
"}"
] | Gets the host name or IP address.
@return the host name or IP address. | [
"Gets",
"the",
"host",
"name",
"or",
"IP",
"address",
"."
] | 122352fbf9b208f6417376da7b8ad725bc85ee58 | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/connect/ConnectionParams.java#L133-L137 | train | Gets the value host property. | Of course, here is the Java code you requested:
```java
public String getHost() {
String host = getAsNullableString("host");
host = host != null ? host : getAsNullableString("ip");
return host;
}
```
Hope this helps! |
diffplug/durian | src/com/diffplug/common/base/FieldsAndGetters.java | FieldsAndGetters.fieldsAndGetters | public static Stream<Map.Entry<String, Object>> fieldsAndGetters(Object obj) {
return fieldsAndGetters(obj, Predicates.alwaysTrue());
} | java | public static Stream<Map.Entry<String, Object>> fieldsAndGetters(Object obj) {
return fieldsAndGetters(obj, Predicates.alwaysTrue());
} | [
"public",
"static",
"Stream",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
">",
"fieldsAndGetters",
"(",
"Object",
"obj",
")",
"{",
"return",
"fieldsAndGetters",
"(",
"obj",
",",
"Predicates",
".",
"alwaysTrue",
"(",
")",
")",
";",
"}"
] | Returns a {@code Stream} of all public fields and getter methods and their values for the given object.
@see #getters(Object, Predicate) | [
"Returns",
"a",
"{",
"@code",
"Stream",
"}",
"of",
"all",
"public",
"fields",
"and",
"getter",
"methods",
"and",
"their",
"values",
"for",
"the",
"given",
"object",
"."
] | 10631a3480e5491eb6eb6ee06e752d8596914232 | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/FieldsAndGetters.java#L132-L134 | train | Returns a stream of all the fields of the given object and all its superclasses. | Of course, here is the Java code you requested:
```java
public static Stream<Map.Entry<String, Object>> fieldsAndGetters(Object obj) {
return fieldsAndGetters(obj, Predicates.alwaysTrue());
}
```
Hope this helps! |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/handlers/DeploymentOverlayHandler.java | DeploymentOverlayHandler.getName | private String getName(CommandContext ctx, boolean failInBatch) throws CommandLineException {
final ParsedCommandLine args = ctx.getParsedCommandLine();
final String name = this.name.getValue(args, true);
if (name == null) {
throw new CommandFormatException(this.name + " is missing v... | java | private String getName(CommandContext ctx, boolean failInBatch) throws CommandLineException {
final ParsedCommandLine args = ctx.getParsedCommandLine();
final String name = this.name.getValue(args, true);
if (name == null) {
throw new CommandFormatException(this.name + " is missing v... | [
"private",
"String",
"getName",
"(",
"CommandContext",
"ctx",
",",
"boolean",
"failInBatch",
")",
"throws",
"CommandLineException",
"{",
"final",
"ParsedCommandLine",
"args",
"=",
"ctx",
".",
"getParsedCommandLine",
"(",
")",
";",
"final",
"String",
"name",
"=",
... | Validate that the overlay exists. If it doesn't exist, throws an
exception if not in batch mode or if failInBatch is true. In batch mode,
we could be in the case that the overlay doesn't exist yet. | [
"Validate",
"that",
"the",
"overlay",
"exists",
".",
"If",
"it",
"doesn",
"t",
"exist",
"throws",
"an",
"exception",
"if",
"not",
"in",
"batch",
"mode",
"or",
"if",
"failInBatch",
"is",
"true",
".",
"In",
"batch",
"mode",
"we",
"could",
"be",
"in",
"th... | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/handlers/DeploymentOverlayHandler.java#L545-L557 | train | Get the name of the application. | Of course, here is the Java code you requested:
```java
private String getName(CommandContext ctx, boolean failInBatch) throws CommandLineException {
final ParsedCommandLine args = ctx.getParsedCommandLine();
final String name = this.name.getValue(args, true);
if (name == null) {
th... |
google/closure-compiler | src/com/google/javascript/jscomp/TypedScopeCreator.java | TypedScopeCreator.patchGlobalScope | void patchGlobalScope(TypedScope globalScope, Node scriptRoot) {
// Preconditions: This is supposed to be called only on (named) SCRIPT nodes
// and a global typed scope should have been generated already.
checkState(scriptRoot.isScript());
checkNotNull(globalScope);
checkState(globalScope.isGlobal(... | java | void patchGlobalScope(TypedScope globalScope, Node scriptRoot) {
// Preconditions: This is supposed to be called only on (named) SCRIPT nodes
// and a global typed scope should have been generated already.
checkState(scriptRoot.isScript());
checkNotNull(globalScope);
checkState(globalScope.isGlobal(... | [
"void",
"patchGlobalScope",
"(",
"TypedScope",
"globalScope",
",",
"Node",
"scriptRoot",
")",
"{",
"// Preconditions: This is supposed to be called only on (named) SCRIPT nodes",
"// and a global typed scope should have been generated already.",
"checkState",
"(",
"scriptRoot",
".",
... | Patches a given global scope by removing variables previously declared in a script and
re-traversing a new version of that script.
@param globalScope The global scope generated by {@code createScope}.
@param scriptRoot The script that is modified. | [
"Patches",
"a",
"given",
"global",
"scope",
"by",
"removing",
"variables",
"previously",
"declared",
"in",
"a",
"script",
"and",
"re",
"-",
"traversing",
"a",
"new",
"version",
"of",
"that",
"script",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypedScopeCreator.java#L558-L603 | train | This is a helper method that is called when a global typed scope is being generated. It is called when a global typed scope is being generated. | Of course, here is the Java code you requested:
```java
void patchGlobalScope(TypedScope globalScope, Node scriptRoot) {
// Preconditions: This is supposed to be called only on (named) SCRIPT nodes
// and a global typed scope should have been generated already.
checkState(scriptRoot.isScript());
checkN... |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/agent/SpecificationMethodAdapter.java | SpecificationMethodAdapter.labelIsResolved | @Requires("label != null")
protected static boolean labelIsResolved(Label label) {
try {
label.getOffset();
} catch (IllegalStateException e) {
return false;
}
return true;
} | java | @Requires("label != null")
protected static boolean labelIsResolved(Label label) {
try {
label.getOffset();
} catch (IllegalStateException e) {
return false;
}
return true;
} | [
"@",
"Requires",
"(",
"\"label != null\"",
")",
"protected",
"static",
"boolean",
"labelIsResolved",
"(",
"Label",
"label",
")",
"{",
"try",
"{",
"label",
".",
"getOffset",
"(",
")",
";",
"}",
"catch",
"(",
"IllegalStateException",
"e",
")",
"{",
"return",
... | Returns {@code true} if the specified label is resolved, that is,
is associated with an offset in the bytecode of the method. | [
"Returns",
"{"
] | 6ded58fa05eb5bf85f16353c8dd4c70bee59121a | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/agent/SpecificationMethodAdapter.java#L167-L175 | train | Check if the label is resolved. | Of course, here is the Java code you requested:
```java
@Requires("label != null")
protected static boolean labelIsResolved(Label label) {
try {
label.getOffset();
} catch (IllegalStateException e) {
return false;
}
return true;
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.