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 |
|---|---|---|---|---|---|---|---|---|---|---|
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getLatitudeFromPixel | public static double getLatitudeFromPixel(long height,
BoundingBox boundingBox, float pixel) {
"""
Get the latitude from the pixel location, bounding box, and image height
@param height
height
@param boundingBox
bounding box
@param pixel
pixel
@return latitude
"""
return getLatitudeFromPixel(heig... | java | public static double getLatitudeFromPixel(long height,
BoundingBox boundingBox, float pixel) {
return getLatitudeFromPixel(height, boundingBox, boundingBox, pixel);
} | [
"public",
"static",
"double",
"getLatitudeFromPixel",
"(",
"long",
"height",
",",
"BoundingBox",
"boundingBox",
",",
"float",
"pixel",
")",
"{",
"return",
"getLatitudeFromPixel",
"(",
"height",
",",
"boundingBox",
",",
"boundingBox",
",",
"pixel",
")",
";",
"}"
... | Get the latitude from the pixel location, bounding box, and image height
@param height
height
@param boundingBox
bounding box
@param pixel
pixel
@return latitude | [
"Get",
"the",
"latitude",
"from",
"the",
"pixel",
"location",
"bounding",
"box",
"and",
"image",
"height"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L274-L277 |
fernandospr/javapns-jdk16 | src/main/java/javapns/notification/Payload.java | Payload.addCustomDictionary | public void addCustomDictionary(String name, List values) throws JSONException {
"""
Add a custom dictionnary with multiple values
@param name
@param values
@throws JSONException
"""
logger.debug("Adding custom Dictionary [" + name + "] = (list)");
put(name, values, payload, false);
} | java | public void addCustomDictionary(String name, List values) throws JSONException {
logger.debug("Adding custom Dictionary [" + name + "] = (list)");
put(name, values, payload, false);
} | [
"public",
"void",
"addCustomDictionary",
"(",
"String",
"name",
",",
"List",
"values",
")",
"throws",
"JSONException",
"{",
"logger",
".",
"debug",
"(",
"\"Adding custom Dictionary [\"",
"+",
"name",
"+",
"\"] = (list)\"",
")",
";",
"put",
"(",
"name",
",",
"v... | Add a custom dictionnary with multiple values
@param name
@param values
@throws JSONException | [
"Add",
"a",
"custom",
"dictionnary",
"with",
"multiple",
"values"
] | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L101-L104 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/JSONs.java | JSONs.requiredNode | public static Node requiredNode(Model mo, JSONObject o, String id) throws JSONConverterException {
"""
Read an expected node.
@param mo the associated model to browse
@param o the object to parse
@param id the key in the map that points to the node identifier
@return the node
@throws JSONConverterException... | java | public static Node requiredNode(Model mo, JSONObject o, String id) throws JSONConverterException {
checkKeys(o, id);
try {
return getNode(mo, (Integer) o.get(id));
} catch (ClassCastException e) {
throw new JSONConverterException("Unable to read a Node identifier from str... | [
"public",
"static",
"Node",
"requiredNode",
"(",
"Model",
"mo",
",",
"JSONObject",
"o",
",",
"String",
"id",
")",
"throws",
"JSONConverterException",
"{",
"checkKeys",
"(",
"o",
",",
"id",
")",
";",
"try",
"{",
"return",
"getNode",
"(",
"mo",
",",
"(",
... | Read an expected node.
@param mo the associated model to browse
@param o the object to parse
@param id the key in the map that points to the node identifier
@return the node
@throws JSONConverterException if the key does not point to a node identifier | [
"Read",
"an",
"expected",
"node",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/JSONs.java#L359-L366 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, DateAttribute attribute) {
"""
Get a date value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1
"""
attribute.setValue((Date) formWidget.getValue(name));
} | java | @Api
public void getValue(String name, DateAttribute attribute) {
attribute.setValue((Date) formWidget.getValue(name));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"DateAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"(",
"Date",
")",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
";",
"}"
] | Get a date value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"date",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L764-L767 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ArrayUtils.java | ArrayUtils.assertArraySize | public static void assertArraySize(int size, double[] array, Supplier<String> errmsg) {
"""
Throws an {@link IllegalArgumentException} is the specified array is not of specified size
@param size for array to have
@param array to check
@param errmsg generates message to put into exception
"""
if(array.leng... | java | public static void assertArraySize(int size, double[] array, Supplier<String> errmsg){
if(array.length != size){
throw new IllegalArgumentException(errmsg.get());
}
} | [
"public",
"static",
"void",
"assertArraySize",
"(",
"int",
"size",
",",
"double",
"[",
"]",
"array",
",",
"Supplier",
"<",
"String",
">",
"errmsg",
")",
"{",
"if",
"(",
"array",
".",
"length",
"!=",
"size",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | Throws an {@link IllegalArgumentException} is the specified array is not of specified size
@param size for array to have
@param array to check
@param errmsg generates message to put into exception | [
"Throws",
"an",
"{"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ArrayUtils.java#L108-L112 |
grails/grails-core | grails-core/src/main/groovy/grails/core/ArtefactHandlerAdapter.java | ArtefactHandlerAdapter.newArtefactClass | public GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") Class artefactClass) {
"""
<p>Creates new GrailsClass derived object using the type supplied in constructor. May not perform
optimally but is a convenience.</p>
@param artefactClass Creates a new artefact for the given class
@return An instance o... | java | public GrailsClass newArtefactClass(@SuppressWarnings("rawtypes") Class artefactClass) {
try {
Constructor<?> c = grailsClassImpl.getDeclaredConstructor(new Class[] { Class.class });
// TODO GRAILS-720 plugin class instance created here first
return (GrailsClass) c.newInstanc... | [
"public",
"GrailsClass",
"newArtefactClass",
"(",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"Class",
"artefactClass",
")",
"{",
"try",
"{",
"Constructor",
"<",
"?",
">",
"c",
"=",
"grailsClassImpl",
".",
"getDeclaredConstructor",
"(",
"new",
"Class",
"[... | <p>Creates new GrailsClass derived object using the type supplied in constructor. May not perform
optimally but is a convenience.</p>
@param artefactClass Creates a new artefact for the given class
@return An instance of the GrailsClass interface representing the artefact | [
"<p",
">",
"Creates",
"new",
"GrailsClass",
"derived",
"object",
"using",
"the",
"type",
"supplied",
"in",
"constructor",
".",
"May",
"not",
"perform",
"optimally",
"but",
"is",
"a",
"convenience",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/core/ArtefactHandlerAdapter.java#L157-L175 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getWvWMatchDetail | public void getWvWMatchDetail(int worldID, Callback<WvWMatchDetail> callback) throws NullPointerException {
"""
For more info on WvW matches API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/matches">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onF... | java | public void getWvWMatchDetail(int worldID, Callback<WvWMatchDetail> callback) throws NullPointerException {
gw2API.getWvWMatchInfoUsingWorld(Integer.toString(worldID)).enqueue(callback);
} | [
"public",
"void",
"getWvWMatchDetail",
"(",
"int",
"worldID",
",",
"Callback",
"<",
"WvWMatchDetail",
">",
"callback",
")",
"throws",
"NullPointerException",
"{",
"gw2API",
".",
"getWvWMatchInfoUsingWorld",
"(",
"Integer",
".",
"toString",
"(",
"worldID",
")",
")"... | For more info on WvW matches API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/matches">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param worldID {@link World#id}
@param callback callback th... | [
"For",
"more",
"info",
"on",
"WvW",
"matches",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"wvw",
"/",
"matches",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2610-L2612 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/JSONs.java | JSONs.checkKeys | public static void checkKeys(JSONObject o, String... keys) throws JSONConverterException {
"""
Check if some keys are present.
@param o the object to parse
@param keys the keys to check
@throws JSONConverterException when at least a key is missing
"""
for (String k : keys) {
if (!o.... | java | public static void checkKeys(JSONObject o, String... keys) throws JSONConverterException {
for (String k : keys) {
if (!o.containsKey(k)) {
throw new JSONConverterException("Missing key '" + k + "'");
}
}
} | [
"public",
"static",
"void",
"checkKeys",
"(",
"JSONObject",
"o",
",",
"String",
"...",
"keys",
")",
"throws",
"JSONConverterException",
"{",
"for",
"(",
"String",
"k",
":",
"keys",
")",
"{",
"if",
"(",
"!",
"o",
".",
"containsKey",
"(",
"k",
")",
")",
... | Check if some keys are present.
@param o the object to parse
@param keys the keys to check
@throws JSONConverterException when at least a key is missing | [
"Check",
"if",
"some",
"keys",
"are",
"present",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/JSONs.java#L128-L134 |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/Bindings.java | Bindings.toRSL | public void toRSL(StringBuffer buf, boolean explicitConcat) {
"""
Produces a RSL representation of this relation.
@param buf buffer to add the RSL representation to.
@param explicitConcat if true explicit concatination will
be used in RSL strings.
"""
buf.append("( ");
buf.append( getAttribute() );
buf... | java | public void toRSL(StringBuffer buf, boolean explicitConcat) {
buf.append("( ");
buf.append( getAttribute() );
buf.append(" = ");
Iterator iterator = values.iterator();
Binding binding;
while(iterator.hasNext()) {
binding = (Binding)iterator.next();
binding.toRSL(buf, explicitConcat);
if (iterator.h... | [
"public",
"void",
"toRSL",
"(",
"StringBuffer",
"buf",
",",
"boolean",
"explicitConcat",
")",
"{",
"buf",
".",
"append",
"(",
"\"( \"",
")",
";",
"buf",
".",
"append",
"(",
"getAttribute",
"(",
")",
")",
";",
"buf",
".",
"append",
"(",
"\" = \"",
")",
... | Produces a RSL representation of this relation.
@param buf buffer to add the RSL representation to.
@param explicitConcat if true explicit concatination will
be used in RSL strings. | [
"Produces",
"a",
"RSL",
"representation",
"of",
"this",
"relation",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/Bindings.java#L120-L132 |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/RiakClient.java | RiakClient.newClient | public static RiakClient newClient(int port, List<String> remoteAddresses) throws UnknownHostException {
"""
Static factory method to create a new client instance.
This method produces a client connected to the supplied addresses on
the supplied port.
@param remoteAddresses a list of IP addresses or hostnames
... | java | public static RiakClient newClient(int port, List<String> remoteAddresses) throws UnknownHostException
{
RiakNode.Builder builder = createDefaultNodeBuilder()
.withRemotePort(port);
return newClient(builder, remoteAddresses);
} | [
"public",
"static",
"RiakClient",
"newClient",
"(",
"int",
"port",
",",
"List",
"<",
"String",
">",
"remoteAddresses",
")",
"throws",
"UnknownHostException",
"{",
"RiakNode",
".",
"Builder",
"builder",
"=",
"createDefaultNodeBuilder",
"(",
")",
".",
"withRemotePor... | Static factory method to create a new client instance.
This method produces a client connected to the supplied addresses on
the supplied port.
@param remoteAddresses a list of IP addresses or hostnames
@param port the (protocol buffers) port to connect to on the supplied hosts.
@return a new client instance
@throws Unk... | [
"Static",
"factory",
"method",
"to",
"create",
"a",
"new",
"client",
"instance",
".",
"This",
"method",
"produces",
"a",
"client",
"connected",
"to",
"the",
"supplied",
"addresses",
"on",
"the",
"supplied",
"port",
"."
] | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/RiakClient.java#L245-L250 |
apache/groovy | subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java | JsonLexer.readingConstant | private JsonToken readingConstant(JsonTokenType type, JsonToken token) {
"""
When a constant token type is expected, check that the expected constant is read,
and update the content of the token accordingly.
@param type the token type
@param token the token
@return the token updated with end column and text ... | java | private JsonToken readingConstant(JsonTokenType type, JsonToken token) {
try {
int numCharsToRead = ((String) type.getValidator()).length();
char[] chars = new char[numCharsToRead];
reader.read(chars);
String stringRead = new String(chars);
if (string... | [
"private",
"JsonToken",
"readingConstant",
"(",
"JsonTokenType",
"type",
",",
"JsonToken",
"token",
")",
"{",
"try",
"{",
"int",
"numCharsToRead",
"=",
"(",
"(",
"String",
")",
"type",
".",
"getValidator",
"(",
")",
")",
".",
"length",
"(",
")",
";",
"ch... | When a constant token type is expected, check that the expected constant is read,
and update the content of the token accordingly.
@param type the token type
@param token the token
@return the token updated with end column and text updated | [
"When",
"a",
"constant",
"token",
"type",
"is",
"expected",
"check",
"that",
"the",
"expected",
"constant",
"is",
"read",
"and",
"update",
"the",
"content",
"of",
"the",
"token",
"accordingly",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/JsonLexer.java#L190-L208 |
groundupworks/wings | wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookSettings.java | FacebookSettings.newInstance | static FacebookSettings newInstance(int destinationId, String accountName, String albumName, String albumGraphPath, String pageAccessToken, String photoPrivacy) {
"""
Creates a new {@link FacebookSettings} instance.
@param destinationId the destination id.
@param accountName the user name associated with... | java | static FacebookSettings newInstance(int destinationId, String accountName, String albumName, String albumGraphPath, String pageAccessToken, String photoPrivacy) {
FacebookSettings settings = null;
if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(albumName) && !TextUtils.isEmpty(albumGraphPath)... | [
"static",
"FacebookSettings",
"newInstance",
"(",
"int",
"destinationId",
",",
"String",
"accountName",
",",
"String",
"albumName",
",",
"String",
"albumGraphPath",
",",
"String",
"pageAccessToken",
",",
"String",
"photoPrivacy",
")",
"{",
"FacebookSettings",
"setting... | Creates a new {@link FacebookSettings} instance.
@param destinationId the destination id.
@param accountName the user name associated with the account.
@param albumName the name of the album to share to.
@param albumGraphPath the graph path of the album to share to.
@param pageAccessToken the Page access ... | [
"Creates",
"a",
"new",
"{",
"@link",
"FacebookSettings",
"}",
"instance",
"."
] | train | https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookSettings.java#L96-L109 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/BaseTaskSession.java | BaseTaskSession.init | public void init(BaseSession parentSessionObject, Record record, Map<String, Object> objectID) {
"""
Build a new task session.
@param parentSessionObject Parent that created this session object (usually null for task sessions).
@param record Main record for this session (always null for task sessions).
@param ... | java | public void init(BaseSession parentSessionObject, Record record, Map<String, Object> objectID)
{
if (m_application == null)
m_application = new MainApplication(null, null, null);
this.addToApplication();
super.init(parentSessionObject, record, objectID);
} | [
"public",
"void",
"init",
"(",
"BaseSession",
"parentSessionObject",
",",
"Record",
"record",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"objectID",
")",
"{",
"if",
"(",
"m_application",
"==",
"null",
")",
"m_application",
"=",
"new",
"MainApplication",
... | Build a new task session.
@param parentSessionObject Parent that created this session object (usually null for task sessions).
@param record Main record for this session (always null for task sessions).
@param objectID ObjectID of the object that this SessionObject represents (usually null for task sessions). | [
"Build",
"a",
"new",
"task",
"session",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/BaseTaskSession.java#L92-L98 |
tango-controls/JTango | server/src/main/java/org/tango/server/device/DeviceManager.java | DeviceManager.setAttributeProperties | public void setAttributeProperties(final String attributeName, final AttributePropertiesImpl properties)
throws DevFailed {
"""
Configure an attribute's properties
@param attributeName the attribute name
@param properties its properties
@throws DevFailed
"""
final AttributeImpl attr... | java | public void setAttributeProperties(final String attributeName, final AttributePropertiesImpl properties)
throws DevFailed {
final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, device.getAttributeList());
attr.setProperties(properties);
} | [
"public",
"void",
"setAttributeProperties",
"(",
"final",
"String",
"attributeName",
",",
"final",
"AttributePropertiesImpl",
"properties",
")",
"throws",
"DevFailed",
"{",
"final",
"AttributeImpl",
"attr",
"=",
"AttributeGetterSetter",
".",
"getAttribute",
"(",
"attrib... | Configure an attribute's properties
@param attributeName the attribute name
@param properties its properties
@throws DevFailed | [
"Configure",
"an",
"attribute",
"s",
"properties"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/device/DeviceManager.java#L110-L114 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.getCoinInstance | public static BtcFormat getCoinInstance(int minFractionPlaces, int... groups) {
"""
Return a new coin-denominated formatter with the specified fraction-places. The
returned object will format and parse values according to the default locale, and will
format the fraction part of numbers with at least two decimal... | java | public static BtcFormat getCoinInstance(int minFractionPlaces, int... groups) {
return getInstance(COIN_SCALE, defaultLocale(), minFractionPlaces, boxAsList(groups));
} | [
"public",
"static",
"BtcFormat",
"getCoinInstance",
"(",
"int",
"minFractionPlaces",
",",
"int",
"...",
"groups",
")",
"{",
"return",
"getInstance",
"(",
"COIN_SCALE",
",",
"defaultLocale",
"(",
")",
",",
"minFractionPlaces",
",",
"boxAsList",
"(",
"groups",
")"... | Return a new coin-denominated formatter with the specified fraction-places. The
returned object will format and parse values according to the default locale, and will
format the fraction part of numbers with at least two decimal places. The sizes of
additional groups of decimal places can be specified by a variable n... | [
"Return",
"a",
"new",
"coin",
"-",
"denominated",
"formatter",
"with",
"the",
"specified",
"fraction",
"-",
"places",
".",
"The",
"returned",
"object",
"will",
"format",
"and",
"parse",
"values",
"according",
"to",
"the",
"default",
"locale",
"and",
"will",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L949-L951 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MathUtils.java | MathUtils.randomLong | public static long randomLong(final long min, final long max) {
"""
Returns a natural long value between given minimum value and max value.
@param min
the minimum value to random.
@param max
the max value to random.
@return a natural long value between given minimum value and max value.
"""
ret... | java | public static long randomLong(final long min, final long max) {
return Math.round(Math.random() * (max - min) + min);
} | [
"public",
"static",
"long",
"randomLong",
"(",
"final",
"long",
"min",
",",
"final",
"long",
"max",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"(",
"max",
"-",
"min",
")",
"+",
"min",
")",
";",
"}"
] | Returns a natural long value between given minimum value and max value.
@param min
the minimum value to random.
@param max
the max value to random.
@return a natural long value between given minimum value and max value. | [
"Returns",
"a",
"natural",
"long",
"value",
"between",
"given",
"minimum",
"value",
"and",
"max",
"value",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MathUtils.java#L88-L91 |
oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/ecd/BaseExperimentBuilder.java | BaseExperimentBuilder.loadFromClassOrInherit | @Deprecated
public static <C> Class<? extends C> loadFromClassOrInherit(String handle, Class<C> ifaceClass,
Map<String, Object> tuples) throws Exception {
"""
These methods are preserved for compatibility with the old version of PhaseImpl
"""
String[] name = handle.split("!");
if (name[0].e... | java | @Deprecated
public static <C> Class<? extends C> loadFromClassOrInherit(String handle, Class<C> ifaceClass,
Map<String, Object> tuples) throws Exception {
String[] name = handle.split("!");
if (name[0].equals("class")) {
return Class.forName(name[1]).asSubclass(ifaceClass);
} else {
... | [
"@",
"Deprecated",
"public",
"static",
"<",
"C",
">",
"Class",
"<",
"?",
"extends",
"C",
">",
"loadFromClassOrInherit",
"(",
"String",
"handle",
",",
"Class",
"<",
"C",
">",
"ifaceClass",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"tuples",
")",
"t... | These methods are preserved for compatibility with the old version of PhaseImpl | [
"These",
"methods",
"are",
"preserved",
"for",
"compatibility",
"with",
"the",
"old",
"version",
"of",
"PhaseImpl"
] | train | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/ecd/BaseExperimentBuilder.java#L519-L534 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsErrorUtils.java | JmsErrorUtils.getJMS2Exception | public static Throwable getJMS2Exception(JMSException jmse, Class exceptionToBeThrown) {
"""
This is a generic function to convert all the JMS 1.1 exceptions to JMS 2.0 exception.
It uses reflection to create the desired JMS2.0 exception
@param jmse The JMSException
@param exceptionToBeThrown The exception wh... | java | public static Throwable getJMS2Exception(JMSException jmse, Class exceptionToBeThrown) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getJMS2Exceptions",
new Object[] { jmse, exceptionToBeThrown });
JMSRuntimeException jmsre = nu... | [
"public",
"static",
"Throwable",
"getJMS2Exception",
"(",
"JMSException",
"jmse",
",",
"Class",
"exceptionToBeThrown",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
... | This is a generic function to convert all the JMS 1.1 exceptions to JMS 2.0 exception.
It uses reflection to create the desired JMS2.0 exception
@param jmse The JMSException
@param exceptionToBeThrown The exception which has to be returned
@return Throwable It can be of type IllegalStateRuntimeException, InvalidClient... | [
"This",
"is",
"a",
"generic",
"function",
"to",
"convert",
"all",
"the",
"JMS",
"1",
".",
"1",
"exceptions",
"to",
"JMS",
"2",
".",
"0",
"exception",
".",
"It",
"uses",
"reflection",
"to",
"create",
"the",
"desired",
"JMS2",
".",
"0",
"exception"
] | 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/JmsErrorUtils.java#L482-L507 |
cryptomator/cryptolib | src/main/java/org/cryptomator/cryptolib/Cryptors.java | Cryptors.changePassphrase | public static byte[] changePassphrase(CryptorProvider cryptoProvider, byte[] masterkey, CharSequence oldPassphrase, CharSequence newPassphrase) throws InvalidPassphraseException {
"""
Reencrypts a masterkey with a new passphrase.
@param cryptoProvider A suitable CryptorProvider instance, i.e. same version as th... | java | public static byte[] changePassphrase(CryptorProvider cryptoProvider, byte[] masterkey, CharSequence oldPassphrase, CharSequence newPassphrase) throws InvalidPassphraseException {
return changePassphrase(cryptoProvider, masterkey, new byte[0], oldPassphrase, newPassphrase);
} | [
"public",
"static",
"byte",
"[",
"]",
"changePassphrase",
"(",
"CryptorProvider",
"cryptoProvider",
",",
"byte",
"[",
"]",
"masterkey",
",",
"CharSequence",
"oldPassphrase",
",",
"CharSequence",
"newPassphrase",
")",
"throws",
"InvalidPassphraseException",
"{",
"retur... | Reencrypts a masterkey with a new passphrase.
@param cryptoProvider A suitable CryptorProvider instance, i.e. same version as the original masterkey has been created with.
@param masterkey The original JSON representation of the masterkey
@param oldPassphrase The old passphrase
@param newPassphrase The new passphrase
... | [
"Reencrypts",
"a",
"masterkey",
"with",
"a",
"new",
"passphrase",
"."
] | train | https://github.com/cryptomator/cryptolib/blob/33bc881f6ee7d4924043ea6309efd2c063ec3638/src/main/java/org/cryptomator/cryptolib/Cryptors.java#L89-L91 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java | TransformersLogger.getAttributeWarning | public String getAttributeWarning(PathAddress address, ModelNode operation, String message, Set<String> attributes) {
"""
Get a warning message for the given operation at the provided address for the passed attributes with the given
custom message appended. Intended for use in providing a failure description for ... | java | public String getAttributeWarning(PathAddress address, ModelNode operation, String message, Set<String> attributes) {
return new AttributeLogEntry(address, operation, message, attributes).getMessage();
} | [
"public",
"String",
"getAttributeWarning",
"(",
"PathAddress",
"address",
",",
"ModelNode",
"operation",
",",
"String",
"message",
",",
"Set",
"<",
"String",
">",
"attributes",
")",
"{",
"return",
"new",
"AttributeLogEntry",
"(",
"address",
",",
"operation",
","... | Get a warning message for the given operation at the provided address for the passed attributes with the given
custom message appended. Intended for use in providing a failure description for an operation
or an exception message for an {@link org.jboss.as.controller.OperationFailedException}.
@param address where w... | [
"Get",
"a",
"warning",
"message",
"for",
"the",
"given",
"operation",
"at",
"the",
"provided",
"address",
"for",
"the",
"passed",
"attributes",
"with",
"the",
"given",
"custom",
"message",
"appended",
".",
"Intended",
"for",
"use",
"in",
"providing",
"a",
"f... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java#L174-L176 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java | PolicyEventsInner.listQueryResultsForResourceGroup | public PolicyEventsQueryResultsInner listQueryResultsForResourceGroup(String subscriptionId, String resourceGroupName) {
"""
Queries policy events for the resources under the resource group.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@throws IllegalArg... | java | public PolicyEventsQueryResultsInner listQueryResultsForResourceGroup(String subscriptionId, String resourceGroupName) {
return listQueryResultsForResourceGroupWithServiceResponseAsync(subscriptionId, resourceGroupName).toBlocking().single().body();
} | [
"public",
"PolicyEventsQueryResultsInner",
"listQueryResultsForResourceGroup",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"listQueryResultsForResourceGroupWithServiceResponseAsync",
"(",
"subscriptionId",
",",
"resourceGroupName",
")",
... | Queries policy events for the resources under the resource group.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailureException thrown if the request is rejected by server
@thr... | [
"Queries",
"policy",
"events",
"for",
"the",
"resources",
"under",
"the",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L484-L486 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java | HeaderAndFooterGridView.addFooterView | public final void addFooterView(@NonNull final View view, @Nullable final Object data,
final boolean selectable) {
"""
Adds a fixed view to appear at the bottom of the adapter view. If this method is called more
than once, the views will appear in the order they were added.
... | java | public final void addFooterView(@NonNull final View view, @Nullable final Object data,
final boolean selectable) {
Condition.INSTANCE.ensureNotNull(view, "The view may not be null");
footers.add(new FullWidthItem(view, data, selectable));
notifyDataSetChanged(... | [
"public",
"final",
"void",
"addFooterView",
"(",
"@",
"NonNull",
"final",
"View",
"view",
",",
"@",
"Nullable",
"final",
"Object",
"data",
",",
"final",
"boolean",
"selectable",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"view",
",",
... | Adds a fixed view to appear at the bottom of the adapter view. If this method is called more
than once, the views will appear in the order they were added.
@param view
The footer view, which should be added, as an instance of the class {@link View}. The
view may not be null
@param data
The data, which should be associ... | [
"Adds",
"a",
"fixed",
"view",
"to",
"appear",
"at",
"the",
"bottom",
"of",
"the",
"adapter",
"view",
".",
"If",
"this",
"method",
"is",
"called",
"more",
"than",
"once",
"the",
"views",
"will",
"appear",
"in",
"the",
"order",
"they",
"were",
"added",
"... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java#L646-L651 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java | SimpleMMcifConsumer.addInformationFromESN | private void addInformationFromESN(EntitySrcNat esn, int eId, EntityInfo c) {
"""
Add the information to entity info from ESN.
@param esn
@param eId
@param c
"""
c.setAtcc(esn.getPdbx_atcc());
c.setCell(esn.getPdbx_cell());
c.setOrganismCommon(esn.getCommon_name());
c.setOrganismScientific(esn.getP... | java | private void addInformationFromESN(EntitySrcNat esn, int eId, EntityInfo c) {
c.setAtcc(esn.getPdbx_atcc());
c.setCell(esn.getPdbx_cell());
c.setOrganismCommon(esn.getCommon_name());
c.setOrganismScientific(esn.getPdbx_organism_scientific());
c.setOrganismTaxId(esn.getPdbx_ncbi_taxonomy_id());
} | [
"private",
"void",
"addInformationFromESN",
"(",
"EntitySrcNat",
"esn",
",",
"int",
"eId",
",",
"EntityInfo",
"c",
")",
"{",
"c",
".",
"setAtcc",
"(",
"esn",
".",
"getPdbx_atcc",
"(",
")",
")",
";",
"c",
".",
"setCell",
"(",
"esn",
".",
"getPdbx_cell",
... | Add the information to entity info from ESN.
@param esn
@param eId
@param c | [
"Add",
"the",
"information",
"to",
"entity",
"info",
"from",
"ESN",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java#L1212-L1220 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseLogicalExpression | private Expr parseLogicalExpression(EnclosingScope scope, boolean terminated) {
"""
Parse a logical expression of the form:
<pre>
Expr ::= AndOrExpr [ "==>" UnitExpr]
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the cur... | java | private Expr parseLogicalExpression(EnclosingScope scope, boolean terminated) {
checkNotEof();
int start = index;
Expr lhs = parseAndOrExpression(scope, terminated);
Token lookahead = tryAndMatch(terminated, LogicalImplication, LogicalIff);
if (lookahead != null) {
switch (lookahead.kind) {
case Logical... | [
"private",
"Expr",
"parseLogicalExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"checkNotEof",
"(",
")",
";",
"int",
"start",
"=",
"index",
";",
"Expr",
"lhs",
"=",
"parseAndOrExpression",
"(",
"scope",
",",
"terminated",
"... | Parse a logical expression of the form:
<pre>
Expr ::= AndOrExpr [ "==>" UnitExpr]
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the expression is known to be termi... | [
"Parse",
"a",
"logical",
"expression",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1662-L1685 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTreeNode.java | MkTabTreeNode.integrityCheckParameters | @Override
protected void integrityCheckParameters(MkTabEntry parentEntry, MkTabTreeNode<O> parent, int index, AbstractMTree<O, MkTabTreeNode<O>, MkTabEntry, ?> mTree) {
"""
Tests, if the parameters of the entry representing this node, are correctly
set. Subclasses may need to overwrite this method.
@param pa... | java | @Override
protected void integrityCheckParameters(MkTabEntry parentEntry, MkTabTreeNode<O> parent, int index, AbstractMTree<O, MkTabTreeNode<O>, MkTabEntry, ?> mTree) {
super.integrityCheckParameters(parentEntry, parent, index, mTree);
// test knn distances
MkTabEntry entry = parent.getEntry(index);
d... | [
"@",
"Override",
"protected",
"void",
"integrityCheckParameters",
"(",
"MkTabEntry",
"parentEntry",
",",
"MkTabTreeNode",
"<",
"O",
">",
"parent",
",",
"int",
"index",
",",
"AbstractMTree",
"<",
"O",
",",
"MkTabTreeNode",
"<",
"O",
">",
",",
"MkTabEntry",
",",... | Tests, if the parameters of the entry representing this node, are correctly
set. Subclasses may need to overwrite this method.
@param parent the parent holding the entry representing this node
@param index the index of the entry in the parents child array
@param mTree the underlying M-Tree | [
"Tests",
"if",
"the",
"parameters",
"of",
"the",
"entry",
"representing",
"this",
"node",
"are",
"correctly",
"set",
".",
"Subclasses",
"may",
"need",
"to",
"overwrite",
"this",
"method",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTreeNode.java#L97-L108 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/NIOFileUtil.java | NIOFileUtil.asPath | public static Path asPath(URI uri) {
"""
Convert the given path {@link URI} to a {@link Path} object.
@param uri the path to convert
@return a {@link Path} object
"""
try {
return Paths.get(uri);
} catch (FileSystemNotFoundException e) {
ClassLoader cl = Thread.currentThread().getContextC... | java | public static Path asPath(URI uri) {
try {
return Paths.get(uri);
} catch (FileSystemNotFoundException e) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
throw e;
}
try {
return FileSystems.newFileSystem(uri, new HashMap<>(), cl)... | [
"public",
"static",
"Path",
"asPath",
"(",
"URI",
"uri",
")",
"{",
"try",
"{",
"return",
"Paths",
".",
"get",
"(",
"uri",
")",
";",
"}",
"catch",
"(",
"FileSystemNotFoundException",
"e",
")",
"{",
"ClassLoader",
"cl",
"=",
"Thread",
".",
"currentThread",... | Convert the given path {@link URI} to a {@link Path} object.
@param uri the path to convert
@return a {@link Path} object | [
"Convert",
"the",
"given",
"path",
"{"
] | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/NIOFileUtil.java#L31-L45 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java | WorkflowExecutor.validateWorkflow | private void validateWorkflow(WorkflowDef workflowDef, Map<String, Object> workflowInput, String externalStoragePath) {
"""
Performs validations for starting a workflow
@throws ApplicationException if the validation fails
"""
try {
//Check if the input to the workflow is not null
... | java | private void validateWorkflow(WorkflowDef workflowDef, Map<String, Object> workflowInput, String externalStoragePath) {
try {
//Check if the input to the workflow is not null
if (workflowInput == null && StringUtils.isBlank(externalStoragePath)) {
LOGGER.error("The input ... | [
"private",
"void",
"validateWorkflow",
"(",
"WorkflowDef",
"workflowDef",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"workflowInput",
",",
"String",
"externalStoragePath",
")",
"{",
"try",
"{",
"//Check if the input to the workflow is not null",
"if",
"(",
"workfl... | Performs validations for starting a workflow
@throws ApplicationException if the validation fails | [
"Performs",
"validations",
"for",
"starting",
"a",
"workflow"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java#L313-L324 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/mapping/Mapper.java | Mapper.getClassFromCollection | @Deprecated
public Class<?> getClassFromCollection(final String collection) {
"""
Looks up the class mapped to a named collection.
@param collection the collection name
@return the Class mapped to this collection name
@morphia.internal
@deprecated no replacement is planned
"""
final Set<Mappe... | java | @Deprecated
public Class<?> getClassFromCollection(final String collection) {
final Set<MappedClass> mcs = mappedClassesByCollection.get(collection);
if (mcs == null || mcs.isEmpty()) {
throw new MappingException(format("The collection '%s' is not mapped to a java class.", collection));
... | [
"@",
"Deprecated",
"public",
"Class",
"<",
"?",
">",
"getClassFromCollection",
"(",
"final",
"String",
"collection",
")",
"{",
"final",
"Set",
"<",
"MappedClass",
">",
"mcs",
"=",
"mappedClassesByCollection",
".",
"get",
"(",
"collection",
")",
";",
"if",
"(... | Looks up the class mapped to a named collection.
@param collection the collection name
@return the Class mapped to this collection name
@morphia.internal
@deprecated no replacement is planned | [
"Looks",
"up",
"the",
"class",
"mapped",
"to",
"a",
"named",
"collection",
"."
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/Mapper.java#L325-L337 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java | RolloutHelper.verifyRolloutInStatus | public static void verifyRolloutInStatus(final Rollout rollout, final Rollout.RolloutStatus status) {
"""
Verifies that the Rollout is in the required status.
@param rollout
the Rollout
@param status
the Status
"""
if (!rollout.getStatus().equals(status)) {
throw new RolloutIllegalSta... | java | public static void verifyRolloutInStatus(final Rollout rollout, final Rollout.RolloutStatus status) {
if (!rollout.getStatus().equals(status)) {
throw new RolloutIllegalStateException("Rollout is not in status " + status.toString());
}
} | [
"public",
"static",
"void",
"verifyRolloutInStatus",
"(",
"final",
"Rollout",
"rollout",
",",
"final",
"Rollout",
".",
"RolloutStatus",
"status",
")",
"{",
"if",
"(",
"!",
"rollout",
".",
"getStatus",
"(",
")",
".",
"equals",
"(",
"status",
")",
")",
"{",
... | Verifies that the Rollout is in the required status.
@param rollout
the Rollout
@param status
the Status | [
"Verifies",
"that",
"the",
"Rollout",
"is",
"in",
"the",
"required",
"status",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L136-L140 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OSecurityHelper.java | OSecurityHelper.isAllowed | public static boolean isAllowed(ODocument doc, OrientPermission... permissions) {
"""
Check that all required permissions present for specified {@link ODocument}
@param doc {@link ODocument} to check security rights for
@param permissions {@link OrientPermission}s to check
@return true if all permissions are al... | java | public static boolean isAllowed(ODocument doc, OrientPermission... permissions)
{
if(!isAllowed(doc.getSchemaClass(), permissions)) return false;
for (OrientPermission orientPermission : permissions) {
ORestrictedOperation allowOperation = MAPPING_FOR_HACK.get(orientPermission);
if(allowOperation!=null)
{... | [
"public",
"static",
"boolean",
"isAllowed",
"(",
"ODocument",
"doc",
",",
"OrientPermission",
"...",
"permissions",
")",
"{",
"if",
"(",
"!",
"isAllowed",
"(",
"doc",
".",
"getSchemaClass",
"(",
")",
",",
"permissions",
")",
")",
"return",
"false",
";",
"f... | Check that all required permissions present for specified {@link ODocument}
@param doc {@link ODocument} to check security rights for
@param permissions {@link OrientPermission}s to check
@return true if all permissions are allowable | [
"Check",
"that",
"all",
"required",
"permissions",
"present",
"for",
"specified",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OSecurityHelper.java#L183-L194 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskTracker.java | TaskTracker.reportDiagnosticInfo | public synchronized void reportDiagnosticInfo(TaskAttemptID taskid, String info) throws IOException {
"""
Called when the task dies before completion, and we want to report back
diagnostic info
"""
TaskInProgress tip = tasks.get(taskid);
if (tip != null) {
tip.reportDiagnosticInfo(info);
} e... | java | public synchronized void reportDiagnosticInfo(TaskAttemptID taskid, String info) throws IOException {
TaskInProgress tip = tasks.get(taskid);
if (tip != null) {
tip.reportDiagnosticInfo(info);
} else {
LOG.warn("Error from unknown child task: "+taskid+". Ignored.");
}
} | [
"public",
"synchronized",
"void",
"reportDiagnosticInfo",
"(",
"TaskAttemptID",
"taskid",
",",
"String",
"info",
")",
"throws",
"IOException",
"{",
"TaskInProgress",
"tip",
"=",
"tasks",
".",
"get",
"(",
"taskid",
")",
";",
"if",
"(",
"tip",
"!=",
"null",
")... | Called when the task dies before completion, and we want to report back
diagnostic info | [
"Called",
"when",
"the",
"task",
"dies",
"before",
"completion",
"and",
"we",
"want",
"to",
"report",
"back",
"diagnostic",
"info"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L3635-L3642 |
apache/incubator-atlas | graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/GraphDbObjectFactory.java | GraphDbObjectFactory.createEdge | public static Titan1Edge createEdge(Titan1Graph graph, Edge source) {
"""
Creates a Titan1Edge that corresponds to the given Gremlin Edge.
@param graph The graph the edge should be created in
@param source The gremlin edge
"""
if (source == null) {
return null;
}
return... | java | public static Titan1Edge createEdge(Titan1Graph graph, Edge source) {
if (source == null) {
return null;
}
return new Titan1Edge(graph, source);
} | [
"public",
"static",
"Titan1Edge",
"createEdge",
"(",
"Titan1Graph",
"graph",
",",
"Edge",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"Titan1Edge",
"(",
"graph",
",",
"source",
")",
";",
... | Creates a Titan1Edge that corresponds to the given Gremlin Edge.
@param graph The graph the edge should be created in
@param source The gremlin edge | [
"Creates",
"a",
"Titan1Edge",
"that",
"corresponds",
"to",
"the",
"given",
"Gremlin",
"Edge",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/GraphDbObjectFactory.java#L48-L54 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/formatting/PatternMatchingSupport.java | PatternMatchingSupport.valueMatchesRegularExpression | public static boolean valueMatchesRegularExpression(String val, Pattern regexp) {
"""
Returns true only if the value matches the regular expression
at least once.
@param val string value that may match the expression
@param regexp regular expression
@return true if val matches regular expression regexp
"... | java | public static boolean valueMatchesRegularExpression(String val, Pattern regexp) {
Matcher m = regexp.matcher(val);
try {
return m.matches();
} catch (StackOverflowError e) {
e.printStackTrace();
System.out.println("-> [" + val + "][" + regexp + "]");
System.out.println("-> " + val.length());
Syste... | [
"public",
"static",
"boolean",
"valueMatchesRegularExpression",
"(",
"String",
"val",
",",
"Pattern",
"regexp",
")",
"{",
"Matcher",
"m",
"=",
"regexp",
".",
"matcher",
"(",
"val",
")",
";",
"try",
"{",
"return",
"m",
".",
"matches",
"(",
")",
";",
"}",
... | Returns true only if the value matches the regular expression
at least once.
@param val string value that may match the expression
@param regexp regular expression
@return true if val matches regular expression regexp | [
"Returns",
"true",
"only",
"if",
"the",
"value",
"matches",
"the",
"regular",
"expression",
"at",
"least",
"once",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/formatting/PatternMatchingSupport.java#L63-L75 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.addEntityChangeListener | public static void addEntityChangeListener(I_CmsEntityChangeListener changeListener, String changeScope) {
"""
Adds an entity change listener.<p>
@param changeListener the change listener
@param changeScope the change scope
"""
CmsDebugLog.getInstance().printLine("trying to ad change listener fo... | java | public static void addEntityChangeListener(I_CmsEntityChangeListener changeListener, String changeScope) {
CmsDebugLog.getInstance().printLine("trying to ad change listener for scope: " + changeScope);
if ((INSTANCE == null) || (INSTANCE.m_entityObserver == null)) {
CmsDebugLog.getInsta... | [
"public",
"static",
"void",
"addEntityChangeListener",
"(",
"I_CmsEntityChangeListener",
"changeListener",
",",
"String",
"changeScope",
")",
"{",
"CmsDebugLog",
".",
"getInstance",
"(",
")",
".",
"printLine",
"(",
"\"trying to ad change listener for scope: \"",
"+",
"cha... | Adds an entity change listener.<p>
@param changeListener the change listener
@param changeScope the change scope | [
"Adds",
"an",
"entity",
"change",
"listener",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L400-L420 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java | TelegramBot.answerInlineQuery | public boolean answerInlineQuery(String inlineQueryId, InlineQueryResponse inlineQueryResponse) {
"""
This allows you to respond to an inline query with an InlineQueryResponse object
@param inlineQueryId The ID of the inline query you are responding to
@param inlineQueryResponse The InlineQueryRespon... | java | public boolean answerInlineQuery(String inlineQueryId, InlineQueryResponse inlineQueryResponse) {
if (inlineQueryId != null && inlineQueryResponse != null) {
HttpResponse<String> response;
JSONObject jsonResponse;
try {
MultipartBody requests = Unirest.post... | [
"public",
"boolean",
"answerInlineQuery",
"(",
"String",
"inlineQueryId",
",",
"InlineQueryResponse",
"inlineQueryResponse",
")",
"{",
"if",
"(",
"inlineQueryId",
"!=",
"null",
"&&",
"inlineQueryResponse",
"!=",
"null",
")",
"{",
"HttpResponse",
"<",
"String",
">",
... | This allows you to respond to an inline query with an InlineQueryResponse object
@param inlineQueryId The ID of the inline query you are responding to
@param inlineQueryResponse The InlineQueryResponse object that you want to send to the user
@return True if the response was sent successfully, otherwise Fal... | [
"This",
"allows",
"you",
"to",
"respond",
"to",
"an",
"inline",
"query",
"with",
"an",
"InlineQueryResponse",
"object"
] | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L935-L965 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java | TransliteratorParser.resemblesPragma | static boolean resemblesPragma(String rule, int pos, int limit) {
"""
Return true if the given rule looks like a pragma.
@param pos offset to the first non-whitespace character
of the rule.
@param limit pointer past the last character of the rule.
"""
// Must start with /use\s/i
return Utili... | java | static boolean resemblesPragma(String rule, int pos, int limit) {
// Must start with /use\s/i
return Utility.parsePattern(rule, pos, limit, "use ", null) >= 0;
} | [
"static",
"boolean",
"resemblesPragma",
"(",
"String",
"rule",
",",
"int",
"pos",
",",
"int",
"limit",
")",
"{",
"// Must start with /use\\s/i",
"return",
"Utility",
".",
"parsePattern",
"(",
"rule",
",",
"pos",
",",
"limit",
",",
"\"use \"",
",",
"null",
")... | Return true if the given rule looks like a pragma.
@param pos offset to the first non-whitespace character
of the rule.
@param limit pointer past the last character of the rule. | [
"Return",
"true",
"if",
"the",
"given",
"rule",
"looks",
"like",
"a",
"pragma",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java#L1372-L1375 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4, R> Func4<T1, T2, T3, T4, Observable<R>> toAsync(Func4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/Reactiv... | java | public static <T1, T2, T3, T4, R> Func4<T1, T2, T3, T4, Observable<R>> toAsync(Func4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> func) {
return toAsync(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"R",
">",
"Func4",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"Observable",
"<",
"R",
">",
">",
"toAsync",
"(",
"Func4",
"<",
"?",
"super",
"T1",
",",
"?",
"super",
... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
@... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L363-L365 |
PeachTech/peachweb-peachproxy-java | src/main/java/com/peachfuzzer/web/api/PeachProxy.java | PeachProxy.sessionSetup | public void sessionSetup(String project, String profile) throws PeachApiException {
"""
Start a Peach API Security job.
This will start a new job with associated
proxy. Once the call returns the proxy is
ready to accept traffic.
Expected call flow:
sessionSetup(...)
Loop until finished:
testSetup(...... | java | public void sessionSetup(String project, String profile) throws PeachApiException
{
stashUnirestProxy();
if(_debug)
System.out.println(">>sessionSetup");
try
{
HttpResponse<JsonNode> ret = null;
try {
re... | [
"public",
"void",
"sessionSetup",
"(",
"String",
"project",
",",
"String",
"profile",
")",
"throws",
"PeachApiException",
"{",
"stashUnirestProxy",
"(",
")",
";",
"if",
"(",
"_debug",
")",
"System",
".",
"out",
".",
"println",
"(",
"\">>sessionSetup\"",
")",
... | Start a Peach API Security job.
This will start a new job with associated
proxy. Once the call returns the proxy is
ready to accept traffic.
Expected call flow:
sessionSetup(...)
Loop until finished:
testSetup(...)
testCase(...)
testTeardown(...)
suiteTeardown(...)
sessionTeardown(...)
@param project Name of proje... | [
"Start",
"a",
"Peach",
"API",
"Security",
"job",
"."
] | train | https://github.com/PeachTech/peachweb-peachproxy-java/blob/0ca274b0d1668fb4be0fed7e247394438374de58/src/main/java/com/peachfuzzer/web/api/PeachProxy.java#L239-L284 |
soi-toolkit/soi-toolkit-mule | commons/components/studio-components/src/main/java/org/soitoolkit/commons/studio/components/logger/LoggerModule.java | LoggerModule.logWarning | @Processor
public Object logWarning(
@Optional @FriendlyName("Log Message") String message,
@Optional String integrationScenario,
@Optional String messageType,
@Optional String contractId,
@Optional String correlationId,
@Optional @FriendlyName("Extra Info") Map<String, String> extra... | java | @Processor
public Object logWarning(
@Optional @FriendlyName("Log Message") String message,
@Optional String integrationScenario,
@Optional String messageType,
@Optional String contractId,
@Optional String correlationId,
@Optional @FriendlyName("Extra Info") Map<String, String> extra... | [
"@",
"Processor",
"public",
"Object",
"logWarning",
"(",
"@",
"Optional",
"@",
"FriendlyName",
"(",
"\"Log Message\"",
")",
"String",
"message",
",",
"@",
"Optional",
"String",
"integrationScenario",
",",
"@",
"Optional",
"String",
"messageType",
",",
"@",
"Opti... | Log processor for level WARNING
{@sample.xml ../../../doc/soitoolkit-connector.xml.sample soitoolkit:log-warning}
@param message Log-message to be processed
@param integrationScenario Optional name of the integration scenario or business process
@param messageType Optional name of the message type, e.g. a XML Schema ... | [
"Log",
"processor",
"for",
"level",
"WARNING"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/studio-components/src/main/java/org/soitoolkit/commons/studio/components/logger/LoggerModule.java#L227-L237 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/merge/SplitBrainMergePolicyProvider.java | SplitBrainMergePolicyProvider.getMergePolicy | public SplitBrainMergePolicy getMergePolicy(String className) {
"""
Resolves the {@link SplitBrainMergePolicy} class by its classname.
@param className the merge policy classname to resolve
@return the resolved {@link SplitBrainMergePolicy} class
@throws InvalidConfigurationException when the classname could ... | java | public SplitBrainMergePolicy getMergePolicy(String className) {
if (className == null) {
throw new InvalidConfigurationException("Class name is mandatory!");
}
return getOrPutIfAbsent(mergePolicyMap, className, policyConstructorFunction);
} | [
"public",
"SplitBrainMergePolicy",
"getMergePolicy",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"className",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidConfigurationException",
"(",
"\"Class name is mandatory!\"",
")",
";",
"}",
"return",
"getOrPutIfAbsent"... | Resolves the {@link SplitBrainMergePolicy} class by its classname.
@param className the merge policy classname to resolve
@return the resolved {@link SplitBrainMergePolicy} class
@throws InvalidConfigurationException when the classname could not be resolved | [
"Resolves",
"the",
"{",
"@link",
"SplitBrainMergePolicy",
"}",
"class",
"by",
"its",
"classname",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/merge/SplitBrainMergePolicyProvider.java#L88-L93 |
io7m/ieee754b16 | com.io7m.ieee754b16.core/src/main/java/com/io7m/ieee754b16/Binary16.java | Binary16.packFloat | public static char packFloat(
final float k) {
"""
<p>
Convert a single precision floating point value to a packed
{@code binary16} value.
</p>
<p>
For the following specific cases, the function returns:
</p>
<ul>
<li>{@code NaN} iff {@code isNaN(k)}</li>
<li>{@link #POSITIVE_INFINITY} iff
<code>k ==... | java | public static char packFloat(
final float k)
{
final int f32_bits = Float.floatToIntBits(k);
final int f16_sign = (f32_bits >>> 16) & 0x8000;
final int f32_unrounded = f32_bits & 0x7fffffff;
final int f32_rounded = f32_unrounded + 0x1000;
/*
* The 32-bit float might be large enough to be... | [
"public",
"static",
"char",
"packFloat",
"(",
"final",
"float",
"k",
")",
"{",
"final",
"int",
"f32_bits",
"=",
"Float",
".",
"floatToIntBits",
"(",
"k",
")",
";",
"final",
"int",
"f16_sign",
"=",
"(",
"f32_bits",
">>>",
"16",
")",
"&",
"0x8000",
";",
... | <p>
Convert a single precision floating point value to a packed
{@code binary16} value.
</p>
<p>
For the following specific cases, the function returns:
</p>
<ul>
<li>{@code NaN} iff {@code isNaN(k)}</li>
<li>{@link #POSITIVE_INFINITY} iff
<code>k == {@link Float#POSITIVE_INFINITY}</code></li>
<li>{@link #NEGATIVE_INFI... | [
"<p",
">",
"Convert",
"a",
"single",
"precision",
"floating",
"point",
"value",
"to",
"a",
"packed",
"{",
"@code",
"binary16",
"}",
"value",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"the",
"following",
"specific",
"cases",
"the",
"function",
"returns",... | train | https://github.com/io7m/ieee754b16/blob/39474026e6d069695adf5a14c5c326aadb7b4cf4/com.io7m.ieee754b16.core/src/main/java/com/io7m/ieee754b16/Binary16.java#L377-L418 |
ModeShape/modeshape | sequencers/modeshape-sequencer-xml/src/main/java/org/modeshape/sequencer/xml/XmlSequencerHandler.java | XmlSequencerHandler.endContent | protected void endContent() throws RepositoryException {
"""
See if there is any element content that needs to be completed.
@throws RepositoryException if there is a problem writing the content to the repository session
"""
// Process the content of the element ...
String content = StringUt... | java | protected void endContent() throws RepositoryException {
// Process the content of the element ...
String content = StringUtil.normalize(contentBuilder.toString());
// Null-out builder to setup for subsequent content.
// Must be done before call to startElement below to prevent infinite ... | [
"protected",
"void",
"endContent",
"(",
")",
"throws",
"RepositoryException",
"{",
"// Process the content of the element ...",
"String",
"content",
"=",
"StringUtil",
".",
"normalize",
"(",
"contentBuilder",
".",
"toString",
"(",
")",
")",
";",
"// Null-out builder to ... | See if there is any element content that needs to be completed.
@throws RepositoryException if there is a problem writing the content to the repository session | [
"See",
"if",
"there",
"is",
"any",
"element",
"content",
"that",
"needs",
"to",
"be",
"completed",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-xml/src/main/java/org/modeshape/sequencer/xml/XmlSequencerHandler.java#L104-L117 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.elementMult | public static void elementMult( DMatrixSparseCSC A, DMatrixSparseCSC B, DMatrixSparseCSC C ,
@Nullable IGrowArray gw, @Nullable DGrowArray gx) {
"""
Performs an element-wise multiplication.<br>
C[i,j] = A[i,j]*B[i,j]<br>
All matrices must have the same shape.
@param A (Inpu... | java | public static void elementMult( DMatrixSparseCSC A, DMatrixSparseCSC B, DMatrixSparseCSC C ,
@Nullable IGrowArray gw, @Nullable DGrowArray gx) {
if( A.numCols != B.numCols || A.numRows != B.numRows )
throw new MatrixDimensionException("All inputs must have the sam... | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrixSparseCSC",
"A",
",",
"DMatrixSparseCSC",
"B",
",",
"DMatrixSparseCSC",
"C",
",",
"@",
"Nullable",
"IGrowArray",
"gw",
",",
"@",
"Nullable",
"DGrowArray",
"gx",
")",
"{",
"if",
"(",
"A",
".",
"numCols",... | Performs an element-wise multiplication.<br>
C[i,j] = A[i,j]*B[i,j]<br>
All matrices must have the same shape.
@param A (Input) Matrix.
@param B (Input) Matrix
@param C (Output) Matrix. data array is grown to min(A.nz_length,B.nz_length), resulting a in a large speed boost.
@param gw (Optional) Storage for internal wo... | [
"Performs",
"an",
"element",
"-",
"wise",
"multiplication",
".",
"<br",
">",
"C",
"[",
"i",
"j",
"]",
"=",
"A",
"[",
"i",
"j",
"]",
"*",
"B",
"[",
"i",
"j",
"]",
"<br",
">",
"All",
"matrices",
"must",
"have",
"the",
"same",
"shape",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L565-L572 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.setParameters | @SuppressWarnings("unchecked")
protected void setParameters(PreparedStatement stmt, Object[] params) throws SQLException {
"""
Sets parameters to the PreparedStatement.
@param stmt the prepared statement
@param params the parameters
@throws SQLException if something goes wrong.
"""
for (in... | java | @SuppressWarnings("unchecked")
protected void setParameters(PreparedStatement stmt, Object[] params) throws SQLException {
for (int i = 0; i < params.length; i++) {
if(params[i] == null){
stmt.setObject(i + 1, null);
} else {
Class<?> propertType... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"setParameters",
"(",
"PreparedStatement",
"stmt",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".... | Sets parameters to the PreparedStatement.
@param stmt the prepared statement
@param params the parameters
@throws SQLException if something goes wrong. | [
"Sets",
"parameters",
"to",
"the",
"PreparedStatement",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L497-L515 |
camunda/camunda-spin | dataformat-json-jackson/src/main/java/org/camunda/spin/impl/json/jackson/JacksonJsonLogger.java | JacksonJsonLogger.unableToParseValue | public SpinJsonDataFormatException unableToParseValue(String expectedType, JsonNodeType type) {
"""
Exception handler if we are unable to parse a json value into a java representation
@param expectedType Name of the expected Type
@param type Type of the json node
@return SpinJsonDataFormatException
"""
... | java | public SpinJsonDataFormatException unableToParseValue(String expectedType, JsonNodeType type) {
return new SpinJsonDataFormatException(exceptionMessage("002", "Expected '{}', got '{}'", expectedType, type.toString()));
} | [
"public",
"SpinJsonDataFormatException",
"unableToParseValue",
"(",
"String",
"expectedType",
",",
"JsonNodeType",
"type",
")",
"{",
"return",
"new",
"SpinJsonDataFormatException",
"(",
"exceptionMessage",
"(",
"\"002\"",
",",
"\"Expected '{}', got '{}'\"",
",",
"expectedTy... | Exception handler if we are unable to parse a json value into a java representation
@param expectedType Name of the expected Type
@param type Type of the json node
@return SpinJsonDataFormatException | [
"Exception",
"handler",
"if",
"we",
"are",
"unable",
"to",
"parse",
"a",
"json",
"value",
"into",
"a",
"java",
"representation"
] | train | https://github.com/camunda/camunda-spin/blob/cfe65161eb97fd5023a945cb97c47fbfe69e9fdd/dataformat-json-jackson/src/main/java/org/camunda/spin/impl/json/jackson/JacksonJsonLogger.java#L52-L54 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java | CompiledFEELSemanticMappings.div | public static Object div(Object left, Object right) {
"""
FEEL spec Table 45
Delegates to {@link InfixOpNode} except evaluationcontext
"""
return InfixOpNode.div(left, right, null);
} | java | public static Object div(Object left, Object right) {
return InfixOpNode.div(left, right, null);
} | [
"public",
"static",
"Object",
"div",
"(",
"Object",
"left",
",",
"Object",
"right",
")",
"{",
"return",
"InfixOpNode",
".",
"div",
"(",
"left",
",",
"right",
",",
"null",
")",
";",
"}"
] | FEEL spec Table 45
Delegates to {@link InfixOpNode} except evaluationcontext | [
"FEEL",
"spec",
"Table",
"45",
"Delegates",
"to",
"{"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java#L322-L324 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallUser | public static UserBean unmarshallUser(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the user
"""
if (source == null) {
return null;
}
UserBean bean = new UserBean();
bean.setUsername(asString(source.... | java | public static UserBean unmarshallUser(Map<String, Object> source) {
if (source == null) {
return null;
}
UserBean bean = new UserBean();
bean.setUsername(asString(source.get("username")));
bean.setEmail(asString(source.get("email")));
bean.setFullName(asString... | [
"public",
"static",
"UserBean",
"unmarshallUser",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"UserBean",
"bean",
"=",
"new",
"UserBean",
"(",
")",
";",
"... | Unmarshals the given map source into a bean.
@param source the source
@return the user | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1134-L1145 |
grpc/grpc-java | examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java | RouteGuideClient.listFeatures | public void listFeatures(int lowLat, int lowLon, int hiLat, int hiLon) {
"""
Blocking server-streaming example. Calls listFeatures with a rectangle of interest. Prints each
response feature as it arrives.
"""
info("*** ListFeatures: lowLat={0} lowLon={1} hiLat={2} hiLon={3}", lowLat, lowLon, hiLat,
... | java | public void listFeatures(int lowLat, int lowLon, int hiLat, int hiLon) {
info("*** ListFeatures: lowLat={0} lowLon={1} hiLat={2} hiLon={3}", lowLat, lowLon, hiLat,
hiLon);
Rectangle request =
Rectangle.newBuilder()
.setLo(Point.newBuilder().setLatitude(lowLat).setLongitude(lowLon).b... | [
"public",
"void",
"listFeatures",
"(",
"int",
"lowLat",
",",
"int",
"lowLon",
",",
"int",
"hiLat",
",",
"int",
"hiLon",
")",
"{",
"info",
"(",
"\"*** ListFeatures: lowLat={0} lowLon={1} hiLat={2} hiLon={3}\"",
",",
"lowLat",
",",
"lowLon",
",",
"hiLat",
",",
"hi... | Blocking server-streaming example. Calls listFeatures with a rectangle of interest. Prints each
response feature as it arrives. | [
"Blocking",
"server",
"-",
"streaming",
"example",
".",
"Calls",
"listFeatures",
"with",
"a",
"rectangle",
"of",
"interest",
".",
"Prints",
"each",
"response",
"feature",
"as",
"it",
"arrives",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java#L103-L127 |
emilsjolander/sprinkles | library/src/main/java/se/emilsjolander/sprinkles/Query.java | Query.many | public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, int sqlResId,
Object... sqlArgs) {
"""
Start a query for a list of instance of type T
@param clazz
The class representing the type of the list you want returned
@param sqlResId... | java | public static <T extends QueryResult> ManyQuery<T> many(Class<T> clazz, int sqlResId,
Object... sqlArgs) {
String sql = Utils.readRawText(sqlResId);
return many(clazz, sql, sqlArgs);
} | [
"public",
"static",
"<",
"T",
"extends",
"QueryResult",
">",
"ManyQuery",
"<",
"T",
">",
"many",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"int",
"sqlResId",
",",
"Object",
"...",
"sqlArgs",
")",
"{",
"String",
"sql",
"=",
"Utils",
".",
"readRawText",... | Start a query for a list of instance of type T
@param clazz
The class representing the type of the list you want returned
@param sqlResId
The raw sql resource id that should be executed.
@param sqlArgs
The array of arguments to insert instead of ? in the placeholderQuery statement.
Strings are automatically placehol... | [
"Start",
"a",
"query",
"for",
"a",
"list",
"of",
"instance",
"of",
"type",
"T"
] | train | https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Query.java#L107-L111 |
twitter/cloudhopper-commons | ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/TypeOfAddress.java | TypeOfAddress.valueOf | public static TypeOfAddress valueOf(byte b) {
"""
Creates a TypeOfAddress from a GSM-encoded type of address byte.
@return
"""
// bits 0-3 are the ton (shift over 0, then only the first 4 bits)
int ton = (b & 0x0F);
// bits 4-7 are the npi (shift over 4, then only the first 3 bits)
... | java | public static TypeOfAddress valueOf(byte b) {
// bits 0-3 are the ton (shift over 0, then only the first 4 bits)
int ton = (b & 0x0F);
// bits 4-7 are the npi (shift over 4, then only the first 3 bits)
int npi = ((b >> 4) & 0x07);
// create our type of address now
return ... | [
"public",
"static",
"TypeOfAddress",
"valueOf",
"(",
"byte",
"b",
")",
"{",
"// bits 0-3 are the ton (shift over 0, then only the first 4 bits)",
"int",
"ton",
"=",
"(",
"b",
"&",
"0x0F",
")",
";",
"// bits 4-7 are the npi (shift over 4, then only the first 3 bits)",
"int",
... | Creates a TypeOfAddress from a GSM-encoded type of address byte.
@return | [
"Creates",
"a",
"TypeOfAddress",
"from",
"a",
"GSM",
"-",
"encoded",
"type",
"of",
"address",
"byte",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/TypeOfAddress.java#L83-L90 |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/pcm_Filter/mutate/PCMMutate.java | PCMMutate.clear_colonne | private static PCM clear_colonne(PCM pcm, PCM pcm_return) {
"""
Enlever les colonnes inutiles
@param pcmic : Le pcm info container du pcm
@param pcm : Le pcm
@return Le pcm avec les colonnes inutiles en moins
"""
List<Feature> pdts = pcm.getConcreteFeatures();
List<Cell> cells = new ArrayList<Cell>() ;
... | java | private static PCM clear_colonne(PCM pcm, PCM pcm_return){
List<Feature> pdts = pcm.getConcreteFeatures();
List<Cell> cells = new ArrayList<Cell>() ;
for (Feature pr : pdts) {
float nbCellsEmpty = 0 ;
// On ajoute les cellules du product dans une liste
cells = pr.getCells();
// On traite les infos des... | [
"private",
"static",
"PCM",
"clear_colonne",
"(",
"PCM",
"pcm",
",",
"PCM",
"pcm_return",
")",
"{",
"List",
"<",
"Feature",
">",
"pdts",
"=",
"pcm",
".",
"getConcreteFeatures",
"(",
")",
";",
"List",
"<",
"Cell",
">",
"cells",
"=",
"new",
"ArrayList",
... | Enlever les colonnes inutiles
@param pcmic : Le pcm info container du pcm
@param pcm : Le pcm
@return Le pcm avec les colonnes inutiles en moins | [
"Enlever",
"les",
"colonnes",
"inutiles"
] | train | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/pcm_Filter/mutate/PCMMutate.java#L88-L112 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/paintable/mapaddon/PanButtonCollection.java | PanButtonCollection.accept | public void accept(PainterVisitor visitor, Object group, Bbox bounds, boolean recursive) {
"""
Apply the correct positions on all panning buttons, and render them.
"""
// Apply position on all pan buttons:
applyPosition();
// Then render them:
map.getVectorContext().drawGroup(group, this);
map.getVe... | java | public void accept(PainterVisitor visitor, Object group, Bbox bounds, boolean recursive) {
// Apply position on all pan buttons:
applyPosition();
// Then render them:
map.getVectorContext().drawGroup(group, this);
map.getVectorContext().drawImage(this, background.getId(), background.getHref(), background.get... | [
"public",
"void",
"accept",
"(",
"PainterVisitor",
"visitor",
",",
"Object",
"group",
",",
"Bbox",
"bounds",
",",
"boolean",
"recursive",
")",
"{",
"// Apply position on all pan buttons:",
"applyPosition",
"(",
")",
";",
"// Then render them:",
"map",
".",
"getVecto... | Apply the correct positions on all panning buttons, and render them. | [
"Apply",
"the",
"correct",
"positions",
"on",
"all",
"panning",
"buttons",
"and",
"render",
"them",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/paintable/mapaddon/PanButtonCollection.java#L104-L116 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java | DateControl.setEntryEditPolicy | public final void setEntryEditPolicy(Callback<EntryEditParameter, Boolean> policy) {
"""
Sets the value of {@link #entryEditPolicy}.
@param policy the entry edit policy callback
@see EditOperation
"""
Objects.requireNonNull(policy, "The edit entry policy can not be null");
this.entryEditP... | java | public final void setEntryEditPolicy(Callback<EntryEditParameter, Boolean> policy) {
Objects.requireNonNull(policy, "The edit entry policy can not be null");
this.entryEditPolicy.set(policy);
} | [
"public",
"final",
"void",
"setEntryEditPolicy",
"(",
"Callback",
"<",
"EntryEditParameter",
",",
"Boolean",
">",
"policy",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"policy",
",",
"\"The edit entry policy can not be null\"",
")",
";",
"this",
".",
"entryEdit... | Sets the value of {@link #entryEditPolicy}.
@param policy the entry edit policy callback
@see EditOperation | [
"Sets",
"the",
"value",
"of",
"{",
"@link",
"#entryEditPolicy",
"}",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java#L1152-L1155 |
apptik/JustJson | json-core/src/main/java/io/apptik/json/JsonObject.java | JsonObject.putOpt | public JsonObject putOpt(String name, Object value) throws JsonException {
"""
Equivalent to {@code put(name, value)} when both parameters are non-null;
does nothing otherwise.
"""
if (name == null || value == null) {
return this;
}
return put(name, value);
} | java | public JsonObject putOpt(String name, Object value) throws JsonException {
if (name == null || value == null) {
return this;
}
return put(name, value);
} | [
"public",
"JsonObject",
"putOpt",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"JsonException",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"return",
"put",
"(",
"name",
",",... | Equivalent to {@code put(name, value)} when both parameters are non-null;
does nothing otherwise. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L216-L221 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.startElement | public void startElement(String elemName, String attrName, String attrValue) {
"""
Start a new XML element using the given start tag and single attribute.
"""
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", attrName, "", "CDATA", attrValue);
writeStartElement(elem... | java | public void startElement(String elemName, String attrName, String attrValue) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", attrName, "", "CDATA", attrValue);
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | [
"public",
"void",
"startElement",
"(",
"String",
"elemName",
",",
"String",
"attrName",
",",
"String",
"attrValue",
")",
"{",
"AttributesImpl",
"attrs",
"=",
"new",
"AttributesImpl",
"(",
")",
";",
"attrs",
".",
"addAttribute",
"(",
"\"\"",
",",
"attrName",
... | Start a new XML element using the given start tag and single attribute. | [
"Start",
"a",
"new",
"XML",
"element",
"using",
"the",
"given",
"start",
"tag",
"and",
"single",
"attribute",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L73-L78 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.getGatewaySettings | public GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName) {
"""
Gets the gateway settings for the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fai... | java | public GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName) {
return getGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"GatewaySettingsInner",
"getGatewaySettings",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"getGatewaySettingsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",
".",... | Gets the gateway settings for the specified cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeE... | [
"Gets",
"the",
"gateway",
"settings",
"for",
"the",
"specified",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1463-L1465 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java | ToStream.addCdataSectionElement | private void addCdataSectionElement(String URI_and_localName, Vector v) {
"""
Adds a URI/LocalName pair of strings to the list.
@param URI_and_localName String of the form "{uri}local" or "local"
@return a QName object
"""
StringTokenizer tokenizer =
new StringTokenizer(URI_and_local... | java | private void addCdataSectionElement(String URI_and_localName, Vector v)
{
StringTokenizer tokenizer =
new StringTokenizer(URI_and_localName, "{}", false);
String s1 = tokenizer.nextToken();
String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
if (null =... | [
"private",
"void",
"addCdataSectionElement",
"(",
"String",
"URI_and_localName",
",",
"Vector",
"v",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"URI_and_localName",
",",
"\"{}\"",
",",
"false",
")",
";",
"String",
"s1",
"=",
"t... | Adds a URI/LocalName pair of strings to the list.
@param URI_and_localName String of the form "{uri}local" or "local"
@return a QName object | [
"Adds",
"a",
"URI",
"/",
"LocalName",
"pair",
"of",
"strings",
"to",
"the",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L2780-L2800 |
killme2008/xmemcached | src/main/java/com/google/code/yanf4j/util/LinkedTransferQueue.java | LinkedTransferQueue.advanceHead | private boolean advanceHead(QNode h, QNode nh) {
"""
Tries to cas nh as new head; if successful, unlink old head's next node to avoid garbage
retention.
"""
if (h == this.head.get() && this.head.compareAndSet(h, nh)) {
h.next = h; // forget old next
return true;
}
return false;
} | java | private boolean advanceHead(QNode h, QNode nh) {
if (h == this.head.get() && this.head.compareAndSet(h, nh)) {
h.next = h; // forget old next
return true;
}
return false;
} | [
"private",
"boolean",
"advanceHead",
"(",
"QNode",
"h",
",",
"QNode",
"nh",
")",
"{",
"if",
"(",
"h",
"==",
"this",
".",
"head",
".",
"get",
"(",
")",
"&&",
"this",
".",
"head",
".",
"compareAndSet",
"(",
"h",
",",
"nh",
")",
")",
"{",
"h",
"."... | Tries to cas nh as new head; if successful, unlink old head's next node to avoid garbage
retention. | [
"Tries",
"to",
"cas",
"nh",
"as",
"new",
"head",
";",
"if",
"successful",
"unlink",
"old",
"head",
"s",
"next",
"node",
"to",
"avoid",
"garbage",
"retention",
"."
] | train | https://github.com/killme2008/xmemcached/blob/66150915938813b3e3413de1d7b43b6ff9b1478d/src/main/java/com/google/code/yanf4j/util/LinkedTransferQueue.java#L203-L209 |
alkacon/opencms-core | src/org/opencms/jsp/search/controller/CmsSearchControllerCommon.java | CmsSearchControllerCommon.resolveMacro | private String resolveMacro(final String string, final String macroName, final String value) {
"""
Replaces the macro with the value, unless the value is <code>null</code>, then the macro is kept.
@param string The String where the macros should be replaced.
@param value The value used for the replacement.
@p... | java | private String resolveMacro(final String string, final String macroName, final String value) {
return null != value ? string.replaceAll("\\%\\(" + Pattern.quote(macroName) + "\\)", value) : string;
} | [
"private",
"String",
"resolveMacro",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"macroName",
",",
"final",
"String",
"value",
")",
"{",
"return",
"null",
"!=",
"value",
"?",
"string",
".",
"replaceAll",
"(",
"\"\\\\%\\\\(\"",
"+",
"Pattern",
"... | Replaces the macro with the value, unless the value is <code>null</code>, then the macro is kept.
@param string The String where the macros should be replaced.
@param value The value used for the replacement.
@param macroName The name of the macro to resolve.
@return The original String with %(value) macros replaced. | [
"Replaces",
"the",
"macro",
"with",
"the",
"value",
"unless",
"the",
"value",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"then",
"the",
"macro",
"is",
"kept",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/controller/CmsSearchControllerCommon.java#L228-L231 |
GCRC/nunaliit | nunaliit2-auth-common/src/main/java/ca/carleton/gcrc/auth/common/AuthenticationUtils.java | AuthenticationUtils.sendAuthRequiredError | static public void sendAuthRequiredError(HttpServletResponse response, String realm) throws IOException {
"""
Sends a response to the client stating that authorization is required.
@param response Response used to send error message
@param realm Realm that client should provide authorization for
@throws IOExcep... | java | static public void sendAuthRequiredError(HttpServletResponse response, String realm) throws IOException {
response.setHeader("WWW-Authenticate", "Basic realm=\""+realm+"\"");
response.setHeader("Cache-Control", "no-cache,must-revalidate");
response.setDateHeader("Expires", (new Date()).getTime());
response.send... | [
"static",
"public",
"void",
"sendAuthRequiredError",
"(",
"HttpServletResponse",
"response",
",",
"String",
"realm",
")",
"throws",
"IOException",
"{",
"response",
".",
"setHeader",
"(",
"\"WWW-Authenticate\"",
",",
"\"Basic realm=\\\"\"",
"+",
"realm",
"+",
"\"\\\"\"... | Sends a response to the client stating that authorization is required.
@param response Response used to send error message
@param realm Realm that client should provide authorization for
@throws IOException | [
"Sends",
"a",
"response",
"to",
"the",
"client",
"stating",
"that",
"authorization",
"is",
"required",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-auth-common/src/main/java/ca/carleton/gcrc/auth/common/AuthenticationUtils.java#L97-L102 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java | ValueMap.withList | public ValueMap withList(String key, Object ... vals) {
"""
Sets the value of the specified key in the current ValueMap to the
given values as a list.
"""
super.put(key,
vals == null ? null : new ArrayList<Object>(Arrays.asList(vals)));
return this;
} | java | public ValueMap withList(String key, Object ... vals) {
super.put(key,
vals == null ? null : new ArrayList<Object>(Arrays.asList(vals)));
return this;
} | [
"public",
"ValueMap",
"withList",
"(",
"String",
"key",
",",
"Object",
"...",
"vals",
")",
"{",
"super",
".",
"put",
"(",
"key",
",",
"vals",
"==",
"null",
"?",
"null",
":",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
"Arrays",
".",
"asList",
"(",
... | Sets the value of the specified key in the current ValueMap to the
given values as a list. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"key",
"in",
"the",
"current",
"ValueMap",
"to",
"the",
"given",
"values",
"as",
"a",
"list",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java#L167-L171 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.copyStream | public static void copyStream( InputStream in, File outputFile ) throws IOException {
"""
Copies the content from in into outputFile.
<p>
<i>in</i> is not closed by this method.<br>
It must be explicitly closed after this method is called.
</p>
@param in an input stream (not null)
@param outputFile will be... | java | public static void copyStream( InputStream in, File outputFile ) throws IOException {
OutputStream os = new FileOutputStream( outputFile );
try {
copyStreamUnsafelyUseWithCaution( in, os );
} finally {
os.close ();
}
} | [
"public",
"static",
"void",
"copyStream",
"(",
"InputStream",
"in",
",",
"File",
"outputFile",
")",
"throws",
"IOException",
"{",
"OutputStream",
"os",
"=",
"new",
"FileOutputStream",
"(",
"outputFile",
")",
";",
"try",
"{",
"copyStreamUnsafelyUseWithCaution",
"("... | Copies the content from in into outputFile.
<p>
<i>in</i> is not closed by this method.<br>
It must be explicitly closed after this method is called.
</p>
@param in an input stream (not null)
@param outputFile will be created if it does not exist
@throws IOException if the file could not be created | [
"Copies",
"the",
"content",
"from",
"in",
"into",
"outputFile",
".",
"<p",
">",
"<i",
">",
"in<",
"/",
"i",
">",
"is",
"not",
"closed",
"by",
"this",
"method",
".",
"<br",
">",
"It",
"must",
"be",
"explicitly",
"closed",
"after",
"this",
"method",
"i... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L354-L361 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.validationConstraints | public Map<String, Map<String, Map<String, Map<String, ?>>>> validationConstraints() {
"""
Returns the validation constraints map.
@return a map containing all validation constraints.
"""
return getEntity(invokeGet("_constraints", null), Map.class);
} | java | public Map<String, Map<String, Map<String, Map<String, ?>>>> validationConstraints() {
return getEntity(invokeGet("_constraints", null), Map.class);
} | [
"public",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"?",
">",
">",
">",
">",
"validationConstraints",
"(",
")",
"{",
"return",
"getEntity",
"(",
"invokeGet",
"(",
"\"_constraints\"",
","... | Returns the validation constraints map.
@return a map containing all validation constraints. | [
"Returns",
"the",
"validation",
"constraints",
"map",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1358-L1360 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/SharesInner.java | SharesInner.beginRefresh | public void beginRefresh(String deviceName, String name, String resourceGroupName) {
"""
Refreshes the share metadata with the data from the cloud.
@param deviceName The device name.
@param name The share name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if param... | java | public void beginRefresh(String deviceName, String name, String resourceGroupName) {
beginRefreshWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body();
} | [
"public",
"void",
"beginRefresh",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
")",
"{",
"beginRefreshWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroupName",
")",
".",
"toBlocking",
"(",
")",
... | Refreshes the share metadata with the data from the cloud.
@param deviceName The device name.
@param name The share name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throw... | [
"Refreshes",
"the",
"share",
"metadata",
"with",
"the",
"data",
"from",
"the",
"cloud",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/SharesInner.java#L759-L761 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.getObjects | public JSONObject getObjects(List<String> objectIDs) throws AlgoliaException {
"""
Get several objects from this index
@param objectIDs the array of unique identifier of objects to retrieve
"""
return getObjects(objectIDs, null, RequestOptions.empty);
} | java | public JSONObject getObjects(List<String> objectIDs) throws AlgoliaException {
return getObjects(objectIDs, null, RequestOptions.empty);
} | [
"public",
"JSONObject",
"getObjects",
"(",
"List",
"<",
"String",
">",
"objectIDs",
")",
"throws",
"AlgoliaException",
"{",
"return",
"getObjects",
"(",
"objectIDs",
",",
"null",
",",
"RequestOptions",
".",
"empty",
")",
";",
"}"
] | Get several objects from this index
@param objectIDs the array of unique identifier of objects to retrieve | [
"Get",
"several",
"objects",
"from",
"this",
"index"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L281-L283 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.writeField | public static void writeField(final Field field, final Object target, final Object value) throws IllegalAccessException {
"""
Writes an accessible {@link Field}.
@param field
to write
@param target
the object to call on, may be {@code null} for {@code static} fields
@param value
to set
@throws IllegalAcce... | java | public static void writeField(final Field field, final Object target, final Object value) throws IllegalAccessException {
writeField(field, target, value, false);
} | [
"public",
"static",
"void",
"writeField",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"target",
",",
"final",
"Object",
"value",
")",
"throws",
"IllegalAccessException",
"{",
"writeField",
"(",
"field",
",",
"target",
",",
"value",
",",
"false",
... | Writes an accessible {@link Field}.
@param field
to write
@param target
the object to call on, may be {@code null} for {@code static} fields
@param value
to set
@throws IllegalAccessException
if the field or target is {@code null}, the field is not accessible or is {@code final}, or
{@code value} is not assignable | [
"Writes",
"an",
"accessible",
"{",
"@link",
"Field",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L661-L663 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java | GrailsHibernateUtil.cacheCriteriaByMapping | public static void cacheCriteriaByMapping(Class<?> targetClass, Criteria criteria) {
"""
Configures the criteria instance to cache based on the configured mapping.
@param targetClass The target class
@param criteria The criteria
"""
Mapping m = GrailsDomainBinder.getMapping(targetClass);
if... | java | public static void cacheCriteriaByMapping(Class<?> targetClass, Criteria criteria) {
Mapping m = GrailsDomainBinder.getMapping(targetClass);
if (m != null && m.getCache() != null && m.getCache().getEnabled()) {
criteria.setCacheable(true);
}
} | [
"public",
"static",
"void",
"cacheCriteriaByMapping",
"(",
"Class",
"<",
"?",
">",
"targetClass",
",",
"Criteria",
"criteria",
")",
"{",
"Mapping",
"m",
"=",
"GrailsDomainBinder",
".",
"getMapping",
"(",
"targetClass",
")",
";",
"if",
"(",
"m",
"!=",
"null",... | Configures the criteria instance to cache based on the configured mapping.
@param targetClass The target class
@param criteria The criteria | [
"Configures",
"the",
"criteria",
"instance",
"to",
"cache",
"based",
"on",
"the",
"configured",
"mapping",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java#L256-L261 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Sets.java | Sets.assign | public static final <T> void assign(Set<T> source, Set<T> target) {
"""
Sets target content to be the same as source without clearing the target.
@param <T>
@param source
@param target
"""
target.retainAll(source);
target.addAll(source);
} | java | public static final <T> void assign(Set<T> source, Set<T> target)
{
target.retainAll(source);
target.addAll(source);
} | [
"public",
"static",
"final",
"<",
"T",
">",
"void",
"assign",
"(",
"Set",
"<",
"T",
">",
"source",
",",
"Set",
"<",
"T",
">",
"target",
")",
"{",
"target",
".",
"retainAll",
"(",
"source",
")",
";",
"target",
".",
"addAll",
"(",
"source",
")",
";... | Sets target content to be the same as source without clearing the target.
@param <T>
@param source
@param target | [
"Sets",
"target",
"content",
"to",
"be",
"the",
"same",
"as",
"source",
"without",
"clearing",
"the",
"target",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Sets.java#L224-L228 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/handler/AnnotationEventHandler.java | AnnotationEventHandler.callMethod | private void callMethod(final String methodName, final Event event) {
"""
Call the method into the callback object.
@param methodName the method name to call
@param event the event to trigger
"""
final Class<?> ctrlClass = this.callbackObject.getClass();
try {
final Method meth... | java | private void callMethod(final String methodName, final Event event) {
final Class<?> ctrlClass = this.callbackObject.getClass();
try {
final Method method = ctrlClass.getDeclaredMethod(methodName, event.getClass());
ClassUtility.callMethod(method, this.callbackObject, event);
... | [
"private",
"void",
"callMethod",
"(",
"final",
"String",
"methodName",
",",
"final",
"Event",
"event",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"ctrlClass",
"=",
"this",
".",
"callbackObject",
".",
"getClass",
"(",
")",
";",
"try",
"{",
"final",
"Metho... | Call the method into the callback object.
@param methodName the method name to call
@param event the event to trigger | [
"Call",
"the",
"method",
"into",
"the",
"callback",
"object",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/handler/AnnotationEventHandler.java#L198-L210 |
atomix/atomix | utils/src/main/java/io/atomix/utils/config/ConfigMapper.java | ConfigMapper.map | @SuppressWarnings("unchecked")
protected <T> T map(Config config, String path, String name, Class<T> clazz) {
"""
Applies the given configuration to the given type.
@param config the configuration to apply
@param clazz the class to which to apply the configuration
"""
T instance = newInstance(config... | java | @SuppressWarnings("unchecked")
protected <T> T map(Config config, String path, String name, Class<T> clazz) {
T instance = newInstance(config, name, clazz);
// Map config property names to bean properties.
Map<String, String> propertyNames = new HashMap<>();
for (Map.Entry<String, ConfigValue> config... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"T",
">",
"T",
"map",
"(",
"Config",
"config",
",",
"String",
"path",
",",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"T",
"instance",
"=",
"newInstance",
"(",... | Applies the given configuration to the given type.
@param config the configuration to apply
@param clazz the class to which to apply the configuration | [
"Applies",
"the",
"given",
"configuration",
"to",
"the",
"given",
"type",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/config/ConfigMapper.java#L151-L176 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java | SqlSelectStatement.appendColumn | protected void appendColumn(TableAlias anAlias, FieldDescriptor field, StringBuffer buf) {
"""
Append a Column with alias: A0 name -> A0.name
@param anAlias the TableAlias
@param field
@param buf
"""
buf.append(anAlias.alias);
buf.append(".");
buf.append(field.getColumnName());
... | java | protected void appendColumn(TableAlias anAlias, FieldDescriptor field, StringBuffer buf)
{
buf.append(anAlias.alias);
buf.append(".");
buf.append(field.getColumnName());
} | [
"protected",
"void",
"appendColumn",
"(",
"TableAlias",
"anAlias",
",",
"FieldDescriptor",
"field",
",",
"StringBuffer",
"buf",
")",
"{",
"buf",
".",
"append",
"(",
"anAlias",
".",
"alias",
")",
";",
"buf",
".",
"append",
"(",
"\".\"",
")",
";",
"buf",
"... | Append a Column with alias: A0 name -> A0.name
@param anAlias the TableAlias
@param field
@param buf | [
"Append",
"a",
"Column",
"with",
"alias",
":",
"A0",
"name",
"-",
">",
"A0",
".",
"name"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java#L81-L86 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/AbstractList.java | AbstractList.beforeInsertAllOf | public void beforeInsertAllOf(int index, java.util.Collection collection) {
"""
Inserts all elements of the specified collection before the specified position into the receiver.
Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices).
@param i... | java | public void beforeInsertAllOf(int index, java.util.Collection collection) {
this.beforeInsertDummies(index, collection.size());
this.replaceFromWith(index, collection);
} | [
"public",
"void",
"beforeInsertAllOf",
"(",
"int",
"index",
",",
"java",
".",
"util",
".",
"Collection",
"collection",
")",
"{",
"this",
".",
"beforeInsertDummies",
"(",
"index",
",",
"collection",
".",
"size",
"(",
")",
")",
";",
"this",
".",
"replaceFrom... | Inserts all elements of the specified collection before the specified position into the receiver.
Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices).
@param index index before which to insert first element from the specified collection.
@param coll... | [
"Inserts",
"all",
"elements",
"of",
"the",
"specified",
"collection",
"before",
"the",
"specified",
"position",
"into",
"the",
"receiver",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
"any",
")",
"and",
"any",
"subsequent"... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/AbstractList.java#L49-L52 |
rey5137/material | material/src/main/java/com/rey/material/widget/DatePicker.java | DatePicker.setDateRange | public void setDateRange(int minDay, int minMonth, int minYear, int maxDay, int maxMonth, int maxYear) {
"""
Set the range of selectable dates.
@param minDay The day value of minimum date.
@param minMonth The month value of minimum date.
@param minYear The year value of minimum date.
@param maxDay The day valu... | java | public void setDateRange(int minDay, int minMonth, int minYear, int maxDay, int maxMonth, int maxYear){
mAdapter.setDateRange(minDay, minMonth, minYear, maxDay, maxMonth, maxYear);
} | [
"public",
"void",
"setDateRange",
"(",
"int",
"minDay",
",",
"int",
"minMonth",
",",
"int",
"minYear",
",",
"int",
"maxDay",
",",
"int",
"maxMonth",
",",
"int",
"maxYear",
")",
"{",
"mAdapter",
".",
"setDateRange",
"(",
"minDay",
",",
"minMonth",
",",
"m... | Set the range of selectable dates.
@param minDay The day value of minimum date.
@param minMonth The month value of minimum date.
@param minYear The year value of minimum date.
@param maxDay The day value of maximum date.
@param maxMonth The month value of maximum date.
@param maxYear The year value of maximum date. | [
"Set",
"the",
"range",
"of",
"selectable",
"dates",
"."
] | train | https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/DatePicker.java#L388-L390 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/Statement.java | Statement.writeMethodTo | private final void writeMethodTo(CodeBuilder builder) {
"""
Writes this statement as the complete method body to {@code ga}.
"""
builder.visitCode();
gen(builder);
try {
builder.endMethod();
} catch (Throwable t) {
// ASM fails in bizarre ways, attach a trace of the thing we tried t... | java | private final void writeMethodTo(CodeBuilder builder) {
builder.visitCode();
gen(builder);
try {
builder.endMethod();
} catch (Throwable t) {
// ASM fails in bizarre ways, attach a trace of the thing we tried to generate to the
// exception.
throw new RuntimeException("Failed to ... | [
"private",
"final",
"void",
"writeMethodTo",
"(",
"CodeBuilder",
"builder",
")",
"{",
"builder",
".",
"visitCode",
"(",
")",
";",
"gen",
"(",
"builder",
")",
";",
"try",
"{",
"builder",
".",
"endMethod",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"... | Writes this statement as the complete method body to {@code ga}. | [
"Writes",
"this",
"statement",
"as",
"the",
"complete",
"method",
"body",
"to",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Statement.java#L140-L150 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.toDouble | public static final Function<String,Double> toDouble(final int scale, final RoundingMode roundingMode) {
"""
<p>
Converts a String into a Double, using the default configuration
for for decimal point and thousands separator and establishing the specified scale. Rounding
mode is used for setting the scale to the... | java | public static final Function<String,Double> toDouble(final int scale, final RoundingMode roundingMode) {
return new ToDouble(scale, roundingMode);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"Double",
">",
"toDouble",
"(",
"final",
"int",
"scale",
",",
"final",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"new",
"ToDouble",
"(",
"scale",
",",
"roundingMode",
")",
";",
"}"
] | <p>
Converts a String into a Double, using the default configuration
for for decimal point and thousands separator and establishing the specified scale. Rounding
mode is used for setting the scale to the specified value.
The input string must be between
{@link Double#MIN_VALUE} and {@link Double#MAX_VALUE}
</p>
@param... | [
"<p",
">",
"Converts",
"a",
"String",
"into",
"a",
"Double",
"using",
"the",
"default",
"configuration",
"for",
"for",
"decimal",
"point",
"and",
"thousands",
"separator",
"and",
"establishing",
"the",
"specified",
"scale",
".",
"Rounding",
"mode",
"is",
"used... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L482-L484 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/ntp_param.java | ntp_param.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>
"""
ntp_param_responses result = (ntp_param_responses) service.get_payload_... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ntp_param_responses result = (ntp_param_responses) service.get_payload_formatter().string_to_resource(ntp_param_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",
"{",
"ntp_param_responses",
"result",
"=",
"(",
"ntp_param_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/ntp_param.java#L289-L306 |
Chorus-bdd/Chorus | extensions/chorus-spring/src/main/java/org/chorusbdd/chorus/spring/SpringContextInjector.java | SpringContextInjector.injectResourceFields | public static void injectResourceFields(ApplicationContext springContext, Object... handlers ) {
"""
Inject the fields annotated with @Resource annotation with beans from a SpringContext, using the field
name to match the bean name, or where a different annotation value is supplied use the annotation value
as th... | java | public static void injectResourceFields(ApplicationContext springContext, Object... handlers ) {
for (Object handler : handlers) {
Class handlerClass = handler.getClass();
injectResourceFields(springContext, handler, handlerClass);
}
} | [
"public",
"static",
"void",
"injectResourceFields",
"(",
"ApplicationContext",
"springContext",
",",
"Object",
"...",
"handlers",
")",
"{",
"for",
"(",
"Object",
"handler",
":",
"handlers",
")",
"{",
"Class",
"handlerClass",
"=",
"handler",
".",
"getClass",
"(",... | Inject the fields annotated with @Resource annotation with beans from a SpringContext, using the field
name to match the bean name, or where a different annotation value is supplied use the annotation value
as the bean name
@param handlers handler instances to configure
@param springContext Spring context... | [
"Inject",
"the",
"fields",
"annotated",
"with",
"@Resource",
"annotation",
"with",
"beans",
"from",
"a",
"SpringContext",
"using",
"the",
"field",
"name",
"to",
"match",
"the",
"bean",
"name",
"or",
"where",
"a",
"different",
"annotation",
"value",
"is",
"supp... | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-spring/src/main/java/org/chorusbdd/chorus/spring/SpringContextInjector.java#L118-L124 |
alipay/sofa-rpc | extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/FaultToleranceConfigManager.java | FaultToleranceConfigManager.putAppConfig | public static void putAppConfig(String appName, FaultToleranceConfig value) {
"""
Put app config.
@param appName the app name
@param value the value
"""
if (appName == null) {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("App name is null when put fault-tolerance config")... | java | public static void putAppConfig(String appName, FaultToleranceConfig value) {
if (appName == null) {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("App name is null when put fault-tolerance config");
}
return;
}
if (value != null) {
APP... | [
"public",
"static",
"void",
"putAppConfig",
"(",
"String",
"appName",
",",
"FaultToleranceConfig",
"value",
")",
"{",
"if",
"(",
"appName",
"==",
"null",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"warn",
"(",... | Put app config.
@param appName the app name
@param value the value | [
"Put",
"app",
"config",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/FaultToleranceConfigManager.java#L60-L79 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateNotNull | public static <T> T validateNotNull(T value, String errorMsgTemplate, Object... params) throws ValidateException {
"""
检查指定值是否非<code>null</code>
@param <T> 被检查的对象类型
@param value 值
@param errorMsgTemplate 错误消息内容模板(变量使用{}表示)
@param params 模板中变量替换后的值
@return 检查过后的值
@throws ValidateException 检查不满足条件抛出的异常
"... | java | public static <T> T validateNotNull(T value, String errorMsgTemplate, Object... params) throws ValidateException {
if (isNull(value)) {
throw new ValidateException(errorMsgTemplate, params);
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"validateNotNull",
"(",
"T",
"value",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"isNull",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"V... | 检查指定值是否非<code>null</code>
@param <T> 被检查的对象类型
@param value 值
@param errorMsgTemplate 错误消息内容模板(变量使用{}表示)
@param params 模板中变量替换后的值
@return 检查过后的值
@throws ValidateException 检查不满足条件抛出的异常 | [
"检查指定值是否非<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L164-L169 |
tvesalainen/util | util/src/main/java/org/vesalainen/lang/Primitives.java | Primitives.readInt | public static final int readInt(byte[] array, int offset) {
"""
Read value from byte array
@param array
@param offset
@return
@see java.nio.ByteBuffer#getInt(int)
"""
if (array.length < offset + 4)
{
throw new IllegalArgumentException("no room in array");
}
... | java | public static final int readInt(byte[] array, int offset)
{
if (array.length < offset + 4)
{
throw new IllegalArgumentException("no room in array");
}
return
((array[offset]<<24) & 0xff000000) +
((array[offset + 1]<<16) & 0xff0000) ... | [
"public",
"static",
"final",
"int",
"readInt",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"array",
".",
"length",
"<",
"offset",
"+",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"no room in array\"",
... | Read value from byte array
@param array
@param offset
@return
@see java.nio.ByteBuffer#getInt(int) | [
"Read",
"value",
"from",
"byte",
"array"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L358-L369 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/ConstantSize.java | ConstantSize.valueOf | static ConstantSize valueOf(String encodedValueAndUnit, boolean horizontal) {
"""
Creates and returns a ConstantSize from the given encoded size and unit description.
@param encodedValueAndUnit the size's value and unit as string, trimmed and in lower case
@param horizontal true for horizontal, false for verti... | java | static ConstantSize valueOf(String encodedValueAndUnit, boolean horizontal) {
String[] split = ConstantSize.splitValueAndUnit(encodedValueAndUnit);
String encodedValue = split[0];
String encodedUnit = split[1];
Unit unit = Unit.valueOf(encodedUnit, horizontal);
double value = Dou... | [
"static",
"ConstantSize",
"valueOf",
"(",
"String",
"encodedValueAndUnit",
",",
"boolean",
"horizontal",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"ConstantSize",
".",
"splitValueAndUnit",
"(",
"encodedValueAndUnit",
")",
";",
"String",
"encodedValue",
"=",
"spl... | Creates and returns a ConstantSize from the given encoded size and unit description.
@param encodedValueAndUnit the size's value and unit as string, trimmed and in lower case
@param horizontal true for horizontal, false for vertical
@return a constant size for the given encoding and unit description
@throws IllegalAr... | [
"Creates",
"and",
"returns",
"a",
"ConstantSize",
"from",
"the",
"given",
"encoded",
"size",
"and",
"unit",
"description",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/ConstantSize.java#L138-L149 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/xmp/XmpReader.java | XmpReader.readJpegSegments | public void readJpegSegments(@NotNull Iterable<byte[]> segments, @NotNull Metadata metadata, @NotNull JpegSegmentType segmentType) {
"""
Version specifically for dealing with XMP found in JPEG segments. This form of XMP has a peculiar preamble, which
must be removed before parsing the XML.
@param segments The ... | java | public void readJpegSegments(@NotNull Iterable<byte[]> segments, @NotNull Metadata metadata, @NotNull JpegSegmentType segmentType)
{
final int preambleLength = XMP_JPEG_PREAMBLE.length();
final int extensionPreambleLength = XMP_EXTENSION_JPEG_PREAMBLE.length();
String extendedXMPGUID = null;... | [
"public",
"void",
"readJpegSegments",
"(",
"@",
"NotNull",
"Iterable",
"<",
"byte",
"[",
"]",
">",
"segments",
",",
"@",
"NotNull",
"Metadata",
"metadata",
",",
"@",
"NotNull",
"JpegSegmentType",
"segmentType",
")",
"{",
"final",
"int",
"preambleLength",
"=",
... | Version specifically for dealing with XMP found in JPEG segments. This form of XMP has a peculiar preamble, which
must be removed before parsing the XML.
@param segments The byte array from which the metadata should be extracted.
@param metadata The {@link Metadata} object into which extracted values should be merged.... | [
"Version",
"specifically",
"for",
"dealing",
"with",
"XMP",
"found",
"in",
"JPEG",
"segments",
".",
"This",
"form",
"of",
"XMP",
"has",
"a",
"peculiar",
"preamble",
"which",
"must",
"be",
"removed",
"before",
"parsing",
"the",
"XML",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/xmp/XmpReader.java#L88-L126 |
cloudfoundry-community/java-nats | client/src/main/java/nats/codec/AbstractFrameDecoder.java | AbstractFrameDecoder.indexOf | private int indexOf(ByteBuf haystack, byte[] needle) {
"""
Returns the number of bytes between the readerIndex of the haystack and
the first needle found in the haystack. -1 is returned if no needle is
found in the haystack.
<p/>
Copied from {@link io.netty.handler.codec.DelimiterBasedFrameDecoder}.
"""
... | java | private int indexOf(ByteBuf haystack, byte[] needle) {
for (int i = haystack.readerIndex(); i < haystack.writerIndex(); i++) {
int haystackIndex = i;
int needleIndex;
for (needleIndex = 0; needleIndex < needle.length; needleIndex++) {
if (haystack.getByte(haystackIndex) != needle[needleIndex]) {
bre... | [
"private",
"int",
"indexOf",
"(",
"ByteBuf",
"haystack",
",",
"byte",
"[",
"]",
"needle",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"haystack",
".",
"readerIndex",
"(",
")",
";",
"i",
"<",
"haystack",
".",
"writerIndex",
"(",
")",
";",
"i",
"++",
")",... | Returns the number of bytes between the readerIndex of the haystack and
the first needle found in the haystack. -1 is returned if no needle is
found in the haystack.
<p/>
Copied from {@link io.netty.handler.codec.DelimiterBasedFrameDecoder}. | [
"Returns",
"the",
"number",
"of",
"bytes",
"between",
"the",
"readerIndex",
"of",
"the",
"haystack",
"and",
"the",
"first",
"needle",
"found",
"in",
"the",
"haystack",
".",
"-",
"1",
"is",
"returned",
"if",
"no",
"needle",
"is",
"found",
"in",
"the",
"ha... | train | https://github.com/cloudfoundry-community/java-nats/blob/f95de9f8f4ee7bf457898ab3bb37c8914b230304/client/src/main/java/nats/codec/AbstractFrameDecoder.java#L80-L102 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameDay | public static boolean sameDay(Date dateOne, Date dateTwo) {
"""
Test to see if two dates are in the same day of year
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same day of year
"""
if ((dateOne == null) || (dateTwo == null)) {
return f... | java | public static boolean sameDay(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DAY_OF_YEAR);
... | [
"public",
"static",
"boolean",
"sameDay",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"=",
... | Test to see if two dates are in the same day of year
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same day of year | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"day",
"of",
"year"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L232-L247 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newRole | public Predicate.Role newRole(Predicate predicate, String semRole, Span<Term> span) {
"""
Creates a new Role object. It assigns an appropriate ID to it. It uses the ID of the predicate to create a new ID for the role. It doesn't add the role to the predicate.
@param predicate the predicate which this role is part... | java | public Predicate.Role newRole(Predicate predicate, String semRole, Span<Term> span) {
String newId = idManager.getNextId(AnnotationType.ROLE);
Predicate.Role newRole = new Predicate.Role(newId, semRole, span);
return newRole;
} | [
"public",
"Predicate",
".",
"Role",
"newRole",
"(",
"Predicate",
"predicate",
",",
"String",
"semRole",
",",
"Span",
"<",
"Term",
">",
"span",
")",
"{",
"String",
"newId",
"=",
"idManager",
".",
"getNextId",
"(",
"AnnotationType",
".",
"ROLE",
")",
";",
... | Creates a new Role object. It assigns an appropriate ID to it. It uses the ID of the predicate to create a new ID for the role. It doesn't add the role to the predicate.
@param predicate the predicate which this role is part of
@param semRole semantic role
@param span span containing all the targets of the role
@return... | [
"Creates",
"a",
"new",
"Role",
"object",
".",
"It",
"assigns",
"an",
"appropriate",
"ID",
"to",
"it",
".",
"It",
"uses",
"the",
"ID",
"of",
"the",
"predicate",
"to",
"create",
"a",
"new",
"ID",
"for",
"the",
"role",
".",
"It",
"doesn",
"t",
"add",
... | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L1033-L1037 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java | ProcessorOutputElem.setForeignAttr | public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue) {
"""
Set a foreign property from the attribute value.
@param newValue non-null reference to attribute value.
"""
QName key = new QName(attrUri, attrLocalName);
m_outputProperties.setProperty(key, at... | java | public void setForeignAttr(String attrUri, String attrLocalName, String attrRawName, String attrValue)
{
QName key = new QName(attrUri, attrLocalName);
m_outputProperties.setProperty(key, attrValue);
} | [
"public",
"void",
"setForeignAttr",
"(",
"String",
"attrUri",
",",
"String",
"attrLocalName",
",",
"String",
"attrRawName",
",",
"String",
"attrValue",
")",
"{",
"QName",
"key",
"=",
"new",
"QName",
"(",
"attrUri",
",",
"attrLocalName",
")",
";",
"m_outputProp... | Set a foreign property from the attribute value.
@param newValue non-null reference to attribute value. | [
"Set",
"a",
"foreign",
"property",
"from",
"the",
"attribute",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java#L151-L155 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardSgroupGenerator.java | StandardSgroupGenerator.generateSgroups | IRenderingElement generateSgroups(IAtomContainer container, AtomSymbol[] symbols) {
"""
Generate the Sgroup elements for the provided atom contains.
@param container molecule
@return Sgroup rendering elements
"""
ElementGroup result = new ElementGroup();
List<Sgroup> sgroups = container.ge... | java | IRenderingElement generateSgroups(IAtomContainer container, AtomSymbol[] symbols) {
ElementGroup result = new ElementGroup();
List<Sgroup> sgroups = container.getProperty(CDKConstants.CTAB_SGROUPS);
if (sgroups == null || sgroups.isEmpty())
return result;
Map<IAtom, AtomSy... | [
"IRenderingElement",
"generateSgroups",
"(",
"IAtomContainer",
"container",
",",
"AtomSymbol",
"[",
"]",
"symbols",
")",
"{",
"ElementGroup",
"result",
"=",
"new",
"ElementGroup",
"(",
")",
";",
"List",
"<",
"Sgroup",
">",
"sgroups",
"=",
"container",
".",
"ge... | Generate the Sgroup elements for the provided atom contains.
@param container molecule
@return Sgroup rendering elements | [
"Generate",
"the",
"Sgroup",
"elements",
"for",
"the",
"provided",
"atom",
"contains",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardSgroupGenerator.java#L282-L328 |
opengeospatial/teamengine | teamengine-realm/src/main/java/com/occamlab/te/realm/PBKDF2Realm.java | PBKDF2Realm.authenticate | @Override
public Principal authenticate(String username, String credentials) {
"""
Return the Principal associated with the specified username and
credentials, if one exists in the user data store; otherwise return null.
"""
GenericPrincipal principal = (GenericPrincipal) getPrincipal(username);
... | java | @Override
public Principal authenticate(String username, String credentials) {
GenericPrincipal principal = (GenericPrincipal) getPrincipal(username);
if (null != principal) {
try {
if (!PasswordStorage.verifyPassword(credentials, principal.getPassword())) {
... | [
"@",
"Override",
"public",
"Principal",
"authenticate",
"(",
"String",
"username",
",",
"String",
"credentials",
")",
"{",
"GenericPrincipal",
"principal",
"=",
"(",
"GenericPrincipal",
")",
"getPrincipal",
"(",
"username",
")",
";",
"if",
"(",
"null",
"!=",
"... | Return the Principal associated with the specified username and
credentials, if one exists in the user data store; otherwise return null. | [
"Return",
"the",
"Principal",
"associated",
"with",
"the",
"specified",
"username",
"and",
"credentials",
"if",
"one",
"exists",
"in",
"the",
"user",
"data",
"store",
";",
"otherwise",
"return",
"null",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-realm/src/main/java/com/occamlab/te/realm/PBKDF2Realm.java#L75-L89 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security.admin/src/com/ibm/ws/webcontainer/security/admin/internal/WebAdminSecurityCollaboratorImpl.java | WebAdminSecurityCollaboratorImpl.getDefaultAdminSecurityMetadata | private SecurityMetadata getDefaultAdminSecurityMetadata() {
"""
Constructs the default Admin Security metadata. This is preserved in
the event we have an "admin application" (aka a feature WAB or system WAB)
which does not provide a web.xml. This is unlikely, but we want to be
safe.
@return The default Admi... | java | private SecurityMetadata getDefaultAdminSecurityMetadata() {
if (secMetadata == null) {
secMetadata = new SecurityServletConfiguratorHelper(null);
// It appears that the web.xml is honored now, but add Viewer role for consistency
List<String> roles = new ArrayList<String>();... | [
"private",
"SecurityMetadata",
"getDefaultAdminSecurityMetadata",
"(",
")",
"{",
"if",
"(",
"secMetadata",
"==",
"null",
")",
"{",
"secMetadata",
"=",
"new",
"SecurityServletConfiguratorHelper",
"(",
"null",
")",
";",
"// It appears that the web.xml is honored now, but add ... | Constructs the default Admin Security metadata. This is preserved in
the event we have an "admin application" (aka a feature WAB or system WAB)
which does not provide a web.xml. This is unlikely, but we want to be
safe.
@return The default Admin Security metadata | [
"Constructs",
"the",
"default",
"Admin",
"Security",
"metadata",
".",
"This",
"is",
"preserved",
"in",
"the",
"event",
"we",
"have",
"an",
"admin",
"application",
"(",
"aka",
"a",
"feature",
"WAB",
"or",
"system",
"WAB",
")",
"which",
"does",
"not",
"provi... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security.admin/src/com/ibm/ws/webcontainer/security/admin/internal/WebAdminSecurityCollaboratorImpl.java#L87-L119 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java | LinearSolverChol_ZDRM.solve | @Override
public void solve(ZMatrixRMaj B , ZMatrixRMaj X ) {
"""
<p>
Using the decomposition, finds the value of 'X' in the linear equation below:<br>
A*x = b<br>
where A has dimension of n by n, x and b are n by m dimension.
</p>
<p>
*Note* that 'b' and 'x' can be the same matrix instance.
</p>
... | java | @Override
public void solve(ZMatrixRMaj B , ZMatrixRMaj X ) {
if( B.numCols != X.numCols || B.numRows != n || X.numRows != n) {
throw new IllegalArgumentException("Unexpected matrix size");
}
int numCols = B.numCols;
double dataB[] = B.data;
double dataX[] = X.d... | [
"@",
"Override",
"public",
"void",
"solve",
"(",
"ZMatrixRMaj",
"B",
",",
"ZMatrixRMaj",
"X",
")",
"{",
"if",
"(",
"B",
".",
"numCols",
"!=",
"X",
".",
"numCols",
"||",
"B",
".",
"numRows",
"!=",
"n",
"||",
"X",
".",
"numRows",
"!=",
"n",
")",
"{... | <p>
Using the decomposition, finds the value of 'X' in the linear equation below:<br>
A*x = b<br>
where A has dimension of n by n, x and b are n by m dimension.
</p>
<p>
*Note* that 'b' and 'x' can be the same matrix instance.
</p>
@param B A matrix that is n by m. Not modified.
@param X An n by m matrix where the ... | [
"<p",
">",
"Using",
"the",
"decomposition",
"finds",
"the",
"value",
"of",
"X",
"in",
"the",
"linear",
"equation",
"below",
":",
"<br",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java#L83-L109 |
jenkinsci/jenkins | core/src/main/java/hudson/util/RunList.java | RunList.newBuilds | public RunList<R> newBuilds() {
"""
Reduce the size of the list by only leaving relatively new ones.
This also removes on-going builds, as RSS cannot be used to publish information
if it changes.
<em>Warning:</em> this method mutates the original list and then returns it.
"""
GregorianCalendar cal =... | java | public RunList<R> newBuilds() {
GregorianCalendar cal = new GregorianCalendar();
cal.add(Calendar.DAY_OF_YEAR, -7);
final long t = cal.getTimeInMillis();
// can't publish on-going builds
return filter(new Predicate<R>() {
public boolean apply(R r) {
r... | [
"public",
"RunList",
"<",
"R",
">",
"newBuilds",
"(",
")",
"{",
"GregorianCalendar",
"cal",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"DAY_OF_YEAR",
",",
"-",
"7",
")",
";",
"final",
"long",
"t",
"=",
"c... | Reduce the size of the list by only leaving relatively new ones.
This also removes on-going builds, as RSS cannot be used to publish information
if it changes.
<em>Warning:</em> this method mutates the original list and then returns it. | [
"Reduce",
"the",
"size",
"of",
"the",
"list",
"by",
"only",
"leaving",
"relatively",
"new",
"ones",
".",
"This",
"also",
"removes",
"on",
"-",
"going",
"builds",
"as",
"RSS",
"cannot",
"be",
"used",
"to",
"publish",
"information",
"if",
"it",
"changes",
... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/RunList.java#L341-L358 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java | Form.setAnswer | public void setAnswer(String variable, List<? extends CharSequence> values) {
"""
Sets a new values to a given form's field. The field whose variable matches the requested
variable will be completed with the specified values. If no field could be found for
the specified variable then an exception will be raised.... | java | public void setAnswer(String variable, List<? extends CharSequence> values) {
if (!isSubmitType()) {
throw new IllegalStateException("Cannot set an answer if the form is not of type " +
"\"submit\"");
}
FormField field = getField(variable);
if (field != null) {
... | [
"public",
"void",
"setAnswer",
"(",
"String",
"variable",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"values",
")",
"{",
"if",
"(",
"!",
"isSubmitType",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot set an answer if th... | Sets a new values to a given form's field. The field whose variable matches the requested
variable will be completed with the specified values. If no field could be found for
the specified variable then an exception will be raised.<p>
The Objects contained in the List could be of any type. The String representation of... | [
"Sets",
"a",
"new",
"values",
"to",
"a",
"given",
"form",
"s",
"field",
".",
"The",
"field",
"whose",
"variable",
"matches",
"the",
"requested",
"variable",
"will",
"be",
"completed",
"with",
"the",
"specified",
"values",
".",
"If",
"no",
"field",
"could",... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/Form.java#L280-L306 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java | FilterTable.insertToBucket | boolean insertToBucket(long bucketIndex, long tag) {
"""
inserts a tag into an empty position in the chosen bucket.
@param bucketIndex
index
@param tag
tag
@return true if insert succeeded(bucket not full)
"""
for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) {
if (checkTag(bucketIndex, i, 0))... | java | boolean insertToBucket(long bucketIndex, long tag) {
for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) {
if (checkTag(bucketIndex, i, 0)) {
writeTagNoClear(bucketIndex, i, tag);
return true;
}
}
return false;
} | [
"boolean",
"insertToBucket",
"(",
"long",
"bucketIndex",
",",
"long",
"tag",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"CuckooFilter",
".",
"BUCKET_SIZE",
";",
"i",
"++",
")",
"{",
"if",
"(",
"checkTag",
"(",
"bucketIndex",
",",
"i",... | inserts a tag into an empty position in the chosen bucket.
@param bucketIndex
index
@param tag
tag
@return true if insert succeeded(bucket not full) | [
"inserts",
"a",
"tag",
"into",
"an",
"empty",
"position",
"in",
"the",
"chosen",
"bucket",
"."
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L93-L102 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlConstructorBuilderImpl.java | SarlConstructorBuilderImpl.eInit | public void eInit(XtendTypeDeclaration container, IJvmTypeProvider context) {
"""
Initialize the Ecore element.
@param container the container of the SarlConstructor.
"""
setTypeResolutionContext(context);
if (this.sarlConstructor == null) {
this.container = container;
this.sarlConstructor = SarlFac... | java | public void eInit(XtendTypeDeclaration container, IJvmTypeProvider context) {
setTypeResolutionContext(context);
if (this.sarlConstructor == null) {
this.container = container;
this.sarlConstructor = SarlFactory.eINSTANCE.createSarlConstructor();
this.sarlConstructor.setAnnotationInfo(XtendFactory.eINSTANC... | [
"public",
"void",
"eInit",
"(",
"XtendTypeDeclaration",
"container",
",",
"IJvmTypeProvider",
"context",
")",
"{",
"setTypeResolutionContext",
"(",
"context",
")",
";",
"if",
"(",
"this",
".",
"sarlConstructor",
"==",
"null",
")",
"{",
"this",
".",
"container",
... | Initialize the Ecore element.
@param container the container of the SarlConstructor. | [
"Initialize",
"the",
"Ecore",
"element",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlConstructorBuilderImpl.java#L62-L70 |
gallandarakhneorg/afc | advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/commands/PrintConfigCommand.java | PrintConfigCommand.generateJson | @SuppressWarnings("static-method")
protected String generateJson(Map<String, Object> map) throws JsonProcessingException {
"""
Generate the Json representation of the given map.
@param map the map to print out.
@return the Json representation.
@throws JsonProcessingException when the Json cannot be processed... | java | @SuppressWarnings("static-method")
protected String generateJson(Map<String, Object> map) throws JsonProcessingException {
final ObjectMapper mapper = new ObjectMapper();
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(map);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"String",
"generateJson",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"throws",
"JsonProcessingException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
... | Generate the Json representation of the given map.
@param map the map to print out.
@return the Json representation.
@throws JsonProcessingException when the Json cannot be processed. | [
"Generate",
"the",
"Json",
"representation",
"of",
"the",
"given",
"map",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/commands/PrintConfigCommand.java#L163-L167 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addGreaterOrEqualThan | public void addGreaterOrEqualThan(Object attribute, Object value) {
"""
Adds GreaterOrEqual Than (>=) criteria,
customer_id >= 10034
@param attribute The field name to be used
@param value An object representing the value of the field
"""
// PAW
// addSelectionCriteria(ValueCriteria.buildN... | java | public void addGreaterOrEqualThan(Object attribute, Object value)
{
// PAW
// addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getAlias()));
addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getUserAlias(attribute)));
} | [
"public",
"void",
"addGreaterOrEqualThan",
"(",
"Object",
"attribute",
",",
"Object",
"value",
")",
"{",
"// PAW\r",
"// addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getAlias()));\r",
"addSelectionCriteria",
"(",
"ValueCriteria",
".",
"buildNotLessCrite... | Adds GreaterOrEqual Than (>=) criteria,
customer_id >= 10034
@param attribute The field name to be used
@param value An object representing the value of the field | [
"Adds",
"GreaterOrEqual",
"Than",
"(",
">",
"=",
")",
"criteria",
"customer_id",
">",
"=",
"10034"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L407-L412 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/configuration/ExecutorFactoryConfigurationBuilder.java | ExecutorFactoryConfigurationBuilder.addExecutorProperty | public ExecutorFactoryConfigurationBuilder addExecutorProperty(String key, String value) {
"""
Add key/value property pair to this executor factory configuration
@param key
property key
@param value
property value
@return previous value if exists, null otherwise
"""
this.properties.put(key, value)... | java | public ExecutorFactoryConfigurationBuilder addExecutorProperty(String key, String value) {
this.properties.put(key, value);
return this;
} | [
"public",
"ExecutorFactoryConfigurationBuilder",
"addExecutorProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"properties",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add key/value property pair to this executor factory configuration
@param key
property key
@param value
property value
@return previous value if exists, null otherwise | [
"Add",
"key",
"/",
"value",
"property",
"pair",
"to",
"this",
"executor",
"factory",
"configuration"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/configuration/ExecutorFactoryConfigurationBuilder.java#L68-L71 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.findByCPOptionCategoryId | @Override
public List<CPSpecificationOption> findByCPOptionCategoryId(
long CPOptionCategoryId, int start, int end) {
"""
Returns a range of all the cp specification options where CPOptionCategoryId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>s... | java | @Override
public List<CPSpecificationOption> findByCPOptionCategoryId(
long CPOptionCategoryId, int start, int end) {
return findByCPOptionCategoryId(CPOptionCategoryId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPSpecificationOption",
">",
"findByCPOptionCategoryId",
"(",
"long",
"CPOptionCategoryId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPOptionCategoryId",
"(",
"CPOptionCategoryId",
",",
"start",
",",... | Returns a range of all the cp specification options where CPOptionCategoryId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first r... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"specification",
"options",
"where",
"CPOptionCategoryId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L2053-L2057 |
brianwhu/xillium | data/src/main/java/org/xillium/data/validation/Reifier.java | Reifier.isRequired | private static final boolean isRequired(DataObject data, Field field, String prefix, String name, int present)
throws MissingParameterException {
"""
/*!
Tests whether the specified field is a required field.
@param data - the containing data object
@param field - the field
@param prefix - the current p... | java | private static final boolean isRequired(DataObject data, Field field, String prefix, String name, int present)
throws MissingParameterException {
if (field.getAnnotation(required.class) != null) {
//if (present == 0) {
if (present == 0 && prefix != null) { // Brian 3/9/2012
... | [
"private",
"static",
"final",
"boolean",
"isRequired",
"(",
"DataObject",
"data",
",",
"Field",
"field",
",",
"String",
"prefix",
",",
"String",
"name",
",",
"int",
"present",
")",
"throws",
"MissingParameterException",
"{",
"if",
"(",
"field",
".",
"getAnnota... | /*!
Tests whether the specified field is a required field.
@param data - the containing data object
@param field - the field
@param prefix - the current prefix indicating the name of the containing data object
@param name - the cached name of the field
@param present - the number of data members already having values
... | [
"/",
"*",
"!",
"Tests",
"whether",
"the",
"specified",
"field",
"is",
"a",
"required",
"field",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/validation/Reifier.java#L243-L260 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkFunctionOrMethodDeclaration | public void checkFunctionOrMethodDeclaration(Decl.FunctionOrMethod d) {
"""
Type check a given function or method declaration.
@param fd
Function or method declaration to check.
@throws IOException
"""
// Construct initial environment
Environment environment = new Environment();
// Update environmen... | java | public void checkFunctionOrMethodDeclaration(Decl.FunctionOrMethod d) {
// Construct initial environment
Environment environment = new Environment();
// Update environment so this within declared lifetimes
environment = FlowTypeUtils.declareThisWithin(d, environment);
// Check parameters and returns are not e... | [
"public",
"void",
"checkFunctionOrMethodDeclaration",
"(",
"Decl",
".",
"FunctionOrMethod",
"d",
")",
"{",
"// Construct initial environment",
"Environment",
"environment",
"=",
"new",
"Environment",
"(",
")",
";",
"// Update environment so this within declared lifetimes",
"e... | Type check a given function or method declaration.
@param fd
Function or method declaration to check.
@throws IOException | [
"Type",
"check",
"a",
"given",
"function",
"or",
"method",
"declaration",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L194-L220 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.