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 |
|---|---|---|---|---|---|---|---|---|---|---|
dickschoeller/gedbrowser | gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/PersonController.java | PersonController.nameHtml | private String nameHtml(final RenderingContext context,
final Person person) {
"""
Get the name string in an html fragment format.
@param context the rendering context
@param person the person being rendered
@return the name string
"""
return nameRenderer(context, person).getNameHtml()... | java | private String nameHtml(final RenderingContext context,
final Person person) {
return nameRenderer(context, person).getNameHtml();
} | [
"private",
"String",
"nameHtml",
"(",
"final",
"RenderingContext",
"context",
",",
"final",
"Person",
"person",
")",
"{",
"return",
"nameRenderer",
"(",
"context",
",",
"person",
")",
".",
"getNameHtml",
"(",
")",
";",
"}"
] | Get the name string in an html fragment format.
@param context the rendering context
@param person the person being rendered
@return the name string | [
"Get",
"the",
"name",
"string",
"in",
"an",
"html",
"fragment",
"format",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/PersonController.java#L113-L116 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/DriverManager.java | DriverManager.openFile | public static void openFile(Connection connection, String fileName, String tableName) throws SQLException {
"""
Create a new table
@param connection Active connection, do not close this connection.
@param fileName File path to write, if exists it may be replaced
@param tableName [[catalog.]schema.]table referen... | java | public static void openFile(Connection connection, String fileName, String tableName) throws SQLException {
String ext = fileName.substring(fileName.lastIndexOf('.') + 1,fileName.length());
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
for(DriverDef driverDef : DRIVE... | [
"public",
"static",
"void",
"openFile",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"String",
"ext",
"=",
"fileName",
".",
"substring",
"(",
"fileName",
".",
"lastIndexOf",
"(",
"'... | Create a new table
@param connection Active connection, do not close this connection.
@param fileName File path to write, if exists it may be replaced
@param tableName [[catalog.]schema.]table reference | [
"Create",
"a",
"new",
"table"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/DriverManager.java#L89-L103 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java | ConnectionMonitorsInner.createOrUpdate | public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
"""
Create or update a connection monitor.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networ... | java | public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().b... | [
"public",
"ConnectionMonitorResultInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"connectionMonitorName",
",",
"ConnectionMonitorInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
... | Create or update a connection monitor.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networkWatcherName The name of the Network Watcher resource.
@param connectionMonitorName The name of the connection monitor.
@param parameters Parameters that define the operation to creat... | [
"Create",
"or",
"update",
"a",
"connection",
"monitor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java#L122-L124 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/StreamService.java | StreamService.sendNSStatus | private void sendNSStatus(IConnection conn, String statusCode, String description, String name, Number streamId) {
"""
Send NetStream.Status to the client.
@param conn
@param statusCode
see StatusCodes class
@param description
@param name
@param streamId
"""
StreamService.sendNetStreamStatus(c... | java | private void sendNSStatus(IConnection conn, String statusCode, String description, String name, Number streamId) {
StreamService.sendNetStreamStatus(conn, statusCode, description, name, Status.STATUS, streamId);
} | [
"private",
"void",
"sendNSStatus",
"(",
"IConnection",
"conn",
",",
"String",
"statusCode",
",",
"String",
"description",
",",
"String",
"name",
",",
"Number",
"streamId",
")",
"{",
"StreamService",
".",
"sendNetStreamStatus",
"(",
"conn",
",",
"statusCode",
","... | Send NetStream.Status to the client.
@param conn
@param statusCode
see StatusCodes class
@param description
@param name
@param streamId | [
"Send",
"NetStream",
".",
"Status",
"to",
"the",
"client",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/StreamService.java#L814-L816 |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java | MgcpCall.removeConnection | public boolean removeConnection(String endpointId, int connectionId) {
"""
Unregisters a connection from the call.
@param endpointId The identifier of the endpoint that owns the connection.
@param connectionId The connection identifier.
@return Returns <code>true</code> if connection was removed successfully.... | java | public boolean removeConnection(String endpointId, int connectionId) {
boolean removed = this.entries.remove(endpointId, connectionId);
if (removed && log.isDebugEnabled()) {
int left = this.entries.get(endpointId).size();
log.debug("Call " + getCallIdHex() + " unregistered conne... | [
"public",
"boolean",
"removeConnection",
"(",
"String",
"endpointId",
",",
"int",
"connectionId",
")",
"{",
"boolean",
"removed",
"=",
"this",
".",
"entries",
".",
"remove",
"(",
"endpointId",
",",
"connectionId",
")",
";",
"if",
"(",
"removed",
"&&",
"log",... | Unregisters a connection from the call.
@param endpointId The identifier of the endpoint that owns the connection.
@param connectionId The connection identifier.
@return Returns <code>true</code> if connection was removed successfully. Returns <code>false</code> otherwise. | [
"Unregisters",
"a",
"connection",
"from",
"the",
"call",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java#L122-L129 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/parser/impl/AbstractLmlView.java | AbstractLmlView.resize | public void resize(final int width, final int height, final boolean centerCamera) {
"""
Updates stage's viewport.
@param width new width of the screen.
@param height new height of the screen.
@param centerCamera false by default. Some viewports seem to require it to be true for proper behavior (
{@link com.b... | java | public void resize(final int width, final int height, final boolean centerCamera) {
stage.getViewport().update(width, height, centerCamera);
} | [
"public",
"void",
"resize",
"(",
"final",
"int",
"width",
",",
"final",
"int",
"height",
",",
"final",
"boolean",
"centerCamera",
")",
"{",
"stage",
".",
"getViewport",
"(",
")",
".",
"update",
"(",
"width",
",",
"height",
",",
"centerCamera",
")",
";",
... | Updates stage's viewport.
@param width new width of the screen.
@param height new height of the screen.
@param centerCamera false by default. Some viewports seem to require it to be true for proper behavior (
{@link com.badlogic.gdx.utils.viewport.ScreenViewport}, for example). | [
"Updates",
"stage",
"s",
"viewport",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/parser/impl/AbstractLmlView.java#L63-L65 |
alkacon/opencms-core | src/org/opencms/security/CmsOrgUnitManager.java | CmsOrgUnitManager.readOrganizationalUnit | public CmsOrganizationalUnit readOrganizationalUnit(CmsObject cms, String ouFqn) throws CmsException {
"""
Reads an organizational Unit based on its fully qualified name.<p>
@param cms the opencms context
@param ouFqn the fully qualified name of the organizational Unit to be read
@return the organizational ... | java | public CmsOrganizationalUnit readOrganizationalUnit(CmsObject cms, String ouFqn) throws CmsException {
return m_securityManager.readOrganizationalUnit(cms.getRequestContext(), ouFqn);
} | [
"public",
"CmsOrganizationalUnit",
"readOrganizationalUnit",
"(",
"CmsObject",
"cms",
",",
"String",
"ouFqn",
")",
"throws",
"CmsException",
"{",
"return",
"m_securityManager",
".",
"readOrganizationalUnit",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
",",
"ouFqn"... | Reads an organizational Unit based on its fully qualified name.<p>
@param cms the opencms context
@param ouFqn the fully qualified name of the organizational Unit to be read
@return the organizational Unit with the provided fully qualified name
@throws CmsException if something goes wrong | [
"Reads",
"an",
"organizational",
"Unit",
"based",
"on",
"its",
"fully",
"qualified",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsOrgUnitManager.java#L310-L313 |
facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java | ServerCore.checkAndSetServiceName | private void checkAndSetServiceName(Configuration conf, StartupInfo info)
throws ConfigurationException {
"""
Check if this is a fedrated cluster and set the service name.
@throws ConfigurationException
"""
String fedrationMode = conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES);
String... | java | private void checkAndSetServiceName(Configuration conf, StartupInfo info)
throws ConfigurationException {
String fedrationMode = conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES);
String serviceName = info.serviceName;
if (fedrationMode != null && !fedrationMode.trim().isEmpty()) {
... | [
"private",
"void",
"checkAndSetServiceName",
"(",
"Configuration",
"conf",
",",
"StartupInfo",
"info",
")",
"throws",
"ConfigurationException",
"{",
"String",
"fedrationMode",
"=",
"conf",
".",
"get",
"(",
"FSConstants",
".",
"DFS_FEDERATION_NAMESERVICES",
")",
";",
... | Check if this is a fedrated cluster and set the service name.
@throws ConfigurationException | [
"Check",
"if",
"this",
"is",
"a",
"fedrated",
"cluster",
"and",
"set",
"the",
"service",
"name",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerCore.java#L159-L170 |
JOML-CI/JOML | src/org/joml/Matrix3d.java | Matrix3d.setLookAlong | public Matrix3d setLookAlong(Vector3dc dir, Vector3dc up) {
"""
Set this matrix to a rotation transformation to make <code>-z</code>
point along <code>dir</code>.
<p>
In order to apply the lookalong transformation to any previous existing transformation,
use {@link #lookAlong(Vector3dc, Vector3dc)}.
@see #s... | java | public Matrix3d setLookAlong(Vector3dc dir, Vector3dc up) {
return setLookAlong(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix3d",
"setLookAlong",
"(",
"Vector3dc",
"dir",
",",
"Vector3dc",
"up",
")",
"{",
"return",
"setLookAlong",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
"(",
... | Set this matrix to a rotation transformation to make <code>-z</code>
point along <code>dir</code>.
<p>
In order to apply the lookalong transformation to any previous existing transformation,
use {@link #lookAlong(Vector3dc, Vector3dc)}.
@see #setLookAlong(Vector3dc, Vector3dc)
@see #lookAlong(Vector3dc, Vector3dc)
@p... | [
"Set",
"this",
"matrix",
"to",
"a",
"rotation",
"transformation",
"to",
"make",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"point",
"along",
"<code",
">",
"dir<",
"/",
"code",
">",
".",
"<p",
">",
"In",
"order",
"to",
"apply",
"the",
"lookalong",
"tr... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3d.java#L3985-L3987 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ContextedException.java | ContextedException.addContextValue | @Override
public ContextedException addContextValue(final String label, final Object value) {
"""
Adds information helpful to a developer in diagnosing and correcting the problem.
For the information to be meaningful, the value passed should have a reasonable
toString() implementation.
Different values can ... | java | @Override
public ContextedException addContextValue(final String label, final Object value) {
exceptionContext.addContextValue(label, value);
return this;
} | [
"@",
"Override",
"public",
"ContextedException",
"addContextValue",
"(",
"final",
"String",
"label",
",",
"final",
"Object",
"value",
")",
"{",
"exceptionContext",
".",
"addContextValue",
"(",
"label",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds information helpful to a developer in diagnosing and correcting the problem.
For the information to be meaningful, the value passed should have a reasonable
toString() implementation.
Different values can be added with the same label multiple times.
<p>
Note: This exception is only serializable if the object added... | [
"Adds",
"information",
"helpful",
"to",
"a",
"developer",
"in",
"diagnosing",
"and",
"correcting",
"the",
"problem",
".",
"For",
"the",
"information",
"to",
"be",
"meaningful",
"the",
"value",
"passed",
"should",
"have",
"a",
"reasonable",
"toString",
"()",
"i... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ContextedException.java#L172-L176 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/forwardingsession.java | forwardingsession.get | public static forwardingsession get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch forwardingsession resource of given name .
"""
forwardingsession obj = new forwardingsession();
obj.set_name(name);
forwardingsession response = (forwardingsession) obj.get_resource(servic... | java | public static forwardingsession get(nitro_service service, String name) throws Exception{
forwardingsession obj = new forwardingsession();
obj.set_name(name);
forwardingsession response = (forwardingsession) obj.get_resource(service);
return response;
} | [
"public",
"static",
"forwardingsession",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"forwardingsession",
"obj",
"=",
"new",
"forwardingsession",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch forwardingsession resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"forwardingsession",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/forwardingsession.java#L320-L325 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.indexOfIgnoreCase | public static int indexOfIgnoreCase(String pString, int pChar, int pPos) {
"""
Returns the index within this string of the first occurrence of the
specified character, starting at the specified index.
@param pString The string to test
@param pChar The character to look for
@param pPos The first index to... | java | public static int indexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | [
"public",
"static",
"int",
"indexOfIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
",",
"int",
"pPos",
")",
"{",
"if",
"(",
"(",
"pString",
"==",
"null",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// Get first char\r",
"char",
"lower",
"... | Returns the index within this string of the first occurrence of the
specified character, starting at the specified index.
@param pString The string to test
@param pChar The character to look for
@param pPos The first index to test
@return if the string argument occurs as a substring within this object,
then the i... | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"character",
"starting",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L465-L496 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/AccentResources.java | AccentResources.getTintendResourceStream | private InputStream getTintendResourceStream(int id, TypedValue value, int color) {
"""
Get a reference to a resource that is equivalent to the one requested,
but with the accent color applied to it.
"""
Bitmap bitmap = getBitmapFromResource(id, value);
bitmap = BitmapUtils.applyColor(bitmap, color);
re... | java | private InputStream getTintendResourceStream(int id, TypedValue value, int color) {
Bitmap bitmap = getBitmapFromResource(id, value);
bitmap = BitmapUtils.applyColor(bitmap, color);
return getStreamFromBitmap(bitmap);
} | [
"private",
"InputStream",
"getTintendResourceStream",
"(",
"int",
"id",
",",
"TypedValue",
"value",
",",
"int",
"color",
")",
"{",
"Bitmap",
"bitmap",
"=",
"getBitmapFromResource",
"(",
"id",
",",
"value",
")",
";",
"bitmap",
"=",
"BitmapUtils",
".",
"applyCol... | Get a reference to a resource that is equivalent to the one requested,
but with the accent color applied to it. | [
"Get",
"a",
"reference",
"to",
"a",
"resource",
"that",
"is",
"equivalent",
"to",
"the",
"one",
"requested",
"but",
"with",
"the",
"accent",
"color",
"applied",
"to",
"it",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/AccentResources.java#L366-L370 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Image.java | Image.getInstance | public static Image getInstance(java.awt.Image image, java.awt.Color color)
throws BadElementException, IOException {
"""
Gets an instance of an Image from a java.awt.Image.
@param image
the <CODE>java.awt.Image</CODE> to convert
@param color
if different from <CODE>null</CODE> the transparency pixels
ar... | java | public static Image getInstance(java.awt.Image image, java.awt.Color color)
throws BadElementException, IOException {
return Image.getInstance(image, color, false);
} | [
"public",
"static",
"Image",
"getInstance",
"(",
"java",
".",
"awt",
".",
"Image",
"image",
",",
"java",
".",
"awt",
".",
"Color",
"color",
")",
"throws",
"BadElementException",
",",
"IOException",
"{",
"return",
"Image",
".",
"getInstance",
"(",
"image",
... | Gets an instance of an Image from a java.awt.Image.
@param image
the <CODE>java.awt.Image</CODE> to convert
@param color
if different from <CODE>null</CODE> the transparency pixels
are replaced by this color
@return an object of type <CODE>ImgRaw</CODE>
@throws BadElementException
on error
@throws IOException
on error | [
"Gets",
"an",
"instance",
"of",
"an",
"Image",
"from",
"a",
"java",
".",
"awt",
".",
"Image",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Image.java#L791-L794 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsm.java | XsdAsm.generateClassFromElement | void generateClassFromElement(XsdElement element, String apiName) {
"""
Generates an element class based on the received {@link XsdElement} object.
@param element The {@link XsdElement} containing information needed for the class creation.
@param apiName The name of the resulting fluent interface.
"""
... | java | void generateClassFromElement(XsdElement element, String apiName){
XsdAsmElements.generateClassFromElement(interfaceGenerator, createdAttributes, element, apiName);
} | [
"void",
"generateClassFromElement",
"(",
"XsdElement",
"element",
",",
"String",
"apiName",
")",
"{",
"XsdAsmElements",
".",
"generateClassFromElement",
"(",
"interfaceGenerator",
",",
"createdAttributes",
",",
"element",
",",
"apiName",
")",
";",
"}"
] | Generates an element class based on the received {@link XsdElement} object.
@param element The {@link XsdElement} containing information needed for the class creation.
@param apiName The name of the resulting fluent interface. | [
"Generates",
"an",
"element",
"class",
"based",
"on",
"the",
"received",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsm.java#L74-L76 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/BrokerHelper.java | BrokerHelper.representsNull | public boolean representsNull(FieldDescriptor fld, Object aValue) {
"""
Decide if the given object value represents 'null'.<br/>
- If given value is 'null' itself, true will be returned<br/>
- If given value is instance of Number with value 0 and the field-descriptor
represents a primitive field, true will ... | java | public boolean representsNull(FieldDescriptor fld, Object aValue)
{
if(aValue == null) return true;
boolean result = false;
if(((aValue instanceof Number) && (((Number) aValue).longValue() == 0)))
{
Class type = fld.getPersistentField().getType();
/*
... | [
"public",
"boolean",
"representsNull",
"(",
"FieldDescriptor",
"fld",
",",
"Object",
"aValue",
")",
"{",
"if",
"(",
"aValue",
"==",
"null",
")",
"return",
"true",
";",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"(",
"(",
"aValue",
"instanceof",
"... | Decide if the given object value represents 'null'.<br/>
- If given value is 'null' itself, true will be returned<br/>
- If given value is instance of Number with value 0 and the field-descriptor
represents a primitive field, true will be returned<br/>
- If given value is instance of String with length 0 and the fie... | [
"Decide",
"if",
"the",
"given",
"object",
"value",
"represents",
"null",
".",
"<br",
"/",
">"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L255-L281 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ActivitysInner.java | ActivitysInner.listByModuleWithServiceResponseAsync | public Observable<ServiceResponse<Page<ActivityInner>>> listByModuleWithServiceResponseAsync(final String resourceGroupName, final String automationAccountName, final String moduleName) {
"""
Retrieve a list of activities in the module identified by module name.
@param resourceGroupName Name of an Azure Resourc... | java | public Observable<ServiceResponse<Page<ActivityInner>>> listByModuleWithServiceResponseAsync(final String resourceGroupName, final String automationAccountName, final String moduleName) {
return listByModuleSinglePageAsync(resourceGroupName, automationAccountName, moduleName)
.concatMap(new Func1<Se... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ActivityInner",
">",
">",
">",
"listByModuleWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
",",
"final",
"String",
"moduleName",
... | Retrieve a list of activities in the module identified by module name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param moduleName The name of module.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the o... | [
"Retrieve",
"a",
"list",
"of",
"activities",
"in",
"the",
"module",
"identified",
"by",
"module",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ActivitysInner.java#L243-L255 |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java | XARMojo.addFilesToArchive | private void addFilesToArchive(ZipArchiver archiver, File sourceDir) throws Exception {
"""
Adds the files from a specific directory to an archive. It also builds a package.xml file based on that content
which is also added to the archive.
@param archiver the archive in which the files will be added
@param so... | java | private void addFilesToArchive(ZipArchiver archiver, File sourceDir) throws Exception
{
File generatedPackageFile = new File(sourceDir, PACKAGE_XML);
if (generatedPackageFile.exists()) {
generatedPackageFile.delete();
}
archiver.addDirectory(sourceDir, getIncludes(), get... | [
"private",
"void",
"addFilesToArchive",
"(",
"ZipArchiver",
"archiver",
",",
"File",
"sourceDir",
")",
"throws",
"Exception",
"{",
"File",
"generatedPackageFile",
"=",
"new",
"File",
"(",
"sourceDir",
",",
"PACKAGE_XML",
")",
";",
"if",
"(",
"generatedPackageFile"... | Adds the files from a specific directory to an archive. It also builds a package.xml file based on that content
which is also added to the archive.
@param archiver the archive in which the files will be added
@param sourceDir the directory whose contents will be added to the archive
@throws Exception if the files cann... | [
"Adds",
"the",
"files",
"from",
"a",
"specific",
"directory",
"to",
"an",
"archive",
".",
"It",
"also",
"builds",
"a",
"package",
".",
"xml",
"file",
"based",
"on",
"that",
"content",
"which",
"is",
"also",
"added",
"to",
"the",
"archive",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L466-L476 |
Berico-Technologies/CLAVIN | src/main/java/com/bericotech/clavin/util/DamerauLevenshtein.java | InfiniteCharArray.remainder | protected String remainder(int index) {
"""
Get the contents of the char array to the right of the given
index, and return it as a String.
@param index left bound of the string we're pulling from the char array
@return a string representing everything to the right of the index
"""
if ... | java | protected String remainder(int index) {
if (index > this.array.length)
return "";
else return new String(Arrays.copyOfRange(this.array, index, this.array.length));
} | [
"protected",
"String",
"remainder",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
">",
"this",
".",
"array",
".",
"length",
")",
"return",
"\"\"",
";",
"else",
"return",
"new",
"String",
"(",
"Arrays",
".",
"copyOfRange",
"(",
"this",
".",
"array"... | Get the contents of the char array to the right of the given
index, and return it as a String.
@param index left bound of the string we're pulling from the char array
@return a string representing everything to the right of the index | [
"Get",
"the",
"contents",
"of",
"the",
"char",
"array",
"to",
"the",
"right",
"of",
"the",
"given",
"index",
"and",
"return",
"it",
"as",
"a",
"String",
"."
] | train | https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/util/DamerauLevenshtein.java#L230-L234 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.addEntry | public static void addEntry(File zip, ZipEntrySource entry, File destZip) {
"""
Copies an existing ZIP file and appends it with one new entry.
@param zip
an existing ZIP file (only read).
@param entry
new ZIP entry appended.
@param destZip
new ZIP file created.
"""
addEntries(zip, new ZipEntrySourc... | java | public static void addEntry(File zip, ZipEntrySource entry, File destZip) {
addEntries(zip, new ZipEntrySource[] { entry }, destZip);
} | [
"public",
"static",
"void",
"addEntry",
"(",
"File",
"zip",
",",
"ZipEntrySource",
"entry",
",",
"File",
"destZip",
")",
"{",
"addEntries",
"(",
"zip",
",",
"new",
"ZipEntrySource",
"[",
"]",
"{",
"entry",
"}",
",",
"destZip",
")",
";",
"}"
] | Copies an existing ZIP file and appends it with one new entry.
@param zip
an existing ZIP file (only read).
@param entry
new ZIP entry appended.
@param destZip
new ZIP file created. | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"appends",
"it",
"with",
"one",
"new",
"entry",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2133-L2135 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/GanttBarStyleFactory14.java | GanttBarStyleFactory14.extractFlags | private void extractFlags(GanttBarStyle style, GanttBarShowForTasks baseCriteria, long flagValue) {
"""
Extract the flags indicating which task types this bar style
is relevant for. Note that this work for the "normal" task types
and the "negated" task types (e.g. Normal Task, Not Normal task).
The set of value... | java | private void extractFlags(GanttBarStyle style, GanttBarShowForTasks baseCriteria, long flagValue)
{
int index = 0;
long flag = 0x0001;
while (index < 64)
{
if ((flagValue & flag) != 0)
{
GanttBarShowForTasks enumValue = GanttBarShowForTasks.getInstance(baseCrite... | [
"private",
"void",
"extractFlags",
"(",
"GanttBarStyle",
"style",
",",
"GanttBarShowForTasks",
"baseCriteria",
",",
"long",
"flagValue",
")",
"{",
"int",
"index",
"=",
"0",
";",
"long",
"flag",
"=",
"0x0001",
";",
"while",
"(",
"index",
"<",
"64",
")",
"{"... | Extract the flags indicating which task types this bar style
is relevant for. Note that this work for the "normal" task types
and the "negated" task types (e.g. Normal Task, Not Normal task).
The set of values used is determined by the baseCriteria argument.
@param style parent bar style
@param baseCriteria determines... | [
"Extract",
"the",
"flags",
"indicating",
"which",
"task",
"types",
"this",
"bar",
"style",
"is",
"relevant",
"for",
".",
"Note",
"that",
"this",
"work",
"for",
"the",
"normal",
"task",
"types",
"and",
"the",
"negated",
"task",
"types",
"(",
"e",
".",
"g"... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GanttBarStyleFactory14.java#L145-L165 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RestorableDroppedDatabasesInner.java | RestorableDroppedDatabasesInner.listByServerAsync | public Observable<List<RestorableDroppedDatabaseInner>> listByServerAsync(String resourceGroupName, String serverName) {
"""
Gets a list of deleted databases that can be restored.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resourc... | java | public Observable<List<RestorableDroppedDatabaseInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<RestorableDroppedDatabaseInner>>, List<RestorableDroppedDatabaseInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"RestorableDroppedDatabaseInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverNa... | Gets a list of deleted databases that can be restored.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail th... | [
"Gets",
"a",
"list",
"of",
"deleted",
"databases",
"that",
"can",
"be",
"restored",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RestorableDroppedDatabasesInner.java#L193-L200 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.drawImage | public void drawImage (final PDInlineImage inlineImage,
final float x,
final float y,
final float width,
final float height) throws IOException {
"""
Draw an inline image at the x,y coordinates and a certain width a... | java | public void drawImage (final PDInlineImage inlineImage,
final float x,
final float y,
final float width,
final float height) throws IOException
{
if (inTextMode)
{
throw new IllegalStateException ("Error:... | [
"public",
"void",
"drawImage",
"(",
"final",
"PDInlineImage",
"inlineImage",
",",
"final",
"float",
"x",
",",
"final",
"float",
"y",
",",
"final",
"float",
"width",
",",
"final",
"float",
"height",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inTextMode",
... | Draw an inline image at the x,y coordinates and a certain width and height.
@param inlineImage
The inline image to draw.
@param x
The x-coordinate to draw the inline image.
@param y
The y-coordinate to draw the inline image.
@param width
The width of the inline image to draw.
@param height
The height of the inline ima... | [
"Draw",
"an",
"inline",
"image",
"at",
"the",
"x",
"y",
"coordinates",
"and",
"a",
"certain",
"width",
"and",
"height",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L568-L627 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.formatPercent | public static String formatPercent(double number, int scale) {
"""
格式化百分比,小数采用四舍五入方式
@param number 值
@param scale 保留小数位数
@return 百分比
@since 3.2.3
"""
final NumberFormat format = NumberFormat.getPercentInstance();
format.setMaximumFractionDigits(scale);
return format.format(number);
} | java | public static String formatPercent(double number, int scale) {
final NumberFormat format = NumberFormat.getPercentInstance();
format.setMaximumFractionDigits(scale);
return format.format(number);
} | [
"public",
"static",
"String",
"formatPercent",
"(",
"double",
"number",
",",
"int",
"scale",
")",
"{",
"final",
"NumberFormat",
"format",
"=",
"NumberFormat",
".",
"getPercentInstance",
"(",
")",
";",
"format",
".",
"setMaximumFractionDigits",
"(",
"scale",
")",... | 格式化百分比,小数采用四舍五入方式
@param number 值
@param scale 保留小数位数
@return 百分比
@since 3.2.3 | [
"格式化百分比,小数采用四舍五入方式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1038-L1042 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java | MethodBuilder.getInstance | public static MethodBuilder getInstance(Context context,
TypeElement typeElement, MethodWriter writer) {
"""
Construct a new MethodBuilder.
@param context the build context.
@param typeElement the class whoses members are being documented.
@param writer the doclet specific writer.
@return... | java | public static MethodBuilder getInstance(Context context,
TypeElement typeElement, MethodWriter writer) {
return new MethodBuilder(context, typeElement, writer);
} | [
"public",
"static",
"MethodBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"TypeElement",
"typeElement",
",",
"MethodWriter",
"writer",
")",
"{",
"return",
"new",
"MethodBuilder",
"(",
"context",
",",
"typeElement",
",",
"writer",
")",
";",
"}"
] | Construct a new MethodBuilder.
@param context the build context.
@param typeElement the class whoses members are being documented.
@param writer the doclet specific writer.
@return an instance of a MethodBuilder. | [
"Construct",
"a",
"new",
"MethodBuilder",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java#L111-L114 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAchievementGroupInfo | public void getAchievementGroupInfo(String[] ids, Callback<List<AchievementGroup>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on achievements groups API go <a href="https://wiki.guildwars2.com/wiki/API:2/achievements/groups">here</a><br/>
Give user the access to {@link Callback... | java | public void getAchievementGroupInfo(String[] ids, Callback<List<AchievementGroup>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getAchievementGroupInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getAchievementGroupInfo",
"(",
"String",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"AchievementGroup",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChec... | For more info on achievements groups API go <a href="https://wiki.guildwars2.com/wiki/API:2/achievements/groups">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of achievement group id... | [
"For",
"more",
"info",
"on",
"achievements",
"groups",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"achievements",
"/",
"groups",
">",
"here<",
"/",
"a",
">",
"<... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L563-L566 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java | InstanceListenerService.evaluateMethod | private void evaluateMethod(Object listener, Class<? extends Annotation> annotation, Method method, Map<Object, Set<Method>> methods) {
"""
Evaluates a method if an annotation is present and if true adds to the map of
life cycle methods.
@param listener
The listener instance.
@param annotation
The annotatio... | java | private void evaluateMethod(Object listener, Class<? extends Annotation> annotation, Method method, Map<Object, Set<Method>> methods) {
if (method.isAnnotationPresent(annotation)) {
if (method.getParameterTypes().length != 1) {
throw new XOException("Life cycle method '" + method.toG... | [
"private",
"void",
"evaluateMethod",
"(",
"Object",
"listener",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"Method",
"method",
",",
"Map",
"<",
"Object",
",",
"Set",
"<",
"Method",
">",
">",
"methods",
")",
"{",
"if",
"(",
... | Evaluates a method if an annotation is present and if true adds to the map of
life cycle methods.
@param listener
The listener instance.
@param annotation
The annotation to check for.
@param method
The method to evaluate.
@param methods
The map of methods. | [
"Evaluates",
"a",
"method",
"if",
"an",
"annotation",
"is",
"present",
"and",
"if",
"true",
"adds",
"to",
"the",
"map",
"of",
"life",
"cycle",
"methods",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java#L145-L158 |
adyliu/jafka | src/main/java/io/jafka/consumer/StringConsumers.java | StringConsumers.buildConsumer | public static StringConsumers buildConsumer(
final String zookeeperConfig,//
final String topic,//
final String groupId,//
final IMessageListener<String> listener, //
final int threads) {
"""
build a callback consumer
@param zookeeperConfig connect con... | java | public static StringConsumers buildConsumer(
final String zookeeperConfig,//
final String topic,//
final String groupId,//
final IMessageListener<String> listener, //
final int threads) {
Properties props = new Properties();
props.put("zk.conne... | [
"public",
"static",
"StringConsumers",
"buildConsumer",
"(",
"final",
"String",
"zookeeperConfig",
",",
"//",
"final",
"String",
"topic",
",",
"//",
"final",
"String",
"groupId",
",",
"//",
"final",
"IMessageListener",
"<",
"String",
">",
"listener",
",",
"//",
... | build a callback consumer
@param zookeeperConfig connect config of zookeeper; ex: 127.0.0.1:2181/jafka
@param topic the topic to be watched
@param groupId grouping the consumer clients
@param listener message listener
@param threads threads of consumer per topic
@return the real consum... | [
"build",
"a",
"callback",
"consumer"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/consumer/StringConsumers.java#L96-L115 |
duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java | StorageProviderUtil.loadProperties | public static Map<String, String> loadProperties(InputStream is)
throws StorageException {
"""
Loads a stream containing properties and populates a map
with the properties name/value pairs.
@param is
@return
@throws StorageException
"""
Map<String, String> propertiesMap = null;
if... | java | public static Map<String, String> loadProperties(InputStream is)
throws StorageException {
Map<String, String> propertiesMap = null;
if (is != null) {
try {
String properties = readStringFromStream(is);
propertiesMap = deserializeMap(properties);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"loadProperties",
"(",
"InputStream",
"is",
")",
"throws",
"StorageException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"propertiesMap",
"=",
"null",
";",
"if",
"(",
"is",
"!=",
"null",
... | Loads a stream containing properties and populates a map
with the properties name/value pairs.
@param is
@return
@throws StorageException | [
"Loads",
"a",
"stream",
"containing",
"properties",
"and",
"populates",
"a",
"map",
"with",
"the",
"properties",
"name",
"/",
"value",
"pairs",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java#L56-L75 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.filterCountByG_C | @Override
public int filterCountByG_C(long groupId, String couponCode) {
"""
Returns the number of commerce discounts that the user has permission to view where groupId = ? and couponCode = ?.
@param groupId the group ID
@param couponCode the coupon code
@return the number of matching commerce discou... | java | @Override
public int filterCountByG_C(long groupId, String couponCode) {
if (!InlineSQLHelperUtil.isEnabled(groupId)) {
return countByG_C(groupId, couponCode);
}
StringBundler query = new StringBundler(3);
query.append(_FILTER_SQL_COUNT_COMMERCEDISCOUNT_WHERE);
query.append(_FINDER_COLUMN_G_C_GROUPID_2... | [
"@",
"Override",
"public",
"int",
"filterCountByG_C",
"(",
"long",
"groupId",
",",
"String",
"couponCode",
")",
"{",
"if",
"(",
"!",
"InlineSQLHelperUtil",
".",
"isEnabled",
"(",
"groupId",
")",
")",
"{",
"return",
"countByG_C",
"(",
"groupId",
",",
"couponC... | Returns the number of commerce discounts that the user has permission to view where groupId = ? and couponCode = ?.
@param groupId the group ID
@param couponCode the coupon code
@return the number of matching commerce discounts that the user has permission to view | [
"Returns",
"the",
"number",
"of",
"commerce",
"discounts",
"that",
"the",
"user",
"has",
"permission",
"to",
"view",
"where",
"groupId",
"=",
"?",
";",
"and",
"couponCode",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L3305-L3363 |
netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java | AbstractKQueueStreamChannel.writeFileRegion | private int writeFileRegion(ChannelOutboundBuffer in, FileRegion region) throws Exception {
"""
Write a {@link FileRegion}
@param in the collection which contains objects to write.
@param region the {@link FileRegion} from which the bytes should be written
@return The value that should be decremented from the w... | java | private int writeFileRegion(ChannelOutboundBuffer in, FileRegion region) throws Exception {
if (region.transferred() >= region.count()) {
in.remove();
return 0;
}
if (byteChannel == null) {
byteChannel = new KQueueSocketWritableByteChannel();
}
... | [
"private",
"int",
"writeFileRegion",
"(",
"ChannelOutboundBuffer",
"in",
",",
"FileRegion",
"region",
")",
"throws",
"Exception",
"{",
"if",
"(",
"region",
".",
"transferred",
"(",
")",
">=",
"region",
".",
"count",
"(",
")",
")",
"{",
"in",
".",
"remove",... | Write a {@link FileRegion}
@param in the collection which contains objects to write.
@param region the {@link FileRegion} from which the bytes should be written
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as fol... | [
"Write",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java#L247-L265 |
openbase/jul | exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java | ExceptionPrinter.printHistory | public static <T extends Throwable> void printHistory(final T th, final Logger logger, final LogLevel level) {
"""
Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the... | java | public static <T extends Throwable> void printHistory(final T th, final Logger logger, final LogLevel level) {
printHistory(th, new LogPrinter(logger, level));
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"void",
"printHistory",
"(",
"final",
"T",
"th",
",",
"final",
"Logger",
"logger",
",",
"final",
"LogLevel",
"level",
")",
"{",
"printHistory",
"(",
"th",
",",
"new",
"LogPrinter",
"(",
"logger",
... | Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the stacktrace is printed in the end of history.
@param <T> Exception type
@param logger the logger used as message printer... | [
"Print",
"Exception",
"messages",
"without",
"stack",
"trace",
"in",
"non",
"debug",
"mode",
".",
"Method",
"prints",
"recursive",
"all",
"messages",
"of",
"the",
"given",
"exception",
"stack",
"to",
"get",
"a",
"history",
"overview",
"of",
"the",
"causes",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java#L120-L122 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java | AbstractSecurityController.setVisibilityOnControlledObject | private void setVisibilityOnControlledObject(Object controlledObject, boolean authorized) {
"""
Set the visible property on a controlled action according to the provided
authorization.
"""
try {
Method method = controlledObject.getClass().getMethod( "setVisible", new Class[] { boolean.clas... | java | private void setVisibilityOnControlledObject(Object controlledObject, boolean authorized) {
try {
Method method = controlledObject.getClass().getMethod( "setVisible", new Class[] { boolean.class } );
method.invoke( controlledObject, new Object[] { new Boolean( authorized ) } );
}... | [
"private",
"void",
"setVisibilityOnControlledObject",
"(",
"Object",
"controlledObject",
",",
"boolean",
"authorized",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"controlledObject",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"setVisible\"",
",",
"new"... | Set the visible property on a controlled action according to the provided
authorization. | [
"Set",
"the",
"visible",
"property",
"on",
"a",
"controlled",
"action",
"according",
"to",
"the",
"provided",
"authorization",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L218-L230 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.doUnlock | protected void doUnlock(HttpServletRequest req, HttpServletResponse resp) {
"""
Process a UNLOCK WebDAV request for the specified resource.<p>
@param req the servlet request we are processing
@param resp the servlet response we are creating
"""
String path = getRelativePath(req);
// Check... | java | protected void doUnlock(HttpServletRequest req, HttpServletResponse resp) {
String path = getRelativePath(req);
// Check if Webdav is read only
if (m_readOnly) {
resp.setStatus(CmsWebdavStatus.SC_FORBIDDEN);
if (LOG.isDebugEnabled()) {
LOG.debug(Messag... | [
"protected",
"void",
"doUnlock",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"String",
"path",
"=",
"getRelativePath",
"(",
"req",
")",
";",
"// Check if Webdav is read only",
"if",
"(",
"m_readOnly",
")",
"{",
"resp",
".",
"s... | Process a UNLOCK WebDAV request for the specified resource.<p>
@param req the servlet request we are processing
@param resp the servlet response we are creating | [
"Process",
"a",
"UNLOCK",
"WebDAV",
"request",
"for",
"the",
"specified",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L2111-L2146 |
jenkinsci/favorite-plugin | src/main/java/hudson/plugins/favorite/Favorites.java | Favorites.isFavorite | public static boolean isFavorite(@Nonnull User user, @Nonnull Item item) {
"""
Check if the item is favorited
@param user to check
@param item to check
@return favorite state
"""
FavoriteUserProperty fup = user.getProperty(FavoriteUserProperty.class);
return fup != null && fup.isJobFavorite(... | java | public static boolean isFavorite(@Nonnull User user, @Nonnull Item item) {
FavoriteUserProperty fup = user.getProperty(FavoriteUserProperty.class);
return fup != null && fup.isJobFavorite(item.getFullName());
} | [
"public",
"static",
"boolean",
"isFavorite",
"(",
"@",
"Nonnull",
"User",
"user",
",",
"@",
"Nonnull",
"Item",
"item",
")",
"{",
"FavoriteUserProperty",
"fup",
"=",
"user",
".",
"getProperty",
"(",
"FavoriteUserProperty",
".",
"class",
")",
";",
"return",
"f... | Check if the item is favorited
@param user to check
@param item to check
@return favorite state | [
"Check",
"if",
"the",
"item",
"is",
"favorited"
] | train | https://github.com/jenkinsci/favorite-plugin/blob/4ce9b195b4d888190fe12c92d546d64f22728c22/src/main/java/hudson/plugins/favorite/Favorites.java#L43-L46 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addPreQualifiedStrongClassLink | public void addPreQualifiedStrongClassLink(LinkInfoImpl.Kind context, TypeElement typeElement, Content contentTree) {
"""
Add the class link, with only class name as the strong link and prefixing
plain package name.
@param context the id of the context where the link will be added
@param typeElement the class... | java | public void addPreQualifiedStrongClassLink(LinkInfoImpl.Kind context, TypeElement typeElement, Content contentTree) {
addPreQualifiedClassLink(context, typeElement, true, contentTree);
} | [
"public",
"void",
"addPreQualifiedStrongClassLink",
"(",
"LinkInfoImpl",
".",
"Kind",
"context",
",",
"TypeElement",
"typeElement",
",",
"Content",
"contentTree",
")",
"{",
"addPreQualifiedClassLink",
"(",
"context",
",",
"typeElement",
",",
"true",
",",
"contentTree"... | Add the class link, with only class name as the strong link and prefixing
plain package name.
@param context the id of the context where the link will be added
@param typeElement the class to link to
@param contentTree the content tree to which the link with be added | [
"Add",
"the",
"class",
"link",
"with",
"only",
"class",
"name",
"as",
"the",
"strong",
"link",
"and",
"prefixing",
"plain",
"package",
"name",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1339-L1341 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ServiceExtensionLoader.java | ServiceExtensionLoader.loadExtensionWrapper | private <T extends Assignable> ExtensionWrapper loadExtensionWrapper(final InputStream extensionStream,
Class<T> extensionClass) {
"""
Wraps the provider-configuration file <code>extensionStream</code>, the SPI <code>extensionClass</code> and its
implementation class name into a {@link ExtensionWrapper} i... | java | private <T extends Assignable> ExtensionWrapper loadExtensionWrapper(final InputStream extensionStream,
Class<T> extensionClass) {
Properties properties = new Properties();
try {
properties.load(extensionStream);
} catch (IOException e) {
throw new RuntimeExceptio... | [
"private",
"<",
"T",
"extends",
"Assignable",
">",
"ExtensionWrapper",
"loadExtensionWrapper",
"(",
"final",
"InputStream",
"extensionStream",
",",
"Class",
"<",
"T",
">",
"extensionClass",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
... | Wraps the provider-configuration file <code>extensionStream</code>, the SPI <code>extensionClass</code> and its
implementation class name into a {@link ExtensionWrapper} instance.
@param <T>
@param extensionStream
- a bytes stream representation of the provider-configuration file
@param extensionClass
- SPI type
@retu... | [
"Wraps",
"the",
"provider",
"-",
"configuration",
"file",
"<code",
">",
"extensionStream<",
"/",
"code",
">",
"the",
"SPI",
"<code",
">",
"extensionClass<",
"/",
"code",
">",
"and",
"its",
"implementation",
"class",
"name",
"into",
"a",
"{",
"@link",
"Extens... | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ServiceExtensionLoader.java#L294-L314 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/io/Closeables.java | Closeables.closeableFrom | public static Closeable closeableFrom(@WillNotClose @Nullable final Clob clob) {
"""
Provides {@link Closeable} interface for {@link Clob}
@param clob the clob to decorate
@return a closeable decorated clob
"""
return closeableFrom(clob, Clob::free);
} | java | public static Closeable closeableFrom(@WillNotClose @Nullable final Clob clob) {
return closeableFrom(clob, Clob::free);
} | [
"public",
"static",
"Closeable",
"closeableFrom",
"(",
"@",
"WillNotClose",
"@",
"Nullable",
"final",
"Clob",
"clob",
")",
"{",
"return",
"closeableFrom",
"(",
"clob",
",",
"Clob",
"::",
"free",
")",
";",
"}"
] | Provides {@link Closeable} interface for {@link Clob}
@param clob the clob to decorate
@return a closeable decorated clob | [
"Provides",
"{",
"@link",
"Closeable",
"}",
"interface",
"for",
"{",
"@link",
"Clob",
"}"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/io/Closeables.java#L58-L60 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/PayMchAPI.java | PayMchAPI.secapiPayProfitsharingfinish | public static SecapiPayProfitsharingfinishResult secapiPayProfitsharingfinish(SecapiPayProfitsharingfinish profitsharingfinish,String key) {
"""
分账-完结分账
@since 2.8.26
@param profitsharingfinish profitsharingfinish
@param key key
@return SecapiPayProfitsharingfinishResult
"""
Map<String,String> map = MapU... | java | public static SecapiPayProfitsharingfinishResult secapiPayProfitsharingfinish(SecapiPayProfitsharingfinish profitsharingfinish,String key){
Map<String,String> map = MapUtil.objectToMap(profitsharingfinish);
String sign = SignatureUtil.generateSign(map,profitsharingfinish.getSign_type() == null? "HMAC-SHA256": profi... | [
"public",
"static",
"SecapiPayProfitsharingfinishResult",
"secapiPayProfitsharingfinish",
"(",
"SecapiPayProfitsharingfinish",
"profitsharingfinish",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"MapUtil",
".",
"objectToMap",
"("... | 分账-完结分账
@since 2.8.26
@param profitsharingfinish profitsharingfinish
@param key key
@return SecapiPayProfitsharingfinishResult | [
"分账",
"-",
"完结分账"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/PayMchAPI.java#L779-L790 |
UrielCh/ovh-java-sdk | ovh-java-sdk-licensedirectadmin/src/main/java/net/minidev/ovh/api/ApiOvhLicensedirectadmin.java | ApiOvhLicensedirectadmin.orderableVersions_GET | public ArrayList<OvhDirectAdminOrderConfiguration> orderableVersions_GET(String ip) throws IOException {
"""
Get the orderable DirectAdmin versions
REST: GET /license/directadmin/orderableVersions
@param ip [required] Your license Ip
"""
String qPath = "/license/directadmin/orderableVersions";
StringBu... | java | public ArrayList<OvhDirectAdminOrderConfiguration> orderableVersions_GET(String ip) throws IOException {
String qPath = "/license/directadmin/orderableVersions";
StringBuilder sb = path(qPath);
query(sb, "ip", ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | [
"public",
"ArrayList",
"<",
"OvhDirectAdminOrderConfiguration",
">",
"orderableVersions_GET",
"(",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/license/directadmin/orderableVersions\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | Get the orderable DirectAdmin versions
REST: GET /license/directadmin/orderableVersions
@param ip [required] Your license Ip | [
"Get",
"the",
"orderable",
"DirectAdmin",
"versions"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licensedirectadmin/src/main/java/net/minidev/ovh/api/ApiOvhLicensedirectadmin.java#L36-L42 |
roboconf/roboconf-platform | core/roboconf-plugin-script/src/main/java/net/roboconf/plugin/script/internal/templating/InstanceTemplateHelper.java | InstanceTemplateHelper.injectInstanceImports | public static void injectInstanceImports(Instance instance, String templateFilePath, File targetFile)
throws IOException {
"""
Reads the import values of the instances and injects them into the template file.
<p>
See test resources to see the associated way to write templates
</p>
@param instance the instan... | java | public static void injectInstanceImports(Instance instance, String templateFilePath, File targetFile)
throws IOException {
OutputStream os = null;
try {
os = new FileOutputStream( targetFile );
OutputStreamWriter writer = new OutputStreamWriter( os, StandardCharsets.UTF_8.newEncoder());
injectInstanceImp... | [
"public",
"static",
"void",
"injectInstanceImports",
"(",
"Instance",
"instance",
",",
"String",
"templateFilePath",
",",
"File",
"targetFile",
")",
"throws",
"IOException",
"{",
"OutputStream",
"os",
"=",
"null",
";",
"try",
"{",
"os",
"=",
"new",
"FileOutputSt... | Reads the import values of the instances and injects them into the template file.
<p>
See test resources to see the associated way to write templates
</p>
@param instance the instance whose imports must be injected
@param templateFilePath the path of the template file
@param targetFile the file to write into
@throws I... | [
"Reads",
"the",
"import",
"values",
"of",
"the",
"instances",
"and",
"injects",
"them",
"into",
"the",
"template",
"file",
".",
"<p",
">",
"See",
"test",
"resources",
"to",
"see",
"the",
"associated",
"way",
"to",
"write",
"templates",
"<",
"/",
"p",
">"... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-plugin-script/src/main/java/net/roboconf/plugin/script/internal/templating/InstanceTemplateHelper.java#L105-L117 |
menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.readObject | public static Object readObject(ChannelBuffer buffer, int length) {
"""
Read an object from a channel buffer with the specified length. It sets
the reader index of the buffer to current reader index + 2(length bytes)
+ actual length.
@param buffer
The Netty buffer containing the Object.
@param length
The n... | java | public static Object readObject(ChannelBuffer buffer, int length)
{
ChannelBuffer objBuffer = buffer.readSlice(length);
Object obj;
try
{
obj = OBJECT_DECODER.decode(objBuffer);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
return obj;
} | [
"public",
"static",
"Object",
"readObject",
"(",
"ChannelBuffer",
"buffer",
",",
"int",
"length",
")",
"{",
"ChannelBuffer",
"objBuffer",
"=",
"buffer",
".",
"readSlice",
"(",
"length",
")",
";",
"Object",
"obj",
";",
"try",
"{",
"obj",
"=",
"OBJECT_DECODER"... | Read an object from a channel buffer with the specified length. It sets
the reader index of the buffer to current reader index + 2(length bytes)
+ actual length.
@param buffer
The Netty buffer containing the Object.
@param length
The number of bytes in the Object.
@return Returns the read object. | [
"Read",
"an",
"object",
"from",
"a",
"channel",
"buffer",
"with",
"the",
"specified",
"length",
".",
"It",
"sets",
"the",
"reader",
"index",
"of",
"the",
"buffer",
"to",
"current",
"reader",
"index",
"+",
"2",
"(",
"length",
"bytes",
")",
"+",
"actual",
... | train | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L353-L366 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_binding.java | wisite_binding.get | public static wisite_binding get(nitro_service service, String sitepath) throws Exception {
"""
Use this API to fetch wisite_binding resource of given name .
"""
wisite_binding obj = new wisite_binding();
obj.set_sitepath(sitepath);
wisite_binding response = (wisite_binding) obj.get_resource(service);
... | java | public static wisite_binding get(nitro_service service, String sitepath) throws Exception{
wisite_binding obj = new wisite_binding();
obj.set_sitepath(sitepath);
wisite_binding response = (wisite_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"wisite_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"sitepath",
")",
"throws",
"Exception",
"{",
"wisite_binding",
"obj",
"=",
"new",
"wisite_binding",
"(",
")",
";",
"obj",
".",
"set_sitepath",
"(",
"sitepath",
")",
";... | Use this API to fetch wisite_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"wisite_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_binding.java#L125-L130 |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/io/FileStorage.java | FileStorage.onOutput | @Handler
public void onOutput(Output<ByteBuffer> event, Channel channel) {
"""
Handle {@link Output} events by writing them to the file, if
a channel exists.
@param event the event
@param channel the channel
"""
Writer writer = outputWriters.get(channel);
if (writer != null) {
... | java | @Handler
public void onOutput(Output<ByteBuffer> event, Channel channel) {
Writer writer = outputWriters.get(channel);
if (writer != null) {
writer.write(event.buffer());
}
} | [
"@",
"Handler",
"public",
"void",
"onOutput",
"(",
"Output",
"<",
"ByteBuffer",
">",
"event",
",",
"Channel",
"channel",
")",
"{",
"Writer",
"writer",
"=",
"outputWriters",
".",
"get",
"(",
"channel",
")",
";",
"if",
"(",
"writer",
"!=",
"null",
")",
"... | Handle {@link Output} events by writing them to the file, if
a channel exists.
@param event the event
@param channel the channel | [
"Handle",
"{",
"@link",
"Output",
"}",
"events",
"by",
"writing",
"them",
"to",
"the",
"file",
"if",
"a",
"channel",
"exists",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java#L368-L374 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/OpenCensusUtils.java | OpenCensusUtils.recordMessageEvent | @VisibleForTesting
static void recordMessageEvent(Span span, long size, Type eventType) {
"""
Records a message event of a certain {@link MessageEvent.Type}. This method is package
protected since {@link MessageEvent} might be deprecated in future releases.
@param span The {@code span} in which the event occ... | java | @VisibleForTesting
static void recordMessageEvent(Span span, long size, Type eventType) {
Preconditions.checkArgument(span != null, "span should not be null.");
if (size < 0) {
size = 0;
}
MessageEvent event =
MessageEvent.builder(eventType, idGenerator.getAndIncrement())
.se... | [
"@",
"VisibleForTesting",
"static",
"void",
"recordMessageEvent",
"(",
"Span",
"span",
",",
"long",
"size",
",",
"Type",
"eventType",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"span",
"!=",
"null",
",",
"\"span should not be null.\"",
")",
";",
"if",... | Records a message event of a certain {@link MessageEvent.Type}. This method is package
protected since {@link MessageEvent} might be deprecated in future releases.
@param span The {@code span} in which the event occurs.
@param size Size of the message.
@param eventType The {@code NetworkEvent.Type} of the message even... | [
"Records",
"a",
"message",
"event",
"of",
"a",
"certain",
"{",
"@link",
"MessageEvent",
".",
"Type",
"}",
".",
"This",
"method",
"is",
"package",
"protected",
"since",
"{",
"@link",
"MessageEvent",
"}",
"might",
"be",
"deprecated",
"in",
"future",
"releases"... | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/OpenCensusUtils.java#L212-L223 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/controller/Fetcher.java | Fetcher.subgraphContains | public boolean subgraphContains(final BioPAXElement root, final String uri,
final Class<? extends BioPAXElement> type) {
"""
Iterates over child objects of the given biopax element,
using BioPAX object-type properties, until the element
with specified URI and class (including its sub-classes).
is found.
... | java | public boolean subgraphContains(final BioPAXElement root, final String uri,
final Class<? extends BioPAXElement> type) {
final AtomicBoolean found = new AtomicBoolean(false);
Traverser traverser = new AbstractTraverser(editorMap, filters) {
@Override
protected voi... | [
"public",
"boolean",
"subgraphContains",
"(",
"final",
"BioPAXElement",
"root",
",",
"final",
"String",
"uri",
",",
"final",
"Class",
"<",
"?",
"extends",
"BioPAXElement",
">",
"type",
")",
"{",
"final",
"AtomicBoolean",
"found",
"=",
"new",
"AtomicBoolean",
"... | Iterates over child objects of the given biopax element,
using BioPAX object-type properties, until the element
with specified URI and class (including its sub-classes).
is found.
@param root biopax element to process
@param uri URI to match
@param type class to match
@return true if the match found; false - otherwis... | [
"Iterates",
"over",
"child",
"objects",
"of",
"the",
"given",
"biopax",
"element",
"using",
"BioPAX",
"object",
"-",
"type",
"properties",
"until",
"the",
"element",
"with",
"specified",
"URI",
"and",
"class",
"(",
"including",
"its",
"sub",
"-",
"classes",
... | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/controller/Fetcher.java#L270-L294 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java | TimeUnit.timedWait | public void timedWait(Object obj, long timeout)
throws InterruptedException {
"""
Perform a timed <tt>Object.wait</tt> using this time unit.
This is a convenience method that converts timeout arguments
into the form required by the <tt>Object.wait</tt> method.
<p>For example, you could implement a bl... | java | public void timedWait(Object obj, long timeout)
throws InterruptedException {
if (timeout > 0) {
long ms = toMillis(timeout);
int ns = excessNanos(timeout, ms);
obj.wait(ms, ns);
}
} | [
"public",
"void",
"timedWait",
"(",
"Object",
"obj",
",",
"long",
"timeout",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"timeout",
">",
"0",
")",
"{",
"long",
"ms",
"=",
"toMillis",
"(",
"timeout",
")",
";",
"int",
"ns",
"=",
"excessNanos",
... | Perform a timed <tt>Object.wait</tt> using this time unit.
This is a convenience method that converts timeout arguments
into the form required by the <tt>Object.wait</tt> method.
<p>For example, you could implement a blocking <tt>poll</tt>
method (see {@link BlockingQueue#poll BlockingQueue.poll})
using:
<pre> publi... | [
"Perform",
"a",
"timed",
"<tt",
">",
"Object",
".",
"wait<",
"/",
"tt",
">",
"using",
"this",
"time",
"unit",
".",
"This",
"is",
"a",
"convenience",
"method",
"that",
"converts",
"timeout",
"arguments",
"into",
"the",
"form",
"required",
"by",
"the",
"<t... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/concurrent/TimeUnit.java#L282-L289 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getDeletedSasDefinitionsWithServiceResponseAsync | public Observable<ServiceResponse<Page<DeletedSasDefinitionItem>>> getDeletedSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName) {
"""
Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS... | java | public Observable<ServiceResponse<Page<DeletedSasDefinitionItem>>> getDeletedSasDefinitionsWithServiceResponseAsync(final String vaultBaseUrl, final String storageAccountName) {
return getDeletedSasDefinitionsSinglePageAsync(vaultBaseUrl, storageAccountName)
.concatMap(new Func1<ServiceResponse<Page... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DeletedSasDefinitionItem",
">",
">",
">",
"getDeletedSasDefinitionsWithServiceResponseAsync",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"String",
"storageAccountName",
")",
"{",
"return",
"ge... | Lists deleted SAS definitions for the specified vault and storage account.
The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.
@param vaultBaseUrl The vault name, for example https://my... | [
"Lists",
"deleted",
"SAS",
"definitions",
"for",
"the",
"specified",
"vault",
"and",
"storage",
"account",
".",
"The",
"Get",
"Deleted",
"Sas",
"Definitions",
"operation",
"returns",
"the",
"SAS",
"definitions",
"that",
"have",
"been",
"deleted",
"for",
"a",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10688-L10700 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.compareTo | public static int compareTo(Character left, Character right) {
"""
Compare two Characters. The ordinal values of the Characters
are compared (the ordinal value is the unicode
value which for simple character sets is the ASCII value).
@param left a Character
@param right a Character
@return the result of th... | java | public static int compareTo(Character left, Character right) {
return compareTo(Integer.valueOf(left), right);
} | [
"public",
"static",
"int",
"compareTo",
"(",
"Character",
"left",
",",
"Character",
"right",
")",
"{",
"return",
"compareTo",
"(",
"Integer",
".",
"valueOf",
"(",
"left",
")",
",",
"right",
")",
";",
"}"
] | Compare two Characters. The ordinal values of the Characters
are compared (the ordinal value is the unicode
value which for simple character sets is the ASCII value).
@param left a Character
@param right a Character
@return the result of the comparison
@since 1.0 | [
"Compare",
"two",
"Characters",
".",
"The",
"ordinal",
"values",
"of",
"the",
"Characters",
"are",
"compared",
"(",
"the",
"ordinal",
"value",
"is",
"the",
"unicode",
"value",
"which",
"for",
"simple",
"character",
"sets",
"is",
"the",
"ASCII",
"value",
")",... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L15085-L15087 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java | TmdbAccount.getAccount | public Account getAccount(String sessionId) throws MovieDbException {
"""
Get the basic information for an account. You will need to have a valid session id.
@param sessionId
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SESSION... | java | public Account getAccount(String sessionId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.SESSION_ID, sessionId);
URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
... | [
"public",
"Account",
"getAccount",
"(",
"String",
"sessionId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"SESSION_ID",
",",
"sessionId",
")",
... | Get the basic information for an account. You will need to have a valid session id.
@param sessionId
@return
@throws MovieDbException | [
"Get",
"the",
"basic",
"information",
"for",
"an",
"account",
".",
"You",
"will",
"need",
"to",
"have",
"a",
"valid",
"session",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L68-L80 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java | BytecodeUtils.logicalNot | public static Expression logicalNot(final Expression baseExpr) {
"""
Returns an expression that evaluates to the logical negation of the given boolean valued
expression.
"""
baseExpr.checkAssignableTo(Type.BOOLEAN_TYPE);
checkArgument(baseExpr.resultType().equals(Type.BOOLEAN_TYPE), "not a boolean exp... | java | public static Expression logicalNot(final Expression baseExpr) {
baseExpr.checkAssignableTo(Type.BOOLEAN_TYPE);
checkArgument(baseExpr.resultType().equals(Type.BOOLEAN_TYPE), "not a boolean expression");
return new Expression(Type.BOOLEAN_TYPE, baseExpr.features()) {
@Override
protected void doG... | [
"public",
"static",
"Expression",
"logicalNot",
"(",
"final",
"Expression",
"baseExpr",
")",
"{",
"baseExpr",
".",
"checkAssignableTo",
"(",
"Type",
".",
"BOOLEAN_TYPE",
")",
";",
"checkArgument",
"(",
"baseExpr",
".",
"resultType",
"(",
")",
".",
"equals",
"(... | Returns an expression that evaluates to the logical negation of the given boolean valued
expression. | [
"Returns",
"an",
"expression",
"that",
"evaluates",
"to",
"the",
"logical",
"negation",
"of",
"the",
"given",
"boolean",
"valued",
"expression",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L553-L573 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqlsecond | public static void sqlsecond(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
second translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
singleArgumentFunctionCall(buf, "extract(second fro... | java | public static void sqlsecond(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "extract(second from ", "second", parsedArgs);
} | [
"public",
"static",
"void",
"sqlsecond",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"extract(second from \"",
",",
"\"second\"... | second translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"second",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L464-L466 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpHistory.java | HelpHistory.sameTopic | private boolean sameTopic(HelpTopic topic1, HelpTopic topic2) {
"""
Because the HelpTopic class does not implement its own equals method, have to implement
equality test here. Two topics are considered equal if the are the same instance or if their
targets are equal.
@param topic1 First topic to compare.
@pa... | java | private boolean sameTopic(HelpTopic topic1, HelpTopic topic2) {
return topic1 == topic2 || (topic1 != null && topic2 != null && topic1.equals(topic2));
} | [
"private",
"boolean",
"sameTopic",
"(",
"HelpTopic",
"topic1",
",",
"HelpTopic",
"topic2",
")",
"{",
"return",
"topic1",
"==",
"topic2",
"||",
"(",
"topic1",
"!=",
"null",
"&&",
"topic2",
"!=",
"null",
"&&",
"topic1",
".",
"equals",
"(",
"topic2",
")",
"... | Because the HelpTopic class does not implement its own equals method, have to implement
equality test here. Two topics are considered equal if the are the same instance or if their
targets are equal.
@param topic1 First topic to compare.
@param topic2 Second topic to compare.
@return True if topics are equal. | [
"Because",
"the",
"HelpTopic",
"class",
"does",
"not",
"implement",
"its",
"own",
"equals",
"method",
"have",
"to",
"implement",
"equality",
"test",
"here",
".",
"Two",
"topics",
"are",
"considered",
"equal",
"if",
"the",
"are",
"the",
"same",
"instance",
"o... | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpHistory.java#L116-L118 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.setFieldValues | @SuppressWarnings("unchecked")
public static void setFieldValues(Object object, String fieldName, String valuesString) {
"""
Set values to a field of array or collection type. If named field is not of supported types throws bug exception.
This method has <code>valuesString</code> parameter that is a list of co... | java | @SuppressWarnings("unchecked")
public static void setFieldValues(Object object, String fieldName, String valuesString)
{
Converter converter = ConverterRegistry.getConverter();
List<String> values = Strings.split(valuesString, ',');
Field field = getField(object.getClass(), fieldName);
Type ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"setFieldValues",
"(",
"Object",
"object",
",",
"String",
"fieldName",
",",
"String",
"valuesString",
")",
"{",
"Converter",
"converter",
"=",
"ConverterRegistry",
".",
"getConverter",
... | Set values to a field of array or collection type. If named field is not of supported types throws bug exception.
This method has <code>valuesString</code> parameter that is a list of comma separated value objects. Split values
string and converter every resulting item to field component type.
@param object instance t... | [
"Set",
"values",
"to",
"a",
"field",
"of",
"array",
"or",
"collection",
"type",
".",
"If",
"named",
"field",
"is",
"not",
"of",
"supported",
"types",
"throws",
"bug",
"exception",
".",
"This",
"method",
"has",
"<code",
">",
"valuesString<",
"/",
"code",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L908-L938 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.wrapMethodBodyInTryCatchDebugStatements | public static void wrapMethodBodyInTryCatchDebugStatements(MethodNode methodNode) {
"""
Wraps a method body in try / catch logic that catches any errors and logs an error, but does not rethrow!
@param methodNode The method node
"""
BlockStatement code = (BlockStatement) methodNode.getCode();
... | java | public static void wrapMethodBodyInTryCatchDebugStatements(MethodNode methodNode) {
BlockStatement code = (BlockStatement) methodNode.getCode();
BlockStatement newCode = new BlockStatement();
TryCatchStatement tryCatchStatement = new TryCatchStatement(code, new BlockStatement());
newCode... | [
"public",
"static",
"void",
"wrapMethodBodyInTryCatchDebugStatements",
"(",
"MethodNode",
"methodNode",
")",
"{",
"BlockStatement",
"code",
"=",
"(",
"BlockStatement",
")",
"methodNode",
".",
"getCode",
"(",
")",
";",
"BlockStatement",
"newCode",
"=",
"new",
"BlockS... | Wraps a method body in try / catch logic that catches any errors and logs an error, but does not rethrow!
@param methodNode The method node | [
"Wraps",
"a",
"method",
"body",
"in",
"try",
"/",
"catch",
"logic",
"that",
"catches",
"any",
"errors",
"and",
"logs",
"an",
"error",
"but",
"does",
"not",
"rethrow!"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1003-L1015 |
jaxio/celerio | celerio-engine/src/main/java/com/jaxio/celerio/factory/RelationCollisionUtil.java | RelationCollisionUtil.getManyToOneIntermediateNamer | public Namer getManyToOneIntermediateNamer(Namer fromEntityNamer, ColumnConfig pointsOnToEntity, Namer toEntityNamer) {
"""
Compute the appropriate namer for the Java field @ManyToOne (with intermediate table)
"""
// new configuration
Namer result = getManyToOneNamerFromConf(pointsOnToEntity, ... | java | public Namer getManyToOneIntermediateNamer(Namer fromEntityNamer, ColumnConfig pointsOnToEntity, Namer toEntityNamer) {
// new configuration
Namer result = getManyToOneNamerFromConf(pointsOnToEntity, toEntityNamer);
// fallback
if (result == null) {
// NOTE: we use the many... | [
"public",
"Namer",
"getManyToOneIntermediateNamer",
"(",
"Namer",
"fromEntityNamer",
",",
"ColumnConfig",
"pointsOnToEntity",
",",
"Namer",
"toEntityNamer",
")",
"{",
"// new configuration",
"Namer",
"result",
"=",
"getManyToOneNamerFromConf",
"(",
"pointsOnToEntity",
",",
... | Compute the appropriate namer for the Java field @ManyToOne (with intermediate table) | [
"Compute",
"the",
"appropriate",
"namer",
"for",
"the",
"Java",
"field"
] | train | https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/factory/RelationCollisionUtil.java#L105-L117 |
oehf/ipf-oht-atna | nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/utils/AliasSensitiveX509KeyManager.java | AliasSensitiveX509KeyManager.chooseClientAliasForKey | private String chooseClientAliasForKey(String preferredAlias, String keyType, Principal[] issuers, Socket socket) {
"""
Attempts to find a keystore
@param keyType
@param issuers
@param socket
@return
"""
String[] aliases = getClientAliases(keyType, issuers);
if (aliases != null && aliases.length > 0) ... | java | private String chooseClientAliasForKey(String preferredAlias, String keyType, Principal[] issuers, Socket socket)
{
String[] aliases = getClientAliases(keyType, issuers);
if (aliases != null && aliases.length > 0) {
for (int i=0; i<aliases.length;i++) {
if (preferredAlias.equals(aliases[i])) {
return ... | [
"private",
"String",
"chooseClientAliasForKey",
"(",
"String",
"preferredAlias",
",",
"String",
"keyType",
",",
"Principal",
"[",
"]",
"issuers",
",",
"Socket",
"socket",
")",
"{",
"String",
"[",
"]",
"aliases",
"=",
"getClientAliases",
"(",
"keyType",
",",
"i... | Attempts to find a keystore
@param keyType
@param issuers
@param socket
@return | [
"Attempts",
"to",
"find",
"a",
"keystore"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/utils/AliasSensitiveX509KeyManager.java#L142-L154 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/concurrent/lock/LockResourceImpl.java | LockResourceImpl.extendLeaseTime | boolean extendLeaseTime(String caller, long threadId, long leaseTime) {
"""
This method is used to extend the already locked resource in the prepare phase of the transactions.
It also marks the resource true to block reads.
@param caller
@param threadId
@param leaseTime
@return
"""
if (!isLocked... | java | boolean extendLeaseTime(String caller, long threadId, long leaseTime) {
if (!isLockedBy(caller, threadId)) {
return false;
}
this.blockReads = true;
if (expirationTime < Long.MAX_VALUE) {
setExpirationTime(expirationTime - Clock.currentTimeMillis() + leaseTime);
... | [
"boolean",
"extendLeaseTime",
"(",
"String",
"caller",
",",
"long",
"threadId",
",",
"long",
"leaseTime",
")",
"{",
"if",
"(",
"!",
"isLockedBy",
"(",
"caller",
",",
"threadId",
")",
")",
"{",
"return",
"false",
";",
"}",
"this",
".",
"blockReads",
"=",
... | This method is used to extend the already locked resource in the prepare phase of the transactions.
It also marks the resource true to block reads.
@param caller
@param threadId
@param leaseTime
@return | [
"This",
"method",
"is",
"used",
"to",
"extend",
"the",
"already",
"locked",
"resource",
"in",
"the",
"prepare",
"phase",
"of",
"the",
"transactions",
".",
"It",
"also",
"marks",
"the",
"resource",
"true",
"to",
"block",
"reads",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/concurrent/lock/LockResourceImpl.java#L122-L131 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/ReadSecondIfCheckHandler.java | ReadSecondIfCheckHandler.init | public void init(BaseField field, Record record, String keyAreaName, boolean bCloseOnFree, Converter convFlag) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param record The secondary record to read.
@param iQueryKeyArea The key area to read from.
@... | java | public void init(BaseField field, Record record, String keyAreaName, boolean bCloseOnFree, Converter convFlag)
{
m_convFlag = convFlag;
super.init(field, record, keyAreaName, bCloseOnFree, false, true);
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"Record",
"record",
",",
"String",
"keyAreaName",
",",
"boolean",
"bCloseOnFree",
",",
"Converter",
"convFlag",
")",
"{",
"m_convFlag",
"=",
"convFlag",
";",
"super",
".",
"init",
"(",
"field",
",",
... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param record The secondary record to read.
@param iQueryKeyArea The key area to read from.
@param bCloseOnFree Close the record when this behavior is removed?
@param convFlag The flag to check. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/ReadSecondIfCheckHandler.java#L60-L64 |
jboss/jboss-jstl-api_spec | src/main/java/javax/servlet/jsp/jstl/core/Config.java | Config.get | public static Object get(PageContext pc, String name, int scope) {
"""
Looks up a configuration variable in the given scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in a... | java | public static Object get(PageContext pc, String name, int scope) {
switch (scope) {
case PageContext.PAGE_SCOPE:
return pc.getAttribute(name + PAGE_SCOPE_SUFFIX, scope);
case PageContext.REQUEST_SCOPE:
return pc.getAttribute(name + REQUEST_SCOPE_SUFFIX, sc... | [
"public",
"static",
"Object",
"get",
"(",
"PageContext",
"pc",
",",
"String",
"name",
",",
"int",
"scope",
")",
"{",
"switch",
"(",
"scope",
")",
"{",
"case",
"PageContext",
".",
"PAGE_SCOPE",
":",
"return",
"pc",
".",
"getAttribute",
"(",
"name",
"+",
... | Looks up a configuration variable in the given scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in a different scope.
@param pc Page context in which the configuration variabl... | [
"Looks",
"up",
"a",
"configuration",
"variable",
"in",
"the",
"given",
"scope",
".",
"<p",
">",
"The",
"lookup",
"of",
"configuration",
"variables",
"is",
"performed",
"as",
"if",
"each",
"scope",
"had",
"its",
"own",
"name",
"space",
"that",
"is",
"the",
... | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/javax/servlet/jsp/jstl/core/Config.java#L98-L111 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Request.java | Request.addParameter | public void addParameter(String name, RPCParameter parameter) {
"""
Adds an RPC parameter to the request.
@param name Parameter name.
@param parameter RPC parameter.
"""
for (String subscript : parameter) {
addParameter(name, subscript, parameter.get(subscript));
}
} | java | public void addParameter(String name, RPCParameter parameter) {
for (String subscript : parameter) {
addParameter(name, subscript, parameter.get(subscript));
}
} | [
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"RPCParameter",
"parameter",
")",
"{",
"for",
"(",
"String",
"subscript",
":",
"parameter",
")",
"{",
"addParameter",
"(",
"name",
",",
"subscript",
",",
"parameter",
".",
"get",
"(",
"subscript",... | Adds an RPC parameter to the request.
@param name Parameter name.
@param parameter RPC parameter. | [
"Adds",
"an",
"RPC",
"parameter",
"to",
"the",
"request",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/Request.java#L166-L170 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java | RemotePDPProvider.getDomain | @Override
public Structure getDomain(String pdpDomainName, AtomCache cache) throws IOException, StructureException {
"""
Get the structure for a particular PDP domain
@param pdpDomainName PDP identifier, e.g. "PDP:4HHBAa"
@param cache AtomCache, responsible for fetching and storing the coordinates
@return Stru... | java | @Override
public Structure getDomain(String pdpDomainName, AtomCache cache) throws IOException, StructureException {
return cache.getStructure(getPDPDomain(pdpDomainName));
} | [
"@",
"Override",
"public",
"Structure",
"getDomain",
"(",
"String",
"pdpDomainName",
",",
"AtomCache",
"cache",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"return",
"cache",
".",
"getStructure",
"(",
"getPDPDomain",
"(",
"pdpDomainName",
")",
")... | Get the structure for a particular PDP domain
@param pdpDomainName PDP identifier, e.g. "PDP:4HHBAa"
@param cache AtomCache, responsible for fetching and storing the coordinates
@return Structure representing the PDP domain
@throws IOException if the server cannot be reached
@throws StructureException For errors parsin... | [
"Get",
"the",
"structure",
"for",
"a",
"particular",
"PDP",
"domain"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java#L162-L165 |
alibaba/jstorm | example/sequence-split-merge/src/main/java/org/apache/storm/starter/trident/TridentMinMaxOfVehiclesTopology.java | TridentMinMaxOfVehiclesTopology.buildVehiclesTopology | public static StormTopology buildVehiclesTopology() {
"""
Creates a topology which demonstrates min/max operations on tuples of
stream which contain vehicle and driver fields with values
{@link TridentMinMaxOfVehiclesTopology.Vehicle} and
{@link TridentMinMaxOfVehiclesTopology.Driver} respectively.
"""
... | java | public static StormTopology buildVehiclesTopology() {
Fields driverField = new Fields(Driver.FIELD_NAME);
Fields vehicleField = new Fields(Vehicle.FIELD_NAME);
Fields allFields = new Fields(Vehicle.FIELD_NAME, Driver.FIELD_NAME);
FixedBatchSpout spout = new FixedBatchSpout(allFi... | [
"public",
"static",
"StormTopology",
"buildVehiclesTopology",
"(",
")",
"{",
"Fields",
"driverField",
"=",
"new",
"Fields",
"(",
"Driver",
".",
"FIELD_NAME",
")",
";",
"Fields",
"vehicleField",
"=",
"new",
"Fields",
"(",
"Vehicle",
".",
"FIELD_NAME",
")",
";",... | Creates a topology which demonstrates min/max operations on tuples of
stream which contain vehicle and driver fields with values
{@link TridentMinMaxOfVehiclesTopology.Vehicle} and
{@link TridentMinMaxOfVehiclesTopology.Driver} respectively. | [
"Creates",
"a",
"topology",
"which",
"demonstrates",
"min",
"/",
"max",
"operations",
"on",
"tuples",
"of",
"stream",
"which",
"contain",
"vehicle",
"and",
"driver",
"fields",
"with",
"values",
"{"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/example/sequence-split-merge/src/main/java/org/apache/storm/starter/trident/TridentMinMaxOfVehiclesTopology.java#L57-L84 |
Netflix/karyon | karyon2-governator/src/main/java/netflix/karyon/Karyon.java | Karyon.forTcpConnectionHandler | public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler,
BootstrapModule... bootstrapModules) {
"""
Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection
handli... | java | public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler,
BootstrapModule... bootstrapModules) {
RxServer<ByteBuf, ByteBuf> server = RxNetty.newTcpServerBuilder(port, handler).build();
return new RxNet... | [
"public",
"static",
"KaryonServer",
"forTcpConnectionHandler",
"(",
"int",
"port",
",",
"ConnectionHandler",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"handler",
",",
"BootstrapModule",
"...",
"bootstrapModules",
")",
"{",
"RxServer",
"<",
"ByteBuf",
",",
"ByteBuf",
">... | Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection
handling to {@link ConnectionHandler}.
The {@link RxServer} is created using {@link RxNetty#newTcpServerBuilder(int, ConnectionHandler)}
@param port Port for the server.
@param handler Connection Handler
@param boot... | [
"Creates",
"a",
"new",
"{",
"@link",
"KaryonServer",
"}",
"that",
"has",
"a",
"single",
"TCP",
"server",
"instance",
"which",
"delegates",
"all",
"connection",
"handling",
"to",
"{",
"@link",
"ConnectionHandler",
"}",
".",
"The",
"{",
"@link",
"RxServer",
"}... | train | https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L103-L107 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsUserTable.java | CmsUserTable.getStatus | String getStatus(CmsUser user, boolean disabled, boolean newUser) {
"""
Returns status message.
@param user CmsUser
@param disabled boolean
@param newUser boolean
@return String
"""
if (disabled) {
return CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_DISABLED_0);
... | java | String getStatus(CmsUser user, boolean disabled, boolean newUser) {
if (disabled) {
return CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_DISABLED_0);
}
if (newUser) {
return CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_INACTIVE_0);
... | [
"String",
"getStatus",
"(",
"CmsUser",
"user",
",",
"boolean",
"disabled",
",",
"boolean",
"newUser",
")",
"{",
"if",
"(",
"disabled",
")",
"{",
"return",
"CmsVaadinUtils",
".",
"getMessageText",
"(",
"Messages",
".",
"GUI_USERMANAGEMENT_USER_DISABLED_0",
")",
"... | Returns status message.
@param user CmsUser
@param disabled boolean
@param newUser boolean
@return String | [
"Returns",
"status",
"message",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsUserTable.java#L1351-L1366 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java | ByteArrayDiskQueue.createFromFile | public static ByteArrayDiskQueue createFromFile(final long size, final File file, final int bufferSize, final boolean direct) throws IOException {
"""
Creates a new disk-based queue of byte arrays using an existing file.
<p>Note that you have to supply the correct number of byte arrays contained in the dump fil... | java | public static ByteArrayDiskQueue createFromFile(final long size, final File file, final int bufferSize, final boolean direct) throws IOException {
final ByteArrayDiskQueue byteArrayDiskQueue = new ByteArrayDiskQueue(ByteDiskQueue.createFromFile(file, bufferSize, direct));
byteArrayDiskQueue.size = size;
return by... | [
"public",
"static",
"ByteArrayDiskQueue",
"createFromFile",
"(",
"final",
"long",
"size",
",",
"final",
"File",
"file",
",",
"final",
"int",
"bufferSize",
",",
"final",
"boolean",
"direct",
")",
"throws",
"IOException",
"{",
"final",
"ByteArrayDiskQueue",
"byteArr... | Creates a new disk-based queue of byte arrays using an existing file.
<p>Note that you have to supply the correct number of byte arrays contained in the dump file of
the underlying {@link ByteDiskQueue}. Failure to do so will cause unpredictable behaviour.
@param size the number of byte arrays contained in {@code fil... | [
"Creates",
"a",
"new",
"disk",
"-",
"based",
"queue",
"of",
"byte",
"arrays",
"using",
"an",
"existing",
"file",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java#L81-L85 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/paytrail/PaytrailServiceFactory.java | PaytrailServiceFactory.createPaytrailService | public static PaytrailService createPaytrailService() {
"""
Creates a paytrail service instance
@return created paytrail service instance
"""
IOHandler ioHandler = new HttpClientIOHandler();
Marshaller marshaller = new JacksonMarshaller();
String merchantId = SystemUtils.getSettingValue("paytrail.me... | java | public static PaytrailService createPaytrailService() {
IOHandler ioHandler = new HttpClientIOHandler();
Marshaller marshaller = new JacksonMarshaller();
String merchantId = SystemUtils.getSettingValue("paytrail.merchantId");
String merchantSecret = SystemUtils.getSettingValue("paytrail.merchantSecret");
... | [
"public",
"static",
"PaytrailService",
"createPaytrailService",
"(",
")",
"{",
"IOHandler",
"ioHandler",
"=",
"new",
"HttpClientIOHandler",
"(",
")",
";",
"Marshaller",
"marshaller",
"=",
"new",
"JacksonMarshaller",
"(",
")",
";",
"String",
"merchantId",
"=",
"Sys... | Creates a paytrail service instance
@return created paytrail service instance | [
"Creates",
"a",
"paytrail",
"service",
"instance"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/paytrail/PaytrailServiceFactory.java#L18-L24 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/PHPSimilarText.java | PHPSimilarText.similarityChars | public static int similarityChars(String txt1, String txt2) {
"""
Checks the similarity of two strings and returns the number of matching
chars in both strings.
@param txt1
@param txt2
@return
"""
int sim = similar_char(txt1, txt1.length(), txt2, txt2.length());
return sim;
} | java | public static int similarityChars(String txt1, String txt2) {
int sim = similar_char(txt1, txt1.length(), txt2, txt2.length());
return sim;
} | [
"public",
"static",
"int",
"similarityChars",
"(",
"String",
"txt1",
",",
"String",
"txt2",
")",
"{",
"int",
"sim",
"=",
"similar_char",
"(",
"txt1",
",",
"txt1",
".",
"length",
"(",
")",
",",
"txt2",
",",
"txt2",
".",
"length",
"(",
")",
")",
";",
... | Checks the similarity of two strings and returns the number of matching
chars in both strings.
@param txt1
@param txt2
@return | [
"Checks",
"the",
"similarity",
"of",
"two",
"strings",
"and",
"returns",
"the",
"number",
"of",
"matching",
"chars",
"in",
"both",
"strings",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/PHPSimilarText.java#L67-L70 |
wildfly-extras/wildfly-camel | config/src/main/java/org/wildfly/extras/config/internal/IllegalArgumentAssertion.java | IllegalArgumentAssertion.assertTrue | public static Boolean assertTrue(Boolean value, String message) {
"""
Throws an IllegalArgumentException when the given value is not true.
@param value the value to assert if true
@param message the message to display if the value is false
@return the value
"""
if (!Boolean.valueOf(value))
... | java | public static Boolean assertTrue(Boolean value, String message) {
if (!Boolean.valueOf(value))
throw new IllegalArgumentException(message);
return value;
} | [
"public",
"static",
"Boolean",
"assertTrue",
"(",
"Boolean",
"value",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
")",
";",
"return",
"va... | Throws an IllegalArgumentException when the given value is not true.
@param value the value to assert if true
@param message the message to display if the value is false
@return the value | [
"Throws",
"an",
"IllegalArgumentException",
"when",
"the",
"given",
"value",
"is",
"not",
"true",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/config/src/main/java/org/wildfly/extras/config/internal/IllegalArgumentAssertion.java#L54-L58 |
mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java | AndroidUtil.createTileCache | public static TileCache createTileCache(Context c, String id, int tileSize, float screenRatio, double overdraw) {
"""
Utility function to create a two-level tile cache with the right size. When the cache is created we do not
actually know the size of the mapview, so the screenRatio is an approximation of the requ... | java | public static TileCache createTileCache(Context c, String id, int tileSize, float screenRatio, double overdraw) {
return createTileCache(c, id, tileSize, screenRatio, overdraw, false);
} | [
"public",
"static",
"TileCache",
"createTileCache",
"(",
"Context",
"c",
",",
"String",
"id",
",",
"int",
"tileSize",
",",
"float",
"screenRatio",
",",
"double",
"overdraw",
")",
"{",
"return",
"createTileCache",
"(",
"c",
",",
"id",
",",
"tileSize",
",",
... | Utility function to create a two-level tile cache with the right size. When the cache is created we do not
actually know the size of the mapview, so the screenRatio is an approximation of the required size. This is the
compatibility version that by default creates a non-persistent cache.
@param c the Android... | [
"Utility",
"function",
"to",
"create",
"a",
"two",
"-",
"level",
"tile",
"cache",
"with",
"the",
"right",
"size",
".",
"When",
"the",
"cache",
"is",
"created",
"we",
"do",
"not",
"actually",
"know",
"the",
"size",
"of",
"the",
"mapview",
"so",
"the",
"... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java#L170-L172 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.addEquals | public static void addEquals( DMatrix3 a , DMatrix3 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 +... | java | public static void addEquals( DMatrix3 a , DMatrix3 b ) {
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 += b.a3;
} | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix3",
"a",
",",
"DMatrix3",
"b",
")",
"{",
"a",
".",
"a1",
"+=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"+=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"+=",
"b",
".",
"a3",
";",
"}"
] | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L112-L116 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.codePointBefore | public static final int codePointBefore(CharSequence seq, int index) {
"""
Same as {@link Character#codePointBefore(CharSequence, int)}.
Return the code point before index.
This examines only the characters at index-1 and index-2.
@param seq the characters to check
@param index the index after the last or on... | java | public static final int codePointBefore(CharSequence seq, int index) {
char c2 = seq.charAt(--index);
if (isLowSurrogate(c2)) {
if (index > 0) {
char c1 = seq.charAt(--index);
if (isHighSurrogate(c1)) {
return toCodePoint(c1, c2);
... | [
"public",
"static",
"final",
"int",
"codePointBefore",
"(",
"CharSequence",
"seq",
",",
"int",
"index",
")",
"{",
"char",
"c2",
"=",
"seq",
".",
"charAt",
"(",
"--",
"index",
")",
";",
"if",
"(",
"isLowSurrogate",
"(",
"c2",
")",
")",
"{",
"if",
"(",... | Same as {@link Character#codePointBefore(CharSequence, int)}.
Return the code point before index.
This examines only the characters at index-1 and index-2.
@param seq the characters to check
@param index the index after the last or only char forming the code point
@return the code point before the index | [
"Same",
"as",
"{",
"@link",
"Character#codePointBefore",
"(",
"CharSequence",
"int",
")",
"}",
".",
"Return",
"the",
"code",
"point",
"before",
"index",
".",
"This",
"examines",
"only",
"the",
"characters",
"at",
"index",
"-",
"1",
"and",
"index",
"-",
"2"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5392-L5403 |
atomix/atomix | primitive/src/main/java/io/atomix/primitive/proxy/impl/LogProxySession.java | LogProxySession.getOrCreateSession | private Session getOrCreateSession(SessionId sessionId) {
"""
Gets or creates a session.
@param sessionId the session identifier
@return the session
"""
Session session = sessions.get(sessionId);
if (session == null) {
session = new LocalSession(sessionId, name(), type(), null, service.serial... | java | private Session getOrCreateSession(SessionId sessionId) {
Session session = sessions.get(sessionId);
if (session == null) {
session = new LocalSession(sessionId, name(), type(), null, service.serializer());
sessions.put(session.sessionId(), session);
service.register(session);
}
return... | [
"private",
"Session",
"getOrCreateSession",
"(",
"SessionId",
"sessionId",
")",
"{",
"Session",
"session",
"=",
"sessions",
".",
"get",
"(",
"sessionId",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"session",
"=",
"new",
"LocalSession",
"(",
"s... | Gets or creates a session.
@param sessionId the session identifier
@return the session | [
"Gets",
"or",
"creates",
"a",
"session",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/primitive/src/main/java/io/atomix/primitive/proxy/impl/LogProxySession.java#L170-L178 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java | Form.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
Base support for the attribute tag. This is overridden to prevent setting the <code>action</code>,
and <code>method</code> attributes.
@param name The name of the attribute. This value may not be null or th... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(ACTION) || name.equals(METHOD)) {
String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name});
registerTagError... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"ACTION",
")",
"||",
"name",
... | Base support for the attribute tag. This is overridden to prevent setting the <code>action</code>,
and <code>method</code> attributes.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param facet The name... | [
"Base",
"support",
"for",
"the",
"attribute",
"tag",
".",
"This",
"is",
"overridden",
"to",
"prevent",
"setting",
"the",
"<code",
">",
"action<",
"/",
"code",
">",
"and",
"<code",
">",
"method<",
"/",
"code",
">",
"attributes",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L270-L280 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/xml/XMLFactory.java | XMLFactory.createXMLWriter | public XMLWriter createXMLWriter(String systemID) throws KNXMLException {
"""
Creates a {@link XMLWriter} to write into the XML resource located by the specified
identifier.
<p>
@param systemID location identifier of the XML resource
@return XML writer
@throws KNXMLException if creation of the writer failed... | java | public XMLWriter createXMLWriter(String systemID) throws KNXMLException
{
final XMLWriter w = (XMLWriter) create(DEFAULT_WRITER);
final EntityResolver res = (EntityResolver) create(DEFAULT_RESOLVER);
final OutputStream os = res.resolveOutput(systemID);
try {
w.setOutput(new OutputStreamWriter(os, "UTF... | [
"public",
"XMLWriter",
"createXMLWriter",
"(",
"String",
"systemID",
")",
"throws",
"KNXMLException",
"{",
"final",
"XMLWriter",
"w",
"=",
"(",
"XMLWriter",
")",
"create",
"(",
"DEFAULT_WRITER",
")",
";",
"final",
"EntityResolver",
"res",
"=",
"(",
"EntityResolv... | Creates a {@link XMLWriter} to write into the XML resource located by the specified
identifier.
<p>
@param systemID location identifier of the XML resource
@return XML writer
@throws KNXMLException if creation of the writer failed or XML resource can't be
resolved | [
"Creates",
"a",
"{",
"@link",
"XMLWriter",
"}",
"to",
"write",
"into",
"the",
"XML",
"resource",
"located",
"by",
"the",
"specified",
"identifier",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/xml/XMLFactory.java#L145-L161 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java | DocTreePath.getPath | public static DocTreePath getPath(DocTreePath path, DocTree target) {
"""
Returns a documentation tree path for a tree node within a subtree
identified by a DocTreePath object, or {@code null} if the node is not found.
@param path a path identifying a node within a doc comment tree
@param target a node to be lo... | java | public static DocTreePath getPath(DocTreePath path, DocTree target) {
Objects.requireNonNull(path); //null check
Objects.requireNonNull(target); //null check
class Result extends Error {
static final long serialVersionUID = -5942088234594905625L;
DocTreePath path;
... | [
"public",
"static",
"DocTreePath",
"getPath",
"(",
"DocTreePath",
"path",
",",
"DocTree",
"target",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"path",
")",
";",
"//null check",
"Objects",
".",
"requireNonNull",
"(",
"target",
")",
";",
"//null check",
"c... | Returns a documentation tree path for a tree node within a subtree
identified by a DocTreePath object, or {@code null} if the node is not found.
@param path a path identifying a node within a doc comment tree
@param target a node to be located within the given node
@return a path identifying the target node | [
"Returns",
"a",
"documentation",
"tree",
"path",
"for",
"a",
"tree",
"node",
"within",
"a",
"subtree",
"identified",
"by",
"a",
"DocTreePath",
"object",
"or",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java#L60-L92 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/DocumentInputStreamFactory.java | DocumentInputStreamFactory.getInstance | public InputStream getInstance(DirectoryEntry directory, String name) throws IOException {
"""
Method used to instantiate the appropriate input stream reader,
a standard one, or one which can deal with "encrypted" data.
@param directory directory entry
@param name file name
@return new input stream
@throws ... | java | public InputStream getInstance(DirectoryEntry directory, String name) throws IOException
{
DocumentEntry entry = (DocumentEntry) directory.getEntry(name);
InputStream stream;
if (m_encrypted)
{
stream = new EncryptedDocumentInputStream(entry, m_encryptionCode);
}
else
... | [
"public",
"InputStream",
"getInstance",
"(",
"DirectoryEntry",
"directory",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"DocumentEntry",
"entry",
"=",
"(",
"DocumentEntry",
")",
"directory",
".",
"getEntry",
"(",
"name",
")",
";",
"InputStream",
"s... | Method used to instantiate the appropriate input stream reader,
a standard one, or one which can deal with "encrypted" data.
@param directory directory entry
@param name file name
@return new input stream
@throws IOException | [
"Method",
"used",
"to",
"instantiate",
"the",
"appropriate",
"input",
"stream",
"reader",
"a",
"standard",
"one",
"or",
"one",
"which",
"can",
"deal",
"with",
"encrypted",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/DocumentInputStreamFactory.java#L59-L73 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.renderPixel | public static Point3D_F64 renderPixel( DMatrixRMaj cameraMatrix , Point4D_F64 X , @Nullable Point3D_F64 x) {
"""
Render a pixel in homogeneous coordinates from a 3x4 camera matrix and a 3D homogeneous point.
@param cameraMatrix (Input) 3x4 camera matrix
@param X (Input) 3D point in homogeneous coordinates
@para... | java | public static Point3D_F64 renderPixel( DMatrixRMaj cameraMatrix , Point4D_F64 X , @Nullable Point3D_F64 x) {
if( x == null )
x = new Point3D_F64();
ImplPerspectiveOps_F64.renderPixel(cameraMatrix, X, x);
return x;
} | [
"public",
"static",
"Point3D_F64",
"renderPixel",
"(",
"DMatrixRMaj",
"cameraMatrix",
",",
"Point4D_F64",
"X",
",",
"@",
"Nullable",
"Point3D_F64",
"x",
")",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"x",
"=",
"new",
"Point3D_F64",
"(",
")",
";",
"ImplPerspe... | Render a pixel in homogeneous coordinates from a 3x4 camera matrix and a 3D homogeneous point.
@param cameraMatrix (Input) 3x4 camera matrix
@param X (Input) 3D point in homogeneous coordinates
@param x (Output) Rendered 2D point in homogeneous coordinates
@return Rendered 2D point in homogeneous coordinates | [
"Render",
"a",
"pixel",
"in",
"homogeneous",
"coordinates",
"from",
"a",
"3x4",
"camera",
"matrix",
"and",
"a",
"3D",
"homogeneous",
"point",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L575-L580 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/cost/PlanNodeStatsEstimate.java | PlanNodeStatsEstimate.getOutputSizeInBytes | public double getOutputSizeInBytes(Collection<Symbol> outputSymbols, TypeProvider types) {
"""
Returns estimated data size.
Unknown value is represented by {@link Double#NaN}
"""
requireNonNull(outputSymbols, "outputSymbols is null");
return outputSymbols.stream()
.mapToDouble... | java | public double getOutputSizeInBytes(Collection<Symbol> outputSymbols, TypeProvider types)
{
requireNonNull(outputSymbols, "outputSymbols is null");
return outputSymbols.stream()
.mapToDouble(symbol -> getOutputSizeForSymbol(getSymbolStatistics(symbol), types.get(symbol)))
... | [
"public",
"double",
"getOutputSizeInBytes",
"(",
"Collection",
"<",
"Symbol",
">",
"outputSymbols",
",",
"TypeProvider",
"types",
")",
"{",
"requireNonNull",
"(",
"outputSymbols",
",",
"\"outputSymbols is null\"",
")",
";",
"return",
"outputSymbols",
".",
"stream",
... | Returns estimated data size.
Unknown value is represented by {@link Double#NaN} | [
"Returns",
"estimated",
"data",
"size",
".",
"Unknown",
"value",
"is",
"represented",
"by",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/cost/PlanNodeStatsEstimate.java#L82-L89 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManagementClientImpl.java | NetworkManagementClientImpl.supportedSecurityProvidersAsync | public Observable<VirtualWanSecurityProvidersInner> supportedSecurityProvidersAsync(String resourceGroupName, String virtualWANName) {
"""
Gives the supported security providers for the virtual wan.
@param resourceGroupName The resource group name.
@param virtualWANName The name of the VirtualWAN for which sup... | java | public Observable<VirtualWanSecurityProvidersInner> supportedSecurityProvidersAsync(String resourceGroupName, String virtualWANName) {
return supportedSecurityProvidersWithServiceResponseAsync(resourceGroupName, virtualWANName).map(new Func1<ServiceResponse<VirtualWanSecurityProvidersInner>, VirtualWanSecurityP... | [
"public",
"Observable",
"<",
"VirtualWanSecurityProvidersInner",
">",
"supportedSecurityProvidersAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualWANName",
")",
"{",
"return",
"supportedSecurityProvidersWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gives the supported security providers for the virtual wan.
@param resourceGroupName The resource group name.
@param virtualWANName The name of the VirtualWAN for which supported security providers are needed.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Virtu... | [
"Gives",
"the",
"supported",
"security",
"providers",
"for",
"the",
"virtual",
"wan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkManagementClientImpl.java#L1265-L1272 |
apache/incubator-shardingsphere | sharding-core/sharding-core-merge/src/main/java/org/apache/shardingsphere/core/merge/dql/orderby/CompareUtil.java | CompareUtil.compareTo | @SuppressWarnings( {
"""
Compare two object with order type.
@param thisValue this value
@param otherValue other value
@param orderDirection order direction
@param nullOrderDirection order direction for null value
@return compare result
""" "rawtypes", "unchecked" })
public static int compareTo(fina... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static int compareTo(final Comparable thisValue, final Comparable otherValue, final OrderDirection orderDirection, final OrderDirection nullOrderDirection) {
if (null == thisValue && null == otherValue) {
return 0;
}
if (null ... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"int",
"compareTo",
"(",
"final",
"Comparable",
"thisValue",
",",
"final",
"Comparable",
"otherValue",
",",
"final",
"OrderDirection",
"orderDirection",
",",
"fi... | Compare two object with order type.
@param thisValue this value
@param otherValue other value
@param orderDirection order direction
@param nullOrderDirection order direction for null value
@return compare result | [
"Compare",
"two",
"object",
"with",
"order",
"type",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-merge/src/main/java/org/apache/shardingsphere/core/merge/dql/orderby/CompareUtil.java#L41-L53 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.groupByField | public static <T> List<List<T>> groupByField(Collection<T> collection, final String fieldName) {
"""
根据元素的指定字段名分组,非Bean都放在第一个分组中
@param <T> 元素类型
@param collection 集合
@param fieldName 元素Bean中的字段名,非Bean都放在第一个分组中
@return 分组列表
"""
return group(collection, new Hash<T>() {
private List<Object> fieldName... | java | public static <T> List<List<T>> groupByField(Collection<T> collection, final String fieldName) {
return group(collection, new Hash<T>() {
private List<Object> fieldNameList = new ArrayList<>();
@Override
public int hash(T t) {
if (null == t || false == BeanUtil.isBean(t.getClass())) {
// 非Be... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"List",
"<",
"T",
">",
">",
"groupByField",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"final",
"String",
"fieldName",
")",
"{",
"return",
"group",
"(",
"collection",
",",
"new",
"Hash",
"<",
... | 根据元素的指定字段名分组,非Bean都放在第一个分组中
@param <T> 元素类型
@param collection 集合
@param fieldName 元素Bean中的字段名,非Bean都放在第一个分组中
@return 分组列表 | [
"根据元素的指定字段名分组,非Bean都放在第一个分组中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2330-L2350 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.setRotation | public void setRotation(float w, float x, float y, float z) {
"""
Set rotation, as a quaternion.
Sets the widget's current rotation in quaternion terms. Overrides any
previous rotations using {@link #rotate(float, float, float, float)
rotate()}, {@link #rotateByAxis(float, float, float, float)
rotateByAxis()... | java | public void setRotation(float w, float x, float y, float z) {
getTransform().setRotation(w, x, y, z);
if (mTransformCache.setRotation(w, x, y, z)) {
onTransformChanged();
}
} | [
"public",
"void",
"setRotation",
"(",
"float",
"w",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"getTransform",
"(",
")",
".",
"setRotation",
"(",
"w",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"mTransformCache",
"... | Set rotation, as a quaternion.
Sets the widget's current rotation in quaternion terms. Overrides any
previous rotations using {@link #rotate(float, float, float, float)
rotate()}, {@link #rotateByAxis(float, float, float, float)
rotateByAxis()} , or
{@link #rotateByAxisWithPivot(float, float, float, float, float, floa... | [
"Set",
"rotation",
"as",
"a",
"quaternion",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L1393-L1398 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java | UnionPathIterator.setRoot | public void setRoot(int context, Object environment) {
"""
Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation.
"""
super.setRoot(context, environment);
try
{
if (null != m_exprs)
{
int n = ... | java | public void setRoot(int context, Object environment)
{
super.setRoot(context, environment);
try
{
if (null != m_exprs)
{
int n = m_exprs.length;
DTMIterator newIters[] = new DTMIterator[n];
for (int i = 0; i < n; i++)
{
DTMIterator iter = m_exprs[i... | [
"public",
"void",
"setRoot",
"(",
"int",
"context",
",",
"Object",
"environment",
")",
"{",
"super",
".",
"setRoot",
"(",
"context",
",",
"environment",
")",
";",
"try",
"{",
"if",
"(",
"null",
"!=",
"m_exprs",
")",
"{",
"int",
"n",
"=",
"m_exprs",
"... | Initialize the context values for this expression
after it is cloned.
@param context The XPath runtime context for this
transformation. | [
"Initialize",
"the",
"context",
"values",
"for",
"this",
"expression",
"after",
"it",
"is",
"cloned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java#L67-L91 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.candidateMethods | public static Method[] candidateMethods(Class<?> clazz, String name, Object[] args) {
"""
Finds the best equally-matching methods for the given arguments.
@param clazz
@param name
@param args
@return methods
"""
return candidateMethods(collectMethods(clazz, name), args);
} | java | public static Method[] candidateMethods(Class<?> clazz, String name, Object[] args) {
return candidateMethods(collectMethods(clazz, name), args);
} | [
"public",
"static",
"Method",
"[",
"]",
"candidateMethods",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"return",
"candidateMethods",
"(",
"collectMethods",
"(",
"clazz",
",",
"name",
")",
",",
... | Finds the best equally-matching methods for the given arguments.
@param clazz
@param name
@param args
@return methods | [
"Finds",
"the",
"best",
"equally",
"-",
"matching",
"methods",
"for",
"the",
"given",
"arguments",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L176-L178 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java | EasyRandomParameters.stringLengthRange | public EasyRandomParameters stringLengthRange(final int minStringLength, final int maxStringLength) {
"""
Set the string length range.
@param minStringLength the minimum string length
@param maxStringLength the maximum string length
@return the current {@link EasyRandomParameters} instance for method chaining... | java | public EasyRandomParameters stringLengthRange(final int minStringLength, final int maxStringLength) {
if (minStringLength < 0) {
throw new IllegalArgumentException("minStringLength must be >= 0");
}
if (minStringLength > maxStringLength) {
throw new IllegalArgumentExcepti... | [
"public",
"EasyRandomParameters",
"stringLengthRange",
"(",
"final",
"int",
"minStringLength",
",",
"final",
"int",
"maxStringLength",
")",
"{",
"if",
"(",
"minStringLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"minStringLength must ... | Set the string length range.
@param minStringLength the minimum string length
@param maxStringLength the maximum string length
@return the current {@link EasyRandomParameters} instance for method chaining | [
"Set",
"the",
"string",
"length",
"range",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java#L402-L412 |
pac4j/pac4j | pac4j-saml/src/main/java/org/pac4j/saml/profile/impl/AbstractSAML2ResponseValidator.java | AbstractSAML2ResponseValidator.decryptEncryptedId | protected final NameID decryptEncryptedId(final EncryptedID encryptedId, final Decrypter decrypter) throws SAMLException {
"""
Decrypts an EncryptedID, using a decrypter.
@param encryptedId The EncryptedID to be decrypted.
@param decrypter The decrypter to use.
@return Decrypted ID or {@code null} if any in... | java | protected final NameID decryptEncryptedId(final EncryptedID encryptedId, final Decrypter decrypter) throws SAMLException {
if (encryptedId == null) {
return null;
}
if (decrypter == null) {
logger.warn("Encrypted attributes returned, but no keystore was provided.");
... | [
"protected",
"final",
"NameID",
"decryptEncryptedId",
"(",
"final",
"EncryptedID",
"encryptedId",
",",
"final",
"Decrypter",
"decrypter",
")",
"throws",
"SAMLException",
"{",
"if",
"(",
"encryptedId",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"... | Decrypts an EncryptedID, using a decrypter.
@param encryptedId The EncryptedID to be decrypted.
@param decrypter The decrypter to use.
@return Decrypted ID or {@code null} if any input is {@code null}.
@throws SAMLException If the input ID cannot be decrypted. | [
"Decrypts",
"an",
"EncryptedID",
"using",
"a",
"decrypter",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/profile/impl/AbstractSAML2ResponseValidator.java#L195-L210 |
l0rdn1kk0n/wicket-jquery-selectors | src/main/java/de/agilecoders/wicket/jquery/util/Json.java | Json.fromJson | public static <T> T fromJson(final String json, final Class<T> clazz) {
"""
Convert a JsonNode to a Java value
@param json Json value to convert.
@param clazz Expected Java value type.
@param <T> type of return object
@return casted value of given json object
"""
return fromJson(parse(json), c... | java | public static <T> T fromJson(final String json, final Class<T> clazz) {
return fromJson(parse(json), clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJson",
"(",
"final",
"String",
"json",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"fromJson",
"(",
"parse",
"(",
"json",
")",
",",
"clazz",
")",
";",
"}"
] | Convert a JsonNode to a Java value
@param json Json value to convert.
@param clazz Expected Java value type.
@param <T> type of return object
@return casted value of given json object | [
"Convert",
"a",
"JsonNode",
"to",
"a",
"Java",
"value"
] | train | https://github.com/l0rdn1kk0n/wicket-jquery-selectors/blob/a606263f7821d0b5f337c9e65f8caa466ad398ad/src/main/java/de/agilecoders/wicket/jquery/util/Json.java#L104-L106 |
janus-project/guava.janusproject.io | guava/src/com/google/common/hash/HashCode.java | HashCode.writeBytesTo | public int writeBytesTo(byte[] dest, int offset, int maxLength) {
"""
Copies bytes from this hash code into {@code dest}.
@param dest the byte array into which the hash code will be written
@param offset the start offset in the data
@param maxLength the maximum number of bytes to write
@return the number of ... | java | public int writeBytesTo(byte[] dest, int offset, int maxLength) {
maxLength = Ints.min(maxLength, bits() / 8);
Preconditions.checkPositionIndexes(offset, offset + maxLength, dest.length);
writeBytesToImpl(dest, offset, maxLength);
return maxLength;
} | [
"public",
"int",
"writeBytesTo",
"(",
"byte",
"[",
"]",
"dest",
",",
"int",
"offset",
",",
"int",
"maxLength",
")",
"{",
"maxLength",
"=",
"Ints",
".",
"min",
"(",
"maxLength",
",",
"bits",
"(",
")",
"/",
"8",
")",
";",
"Preconditions",
".",
"checkPo... | Copies bytes from this hash code into {@code dest}.
@param dest the byte array into which the hash code will be written
@param offset the start offset in the data
@param maxLength the maximum number of bytes to write
@return the number of bytes written to {@code dest}
@throws IndexOutOfBoundsException if there is not ... | [
"Copies",
"bytes",
"from",
"this",
"hash",
"code",
"into",
"{",
"@code",
"dest",
"}",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/hash/HashCode.java#L89-L94 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getNotEmpty | @Nullable
public static String getNotEmpty (@Nullable final String s, @Nullable final String sDefaultIfEmpty) {
"""
Get the passed string but never return an empty string. If the passed
parameter is <code>null</code> or empty the second parameter is returned.
@param s
The parameter to be not <code>null</cod... | java | @Nullable
public static String getNotEmpty (@Nullable final String s, @Nullable final String sDefaultIfEmpty)
{
return hasNoText (s) ? sDefaultIfEmpty : s;
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getNotEmpty",
"(",
"@",
"Nullable",
"final",
"String",
"s",
",",
"@",
"Nullable",
"final",
"String",
"sDefaultIfEmpty",
")",
"{",
"return",
"hasNoText",
"(",
"s",
")",
"?",
"sDefaultIfEmpty",
":",
"s",
";",
"... | Get the passed string but never return an empty string. If the passed
parameter is <code>null</code> or empty the second parameter is returned.
@param s
The parameter to be not <code>null</code> nor empty.
@param sDefaultIfEmpty
The value to be used of the first parameter is <code>null</code> or
empty. May be <code>nu... | [
"Get",
"the",
"passed",
"string",
"but",
"never",
"return",
"an",
"empty",
"string",
".",
"If",
"the",
"passed",
"parameter",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"or",
"empty",
"the",
"second",
"parameter",
"is",
"returned",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4581-L4585 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newWasAssociatedWith | public WasAssociatedWith newWasAssociatedWith(QualifiedName id) {
"""
A factory method to create an instance of an Association {@link WasAssociatedWith}
@param id an identifier for the association
@return an instance of {@link WasAssociatedWith}
"""
return newWasAssociatedWith(id, (QualifiedName)null,(Quali... | java | public WasAssociatedWith newWasAssociatedWith(QualifiedName id) {
return newWasAssociatedWith(id, (QualifiedName)null,(QualifiedName)null);
} | [
"public",
"WasAssociatedWith",
"newWasAssociatedWith",
"(",
"QualifiedName",
"id",
")",
"{",
"return",
"newWasAssociatedWith",
"(",
"id",
",",
"(",
"QualifiedName",
")",
"null",
",",
"(",
"QualifiedName",
")",
"null",
")",
";",
"}"
] | A factory method to create an instance of an Association {@link WasAssociatedWith}
@param id an identifier for the association
@return an instance of {@link WasAssociatedWith} | [
"A",
"factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"an",
"Association",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1066-L1068 |
FitLayout/classify | src/main/java/org/fit/layout/classify/VisualClassifier.java | VisualClassifier.classifyTree | public void classifyTree(Area root, FeatureExtractor features) {
"""
Classifies the areas in an area tree.
@param root the root node of the area tree
"""
if (classifier != null)
{
System.out.print("tree visual classification...");
testRoot = root;
this.features = feature... | java | public void classifyTree(Area root, FeatureExtractor features)
{
if (classifier != null)
{
System.out.print("tree visual classification...");
testRoot = root;
this.features = features;
//create a new empty set with the same header as the training set
testset = new... | [
"public",
"void",
"classifyTree",
"(",
"Area",
"root",
",",
"FeatureExtractor",
"features",
")",
"{",
"if",
"(",
"classifier",
"!=",
"null",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"\"tree visual classification...\"",
")",
";",
"testRoot",
"=",
"r... | Classifies the areas in an area tree.
@param root the root node of the area tree | [
"Classifies",
"the",
"areas",
"in",
"an",
"area",
"tree",
"."
] | train | https://github.com/FitLayout/classify/blob/0b43ceb2f0be4e6d26263491893884d811f0d605/src/main/java/org/fit/layout/classify/VisualClassifier.java#L56-L71 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/lang/ClassLoaders.java | ClassLoaders.getClassLoader | public static ClassLoader getClassLoader(TypeToken<?> type) {
"""
Returns the ClassLoader of the given type. If the given type is a {@link java.lang.reflect.ParameterizedType},
it returns a {@link CombineClassLoader} of all types. The context ClassLoader or System ClassLoader would be used
as the parent of the C... | java | public static ClassLoader getClassLoader(TypeToken<?> type) {
Set<ClassLoader> classLoaders = Sets.newIdentityHashSet();
// Breath first traversal into the Type.
Queue<TypeToken<?>> queue = Lists.newLinkedList();
queue.add(type);
while (!queue.isEmpty()) {
type = queue.remove();
ClassLo... | [
"public",
"static",
"ClassLoader",
"getClassLoader",
"(",
"TypeToken",
"<",
"?",
">",
"type",
")",
"{",
"Set",
"<",
"ClassLoader",
">",
"classLoaders",
"=",
"Sets",
".",
"newIdentityHashSet",
"(",
")",
";",
"// Breath first traversal into the Type.",
"Queue",
"<",... | Returns the ClassLoader of the given type. If the given type is a {@link java.lang.reflect.ParameterizedType},
it returns a {@link CombineClassLoader} of all types. The context ClassLoader or System ClassLoader would be used
as the parent of the CombineClassLoader.
@return A new CombineClassLoader. If no ClassLoader i... | [
"Returns",
"the",
"ClassLoader",
"of",
"the",
"given",
"type",
".",
"If",
"the",
"given",
"type",
"is",
"a",
"{",
"@link",
"java",
".",
"lang",
".",
"reflect",
".",
"ParameterizedType",
"}",
"it",
"returns",
"a",
"{",
"@link",
"CombineClassLoader",
"}",
... | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/lang/ClassLoaders.java#L101-L129 |
jaxio/celerio | celerio-engine/src/main/java/com/jaxio/celerio/factory/EntityFactory.java | EntityFactory.namerDefault | private void namerDefault(Entity entity) {
"""
Namers declared here can be overridden easily through configuration.
@param entity
"""
entity.put("searchForm", new ClassNamer2(entity, null, "web.domain", null, "SearchForm"));
entity.put("editForm", new ClassNamer2(entity, null, "web.domain", ... | java | private void namerDefault(Entity entity) {
entity.put("searchForm", new ClassNamer2(entity, null, "web.domain", null, "SearchForm"));
entity.put("editForm", new ClassNamer2(entity, null, "web.domain", null, "EditForm"));
entity.put("graphLoader", new ClassNamer2(entity, null, "web.domain", null,... | [
"private",
"void",
"namerDefault",
"(",
"Entity",
"entity",
")",
"{",
"entity",
".",
"put",
"(",
"\"searchForm\"",
",",
"new",
"ClassNamer2",
"(",
"entity",
",",
"null",
",",
"\"web.domain\"",
",",
"null",
",",
"\"SearchForm\"",
")",
")",
";",
"entity",
".... | Namers declared here can be overridden easily through configuration.
@param entity | [
"Namers",
"declared",
"here",
"can",
"be",
"overridden",
"easily",
"through",
"configuration",
"."
] | train | https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/factory/EntityFactory.java#L246-L255 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/modelselection/Validator.java | Validator.validate | public VM validate(Iterator<Split> dataSplits, TrainingParameters trainingParameters) {
"""
Estimates the average validation metrics on the provided data splits.
@param dataSplits
@param trainingParameters
@return
"""
AbstractModeler modeler = MLBuilder.create(trainingParameters, configuration);
... | java | public VM validate(Iterator<Split> dataSplits, TrainingParameters trainingParameters) {
AbstractModeler modeler = MLBuilder.create(trainingParameters, configuration);
List<VM> validationMetricsList = new LinkedList<>();
while (dataSplits.hasNext()) {
Split s = dataSplits.next();
... | [
"public",
"VM",
"validate",
"(",
"Iterator",
"<",
"Split",
">",
"dataSplits",
",",
"TrainingParameters",
"trainingParameters",
")",
"{",
"AbstractModeler",
"modeler",
"=",
"MLBuilder",
".",
"create",
"(",
"trainingParameters",
",",
"configuration",
")",
";",
"List... | Estimates the average validation metrics on the provided data splits.
@param dataSplits
@param trainingParameters
@return | [
"Estimates",
"the",
"average",
"validation",
"metrics",
"on",
"the",
"provided",
"data",
"splits",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/modelselection/Validator.java#L58-L81 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java | ChecksumExtensions.getChecksum | public static String getChecksum(final File file, final String algorithm)
throws NoSuchAlgorithmException, IOException {
"""
Gets the checksum from the given file with an instance of the given algorithm.
@param file
the file.
@param algorithm
the algorithm to get the checksum. This could be for instance "M... | java | public static String getChecksum(final File file, final String algorithm)
throws NoSuchAlgorithmException, IOException
{
return getChecksum(ReadFileExtensions.toByteArray(file), algorithm);
} | [
"public",
"static",
"String",
"getChecksum",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"return",
"getChecksum",
"(",
"ReadFileExtensions",
".",
"toByteArray",
"(",
"file",
... | Gets the checksum from the given file with an instance of the given algorithm.
@param file
the file.
@param algorithm
the algorithm to get the checksum. This could be for instance "MD4", "MD5",
"SHA-1", "SHA-256", "SHA-384" or "SHA-512".
@return The checksum from the file as a String object.
@throws NoSuchAlgorithmExc... | [
"Gets",
"the",
"checksum",
"from",
"the",
"given",
"file",
"with",
"an",
"instance",
"of",
"the",
"given",
"algorithm",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java#L255-L259 |
httl/httl | httl/src/main/java/httl/spi/codecs/json/JSONArray.java | JSONArray.writeJSON | public void writeJSON(JSONValue jc, JSONWriter jb, boolean writeClass)
throws IOException {
"""
write json.
@param jc json converter
@param jb json builder.
"""
jb.arrayBegin();
for (Object item : mArray) {
if (item == null)
jb.valueNull();
... | java | public void writeJSON(JSONValue jc, JSONWriter jb, boolean writeClass)
throws IOException {
jb.arrayBegin();
for (Object item : mArray) {
if (item == null)
jb.valueNull();
else
jc.writeValue(item, jb, writeClass);
}
jb.a... | [
"public",
"void",
"writeJSON",
"(",
"JSONValue",
"jc",
",",
"JSONWriter",
"jb",
",",
"boolean",
"writeClass",
")",
"throws",
"IOException",
"{",
"jb",
".",
"arrayBegin",
"(",
")",
";",
"for",
"(",
"Object",
"item",
":",
"mArray",
")",
"{",
"if",
"(",
"... | write json.
@param jc json converter
@param jb json builder. | [
"write",
"json",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONArray.java#L179-L189 |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.runPzConverter | public static Object runPzConverter(final Properties classXref, final String value, final Class<?> typeToReturn) {
"""
Converts a String value to the appropriate Object via
the correct net.sf.flatpack.converter.PZConverter implementation
@param classXref
Properties holding class cross reference
@param value
... | java | public static Object runPzConverter(final Properties classXref, final String value, final Class<?> typeToReturn) {
final String sConverter = classXref.getProperty(typeToReturn.getName());
if (sConverter == null) {
throw new FPConvertException(typeToReturn.getName() + " is not registered i... | [
"public",
"static",
"Object",
"runPzConverter",
"(",
"final",
"Properties",
"classXref",
",",
"final",
"String",
"value",
",",
"final",
"Class",
"<",
"?",
">",
"typeToReturn",
")",
"{",
"final",
"String",
"sConverter",
"=",
"classXref",
".",
"getProperty",
"("... | Converts a String value to the appropriate Object via
the correct net.sf.flatpack.converter.PZConverter implementation
@param classXref
Properties holding class cross reference
@param value
Value to be converted to the Object
@param typeToReturn
Type of object to be returned
@throws FPConvertException
@return Object | [
"Converts",
"a",
"String",
"value",
"to",
"the",
"appropriate",
"Object",
"via",
"the",
"correct",
"net",
".",
"sf",
".",
"flatpack",
".",
"converter",
".",
"PZConverter",
"implementation"
] | train | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L791-L802 |
alkacon/opencms-core | src/org/opencms/workplace/tools/CmsToolDialog.java | CmsToolDialog.dialogScriptSubmit | public String dialogScriptSubmit() {
"""
Builds the standard javascript for submitting the dialog.<p>
Should only be used by the <code>{@link CmsDialog#dialogScriptSubmit()}</code> method.<p>
@return the standard javascript for submitting the dialog
"""
StringBuffer html = new StringBuffer(512);... | java | public String dialogScriptSubmit() {
StringBuffer html = new StringBuffer(512);
html.append("function submitAction(actionValue, theForm, formName) {\n");
html.append("\tif (theForm == null) {\n");
html.append("\t\ttheForm = document.forms[formName];\n");
html.append("\t}\n");
... | [
"public",
"String",
"dialogScriptSubmit",
"(",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"html",
".",
"append",
"(",
"\"function submitAction(actionValue, theForm, formName) {\\n\"",
")",
";",
"html",
".",
"append",
"(",
"... | Builds the standard javascript for submitting the dialog.<p>
Should only be used by the <code>{@link CmsDialog#dialogScriptSubmit()}</code> method.<p>
@return the standard javascript for submitting the dialog | [
"Builds",
"the",
"standard",
"javascript",
"for",
"submitting",
"the",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolDialog.java#L106-L125 |
Jasig/uPortal | uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/RDBMPermissionImpl.java | RDBMPermissionImpl.primDelete | private int primDelete(IPermission perm, PreparedStatement ps) throws Exception {
"""
Set the params on the PreparedStatement and execute the delete.
@param perm org.apereo.portal.security.IPermission
@param ps java.sql.PreparedStatement - the PreparedStatement for deleting a Permission row.
@return int - the... | java | private int primDelete(IPermission perm, PreparedStatement ps) throws Exception {
ps.clearParameters();
ps.setString(1, perm.getOwner());
ps.setInt(2, getPrincipalType(perm));
ps.setString(3, getPrincipalKey(perm));
ps.setString(4, perm.getActivity());
ps.setString(5, per... | [
"private",
"int",
"primDelete",
"(",
"IPermission",
"perm",
",",
"PreparedStatement",
"ps",
")",
"throws",
"Exception",
"{",
"ps",
".",
"clearParameters",
"(",
")",
";",
"ps",
".",
"setString",
"(",
"1",
",",
"perm",
".",
"getOwner",
"(",
")",
")",
";",
... | Set the params on the PreparedStatement and execute the delete.
@param perm org.apereo.portal.security.IPermission
@param ps java.sql.PreparedStatement - the PreparedStatement for deleting a Permission row.
@return int - the return code from the PreparedStatement
@exception Exception | [
"Set",
"the",
"params",
"on",
"the",
"PreparedStatement",
"and",
"execute",
"the",
"delete",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-core/src/main/java/org/apereo/portal/security/provider/RDBMPermissionImpl.java#L498-L508 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.