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 |
|---|---|---|---|---|---|---|---|---|---|---|
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/content/documentlists/ViewUrl.java | ViewUrl.getViewDocumentsUrl | public static MozuUrl getViewDocumentsUrl(String documentListName, String filter, Boolean includeInactive, Integer pageSize, String responseFields, String sortBy, Integer startIndex, String viewName) {
"""
Get Resource Url for GetViewDocuments
@param documentListName Name of content documentListName to delete
@p... | java | public static MozuUrl getViewDocumentsUrl(String documentListName, String filter, Boolean includeInactive, Integer pageSize, String responseFields, String sortBy, Integer startIndex, String viewName)
{
UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}/views/{viewName}/documen... | [
"public",
"static",
"MozuUrl",
"getViewDocumentsUrl",
"(",
"String",
"documentListName",
",",
"String",
"filter",
",",
"Boolean",
"includeInactive",
",",
"Integer",
"pageSize",
",",
"String",
"responseFields",
",",
"String",
"sortBy",
",",
"Integer",
"startIndex",
"... | Get Resource Url for GetViewDocuments
@param documentListName Name of content documentListName to delete
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a li... | [
"Get",
"Resource",
"Url",
"for",
"GetViewDocuments"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/content/documentlists/ViewUrl.java#L28-L40 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRMorphAnimation.java | GVRMorphAnimation.animate | public void animate(GVRHybridObject object, float animationTime) {
"""
Computes the blend weights for the given time and
updates them in the target.
"""
GVRMeshMorph morph = (GVRMeshMorph) mTarget;
mKeyInterpolator.animate(animationTime * mDuration, mCurrentValues);
morph.setWeights(... | java | public void animate(GVRHybridObject object, float animationTime)
{
GVRMeshMorph morph = (GVRMeshMorph) mTarget;
mKeyInterpolator.animate(animationTime * mDuration, mCurrentValues);
morph.setWeights(mCurrentValues);
} | [
"public",
"void",
"animate",
"(",
"GVRHybridObject",
"object",
",",
"float",
"animationTime",
")",
"{",
"GVRMeshMorph",
"morph",
"=",
"(",
"GVRMeshMorph",
")",
"mTarget",
";",
"mKeyInterpolator",
".",
"animate",
"(",
"animationTime",
"*",
"mDuration",
",",
"mCur... | Computes the blend weights for the given time and
updates them in the target. | [
"Computes",
"the",
"blend",
"weights",
"for",
"the",
"given",
"time",
"and",
"updates",
"them",
"in",
"the",
"target",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRMorphAnimation.java#L55-L62 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/util/DebugUtils.java | DebugUtils.traceView | private static void traceView(String additionalMsg, UIViewRoot viewRoot) {
"""
Be careful, when using this version of traceView: Some component properties (e.g. getRenderer) assume, that there
is a valid viewRoot set in the FacesContext!
@param additionalMsg
@param viewRoot
"""
ByteArrayOutputStre... | java | private static void traceView(String additionalMsg, UIViewRoot viewRoot)
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
if (additionalMsg != null)
{
ps.println(additionalMsg);
}
ps.println("=============... | [
"private",
"static",
"void",
"traceView",
"(",
"String",
"additionalMsg",
",",
"UIViewRoot",
"viewRoot",
")",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"PrintStream",
"ps",
"=",
"new",
"PrintStream",
"(",
"baos",
"... | Be careful, when using this version of traceView: Some component properties (e.g. getRenderer) assume, that there
is a valid viewRoot set in the FacesContext!
@param additionalMsg
@param viewRoot | [
"Be",
"careful",
"when",
"using",
"this",
"version",
"of",
"traceView",
":",
"Some",
"component",
"properties",
"(",
"e",
".",
"g",
".",
"getRenderer",
")",
"assume",
"that",
"there",
"is",
"a",
"valid",
"viewRoot",
"set",
"in",
"the",
"FacesContext!"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/util/DebugUtils.java#L131-L144 |
facebookarchive/nifty | nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java | Socks4ClientBootstrap.socksConnect | private static ChannelFuture socksConnect(Channel channel, InetSocketAddress remoteAddress) {
"""
try to look at the remoteAddress and decide to use SOCKS4 or SOCKS4a handshake
packet.
"""
channel.write(createHandshake(remoteAddress));
return ((Socks4HandshakeHandler) channel.getPipeline().get... | java | private static ChannelFuture socksConnect(Channel channel, InetSocketAddress remoteAddress)
{
channel.write(createHandshake(remoteAddress));
return ((Socks4HandshakeHandler) channel.getPipeline().get("handshake")).getChannelFuture();
} | [
"private",
"static",
"ChannelFuture",
"socksConnect",
"(",
"Channel",
"channel",
",",
"InetSocketAddress",
"remoteAddress",
")",
"{",
"channel",
".",
"write",
"(",
"createHandshake",
"(",
"remoteAddress",
")",
")",
";",
"return",
"(",
"(",
"Socks4HandshakeHandler",
... | try to look at the remoteAddress and decide to use SOCKS4 or SOCKS4a handshake
packet. | [
"try",
"to",
"look",
"at",
"the",
"remoteAddress",
"and",
"decide",
"to",
"use",
"SOCKS4",
"or",
"SOCKS4a",
"handshake",
"packet",
"."
] | train | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-client/src/main/java/com/facebook/nifty/client/socks/Socks4ClientBootstrap.java#L133-L137 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperCube.java | SVGHyperCube.drawFrame | public static Element drawFrame(SVGPlot svgp, Projection2D proj, SpatialComparable box) {
"""
Wireframe hypercube.
@param svgp SVG Plot
@param proj Visualization projection
@param box Bounding box
@return path element
"""
SVGPath path = new SVGPath();
ArrayList<double[]> edges = getVisibleEdges(p... | java | public static Element drawFrame(SVGPlot svgp, Projection2D proj, SpatialComparable box) {
SVGPath path = new SVGPath();
ArrayList<double[]> edges = getVisibleEdges(proj, box);
final int dim = box.getDimensionality();
double[] min = new double[dim];
for(int i = 0; i < dim; i++) {
min[i] = box.g... | [
"public",
"static",
"Element",
"drawFrame",
"(",
"SVGPlot",
"svgp",
",",
"Projection2D",
"proj",
",",
"SpatialComparable",
"box",
")",
"{",
"SVGPath",
"path",
"=",
"new",
"SVGPath",
"(",
")",
";",
"ArrayList",
"<",
"double",
"[",
"]",
">",
"edges",
"=",
... | Wireframe hypercube.
@param svgp SVG Plot
@param proj Visualization projection
@param box Bounding box
@return path element | [
"Wireframe",
"hypercube",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperCube.java#L94-L105 |
dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/persistence/GeoCodeLoader.java | GeoCodeLoader.load | public final void load(final InputStream istream) {
"""
Read places from an input stream. The format is | separated. It may
contain just a historical place name or both historical and modern
places names.
@param istream the input stream
"""
load(istream, (name, modernName) -> {
final G... | java | public final void load(final InputStream istream) {
load(istream, (name, modernName) -> {
final GeoCodeItem gci = gcc.get(name);
if (gci == null || !gci.getModernPlaceName().equals(modernName)) {
final GeoCodeItem item = new GeoCodeItem(name, modernName);
... | [
"public",
"final",
"void",
"load",
"(",
"final",
"InputStream",
"istream",
")",
"{",
"load",
"(",
"istream",
",",
"(",
"name",
",",
"modernName",
")",
"->",
"{",
"final",
"GeoCodeItem",
"gci",
"=",
"gcc",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",... | Read places from an input stream. The format is | separated. It may
contain just a historical place name or both historical and modern
places names.
@param istream the input stream | [
"Read",
"places",
"from",
"an",
"input",
"stream",
".",
"The",
"format",
"is",
"|",
"separated",
".",
"It",
"may",
"contain",
"just",
"a",
"historical",
"place",
"name",
"or",
"both",
"historical",
"and",
"modern",
"places",
"names",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/persistence/GeoCodeLoader.java#L53-L63 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/user/TileDaoUtils.java | TileDaoUtils.getClosestZoomLevel | public static Long getClosestZoomLevel(double[] widths, double[] heights,
List<TileMatrix> tileMatrices, double length) {
"""
Get the closest zoom level for the provided width and height in the
default units
@param widths
sorted widths
@param heights
sorted heights
@param tileMatrices
tile matrices
@p... | java | public static Long getClosestZoomLevel(double[] widths, double[] heights,
List<TileMatrix> tileMatrices, double length) {
return getZoomLevel(widths, heights, tileMatrices, length, false);
} | [
"public",
"static",
"Long",
"getClosestZoomLevel",
"(",
"double",
"[",
"]",
"widths",
",",
"double",
"[",
"]",
"heights",
",",
"List",
"<",
"TileMatrix",
">",
"tileMatrices",
",",
"double",
"length",
")",
"{",
"return",
"getZoomLevel",
"(",
"widths",
",",
... | Get the closest zoom level for the provided width and height in the
default units
@param widths
sorted widths
@param heights
sorted heights
@param tileMatrices
tile matrices
@param length
in default units
@return tile matrix zoom level
@since 1.2.1 | [
"Get",
"the",
"closest",
"zoom",
"level",
"for",
"the",
"provided",
"width",
"and",
"height",
"in",
"the",
"default",
"units"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/user/TileDaoUtils.java#L100-L103 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java | SquareGraph.findSideIntersect | public int findSideIntersect(SquareNode n , LineSegment2D_F64 line , Point2D_F64 intersection, LineSegment2D_F64 storage ) {
"""
Finds the side which intersects the line on the shape. The line is assumed to pass through the shape
so if there is no intersection it is considered a bug
"""
for (int j = 0,i=3;... | java | public int findSideIntersect(SquareNode n , LineSegment2D_F64 line , Point2D_F64 intersection, LineSegment2D_F64 storage ) {
for (int j = 0,i=3; j < 4; i=j,j++) {
storage.a = n.square.get(i);
storage.b = n.square.get(j);
if( Intersection2D_F64.intersection(line,storage,intersection) != null ) {
return i... | [
"public",
"int",
"findSideIntersect",
"(",
"SquareNode",
"n",
",",
"LineSegment2D_F64",
"line",
",",
"Point2D_F64",
"intersection",
",",
"LineSegment2D_F64",
"storage",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
",",
"i",
"=",
"3",
";",
"j",
"<",
"4",
"... | Finds the side which intersects the line on the shape. The line is assumed to pass through the shape
so if there is no intersection it is considered a bug | [
"Finds",
"the",
"side",
"which",
"intersects",
"the",
"line",
"on",
"the",
"shape",
".",
"The",
"line",
"is",
"assumed",
"to",
"pass",
"through",
"the",
"shape",
"so",
"if",
"there",
"is",
"no",
"intersection",
"it",
"is",
"considered",
"a",
"bug"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L79-L91 |
jingwei/krati | krati-main/src/main/java/krati/core/array/SimpleDataArray.java | SimpleDataArray.transferTo | @Override
public int transferTo(int index, WritableByteChannel channel) {
"""
Transfers data at a given index to a writable channel.
@param index the array index
@return the amount of bytes transferred (the length of data at the given index).
@throws ArrayIndexOutOfBoundsException if the index is out of ... | java | @Override
public int transferTo(int index, WritableByteChannel channel) {
rangeCheck(index);
try {
long address = getAddress(index);
int segPos = _addressFormat.getOffset(address);
int segInd = _addressFormat.getSegment(address);
... | [
"@",
"Override",
"public",
"int",
"transferTo",
"(",
"int",
"index",
",",
"WritableByteChannel",
"channel",
")",
"{",
"rangeCheck",
"(",
"index",
")",
";",
"try",
"{",
"long",
"address",
"=",
"getAddress",
"(",
"index",
")",
";",
"int",
"segPos",
"=",
"_... | Transfers data at a given index to a writable channel.
@param index the array index
@return the amount of bytes transferred (the length of data at the given index).
@throws ArrayIndexOutOfBoundsException if the index is out of range. | [
"Transfers",
"data",
"at",
"a",
"given",
"index",
"to",
"a",
"writable",
"channel",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/SimpleDataArray.java#L664-L693 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/PropertiesBasedStyleLibrary.java | PropertiesBasedStyleLibrary.getPropertyValue | protected String getPropertyValue(String prefix, String postfix) {
"""
Retrieve the property value for a particular path + type pair.
@param prefix Path
@param postfix Type
@return Value
"""
String ret = properties.getProperty(prefix + "." + postfix);
if (ret != null) {
// logger.debugFine("... | java | protected String getPropertyValue(String prefix, String postfix) {
String ret = properties.getProperty(prefix + "." + postfix);
if (ret != null) {
// logger.debugFine("Found property: "+prefix + "." +
// postfix+" for "+prefix);
return ret;
}
int pos = prefix.length();
while (pos >... | [
"protected",
"String",
"getPropertyValue",
"(",
"String",
"prefix",
",",
"String",
"postfix",
")",
"{",
"String",
"ret",
"=",
"properties",
".",
"getProperty",
"(",
"prefix",
"+",
"\".\"",
"+",
"postfix",
")",
";",
"if",
"(",
"ret",
"!=",
"null",
")",
"{... | Retrieve the property value for a particular path + type pair.
@param prefix Path
@param postfix Type
@return Value | [
"Retrieve",
"the",
"property",
"value",
"for",
"a",
"particular",
"path",
"+",
"type",
"pair",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/PropertiesBasedStyleLibrary.java#L192-L218 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.getAndCheckActionImport | public static ActionImport getAndCheckActionImport(EntityDataModel entityDataModel, String actionImportName) {
"""
Gets the action import by the specified name, throw an exception if no action import with the specified name
exists.
@param entityDataModel The entity data model.
@param actionImportName The nam... | java | public static ActionImport getAndCheckActionImport(EntityDataModel entityDataModel, String actionImportName) {
ActionImport actionImport = entityDataModel.getEntityContainer().getActionImport(actionImportName);
if (actionImport == null) {
throw new ODataSystemException("Action import not fou... | [
"public",
"static",
"ActionImport",
"getAndCheckActionImport",
"(",
"EntityDataModel",
"entityDataModel",
",",
"String",
"actionImportName",
")",
"{",
"ActionImport",
"actionImport",
"=",
"entityDataModel",
".",
"getEntityContainer",
"(",
")",
".",
"getActionImport",
"(",... | Gets the action import by the specified name, throw an exception if no action import with the specified name
exists.
@param entityDataModel The entity data model.
@param actionImportName The name of action import.
@return The instance of action import. | [
"Gets",
"the",
"action",
"import",
"by",
"the",
"specified",
"name",
"throw",
"an",
"exception",
"if",
"no",
"action",
"import",
"with",
"the",
"specified",
"name",
"exists",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L631-L638 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java | Disposables.disposeOf | public static void disposeOf(final Map<?, ? extends Disposable> disposables) {
"""
Performs null checks and disposes of assets.
@param disposables its values will be disposed of (if they exist). Can be null.
"""
if (disposables != null) {
for (final Disposable disposable : disposables.va... | java | public static void disposeOf(final Map<?, ? extends Disposable> disposables) {
if (disposables != null) {
for (final Disposable disposable : disposables.values()) {
disposeOf(disposable);
}
}
} | [
"public",
"static",
"void",
"disposeOf",
"(",
"final",
"Map",
"<",
"?",
",",
"?",
"extends",
"Disposable",
">",
"disposables",
")",
"{",
"if",
"(",
"disposables",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Disposable",
"disposable",
":",
"disposables",
... | Performs null checks and disposes of assets.
@param disposables its values will be disposed of (if they exist). Can be null. | [
"Performs",
"null",
"checks",
"and",
"disposes",
"of",
"assets",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java#L62-L68 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/inputs/codecs/gelf/GELFMessage.java | GELFMessage.getJSON | public String getJSON(long maxBytes) {
"""
Return the JSON payload of the GELF message.
@param maxBytes The maximum number of bytes to read from a compressed GELF payload. {@code -1} means unlimited.
@return The extracted JSON payload of the GELF message.
@see Tools#decompressGzip(byte[], long)
@see Tools#de... | java | public String getJSON(long maxBytes) {
try {
switch (getGELFType()) {
case ZLIB:
return Tools.decompressZlib(payload, maxBytes);
case GZIP:
return Tools.decompressGzip(payload, maxBytes);
case UNCOMPRESSED:
... | [
"public",
"String",
"getJSON",
"(",
"long",
"maxBytes",
")",
"{",
"try",
"{",
"switch",
"(",
"getGELFType",
"(",
")",
")",
"{",
"case",
"ZLIB",
":",
"return",
"Tools",
".",
"decompressZlib",
"(",
"payload",
",",
"maxBytes",
")",
";",
"case",
"GZIP",
":... | Return the JSON payload of the GELF message.
@param maxBytes The maximum number of bytes to read from a compressed GELF payload. {@code -1} means unlimited.
@return The extracted JSON payload of the GELF message.
@see Tools#decompressGzip(byte[], long)
@see Tools#decompressZlib(byte[], long) | [
"Return",
"the",
"JSON",
"payload",
"of",
"the",
"GELF",
"message",
"."
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/inputs/codecs/gelf/GELFMessage.java#L70-L89 |
alkacon/opencms-core | src/org/opencms/file/CmsRequestContext.java | CmsRequestContext.getAdjustedSiteRoot | public static String getAdjustedSiteRoot(String siteRoot, String resourcename) {
"""
Returns the adjusted site root for a resource using the provided site root as a base.<p>
Usually, this would be the site root for the current site.
However, if a resource from the <code>/system/</code> folder is requested,
th... | java | public static String getAdjustedSiteRoot(String siteRoot, String resourcename) {
if (resourcename.startsWith(CmsWorkplace.VFS_PATH_SYSTEM)
|| OpenCms.getSiteManager().startsWithShared(resourcename)
|| (resourcename.startsWith(CmsWorkplace.VFS_PATH_SITES) && !resourcename.startsWith(site... | [
"public",
"static",
"String",
"getAdjustedSiteRoot",
"(",
"String",
"siteRoot",
",",
"String",
"resourcename",
")",
"{",
"if",
"(",
"resourcename",
".",
"startsWith",
"(",
"CmsWorkplace",
".",
"VFS_PATH_SYSTEM",
")",
"||",
"OpenCms",
".",
"getSiteManager",
"(",
... | Returns the adjusted site root for a resource using the provided site root as a base.<p>
Usually, this would be the site root for the current site.
However, if a resource from the <code>/system/</code> folder is requested,
this will be the empty String.<p>
@param siteRoot the site root of the current site
@param reso... | [
"Returns",
"the",
"adjusted",
"site",
"root",
"for",
"a",
"resource",
"using",
"the",
"provided",
"site",
"root",
"as",
"a",
"base",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsRequestContext.java#L171-L180 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.updateEntityAttribute | public EntityResult updateEntityAttribute(final String guid, final String attribute, String value)
throws AtlasServiceException {
"""
Supports Partial updates
Updates property for the entity corresponding to guid
@param guid guid
@param attribute property key
@param value property value
... | java | public EntityResult updateEntityAttribute(final String guid, final String attribute, String value)
throws AtlasServiceException {
LOG.debug("Updating entity id: {}, attribute name: {}, attribute value: {}", guid, attribute, value);
JSONObject response = callAPIWithRetries(API.UPDATE_ENTITY_P... | [
"public",
"EntityResult",
"updateEntityAttribute",
"(",
"final",
"String",
"guid",
",",
"final",
"String",
"attribute",
",",
"String",
"value",
")",
"throws",
"AtlasServiceException",
"{",
"LOG",
".",
"debug",
"(",
"\"Updating entity id: {}, attribute name: {}, attribute ... | Supports Partial updates
Updates property for the entity corresponding to guid
@param guid guid
@param attribute property key
@param value property value | [
"Supports",
"Partial",
"updates",
"Updates",
"property",
"for",
"the",
"entity",
"corresponding",
"to",
"guid"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L496-L509 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/dynamic/ProxyUtils.java | ProxyUtils.createServiceInstance | public static <T> T createServiceInstance(T impl, String name, String category, String subsystem, boolean attachLoggers, Class<T> interf, Class<?>... additionalInterfaces) {
"""
Creates a monitored proxy instance for a service. Service in this context means, that the ServiceStatsCallHandler and ServiceStatsFactory... | java | public static <T> T createServiceInstance(T impl, String name, String category, String subsystem, boolean attachLoggers, Class<T> interf, Class<?>... additionalInterfaces){
return createInstance(impl,
name,
category,
subsystem,
new ServiceStatsCallHandler(),
new ServiceStatsFactory(),
atta... | [
"public",
"static",
"<",
"T",
">",
"T",
"createServiceInstance",
"(",
"T",
"impl",
",",
"String",
"name",
",",
"String",
"category",
",",
"String",
"subsystem",
",",
"boolean",
"attachLoggers",
",",
"Class",
"<",
"T",
">",
"interf",
",",
"Class",
"<",
"?... | Creates a monitored proxy instance for a service. Service in this context means, that the ServiceStatsCallHandler and ServiceStatsFactory are used.
@param <T> the server interface.
@param impl the implementation of T.
@param name name for this instance.
@param category category of this instance.
@param subsystem subsys... | [
"Creates",
"a",
"monitored",
"proxy",
"instance",
"for",
"a",
"service",
".",
"Service",
"in",
"this",
"context",
"means",
"that",
"the",
"ServiceStatsCallHandler",
"and",
"ServiceStatsFactory",
"are",
"used",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/dynamic/ProxyUtils.java#L99-L109 |
aws/aws-sdk-java | aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/AccountSettings.java | AccountSettings.withUnmeteredDevices | public AccountSettings withUnmeteredDevices(java.util.Map<String, Integer> unmeteredDevices) {
"""
<p>
Returns the unmetered devices you have purchased or want to purchase.
</p>
@param unmeteredDevices
Returns the unmetered devices you have purchased or want to purchase.
@return Returns a reference to this ... | java | public AccountSettings withUnmeteredDevices(java.util.Map<String, Integer> unmeteredDevices) {
setUnmeteredDevices(unmeteredDevices);
return this;
} | [
"public",
"AccountSettings",
"withUnmeteredDevices",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Integer",
">",
"unmeteredDevices",
")",
"{",
"setUnmeteredDevices",
"(",
"unmeteredDevices",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Returns the unmetered devices you have purchased or want to purchase.
</p>
@param unmeteredDevices
Returns the unmetered devices you have purchased or want to purchase.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Returns",
"the",
"unmetered",
"devices",
"you",
"have",
"purchased",
"or",
"want",
"to",
"purchase",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/AccountSettings.java#L163-L166 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/util/Util.java | Util.slurpStream | public static String slurpStream(InputStream input, String encoding) throws IOException {
"""
Given an input stream, its data will be slurped in memory and returned as a String. The input stream will be
closed when this method returns. WARNING: do not slurp large streams to avoid out-of-memory errors.
@param i... | java | public static String slurpStream(InputStream input, String encoding) throws IOException {
try (Reader r = new InputStreamReader(input, encoding)) {
StringBuilder result = new StringBuilder();
char[] buffer = new char[BUFFER_SIZE];
int len = 0;
while ((len = r.read... | [
"public",
"static",
"String",
"slurpStream",
"(",
"InputStream",
"input",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"try",
"(",
"Reader",
"r",
"=",
"new",
"InputStreamReader",
"(",
"input",
",",
"encoding",
")",
")",
"{",
"StringBuilder",
... | Given an input stream, its data will be slurped in memory and returned as a String. The input stream will be
closed when this method returns. WARNING: do not slurp large streams to avoid out-of-memory errors.
@param input the input stream to slup
@param encoding the encoding to use when reading from {@code input}
@ret... | [
"Given",
"an",
"input",
"stream",
"its",
"data",
"will",
"be",
"slurped",
"in",
"memory",
"and",
"returned",
"as",
"a",
"String",
".",
"The",
"input",
"stream",
"will",
"be",
"closed",
"when",
"this",
"method",
"returns",
".",
"WARNING",
":",
"do",
"not"... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/util/Util.java#L230-L240 |
googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java | AtomContent.forEntry | public static AtomContent forEntry(XmlNamespaceDictionary namespaceDictionary, Object entry) {
"""
Returns a new instance of HTTP content for an Atom entry.
@param namespaceDictionary XML namespace dictionary
@param entry data key/value pair for the Atom entry
@since 1.5
"""
return new AtomContent(nam... | java | public static AtomContent forEntry(XmlNamespaceDictionary namespaceDictionary, Object entry) {
return new AtomContent(namespaceDictionary, entry, true);
} | [
"public",
"static",
"AtomContent",
"forEntry",
"(",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"Object",
"entry",
")",
"{",
"return",
"new",
"AtomContent",
"(",
"namespaceDictionary",
",",
"entry",
",",
"true",
")",
";",
"}"
] | Returns a new instance of HTTP content for an Atom entry.
@param namespaceDictionary XML namespace dictionary
@param entry data key/value pair for the Atom entry
@since 1.5 | [
"Returns",
"a",
"new",
"instance",
"of",
"HTTP",
"content",
"for",
"an",
"Atom",
"entry",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java#L80-L82 |
mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/ClirrReport.java | ClirrReport.generate | public void generate( org.codehaus.doxia.sink.Sink sink, Locale locale )
throws MavenReportException {
"""
eventually, we must replace this with the o.a.m.d.s.Sink class as a parameter
"""
generate( (Sink) sink, locale );
} | java | public void generate( org.codehaus.doxia.sink.Sink sink, Locale locale )
throws MavenReportException
{
generate( (Sink) sink, locale );
} | [
"public",
"void",
"generate",
"(",
"org",
".",
"codehaus",
".",
"doxia",
".",
"sink",
".",
"Sink",
"sink",
",",
"Locale",
"locale",
")",
"throws",
"MavenReportException",
"{",
"generate",
"(",
"(",
"Sink",
")",
"sink",
",",
"locale",
")",
";",
"}"
] | eventually, we must replace this with the o.a.m.d.s.Sink class as a parameter | [
"eventually",
"we",
"must",
"replace",
"this",
"with",
"the",
"o",
".",
"a",
".",
"m",
".",
"d",
".",
"s",
".",
"Sink",
"class",
"as",
"a",
"parameter"
] | train | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/ClirrReport.java#L370-L375 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java | AbstractCodeElementExtractor.findAction | protected static Action findAction(EObject grammarComponent, String assignmentName) {
"""
Replies the assignment component with the given nazme in the given grammar component.
@param grammarComponent the component to explore.
@param assignmentName the name of the assignment to search for.
@return the assignme... | java | protected static Action findAction(EObject grammarComponent, String assignmentName) {
for (final Action action : GrammarUtil.containedActions(grammarComponent)) {
if (GrammarUtil.isAssignedAction(action)) {
if (Objects.equals(assignmentName, action.getFeature())) {
return action;
}
}
}
return n... | [
"protected",
"static",
"Action",
"findAction",
"(",
"EObject",
"grammarComponent",
",",
"String",
"assignmentName",
")",
"{",
"for",
"(",
"final",
"Action",
"action",
":",
"GrammarUtil",
".",
"containedActions",
"(",
"grammarComponent",
")",
")",
"{",
"if",
"(",... | Replies the assignment component with the given nazme in the given grammar component.
@param grammarComponent the component to explore.
@param assignmentName the name of the assignment to search for.
@return the assignment component. | [
"Replies",
"the",
"assignment",
"component",
"with",
"the",
"given",
"nazme",
"in",
"the",
"given",
"grammar",
"component",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/extractor/AbstractCodeElementExtractor.java#L112-L121 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.getStringAttribute | public static final String getStringAttribute(Path path, String attribute, LinkOption... options) throws IOException {
"""
Returns user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param options
@return
@throws IOException
"""
attribute = attribute.st... | java | public static final String getStringAttribute(Path path, String attribute, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
byte[] attr = (byte[]) Files.getAttribute(path, attribute, options);
if (attr == null)
... | [
"public",
"static",
"final",
"String",
"getStringAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"attribute",
"=",
"attribute",
".",
"startsWith",
"(",
"\"user:\"",
")",
"?",
... | Returns user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param options
@return
@throws IOException | [
"Returns",
"user",
"-",
"defined",
"-",
"attribute"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L302-L311 |
podio/podio-java | src/main/java/com/podio/item/ItemAPI.java | ItemAPI.getItemRevision | public ItemRevision getItemRevision(int itemId, int revisionId) {
"""
Returns the data about the specific revision on an item
@param itemId
The id of the item
@param revisionId
The running revision number, starts at 0 for the initial
revision
@return The revision
"""
return getResourceFactory().getAp... | java | public ItemRevision getItemRevision(int itemId, int revisionId) {
return getResourceFactory().getApiResource(
"/item/" + itemId + "/revision/" + revisionId).get(
ItemRevision.class);
} | [
"public",
"ItemRevision",
"getItemRevision",
"(",
"int",
"itemId",
",",
"int",
"revisionId",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/item/\"",
"+",
"itemId",
"+",
"\"/revision/\"",
"+",
"revisionId",
")",
".",
"get",
... | Returns the data about the specific revision on an item
@param itemId
The id of the item
@param revisionId
The running revision number, starts at 0 for the initial
revision
@return The revision | [
"Returns",
"the",
"data",
"about",
"the",
"specific",
"revision",
"on",
"an",
"item"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/item/ItemAPI.java#L230-L234 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/spider/SpiderPanelTableModel.java | SpiderPanelTableModel.removesScanResult | public void removesScanResult(String uri, String method) {
"""
Removes the scan result for a particular uri and method. Method is synchronized internally.
@param uri the uri
@param method the method
"""
SpiderScanResult toRemove = new SpiderScanResult(uri, method);
int index = scanResults.indexOf(toRem... | java | public void removesScanResult(String uri, String method) {
SpiderScanResult toRemove = new SpiderScanResult(uri, method);
int index = scanResults.indexOf(toRemove);
if (index >= 0) {
scanResults.remove(index);
fireTableRowsDeleted(index, index);
}
} | [
"public",
"void",
"removesScanResult",
"(",
"String",
"uri",
",",
"String",
"method",
")",
"{",
"SpiderScanResult",
"toRemove",
"=",
"new",
"SpiderScanResult",
"(",
"uri",
",",
"method",
")",
";",
"int",
"index",
"=",
"scanResults",
".",
"indexOf",
"(",
"toR... | Removes the scan result for a particular uri and method. Method is synchronized internally.
@param uri the uri
@param method the method | [
"Removes",
"the",
"scan",
"result",
"for",
"a",
"particular",
"uri",
"and",
"method",
".",
"Method",
"is",
"synchronized",
"internally",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/spider/SpiderPanelTableModel.java#L133-L140 |
apache/incubator-gobblin | gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AvroHttpJoinConverter.java | AvroHttpJoinConverter.generateHttpOperation | @Override
protected HttpOperation generateHttpOperation (GenericRecord inputRecord, State state) {
"""
Extract user defined keys by looking at "gobblin.converter.http.keys"
If keys are defined, extract key-value pair from inputRecord and set it to HttpOperation
If keys are not defined, generate HttpOperation b... | java | @Override
protected HttpOperation generateHttpOperation (GenericRecord inputRecord, State state) {
Map<String, String> keyAndValue = new HashMap<>();
Optional<Iterable<String>> keys = getKeys(state);
HttpOperation operation;
if (keys.isPresent()) {
for (String key : keys.get()) {
String... | [
"@",
"Override",
"protected",
"HttpOperation",
"generateHttpOperation",
"(",
"GenericRecord",
"inputRecord",
",",
"State",
"state",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"keyAndValue",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Optional",
"<",
... | Extract user defined keys by looking at "gobblin.converter.http.keys"
If keys are defined, extract key-value pair from inputRecord and set it to HttpOperation
If keys are not defined, generate HttpOperation by HttpUtils.toHttpOperation | [
"Extract",
"user",
"defined",
"keys",
"by",
"looking",
"at",
"gobblin",
".",
"converter",
".",
"http",
".",
"keys",
"If",
"keys",
"are",
"defined",
"extract",
"key",
"-",
"value",
"pair",
"from",
"inputRecord",
"and",
"set",
"it",
"to",
"HttpOperation",
"I... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AvroHttpJoinConverter.java#L77-L95 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/markdown/Emitter.java | Emitter.addLinkRef | public void addLinkRef (@Nonnull final String sKey, final LinkRef aLinkRef) {
"""
Adds a LinkRef to this set of LinkRefs.
@param sKey
The key/id.
@param aLinkRef
The LinkRef.
"""
m_aLinkRefs.put (sKey.toLowerCase (Locale.US), aLinkRef);
} | java | public void addLinkRef (@Nonnull final String sKey, final LinkRef aLinkRef)
{
m_aLinkRefs.put (sKey.toLowerCase (Locale.US), aLinkRef);
} | [
"public",
"void",
"addLinkRef",
"(",
"@",
"Nonnull",
"final",
"String",
"sKey",
",",
"final",
"LinkRef",
"aLinkRef",
")",
"{",
"m_aLinkRefs",
".",
"put",
"(",
"sKey",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
",",
"aLinkRef",
")",
";",
"}"
] | Adds a LinkRef to this set of LinkRefs.
@param sKey
The key/id.
@param aLinkRef
The LinkRef. | [
"Adds",
"a",
"LinkRef",
"to",
"this",
"set",
"of",
"LinkRefs",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/Emitter.java#L103-L106 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/MinimalDTDReader.java | MinimalDTDReader.skipInternalSubset | public static void skipInternalSubset(WstxInputData srcData, WstxInputSource input,
ReaderConfig cfg)
throws XMLStreamException {
"""
Method that just skims
through structure of internal subset, but without doing any sort
of validation, or parsing of contents. Me... | java | public static void skipInternalSubset(WstxInputData srcData, WstxInputSource input,
ReaderConfig cfg)
throws XMLStreamException
{
MinimalDTDReader r = new MinimalDTDReader(input, cfg);
// Need to read from same source as the master (owning stream rea... | [
"public",
"static",
"void",
"skipInternalSubset",
"(",
"WstxInputData",
"srcData",
",",
"WstxInputSource",
"input",
",",
"ReaderConfig",
"cfg",
")",
"throws",
"XMLStreamException",
"{",
"MinimalDTDReader",
"r",
"=",
"new",
"MinimalDTDReader",
"(",
"input",
",",
"cfg... | Method that just skims
through structure of internal subset, but without doing any sort
of validation, or parsing of contents. Method may still throw an
exception, if skipping causes EOF or there's an I/O problem.
@param srcData Link back to the input buffer shared with the owning
stream reader. | [
"Method",
"that",
"just",
"skims",
"through",
"structure",
"of",
"internal",
"subset",
"but",
"without",
"doing",
"any",
"sort",
"of",
"validation",
"or",
"parsing",
"of",
"contents",
".",
"Method",
"may",
"still",
"throw",
"an",
"exception",
"if",
"skipping",... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/MinimalDTDReader.java#L83-L99 |
icode/ameba | src/main/java/ameba/core/Addon.java | Addon.unsubscribeEvent | protected static <E extends Event> void unsubscribeEvent(Class<E> eventClass, final Listener<E> listener) {
"""
<p>unsubscribeEvent.</p>
@param eventClass a {@link java.lang.Class} object.
@param listener a {@link ameba.event.Listener} object.
@param <E> a E object.
"""
getEventBus().unsubscribe... | java | protected static <E extends Event> void unsubscribeEvent(Class<E> eventClass, final Listener<E> listener) {
getEventBus().unsubscribe(eventClass, listener);
} | [
"protected",
"static",
"<",
"E",
"extends",
"Event",
">",
"void",
"unsubscribeEvent",
"(",
"Class",
"<",
"E",
">",
"eventClass",
",",
"final",
"Listener",
"<",
"E",
">",
"listener",
")",
"{",
"getEventBus",
"(",
")",
".",
"unsubscribe",
"(",
"eventClass",
... | <p>unsubscribeEvent.</p>
@param eventClass a {@link java.lang.Class} object.
@param listener a {@link ameba.event.Listener} object.
@param <E> a E object. | [
"<p",
">",
"unsubscribeEvent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Addon.java#L63-L65 |
crnk-project/crnk-framework | crnk-core/src/main/java/io/crnk/core/engine/internal/jackson/JacksonModule.java | JacksonModule.createJacksonModule | public static SimpleModule createJacksonModule(boolean serializeLinksAsObjects) {
"""
Creates Crnk Jackson module with all required serializers.<br />
Adds the {@link LinksInformationSerializer} if <code>serializeLinksAsObjects</code> is set to <code>true</code>.
@param serializeLinksAsObjects flag which decid... | java | public static SimpleModule createJacksonModule(boolean serializeLinksAsObjects) {
SimpleModule simpleModule = new SimpleModule(JSON_API_JACKSON_MODULE_NAME,
new Version(1, 0, 0, null, null, null));
simpleModule.addSerializer(new ErrorDataSerializer());
simpleModule.addDeserializer(ErrorData.class, new ErrorDa... | [
"public",
"static",
"SimpleModule",
"createJacksonModule",
"(",
"boolean",
"serializeLinksAsObjects",
")",
"{",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"JSON_API_JACKSON_MODULE_NAME",
",",
"new",
"Version",
"(",
"1",
",",
"0",
",",
"0",
",",... | Creates Crnk Jackson module with all required serializers.<br />
Adds the {@link LinksInformationSerializer} if <code>serializeLinksAsObjects</code> is set to <code>true</code>.
@param serializeLinksAsObjects flag which decides whether the {@link LinksInformationSerializer} should be added as
additional serializer or ... | [
"Creates",
"Crnk",
"Jackson",
"module",
"with",
"all",
"required",
"serializers",
".",
"<br",
"/",
">",
"Adds",
"the",
"{",
"@link",
"LinksInformationSerializer",
"}",
"if",
"<code",
">",
"serializeLinksAsObjects<",
"/",
"code",
">",
"is",
"set",
"to",
"<code"... | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/jackson/JacksonModule.java#L50-L60 |
facebookarchive/hadoop-20 | src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/UTF8ByteArrayUtils.java | UTF8ByteArrayUtils.findTab | public static int findTab(byte [] utf, int start, int length) {
"""
Find the first occured tab in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length no. of bytes
@return position that first tab occures otherwise -1
"""
for(int i=s... | java | public static int findTab(byte [] utf, int start, int length) {
for(int i=start; i<(start+length); i++) {
if (utf[i]==(byte)'\t') {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"findTab",
"(",
"byte",
"[",
"]",
"utf",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"(",
"start",
"+",
"length",
")",
";",
"i",
"++",
")",
"{",
"if",
"(... | Find the first occured tab in a UTF-8 encoded string
@param utf a byte array containing a UTF-8 encoded string
@param start starting offset
@param length no. of bytes
@return position that first tab occures otherwise -1 | [
"Find",
"the",
"first",
"occured",
"tab",
"in",
"a",
"UTF",
"-",
"8",
"encoded",
"string"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/hive-streaming/src/java/org/apache/hadoop/streaming/UTF8ByteArrayUtils.java#L38-L45 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/util/ReflectionUtils.java | ReflectionUtils.getAnnotation | public static <T extends Annotation> T getAnnotation(Field field, Class<T> annotationType) {
"""
Looks for given annotationType on given field or read method for field.
@param field field to check
@param annotationType Type of annotation you're looking for.
@param <T> the actual type of annotation
@return gi... | java | public static <T extends Annotation> T getAnnotation(Field field, Class<T> annotationType) {
return field.getAnnotation(annotationType) == null ? getAnnotationFromReadMethod(getReadMethod(field).orElse(null),
annotationType) : field.getAnnotation(annotationType);
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"Field",
"field",
",",
"Class",
"<",
"T",
">",
"annotationType",
")",
"{",
"return",
"field",
".",
"getAnnotation",
"(",
"annotationType",
")",
"==",
"null",
"?",
"getAn... | Looks for given annotationType on given field or read method for field.
@param field field to check
@param annotationType Type of annotation you're looking for.
@param <T> the actual type of annotation
@return given annotation if field or read method has this annotation or null. | [
"Looks",
"for",
"given",
"annotationType",
"on",
"given",
"field",
"or",
"read",
"method",
"for",
"field",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/util/ReflectionUtils.java#L407-L410 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java | RingPlacer.placeRing | public void placeRing(IRing ring, Point2d ringCenter, double bondLength, Map<Integer, Double> startAngles) {
"""
Place ring with user provided angles.
@param ring the ring to place.
@param ringCenter center coordinates of the ring.
@param bondLength given bond length.
@param startAngles a map with start angl... | java | public void placeRing(IRing ring, Point2d ringCenter, double bondLength, Map<Integer, Double> startAngles) {
double radius = this.getNativeRingRadius(ring, bondLength);
double addAngle = 2 * Math.PI / ring.getRingSize();
IAtom startAtom = ring.getAtom(0);
Point2d p = new Point2d(ringCen... | [
"public",
"void",
"placeRing",
"(",
"IRing",
"ring",
",",
"Point2d",
"ringCenter",
",",
"double",
"bondLength",
",",
"Map",
"<",
"Integer",
",",
"Double",
">",
"startAngles",
")",
"{",
"double",
"radius",
"=",
"this",
".",
"getNativeRingRadius",
"(",
"ring",... | Place ring with user provided angles.
@param ring the ring to place.
@param ringCenter center coordinates of the ring.
@param bondLength given bond length.
@param startAngles a map with start angles when drawing the ring. | [
"Place",
"ring",
"with",
"user",
"provided",
"angles",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L149-L179 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/AgreementsInner.java | AgreementsInner.createOrUpdate | public IntegrationAccountAgreementInner createOrUpdate(String resourceGroupName, String integrationAccountName, String agreementName, IntegrationAccountAgreementInner agreement) {
"""
Creates or updates an integration account agreement.
@param resourceGroupName The resource group name.
@param integrationAccoun... | java | public IntegrationAccountAgreementInner createOrUpdate(String resourceGroupName, String integrationAccountName, String agreementName, IntegrationAccountAgreementInner agreement) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, agreementName, agreement).toBlocking().sing... | [
"public",
"IntegrationAccountAgreementInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"agreementName",
",",
"IntegrationAccountAgreementInner",
"agreement",
")",
"{",
"return",
"createOrUpdateWithServiceRespons... | Creates or updates an integration account agreement.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param agreementName The integration account agreement name.
@param agreement The integration account agreement.
@throws IllegalArgumentException thrown if ... | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"agreement",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/AgreementsInner.java#L448-L450 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsLogin.java | CmsLogin.getDirectEditPath | public static String getDirectEditPath(CmsObject cms, CmsUserSettings userSettings) {
"""
Returns the direct edit path from the user settings, or <code>null</code> if not set.<p>
@param cms the CMS context to use
@param userSettings the user settings
@return the direct edit path
"""
if (userSet... | java | public static String getDirectEditPath(CmsObject cms, CmsUserSettings userSettings) {
if (userSettings.getStartView().equals(CmsWorkplace.VIEW_DIRECT_EDIT)
| userSettings.getStartView().equals(CmsPageEditorConfiguration.APP_ID)) {
try {
CmsObject cloneCms = OpenCms.init... | [
"public",
"static",
"String",
"getDirectEditPath",
"(",
"CmsObject",
"cms",
",",
"CmsUserSettings",
"userSettings",
")",
"{",
"if",
"(",
"userSettings",
".",
"getStartView",
"(",
")",
".",
"equals",
"(",
"CmsWorkplace",
".",
"VIEW_DIRECT_EDIT",
")",
"|",
"userSe... | Returns the direct edit path from the user settings, or <code>null</code> if not set.<p>
@param cms the CMS context to use
@param userSettings the user settings
@return the direct edit path | [
"Returns",
"the",
"direct",
"edit",
"path",
"from",
"the",
"user",
"settings",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"not",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsLogin.java#L230-L253 |
sockeqwe/AdapterDelegates | library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java | AdapterDelegatesManager.addDelegate | public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate) {
"""
Adds an {@link AdapterDelegate}.
<b>This method automatically assign internally the view type integer by using the next
unused</b>
<p>
Internally calls {@link #addDelegate(int, boolean, AdapterDelegate)} with
allowReplac... | java | public AdapterDelegatesManager<T> addDelegate(@NonNull AdapterDelegate<T> delegate) {
// algorithm could be improved since there could be holes,
// but it's very unlikely that we reach Integer.MAX_VALUE and run out of unused indexes
int viewType = delegates.size();
while (delegates.get(v... | [
"public",
"AdapterDelegatesManager",
"<",
"T",
">",
"addDelegate",
"(",
"@",
"NonNull",
"AdapterDelegate",
"<",
"T",
">",
"delegate",
")",
"{",
"// algorithm could be improved since there could be holes,",
"// but it's very unlikely that we reach Integer.MAX_VALUE and run out of un... | Adds an {@link AdapterDelegate}.
<b>This method automatically assign internally the view type integer by using the next
unused</b>
<p>
Internally calls {@link #addDelegate(int, boolean, AdapterDelegate)} with
allowReplacingDelegate = false as parameter.
@param delegate the delegate to add
@return self
@throws NullPoin... | [
"Adds",
"an",
"{",
"@link",
"AdapterDelegate",
"}",
".",
"<b",
">",
"This",
"method",
"automatically",
"assign",
"internally",
"the",
"view",
"type",
"integer",
"by",
"using",
"the",
"next",
"unused<",
"/",
"b",
">",
"<p",
">",
"Internally",
"calls",
"{",
... | train | https://github.com/sockeqwe/AdapterDelegates/blob/d18dc609415e5d17a3354bddf4bae62440e017af/library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java#L91-L103 |
playn/playn | core/src/playn/core/Surface.java | Surface.startClipped | public boolean startClipped (int x, int y, int width, int height) {
"""
Starts a series of drawing commands that are clipped to the specified rectangle (in view
coordinates, not OpenGL coordinates). Thus must be followed by a call to {@link #endClipped}
when the clipped drawing commands are done.
@return whet... | java | public boolean startClipped (int x, int y, int width, int height) {
batch.flush(); // flush any pending unclipped calls
Rectangle r = pushScissorState(x, target.flip() ? target.height()-y-height : y, width, height);
batch.gl.glScissor(r.x, r.y, r.width, r.height);
if (scissorDepth == 1) batch.gl.glEnabl... | [
"public",
"boolean",
"startClipped",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"batch",
".",
"flush",
"(",
")",
";",
"// flush any pending unclipped calls",
"Rectangle",
"r",
"=",
"pushScissorState",
"(",
"x",
"... | Starts a series of drawing commands that are clipped to the specified rectangle (in view
coordinates, not OpenGL coordinates). Thus must be followed by a call to {@link #endClipped}
when the clipped drawing commands are done.
@return whether the resulting clip rectangle is non-empty. <em>Note:</em> the caller may wish... | [
"Starts",
"a",
"series",
"of",
"drawing",
"commands",
"that",
"are",
"clipped",
"to",
"the",
"specified",
"rectangle",
"(",
"in",
"view",
"coordinates",
"not",
"OpenGL",
"coordinates",
")",
".",
"Thus",
"must",
"be",
"followed",
"by",
"a",
"call",
"to",
"{... | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Surface.java#L137-L144 |
ReactiveX/RxNetty | rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/server/HttpServer.java | HttpServer.newServer | public static HttpServer<ByteBuf, ByteBuf> newServer(int port, EventLoopGroup serverGroup,
EventLoopGroup clientGroup,
Class<? extends ServerChannel> channelClass) {
"""
Creates a new server using the ... | java | public static HttpServer<ByteBuf, ByteBuf> newServer(int port, EventLoopGroup serverGroup,
EventLoopGroup clientGroup,
Class<? extends ServerChannel> channelClass) {
return _newServer(TcpServer.newS... | [
"public",
"static",
"HttpServer",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"newServer",
"(",
"int",
"port",
",",
"EventLoopGroup",
"serverGroup",
",",
"EventLoopGroup",
"clientGroup",
",",
"Class",
"<",
"?",
"extends",
"ServerChannel",
">",
"channelClass",
")",
"{",... | Creates a new server using the passed port.
@param port Port for the server. {@code 0} to use ephemeral port.
@param serverGroup Eventloop group to be used for server sockets.
@param clientGroup Eventloop group to be used for client sockets.
@param channelClass The class to be used for server channel.
@return A new {... | [
"Creates",
"a",
"new",
"server",
"using",
"the",
"passed",
"port",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/server/HttpServer.java#L396-L400 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/upsert/AbstractUpsertPlugin.java | AbstractUpsertPlugin.buildSqlClause | protected XmlElement buildSqlClause(IntrospectedTable introspectedTable) {
"""
创建根据传入的Array数组进行判断的sql语句
@param introspectedTable The metadata for database table
@return generated xml element for check input array params
"""
XmlElement sql = new XmlElement("sql");
sql.addAttribute(new Attribute("id... | java | protected XmlElement buildSqlClause(IntrospectedTable introspectedTable) {
XmlElement sql = new XmlElement("sql");
sql.addAttribute(new Attribute("id", IDENTIFIERS_ARRAY_CONDITIONS));
XmlElement foreach = new XmlElement("foreach");
foreach.addAttribute(new Attribute("collection", "array"));
foreac... | [
"protected",
"XmlElement",
"buildSqlClause",
"(",
"IntrospectedTable",
"introspectedTable",
")",
"{",
"XmlElement",
"sql",
"=",
"new",
"XmlElement",
"(",
"\"sql\"",
")",
";",
"sql",
".",
"addAttribute",
"(",
"new",
"Attribute",
"(",
"\"id\"",
",",
"IDENTIFIERS_ARR... | 创建根据传入的Array数组进行判断的sql语句
@param introspectedTable The metadata for database table
@return generated xml element for check input array params | [
"创建根据传入的Array数组进行判断的sql语句"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/upsert/AbstractUpsertPlugin.java#L144-L175 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_resourceAccount_resourceEmailAddress_PUT | public void organizationName_service_exchangeService_resourceAccount_resourceEmailAddress_PUT(String organizationName, String exchangeService, String resourceEmailAddress, OvhResourceAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchang... | java | public void organizationName_service_exchangeService_resourceAccount_resourceEmailAddress_PUT(String organizationName, String exchangeService, String resourceEmailAddress, OvhResourceAccount body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/resourceAccount/{resour... | [
"public",
"void",
"organizationName_service_exchangeService_resourceAccount_resourceEmailAddress_PUT",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"resourceEmailAddress",
",",
"OvhResourceAccount",
"body",
")",
"throws",
"IOException",
"{",... | Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/resourceAccount/{resourceEmailAddress}
@param body [required] New object properties
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name ... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2486-L2490 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/SymmetricDifferenceMatcher.java | SymmetricDifferenceMatcher.unmap | public void unmap(Collection<I> items, T target) {
"""
Remove collection mappings to target
@param items
@param target
"""
for (I item : items)
{
unmap(item, target);
}
} | java | public void unmap(Collection<I> items, T target)
{
for (I item : items)
{
unmap(item, target);
}
} | [
"public",
"void",
"unmap",
"(",
"Collection",
"<",
"I",
">",
"items",
",",
"T",
"target",
")",
"{",
"for",
"(",
"I",
"item",
":",
"items",
")",
"{",
"unmap",
"(",
"item",
",",
"target",
")",
";",
"}",
"}"
] | Remove collection mappings to target
@param items
@param target | [
"Remove",
"collection",
"mappings",
"to",
"target"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/SymmetricDifferenceMatcher.java#L104-L110 |
seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java | AbstractI18nRestIT.httpGet | protected Response httpGet(String path, int statusCode) {
"""
Gets the resource at the path and expect the given status code.
@param path the resource URI
@return the http response
"""
return httpRequest(statusCode, null).get(baseURL + PATH_PREFIX + path);
} | java | protected Response httpGet(String path, int statusCode) {
return httpRequest(statusCode, null).get(baseURL + PATH_PREFIX + path);
} | [
"protected",
"Response",
"httpGet",
"(",
"String",
"path",
",",
"int",
"statusCode",
")",
"{",
"return",
"httpRequest",
"(",
"statusCode",
",",
"null",
")",
".",
"get",
"(",
"baseURL",
"+",
"PATH_PREFIX",
"+",
"path",
")",
";",
"}"
] | Gets the resource at the path and expect the given status code.
@param path the resource URI
@return the http response | [
"Gets",
"the",
"resource",
"at",
"the",
"path",
"and",
"expect",
"the",
"given",
"status",
"code",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java#L59-L61 |
motown-io/motown | ocpi/ocpi-identification-authorization-plugin/src/main/java/io/motown/ocpi/service/AuthorizationService.java | AuthorizationService.insertOrUpdateToken | private void insertOrUpdateToken(io.motown.ocpi.dto.Token tokenUpdate, Integer subscriptionId) {
"""
Inserts a token or updates it if an existing token is found with the same
uid and issuing-company
@param tokenUpdate
"""
Token token = ocpiRepository.findTokenByUidAndIssuingCompany(tokenUpdate.uid,... | java | private void insertOrUpdateToken(io.motown.ocpi.dto.Token tokenUpdate, Integer subscriptionId) {
Token token = ocpiRepository.findTokenByUidAndIssuingCompany(tokenUpdate.uid, tokenUpdate.issuer);
if (token == null) {
token = new Token();
token.setUid(tokenUpdate.uid);
... | [
"private",
"void",
"insertOrUpdateToken",
"(",
"io",
".",
"motown",
".",
"ocpi",
".",
"dto",
".",
"Token",
"tokenUpdate",
",",
"Integer",
"subscriptionId",
")",
"{",
"Token",
"token",
"=",
"ocpiRepository",
".",
"findTokenByUidAndIssuingCompany",
"(",
"tokenUpdate... | Inserts a token or updates it if an existing token is found with the same
uid and issuing-company
@param tokenUpdate | [
"Inserts",
"a",
"token",
"or",
"updates",
"it",
"if",
"an",
"existing",
"token",
"is",
"found",
"with",
"the",
"same",
"uid",
"and",
"issuing",
"-",
"company"
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpi/ocpi-identification-authorization-plugin/src/main/java/io/motown/ocpi/service/AuthorizationService.java#L127-L149 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassPathUtils.java | ClassPathUtils.toFullyQualifiedName | @GwtIncompatible("incompatible method")
public static String toFullyQualifiedName(final Package context, final String resourceName) {
"""
Returns the fully qualified name for the resource with name {@code resourceName} relative to the given context.
<p>Note that this method does not check whether the resour... | java | @GwtIncompatible("incompatible method")
public static String toFullyQualifiedName(final Package context, final String resourceName) {
Validate.notNull(context, "Parameter '%s' must not be null!", "context" );
Validate.notNull(resourceName, "Parameter '%s' must not be null!", "resourceName");
... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"String",
"toFullyQualifiedName",
"(",
"final",
"Package",
"context",
",",
"final",
"String",
"resourceName",
")",
"{",
"Validate",
".",
"notNull",
"(",
"context",
",",
"\"Parameter '%s... | Returns the fully qualified name for the resource with name {@code resourceName} relative to the given context.
<p>Note that this method does not check whether the resource actually exists.
It only constructs the name.
Null inputs are not allowed.</p>
<pre>
ClassPathUtils.toFullyQualifiedName(StringUtils.class.getPac... | [
"Returns",
"the",
"fully",
"qualified",
"name",
"for",
"the",
"resource",
"with",
"name",
"{",
"@code",
"resourceName",
"}",
"relative",
"to",
"the",
"given",
"context",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassPathUtils.java#L82-L87 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecValidator.java | ContentSpecValidator.validateContentSpec | public boolean validateContentSpec(final ContentSpec contentSpec, final String username) {
"""
Validates that a Content Specification is valid by checking the META data,
child levels and topics. This method is a
wrapper to first call PreValidate and then PostValidate.
@param contentSpec The content specificat... | java | public boolean validateContentSpec(final ContentSpec contentSpec, final String username) {
boolean valid = preValidateContentSpec(contentSpec);
if (!postValidateContentSpec(contentSpec, username)) {
valid = false;
}
return valid;
} | [
"public",
"boolean",
"validateContentSpec",
"(",
"final",
"ContentSpec",
"contentSpec",
",",
"final",
"String",
"username",
")",
"{",
"boolean",
"valid",
"=",
"preValidateContentSpec",
"(",
"contentSpec",
")",
";",
"if",
"(",
"!",
"postValidateContentSpec",
"(",
"... | Validates that a Content Specification is valid by checking the META data,
child levels and topics. This method is a
wrapper to first call PreValidate and then PostValidate.
@param contentSpec The content specification to be validated.
@param username The user who requested the content spec validation.
@return True... | [
"Validates",
"that",
"a",
"Content",
"Specification",
"is",
"valid",
"by",
"checking",
"the",
"META",
"data",
"child",
"levels",
"and",
"topics",
".",
"This",
"method",
"is",
"a",
"wrapper",
"to",
"first",
"call",
"PreValidate",
"and",
"then",
"PostValidate",
... | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecValidator.java#L179-L187 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/PropertyTypeNavigator.java | PropertyTypeNavigator.get | public static Object get(final Class<?> rootClass, final String property) {
"""
プロパティの値を取得する。
<p>オプションはデフォルト値で処理する。</p>
@param rootClass 取得元となるクラス
@param property プロパティの式。
@return プロパティのクラスタイプ。
@throws IllegalArgumentException peropety is null or empty.
@throws PropertyAccessException 存在しないプロパティを指定した場合など。
@... | java | public static Object get(final Class<?> rootClass, final String property) {
return new PropertyTypeNavigator().getPropertyType(rootClass, property);
} | [
"public",
"static",
"Object",
"get",
"(",
"final",
"Class",
"<",
"?",
">",
"rootClass",
",",
"final",
"String",
"property",
")",
"{",
"return",
"new",
"PropertyTypeNavigator",
"(",
")",
".",
"getPropertyType",
"(",
"rootClass",
",",
"property",
")",
";",
"... | プロパティの値を取得する。
<p>オプションはデフォルト値で処理する。</p>
@param rootClass 取得元となるクラス
@param property プロパティの式。
@return プロパティのクラスタイプ。
@throws IllegalArgumentException peropety is null or empty.
@throws PropertyAccessException 存在しないプロパティを指定した場合など。
@throws IllegalStateException リストやマップにアクセスする際にGenericsタイプが設定されておらずクラスタイプが取得できない場合。
ただし、オプションi... | [
"プロパティの値を取得する。",
"<p",
">",
"オプションはデフォルト値で処理する。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/PropertyTypeNavigator.java#L61-L63 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/subsystem/FeatureDefinitionUtils.java | FeatureDefinitionUtils.loadAttributes | static ImmutableAttributes loadAttributes(String repoType, File featureFile, ProvisioningDetails details) throws IOException {
"""
Create the ImmutableAttributes based on the contents read from a subsystem
manifest.
@param details ManifestDetails containing manifest parser and accessor methods
for retrieving ... | java | static ImmutableAttributes loadAttributes(String repoType, File featureFile, ProvisioningDetails details) throws IOException {
// This will throw exceptions if required attributes mismatch or are missing
details.ensureValid();
// retrieve the symbolic name and feature manifest version
... | [
"static",
"ImmutableAttributes",
"loadAttributes",
"(",
"String",
"repoType",
",",
"File",
"featureFile",
",",
"ProvisioningDetails",
"details",
")",
"throws",
"IOException",
"{",
"// This will throw exceptions if required attributes mismatch or are missing",
"details",
".",
"e... | Create the ImmutableAttributes based on the contents read from a subsystem
manifest.
@param details ManifestDetails containing manifest parser and accessor methods
for retrieving information from the manifest.
@return new ImmutableAttributes | [
"Create",
"the",
"ImmutableAttributes",
"based",
"on",
"the",
"contents",
"read",
"from",
"a",
"subsystem",
"manifest",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/subsystem/FeatureDefinitionUtils.java#L261-L318 |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/zdt/ZDT1.java | ZDT1.evalH | protected double evalH(double f, double g) {
"""
Returns the value of the ZDT1 function H.
@param f First argument of the function H.
@param g Second argument of the function H.
"""
double h ;
h = 1.0 - Math.sqrt(f / g);
return h;
} | java | protected double evalH(double f, double g) {
double h ;
h = 1.0 - Math.sqrt(f / g);
return h;
} | [
"protected",
"double",
"evalH",
"(",
"double",
"f",
",",
"double",
"g",
")",
"{",
"double",
"h",
";",
"h",
"=",
"1.0",
"-",
"Math",
".",
"sqrt",
"(",
"f",
"/",
"g",
")",
";",
"return",
"h",
";",
"}"
] | Returns the value of the ZDT1 function H.
@param f First argument of the function H.
@param g Second argument of the function H. | [
"Returns",
"the",
"value",
"of",
"the",
"ZDT1",
"function",
"H",
"."
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/zdt/ZDT1.java#L95-L99 |
alexa/alexa-skills-kit-sdk-for-java | ask-sdk-runtime/src/com/amazon/ask/response/template/loader/impl/ConcurrentLRUTemplateCache.java | ConcurrentLRUTemplateCache.put | @Override
synchronized public void put(String identifier, TemplateContentData templateContentData) {
"""
{@inheritDoc}
If template size is larger than total cache capacity, no caching.
If there's not enough capacity for new entry, remove eldest ones until have capacity to insert.
"""
if (!locks... | java | @Override
synchronized public void put(String identifier, TemplateContentData templateContentData) {
if (!locksMap.containsKey(identifier)) {
locksMap.put(identifier, new Object());
}
Object lock = locksMap.get(identifier);
synchronized (lock) {
int size = tem... | [
"@",
"Override",
"synchronized",
"public",
"void",
"put",
"(",
"String",
"identifier",
",",
"TemplateContentData",
"templateContentData",
")",
"{",
"if",
"(",
"!",
"locksMap",
".",
"containsKey",
"(",
"identifier",
")",
")",
"{",
"locksMap",
".",
"put",
"(",
... | {@inheritDoc}
If template size is larger than total cache capacity, no caching.
If there's not enough capacity for new entry, remove eldest ones until have capacity to insert. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/c49194da0693898c70f3f2c4a372f5a12da04e3e/ask-sdk-runtime/src/com/amazon/ask/response/template/loader/impl/ConcurrentLRUTemplateCache.java#L97-L126 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java | Levenshtein.jaroWinkler | @SuppressWarnings("unchecked")
public static <T extends Levenshtein> T jaroWinkler(String baseTarget, String compareTarget) {
"""
Returns a new Jaro-Winkler similarity instance with compare target string
@see JaroWinkler
@param baseTarget
@param compareTarget
@return
"""
return (T) new JaroWinkler(bas... | java | @SuppressWarnings("unchecked")
public static <T extends Levenshtein> T jaroWinkler(String baseTarget, String compareTarget) {
return (T) new JaroWinkler(baseTarget).update(compareTarget);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Levenshtein",
">",
"T",
"jaroWinkler",
"(",
"String",
"baseTarget",
",",
"String",
"compareTarget",
")",
"{",
"return",
"(",
"T",
")",
"new",
"JaroWinkler",
"(",
"b... | Returns a new Jaro-Winkler similarity instance with compare target string
@see JaroWinkler
@param baseTarget
@param compareTarget
@return | [
"Returns",
"a",
"new",
"Jaro",
"-",
"Winkler",
"similarity",
"instance",
"with",
"compare",
"target",
"string"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java#L136-L139 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java | SeaGlassSynthPainterImpl.paintSearchButtonForeground | public void paintSearchButtonForeground(SynthContext context, Graphics g, int x, int y, int w, int h) {
"""
Paints the foreground of a search field button. This method is
responsible for drawing a graphical representation of a find or cancel
button.
@param context SynthContext identifying the <code>JComponent... | java | public void paintSearchButtonForeground(SynthContext context, Graphics g, int x, int y, int w, int h) {
paintForeground(context, g, x, y, w, h, null);
} | [
"public",
"void",
"paintSearchButtonForeground",
"(",
"SynthContext",
"context",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"paintForeground",
"(",
"context",
",",
"g",
",",
"x",
",",
"y",
",",
... | Paints the foreground of a search field button. This method is
responsible for drawing a graphical representation of a find or cancel
button.
@param context SynthContext identifying the <code>JComponent</code> and
<code>Region</code> to paint to
@param g <code>Graphics</code> to paint to
@param x X coordin... | [
"Paints",
"the",
"foreground",
"of",
"a",
"search",
"field",
"button",
".",
"This",
"method",
"is",
"responsible",
"for",
"drawing",
"a",
"graphical",
"representation",
"of",
"a",
"find",
"or",
"cancel",
"button",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L450-L452 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.checkBetween | public static Number checkBetween(Number value, Number min, Number max) {
"""
检查值是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@return 检查后的长度值
@since 4.1.10
"""
notNull(value);
notNull(min);
notNull(max);
double valueDouble = value.doubleValue();
double minDouble = min.dou... | java | public static Number checkBetween(Number value, Number min, Number max) {
notNull(value);
notNull(min);
notNull(max);
double valueDouble = value.doubleValue();
double minDouble = min.doubleValue();
double maxDouble = max.doubleValue();
if (valueDouble < minDouble || valueDouble > maxDouble) {
t... | [
"public",
"static",
"Number",
"checkBetween",
"(",
"Number",
"value",
",",
"Number",
"min",
",",
"Number",
"max",
")",
"{",
"notNull",
"(",
"value",
")",
";",
"notNull",
"(",
"min",
")",
";",
"notNull",
"(",
"max",
")",
";",
"double",
"valueDouble",
"=... | 检查值是否在指定范围内
@param value 值
@param min 最小值(包含)
@param max 最大值(包含)
@return 检查后的长度值
@since 4.1.10 | [
"检查值是否在指定范围内"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L622-L633 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java | JmsMessageImpl.newBadConvertException | static MessageFormatException newBadConvertException(Object obj, String propName, String dType, TraceComponent xtc) {
"""
This method puts together the message to be returned to the user when they
attempt an invalid property conversion - for example trying to read an Int
property as a Byte.
It attempts to resol... | java | static MessageFormatException newBadConvertException(Object obj, String propName, String dType, TraceComponent xtc) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "newBadConvertException", new Object[] { obj, propName, dType, xtc });
// We expect the obje... | [
"static",
"MessageFormatException",
"newBadConvertException",
"(",
"Object",
"obj",
",",
"String",
"propName",
",",
"String",
"dType",
",",
"TraceComponent",
"xtc",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"is... | This method puts together the message to be returned to the user when they
attempt an invalid property conversion - for example trying to read an Int
property as a Byte.
It attempts to resolve the problem of integrating with the Bhattal Exception Handling Utility (tm)
@param obj The object containing the actual proper... | [
"This",
"method",
"puts",
"together",
"the",
"message",
"to",
"be",
"returned",
"to",
"the",
"user",
"when",
"they",
"attempt",
"an",
"invalid",
"property",
"conversion",
"-",
"for",
"example",
"trying",
"to",
"read",
"an",
"Int",
"property",
"as",
"a",
"B... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsMessageImpl.java#L2104-L2119 |
drinkjava2/jDialects | core/src/main/java/com/github/drinkjava2/jdialects/ReservedDBWords.java | ReservedDBWords.isReservedWord | public static boolean isReservedWord(Dialect dialect, String word) {
"""
Check if is a dialect reserved word of ANSI-SQL reserved word
@return false:not reserved word. true:reserved by dialect or ANSI-SQL
"""
if (!isReservedWord(word))
return false;
String fitDatabases = RESERVED_WORDS.get(word.toUpp... | java | public static boolean isReservedWord(Dialect dialect, String word) {
if (!isReservedWord(word))
return false;
String fitDatabases = RESERVED_WORDS.get(word.toUpperCase()).toUpperCase();
if (fitDatabases.contains("ANSI"))
return true;
String dia = dialect.toString().replace("Dialect", "").toUpperCase();
... | [
"public",
"static",
"boolean",
"isReservedWord",
"(",
"Dialect",
"dialect",
",",
"String",
"word",
")",
"{",
"if",
"(",
"!",
"isReservedWord",
"(",
"word",
")",
")",
"return",
"false",
";",
"String",
"fitDatabases",
"=",
"RESERVED_WORDS",
".",
"get",
"(",
... | Check if is a dialect reserved word of ANSI-SQL reserved word
@return false:not reserved word. true:reserved by dialect or ANSI-SQL | [
"Check",
"if",
"is",
"a",
"dialect",
"reserved",
"word",
"of",
"ANSI",
"-",
"SQL",
"reserved",
"word"
] | train | https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/ReservedDBWords.java#L306-L316 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.handleRemoteCriteria | public boolean handleRemoteCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) {
"""
Check to see if this record should be skipped.
@param strFilter The current SQL WHERE string.
@param bIncludeFileName Include the Filename.fieldName in the string.
@param vParamList The list... | java | public boolean handleRemoteCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{
BaseListener nextListener = this.getNextEnabledListener();
if (nextListener != null)
return ((FileListener)nextListener).doRemoteCriteria(strFilter, bIncludeFileName, vP... | [
"public",
"boolean",
"handleRemoteCriteria",
"(",
"StringBuffer",
"strFilter",
",",
"boolean",
"bIncludeFileName",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"BaseListener",
"nextListener",
"=",
"this",
".",
"getNextEnabledListener",
"(",
")",
";"... | Check to see if this record should be skipped.
@param strFilter The current SQL WHERE string.
@param bIncludeFileName Include the Filename.fieldName in the string.
@param vParamList The list of params.
@return true if the criteria passes.
@return false if the criteria fails, and returns without checking further. | [
"Check",
"to",
"see",
"if",
"this",
"record",
"should",
"be",
"skipped",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1680-L1687 |
jenkinsci/jenkins | core/src/main/java/hudson/search/Search.java | Search.findClosestSuggestedItem | static SuggestedItem findClosestSuggestedItem(List<SuggestedItem> r, String query) {
"""
When there are multiple suggested items, this method can narrow down the resultset
to the SuggestedItem that has a url that contains the query. This is useful is one
job has a display name that matches another job's project ... | java | static SuggestedItem findClosestSuggestedItem(List<SuggestedItem> r, String query) {
for(SuggestedItem curItem : r) {
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(String.format("item's searchUrl:%s;query=%s", curItem.item.getSearchUrl(), query));
}
if(curIt... | [
"static",
"SuggestedItem",
"findClosestSuggestedItem",
"(",
"List",
"<",
"SuggestedItem",
">",
"r",
",",
"String",
"query",
")",
"{",
"for",
"(",
"SuggestedItem",
"curItem",
":",
"r",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isLoggable",
"(",
"Level",
".",
"FI... | When there are multiple suggested items, this method can narrow down the resultset
to the SuggestedItem that has a url that contains the query. This is useful is one
job has a display name that matches another job's project name.
@param r A list of Suggested items. It is assumed that there is at least one
SuggestedItem... | [
"When",
"there",
"are",
"multiple",
"suggested",
"items",
"this",
"method",
"can",
"narrow",
"down",
"the",
"resultset",
"to",
"the",
"SuggestedItem",
"that",
"has",
"a",
"url",
"that",
"contains",
"the",
"query",
".",
"This",
"is",
"useful",
"is",
"one",
... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L237-L250 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java | PathBuilder.get | public StringPath get(StringPath path) {
"""
Create a new String typed path
@param path existing path
@return property path
"""
StringPath newPath = getString(toString(path));
return addMetadataOf(newPath, path);
} | java | public StringPath get(StringPath path) {
StringPath newPath = getString(toString(path));
return addMetadataOf(newPath, path);
} | [
"public",
"StringPath",
"get",
"(",
"StringPath",
"path",
")",
"{",
"StringPath",
"newPath",
"=",
"getString",
"(",
"toString",
"(",
"path",
")",
")",
";",
"return",
"addMetadataOf",
"(",
"newPath",
",",
"path",
")",
";",
"}"
] | Create a new String typed path
@param path existing path
@return property path | [
"Create",
"a",
"new",
"String",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java#L478-L481 |
pvanassen/ns-api | src/main/java/nl/pvanassen/ns/NsApi.java | NsApi.getApiResponse | public <T extends NsResult> T getApiResponse(ApiRequest<T> request) throws NsApiException {
"""
Method that makes a call to the NS. The request parameter defines what data to pull. The serialized data of the
request is returned, or an exception is thrown. For all request types, see <a href="http://www.ns.nl/api/a... | java | public <T extends NsResult> T getApiResponse(ApiRequest<T> request) throws NsApiException {
try (InputStream stream = httpConnection
.getContent(NsApi.BASE_URL + request.getPath() + "?" + request.getRequestString())){
@SuppressWarnings("unchecked")
Handle<T> handle = ... | [
"public",
"<",
"T",
"extends",
"NsResult",
">",
"T",
"getApiResponse",
"(",
"ApiRequest",
"<",
"T",
">",
"request",
")",
"throws",
"NsApiException",
"{",
"try",
"(",
"InputStream",
"stream",
"=",
"httpConnection",
".",
"getContent",
"(",
"NsApi",
".",
"BASE_... | Method that makes a call to the NS. The request parameter defines what data to pull. The serialized data of the
request is returned, or an exception is thrown. For all request types, see <a href="http://www.ns.nl/api/api">NS
API</a> and {@link nl.pvanassen.ns.RequestBuilder}
@see nl.pvanassen.ns.RequestBuilder
@param ... | [
"Method",
"that",
"makes",
"a",
"call",
"to",
"the",
"NS",
".",
"The",
"request",
"parameter",
"defines",
"what",
"data",
"to",
"pull",
".",
"The",
"serialized",
"data",
"of",
"the",
"request",
"is",
"returned",
"or",
"an",
"exception",
"is",
"thrown",
"... | train | https://github.com/pvanassen/ns-api/blob/e90e01028a0eb24006e4fddd4c85e7a25c4fe0ae/src/main/java/nl/pvanassen/ns/NsApi.java#L67-L80 |
leancloud/java-sdk-all | android-sdk/storage-android/src/main/java/cn/leancloud/AVManifestUtils.java | AVManifestUtils.checkReceiver | public static boolean checkReceiver(Context context, Class<?> receiver) {
"""
判断 Mainifest 中是否包含对应到 Receiver
如有,则返回 true,反之,则返回 false 并输出日志
@param context
@param receiver
@return
"""
try {
ActivityInfo info = context.getPackageManager().getReceiverInfo(
new ComponentName(context, rece... | java | public static boolean checkReceiver(Context context, Class<?> receiver) {
try {
ActivityInfo info = context.getPackageManager().getReceiverInfo(
new ComponentName(context, receiver), 0);
return null != info;
} catch (PackageManager.NameNotFoundException e) {
printErrorLog("receiver "... | [
"public",
"static",
"boolean",
"checkReceiver",
"(",
"Context",
"context",
",",
"Class",
"<",
"?",
">",
"receiver",
")",
"{",
"try",
"{",
"ActivityInfo",
"info",
"=",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getReceiverInfo",
"(",
"new",
"Compone... | 判断 Mainifest 中是否包含对应到 Receiver
如有,则返回 true,反之,则返回 false 并输出日志
@param context
@param receiver
@return | [
"判断",
"Mainifest",
"中是否包含对应到",
"Receiver",
"如有,则返回",
"true,反之,则返回",
"false",
"并输出日志"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/storage-android/src/main/java/cn/leancloud/AVManifestUtils.java#L64-L73 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/XMLResourceBundle.java | XMLResourceBundle.get | public String get(final String aMessage, final File aFile) {
"""
Returns the string form of the requested message with the file value integrated into it.
@param aMessage A message key to use to return a message value
@param aFile A file whose name should be integrated into the message value
@return The messag... | java | public String get(final String aMessage, final File aFile) {
return StringUtils.format(super.getString(aMessage), new String[] { aFile.getAbsolutePath() });
} | [
"public",
"String",
"get",
"(",
"final",
"String",
"aMessage",
",",
"final",
"File",
"aFile",
")",
"{",
"return",
"StringUtils",
".",
"format",
"(",
"super",
".",
"getString",
"(",
"aMessage",
")",
",",
"new",
"String",
"[",
"]",
"{",
"aFile",
".",
"ge... | Returns the string form of the requested message with the file value integrated into it.
@param aMessage A message key to use to return a message value
@param aFile A file whose name should be integrated into the message value
@return The message value with the supplied file name integrated | [
"Returns",
"the",
"string",
"form",
"of",
"the",
"requested",
"message",
"with",
"the",
"file",
"value",
"integrated",
"into",
"it",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/XMLResourceBundle.java#L141-L143 |
asciidoctor/asciidoctor-maven-plugin | src/main/java/org/asciidoctor/maven/io/AsciidoctorFileScanner.java | AsciidoctorFileScanner.setupScanner | private void setupScanner(Scanner scanner, Resource resource) {
"""
Initializes the Scanner with the default values.
<br>
By default:
<ul>
<li>includes adds extension .adoc, .ad, .asc and .asciidoc
<li>excludes adds filters to avoid hidden files and directoris beginning with undersore
</ul>
NOTE: Patterns... | java | private void setupScanner(Scanner scanner, Resource resource) {
if (resource.getIncludes() == null || resource.getIncludes().isEmpty()) {
scanner.setIncludes(DEFAULT_FILE_EXTENSIONS);
} else {
scanner.setIncludes(resource.getIncludes().toArray(new String[] {}));
}
... | [
"private",
"void",
"setupScanner",
"(",
"Scanner",
"scanner",
",",
"Resource",
"resource",
")",
"{",
"if",
"(",
"resource",
".",
"getIncludes",
"(",
")",
"==",
"null",
"||",
"resource",
".",
"getIncludes",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Initializes the Scanner with the default values.
<br>
By default:
<ul>
<li>includes adds extension .adoc, .ad, .asc and .asciidoc
<li>excludes adds filters to avoid hidden files and directoris beginning with undersore
</ul>
NOTE: Patterns both in inclusions and exclusions are automatically excluded. | [
"Initializes",
"the",
"Scanner",
"with",
"the",
"default",
"values",
".",
"<br",
">",
"By",
"default",
":",
"<ul",
">",
"<li",
">",
"includes",
"adds",
"extension",
".",
"adoc",
".",
"ad",
".",
"asc",
"and",
".",
"asciidoc",
"<li",
">",
"excludes",
"ad... | train | https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/880938df1c638aaabedb3c944cd3e0ea1844109e/src/main/java/org/asciidoctor/maven/io/AsciidoctorFileScanner.java#L85-L100 |
googleads/googleads-java-lib | examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/AddResponsiveDisplayAd.java | AddResponsiveDisplayAd.uploadImage | private static long uploadImage(MediaServiceInterface mediaService, String url)
throws IOException {
"""
Uploads the image from the specified {@code url} via {@code MediaService}.
@return the {@code mediaId} of the uploaded image.
"""
// Create image.
Image image = new Image();
image.setTy... | java | private static long uploadImage(MediaServiceInterface mediaService, String url)
throws IOException {
// Create image.
Image image = new Image();
image.setType(MediaMediaType.IMAGE);
image.setData(com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl(url));
// Upload image.
Image u... | [
"private",
"static",
"long",
"uploadImage",
"(",
"MediaServiceInterface",
"mediaService",
",",
"String",
"url",
")",
"throws",
"IOException",
"{",
"// Create image.",
"Image",
"image",
"=",
"new",
"Image",
"(",
")",
";",
"image",
".",
"setType",
"(",
"MediaMedia... | Uploads the image from the specified {@code url} via {@code MediaService}.
@return the {@code mediaId} of the uploaded image. | [
"Uploads",
"the",
"image",
"from",
"the",
"specified",
"{",
"@code",
"url",
"}",
"via",
"{",
"@code",
"MediaService",
"}",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/AddResponsiveDisplayAd.java#L241-L251 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/protocol/SyntaxElement.java | SyntaxElement.extractValues | public void extractValues(HashMap<String, String> values) {
"""
fuellt die hashtable 'values' mit den werten der de-syntaxelemente; dazu
wird in allen anderen typen von syntaxelementen die liste der
child-elemente durchlaufen und deren 'fillValues' methode aufgerufen
"""
for (MultipleSyntaxElements l... | java | public void extractValues(HashMap<String, String> values) {
for (MultipleSyntaxElements l : childContainers) {
l.extractValues(values);
}
} | [
"public",
"void",
"extractValues",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"values",
")",
"{",
"for",
"(",
"MultipleSyntaxElements",
"l",
":",
"childContainers",
")",
"{",
"l",
".",
"extractValues",
"(",
"values",
")",
";",
"}",
"}"
] | fuellt die hashtable 'values' mit den werten der de-syntaxelemente; dazu
wird in allen anderen typen von syntaxelementen die liste der
child-elemente durchlaufen und deren 'fillValues' methode aufgerufen | [
"fuellt",
"die",
"hashtable",
"values",
"mit",
"den",
"werten",
"der",
"de",
"-",
"syntaxelemente",
";",
"dazu",
"wird",
"in",
"allen",
"anderen",
"typen",
"von",
"syntaxelementen",
"die",
"liste",
"der",
"child",
"-",
"elemente",
"durchlaufen",
"und",
"deren"... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/SyntaxElement.java#L443-L447 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java | NativeQuery.withResultSetAsyncListener | public NativeQuery withResultSetAsyncListener(Function<ResultSet, ResultSet> resultSetAsyncListener) {
"""
Add the given async listener on the {@link com.datastax.driver.core.ResultSet} object.
Example of usage:
<pre class="code"><code class="java">
.withResultSetAsyncListener(resultSet -> {
//Do something w... | java | public NativeQuery withResultSetAsyncListener(Function<ResultSet, ResultSet> resultSetAsyncListener) {
this.options.setResultSetAsyncListeners(Optional.of(asList(resultSetAsyncListener)));
return this;
} | [
"public",
"NativeQuery",
"withResultSetAsyncListener",
"(",
"Function",
"<",
"ResultSet",
",",
"ResultSet",
">",
"resultSetAsyncListener",
")",
"{",
"this",
".",
"options",
".",
"setResultSetAsyncListeners",
"(",
"Optional",
".",
"of",
"(",
"asList",
"(",
"resultSet... | Add the given async listener on the {@link com.datastax.driver.core.ResultSet} object.
Example of usage:
<pre class="code"><code class="java">
.withResultSetAsyncListener(resultSet -> {
//Do something with the resultSet object here
})
</code></pre>
Remark: <strong>it is not allowed to consume the ResultSet values. I... | [
"Add",
"the",
"given",
"async",
"listener",
"on",
"the",
"{",
"@link",
"com",
".",
"datastax",
".",
"driver",
".",
"core",
".",
"ResultSet",
"}",
"object",
".",
"Example",
"of",
"usage",
":",
"<pre",
"class",
"=",
"code",
">",
"<code",
"class",
"=",
... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java#L144-L147 |
ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/commandclass/ZWaveMultiInstanceCommandClass.java | ZWaveMultiInstanceCommandClass.getMultiChannelEncapMessage | public SerialMessage getMultiChannelEncapMessage(SerialMessage serialMessage, ZWaveEndpoint endpoint) {
"""
Gets a SerialMessage with the MULTI INSTANCE ENCAP command.
Encapsulates a message for a specific instance.
@param serialMessage the serial message to encapsulate
@param endpoint the endpoint to encapsula... | java | public SerialMessage getMultiChannelEncapMessage(SerialMessage serialMessage, ZWaveEndpoint endpoint) {
logger.debug("Creating new message for application command MULTI_CHANNEL_ENCAP for node {} and endpoint {}", this.getNode().getNodeId(), endpoint.getEndpointId());
byte[] payload = serialMessage.getMessageP... | [
"public",
"SerialMessage",
"getMultiChannelEncapMessage",
"(",
"SerialMessage",
"serialMessage",
",",
"ZWaveEndpoint",
"endpoint",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Creating new message for application command MULTI_CHANNEL_ENCAP for node {} and endpoint {}\"",
",",
"this",... | Gets a SerialMessage with the MULTI INSTANCE ENCAP command.
Encapsulates a message for a specific instance.
@param serialMessage the serial message to encapsulate
@param endpoint the endpoint to encapsulate the message for.
@return the encapsulated serial message. | [
"Gets",
"a",
"SerialMessage",
"with",
"the",
"MULTI",
"INSTANCE",
"ENCAP",
"command",
".",
"Encapsulates",
"a",
"message",
"for",
"a",
"specific",
"instance",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/commandclass/ZWaveMultiInstanceCommandClass.java#L514-L529 |
SonarOpenCommunity/sonar-cxx | cxx-lint/src/main/java/org/sonar/cxx/cxxlint/CxxLint.java | CxxLint.changeAnnotationValue | @SuppressWarnings("unchecked")
public static Object changeAnnotationValue(Annotation annotation, String key, Object newValue) {
"""
Changes the annotation value for the given key of the given annotation to newValue and returns the previous value.
from: http://stackoverflow.com/questions/14268981/modify-a-class-... | java | @SuppressWarnings("unchecked")
public static Object changeAnnotationValue(Annotation annotation, String key, Object newValue) {
Object handler = Proxy.getInvocationHandler(annotation);
Field f;
try {
f = handler.getClass().getDeclaredField("memberValues");
} catch (NoSuchFieldException | Securit... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Object",
"changeAnnotationValue",
"(",
"Annotation",
"annotation",
",",
"String",
"key",
",",
"Object",
"newValue",
")",
"{",
"Object",
"handler",
"=",
"Proxy",
".",
"getInvocationHandler",
"... | Changes the annotation value for the given key of the given annotation to newValue and returns the previous value.
from: http://stackoverflow.com/questions/14268981/modify-a-class-definitions-annotation-string-parameter-at-runtime
@return updated or old value
@param annotation
@param key
@param newValue | [
"Changes",
"the",
"annotation",
"value",
"for",
"the",
"given",
"key",
"of",
"the",
"given",
"annotation",
"to",
"newValue",
"and",
"returns",
"the",
"previous",
"value",
".",
"from",
":",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"... | train | https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-lint/src/main/java/org/sonar/cxx/cxxlint/CxxLint.java#L243-L265 |
elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/split/AngTanLinearSplit.java | AngTanLinearSplit.computeOverlap | protected <E extends SpatialComparable, A> double computeOverlap(A entries, ArrayAdapter<E, A> getter, long[] assign) {
"""
Compute overlap of assignment
@param entries Entries
@param getter Entry accessor
@param assign Assignment
@return Overlap amount
"""
ModifiableHyperBoundingBox mbr1 = null, mbr... | java | protected <E extends SpatialComparable, A> double computeOverlap(A entries, ArrayAdapter<E, A> getter, long[] assign) {
ModifiableHyperBoundingBox mbr1 = null, mbr2 = null;
for(int i = 0; i < getter.size(entries); i++) {
E e = getter.get(entries, i);
if(BitsUtil.get(assign, i)) {
if(mbr1 == ... | [
"protected",
"<",
"E",
"extends",
"SpatialComparable",
",",
"A",
">",
"double",
"computeOverlap",
"(",
"A",
"entries",
",",
"ArrayAdapter",
"<",
"E",
",",
"A",
">",
"getter",
",",
"long",
"[",
"]",
"assign",
")",
"{",
"ModifiableHyperBoundingBox",
"mbr1",
... | Compute overlap of assignment
@param entries Entries
@param getter Entry accessor
@param assign Assignment
@return Overlap amount | [
"Compute",
"overlap",
"of",
"assignment"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/split/AngTanLinearSplit.java#L150-L175 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withInt | public Postcard withInt(@Nullable String key, int value) {
"""
Inserts an int value into the mapping of this Bundle, replacing
any existing value for the given key.
@param key a String, or null
@param value an int
@return current
"""
mBundle.putInt(key, value);
return this;
} | java | public Postcard withInt(@Nullable String key, int value) {
mBundle.putInt(key, value);
return this;
} | [
"public",
"Postcard",
"withInt",
"(",
"@",
"Nullable",
"String",
"key",
",",
"int",
"value",
")",
"{",
"mBundle",
".",
"putInt",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an int value into the mapping of this Bundle, replacing
any existing value for the given key.
@param key a String, or null
@param value an int
@return current | [
"Inserts",
"an",
"int",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L283-L286 |
overturetool/overture | core/codegen/codegen-runtime/src/main/java/org/overture/codegen/runtime/StaticSentinel.java | StaticSentinel.activating | private synchronized static void activating(String classname, int fn) {
"""
The method that actually changing the #act and #active history counters.
"""
m.put(classname, StaticOperationsCounters.act[fn]++);
m.put(classname, StaticOperationsCounters.active[fn]++);
stateChanged();
} | java | private synchronized static void activating(String classname, int fn)
{
m.put(classname, StaticOperationsCounters.act[fn]++);
m.put(classname, StaticOperationsCounters.active[fn]++);
stateChanged();
} | [
"private",
"synchronized",
"static",
"void",
"activating",
"(",
"String",
"classname",
",",
"int",
"fn",
")",
"{",
"m",
".",
"put",
"(",
"classname",
",",
"StaticOperationsCounters",
".",
"act",
"[",
"fn",
"]",
"++",
")",
";",
"m",
".",
"put",
"(",
"cl... | The method that actually changing the #act and #active history counters. | [
"The",
"method",
"that",
"actually",
"changing",
"the",
"#act",
"and",
"#active",
"history",
"counters",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/codegen/codegen-runtime/src/main/java/org/overture/codegen/runtime/StaticSentinel.java#L64-L69 |
jenkinsci/pipeline-maven-plugin | jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java | WithMavenStepExecution2.setupMavenLocalRepo | @Nullable
private String setupMavenLocalRepo() throws IOException, InterruptedException {
"""
Sets the maven repo location according to the provided parameter on the agent
@return path on the build agent to the repo or {@code null} if not defined
@throws InterruptedException when processing remote calls
... | java | @Nullable
private String setupMavenLocalRepo() throws IOException, InterruptedException {
String expandedMavenLocalRepo;
if (StringUtils.isEmpty(step.getMavenLocalRepo())) {
expandedMavenLocalRepo = null;
} else {
// resolve relative/absolute with workspace as b... | [
"@",
"Nullable",
"private",
"String",
"setupMavenLocalRepo",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"String",
"expandedMavenLocalRepo",
";",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"step",
".",
"getMavenLocalRepo",
"(",
")",
")... | Sets the maven repo location according to the provided parameter on the agent
@return path on the build agent to the repo or {@code null} if not defined
@throws InterruptedException when processing remote calls
@throws IOException when reading files | [
"Sets",
"the",
"maven",
"repo",
"location",
"according",
"to",
"the",
"provided",
"parameter",
"on",
"the",
"agent"
] | train | https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L653-L671 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java | DbEntityManager.updatePreserveOrder | public void updatePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) {
"""
Several update operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to.
They will though be executed after all "not-bulk" operatio... | java | public void updatePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter) {
performBulkOperationPreserveOrder(entityType, statement, parameter, UPDATE_BULK);
} | [
"public",
"void",
"updatePreserveOrder",
"(",
"Class",
"<",
"?",
"extends",
"DbEntity",
">",
"entityType",
",",
"String",
"statement",
",",
"Object",
"parameter",
")",
"{",
"performBulkOperationPreserveOrder",
"(",
"entityType",
",",
"statement",
",",
"parameter",
... | Several update operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to.
They will though be executed after all "not-bulk" operations (e.g. {@link DbEntityManager#insert(DbEntity)} or {@link DbEntityManager#merge(DbEntity)})
and after those updates ... | [
"Several",
"update",
"operations",
"added",
"by",
"this",
"method",
"will",
"be",
"executed",
"preserving",
"the",
"order",
"of",
"method",
"calls",
"no",
"matter",
"what",
"entity",
"type",
"they",
"refer",
"to",
".",
"They",
"will",
"though",
"be",
"execut... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/DbEntityManager.java#L620-L622 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java | NameUtils.getClassName | public static String getClassName(String logicalName, String trailingName) {
"""
Returns the class name for the given logical name and trailing name. For example "person" and "Controller" would evaluate to "PersonController".
@param logicalName The logical name
@param trailingName The trailing name
@return T... | java | public static String getClassName(String logicalName, String trailingName) {
if (isBlank(logicalName)) {
throw new IllegalArgumentException("Argument [logicalName] cannot be null or blank");
}
String className = logicalName.substring(0, 1).toUpperCase(Locale.ENGLISH) + logicalName.s... | [
"public",
"static",
"String",
"getClassName",
"(",
"String",
"logicalName",
",",
"String",
"trailingName",
")",
"{",
"if",
"(",
"isBlank",
"(",
"logicalName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument [logicalName] cannot be null or b... | Returns the class name for the given logical name and trailing name. For example "person" and "Controller" would evaluate to "PersonController".
@param logicalName The logical name
@param trailingName The trailing name
@return The class name | [
"Returns",
"the",
"class",
"name",
"for",
"the",
"given",
"logical",
"name",
"and",
"trailing",
"name",
".",
"For",
"example",
"person",
"and",
"Controller",
"would",
"evaluate",
"to",
"PersonController",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/util/NameUtils.java#L92-L102 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_vm_vmId_backupJob_enable_POST | public OvhTask serviceName_datacenter_datacenterId_vm_vmId_backupJob_enable_POST(String serviceName, Long datacenterId, Long vmId, OvhBackupDaysEnum[] backupDays) throws IOException {
"""
Enable backup solution on this virtual Machine
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/... | java | public OvhTask serviceName_datacenter_datacenterId_vm_vmId_backupJob_enable_POST(String serviceName, Long datacenterId, Long vmId, OvhBackupDaysEnum[] backupDays) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob/enable";
StringBuilder sb = path(qPath, ... | [
"public",
"OvhTask",
"serviceName_datacenter_datacenterId_vm_vmId_backupJob_enable_POST",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"vmId",
",",
"OvhBackupDaysEnum",
"[",
"]",
"backupDays",
")",
"throws",
"IOException",
"{",
"String",
"qPath"... | Enable backup solution on this virtual Machine
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob/enable
@param backupDays [required] Backup offer type
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param vmId [required] Id of the virtual machine... | [
"Enable",
"backup",
"solution",
"on",
"this",
"virtual",
"Machine"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2111-L2118 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java | CommerceSubscriptionEntryPersistenceImpl.findByGroupId | @Override
public List<CommerceSubscriptionEntry> findByGroupId(long groupId) {
"""
Returns all the commerce subscription entries where groupId = ?.
@param groupId the group ID
@return the matching commerce subscription entries
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, n... | java | @Override
public List<CommerceSubscriptionEntry> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceSubscriptionEntry",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
... | Returns all the commerce subscription entries where groupId = ?.
@param groupId the group ID
@return the matching commerce subscription entries | [
"Returns",
"all",
"the",
"commerce",
"subscription",
"entries",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L1536-L1539 |
gallandarakhneorg/afc | advanced/bootique/bootique-synopsishelp/src/main/java/org/arakhne/afc/bootique/synopsishelp/modules/SynopsisHelpGeneratorModule.java | SynopsisHelpGeneratorModule.provideHelpGenerator | @SuppressWarnings("static-method")
@Provides
@Singleton
public HelpGenerator provideHelpGenerator(
ApplicationMetadata metadata, Injector injector, Terminal terminal) {
"""
Provide the help generator with synopsis.
@param metadata the application metadata.
@param injector the injector.
@param terminal t... | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public HelpGenerator provideHelpGenerator(
ApplicationMetadata metadata, Injector injector, Terminal terminal) {
int maxColumns = terminal.getColumns();
if (maxColumns < TTY_MIN_COLUMNS) {
maxColumns = TTY_DEFAULT_COLUMNS;
}
String argumentSynopsi... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"HelpGenerator",
"provideHelpGenerator",
"(",
"ApplicationMetadata",
"metadata",
",",
"Injector",
"injector",
",",
"Terminal",
"terminal",
")",
"{",
"int",
"maxColumns... | Provide the help generator with synopsis.
@param metadata the application metadata.
@param injector the injector.
@param terminal the terminal description.
@return the help generator. | [
"Provide",
"the",
"help",
"generator",
"with",
"synopsis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-synopsishelp/src/main/java/org/arakhne/afc/bootique/synopsishelp/modules/SynopsisHelpGeneratorModule.java#L62-L84 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/DBClosure.java | DBClosure.sudo | public static <R> R sudo(Function<ODatabaseDocument, R> func) {
"""
Simplified function to execute under admin
@param func function to be executed
@param <R> type of returned value
@return result of a function
"""
return new DBClosure<R>() {
@Override
protected R execute(ODatabaseDocument db) {
... | java | public static <R> R sudo(Function<ODatabaseDocument, R> func) {
return new DBClosure<R>() {
@Override
protected R execute(ODatabaseDocument db) {
return func.apply(db);
}
}.execute();
} | [
"public",
"static",
"<",
"R",
">",
"R",
"sudo",
"(",
"Function",
"<",
"ODatabaseDocument",
",",
"R",
">",
"func",
")",
"{",
"return",
"new",
"DBClosure",
"<",
"R",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"R",
"execute",
"(",
"ODatabaseDocumen... | Simplified function to execute under admin
@param func function to be executed
@param <R> type of returned value
@return result of a function | [
"Simplified",
"function",
"to",
"execute",
"under",
"admin"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/DBClosure.java#L97-L104 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.feed_publishActionOfUser | public boolean feed_publishActionOfUser(CharSequence title, CharSequence body,
Collection<IFeedImage> images)
throws FacebookException, IOException {
"""
Publish the notification of an action taken by a user to newsfeed.
@param title the title of the feed story (up to... | java | public boolean feed_publishActionOfUser(CharSequence title, CharSequence body,
Collection<IFeedImage> images)
throws FacebookException, IOException {
return feedHandler(FacebookMethod.FEED_PUBLISH_ACTION_OF_USER, title, body, images, null);
} | [
"public",
"boolean",
"feed_publishActionOfUser",
"(",
"CharSequence",
"title",
",",
"CharSequence",
"body",
",",
"Collection",
"<",
"IFeedImage",
">",
"images",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"feedHandler",
"(",
"FacebookMethod"... | Publish the notification of an action taken by a user to newsfeed.
@param title the title of the feed story (up to 60 characters, excluding tags)
@param body (optional) the body of the feed story (up to 200 characters, excluding tags)
@param images (optional) up to four pairs of image URLs and (possibly null) link URLs... | [
"Publish",
"the",
"notification",
"of",
"an",
"action",
"taken",
"by",
"a",
"user",
"to",
"newsfeed",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L286-L290 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/PreconditionRequired.java | PreconditionRequired.of | public static PreconditionRequired of(Throwable cause) {
"""
Returns a static PreconditionRequired instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param c... | java | public static PreconditionRequired of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(PRECONDITION_REQUIRED));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"PreconditionRequired",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"PRECONDITION_REQUIRED",
")",
")",
";",
"}",
"else",
"{",
... | Returns a static PreconditionRequired instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static PreconditionRequired instance as describ... | [
"Returns",
"a",
"static",
"PreconditionRequired",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/PreconditionRequired.java#L125-L132 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.generateLogForWhereParameters | public static void generateLogForWhereParameters(SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
"""
<p>
Generate log for where conditions.
</p>
<h2>pre conditions</h2>
<p>
required variable are:
</p>
<ul>
<li>_sqlWhereParams</li>
</ul>
<h2>post conditions</h2>
<p>
created variables a... | java | public static void generateLogForWhereParameters(SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
// manage log for where parameters
if (method.getParent().getParent().generateLog) {
methodBuilder.addCode("\n// log for where parameters -- BEGIN\n");
methodBuilder.addStatement("int _whereParamCoun... | [
"public",
"static",
"void",
"generateLogForWhereParameters",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"// manage log for where parameters",
"if",
"(",
"method",
".",
"getParent",
"(",
")",
".",
"getParent",
"(",... | <p>
Generate log for where conditions.
</p>
<h2>pre conditions</h2>
<p>
required variable are:
</p>
<ul>
<li>_sqlWhereParams</li>
</ul>
<h2>post conditions</h2>
<p>
created variables are:
</p>
<ul>
<li>_whereParamCounter</li>
</ul>
@param method
the method
@param methodBuilder
the method builder | [
"<p",
">",
"Generate",
"log",
"for",
"where",
"conditions",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L273-L285 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.getMax | public static Location getMax(List<Location> locations) {
"""
Scans through a list of locations to find the Location with the
highest end
"""
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getEnd().... | java | public static Location getMax(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getEnd().compareTo(previous.getEnd());
return res > 0;
}
});
} | [
"public",
"static",
"Location",
"getMax",
"(",
"List",
"<",
"Location",
">",
"locations",
")",
"{",
"return",
"scanLocations",
"(",
"locations",
",",
"new",
"LocationPredicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"Location",
... | Scans through a list of locations to find the Location with the
highest end | [
"Scans",
"through",
"a",
"list",
"of",
"locations",
"to",
"find",
"the",
"Location",
"with",
"the",
"highest",
"end"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L188-L196 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/inventory.java | inventory.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
inventory_responses result = (inventory_responses) service.get_payload_... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
inventory_responses result = (inventory_responses) service.get_payload_formatter().string_to_resource(inventory_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESS... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"inventory_responses",
"result",
"=",
"(",
"inventory_responses",
")",
"service",
".",
"get_payload_formatter"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/inventory.java#L215-L232 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/authorization/providers/PoliciesCache.java | PoliciesCache.fromSourceProvider | public static PoliciesCache fromSourceProvider(
final SourceProvider provider,
final Set<Attribute> forcedContext
) {
"""
Create from a provider with a forced context
@param provider source provider
@param forcedContext forced context
@return policies cache
"""
return new... | java | public static PoliciesCache fromSourceProvider(
final SourceProvider provider,
final Set<Attribute> forcedContext
)
{
return new PoliciesCache(provider, forcedContext);
} | [
"public",
"static",
"PoliciesCache",
"fromSourceProvider",
"(",
"final",
"SourceProvider",
"provider",
",",
"final",
"Set",
"<",
"Attribute",
">",
"forcedContext",
")",
"{",
"return",
"new",
"PoliciesCache",
"(",
"provider",
",",
"forcedContext",
")",
";",
"}"
] | Create from a provider with a forced context
@param provider source provider
@param forcedContext forced context
@return policies cache | [
"Create",
"from",
"a",
"provider",
"with",
"a",
"forced",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/authorization/providers/PoliciesCache.java#L175-L181 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java | SQLInLoop.visitCode | @Override
public void visitCode(Code obj) {
"""
implements the visitor to clear the collections, and report the query locations that are in loops
@param obj
the context object for the currently parsed code block
"""
queryLocations.clear();
loops.clear();
super.visitCode(obj);
... | java | @Override
public void visitCode(Code obj) {
queryLocations.clear();
loops.clear();
super.visitCode(obj);
for (Integer qLoc : queryLocations) {
for (LoopLocation lLoc : loops) {
if (lLoc.isInLoop(qLoc.intValue())) {
bugReporter.reportBug... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"queryLocations",
".",
"clear",
"(",
")",
";",
"loops",
".",
"clear",
"(",
")",
";",
"super",
".",
"visitCode",
"(",
"obj",
")",
";",
"for",
"(",
"Integer",
"qLoc",
":",
... | implements the visitor to clear the collections, and report the query locations that are in loops
@param obj
the context object for the currently parsed code block | [
"implements",
"the",
"visitor",
"to",
"clear",
"the",
"collections",
"and",
"report",
"the",
"query",
"locations",
"that",
"are",
"in",
"loops"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java#L85-L99 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/GuiStandardUtils.java | GuiStandardUtils.createDialogTitle | public static String createDialogTitle(String appName, String dialogName) {
"""
Return text which conforms to the Look and Feel Design Guidelines for the
title of a dialog : the application name, a colon, then the name of the
specific dialog.
@param dialogName
the short name of the dialog.
"""
if... | java | public static String createDialogTitle(String appName, String dialogName) {
if (appName != null) {
StringBuffer buf = new StringBuffer(appName);
buf.append(": ");
buf.append(dialogName);
return buf.toString();
}
return dialogName;
} | [
"public",
"static",
"String",
"createDialogTitle",
"(",
"String",
"appName",
",",
"String",
"dialogName",
")",
"{",
"if",
"(",
"appName",
"!=",
"null",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"appName",
")",
";",
"buf",
".",
"appe... | Return text which conforms to the Look and Feel Design Guidelines for the
title of a dialog : the application name, a colon, then the name of the
specific dialog.
@param dialogName
the short name of the dialog. | [
"Return",
"text",
"which",
"conforms",
"to",
"the",
"Look",
"and",
"Feel",
"Design",
"Guidelines",
"for",
"the",
"title",
"of",
"a",
"dialog",
":",
"the",
"application",
"name",
"a",
"colon",
"then",
"the",
"name",
"of",
"the",
"specific",
"dialog",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/GuiStandardUtils.java#L95-L104 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/cache/ClusteringConfigurationBuilder.java | ClusteringConfigurationBuilder.biasLifespan | public ClusteringConfigurationBuilder biasLifespan(long l, TimeUnit unit) {
"""
Used in scattered cache. Specifies how long can be the acquired bias held; while the reads
will never be stale, tracking that information consumes memory on primary owner.
"""
attributes.attribute(BIAS_LIFESPAN).set(unit.toM... | java | public ClusteringConfigurationBuilder biasLifespan(long l, TimeUnit unit) {
attributes.attribute(BIAS_LIFESPAN).set(unit.toMillis(l));
return this;
} | [
"public",
"ClusteringConfigurationBuilder",
"biasLifespan",
"(",
"long",
"l",
",",
"TimeUnit",
"unit",
")",
"{",
"attributes",
".",
"attribute",
"(",
"BIAS_LIFESPAN",
")",
".",
"set",
"(",
"unit",
".",
"toMillis",
"(",
"l",
")",
")",
";",
"return",
"this",
... | Used in scattered cache. Specifies how long can be the acquired bias held; while the reads
will never be stale, tracking that information consumes memory on primary owner. | [
"Used",
"in",
"scattered",
"cache",
".",
"Specifies",
"how",
"long",
"can",
"be",
"the",
"acquired",
"bias",
"held",
";",
"while",
"the",
"reads",
"will",
"never",
"be",
"stale",
"tracking",
"that",
"information",
"consumes",
"memory",
"on",
"primary",
"owne... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/cache/ClusteringConfigurationBuilder.java#L112-L115 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java | UniprotProxySequenceReader.getDatabaseReferences | @Override
public LinkedHashMap<String, ArrayList<DBReferenceInfo>> getDatabaseReferences() {
"""
The Uniprot mappings to other database identifiers for this sequence
@return
"""
LinkedHashMap<String, ArrayList<DBReferenceInfo>> databaseReferencesHashMap = new LinkedHashMap<String, ArrayList<DBReferenceInfo... | java | @Override
public LinkedHashMap<String, ArrayList<DBReferenceInfo>> getDatabaseReferences() {
LinkedHashMap<String, ArrayList<DBReferenceInfo>> databaseReferencesHashMap = new LinkedHashMap<String, ArrayList<DBReferenceInfo>>();
if (uniprotDoc == null) {
return databaseReferencesHashMap;
}
try {
Element... | [
"@",
"Override",
"public",
"LinkedHashMap",
"<",
"String",
",",
"ArrayList",
"<",
"DBReferenceInfo",
">",
">",
"getDatabaseReferences",
"(",
")",
"{",
"LinkedHashMap",
"<",
"String",
",",
"ArrayList",
"<",
"DBReferenceInfo",
">",
">",
"databaseReferencesHashMap",
... | The Uniprot mappings to other database identifiers for this sequence
@return | [
"The",
"Uniprot",
"mappings",
"to",
"other",
"database",
"identifiers",
"for",
"this",
"sequence"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/loader/UniprotProxySequenceReader.java#L769-L804 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkDataUtils.java | SparkDataUtils.createFileBatchesLocal | public static void createFileBatchesLocal(File inputDirectory, boolean recursive, File outputDirectory, int batchSize) throws IOException {
"""
See {@link #createFileBatchesLocal(File, String[], boolean, File, int)}.<br>
The directory filtering (extensions arg) is null when calling this method.
"""
cr... | java | public static void createFileBatchesLocal(File inputDirectory, boolean recursive, File outputDirectory, int batchSize) throws IOException {
createFileBatchesLocal(inputDirectory, null, recursive, outputDirectory, batchSize);
} | [
"public",
"static",
"void",
"createFileBatchesLocal",
"(",
"File",
"inputDirectory",
",",
"boolean",
"recursive",
",",
"File",
"outputDirectory",
",",
"int",
"batchSize",
")",
"throws",
"IOException",
"{",
"createFileBatchesLocal",
"(",
"inputDirectory",
",",
"null",
... | See {@link #createFileBatchesLocal(File, String[], boolean, File, int)}.<br>
The directory filtering (extensions arg) is null when calling this method. | [
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkDataUtils.java#L49-L51 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToInt | public static int convertToInt (@Nullable final Object aSrcValue, final int nDefault) {
"""
Convert the passed source value to int
@param aSrcValue
The source value. May be <code>null</code>.
@param nDefault
The default value to be returned if an error occurs during type
conversion.
@return The converted v... | java | public static int convertToInt (@Nullable final Object aSrcValue, final int nDefault)
{
final Integer aValue = convert (aSrcValue, Integer.class, null);
return aValue == null ? nDefault : aValue.intValue ();
} | [
"public",
"static",
"int",
"convertToInt",
"(",
"@",
"Nullable",
"final",
"Object",
"aSrcValue",
",",
"final",
"int",
"nDefault",
")",
"{",
"final",
"Integer",
"aValue",
"=",
"convert",
"(",
"aSrcValue",
",",
"Integer",
".",
"class",
",",
"null",
")",
";",... | Convert the passed source value to int
@param aSrcValue
The source value. May be <code>null</code>.
@param nDefault
The default value to be returned if an error occurs during type
conversion.
@return The converted value.
@throws RuntimeException
If the converter itself throws an exception
@see TypeConverterProviderBes... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"int"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L335-L339 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.removeLongLivedPageFlow | public static void removeLongLivedPageFlow( String modulePath, HttpServletRequest request ) {
"""
Remove a "long-lived" page flow from the session. Once it is created, a long-lived page flow
is never removed from the session unless this method or {@link PageFlowController#remove} is
called. Navigating to anothe... | java | public static void removeLongLivedPageFlow( String modulePath, HttpServletRequest request )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
removeLongLivedPageFlow( modulePath, request, servletContext );
} | [
"public",
"static",
"void",
"removeLongLivedPageFlow",
"(",
"String",
"modulePath",
",",
"HttpServletRequest",
"request",
")",
"{",
"ServletContext",
"servletContext",
"=",
"InternalUtils",
".",
"getServletContext",
"(",
"request",
")",
";",
"removeLongLivedPageFlow",
"... | Remove a "long-lived" page flow from the session. Once it is created, a long-lived page flow
is never removed from the session unless this method or {@link PageFlowController#remove} is
called. Navigating to another page flow hides the current long-lived controller, but does not
remove it.
@deprecated Use {@link #remo... | [
"Remove",
"a",
"long",
"-",
"lived",
"page",
"flow",
"from",
"the",
"session",
".",
"Once",
"it",
"is",
"created",
"a",
"long",
"-",
"lived",
"page",
"flow",
"is",
"never",
"removed",
"from",
"the",
"session",
"unless",
"this",
"method",
"or",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L424-L428 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/SingleSwapNeighbourhood.java | SingleSwapNeighbourhood.getAllMoves | @Override
public List<SubsetMove> getAllMoves(SubsetSolution solution) {
"""
Generates a list of all possible swap moves that transform the given subset solution by removing a single ID from
the current selection and replacing it with a new ID which is currently not selected. Possible fixed IDs are not
consi... | java | @Override
public List<SubsetMove> getAllMoves(SubsetSolution solution) {
// get set of candidate IDs for removal and addition (possibly fixed IDs are discarded)
Set<Integer> removeCandidates = getRemoveCandidates(solution);
Set<Integer> addCandidates = getAddCandidates(solution);
// ... | [
"@",
"Override",
"public",
"List",
"<",
"SubsetMove",
">",
"getAllMoves",
"(",
"SubsetSolution",
"solution",
")",
"{",
"// get set of candidate IDs for removal and addition (possibly fixed IDs are discarded)",
"Set",
"<",
"Integer",
">",
"removeCandidates",
"=",
"getRemoveCan... | Generates a list of all possible swap moves that transform the given subset solution by removing a single ID from
the current selection and replacing it with a new ID which is currently not selected. Possible fixed IDs are not
considered to be swapped. May return an empty list if no swap moves can be generated.
@param... | [
"Generates",
"a",
"list",
"of",
"all",
"possible",
"swap",
"moves",
"that",
"transform",
"the",
"given",
"subset",
"solution",
"by",
"removing",
"a",
"single",
"ID",
"from",
"the",
"current",
"selection",
"and",
"replacing",
"it",
"with",
"a",
"new",
"ID",
... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/SingleSwapNeighbourhood.java#L97-L111 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.apiCreated | public static AuditEntryBean apiCreated(ApiBean bean, ISecurityContext securityContext) {
"""
Creates an audit entry for the 'API created' event.
@param bean the bean
@param securityContext the security context
@return the audit entry
"""
AuditEntryBean entry = newEntry(bean.getOrganization().getId(... | java | public static AuditEntryBean apiCreated(ApiBean bean, ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setEntityId(bean.getId());
entry.setEntityVersion(null);
entry.setData(null);
ent... | [
"public",
"static",
"AuditEntryBean",
"apiCreated",
"(",
"ApiBean",
"bean",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"bean",
".",
"getOrganization",
"(",
")",
".",
"getId",
"(",
")",
",",
"AuditEntity... | Creates an audit entry for the 'API created' event.
@param bean the bean
@param securityContext the security context
@return the audit entry | [
"Creates",
"an",
"audit",
"entry",
"for",
"the",
"API",
"created",
"event",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L256-L263 |
belaban/JGroups | src/org/jgroups/util/Bits.java | Bits.writeDouble | public static void writeDouble(double num, DataOutput out) throws IOException {
"""
Writes a double to an output stream
@param num the double to be written
@param out the output stream
"""
writeLong(Double.doubleToLongBits(num), out);
} | java | public static void writeDouble(double num, DataOutput out) throws IOException {
writeLong(Double.doubleToLongBits(num), out);
} | [
"public",
"static",
"void",
"writeDouble",
"(",
"double",
"num",
",",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"writeLong",
"(",
"Double",
".",
"doubleToLongBits",
"(",
"num",
")",
",",
"out",
")",
";",
"}"
] | Writes a double to an output stream
@param num the double to be written
@param out the output stream | [
"Writes",
"a",
"double",
"to",
"an",
"output",
"stream"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L548-L550 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/GetTagsResult.java | GetTagsResult.withTags | public GetTagsResult withTags(java.util.Map<String, String> tags) {
"""
<p>
The requested tags.
</p>
@param tags
The requested tags.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public GetTagsResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"GetTagsResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The requested tags.
</p>
@param tags
The requested tags.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"requested",
"tags",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/GetTagsResult.java#L67-L70 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java | FormatUtil.findSplitpoint | public static int findSplitpoint(String s, int width) {
"""
Find the first space before position w or if there is none after w.
@param s String
@param width Width
@return index of best whitespace or <code>-1</code> if no whitespace was
found.
"""
// the newline (or EOS) is the fallback split position... | java | public static int findSplitpoint(String s, int width) {
// the newline (or EOS) is the fallback split position.
int in = s.indexOf(NEWLINE);
in = in < 0 ? s.length() : in;
// Good enough?
if(in < width) {
return in;
}
// otherwise, search for whitespace
int iw = s.lastIndexOf(' ', ... | [
"public",
"static",
"int",
"findSplitpoint",
"(",
"String",
"s",
",",
"int",
"width",
")",
"{",
"// the newline (or EOS) is the fallback split position.",
"int",
"in",
"=",
"s",
".",
"indexOf",
"(",
"NEWLINE",
")",
";",
"in",
"=",
"in",
"<",
"0",
"?",
"s",
... | Find the first space before position w or if there is none after w.
@param s String
@param width Width
@return index of best whitespace or <code>-1</code> if no whitespace was
found. | [
"Find",
"the",
"first",
"space",
"before",
"position",
"w",
"or",
"if",
"there",
"is",
"none",
"after",
"w",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L764-L785 |
alkacon/opencms-core | src/org/opencms/search/A_CmsSearchIndex.java | A_CmsSearchIndex.getIndexWriter | public I_CmsIndexWriter getIndexWriter(I_CmsReport report, boolean create) throws CmsIndexException {
"""
Returns a new index writer for this index.<p>
@param report the report to write error messages on
@param create if <code>true</code> a whole new index is created, if <code>false</code> an existing index is... | java | public I_CmsIndexWriter getIndexWriter(I_CmsReport report, boolean create) throws CmsIndexException {
// note - create will be:
// true if the index is to be fully rebuild,
// false if the index is to be incrementally updated
if (m_indexWriter != null) {
if (!create) {
... | [
"public",
"I_CmsIndexWriter",
"getIndexWriter",
"(",
"I_CmsReport",
"report",
",",
"boolean",
"create",
")",
"throws",
"CmsIndexException",
"{",
"// note - create will be:",
"// true if the index is to be fully rebuild,",
"// false if the index is to be incrementally updated",
"i... | Returns a new index writer for this index.<p>
@param report the report to write error messages on
@param create if <code>true</code> a whole new index is created, if <code>false</code> an existing index is updated
@return a new instance of IndexWriter
@throws CmsIndexException if the index can not be opened | [
"Returns",
"a",
"new",
"index",
"writer",
"for",
"this",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/A_CmsSearchIndex.java#L349-L380 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java | FFmpegMuxer.captureH264MetaData | private void captureH264MetaData(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) {
"""
Should only be called once, when the encoder produces
an output buffer with the BUFFER_FLAG_CODEC_CONFIG flag.
For H264 output, this indicates the Sequence Parameter Set
and Picture Parameter Set are contained in th... | java | private void captureH264MetaData(ByteBuffer encodedData, MediaCodec.BufferInfo bufferInfo) {
mH264MetaSize = bufferInfo.size;
mH264Keyframe = ByteBuffer.allocateDirect(encodedData.capacity());
byte[] videoConfig = new byte[bufferInfo.size];
encodedData.get(videoConfig, bufferInfo.offset,... | [
"private",
"void",
"captureH264MetaData",
"(",
"ByteBuffer",
"encodedData",
",",
"MediaCodec",
".",
"BufferInfo",
"bufferInfo",
")",
"{",
"mH264MetaSize",
"=",
"bufferInfo",
".",
"size",
";",
"mH264Keyframe",
"=",
"ByteBuffer",
".",
"allocateDirect",
"(",
"encodedDa... | Should only be called once, when the encoder produces
an output buffer with the BUFFER_FLAG_CODEC_CONFIG flag.
For H264 output, this indicates the Sequence Parameter Set
and Picture Parameter Set are contained in the buffer.
These NAL units are required before every keyframe to ensure
playback is possible in a segmente... | [
"Should",
"only",
"be",
"called",
"once",
"when",
"the",
"encoder",
"produces",
"an",
"output",
"buffer",
"with",
"the",
"BUFFER_FLAG_CODEC_CONFIG",
"flag",
".",
"For",
"H264",
"output",
"this",
"indicates",
"the",
"Sequence",
"Parameter",
"Set",
"and",
"Picture... | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/FFmpegMuxer.java#L296-L305 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java | ViewQueryResponseMapper.mapToViewResult | public static Observable<AsyncViewResult> mapToViewResult(final AsyncBucket bucket, final ViewQuery query,
final ViewQueryResponse response) {
"""
Maps a raw {@link ViewQueryResponse} into a {@link AsyncViewResult}.
@param bucket reference to the bucket.
@param query the original query object.
@param ... | java | public static Observable<AsyncViewResult> mapToViewResult(final AsyncBucket bucket, final ViewQuery query,
final ViewQueryResponse response) {
return response
.info()
.singleOrDefault(null)
.map(new ByteBufToJsonObject())
.map(new BuildViewResult(bucket, ... | [
"public",
"static",
"Observable",
"<",
"AsyncViewResult",
">",
"mapToViewResult",
"(",
"final",
"AsyncBucket",
"bucket",
",",
"final",
"ViewQuery",
"query",
",",
"final",
"ViewQueryResponse",
"response",
")",
"{",
"return",
"response",
".",
"info",
"(",
")",
"."... | Maps a raw {@link ViewQueryResponse} into a {@link AsyncViewResult}.
@param bucket reference to the bucket.
@param query the original query object.
@param response the response from the server.
@return a converted {@link AsyncViewResult}. | [
"Maps",
"a",
"raw",
"{",
"@link",
"ViewQueryResponse",
"}",
"into",
"a",
"{",
"@link",
"AsyncViewResult",
"}",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java#L60-L68 |
zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOnInstaller.java | AddOnInstaller.softUninstall | public static boolean softUninstall(AddOn addOn, AddOnUninstallationProgressCallback callback) {
"""
Uninstalls Java classes ({@code Extension}s, {@code Plugin}s, {@code PassiveScanner}s) of the given {@code addOn}. Should
be called when the add-on must be temporarily uninstalled for an update of a dependency.
<... | java | public static boolean softUninstall(AddOn addOn, AddOnUninstallationProgressCallback callback) {
Validate.notNull(addOn, "Parameter addOn must not be null.");
validateCallbackNotNull(callback);
try {
boolean uninstalledWithoutErrors = true;
uninstalledWithoutErrors &= un... | [
"public",
"static",
"boolean",
"softUninstall",
"(",
"AddOn",
"addOn",
",",
"AddOnUninstallationProgressCallback",
"callback",
")",
"{",
"Validate",
".",
"notNull",
"(",
"addOn",
",",
"\"Parameter addOn must not be null.\"",
")",
";",
"validateCallbackNotNull",
"(",
"ca... | Uninstalls Java classes ({@code Extension}s, {@code Plugin}s, {@code PassiveScanner}s) of the given {@code addOn}. Should
be called when the add-on must be temporarily uninstalled for an update of a dependency.
<p>
The Java classes are uninstalled in the following order (inverse to installation):
<ol>
<li>Passive scann... | [
"Uninstalls",
"Java",
"classes",
"(",
"{",
"@code",
"Extension",
"}",
"s",
"{",
"@code",
"Plugin",
"}",
"s",
"{",
"@code",
"PassiveScanner",
"}",
"s",
")",
"of",
"the",
"given",
"{",
"@code",
"addOn",
"}",
".",
"Should",
"be",
"called",
"when",
"the",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOnInstaller.java#L200-L215 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/crypto/BCrypt.java | BCrypt.hash | public static String hash(char[] password, int cost) {
"""
@param password
the plaintext password
@param cost
the computation cost (complexity increases at <code>2**cost</code>)
@return
"""
String salt = BCryptImpl.gensalt(cost);
return BCryptImpl.hashpw(new String(password), salt);
} | java | public static String hash(char[] password, int cost)
{
String salt = BCryptImpl.gensalt(cost);
return BCryptImpl.hashpw(new String(password), salt);
} | [
"public",
"static",
"String",
"hash",
"(",
"char",
"[",
"]",
"password",
",",
"int",
"cost",
")",
"{",
"String",
"salt",
"=",
"BCryptImpl",
".",
"gensalt",
"(",
"cost",
")",
";",
"return",
"BCryptImpl",
".",
"hashpw",
"(",
"new",
"String",
"(",
"passwo... | @param password
the plaintext password
@param cost
the computation cost (complexity increases at <code>2**cost</code>)
@return | [
"@param",
"password",
"the",
"plaintext",
"password",
"@param",
"cost",
"the",
"computation",
"cost",
"(",
"complexity",
"increases",
"at",
"<code",
">",
"2",
"**",
"cost<",
"/",
"code",
">",
")"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/crypto/BCrypt.java#L19-L24 |
google/j2objc | jre_emul/android/platform/external/okhttp/okio/okio/src/main/java/okio/Buffer.java | Buffer.copyTo | public Buffer copyTo(OutputStream out, long offset, long byteCount) throws IOException {
"""
Copy {@code byteCount} bytes from this, starting at {@code offset}, to
{@code out}.
"""
if (out == null) throw new IllegalArgumentException("out == null");
checkOffsetAndCount(size, offset, byteCount);
if ... | java | public Buffer copyTo(OutputStream out, long offset, long byteCount) throws IOException {
if (out == null) throw new IllegalArgumentException("out == null");
checkOffsetAndCount(size, offset, byteCount);
if (byteCount == 0) return this;
// Skip segments that we aren't copying from.
Segment s = head;... | [
"public",
"Buffer",
"copyTo",
"(",
"OutputStream",
"out",
",",
"long",
"offset",
",",
"long",
"byteCount",
")",
"throws",
"IOException",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"out == null\"",
")",
";",
"... | Copy {@code byteCount} bytes from this, starting at {@code offset}, to
{@code out}. | [
"Copy",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/okhttp/okio/okio/src/main/java/okio/Buffer.java#L140-L161 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/manager/ManagerConnectionFactory.java | ManagerConnectionFactory.createSecureManagerConnection | public ManagerConnection createSecureManagerConnection() {
"""
Returns a new SSL secured ManagerConnection in state {@link ManagerConnectionState#CONNECTED}.
@return the created connection to the Asterisk server.
@since 0.3
"""
DefaultManagerConnection dmc;
dmc = new DefaultManagerConnectio... | java | public ManagerConnection createSecureManagerConnection()
{
DefaultManagerConnection dmc;
dmc = new DefaultManagerConnection(hostname, port, username, password);
dmc.setSsl(true);
return dmc;
} | [
"public",
"ManagerConnection",
"createSecureManagerConnection",
"(",
")",
"{",
"DefaultManagerConnection",
"dmc",
";",
"dmc",
"=",
"new",
"DefaultManagerConnection",
"(",
"hostname",
",",
"port",
",",
"username",
",",
"password",
")",
";",
"dmc",
".",
"setSsl",
"(... | Returns a new SSL secured ManagerConnection in state {@link ManagerConnectionState#CONNECTED}.
@return the created connection to the Asterisk server.
@since 0.3 | [
"Returns",
"a",
"new",
"SSL",
"secured",
"ManagerConnection",
"in",
"state",
"{",
"@link",
"ManagerConnectionState#CONNECTED",
"}",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/manager/ManagerConnectionFactory.java#L107-L113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.