repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.validateLambdaType | public static void validateLambdaType(Class<?> baseClass, Type t) {
"""
Checks whether the given type has the generic parameters declared in the class definition.
@param t type to be validated
"""
if (!(t instanceof Class)) {
return;
}
final Class<?> clazz = (Class<?>) t;
if (clazz.getTypeParame... | java | public static void validateLambdaType(Class<?> baseClass, Type t) {
if (!(t instanceof Class)) {
return;
}
final Class<?> clazz = (Class<?>) t;
if (clazz.getTypeParameters().length > 0) {
throw new InvalidTypesException("The generic type parameters of '" + clazz.getSimpleName() + "' are missing. "
+ ... | [
"public",
"static",
"void",
"validateLambdaType",
"(",
"Class",
"<",
"?",
">",
"baseClass",
",",
"Type",
"t",
")",
"{",
"if",
"(",
"!",
"(",
"t",
"instanceof",
"Class",
")",
")",
"{",
"return",
";",
"}",
"final",
"Class",
"<",
"?",
">",
"clazz",
"=... | Checks whether the given type has the generic parameters declared in the class definition.
@param t type to be validated | [
"Checks",
"whether",
"the",
"given",
"type",
"has",
"the",
"generic",
"parameters",
"declared",
"in",
"the",
"class",
"definition",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L341-L353 |
samskivert/pythagoras | src/main/java/pythagoras/f/Crossing.java | Crossing.crossQuad | public static int crossQuad (float x1, float y1, float cx, float cy, float x2, float y2,
float x, float y) {
"""
Returns how many times ray from point (x,y) cross quard curve
"""
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx && x < x2) || (x > x1 && x > cx && x >... | java | public static int crossQuad (float x1, float y1, float cx, float cy, float x2, float y2,
float x, float y) {
// LEFT/RIGHT/UP/EMPTY
if ((x < x1 && x < cx && x < x2) || (x > x1 && x > cx && x > x2)
|| (y > y1 && y > cy && y > y2) || (x1 == cx && cx == x2))... | [
"public",
"static",
"int",
"crossQuad",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"cx",
",",
"float",
"cy",
",",
"float",
"x2",
",",
"float",
"y2",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"// LEFT/RIGHT/UP/EMPTY",
"if",
"(",
"(",
... | Returns how many times ray from point (x,y) cross quard curve | [
"Returns",
"how",
"many",
"times",
"ray",
"from",
"point",
"(",
"x",
"y",
")",
"cross",
"quard",
"curve"
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Crossing.java#L369-L391 |
OpenLiberty/open-liberty | dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/NetworkInterfaces.java | NetworkInterfaces.getInterfaceInfo | private void getInterfaceInfo(NetworkInterface networkInterface, PrintWriter out) throws IOException {
"""
Capture interface specific information and write it to the provided writer.
@param networkInterface the interface to introspect
@param writer the print writer to write information to
"""
final... | java | private void getInterfaceInfo(NetworkInterface networkInterface, PrintWriter out) throws IOException {
final String indent = " ";
// Basic information from the interface
out.println();
out.append("Interface: ").append(networkInterface.getDisplayName()).println();
out.append(i... | [
"private",
"void",
"getInterfaceInfo",
"(",
"NetworkInterface",
"networkInterface",
",",
"PrintWriter",
"out",
")",
"throws",
"IOException",
"{",
"final",
"String",
"indent",
"=",
"\" \"",
";",
"// Basic information from the interface",
"out",
".",
"println",
"(",
... | Capture interface specific information and write it to the provided writer.
@param networkInterface the interface to introspect
@param writer the print writer to write information to | [
"Capture",
"interface",
"specific",
"information",
"and",
"write",
"it",
"to",
"the",
"provided",
"writer",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/NetworkInterfaces.java#L77-L105 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WHiddenCommentRenderer.java | WHiddenCommentRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WHiddenComment.
@param component the WHiddenComment to paint.
@param renderContext the RenderContext to paint to.
"""
WHiddenComment hiddenComponent = (WHiddenComment) component;
... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WHiddenComment hiddenComponent = (WHiddenComment) component;
XmlStringBuilder xml = renderContext.getWriter();
String hiddenText = hiddenComponent.getText();
if (!Util.empty(hiddenText)) {
xml.appendTag("... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WHiddenComment",
"hiddenComponent",
"=",
"(",
"WHiddenComment",
")",
"component",
";",
"XmlStringBuilder",
"xml",
... | Paints the given WHiddenComment.
@param component the WHiddenComment to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WHiddenComment",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WHiddenCommentRenderer.java#L24-L36 |
spring-projects/spring-social-facebook | spring-social-facebook/src/main/java/org/springframework/social/facebook/api/FqlResult.java | FqlResult.getLong | public Long getLong(String fieldName) {
"""
Returns the value of the identified field as a Long.
@param fieldName the name of the field
@return the value of the field as a Long
@throws FqlException if the field cannot be expressed as an Long
"""
try {
return hasValue(fieldName) ? Long.valueOf(String.va... | java | public Long getLong(String fieldName) {
try {
return hasValue(fieldName) ? Long.valueOf(String.valueOf(resultMap.get(fieldName))) : null;
} catch (NumberFormatException e) {
throw new FqlException("Field '" + fieldName +"' is not a number.", e);
}
} | [
"public",
"Long",
"getLong",
"(",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"hasValue",
"(",
"fieldName",
")",
"?",
"Long",
".",
"valueOf",
"(",
"String",
".",
"valueOf",
"(",
"resultMap",
".",
"get",
"(",
"fieldName",
")",
")",
")",
":",
... | Returns the value of the identified field as a Long.
@param fieldName the name of the field
@return the value of the field as a Long
@throws FqlException if the field cannot be expressed as an Long | [
"Returns",
"the",
"value",
"of",
"the",
"identified",
"field",
"as",
"a",
"Long",
"."
] | train | https://github.com/spring-projects/spring-social-facebook/blob/ae2234d94367eaa3adbba251ec7790d5ba7ffa41/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/FqlResult.java#L69-L75 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.iterateKeys | public int iterateKeys(HashtableAction action, int index, int length)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDiskException {
"""
**********************************... | java | public int iterateKeys(HashtableAction action, int index, int length)
throws IOException,
EOFException,
FileManagerException,
ClassNotFoundException,
HashtableOnDiskException {
return walkHash(action, RETRIEVE_KE... | [
"public",
"int",
"iterateKeys",
"(",
"HashtableAction",
"action",
",",
"int",
"index",
",",
"int",
"length",
")",
"throws",
"IOException",
",",
"EOFException",
",",
"FileManagerException",
",",
"ClassNotFoundException",
",",
"HashtableOnDiskException",
"{",
"return",
... | ************************************************************************
This invokes the action's "execute" method once for every
object passing only the key to the method, to avoid the
overhead of reading the object if it is not necessary.
The iteration is synchronized with concurrent get and put operations
to avoid... | [
"************************************************************************",
"This",
"invokes",
"the",
"action",
"s",
"execute",
"method",
"once",
"for",
"every",
"object",
"passing",
"only",
"the",
"key",
"to",
"the",
"method",
"to",
"avoid",
"the",
"overhead",
"of",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L1340-L1347 |
ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/swing/StatusBar.java | StatusBar.addZone | public void addZone(String id, Component zone, String constraints) {
"""
Adds a new zone in the StatusBar.
@param id
@param zone
@param constraints one of the constraint support by the
{@link com.l2fprod.common.swing.PercentLayout}
"""
// is there already a zone with this id?
Component pr... | java | public void addZone(String id, Component zone, String constraints) {
// is there already a zone with this id?
Component previousZone = getZone(id);
if (previousZone != null) {
remove(previousZone);
idToZones.remove(id);
}
if (zone instanceof JComponent) {... | [
"public",
"void",
"addZone",
"(",
"String",
"id",
",",
"Component",
"zone",
",",
"String",
"constraints",
")",
"{",
"// is there already a zone with this id?",
"Component",
"previousZone",
"=",
"getZone",
"(",
"id",
")",
";",
"if",
"(",
"previousZone",
"!=",
"nu... | Adds a new zone in the StatusBar.
@param id
@param zone
@param constraints one of the constraint support by the
{@link com.l2fprod.common.swing.PercentLayout} | [
"Adds",
"a",
"new",
"zone",
"in",
"the",
"StatusBar",
"."
] | train | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/swing/StatusBar.java#L67-L90 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Resource.java | Resource.isCollidingWith | public boolean isCollidingWith(Resource that, int count) {
"""
Checks the resource collision.
@param count
If we are testing W/W conflict, total # of write counts.
For R/W conflict test, this value should be set to {@link Integer#MAX_VALUE}.
"""
assert that!=null;
for(Resource r=that; r!=n... | java | public boolean isCollidingWith(Resource that, int count) {
assert that!=null;
for(Resource r=that; r!=null; r=r.parent)
if(this.equals(r) && r.numConcurrentWrite<count)
return true;
for(Resource r=this; r!=null; r=r.parent)
if(that.equals(r) && r.numConcur... | [
"public",
"boolean",
"isCollidingWith",
"(",
"Resource",
"that",
",",
"int",
"count",
")",
"{",
"assert",
"that",
"!=",
"null",
";",
"for",
"(",
"Resource",
"r",
"=",
"that",
";",
"r",
"!=",
"null",
";",
"r",
"=",
"r",
".",
"parent",
")",
"if",
"("... | Checks the resource collision.
@param count
If we are testing W/W conflict, total # of write counts.
For R/W conflict test, this value should be set to {@link Integer#MAX_VALUE}. | [
"Checks",
"the",
"resource",
"collision",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Resource.java#L92-L101 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.beginRotateDiskEncryptionKey | public void beginRotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) {
"""
Rotate disk encryption key of the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param pa... | java | public void beginRotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) {
beginRotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginRotateDiskEncryptionKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ClusterDiskEncryptionParameters",
"parameters",
")",
"{",
"beginRotateDiskEncryptionKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName"... | Rotate disk encryption key of the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The parameters for the disk encryption operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Error... | [
"Rotate",
"disk",
"encryption",
"key",
"of",
"the",
"specified",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1369-L1371 |
grails/grails-core | grails-spring/src/main/groovy/grails/spring/BeanBuilder.java | BeanBuilder.setProperty | @Override
public void setProperty(String name, Object value) {
"""
Overrides property setting in the scope of the BeanBuilder to set
properties on the current BeanConfiguration.
"""
if (currentBeanConfig != null) {
setPropertyOnBeanConfig(name, value);
}
} | java | @Override
public void setProperty(String name, Object value) {
if (currentBeanConfig != null) {
setPropertyOnBeanConfig(name, value);
}
} | [
"@",
"Override",
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"currentBeanConfig",
"!=",
"null",
")",
"{",
"setPropertyOnBeanConfig",
"(",
"name",
",",
"value",
")",
";",
"}",
"}"
] | Overrides property setting in the scope of the BeanBuilder to set
properties on the current BeanConfiguration. | [
"Overrides",
"property",
"setting",
"in",
"the",
"scope",
"of",
"the",
"BeanBuilder",
"to",
"set",
"properties",
"on",
"the",
"current",
"BeanConfiguration",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-spring/src/main/groovy/grails/spring/BeanBuilder.java#L769-L774 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/util/FontUtils.java | FontUtils.drawRight | public static void drawRight(Font font, String s, int x, int y, int width) {
"""
Draw text right justified
@param font The font to draw with
@param s The string to draw
@param x The x location to draw at
@param y The y location to draw at
@param width The width to fill with the text
"""
drawString(fon... | java | public static void drawRight(Font font, String s, int x, int y, int width) {
drawString(font, s, Alignment.RIGHT, x, y, width, Color.white);
} | [
"public",
"static",
"void",
"drawRight",
"(",
"Font",
"font",
",",
"String",
"s",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
")",
"{",
"drawString",
"(",
"font",
",",
"s",
",",
"Alignment",
".",
"RIGHT",
",",
"x",
",",
"y",
",",
"widt... | Draw text right justified
@param font The font to draw with
@param s The string to draw
@param x The x location to draw at
@param y The y location to draw at
@param width The width to fill with the text | [
"Draw",
"text",
"right",
"justified"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/FontUtils.java#L79-L81 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webservices.javaee.common/src/com/ibm/ws/webservices/javaee/common/internal/JaxWsDDHelper.java | JaxWsDDHelper.getPortComponentByServletLink | static PortComponent getPortComponentByServletLink(String servletLink, Adaptable containerToAdapt) throws UnableToAdaptException {
"""
Get the PortComponent by servlet-link.
@param servletLink
@param containerToAdapt
@return
@throws UnableToAdaptException
"""
return getHighLevelElementByServiceIm... | java | static PortComponent getPortComponentByServletLink(String servletLink, Adaptable containerToAdapt) throws UnableToAdaptException {
return getHighLevelElementByServiceImplBean(servletLink, containerToAdapt, PortComponent.class, LinkType.SERVLET);
} | [
"static",
"PortComponent",
"getPortComponentByServletLink",
"(",
"String",
"servletLink",
",",
"Adaptable",
"containerToAdapt",
")",
"throws",
"UnableToAdaptException",
"{",
"return",
"getHighLevelElementByServiceImplBean",
"(",
"servletLink",
",",
"containerToAdapt",
",",
"P... | Get the PortComponent by servlet-link.
@param servletLink
@param containerToAdapt
@return
@throws UnableToAdaptException | [
"Get",
"the",
"PortComponent",
"by",
"servlet",
"-",
"link",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webservices.javaee.common/src/com/ibm/ws/webservices/javaee/common/internal/JaxWsDDHelper.java#L56-L58 |
gallandarakhneorg/afc | advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/AbstractCommonShapeFileReader.java | AbstractCommonShapeFileReader.setReadingPosition | protected void setReadingPosition(int recordIndex, int byteIndex) throws IOException {
"""
Set the reading position, excluding the header.
@param recordIndex is the index of the next record to read.
@param byteIndex is the index of the next byte to read (excluding the header).
@throws IOException in case of e... | java | protected void setReadingPosition(int recordIndex, int byteIndex) throws IOException {
if (this.seekEnabled) {
this.nextExpectedRecordIndex = recordIndex;
this.buffer.position(byteIndex);
} else {
throw new SeekOperationDisabledException();
}
} | [
"protected",
"void",
"setReadingPosition",
"(",
"int",
"recordIndex",
",",
"int",
"byteIndex",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"seekEnabled",
")",
"{",
"this",
".",
"nextExpectedRecordIndex",
"=",
"recordIndex",
";",
"this",
".",
"bu... | Set the reading position, excluding the header.
@param recordIndex is the index of the next record to read.
@param byteIndex is the index of the next byte to read (excluding the header).
@throws IOException in case of error. | [
"Set",
"the",
"reading",
"position",
"excluding",
"the",
"header",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/shapefile/src/main/java/org/arakhne/afc/io/shape/AbstractCommonShapeFileReader.java#L614-L621 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.countByG_T_E | @Override
public int countByG_T_E(long groupId, String type, boolean enabled) {
"""
Returns the number of commerce notification templates where groupId = ? and type = ? and enabled = ?.
@param groupId the group ID
@param type the type
@param enabled the enabled
@return the number of matching com... | java | @Override
public int countByG_T_E(long groupId, String type, boolean enabled) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_T_E;
Object[] finderArgs = new Object[] { groupId, type, enabled };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler que... | [
"@",
"Override",
"public",
"int",
"countByG_T_E",
"(",
"long",
"groupId",
",",
"String",
"type",
",",
"boolean",
"enabled",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_T_E",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[... | Returns the number of commerce notification templates where groupId = ? and type = ? and enabled = ?.
@param groupId the group ID
@param type the type
@param enabled the enabled
@return the number of matching commerce notification templates | [
"Returns",
"the",
"number",
"of",
"commerce",
"notification",
"templates",
"where",
"groupId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"and",
"enabled",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L4296-L4361 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/IntrospectionUtils.java | IntrospectionUtils.getFieldValue | public static Object getFieldValue(FieldMetadata fieldMetadata, Object target) {
"""
Returns the value of the field represented by the given metadata.
@param fieldMetadata
the metadata of the field
@param target
the target object to which the field belongs.
@return the value of the field.
"""
Method... | java | public static Object getFieldValue(FieldMetadata fieldMetadata, Object target) {
MethodHandle readMethod = fieldMetadata.getReadMethod();
try {
return readMethod.invoke(target);
} catch (Throwable t) {
throw new EntityManagerException(t.getMessage(), t);
}
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"FieldMetadata",
"fieldMetadata",
",",
"Object",
"target",
")",
"{",
"MethodHandle",
"readMethod",
"=",
"fieldMetadata",
".",
"getReadMethod",
"(",
")",
";",
"try",
"{",
"return",
"readMethod",
".",
"invoke",
"... | Returns the value of the field represented by the given metadata.
@param fieldMetadata
the metadata of the field
@param target
the target object to which the field belongs.
@return the value of the field. | [
"Returns",
"the",
"value",
"of",
"the",
"field",
"represented",
"by",
"the",
"given",
"metadata",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/IntrospectionUtils.java#L376-L383 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java | GraphEdgeIdFinder.findClosestEdgeToPoint | public void findClosestEdgeToPoint(GHIntHashSet edgeIds, GHPoint point, EdgeFilter filter) {
"""
This method fills the edgeIds hash with edgeIds found close (exact match) to the specified point
"""
findClosestEdge(edgeIds, point.getLat(), point.getLon(), filter);
} | java | public void findClosestEdgeToPoint(GHIntHashSet edgeIds, GHPoint point, EdgeFilter filter) {
findClosestEdge(edgeIds, point.getLat(), point.getLon(), filter);
} | [
"public",
"void",
"findClosestEdgeToPoint",
"(",
"GHIntHashSet",
"edgeIds",
",",
"GHPoint",
"point",
",",
"EdgeFilter",
"filter",
")",
"{",
"findClosestEdge",
"(",
"edgeIds",
",",
"point",
".",
"getLat",
"(",
")",
",",
"point",
".",
"getLon",
"(",
")",
",",
... | This method fills the edgeIds hash with edgeIds found close (exact match) to the specified point | [
"This",
"method",
"fills",
"the",
"edgeIds",
"hash",
"with",
"edgeIds",
"found",
"close",
"(",
"exact",
"match",
")",
"to",
"the",
"specified",
"point"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java#L55-L57 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsDefaultAppButtonProvider.java | CmsDefaultAppButtonProvider.createIconButton | public static Button createIconButton(String name, String description, Resource icon, String buttonStyle) {
"""
Creates an icon button.<p>
@param name the name
@param description the description
@param icon the icon
@param buttonStyle the button style
@return the created button
"""
Button but... | java | public static Button createIconButton(String name, String description, Resource icon, String buttonStyle) {
Button button = new Button(name);
button.setIcon(icon, name);
button.setDescription(description);
button.addStyleName(OpenCmsTheme.APP_BUTTON);
button.addStyleName(ValoThe... | [
"public",
"static",
"Button",
"createIconButton",
"(",
"String",
"name",
",",
"String",
"description",
",",
"Resource",
"icon",
",",
"String",
"buttonStyle",
")",
"{",
"Button",
"button",
"=",
"new",
"Button",
"(",
"name",
")",
";",
"button",
".",
"setIcon",... | Creates an icon button.<p>
@param name the name
@param description the description
@param icon the icon
@param buttonStyle the button style
@return the created button | [
"Creates",
"an",
"icon",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsDefaultAppButtonProvider.java#L210-L225 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/MethodDelegation.java | MethodDelegation.withEmptyConfiguration | public static WithCustomProperties withEmptyConfiguration() {
"""
Creates a configuration builder for a method delegation that does not apply any pre-configured
{@link net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver}s or
{@link net.bytebuddy.implementation.bind.annotation.TargetMethodA... | java | public static WithCustomProperties withEmptyConfiguration() {
return new WithCustomProperties(MethodDelegationBinder.AmbiguityResolver.NoOp.INSTANCE, Collections.<TargetMethodAnnotationDrivenBinder.ParameterBinder<?>>emptyList());
} | [
"public",
"static",
"WithCustomProperties",
"withEmptyConfiguration",
"(",
")",
"{",
"return",
"new",
"WithCustomProperties",
"(",
"MethodDelegationBinder",
".",
"AmbiguityResolver",
".",
"NoOp",
".",
"INSTANCE",
",",
"Collections",
".",
"<",
"TargetMethodAnnotationDriven... | Creates a configuration builder for a method delegation that does not apply any pre-configured
{@link net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver}s or
{@link net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder}s.
@return A method delegation con... | [
"Creates",
"a",
"configuration",
"builder",
"for",
"a",
"method",
"delegation",
"that",
"does",
"not",
"apply",
"any",
"pre",
"-",
"configured",
"{",
"@link",
"net",
".",
"bytebuddy",
".",
"implementation",
".",
"bind",
".",
"MethodDelegationBinder",
".",
"Amb... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/MethodDelegation.java#L547-L549 |
i-net-software/jlessc | src/com/inet/lib/less/UrlUtils.java | UrlUtils.getColor | static double getColor( Expression param, CssFormatter formatter ) throws LessException {
"""
Get the color value of the expression or fire an exception if not a color.
@param param the expression to evaluate
@param formatter current formatter
@return the color value of the expression
@throws LessException i... | java | static double getColor( Expression param, CssFormatter formatter ) throws LessException {
switch( param.getDataType( formatter ) ) {
case Expression.COLOR:
case Expression.RGBA:
return param.doubleValue( formatter );
}
throw new LessException( "Not a color... | [
"static",
"double",
"getColor",
"(",
"Expression",
"param",
",",
"CssFormatter",
"formatter",
")",
"throws",
"LessException",
"{",
"switch",
"(",
"param",
".",
"getDataType",
"(",
"formatter",
")",
")",
"{",
"case",
"Expression",
".",
"COLOR",
":",
"case",
"... | Get the color value of the expression or fire an exception if not a color.
@param param the expression to evaluate
@param formatter current formatter
@return the color value of the expression
@throws LessException if the expression is not a color value | [
"Get",
"the",
"color",
"value",
"of",
"the",
"expression",
"or",
"fire",
"an",
"exception",
"if",
"not",
"a",
"color",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/UrlUtils.java#L153-L160 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentClassesAxiomImpl_CustomFieldSerializer.java | OWLEquivalentClassesAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLEquivalentClassesAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLEquivalentClassesAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLEquivalentClassesAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentClassesAxiomImpl_CustomFieldSerializer.java#L95-L98 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/LambdaMetaHelper.java | LambdaMetaHelper.getConstructor | public <T, A> Function<A, T> getConstructor(Class<? extends T> clazz, Class<A> arg) {
"""
Gets single arg constructor as Function.
@param clazz class to get constructor for.
@param arg constructor argument type.
@param <T> clazz.
@param <A> argument class.
@return function.
"""
return getConstruc... | java | public <T, A> Function<A, T> getConstructor(Class<? extends T> clazz, Class<A> arg) {
return getConstructorAs(Function.class, "apply", clazz, arg);
} | [
"public",
"<",
"T",
",",
"A",
">",
"Function",
"<",
"A",
",",
"T",
">",
"getConstructor",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
",",
"Class",
"<",
"A",
">",
"arg",
")",
"{",
"return",
"getConstructorAs",
"(",
"Function",
".",
"class... | Gets single arg constructor as Function.
@param clazz class to get constructor for.
@param arg constructor argument type.
@param <T> clazz.
@param <A> argument class.
@return function. | [
"Gets",
"single",
"arg",
"constructor",
"as",
"Function",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/LambdaMetaHelper.java#L37-L39 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookXMLPreProcessor.java | DocBookXMLPreProcessor.createLinkWrapperElement | protected Element createLinkWrapperElement(final Document document, final Node node, final String cssClass) {
"""
Creates the wrapper element for bug or editor links and adds it to the document.
@param document The document to add the wrapper/link to.
@param node The specific node the wrapper/link should b... | java | protected Element createLinkWrapperElement(final Document document, final Node node, final String cssClass) {
// Create the bug/editor link root element
final Element linkElement = document.createElement("para");
if (cssClass != null) {
linkElement.setAttribute("role", cssClass);
... | [
"protected",
"Element",
"createLinkWrapperElement",
"(",
"final",
"Document",
"document",
",",
"final",
"Node",
"node",
",",
"final",
"String",
"cssClass",
")",
"{",
"// Create the bug/editor link root element",
"final",
"Element",
"linkElement",
"=",
"document",
".",
... | Creates the wrapper element for bug or editor links and adds it to the document.
@param document The document to add the wrapper/link to.
@param node The specific node the wrapper/link should be added to.
@param cssClass The css class name to use for the wrapper. @return The wrapper element that links can be adde... | [
"Creates",
"the",
"wrapper",
"element",
"for",
"bug",
"or",
"editor",
"links",
"and",
"adds",
"it",
"to",
"the",
"document",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookXMLPreProcessor.java#L227-L237 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java | WindowManager.getEarliestEventTs | public long getEarliestEventTs(long startTs, long endTs) {
"""
Scans the event queue and returns the next earliest event ts
between the startTs and endTs
@param startTs the start ts (exclusive)
@param endTs the end ts (inclusive)
@return the earliest event ts between startTs and endTs
"""
long mi... | java | public long getEarliestEventTs(long startTs, long endTs) {
long minTs = Long.MAX_VALUE;
for (Event<T> event : queue) {
if (event.getTimestamp() > startTs && event.getTimestamp() <= endTs) {
minTs = Math.min(minTs, event.getTimestamp());
}
}
return ... | [
"public",
"long",
"getEarliestEventTs",
"(",
"long",
"startTs",
",",
"long",
"endTs",
")",
"{",
"long",
"minTs",
"=",
"Long",
".",
"MAX_VALUE",
";",
"for",
"(",
"Event",
"<",
"T",
">",
"event",
":",
"queue",
")",
"{",
"if",
"(",
"event",
".",
"getTim... | Scans the event queue and returns the next earliest event ts
between the startTs and endTs
@param startTs the start ts (exclusive)
@param endTs the end ts (inclusive)
@return the earliest event ts between startTs and endTs | [
"Scans",
"the",
"event",
"queue",
"and",
"returns",
"the",
"next",
"earliest",
"event",
"ts",
"between",
"the",
"startTs",
"and",
"endTs"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WindowManager.java#L225-L233 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/ScaleSceneStructure.java | ScaleSceneStructure.applyScale | public void applyScale( SceneStructureProjective structure ,
SceneObservations observations ) {
"""
Applies the scale transform to the input scene structure. Metric.
@param structure 3D scene
@param observations Observations of the scene
"""
if( structure.homogenous ) {
applyScaleToPointsHomogeno... | java | public void applyScale( SceneStructureProjective structure ,
SceneObservations observations ) {
if( structure.homogenous ) {
applyScaleToPointsHomogenous(structure);
} else {
computePointStatistics(structure.points);
applyScaleToPoints3D(structure);
applyScaleTranslation3D(structure);
}
// C... | [
"public",
"void",
"applyScale",
"(",
"SceneStructureProjective",
"structure",
",",
"SceneObservations",
"observations",
")",
"{",
"if",
"(",
"structure",
".",
"homogenous",
")",
"{",
"applyScaleToPointsHomogenous",
"(",
"structure",
")",
";",
"}",
"else",
"{",
"co... | Applies the scale transform to the input scene structure. Metric.
@param structure 3D scene
@param observations Observations of the scene | [
"Applies",
"the",
"scale",
"transform",
"to",
"the",
"input",
"scene",
"structure",
".",
"Metric",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/ScaleSceneStructure.java#L115-L130 |
FINRAOS/DataGenerator | dg-common/src/main/java/org/finra/datagenerator/common/SocialNetwork_Example_Java/SocialNetworkUtilities.java | SocialNetworkUtilities.areCoordinatesWithinThreshold | public static Boolean areCoordinatesWithinThreshold(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
"""
Whether or not points are within some threshold.
@param point1 Point 1
@param point2 Point 2
@return True or false
"""
return getDistanceBetweenCoordinates(point1, point2) < COORD... | java | public static Boolean areCoordinatesWithinThreshold(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
return getDistanceBetweenCoordinates(point1, point2) < COORDINATE_THRESHOLD;
} | [
"public",
"static",
"Boolean",
"areCoordinatesWithinThreshold",
"(",
"Tuple2",
"<",
"Double",
",",
"Double",
">",
"point1",
",",
"Tuple2",
"<",
"Double",
",",
"Double",
">",
"point2",
")",
"{",
"return",
"getDistanceBetweenCoordinates",
"(",
"point1",
",",
"poin... | Whether or not points are within some threshold.
@param point1 Point 1
@param point2 Point 2
@return True or false | [
"Whether",
"or",
"not",
"points",
"are",
"within",
"some",
"threshold",
"."
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-common/src/main/java/org/finra/datagenerator/common/SocialNetwork_Example_Java/SocialNetworkUtilities.java#L94-L96 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/RecurrenceUtility.java | RecurrenceUtility.getDuration | public static Duration getDuration(ProjectProperties properties, Integer durationValue, Integer unitsValue) {
"""
Convert the integer representation of a duration value and duration units
into an MPXJ Duration instance.
@param properties project properties, used for duration units conversion
@param durationVa... | java | public static Duration getDuration(ProjectProperties properties, Integer durationValue, Integer unitsValue)
{
Duration result;
if (durationValue == null)
{
result = null;
}
else
{
result = Duration.getInstance(durationValue.intValue(), TimeUnit.MINUTES);
... | [
"public",
"static",
"Duration",
"getDuration",
"(",
"ProjectProperties",
"properties",
",",
"Integer",
"durationValue",
",",
"Integer",
"unitsValue",
")",
"{",
"Duration",
"result",
";",
"if",
"(",
"durationValue",
"==",
"null",
")",
"{",
"result",
"=",
"null",
... | Convert the integer representation of a duration value and duration units
into an MPXJ Duration instance.
@param properties project properties, used for duration units conversion
@param durationValue integer duration value
@param unitsValue integer units value
@return Duration instance | [
"Convert",
"the",
"integer",
"representation",
"of",
"a",
"duration",
"value",
"and",
"duration",
"units",
"into",
"an",
"MPXJ",
"Duration",
"instance",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/RecurrenceUtility.java#L63-L80 |
elki-project/elki | elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/OfflineChangePointDetectionAlgorithm.java | OfflineChangePointDetectionAlgorithm.run | public ChangePoints run(Relation<DoubleVector> relation) {
"""
Executes multiple change point detection for given relation
@param relation the relation to process
@return list with all the detected change point for every time series
"""
if(!(relation.getDBIDs() instanceof ArrayDBIDs)) {
throw new... | java | public ChangePoints run(Relation<DoubleVector> relation) {
if(!(relation.getDBIDs() instanceof ArrayDBIDs)) {
throw new AbortException("This implementation may only be used on static databases, with ArrayDBIDs to provide a clear order.");
}
return new Instance(rnd.getSingleThreadedRandom()).run(relati... | [
"public",
"ChangePoints",
"run",
"(",
"Relation",
"<",
"DoubleVector",
">",
"relation",
")",
"{",
"if",
"(",
"!",
"(",
"relation",
".",
"getDBIDs",
"(",
")",
"instanceof",
"ArrayDBIDs",
")",
")",
"{",
"throw",
"new",
"AbortException",
"(",
"\"This implementa... | Executes multiple change point detection for given relation
@param relation the relation to process
@return list with all the detected change point for every time series | [
"Executes",
"multiple",
"change",
"point",
"detection",
"for",
"given",
"relation"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-timeseries/src/main/java/de/lmu/ifi/dbs/elki/algorithm/timeseries/OfflineChangePointDetectionAlgorithm.java#L133-L138 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/QuadTree.java | QuadTree.getIterator | public QuadTreeIterator getIterator(Geometry query, double tolerance, boolean bSorted) {
"""
Gets an iterator on the QuadTree. The query will be the Envelope2D that bounds the input Geometry.
To reuse the existing iterator on the same QuadTree but with a new query, use the reset_iterator function on the QuadTree_... | java | public QuadTreeIterator getIterator(Geometry query, double tolerance, boolean bSorted) {
if (!bSorted) {
QuadTreeImpl.QuadTreeIteratorImpl iterator = m_impl.getIterator(query, tolerance);
return new QuadTreeIterator(iterator, false);
} else {
QuadTreeImpl.QuadTreeSortedIteratorImpl iterator = m_impl.getSor... | [
"public",
"QuadTreeIterator",
"getIterator",
"(",
"Geometry",
"query",
",",
"double",
"tolerance",
",",
"boolean",
"bSorted",
")",
"{",
"if",
"(",
"!",
"bSorted",
")",
"{",
"QuadTreeImpl",
".",
"QuadTreeIteratorImpl",
"iterator",
"=",
"m_impl",
".",
"getIterator... | Gets an iterator on the QuadTree. The query will be the Envelope2D that bounds the input Geometry.
To reuse the existing iterator on the same QuadTree but with a new query, use the reset_iterator function on the QuadTree_iterator.
\param query The Geometry used for the query. If the Geometry is a Line segment, then the... | [
"Gets",
"an",
"iterator",
"on",
"the",
"QuadTree",
".",
"The",
"query",
"will",
"be",
"the",
"Envelope2D",
"that",
"bounds",
"the",
"input",
"Geometry",
".",
"To",
"reuse",
"the",
"existing",
"iterator",
"on",
"the",
"same",
"QuadTree",
"but",
"with",
"a",... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/QuadTree.java#L295-L303 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java | AnycastOutputHandler.getStreamInfo | private final StreamInfo getStreamInfo(String streamKey, SIBUuid12 streamId) {
"""
Helper method used to dispatch a message received for a particular stream.
Handles its own synchronization
@param remoteMEId
@param streamId
@return the StreamInfo, if there is one that matches the parameters, else null
"""
... | java | private final StreamInfo getStreamInfo(String streamKey, SIBUuid12 streamId)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getStreamInfo", new Object[]{streamKey, streamId});
StreamInfo sinfo = streamTable.get(streamKey);
if ((sinfo != null) && sinfo.streamId.eq... | [
"private",
"final",
"StreamInfo",
"getStreamInfo",
"(",
"String",
"streamKey",
",",
"SIBUuid12",
"streamId",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | Helper method used to dispatch a message received for a particular stream.
Handles its own synchronization
@param remoteMEId
@param streamId
@return the StreamInfo, if there is one that matches the parameters, else null | [
"Helper",
"method",
"used",
"to",
"dispatch",
"a",
"message",
"received",
"for",
"a",
"particular",
"stream",
".",
"Handles",
"its",
"own",
"synchronization"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java#L1944-L1957 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.whereEqualTo | @Nonnull
public Query whereEqualTo(@Nonnull FieldPath fieldPath, @Nullable Object value) {
"""
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be equal to the specified value.
@param fieldPath The path of the field to compare.
@... | java | @Nonnull
public Query whereEqualTo(@Nonnull FieldPath fieldPath, @Nullable Object value) {
Preconditions.checkState(
options.startCursor == null && options.endCursor == null,
"Cannot call whereEqualTo() after defining a boundary with startAt(), "
+ "startAfter(), endBefore() or endAt()... | [
"@",
"Nonnull",
"public",
"Query",
"whereEqualTo",
"(",
"@",
"Nonnull",
"FieldPath",
"fieldPath",
",",
"@",
"Nullable",
"Object",
"value",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"options",
".",
"startCursor",
"==",
"null",
"&&",
"options",
".",
"... | Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be equal to the specified value.
@param fieldPath The path of the field to compare.
@param value The value for comparison.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"with",
"the",
"additional",
"filter",
"that",
"documents",
"must",
"contain",
"the",
"specified",
"field",
"and",
"the",
"value",
"should",
"be",
"equal",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L429-L447 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowSummarizingLong | public static <E> Stream<LongSummaryStatistics> shiftingWindowSummarizingLong(Stream<E> stream, int rollingFactor, ToLongFunction<? super E> mapper) {
"""
<p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>LongStream</code> that i... | java | public static <E> Stream<LongSummaryStatistics> shiftingWindowSummarizingLong(Stream<E> stream, int rollingFactor, ToLongFunction<? super E> mapper) {
Objects.requireNonNull(stream);
Objects.requireNonNull(mapper);
LongStream longStream = stream.mapToLong(mapper);
return shiftingWindowS... | [
"public",
"static",
"<",
"E",
">",
"Stream",
"<",
"LongSummaryStatistics",
">",
"shiftingWindowSummarizingLong",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"int",
"rollingFactor",
",",
"ToLongFunction",
"<",
"?",
"super",
"E",
">",
"mapper",
")",
"{",
"Obj... | <p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>LongStream</code> that is then rolled following
the same principle as the <code>roll()</code> method. This steps builds a <code>Stream<LongStream></code>.
</p>
<p>Then long summar... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"stream",
"following",
"two",
"steps",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"first",
"steps",
"maps",
"this",
"stream",
"to",
"an",
"<code",
">",
"LongStrea... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L751-L757 |
lucee/Lucee | core/src/main/java/lucee/commons/net/HTTPUtil.java | HTTPUtil.optimizeRealPath | public static String optimizeRealPath(PageContext pc, String realPath) {
"""
/*
public static URL toURL(HttpMethod httpMethod) { HostConfiguration config =
httpMethod.getHostConfiguration();
try { String qs = httpMethod.getQueryString(); if(StringUtil.isEmpty(qs)) return new
URL(config.getProtocol().getSchem... | java | public static String optimizeRealPath(PageContext pc, String realPath) {
int index;
String requestURI = realPath, queryString = null;
if ((index = realPath.indexOf('?')) != -1) {
requestURI = realPath.substring(0, index);
queryString = realPath.substring(index + 1);
}
PageSource ps = PageSourceImpl.best(... | [
"public",
"static",
"String",
"optimizeRealPath",
"(",
"PageContext",
"pc",
",",
"String",
"realPath",
")",
"{",
"int",
"index",
";",
"String",
"requestURI",
"=",
"realPath",
",",
"queryString",
"=",
"null",
";",
"if",
"(",
"(",
"index",
"=",
"realPath",
"... | /*
public static URL toURL(HttpMethod httpMethod) { HostConfiguration config =
httpMethod.getHostConfiguration();
try { String qs = httpMethod.getQueryString(); if(StringUtil.isEmpty(qs)) return new
URL(config.getProtocol().getScheme(),config.getHost(),config.getPort(),httpMethod.getPath());
return new
URL(config.getP... | [
"/",
"*",
"public",
"static",
"URL",
"toURL",
"(",
"HttpMethod",
"httpMethod",
")",
"{",
"HostConfiguration",
"config",
"=",
"httpMethod",
".",
"getHostConfiguration",
"()",
";"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/net/HTTPUtil.java#L388-L399 |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/ShellUtils.java | ShellUtils.execCommand | public static CommandResult execCommand(String command, boolean isRoot) {
"""
execute shell command, default return result msg
@param command command
@param isRoot whether need to run with root
@return
@see ShellUtils#execCommand(String[], boolean, boolean)
"""
return execCommand(new String[]{co... | java | public static CommandResult execCommand(String command, boolean isRoot) {
return execCommand(new String[]{command}, isRoot, true);
} | [
"public",
"static",
"CommandResult",
"execCommand",
"(",
"String",
"command",
",",
"boolean",
"isRoot",
")",
"{",
"return",
"execCommand",
"(",
"new",
"String",
"[",
"]",
"{",
"command",
"}",
",",
"isRoot",
",",
"true",
")",
";",
"}"
] | execute shell command, default return result msg
@param command command
@param isRoot whether need to run with root
@return
@see ShellUtils#execCommand(String[], boolean, boolean) | [
"execute",
"shell",
"command",
"default",
"return",
"result",
"msg"
] | train | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/ShellUtils.java#L44-L46 |
syphr42/prom | src/main/java/org/syphr/prom/ManagedProperties.java | ManagedProperties.getProperties | public Properties getProperties(boolean includeDefaults, String propertyName) {
"""
Retrieve a {@link Properties} object that contains the properties managed
by this instance. If a non-<code>null</code> property name is given, the
values will be the last saved value for each property except the given
one. Other... | java | public Properties getProperties(boolean includeDefaults, String propertyName)
{
Properties tmpProperties = new Properties(defaults);
for (Entry<String, ChangeStack<String>> entry : properties.entrySet())
{
String entryName = entry.getKey();
/*
* If we a... | [
"public",
"Properties",
"getProperties",
"(",
"boolean",
"includeDefaults",
",",
"String",
"propertyName",
")",
"{",
"Properties",
"tmpProperties",
"=",
"new",
"Properties",
"(",
"defaults",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"ChangeStack",
"<",
... | Retrieve a {@link Properties} object that contains the properties managed
by this instance. If a non-<code>null</code> property name is given, the
values will be the last saved value for each property except the given
one. Otherwise, the properties will all be the current values. This is
useful for saving a change to a... | [
"Retrieve",
"a",
"{",
"@link",
"Properties",
"}",
"object",
"that",
"contains",
"the",
"properties",
"managed",
"by",
"this",
"instance",
".",
"If",
"a",
"non",
"-",
"<code",
">",
"null<",
"/",
"code",
">",
"property",
"name",
"is",
"given",
"the",
"valu... | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/ManagedProperties.java#L589-L622 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/ReflectionFragment.java | ReflectionFragment.hasComplexValue | protected boolean hasComplexValue(ControlBeanContext context, Method m, Object[] args) {
"""
A reflection fragment may evaluate to an JdbcControl.ComplexSqlFragment type,
which requires additional steps to evaluate after reflection.
@param context Control bean context.
@param m Method.
@param args Method arg... | java | protected boolean hasComplexValue(ControlBeanContext context, Method m, Object[] args) {
Object val = getParameterValue(context, m, args);
return val instanceof JdbcControl.ComplexSqlFragment;
} | [
"protected",
"boolean",
"hasComplexValue",
"(",
"ControlBeanContext",
"context",
",",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Object",
"val",
"=",
"getParameterValue",
"(",
"context",
",",
"m",
",",
"args",
")",
";",
"return",
"val",
"in... | A reflection fragment may evaluate to an JdbcControl.ComplexSqlFragment type,
which requires additional steps to evaluate after reflection.
@param context Control bean context.
@param m Method.
@param args Method args.
@return true or false. | [
"A",
"reflection",
"fragment",
"may",
"evaluate",
"to",
"an",
"JdbcControl",
".",
"ComplexSqlFragment",
"type",
"which",
"requires",
"additional",
"steps",
"to",
"evaluate",
"after",
"reflection",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/ReflectionFragment.java#L101-L104 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonSchema.java | JsonSchema.getTypeOfArrayItems | public Type getTypeOfArrayItems()
throws DataConversionException {
"""
Fetches the nested or primitive array items type from schema.
@return
@throws DataConversionException
"""
JsonSchema arrayValues = getItemsWithinDataType();
if (arrayValues == null) {
throw new DataConversionException(... | java | public Type getTypeOfArrayItems()
throws DataConversionException {
JsonSchema arrayValues = getItemsWithinDataType();
if (arrayValues == null) {
throw new DataConversionException("Array types only allow values as primitive, null or JsonObject");
}
return arrayValues.getType();
} | [
"public",
"Type",
"getTypeOfArrayItems",
"(",
")",
"throws",
"DataConversionException",
"{",
"JsonSchema",
"arrayValues",
"=",
"getItemsWithinDataType",
"(",
")",
";",
"if",
"(",
"arrayValues",
"==",
"null",
")",
"{",
"throw",
"new",
"DataConversionException",
"(",
... | Fetches the nested or primitive array items type from schema.
@return
@throws DataConversionException | [
"Fetches",
"the",
"nested",
"or",
"primitive",
"array",
"items",
"type",
"from",
"schema",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonSchema.java#L232-L239 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ShakeAroundAPI.java | ShakeAroundAPI.pageUpdate | public static PageUpdateResult pageUpdate(String accessToken,
PageUpdate pageUpdate) {
"""
页面管理-编辑页面信息
@param accessToken accessToken
@param pageUpdate pageUpdate
@return result
"""
return pageUpdate(accessToken, JsonUtil.toJSONString(pageUpdate));
... | java | public static PageUpdateResult pageUpdate(String accessToken,
PageUpdate pageUpdate) {
return pageUpdate(accessToken, JsonUtil.toJSONString(pageUpdate));
} | [
"public",
"static",
"PageUpdateResult",
"pageUpdate",
"(",
"String",
"accessToken",
",",
"PageUpdate",
"pageUpdate",
")",
"{",
"return",
"pageUpdate",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"pageUpdate",
")",
")",
";",
"}"
] | 页面管理-编辑页面信息
@param accessToken accessToken
@param pageUpdate pageUpdate
@return result | [
"页面管理-编辑页面信息"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ShakeAroundAPI.java#L820-L823 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_historyRepaymentConsumption_date_GET | public OvhHistoryRepaymentConsumption billingAccount_historyRepaymentConsumption_date_GET(String billingAccount, java.util.Date date) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/historyRepaymentConsumption/{date}
@param billingAccount [required] The name of your bi... | java | public OvhHistoryRepaymentConsumption billingAccount_historyRepaymentConsumption_date_GET(String billingAccount, java.util.Date date) throws IOException {
String qPath = "/telephony/{billingAccount}/historyRepaymentConsumption/{date}";
StringBuilder sb = path(qPath, billingAccount, date);
String resp = exec(qPath... | [
"public",
"OvhHistoryRepaymentConsumption",
"billingAccount_historyRepaymentConsumption_date_GET",
"(",
"String",
"billingAccount",
",",
"java",
".",
"util",
".",
"Date",
"date",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/history... | Get this object properties
REST: GET /telephony/{billingAccount}/historyRepaymentConsumption/{date}
@param billingAccount [required] The name of your billingAccount
@param date [required] date of the bill | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8428-L8433 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ResultUtil.java | ResultUtil.getAggBuckets | public static Object getAggBuckets(Map<String,?> map ,String metrics) {
"""
{
"key": "demoproject",
"doc_count": 30,
"successsums": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 0,
"doc_count": 30
}
]
}
},
@param map
@param metrics successsums->buckets
@retur... | java | public static Object getAggBuckets(Map<String,?> map ,String metrics){
if(map != null){
Map<String,Object> metrics_ = (Map<String,Object>)map.get(metrics);
if(metrics_ != null){
return metrics_.get("buckets");
}
}
return null;
} | [
"public",
"static",
"Object",
"getAggBuckets",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"map",
",",
"String",
"metrics",
")",
"{",
"if",
"(",
"map",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"metrics_",
"=",
"(",
"Map",
"<"... | {
"key": "demoproject",
"doc_count": 30,
"successsums": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 0,
"doc_count": 30
}
]
}
},
@param map
@param metrics successsums->buckets
@return | [
"{",
"key",
":",
"demoproject",
"doc_count",
":",
"30",
"successsums",
":",
"{",
"doc_count_error_upper_bound",
":",
"0",
"sum_other_doc_count",
":",
"0",
"buckets",
":",
"[",
"{",
"key",
":",
"0",
"doc_count",
":",
"30",
"}",
"]",
"}",
"}",
"@param",
"m... | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ResultUtil.java#L723-L731 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/data/NaryTree.java | NaryTree.leftBinarize | public BinaryTree leftBinarize() {
"""
Get a left-binarized form of this tree.
This returns a binarized form that relabels the nodes just as in the
Berkeley parser.
"""
BinaryTree leftChild;
BinaryTree rightChild;
if (isLeaf()) {
leftChild = null;
rightChild ... | java | public BinaryTree leftBinarize() {
BinaryTree leftChild;
BinaryTree rightChild;
if (isLeaf()) {
leftChild = null;
rightChild = null;
} else if (children.size() == 1) {
leftChild = children.get(0).leftBinarize();
rightChild = null;
}... | [
"public",
"BinaryTree",
"leftBinarize",
"(",
")",
"{",
"BinaryTree",
"leftChild",
";",
"BinaryTree",
"rightChild",
";",
"if",
"(",
"isLeaf",
"(",
")",
")",
"{",
"leftChild",
"=",
"null",
";",
"rightChild",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"child... | Get a left-binarized form of this tree.
This returns a binarized form that relabels the nodes just as in the
Berkeley parser. | [
"Get",
"a",
"left",
"-",
"binarized",
"form",
"of",
"this",
"tree",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/data/NaryTree.java#L417-L451 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/windows/CreateTableDialog.java | CreateTableDialog.isCreateTableAppropriate | public static boolean isCreateTableAppropriate(final Datastore datastore, final Schema schema) {
"""
Determines if it is appropriate/possible to create a table in a
particular schema or a particular datastore.
@param datastore
@param schema
@return
"""
if (datastore == null || schema == null) {
... | java | public static boolean isCreateTableAppropriate(final Datastore datastore, final Schema schema) {
if (datastore == null || schema == null) {
return false;
}
if (!(datastore instanceof UpdateableDatastore)) {
return false;
}
if (datastore instanceof CsvDatas... | [
"public",
"static",
"boolean",
"isCreateTableAppropriate",
"(",
"final",
"Datastore",
"datastore",
",",
"final",
"Schema",
"schema",
")",
"{",
"if",
"(",
"datastore",
"==",
"null",
"||",
"schema",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
... | Determines if it is appropriate/possible to create a table in a
particular schema or a particular datastore.
@param datastore
@param schema
@return | [
"Determines",
"if",
"it",
"is",
"appropriate",
"/",
"possible",
"to",
"create",
"a",
"table",
"in",
"a",
"particular",
"schema",
"or",
"a",
"particular",
"datastore",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/windows/CreateTableDialog.java#L117-L134 |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BytesUtils.java | BytesUtils.setBit | public static byte setBit(final byte pData, final int pBitIndex, final boolean pOn) {
"""
Method used to set a bit index to 1 or 0.
@param pData
data to modify
@param pBitIndex
index to set
@param pOn
set bit at specified index to 1 or 0
@return the modified byte
"""
if (pBitIndex < 0 || pBitIndex ... | java | public static byte setBit(final byte pData, final int pBitIndex, final boolean pOn) {
if (pBitIndex < 0 || pBitIndex > 7) {
throw new IllegalArgumentException("parameter 'pBitIndex' must be between 0 and 7. pBitIndex=" + pBitIndex);
}
byte ret = pData;
if (pOn) { // Set bit
ret |= 1 << pBitIndex;
... | [
"public",
"static",
"byte",
"setBit",
"(",
"final",
"byte",
"pData",
",",
"final",
"int",
"pBitIndex",
",",
"final",
"boolean",
"pOn",
")",
"{",
"if",
"(",
"pBitIndex",
"<",
"0",
"||",
"pBitIndex",
">",
"7",
")",
"{",
"throw",
"new",
"IllegalArgumentExce... | Method used to set a bit index to 1 or 0.
@param pData
data to modify
@param pBitIndex
index to set
@param pOn
set bit at specified index to 1 or 0
@return the modified byte | [
"Method",
"used",
"to",
"set",
"a",
"bit",
"index",
"to",
"1",
"or",
"0",
"."
] | train | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BytesUtils.java#L265-L276 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java | SpiderSession.objectQuery | public QueryResult objectQuery(String tableName,
String queryText,
String fieldNames,
int pageSize,
String afterObjID,
String sortOrder) ... | java | public QueryResult objectQuery(String tableName,
String queryText,
String fieldNames,
int pageSize,
String afterObjID,
String sortOrder) ... | [
"public",
"QueryResult",
"objectQuery",
"(",
"String",
"tableName",
",",
"String",
"queryText",
",",
"String",
"fieldNames",
",",
"int",
"pageSize",
",",
"String",
"afterObjID",
",",
"String",
"sortOrder",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
... | Perform an object query for the given table and query parameters. This is a
convenience method for Spider applications that bundles the given parameters into
a Map<String,String> and calls {@link #objectQuery(String, Map)}. String parameters
should *not* be URL-encoded. Optional, unused parameters can be null or empty ... | [
"Perform",
"an",
"object",
"query",
"for",
"the",
"given",
"table",
"and",
"query",
"parameters",
".",
"This",
"is",
"a",
"convenience",
"method",
"for",
"Spider",
"applications",
"that",
"bundles",
"the",
"given",
"parameters",
"into",
"a",
"Map<String",
"Str... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java#L506-L529 |
softindex/datakernel | cloud-fs/src/main/java/io/datakernel/remotefs/LocalFsClient.java | LocalFsClient.create | public static LocalFsClient create(Eventloop eventloop, Path storageDir, Object lock) {
"""
Use this to synchronize multiple LocalFsClient's over some filesystem space
that they may all try to access (same storage folder, one storage is subfolder of another etc.)
"""
return new LocalFsClient(eventloop, stor... | java | public static LocalFsClient create(Eventloop eventloop, Path storageDir, Object lock) {
return new LocalFsClient(eventloop, storageDir, Executors.newSingleThreadExecutor(), lock);
} | [
"public",
"static",
"LocalFsClient",
"create",
"(",
"Eventloop",
"eventloop",
",",
"Path",
"storageDir",
",",
"Object",
"lock",
")",
"{",
"return",
"new",
"LocalFsClient",
"(",
"eventloop",
",",
"storageDir",
",",
"Executors",
".",
"newSingleThreadExecutor",
"(",
... | Use this to synchronize multiple LocalFsClient's over some filesystem space
that they may all try to access (same storage folder, one storage is subfolder of another etc.) | [
"Use",
"this",
"to",
"synchronize",
"multiple",
"LocalFsClient",
"s",
"over",
"some",
"filesystem",
"space",
"that",
"they",
"may",
"all",
"try",
"to",
"access",
"(",
"same",
"storage",
"folder",
"one",
"storage",
"is",
"subfolder",
"of",
"another",
"etc",
"... | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-fs/src/main/java/io/datakernel/remotefs/LocalFsClient.java#L168-L170 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.scale | public static void scale(Image srcImage, ImageOutputStream destImageStream, int width, int height, Color fixedColor) throws IORuntimeException {
"""
缩放图像(按高度和宽度缩放)<br>
缩放后默认为jpeg格式,此方法并不关闭流
@param srcImage 源图像
@param destImageStream 缩放后的图像目标流
@param width 缩放后的宽度
@param height 缩放后的高度
@param fixedColor 比例不对时... | java | public static void scale(Image srcImage, ImageOutputStream destImageStream, int width, int height, Color fixedColor) throws IORuntimeException {
writeJpg(scale(srcImage, width, height, fixedColor), destImageStream);
} | [
"public",
"static",
"void",
"scale",
"(",
"Image",
"srcImage",
",",
"ImageOutputStream",
"destImageStream",
",",
"int",
"width",
",",
"int",
"height",
",",
"Color",
"fixedColor",
")",
"throws",
"IORuntimeException",
"{",
"writeJpg",
"(",
"scale",
"(",
"srcImage"... | 缩放图像(按高度和宽度缩放)<br>
缩放后默认为jpeg格式,此方法并不关闭流
@param srcImage 源图像
@param destImageStream 缩放后的图像目标流
@param width 缩放后的宽度
@param height 缩放后的高度
@param fixedColor 比例不对时补充的颜色,不补充为<code>null</code>
@throws IORuntimeException IO异常 | [
"缩放图像(按高度和宽度缩放)<br",
">",
"缩放后默认为jpeg格式,此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L229-L231 |
strator-dev/greenpepper | greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/plugin/FixtureCompilerMojo.java | FixtureCompilerMojo.getSourceInclusionScanner | @SuppressWarnings("unchecked")
protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis ) {
"""
<p>getSourceInclusionScanner.</p>
@param staleMillis a int.
@return a {@link org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner} object.
"""
SourceInclusionScanner scann... | java | @SuppressWarnings("unchecked")
protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis )
{
SourceInclusionScanner scanner;
if ( testIncludes.isEmpty() && testExcludes.isEmpty() )
{
scanner = new StaleSourceScanner( staleMillis );
}
else
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"SourceInclusionScanner",
"getSourceInclusionScanner",
"(",
"int",
"staleMillis",
")",
"{",
"SourceInclusionScanner",
"scanner",
";",
"if",
"(",
"testIncludes",
".",
"isEmpty",
"(",
")",
"&&",
"testExclu... | <p>getSourceInclusionScanner.</p>
@param staleMillis a int.
@return a {@link org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner} object. | [
"<p",
">",
"getSourceInclusionScanner",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/plugin/FixtureCompilerMojo.java#L144-L163 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/sql/ObjectReader.java | ObjectReader.buildWhereClause | private String buildWhereClause(String[] pKeys, Hashtable pMapping) {
"""
Builds extra SQL WHERE clause
@param keys An array of ID names
@param mapping The hashtable containing the object mapping
@return A string containing valid SQL
"""
StringBuilder sqlBuf = new StringBuilder();
fo... | java | private String buildWhereClause(String[] pKeys, Hashtable pMapping) {
StringBuilder sqlBuf = new StringBuilder();
for (int i = 0; i < pKeys.length; i++) {
String column = (String) pMapping.get(pKeys[i]);
sqlBuf.append(" AND ");
sqlBuf.append(column);
... | [
"private",
"String",
"buildWhereClause",
"(",
"String",
"[",
"]",
"pKeys",
",",
"Hashtable",
"pMapping",
")",
"{",
"StringBuilder",
"sqlBuf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pKeys",
".",
"le... | Builds extra SQL WHERE clause
@param keys An array of ID names
@param mapping The hashtable containing the object mapping
@return A string containing valid SQL | [
"Builds",
"extra",
"SQL",
"WHERE",
"clause"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/sql/ObjectReader.java#L524-L536 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getIntHeader | public int getIntHeader(int radix, String name, int defaultValue) {
"""
获取指定的header的int值, 没有返回默认int值
@param radix 进制数
@param name header名
@param defaultValue 默认int值
@return header值
"""
return header.getIntValue(radix, name, defaultValue);
} | java | public int getIntHeader(int radix, String name, int defaultValue) {
return header.getIntValue(radix, name, defaultValue);
} | [
"public",
"int",
"getIntHeader",
"(",
"int",
"radix",
",",
"String",
"name",
",",
"int",
"defaultValue",
")",
"{",
"return",
"header",
".",
"getIntValue",
"(",
"radix",
",",
"name",
",",
"defaultValue",
")",
";",
"}"
] | 获取指定的header的int值, 没有返回默认int值
@param radix 进制数
@param name header名
@param defaultValue 默认int值
@return header值 | [
"获取指定的header的int值",
"没有返回默认int值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L1132-L1134 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/WeeklyAutoScalingSchedule.java | WeeklyAutoScalingSchedule.withWednesday | public WeeklyAutoScalingSchedule withWednesday(java.util.Map<String, String> wednesday) {
"""
<p>
The schedule for Wednesday.
</p>
@param wednesday
The schedule for Wednesday.
@return Returns a reference to this object so that method calls can be chained together.
"""
setWednesday(wednesday);
... | java | public WeeklyAutoScalingSchedule withWednesday(java.util.Map<String, String> wednesday) {
setWednesday(wednesday);
return this;
} | [
"public",
"WeeklyAutoScalingSchedule",
"withWednesday",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"wednesday",
")",
"{",
"setWednesday",
"(",
"wednesday",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The schedule for Wednesday.
</p>
@param wednesday
The schedule for Wednesday.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"schedule",
"for",
"Wednesday",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/WeeklyAutoScalingSchedule.java#L265-L268 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/PersistenceDelegator.java | PersistenceDelegator.createQuery | Query createQuery(String jpaQuery, final String persistenceUnit) {
"""
Creates the query.
@param jpaQuery
the jpa query
@return the query
"""
Client client = getClient(persistenceUnit);
EntityMetadata metadata = null;
try
{
metadata = KunderaMetadataManager.getM... | java | Query createQuery(String jpaQuery, final String persistenceUnit)
{
Client client = getClient(persistenceUnit);
EntityMetadata metadata = null;
try
{
metadata = KunderaMetadataManager.getMetamodel(kunderaMetadata, client.getPersistenceUnit())
.getEntity... | [
"Query",
"createQuery",
"(",
"String",
"jpaQuery",
",",
"final",
"String",
"persistenceUnit",
")",
"{",
"Client",
"client",
"=",
"getClient",
"(",
"persistenceUnit",
")",
";",
"EntityMetadata",
"metadata",
"=",
"null",
";",
"try",
"{",
"metadata",
"=",
"Kunder... | Creates the query.
@param jpaQuery
the jpa query
@return the query | [
"Creates",
"the",
"query",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/PersistenceDelegator.java#L531-L548 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/AccountUpdater.java | AccountUpdater.setAvatar | public AccountUpdater setAvatar(InputStream avatar, String fileType) {
"""
Queues the avatar of the connected account to get updated.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
"""
deleg... | java | public AccountUpdater setAvatar(InputStream avatar, String fileType) {
delegate.setAvatar(avatar, fileType);
return this;
} | [
"public",
"AccountUpdater",
"setAvatar",
"(",
"InputStream",
"avatar",
",",
"String",
"fileType",
")",
"{",
"delegate",
".",
"setAvatar",
"(",
"avatar",
",",
"fileType",
")",
";",
"return",
"this",
";",
"}"
] | Queues the avatar of the connected account to get updated.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods. | [
"Queues",
"the",
"avatar",
"of",
"the",
"connected",
"account",
"to",
"get",
"updated",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/AccountUpdater.java#L143-L146 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/CurrentDirectoryUrlPhrase.java | CurrentDirectoryUrlPhrase.evaluate | public Object evaluate(TaskRequest req, TaskResponse res) {
"""
Always returns a <code>URL</code> representation of the filesystem
directory from which Java is executing.
@param req Representations the input to the current task.
@param res Representations the output of the current task.
@return The final, ac... | java | public Object evaluate(TaskRequest req, TaskResponse res) {
String rslt = null;
try {
rslt = new File(".").toURI().toURL().toExternalForm();
} catch (Throwable t) {
String msg = "Unable to represent the current directory as a URL.";
throw new RuntimeException(msg, t);
}
return rslt;
} | [
"public",
"Object",
"evaluate",
"(",
"TaskRequest",
"req",
",",
"TaskResponse",
"res",
")",
"{",
"String",
"rslt",
"=",
"null",
";",
"try",
"{",
"rslt",
"=",
"new",
"File",
"(",
"\".\"",
")",
".",
"toURI",
"(",
")",
".",
"toURL",
"(",
")",
".",
"to... | Always returns a <code>URL</code> representation of the filesystem
directory from which Java is executing.
@param req Representations the input to the current task.
@param res Representations the output of the current task.
@return The final, actual value of this <code>Phrase</code>. | [
"Always",
"returns",
"a",
"<code",
">",
"URL<",
"/",
"code",
">",
"representation",
"of",
"the",
"filesystem",
"directory",
"from",
"which",
"Java",
"is",
"executing",
"."
] | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/CurrentDirectoryUrlPhrase.java#L51-L60 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java | JsonUtils.fromInputStream | public static Object fromInputStream(InputStream input, String enc) throws IOException {
"""
Parses a JSON-LD document from the given {@link InputStream} to an object
that can be used as input for the {@link JsonLdApi} and
{@link JsonLdProcessor} methods.
@param input
The JSON-LD document in an InputStream.
... | java | public static Object fromInputStream(InputStream input, String enc) throws IOException {
return fromInputStream(input, Charset.forName(enc));
} | [
"public",
"static",
"Object",
"fromInputStream",
"(",
"InputStream",
"input",
",",
"String",
"enc",
")",
"throws",
"IOException",
"{",
"return",
"fromInputStream",
"(",
"input",
",",
"Charset",
".",
"forName",
"(",
"enc",
")",
")",
";",
"}"
] | Parses a JSON-LD document from the given {@link InputStream} to an object
that can be used as input for the {@link JsonLdApi} and
{@link JsonLdProcessor} methods.
@param input
The JSON-LD document in an InputStream.
@param enc
The character encoding to use when interpreting the characters
in the InputStream.
@return A... | [
"Parses",
"a",
"JSON",
"-",
"LD",
"document",
"from",
"the",
"given",
"{",
"@link",
"InputStream",
"}",
"to",
"an",
"object",
"that",
"can",
"be",
"used",
"as",
"input",
"for",
"the",
"{",
"@link",
"JsonLdApi",
"}",
"and",
"{",
"@link",
"JsonLdProcessor"... | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java#L131-L133 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/PGStream.java | PGStream.receive | public void receive(byte[] buf, int off, int siz) throws IOException {
"""
Reads in a given number of bytes from the backend.
@param buf buffer to store result
@param off offset in buffer
@param siz number of bytes to read
@throws IOException if a data I/O error occurs
"""
int s = 0;
while (s < ... | java | public void receive(byte[] buf, int off, int siz) throws IOException {
int s = 0;
while (s < siz) {
int w = pgInput.read(buf, off + s, siz - s);
if (w < 0) {
throw new EOFException();
}
s += w;
}
} | [
"public",
"void",
"receive",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"siz",
")",
"throws",
"IOException",
"{",
"int",
"s",
"=",
"0",
";",
"while",
"(",
"s",
"<",
"siz",
")",
"{",
"int",
"w",
"=",
"pgInput",
".",
"read",
"("... | Reads in a given number of bytes from the backend.
@param buf buffer to store result
@param off offset in buffer
@param siz number of bytes to read
@throws IOException if a data I/O error occurs | [
"Reads",
"in",
"a",
"given",
"number",
"of",
"bytes",
"from",
"the",
"backend",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L473-L483 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/SetOptions.java | SetOptions.mergeFields | @Nonnull
public static SetOptions mergeFields(List<String> fields) {
"""
Changes the behavior of set() calls to only replace the fields under fieldPaths. Any field that
is not specified in fieldPaths is ignored and remains untouched.
<p>It is an error to pass a SetOptions object to a set() call that is missi... | java | @Nonnull
public static SetOptions mergeFields(List<String> fields) {
List<FieldPath> fieldPaths = new ArrayList<>();
for (String field : fields) {
fieldPaths.add(FieldPath.fromDotSeparatedString(field));
}
return new SetOptions(true, fieldPaths);
} | [
"@",
"Nonnull",
"public",
"static",
"SetOptions",
"mergeFields",
"(",
"List",
"<",
"String",
">",
"fields",
")",
"{",
"List",
"<",
"FieldPath",
">",
"fieldPaths",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"field",
":",
"fields",... | Changes the behavior of set() calls to only replace the fields under fieldPaths. Any field that
is not specified in fieldPaths is ignored and remains untouched.
<p>It is an error to pass a SetOptions object to a set() call that is missing a value for any
of the fields specified here.
@param fields The list of fields ... | [
"Changes",
"the",
"behavior",
"of",
"set",
"()",
"calls",
"to",
"only",
"replace",
"the",
"fields",
"under",
"fieldPaths",
".",
"Any",
"field",
"that",
"is",
"not",
"specified",
"in",
"fieldPaths",
"is",
"ignored",
"and",
"remains",
"untouched",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/SetOptions.java#L76-L85 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/search/queries/DateRangeQuery.java | DateRangeQuery.start | public DateRangeQuery start(Date start, boolean inclusive) {
"""
Sets the lower boundary of the range, inclusive or not depending on the second parameter.
Works with a {@link Date} object, which is converted to RFC 3339 format using
{@link SearchUtils#toFtsUtcString(Date)}, so you shouldn't use a non-default {... | java | public DateRangeQuery start(Date start, boolean inclusive) {
this.start = SearchUtils.toFtsUtcString(start);
this.inclusiveStart = inclusive;
return this;
} | [
"public",
"DateRangeQuery",
"start",
"(",
"Date",
"start",
",",
"boolean",
"inclusive",
")",
"{",
"this",
".",
"start",
"=",
"SearchUtils",
".",
"toFtsUtcString",
"(",
"start",
")",
";",
"this",
".",
"inclusiveStart",
"=",
"inclusive",
";",
"return",
"this",... | Sets the lower boundary of the range, inclusive or not depending on the second parameter.
Works with a {@link Date} object, which is converted to RFC 3339 format using
{@link SearchUtils#toFtsUtcString(Date)}, so you shouldn't use a non-default {@link #dateTimeParser(String)}
after that. | [
"Sets",
"the",
"lower",
"boundary",
"of",
"the",
"range",
"inclusive",
"or",
"not",
"depending",
"on",
"the",
"second",
"parameter",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/search/queries/DateRangeQuery.java#L96-L100 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.equationsToString | public String equationsToString(String prefix, int fractionDigits) {
"""
Returns a string representation of this equation system.
@param prefix the prefix of each line
@param fractionDigits the number of fraction digits for output accuracy
@return a string representation of this equation system
"""
De... | java | public String equationsToString(String prefix, int fractionDigits) {
DecimalFormat nf = new DecimalFormat();
nf.setMinimumFractionDigits(fractionDigits);
nf.setMaximumFractionDigits(fractionDigits);
nf.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US));
nf.setNegativePrefix("");
nf.set... | [
"public",
"String",
"equationsToString",
"(",
"String",
"prefix",
",",
"int",
"fractionDigits",
")",
"{",
"DecimalFormat",
"nf",
"=",
"new",
"DecimalFormat",
"(",
")",
";",
"nf",
".",
"setMinimumFractionDigits",
"(",
"fractionDigits",
")",
";",
"nf",
".",
"set... | Returns a string representation of this equation system.
@param prefix the prefix of each line
@param fractionDigits the number of fraction digits for output accuracy
@return a string representation of this equation system | [
"Returns",
"a",
"string",
"representation",
"of",
"this",
"equation",
"system",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L275-L283 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/workspace/WorkspaceUtils.java | WorkspaceUtils.assertNoWorkspacesOpen | public static void assertNoWorkspacesOpen(String msg, boolean allowScopedOut) throws ND4JWorkspaceException {
"""
Assert that no workspaces are currently open
@param msg Message to include in the exception, if required
@param allowScopedOut If true: don't fail if we have an open workspace but are currently sco... | java | public static void assertNoWorkspacesOpen(String msg, boolean allowScopedOut) throws ND4JWorkspaceException {
if (Nd4j.getWorkspaceManager().anyWorkspaceActiveForCurrentThread()) {
MemoryWorkspace currWs = Nd4j.getMemoryManager().getCurrentWorkspace();
if(allowScopedOut && (currWs == nu... | [
"public",
"static",
"void",
"assertNoWorkspacesOpen",
"(",
"String",
"msg",
",",
"boolean",
"allowScopedOut",
")",
"throws",
"ND4JWorkspaceException",
"{",
"if",
"(",
"Nd4j",
".",
"getWorkspaceManager",
"(",
")",
".",
"anyWorkspaceActiveForCurrentThread",
"(",
")",
... | Assert that no workspaces are currently open
@param msg Message to include in the exception, if required
@param allowScopedOut If true: don't fail if we have an open workspace but are currently scoped out | [
"Assert",
"that",
"no",
"workspaces",
"are",
"currently",
"open"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/workspace/WorkspaceUtils.java#L56-L72 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.toStr | public static String toStr(Number number, String defaultValue) {
"""
数字转字符串<br>
调用{@link Number#toString()},并去除尾小数点儿后多余的0
@param number A Number
@param defaultValue 如果number参数为{@code null},返回此默认值
@return A String.
@since 3.0.9
"""
return (null == number) ? defaultValue : toStr(number);
} | java | public static String toStr(Number number, String defaultValue) {
return (null == number) ? defaultValue : toStr(number);
} | [
"public",
"static",
"String",
"toStr",
"(",
"Number",
"number",
",",
"String",
"defaultValue",
")",
"{",
"return",
"(",
"null",
"==",
"number",
")",
"?",
"defaultValue",
":",
"toStr",
"(",
"number",
")",
";",
"}"
] | 数字转字符串<br>
调用{@link Number#toString()},并去除尾小数点儿后多余的0
@param number A Number
@param defaultValue 如果number参数为{@code null},返回此默认值
@return A String.
@since 3.0.9 | [
"数字转字符串<br",
">",
"调用",
"{",
"@link",
"Number#toString",
"()",
"}",
",并去除尾小数点儿后多余的0"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1856-L1858 |
snowtide/lucene-pdf | src/java/com/snowtide/pdf/lucene/LucenePDFConfiguration.java | LucenePDFConfiguration.setBodyTextSettings | public void setBodyTextSettings (boolean store, boolean index, boolean token) {
"""
Sets Field attributes that will be used when creating the Field object for the main text content of
a PDF document. These attributes correspond to the <code>store</code>,
<code>index</code>, and <code>token</code> parameters of ... | java | public void setBodyTextSettings (boolean store, boolean index, boolean token) {
indexBodyText = index;
storeBodyText = store;
tokenizeBodyText = token;
} | [
"public",
"void",
"setBodyTextSettings",
"(",
"boolean",
"store",
",",
"boolean",
"index",
",",
"boolean",
"token",
")",
"{",
"indexBodyText",
"=",
"index",
";",
"storeBodyText",
"=",
"store",
";",
"tokenizeBodyText",
"=",
"token",
";",
"}"
] | Sets Field attributes that will be used when creating the Field object for the main text content of
a PDF document. These attributes correspond to the <code>store</code>,
<code>index</code>, and <code>token</code> parameters of the {@link org.apache.lucene.document.Field}
constructor before Lucene v4.x and the same-na... | [
"Sets",
"Field",
"attributes",
"that",
"will",
"be",
"used",
"when",
"creating",
"the",
"Field",
"object",
"for",
"the",
"main",
"text",
"content",
"of",
"a",
"PDF",
"document",
".",
"These",
"attributes",
"correspond",
"to",
"the",
"<code",
">",
"store<",
... | train | https://github.com/snowtide/lucene-pdf/blob/1d97a877912bcfb354d3e8bff8275c92397db133/src/java/com/snowtide/pdf/lucene/LucenePDFConfiguration.java#L123-L127 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelUtilsBase.java | ChannelUtilsBase.traceChains | protected final void traceChains(Object logTool, ChannelFramework cfw, Class<?> factory, String message, String prefix) {
"""
Display configured channel chains.
@param logTool
Caller's LogTool (should be Logger OR TraceComponent)
@param cfw
Reference to channel framework service
@param factory
Factory clas... | java | protected final void traceChains(Object logTool, ChannelFramework cfw, Class<?> factory, String message, String prefix) {
ChainData[] chains = null;
String fstring = "(" + (factory == null ? "no factory specified" : factory.getName()) + ")";
if (cfw == null) {
debugTrace(logTool, pr... | [
"protected",
"final",
"void",
"traceChains",
"(",
"Object",
"logTool",
",",
"ChannelFramework",
"cfw",
",",
"Class",
"<",
"?",
">",
"factory",
",",
"String",
"message",
",",
"String",
"prefix",
")",
"{",
"ChainData",
"[",
"]",
"chains",
"=",
"null",
";",
... | Display configured channel chains.
@param logTool
Caller's LogTool (should be Logger OR TraceComponent)
@param cfw
Reference to channel framework service
@param factory
Factory class that chains to be traced are associated with
(e.g. ORBInboundChannelFactory.. )
@param message
Description to accompany trace, e.g. "CFW... | [
"Display",
"configured",
"channel",
"chains",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelUtilsBase.java#L62-L85 |
GumTreeDiff/gumtree | core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java | RtedAlgorithm.spfR | private double spfR(InfoTree it1, InfoTree it2) {
"""
Single-path function for right-most path based on symmetric version of
Zhang and Shasha algorithm.
@param it1
@param it2
@return distance between subtrees it1 and it2
"""
int fReversedPostorder = it1.getSize() - 1 - it1.info[POST2_PRE][it1.getCurre... | java | private double spfR(InfoTree it1, InfoTree it2) {
int fReversedPostorder = it1.getSize() - 1 - it1.info[POST2_PRE][it1.getCurrentNode()];
int gReversedPostorder = it2.getSize() - 1 - it2.info[POST2_PRE][it2.getCurrentNode()];
int minRKR = it2.info[RPOST2_MIN_RKR][gReversedPostorder];
int[] rkr = it2.info[RKR]... | [
"private",
"double",
"spfR",
"(",
"InfoTree",
"it1",
",",
"InfoTree",
"it2",
")",
"{",
"int",
"fReversedPostorder",
"=",
"it1",
".",
"getSize",
"(",
")",
"-",
"1",
"-",
"it1",
".",
"info",
"[",
"POST2_PRE",
"]",
"[",
"it1",
".",
"getCurrentNode",
"(",
... | Single-path function for right-most path based on symmetric version of
Zhang and Shasha algorithm.
@param it1
@param it2
@return distance between subtrees it1 and it2 | [
"Single",
"-",
"path",
"function",
"for",
"right",
"-",
"most",
"path",
"based",
"on",
"symmetric",
"version",
"of",
"Zhang",
"and",
"Shasha",
"algorithm",
"."
] | train | https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java#L494-L510 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java | RtcpHandler.scheduleRtcp | private void scheduleRtcp(long timestamp, RtcpPacketType packetType) {
"""
Schedules an event to occur at a certain time.
@param timestamp The time (in milliseconds) when the event should be fired
@param packet The RTCP packet to be sent when the timer expires
"""
// Create the task and schedule it... | java | private void scheduleRtcp(long timestamp, RtcpPacketType packetType) {
// Create the task and schedule it
long interval = resolveInterval(timestamp);
this.scheduledTask = new TxTask(packetType);
try {
this.reportTaskFuture = this.scheduler.schedule(this.scheduledTask, interv... | [
"private",
"void",
"scheduleRtcp",
"(",
"long",
"timestamp",
",",
"RtcpPacketType",
"packetType",
")",
"{",
"// Create the task and schedule it",
"long",
"interval",
"=",
"resolveInterval",
"(",
"timestamp",
")",
";",
"this",
".",
"scheduledTask",
"=",
"new",
"TxTas... | Schedules an event to occur at a certain time.
@param timestamp The time (in milliseconds) when the event should be fired
@param packet The RTCP packet to be sent when the timer expires | [
"Schedules",
"an",
"event",
"to",
"occur",
"at",
"a",
"certain",
"time",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpHandler.java#L225-L237 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractQueryImpl.java | AbstractQueryImpl.bindValue | public void bindValue(InternalQName varName, Value value) throws IllegalArgumentException, RepositoryException {
"""
Binds the given <code>value</code> to the variable named
<code>varName</code>.
@param varName name of variable in query
@param value value to bind
@throws IllegalArgumentException if <code>v... | java | public void bindValue(InternalQName varName, Value value) throws IllegalArgumentException, RepositoryException
{
if (!variableNames.contains(varName))
{
throw new IllegalArgumentException("not a valid variable in this query");
}
else
{
bindValues.put(varName, value);
... | [
"public",
"void",
"bindValue",
"(",
"InternalQName",
"varName",
",",
"Value",
"value",
")",
"throws",
"IllegalArgumentException",
",",
"RepositoryException",
"{",
"if",
"(",
"!",
"variableNames",
".",
"contains",
"(",
"varName",
")",
")",
"{",
"throw",
"new",
... | Binds the given <code>value</code> to the variable named
<code>varName</code>.
@param varName name of variable in query
@param value value to bind
@throws IllegalArgumentException if <code>varName</code> is not a valid
variable in this query.
@throws RepositoryException if an error occurs. | [
"Binds",
"the",
"given",
"<code",
">",
"value<",
"/",
"code",
">",
"to",
"the",
"variable",
"named",
"<code",
">",
"varName<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractQueryImpl.java#L153-L163 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/SailthruClient.java | SailthruClient.getTemplate | public JsonResponse getTemplate(String template) throws IOException {
"""
Get template information
@param template template name
@throws IOException
"""
Map<String, Object> data = new HashMap<String, Object>();
data.put(Template.PARAM_TEMPLATE, template);
return apiGet(ApiAction.templ... | java | public JsonResponse getTemplate(String template) throws IOException {
Map<String, Object> data = new HashMap<String, Object>();
data.put(Template.PARAM_TEMPLATE, template);
return apiGet(ApiAction.template, data);
} | [
"public",
"JsonResponse",
"getTemplate",
"(",
"String",
"template",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
"... | Get template information
@param template template name
@throws IOException | [
"Get",
"template",
"information"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L281-L285 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java | ApiOvhVrack.serviceName_dedicatedServer_dedicatedServer_GET | public OvhDedicatedServer serviceName_dedicatedServer_dedicatedServer_GET(String serviceName, String dedicatedServer) throws IOException {
"""
Get this object properties
REST: GET /vrack/{serviceName}/dedicatedServer/{dedicatedServer}
@param serviceName [required] The internal name of your vrack
@param dedica... | java | public OvhDedicatedServer serviceName_dedicatedServer_dedicatedServer_GET(String serviceName, String dedicatedServer) throws IOException {
String qPath = "/vrack/{serviceName}/dedicatedServer/{dedicatedServer}";
StringBuilder sb = path(qPath, serviceName, dedicatedServer);
String resp = exec(qPath, "GET", sb.toSt... | [
"public",
"OvhDedicatedServer",
"serviceName_dedicatedServer_dedicatedServer_GET",
"(",
"String",
"serviceName",
",",
"String",
"dedicatedServer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vrack/{serviceName}/dedicatedServer/{dedicatedServer}\"",
";",
"String... | Get this object properties
REST: GET /vrack/{serviceName}/dedicatedServer/{dedicatedServer}
@param serviceName [required] The internal name of your vrack
@param dedicatedServer [required] Dedicated Server | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java#L292-L297 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Shape.java | Shape.setScale | @Override
public T setScale(final double x, final double y) {
"""
Sets this shape's scale, starting at the given x and y
@param x
@param y
@return T
"""
getAttributes().setScale(x, y);
return cast();
} | java | @Override
public T setScale(final double x, final double y)
{
getAttributes().setScale(x, y);
return cast();
} | [
"@",
"Override",
"public",
"T",
"setScale",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"getAttributes",
"(",
")",
".",
"setScale",
"(",
"x",
",",
"y",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets this shape's scale, starting at the given x and y
@param x
@param y
@return T | [
"Sets",
"this",
"shape",
"s",
"scale",
"starting",
"at",
"the",
"given",
"x",
"and",
"y"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1154-L1160 |
rahulsom/genealogy | src/main/java/com/github/rahulsom/genealogy/DataUtil.java | DataUtil.processResource | private static void processResource(String resourceName, AbstractProcessor processor) {
"""
Processes a given resource using provided closure
@param resourceName resource to fetch from classpath
@param processor how to process the resource
"""
InputStream lastNameStream = NameDbUsa.class.getClas... | java | private static void processResource(String resourceName, AbstractProcessor processor) {
InputStream lastNameStream = NameDbUsa.class.getClassLoader().getResourceAsStream(resourceName);
BufferedReader lastNameReader = new BufferedReader(new InputStreamReader(lastNameStream));
try {
in... | [
"private",
"static",
"void",
"processResource",
"(",
"String",
"resourceName",
",",
"AbstractProcessor",
"processor",
")",
"{",
"InputStream",
"lastNameStream",
"=",
"NameDbUsa",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",
"(",
"resour... | Processes a given resource using provided closure
@param resourceName resource to fetch from classpath
@param processor how to process the resource | [
"Processes",
"a",
"given",
"resource",
"using",
"provided",
"closure"
] | train | https://github.com/rahulsom/genealogy/blob/2beb35ab9c6e03080328aa08b18f0a3c5d3f5c12/src/main/java/com/github/rahulsom/genealogy/DataUtil.java#L97-L109 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java | ClustersInner.checkNameAvailability | public CheckNameResultInner checkNameAvailability(String location, String name) {
"""
Checks that the cluster name is valid and is not already in use.
@param location Azure location.
@param name Cluster name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thr... | java | public CheckNameResultInner checkNameAvailability(String location, String name) {
return checkNameAvailabilityWithServiceResponseAsync(location, name).toBlocking().single().body();
} | [
"public",
"CheckNameResultInner",
"checkNameAvailability",
"(",
"String",
"location",
",",
"String",
"name",
")",
"{",
"return",
"checkNameAvailabilityWithServiceResponseAsync",
"(",
"location",
",",
"name",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",... | Checks that the cluster name is valid and is not already in use.
@param location Azure location.
@param name Cluster name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exce... | [
"Checks",
"that",
"the",
"cluster",
"name",
"is",
"valid",
"and",
"is",
"not",
"already",
"in",
"use",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L1289-L1291 |
maochen/NLP | CoreNLP-Experiment/src/main/java/org/maochen/nlp/ml/classifier/knn/KNNClassifier.java | KNNClassifier.setParameter | @Override
public void setParameter(Map<String, String> paraMap) {
"""
k: k nearest neighbors. mode: 0 - EuclideanDistance, 1 - ChebyshevDistance, 2 - ManhattanDistance
@param paraMap Parameters Map.
"""
if (paraMap.containsKey("k")) {
this.k = Integer.parseInt(paraMap.get("k"));
... | java | @Override
public void setParameter(Map<String, String> paraMap) {
if (paraMap.containsKey("k")) {
this.k = Integer.parseInt(paraMap.get("k"));
}
if (paraMap.containsKey("mode")) {
this.mode = Integer.parseInt(paraMap.get("mode"));
}
} | [
"@",
"Override",
"public",
"void",
"setParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"paraMap",
")",
"{",
"if",
"(",
"paraMap",
".",
"containsKey",
"(",
"\"k\"",
")",
")",
"{",
"this",
".",
"k",
"=",
"Integer",
".",
"parseInt",
"(",
"par... | k: k nearest neighbors. mode: 0 - EuclideanDistance, 1 - ChebyshevDistance, 2 - ManhattanDistance
@param paraMap Parameters Map. | [
"k",
":",
"k",
"nearest",
"neighbors",
".",
"mode",
":",
"0",
"-",
"EuclideanDistance",
"1",
"-",
"ChebyshevDistance",
"2",
"-",
"ManhattanDistance"
] | train | https://github.com/maochen/NLP/blob/38ae7b384d5295334d9efa9dc4cd901b19d9c27e/CoreNLP-Experiment/src/main/java/org/maochen/nlp/ml/classifier/knn/KNNClassifier.java#L33-L41 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java | AbstractExtraLanguageGenerator.toFilename | protected String toFilename(QualifiedName name, String separator) {
"""
Replies the filename for the qualified name.
@param name the qualified name.
@param separator the filename separator.
@return the filename.
"""
final List<String> segments = name.getSegments();
if (segments.isEmpty()) {
return ... | java | protected String toFilename(QualifiedName name, String separator) {
final List<String> segments = name.getSegments();
if (segments.isEmpty()) {
return ""; //$NON-NLS-1$
}
final StringBuilder builder = new StringBuilder();
builder.append(name.toString(separator));
builder.append(getFilenameExtension());
... | [
"protected",
"String",
"toFilename",
"(",
"QualifiedName",
"name",
",",
"String",
"separator",
")",
"{",
"final",
"List",
"<",
"String",
">",
"segments",
"=",
"name",
".",
"getSegments",
"(",
")",
";",
"if",
"(",
"segments",
".",
"isEmpty",
"(",
")",
")"... | Replies the filename for the qualified name.
@param name the qualified name.
@param separator the filename separator.
@return the filename. | [
"Replies",
"the",
"filename",
"for",
"the",
"qualified",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L438-L447 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/HttpRequestUtils.java | HttpRequestUtils.getShortRequestDump | public static String getShortRequestDump(String fromMethod, boolean includeHeaders, HttpServletRequest request) {
"""
Build a String containing a short multi-line dump of an HTTP request.
@param fromMethod the method that this method was called from
@param request the HTTP request build the request dump from
... | java | public static String getShortRequestDump(String fromMethod, boolean includeHeaders, HttpServletRequest request) {
StringBuilder dump = new StringBuilder();
dump.append("Timestamp : ").append(ISO8601.getTimestamp()).append("\n");
dump.append("fromMethod : ").append(fromMethod).append(... | [
"public",
"static",
"String",
"getShortRequestDump",
"(",
"String",
"fromMethod",
",",
"boolean",
"includeHeaders",
",",
"HttpServletRequest",
"request",
")",
"{",
"StringBuilder",
"dump",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"dump",
".",
"append",
"(",
"... | Build a String containing a short multi-line dump of an HTTP request.
@param fromMethod the method that this method was called from
@param request the HTTP request build the request dump from
@param includeHeaders if true will include the HTTP headers in the dump
@return a String containing a short multi-line dump of ... | [
"Build",
"a",
"String",
"containing",
"a",
"short",
"multi",
"-",
"line",
"dump",
"of",
"an",
"HTTP",
"request",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/HttpRequestUtils.java#L32-L57 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginGetAdvertisedRoutes | public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
"""
This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
@param resourceGroupName The name of the resource group.
@param ... | java | public GatewayRouteListResultInner beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().single().body();
} | [
"public",
"GatewayRouteListResultInner",
"beginGetAdvertisedRoutes",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"String",
"peer",
")",
"{",
"return",
"beginGetAdvertisedRoutesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vi... | This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param peer The IP address of the peer
@throws IllegalArgumentException thrown i... | [
"This",
"operation",
"retrieves",
"a",
"list",
"of",
"routes",
"the",
"virtual",
"network",
"gateway",
"is",
"advertising",
"to",
"the",
"specified",
"peer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2567-L2569 |
weld/core | impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java | AnnotatedTypes.compareAnnotatedParameters | private static boolean compareAnnotatedParameters(List<? extends AnnotatedParameter<?>> p1, List<? extends AnnotatedParameter<?>> p2) {
"""
compares two annotated elements to see if they have the same annotations
"""
if (p1.size() != p2.size()) {
return false;
}
for (int i =... | java | private static boolean compareAnnotatedParameters(List<? extends AnnotatedParameter<?>> p1, List<? extends AnnotatedParameter<?>> p2) {
if (p1.size() != p2.size()) {
return false;
}
for (int i = 0; i < p1.size(); ++i) {
if (!compareAnnotated(p1.get(i), p2.get(i))) {
... | [
"private",
"static",
"boolean",
"compareAnnotatedParameters",
"(",
"List",
"<",
"?",
"extends",
"AnnotatedParameter",
"<",
"?",
">",
">",
"p1",
",",
"List",
"<",
"?",
"extends",
"AnnotatedParameter",
"<",
"?",
">",
">",
"p2",
")",
"{",
"if",
"(",
"p1",
"... | compares two annotated elements to see if they have the same annotations | [
"compares",
"two",
"annotated",
"elements",
"to",
"see",
"if",
"they",
"have",
"the",
"same",
"annotations"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java#L435-L445 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/server/mvc/WebMvcLinkBuilder.java | WebMvcLinkBuilder.methodOn | public static <T> T methodOn(Class<T> controller, Object... parameters) {
"""
Wrapper for {@link DummyInvocationUtils#methodOn(Class, Object...)} to be available in case you work with static
imports of {@link WebMvcLinkBuilder}.
@param controller must not be {@literal null}.
@param parameters parameters to ex... | java | public static <T> T methodOn(Class<T> controller, Object... parameters) {
return DummyInvocationUtils.methodOn(controller, parameters);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"methodOn",
"(",
"Class",
"<",
"T",
">",
"controller",
",",
"Object",
"...",
"parameters",
")",
"{",
"return",
"DummyInvocationUtils",
".",
"methodOn",
"(",
"controller",
",",
"parameters",
")",
";",
"}"
] | Wrapper for {@link DummyInvocationUtils#methodOn(Class, Object...)} to be available in case you work with static
imports of {@link WebMvcLinkBuilder}.
@param controller must not be {@literal null}.
@param parameters parameters to extend template variables in the type level mapping.
@return | [
"Wrapper",
"for",
"{",
"@link",
"DummyInvocationUtils#methodOn",
"(",
"Class",
"Object",
"...",
")",
"}",
"to",
"be",
"available",
"in",
"case",
"you",
"work",
"with",
"static",
"imports",
"of",
"{",
"@link",
"WebMvcLinkBuilder",
"}",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/server/mvc/WebMvcLinkBuilder.java#L209-L211 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java | Monitors.newThreadPoolMonitor | public static CompositeMonitor<?> newThreadPoolMonitor(String id, ThreadPoolExecutor pool) {
"""
Creates a new monitor for a thread pool with standard metrics for the pool size, queue size,
task counts, etc.
@param id id to differentiate metrics for this pool from others.
@param pool thread pool instance to... | java | public static CompositeMonitor<?> newThreadPoolMonitor(String id, ThreadPoolExecutor pool) {
return newObjectMonitor(id, new MonitoredThreadPool(pool));
} | [
"public",
"static",
"CompositeMonitor",
"<",
"?",
">",
"newThreadPoolMonitor",
"(",
"String",
"id",
",",
"ThreadPoolExecutor",
"pool",
")",
"{",
"return",
"newObjectMonitor",
"(",
"id",
",",
"new",
"MonitoredThreadPool",
"(",
"pool",
")",
")",
";",
"}"
] | Creates a new monitor for a thread pool with standard metrics for the pool size, queue size,
task counts, etc.
@param id id to differentiate metrics for this pool from others.
@param pool thread pool instance to monitor.
@return composite monitor based on stats provided for the pool | [
"Creates",
"a",
"new",
"monitor",
"for",
"a",
"thread",
"pool",
"with",
"standard",
"metrics",
"for",
"the",
"pool",
"size",
"queue",
"size",
"task",
"counts",
"etc",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java#L168-L170 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.setFormatsByArgumentName | public void setFormatsByArgumentName(Map<String, Format> newFormats) {
"""
<strong>[icu]</strong> Sets the Format objects to use for the values passed into
<code>format</code> methods or returned from <code>parse</code>
methods. The keys in <code>newFormats</code> are the argument
names in the previously set pa... | java | public void setFormatsByArgumentName(Map<String, Format> newFormats) {
for (int partIndex = 0; (partIndex = nextTopLevelArgStart(partIndex)) >= 0;) {
String key = getArgName(partIndex + 1);
if (newFormats.containsKey(key)) {
setCustomArgStartFormat(partIndex, newFormats.g... | [
"public",
"void",
"setFormatsByArgumentName",
"(",
"Map",
"<",
"String",
",",
"Format",
">",
"newFormats",
")",
"{",
"for",
"(",
"int",
"partIndex",
"=",
"0",
";",
"(",
"partIndex",
"=",
"nextTopLevelArgStart",
"(",
"partIndex",
")",
")",
">=",
"0",
";",
... | <strong>[icu]</strong> Sets the Format objects to use for the values passed into
<code>format</code> methods or returned from <code>parse</code>
methods. The keys in <code>newFormats</code> are the argument
names in the previously set pattern string, and the values
are the formats.
<p>
Only argument names from the patt... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Sets",
"the",
"Format",
"objects",
"to",
"use",
"for",
"the",
"values",
"passed",
"into",
"<code",
">",
"format<",
"/",
"code",
">",
"methods",
"or",
"returned",
"from",
"<code",
">",
"parse<",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L614-L621 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableBufferedMutator.java | BigtableBufferedMutator.getExceptions | private RetriesExhaustedWithDetailsException getExceptions()
throws RetriesExhaustedWithDetailsException {
"""
Create a {@link RetriesExhaustedWithDetailsException} if there were any async exceptions and
send it to the {@link org.apache.hadoop.hbase.client.BufferedMutator.ExceptionListener}.
"""
if ... | java | private RetriesExhaustedWithDetailsException getExceptions()
throws RetriesExhaustedWithDetailsException {
if (!hasExceptions.get()) {
return null;
}
ArrayList<MutationException> mutationExceptions = null;
synchronized (globalExceptions) {
hasExceptions.set(false);
if (globalExc... | [
"private",
"RetriesExhaustedWithDetailsException",
"getExceptions",
"(",
")",
"throws",
"RetriesExhaustedWithDetailsException",
"{",
"if",
"(",
"!",
"hasExceptions",
".",
"get",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"ArrayList",
"<",
"MutationException",
"... | Create a {@link RetriesExhaustedWithDetailsException} if there were any async exceptions and
send it to the {@link org.apache.hadoop.hbase.client.BufferedMutator.ExceptionListener}. | [
"Create",
"a",
"{"
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableBufferedMutator.java#L166-L198 |
JetBrains/xodus | vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java | VirtualFileSystem.appendFile | public OutputStream appendFile(@NotNull final Transaction txn, @NotNull final File file) {
"""
Returns {@linkplain OutputStream} to write the contents of the specified file from the end of the file. If the
file is empty the contents is written from the beginning.
@param txn {@linkplain Transaction} instance
... | java | public OutputStream appendFile(@NotNull final Transaction txn, @NotNull final File file) {
return new VfsAppendingStream(this, txn, file, new LastModifiedTrigger(txn, file, pathnames));
} | [
"public",
"OutputStream",
"appendFile",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"File",
"file",
")",
"{",
"return",
"new",
"VfsAppendingStream",
"(",
"this",
",",
"txn",
",",
"file",
",",
"new",
"LastModifiedTrigger",
... | Returns {@linkplain OutputStream} to write the contents of the specified file from the end of the file. If the
file is empty the contents is written from the beginning.
@param txn {@linkplain Transaction} instance
@param file {@linkplain File} instance
@return @linkplain OutputStream} to write the contents of the spe... | [
"Returns",
"{",
"@linkplain",
"OutputStream",
"}",
"to",
"write",
"the",
"contents",
"of",
"the",
"specified",
"file",
"from",
"the",
"end",
"of",
"the",
"file",
".",
"If",
"the",
"file",
"is",
"empty",
"the",
"contents",
"is",
"written",
"from",
"the",
... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java#L585-L587 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java | UserEventMessenger.sendToUser | public void sendToUser(String topicURI, Object event, String eligibleUser) {
"""
Send an {@link EventMessage} to one client that is subscribed to the given
topicURI. If the client with the given user name is not subscribed to the topicURI
nothing happens.
@param topicURI the name of the topic
@param event th... | java | public void sendToUser(String topicURI, Object event, String eligibleUser) {
sendToUsers(topicURI, event, Collections.singleton(eligibleUser));
} | [
"public",
"void",
"sendToUser",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"String",
"eligibleUser",
")",
"{",
"sendToUsers",
"(",
"topicURI",
",",
"event",
",",
"Collections",
".",
"singleton",
"(",
"eligibleUser",
")",
")",
";",
"}"
] | Send an {@link EventMessage} to one client that is subscribed to the given
topicURI. If the client with the given user name is not subscribed to the topicURI
nothing happens.
@param topicURI the name of the topic
@param event the payload of the {@link EventMessage}
@param eligibleUser only the user listed here will re... | [
"Send",
"an",
"{",
"@link",
"EventMessage",
"}",
"to",
"one",
"client",
"that",
"is",
"subscribed",
"to",
"the",
"given",
"topicURI",
".",
"If",
"the",
"client",
"with",
"the",
"given",
"user",
"name",
"is",
"not",
"subscribed",
"to",
"the",
"topicURI",
... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java#L171-L173 |
mfornos/humanize | humanize-icu/src/main/java/humanize/ICUHumanize.java | ICUHumanize.naturalTime | public static String naturalTime(final Date reference, final Date duration, final Locale locale) {
"""
<p>
Same as {@link #naturalTime(Date, Date) naturalTime} for the specified
locale.
</p>
@param reference
Date to be used as reference
@param duration
Date to be used as duration from reference
@param lo... | java | public static String naturalTime(final Date reference, final Date duration, final Locale locale)
{
return withinLocale(new Callable<String>()
{
public String call()
{
return naturalTime(reference, duration);
}
}, locale);
} | [
"public",
"static",
"String",
"naturalTime",
"(",
"final",
"Date",
"reference",
",",
"final",
"Date",
"duration",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"withinLocale",
"(",
"new",
"Callable",
"<",
"String",
">",
"(",
")",
"{",
"public",
"St... | <p>
Same as {@link #naturalTime(Date, Date) naturalTime} for the specified
locale.
</p>
@param reference
Date to be used as reference
@param duration
Date to be used as duration from reference
@param locale
Target locale
@return String representing the relative date | [
"<p",
">",
"Same",
"as",
"{",
"@link",
"#naturalTime",
"(",
"Date",
"Date",
")",
"naturalTime",
"}",
"for",
"the",
"specified",
"locale",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-icu/src/main/java/humanize/ICUHumanize.java#L1356-L1365 |
Alluxio/alluxio | core/server/proxy/src/main/java/alluxio/proxy/s3/S3RestServiceHandler.java | S3RestServiceHandler.completeMultipartUpload | private Response completeMultipartUpload(final String bucket, final String object,
final long uploadId) {
"""
under the temporary multipart upload directory are combined into the final object.
"""
return S3RestUtils.call(bucket, new S3RestUtils.RestCallable<CompleteMultipartUploadResult>() {
@O... | java | private Response completeMultipartUpload(final String bucket, final String object,
final long uploadId) {
return S3RestUtils.call(bucket, new S3RestUtils.RestCallable<CompleteMultipartUploadResult>() {
@Override
public CompleteMultipartUploadResult call() throws S3Exception {
String bucket... | [
"private",
"Response",
"completeMultipartUpload",
"(",
"final",
"String",
"bucket",
",",
"final",
"String",
"object",
",",
"final",
"long",
"uploadId",
")",
"{",
"return",
"S3RestUtils",
".",
"call",
"(",
"bucket",
",",
"new",
"S3RestUtils",
".",
"RestCallable",... | under the temporary multipart upload directory are combined into the final object. | [
"under",
"the",
"temporary",
"multipart",
"upload",
"directory",
"are",
"combined",
"into",
"the",
"final",
"object",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/proxy/src/main/java/alluxio/proxy/s3/S3RestServiceHandler.java#L330-L372 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/bond/Bond.java | Bond.getValueWithGivenYield | public double getValueWithGivenYield(double evaluationTime, double rate, AnalyticModel model) {
"""
Returns the value of the sum of discounted cash flows of the bond where
the discounting is done with the given yield curve.
This method can be used for optimizer.
@param evaluationTime The evaluation time as do... | java | public double getValueWithGivenYield(double evaluationTime, double rate, AnalyticModel model) {
DiscountCurve referenceCurve = DiscountCurveInterpolation.createDiscountCurveFromDiscountFactors("referenceCurve", new double[] {0.0, 1.0}, new double[] {1.0, 1.0});
return getValueWithGivenSpreadOverCurve(evaluationTim... | [
"public",
"double",
"getValueWithGivenYield",
"(",
"double",
"evaluationTime",
",",
"double",
"rate",
",",
"AnalyticModel",
"model",
")",
"{",
"DiscountCurve",
"referenceCurve",
"=",
"DiscountCurveInterpolation",
".",
"createDiscountCurveFromDiscountFactors",
"(",
"\"refere... | Returns the value of the sum of discounted cash flows of the bond where
the discounting is done with the given yield curve.
This method can be used for optimizer.
@param evaluationTime The evaluation time as double. Cash flows prior and including this time are not considered.
@param rate The yield which is used for di... | [
"Returns",
"the",
"value",
"of",
"the",
"sum",
"of",
"discounted",
"cash",
"flows",
"of",
"the",
"bond",
"where",
"the",
"discounting",
"is",
"done",
"with",
"the",
"given",
"yield",
"curve",
".",
"This",
"method",
"can",
"be",
"used",
"for",
"optimizer",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/bond/Bond.java#L256-L259 |
knowm/XChange | xchange-core/src/main/java/org/knowm/xchange/utils/CertHelper.java | CertHelper.createIncorrectHostnameVerifier | public static HostnameVerifier createIncorrectHostnameVerifier(
final String requestHostname, final String certPrincipalName) {
"""
Creates a custom {@link HostnameVerifier} that allows a specific certificate to be accepted for
a mismatching hostname.
@param requestHostname hostname used to access the se... | java | public static HostnameVerifier createIncorrectHostnameVerifier(
final String requestHostname, final String certPrincipalName) {
return new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
try {
String principalName = session.getPeerP... | [
"public",
"static",
"HostnameVerifier",
"createIncorrectHostnameVerifier",
"(",
"final",
"String",
"requestHostname",
",",
"final",
"String",
"certPrincipalName",
")",
"{",
"return",
"new",
"HostnameVerifier",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"veri... | Creates a custom {@link HostnameVerifier} that allows a specific certificate to be accepted for
a mismatching hostname.
@param requestHostname hostname used to access the service which offers the incorrectly named
certificate
@param certPrincipalName RFC 2253 name on the certificate
@return A {@link HostnameVerifier} ... | [
"Creates",
"a",
"custom",
"{",
"@link",
"HostnameVerifier",
"}",
"that",
"allows",
"a",
"specific",
"certificate",
"to",
"be",
"accepted",
"for",
"a",
"mismatching",
"hostname",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-core/src/main/java/org/knowm/xchange/utils/CertHelper.java#L220-L241 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.updateConversation | public Conversation updateConversation(final String id, final ConversationStatus status)
throws UnauthorizedException, GeneralException {
"""
Updates a conversation.
@param id Conversation to update.
@param status New status for the conversation.
@return The updated Conversation.
"""
... | java | public Conversation updateConversation(final String id, final ConversationStatus status)
throws UnauthorizedException, GeneralException {
if (id == null) {
throw new IllegalArgumentException("Id must be specified.");
}
String url = String.format("%s%s/%s", CONVERSATIONS_B... | [
"public",
"Conversation",
"updateConversation",
"(",
"final",
"String",
"id",
",",
"final",
"ConversationStatus",
"status",
")",
"throws",
"UnauthorizedException",
",",
"GeneralException",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgum... | Updates a conversation.
@param id Conversation to update.
@param status New status for the conversation.
@return The updated Conversation. | [
"Updates",
"a",
"conversation",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L724-L731 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.isSnapshotablePersistentTableView | public static boolean isSnapshotablePersistentTableView(Database db, Table table) {
"""
Test if a table is a persistent table view and should be included in the snapshot.
@param db The database catalog
@param table The table to test.</br>
@return If the table is a persistent table view that should be snapshotte... | java | public static boolean isSnapshotablePersistentTableView(Database db, Table table) {
Table materializer = table.getMaterializer();
if (materializer == null) {
// Return false if it is not a materialized view.
return false;
}
if (CatalogUtil.isTableExportOnly(db, ma... | [
"public",
"static",
"boolean",
"isSnapshotablePersistentTableView",
"(",
"Database",
"db",
",",
"Table",
"table",
")",
"{",
"Table",
"materializer",
"=",
"table",
".",
"getMaterializer",
"(",
")",
";",
"if",
"(",
"materializer",
"==",
"null",
")",
"{",
"// Ret... | Test if a table is a persistent table view and should be included in the snapshot.
@param db The database catalog
@param table The table to test.</br>
@return If the table is a persistent table view that should be snapshotted. | [
"Test",
"if",
"a",
"table",
"is",
"a",
"persistent",
"table",
"view",
"and",
"should",
"be",
"included",
"in",
"the",
"snapshot",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L418-L436 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.truncateStream | public CompletableFuture<UpdateStreamStatus.Status> truncateStream(final String scope, final String stream,
final Map<Long, Long> streamCut,
final OperationContext contextOpt) {
... | java | public CompletableFuture<UpdateStreamStatus.Status> truncateStream(final String scope, final String stream,
final Map<Long, Long> streamCut,
final OperationContext contextOpt) {
... | [
"public",
"CompletableFuture",
"<",
"UpdateStreamStatus",
".",
"Status",
">",
"truncateStream",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"Map",
"<",
"Long",
",",
"Long",
">",
"streamCut",
",",
"final",
"OperationContext",
... | Truncate a stream.
@param scope scope.
@param stream stream name.
@param streamCut stream cut.
@param contextOpt optional context
@return update status. | [
"Truncate",
"a",
"stream",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L364-L386 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java | StaticFileServerHandler.setContentTypeHeader | public static void setContentTypeHeader(HttpResponse response, File file) {
"""
Sets the content type header for the HTTP Response.
@param response HTTP response
@param file file to extract content type
"""
String mimeType = MimeTypes.getMimeTypeForFileName(file.getName());
String mimeFinal = mimeT... | java | public static void setContentTypeHeader(HttpResponse response, File file) {
String mimeType = MimeTypes.getMimeTypeForFileName(file.getName());
String mimeFinal = mimeType != null ? mimeType : MimeTypes.getDefaultMimeType();
response.headers().set(CONTENT_TYPE, mimeFinal);
} | [
"public",
"static",
"void",
"setContentTypeHeader",
"(",
"HttpResponse",
"response",
",",
"File",
"file",
")",
"{",
"String",
"mimeType",
"=",
"MimeTypes",
".",
"getMimeTypeForFileName",
"(",
"file",
".",
"getName",
"(",
")",
")",
";",
"String",
"mimeFinal",
"... | Sets the content type header for the HTTP Response.
@param response HTTP response
@param file file to extract content type | [
"Sets",
"the",
"content",
"type",
"header",
"for",
"the",
"HTTP",
"Response",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java#L372-L376 |
deephacks/confit | api-model/src/main/java/org/deephacks/confit/model/Bean.java | Bean.setProperty | public void setProperty(final String propertyName, final String value) {
"""
Overwrite the current values with the provided value.
@param propertyName name of the property as defined by the bean's schema.
@param value final String representations of the property that conforms to
its type as defined by the bea... | java | public void setProperty(final String propertyName, final String value) {
Preconditions.checkNotNull(propertyName);
if (value == null) {
properties.put(propertyName, null);
return;
}
List<String> values = new ArrayList<>();
values.add(value);
proper... | [
"public",
"void",
"setProperty",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"value",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"propertyName",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"properties",
".",
"put",
"... | Overwrite the current values with the provided value.
@param propertyName name of the property as defined by the bean's schema.
@param value final String representations of the property that conforms to
its type as defined by the bean's schema. | [
"Overwrite",
"the",
"current",
"values",
"with",
"the",
"provided",
"value",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-model/src/main/java/org/deephacks/confit/model/Bean.java#L183-L192 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/message/SQSBytesMessage.java | SQSBytesMessage.readBytes | @Override
public int readBytes(byte[] value, int length) throws JMSException {
"""
Reads a portion of the bytes message stream.
<P>
If the length of array value is less than the number of bytes remaining
to be read from the stream, the array should be filled. A subsequent call
reads the next increment, and... | java | @Override
public int readBytes(byte[] value, int length) throws JMSException {
if (length < 0) {
throw new IndexOutOfBoundsException("Length bytes to read can't be smaller than 0 but was " +
length);
}
checkCanRead();
try {
... | [
"@",
"Override",
"public",
"int",
"readBytes",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"length",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"length",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Length bytes to read can't be... | Reads a portion of the bytes message stream.
<P>
If the length of array value is less than the number of bytes remaining
to be read from the stream, the array should be filled. A subsequent call
reads the next increment, and so on.
<P>
If the number of bytes remaining in the stream is less than the length of
array valu... | [
"Reads",
"a",
"portion",
"of",
"the",
"bytes",
"message",
"stream",
".",
"<P",
">",
"If",
"the",
"length",
"of",
"array",
"value",
"is",
"less",
"than",
"the",
"number",
"of",
"bytes",
"remaining",
"to",
"be",
"read",
"from",
"the",
"stream",
"the",
"a... | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/message/SQSBytesMessage.java#L428-L461 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/ErrorCollector.java | ErrorCollector.appendQuerySnippet | private void appendQuerySnippet(Parser parser, StringBuilder builder) {
"""
Appends a query snippet to the message to help the user to understand the problem.
@param parser the parser used to parse the query
@param builder the <code>StringBuilder</code> used to build the error message
"""
TokenStre... | java | private void appendQuerySnippet(Parser parser, StringBuilder builder)
{
TokenStream tokenStream = parser.getTokenStream();
int index = tokenStream.index();
int size = tokenStream.size();
Token from = tokenStream.get(getSnippetFirstTokenIndex(index));
Token to = tokenStream.g... | [
"private",
"void",
"appendQuerySnippet",
"(",
"Parser",
"parser",
",",
"StringBuilder",
"builder",
")",
"{",
"TokenStream",
"tokenStream",
"=",
"parser",
".",
"getTokenStream",
"(",
")",
";",
"int",
"index",
"=",
"tokenStream",
".",
"index",
"(",
")",
";",
"... | Appends a query snippet to the message to help the user to understand the problem.
@param parser the parser used to parse the query
@param builder the <code>StringBuilder</code> used to build the error message | [
"Appends",
"a",
"query",
"snippet",
"to",
"the",
"message",
"to",
"help",
"the",
"user",
"to",
"understand",
"the",
"problem",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/ErrorCollector.java#L110-L121 |
apache/groovy | src/main/groovy/groovy/lang/ProxyMetaClass.java | ProxyMetaClass.invokeMethod | @Override
public Object invokeMethod(final Class sender, final Object object, final String methodName, final Object[] arguments, final boolean isCallToSuper, final boolean fromInsideClass) {
"""
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
With Interceptor the call ... | java | @Override
public Object invokeMethod(final Class sender, final Object object, final String methodName, final Object[] arguments, final boolean isCallToSuper, final boolean fromInsideClass) {
return doCall(object, methodName, arguments, interceptor, new Callable() {
public Object call() {
... | [
"@",
"Override",
"public",
"Object",
"invokeMethod",
"(",
"final",
"Class",
"sender",
",",
"final",
"Object",
"object",
",",
"final",
"String",
"methodName",
",",
"final",
"Object",
"[",
"]",
"arguments",
",",
"final",
"boolean",
"isCallToSuper",
",",
"final",... | Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
With Interceptor the call is nested in its beforeInvoke and afterInvoke methods.
The method call is suppressed if Interceptor.doInvoke() returns false.
See Interceptor for details. | [
"Call",
"invokeMethod",
"on",
"adaptee",
"with",
"logic",
"like",
"in",
"MetaClass",
"unless",
"we",
"have",
"an",
"Interceptor",
".",
"With",
"Interceptor",
"the",
"call",
"is",
"nested",
"in",
"its",
"beforeInvoke",
"and",
"afterInvoke",
"methods",
".",
"The... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/ProxyMetaClass.java#L131-L138 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java | ValueFileIOHelper.copyClose | protected long copyClose(InputStream in, OutputStream out) throws IOException {
"""
Copy input to output data using NIO. Input and output streams will be closed after the
operation.
@param in
InputStream
@param out
OutputStream
@return The number of bytes, possibly zero, that were actually copied
@throws ... | java | protected long copyClose(InputStream in, OutputStream out) throws IOException
{
try
{
try
{
return copy(in, out);
}
finally
{
in.close();
}
}
finally
{
out.close();
}
} | [
"protected",
"long",
"copyClose",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"try",
"{",
"try",
"{",
"return",
"copy",
"(",
"in",
",",
"out",
")",
";",
"}",
"finally",
"{",
"in",
".",
"close",
"(",
")",
"... | Copy input to output data using NIO. Input and output streams will be closed after the
operation.
@param in
InputStream
@param out
OutputStream
@return The number of bytes, possibly zero, that were actually copied
@throws IOException
if error occurs | [
"Copy",
"input",
"to",
"output",
"data",
"using",
"NIO",
".",
"Input",
"and",
"output",
"streams",
"will",
"be",
"closed",
"after",
"the",
"operation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java#L310-L327 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.readResponse | private Object readResponse(Type returnType, InputStream input, String id) throws Throwable {
"""
Reads a JSON-PRC response from the server. This blocks until
a response is received. If an id is given, responses that do
not correspond, are disregarded.
@param returnType the expected return type
@param input... | java | private Object readResponse(Type returnType, InputStream input, String id) throws Throwable {
ReadContext context = ReadContext.getReadContext(input, mapper);
ObjectNode jsonObject = getValidResponse(id, context);
notifyAnswerListener(jsonObject);
handleErrorResponse(jsonObject);
if (hasResult(jsonObjec... | [
"private",
"Object",
"readResponse",
"(",
"Type",
"returnType",
",",
"InputStream",
"input",
",",
"String",
"id",
")",
"throws",
"Throwable",
"{",
"ReadContext",
"context",
"=",
"ReadContext",
".",
"getReadContext",
"(",
"input",
",",
"mapper",
")",
";",
"Obje... | Reads a JSON-PRC response from the server. This blocks until
a response is received. If an id is given, responses that do
not correspond, are disregarded.
@param returnType the expected return type
@param input the {@link InputStream} to read from
@param id The id used to compare the response with.
@retu... | [
"Reads",
"a",
"JSON",
"-",
"PRC",
"response",
"from",
"the",
"server",
".",
"This",
"blocks",
"until",
"a",
"response",
"is",
"received",
".",
"If",
"an",
"id",
"is",
"given",
"responses",
"that",
"do",
"not",
"correspond",
"are",
"disregarded",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L191-L207 |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java | Calcites.calciteDateToJoda | public static DateTime calciteDateToJoda(final int date, final DateTimeZone timeZone) {
"""
The inverse of {@link #jodaToCalciteDate(DateTime, DateTimeZone)}.
@param date Calcite style date
@param timeZone session time zone
@return joda timestamp, with time zone set to the session time zone
"""
... | java | public static DateTime calciteDateToJoda(final int date, final DateTimeZone timeZone)
{
return DateTimes.EPOCH.plusDays(date).withZoneRetainFields(timeZone);
} | [
"public",
"static",
"DateTime",
"calciteDateToJoda",
"(",
"final",
"int",
"date",
",",
"final",
"DateTimeZone",
"timeZone",
")",
"{",
"return",
"DateTimes",
".",
"EPOCH",
".",
"plusDays",
"(",
"date",
")",
".",
"withZoneRetainFields",
"(",
"timeZone",
")",
";"... | The inverse of {@link #jodaToCalciteDate(DateTime, DateTimeZone)}.
@param date Calcite style date
@param timeZone session time zone
@return joda timestamp, with time zone set to the session time zone | [
"The",
"inverse",
"of",
"{",
"@link",
"#jodaToCalciteDate",
"(",
"DateTime",
"DateTimeZone",
")",
"}",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java#L338-L341 |
ugli/jocote | src/main/java/se/ugli/jocote/lpr/SocketFactory.java | SocketFactory.create | static Socket create(String hostName, int port, boolean useOutOfBoundsPorts) throws IOException {
"""
/*
The RFC for lpr specifies the use of local ports numbered 721 - 731, however
TCP/IP also requires that any port that is used will not be released for 3 minutes
which means that it get stuck on the 12th job i... | java | static Socket create(String hostName, int port, boolean useOutOfBoundsPorts) throws IOException {
if (useOutOfBoundsPorts) {
return IntStream.rangeClosed(721, 731).mapToObj(localPort -> {
try {
return Optional.of(new Socket(hostName, port, InetAddress.getLocalHost... | [
"static",
"Socket",
"create",
"(",
"String",
"hostName",
",",
"int",
"port",
",",
"boolean",
"useOutOfBoundsPorts",
")",
"throws",
"IOException",
"{",
"if",
"(",
"useOutOfBoundsPorts",
")",
"{",
"return",
"IntStream",
".",
"rangeClosed",
"(",
"721",
",",
"731"... | /*
The RFC for lpr specifies the use of local ports numbered 721 - 731, however
TCP/IP also requires that any port that is used will not be released for 3 minutes
which means that it get stuck on the 12th job if prints are sent quickly.
To resolve this issue you can use out of bounds ports which most print servers
wil... | [
"/",
"*",
"The",
"RFC",
"for",
"lpr",
"specifies",
"the",
"use",
"of",
"local",
"ports",
"numbered",
"721",
"-",
"731",
"however",
"TCP",
"/",
"IP",
"also",
"requires",
"that",
"any",
"port",
"that",
"is",
"used",
"will",
"not",
"be",
"released",
"for"... | train | https://github.com/ugli/jocote/blob/28c34eb5aadbca6597bf006bb92d4fc340c71b41/src/main/java/se/ugli/jocote/lpr/SocketFactory.java#L22-L33 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/SerializerSwitcher.java | SerializerSwitcher.getOutputPropertyNoDefault | private static String getOutputPropertyNoDefault(String qnameString, Properties props)
throws IllegalArgumentException {
"""
Get the value of a property, without using the default properties. This
can be used to test if a property has been explicitly set by the stylesheet
or user.
@param name The propert... | java | private static String getOutputPropertyNoDefault(String qnameString, Properties props)
throws IllegalArgumentException
{
String value = (String)props.get(qnameString);
return value;
} | [
"private",
"static",
"String",
"getOutputPropertyNoDefault",
"(",
"String",
"qnameString",
",",
"Properties",
"props",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"value",
"=",
"(",
"String",
")",
"props",
".",
"get",
"(",
"qnameString",
")",
";",
... | Get the value of a property, without using the default properties. This
can be used to test if a property has been explicitly set by the stylesheet
or user.
@param name The property name, which is a fully-qualified URI.
@return The value of the property, or null if not found.
@throws IllegalArgumentException If the... | [
"Get",
"the",
"value",
"of",
"a",
"property",
"without",
"using",
"the",
"default",
"properties",
".",
"This",
"can",
"be",
"used",
"to",
"test",
"if",
"a",
"property",
"has",
"been",
"explicitly",
"set",
"by",
"the",
"stylesheet",
"or",
"user",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/SerializerSwitcher.java#L131-L137 |
hdecarne/java-default | src/main/java/de/carne/util/ManifestInfos.java | ManifestInfos.getMainAttribute | public String getMainAttribute(String attributeName, String defaultValue) {
"""
Gets a manifest's main attribute.
@param attributeName the attribute name to get.
@param defaultValue the default value to return in case the attribute undefined.
@return the found attribute value or the submitted default value in... | java | public String getMainAttribute(String attributeName, String defaultValue) {
Attributes attributes = this.manifest.getMainAttributes();
String attributeValue = (attributes != null ? attributes.getValue(attributeName) : null);
return (attributeValue != null ? attributeValue : defaultValue);
} | [
"public",
"String",
"getMainAttribute",
"(",
"String",
"attributeName",
",",
"String",
"defaultValue",
")",
"{",
"Attributes",
"attributes",
"=",
"this",
".",
"manifest",
".",
"getMainAttributes",
"(",
")",
";",
"String",
"attributeValue",
"=",
"(",
"attributes",
... | Gets a manifest's main attribute.
@param attributeName the attribute name to get.
@param defaultValue the default value to return in case the attribute undefined.
@return the found attribute value or the submitted default value in case the attribute is undefined. | [
"Gets",
"a",
"manifest",
"s",
"main",
"attribute",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/util/ManifestInfos.java#L68-L73 |
twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java | ZooKeeperClient.get | public synchronized ZooKeeper get(Duration connectionTimeout)
throws ZooKeeperConnectionException, InterruptedException, TimeoutException {
"""
Returns the current active ZK connection or establishes a new one if none has yet been
established or a previous connection was disconnected or had its session time... | java | public synchronized ZooKeeper get(Duration connectionTimeout)
throws ZooKeeperConnectionException, InterruptedException, TimeoutException {
if (zooKeeper == null) {
final CountDownLatch connected = new CountDownLatch(1);
Watcher watcher = new Watcher() {
@Override public void process(Watc... | [
"public",
"synchronized",
"ZooKeeper",
"get",
"(",
"Duration",
"connectionTimeout",
")",
"throws",
"ZooKeeperConnectionException",
",",
"InterruptedException",
",",
"TimeoutException",
"{",
"if",
"(",
"zooKeeper",
"==",
"null",
")",
"{",
"final",
"CountDownLatch",
"co... | Returns the current active ZK connection or establishes a new one if none has yet been
established or a previous connection was disconnected or had its session time out. This
method will attempt to re-use sessions when possible.
@param connectionTimeout the maximum amount of time to wait for the connection to the ZK
... | [
"Returns",
"the",
"current",
"active",
"ZK",
"connection",
"or",
"establishes",
"a",
"new",
"one",
"if",
"none",
"has",
"yet",
"been",
"established",
"or",
"a",
"previous",
"connection",
"was",
"disconnected",
"or",
"had",
"its",
"session",
"time",
"out",
".... | train | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/ZooKeeperClient.java#L357-L418 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getLeagues | public Future<Map<String, List<LeagueList>>> getLeagues(String... teamIds) {
"""
Get a listing of leagues for the specified teams
@param teamIds The ids of the team
@return A mapping of team ids to lists of leagues
@see <a href=https://developer.riotgames.com/api/methods#!/593/1860>Official API documentation</a... | java | public Future<Map<String, List<LeagueList>>> getLeagues(String... teamIds) {
return new ApiFuture<>(() -> handler.getLeagues(teamIds));
} | [
"public",
"Future",
"<",
"Map",
"<",
"String",
",",
"List",
"<",
"LeagueList",
">",
">",
">",
"getLeagues",
"(",
"String",
"...",
"teamIds",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getLeagues",
"(",
"teamIds"... | Get a listing of leagues for the specified teams
@param teamIds The ids of the team
@return A mapping of team ids to lists of leagues
@see <a href=https://developer.riotgames.com/api/methods#!/593/1860>Official API documentation</a> | [
"Get",
"a",
"listing",
"of",
"leagues",
"for",
"the",
"specified",
"teams"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L275-L277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.