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 |
|---|---|---|---|---|---|---|---|---|---|---|
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LauncherModel.java | LauncherModel.computeVector | private Force computeVector(Force vector) {
"""
Compute the vector used for launch.
@param vector The initial vector used for launch.
@return The vector used for launch.
"""
if (target != null)
{
return computeVector(vector, target);
}
vector.setDestination(... | java | private Force computeVector(Force vector)
{
if (target != null)
{
return computeVector(vector, target);
}
vector.setDestination(vector.getDirectionHorizontal(), vector.getDirectionVertical());
return vector;
} | [
"private",
"Force",
"computeVector",
"(",
"Force",
"vector",
")",
"{",
"if",
"(",
"target",
"!=",
"null",
")",
"{",
"return",
"computeVector",
"(",
"vector",
",",
"target",
")",
";",
"}",
"vector",
".",
"setDestination",
"(",
"vector",
".",
"getDirectionHo... | Compute the vector used for launch.
@param vector The initial vector used for launch.
@return The vector used for launch. | [
"Compute",
"the",
"vector",
"used",
"for",
"launch",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/launchable/LauncherModel.java#L188-L196 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java | CLINK.clinkstep8 | private void clinkstep8(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
"""
Update hierarchy.
@param id Current object
@param it Iterator
@param n Last object to process
@param pi Parent data store
@param lambda Height data store
@... | java | private void clinkstep8(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
DBIDVar p_i = DBIDUtil.newVar(), pp_i = DBIDUtil.newVar();
for(it.seek(0); it.getOffset() < n; it.advance()) {
p_i.from(pi, it); // p_i = pi[i]
pp_i.fro... | [
"private",
"void",
"clinkstep8",
"(",
"DBIDRef",
"id",
",",
"DBIDArrayIter",
"it",
",",
"int",
"n",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"DBIDVar",
"p_i",
"=",
"DBIDUtil",
".... | Update hierarchy.
@param id Current object
@param it Iterator
@param n Last object to process
@param pi Parent data store
@param lambda Height data store
@param m Distance data store | [
"Update",
"hierarchy",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java#L195-L204 |
duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/StoreRest.java | StoreRest.getStores | @GET
public Response getStores() {
"""
Provides a listing of all available storage provider accounts
@return 200 response with XML file listing stores
"""
String msg = "getting stores.";
try {
return doGetStores(msg);
} catch (StorageException se) {
retur... | java | @GET
public Response getStores() {
String msg = "getting stores.";
try {
return doGetStores(msg);
} catch (StorageException se) {
return responseBad(msg, se);
} catch (Exception e) {
return responseBad(msg, e);
}
} | [
"@",
"GET",
"public",
"Response",
"getStores",
"(",
")",
"{",
"String",
"msg",
"=",
"\"getting stores.\"",
";",
"try",
"{",
"return",
"doGetStores",
"(",
"msg",
")",
";",
"}",
"catch",
"(",
"StorageException",
"se",
")",
"{",
"return",
"responseBad",
"(",
... | Provides a listing of all available storage provider accounts
@return 200 response with XML file listing stores | [
"Provides",
"a",
"listing",
"of",
"all",
"available",
"storage",
"provider",
"accounts"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/StoreRest.java#L49-L61 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.xdsl_addressMove_fee_option_GET | public OvhPrice xdsl_addressMove_fee_option_GET(net.minidev.ovh.api.price.xdsl.addressmove.OvhFeeEnum option) throws IOException {
"""
Get the price of address move option fee
REST: GET /price/xdsl/addressMove/fee/{option}
@param option [required] The option name
"""
String qPath = "/price/xdsl/addressMo... | java | public OvhPrice xdsl_addressMove_fee_option_GET(net.minidev.ovh.api.price.xdsl.addressmove.OvhFeeEnum option) throws IOException {
String qPath = "/price/xdsl/addressMove/fee/{option}";
StringBuilder sb = path(qPath, option);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice... | [
"public",
"OvhPrice",
"xdsl_addressMove_fee_option_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"xdsl",
".",
"addressmove",
".",
"OvhFeeEnum",
"option",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/xdsl/add... | Get the price of address move option fee
REST: GET /price/xdsl/addressMove/fee/{option}
@param option [required] The option name | [
"Get",
"the",
"price",
"of",
"address",
"move",
"option",
"fee"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L37-L42 |
edwardcapriolo/gossip | src/main/java/com/google/code/gossip/manager/GossipManager.java | GossipManager.handleNotification | @Override
public void handleNotification(Notification notification, Object handback) {
"""
All timers associated with a member will trigger this method when it goes off. The timer will
go off if we have not heard from this member in <code> _settings.T_CLEANUP </code> time.
"""
LocalGossipMember deadMemb... | java | @Override
public void handleNotification(Notification notification, Object handback) {
LocalGossipMember deadMember = (LocalGossipMember) notification.getUserData();
GossipService.LOGGER.debug("Dead member detected: " + deadMember);
members.put(deadMember, GossipState.DOWN);
if (listener != null) {
... | [
"@",
"Override",
"public",
"void",
"handleNotification",
"(",
"Notification",
"notification",
",",
"Object",
"handback",
")",
"{",
"LocalGossipMember",
"deadMember",
"=",
"(",
"LocalGossipMember",
")",
"notification",
".",
"getUserData",
"(",
")",
";",
"GossipServic... | All timers associated with a member will trigger this method when it goes off. The timer will
go off if we have not heard from this member in <code> _settings.T_CLEANUP </code> time. | [
"All",
"timers",
"associated",
"with",
"a",
"member",
"will",
"trigger",
"this",
"method",
"when",
"it",
"goes",
"off",
".",
"The",
"timer",
"will",
"go",
"off",
"if",
"we",
"have",
"not",
"heard",
"from",
"this",
"member",
"in",
"<code",
">",
"_settings... | train | https://github.com/edwardcapriolo/gossip/blob/ac87301458c7ba4eb7d952046894ebf42ffb0518/src/main/java/com/google/code/gossip/manager/GossipManager.java#L102-L110 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getTMScore | public static double getTMScore(Atom[] atomSet1, Atom[] atomSet2, int len1, int len2) throws StructureException {
"""
Calculate the TM-Score for the superposition.
<em>Normalizes by the <strong>minimum</strong>-length structure (that is, {@code min\{len1,len2\}}).</em>
Atom sets must be pre-rotated.
<p>
... | java | public static double getTMScore(Atom[] atomSet1, Atom[] atomSet2, int len1, int len2) throws StructureException {
return getTMScore(atomSet1, atomSet2, len1, len2,true);
} | [
"public",
"static",
"double",
"getTMScore",
"(",
"Atom",
"[",
"]",
"atomSet1",
",",
"Atom",
"[",
"]",
"atomSet2",
",",
"int",
"len1",
",",
"int",
"len2",
")",
"throws",
"StructureException",
"{",
"return",
"getTMScore",
"(",
"atomSet1",
",",
"atomSet2",
",... | Calculate the TM-Score for the superposition.
<em>Normalizes by the <strong>minimum</strong>-length structure (that is, {@code min\{len1,len2\}}).</em>
Atom sets must be pre-rotated.
<p>
Citation:<br/>
<i>Zhang Y and Skolnick J (2004). "Scoring function for automated
assessment of protein structure template quality"... | [
"Calculate",
"the",
"TM",
"-",
"Score",
"for",
"the",
"superposition",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L1285-L1287 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateAffineXYZ | public Matrix4f rotateAffineXYZ(float angleX, float angleY, float angleZ) {
"""
Apply rotation of <code>angleX</code> radians about the X axis, followed by a rotation of <code>angleY</code> radians about the Y axis and
followed by a rotation of <code>angleZ</code> radians about the Z axis.
<p>
When used with a ... | java | public Matrix4f rotateAffineXYZ(float angleX, float angleY, float angleZ) {
return rotateAffineXYZ(angleX, angleY, angleZ, thisOrNew());
} | [
"public",
"Matrix4f",
"rotateAffineXYZ",
"(",
"float",
"angleX",
",",
"float",
"angleY",
",",
"float",
"angleZ",
")",
"{",
"return",
"rotateAffineXYZ",
"(",
"angleX",
",",
"angleY",
",",
"angleZ",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Apply rotation of <code>angleX</code> radians about the X axis, followed by a rotation of <code>angleY</code> radians about the Y axis and
followed by a rotation of <code>angleZ</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clock... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angleX<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angleY<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axis",
"and",
"followed",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L5399-L5401 |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java | GroovyRuntimeUtil.invokeMethod | public static Object invokeMethod(Object target, String method, Object... args) {
"""
Note: This method may throw checked exceptions although it doesn't say so.
"""
try {
return InvokerHelper.invokeMethod(target, method, args);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyTh... | java | public static Object invokeMethod(Object target, String method, Object... args) {
try {
return InvokerHelper.invokeMethod(target, method, args);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
return null; // never reached
}
} | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"Object",
"target",
",",
"String",
"method",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"return",
"InvokerHelper",
".",
"invokeMethod",
"(",
"target",
",",
"method",
",",
"args",
")",
";",
"}",
... | Note: This method may throw checked exceptions although it doesn't say so. | [
"Note",
":",
"This",
"method",
"may",
"throw",
"checked",
"exceptions",
"although",
"it",
"doesn",
"t",
"say",
"so",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L169-L176 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static short[] removeAll(final short[] a, final short... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {
... | java | @SafeVarargs
public static short[] removeAll(final short[] a, final short... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_SHORT_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return remove... | [
"@",
"SafeVarargs",
"public",
"static",
"short",
"[",
"]",
"removeAll",
"(",
"final",
"short",
"[",
"]",
"a",
",",
"final",
"short",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",
"EM... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23420-L23433 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Document.java | Document.addKeywords | public boolean addKeywords(String keywords) {
"""
Adds the keywords to a Document.
@param keywords
adds the keywords to the document
@return <CODE>true</CODE> if successful, <CODE>false</CODE> otherwise
"""
try {
return add(new Meta(Element.KEYWORDS, keywords));
} catch (DocumentExce... | java | public boolean addKeywords(String keywords) {
try {
return add(new Meta(Element.KEYWORDS, keywords));
} catch (DocumentException de) {
throw new ExceptionConverter(de);
}
} | [
"public",
"boolean",
"addKeywords",
"(",
"String",
"keywords",
")",
"{",
"try",
"{",
"return",
"add",
"(",
"new",
"Meta",
"(",
"Element",
".",
"KEYWORDS",
",",
"keywords",
")",
")",
";",
"}",
"catch",
"(",
"DocumentException",
"de",
")",
"{",
"throw",
... | Adds the keywords to a Document.
@param keywords
adds the keywords to the document
@return <CODE>true</CODE> if successful, <CODE>false</CODE> otherwise | [
"Adds",
"the",
"keywords",
"to",
"a",
"Document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Document.java#L560-L566 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getCategory | public Category getCategory(int pageId) {
"""
Gets the category for a given pageId.
@param pageId The id of the {@link Category}.
@return The category object or null if no category with this pageId exists.
"""
long hibernateId = __getCategoryHibernateId(pageId);
if (hibernateId == -1) {
... | java | public Category getCategory(int pageId) {
long hibernateId = __getCategoryHibernateId(pageId);
if (hibernateId == -1) {
return null;
}
try {
Category cat = new Category(this, hibernateId);
return cat;
} catch (WikiPageNotFoundException e) {
... | [
"public",
"Category",
"getCategory",
"(",
"int",
"pageId",
")",
"{",
"long",
"hibernateId",
"=",
"__getCategoryHibernateId",
"(",
"pageId",
")",
";",
"if",
"(",
"hibernateId",
"==",
"-",
"1",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"Category",
... | Gets the category for a given pageId.
@param pageId The id of the {@link Category}.
@return The category object or null if no category with this pageId exists. | [
"Gets",
"the",
"category",
"for",
"a",
"given",
"pageId",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L473-L485 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java | CommercePriceListPersistenceImpl.findByGroupId | @Override
public List<CommercePriceList> findByGroupId(long groupId) {
"""
Returns all the commerce price lists where groupId = ?.
@param groupId the group ID
@return the matching commerce price lists
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommercePriceList> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceList",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce price lists where groupId = ?.
@param groupId the group ID
@return the matching commerce price lists | [
"Returns",
"all",
"the",
"commerce",
"price",
"lists",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java#L1524-L1527 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java | Fastpath.getOID | public long getOID(String name, FastpathArg[] args) throws SQLException {
"""
This convenience method assumes that the return value is an oid.
@param name Function name
@param args Function arguments
@return oid of the given call
@throws SQLException if a database-access error occurs or no result
"""
... | java | public long getOID(String name, FastpathArg[] args) throws SQLException {
long oid = getInteger(name, args);
if (oid < 0) {
oid += NUM_OIDS;
}
return oid;
} | [
"public",
"long",
"getOID",
"(",
"String",
"name",
",",
"FastpathArg",
"[",
"]",
"args",
")",
"throws",
"SQLException",
"{",
"long",
"oid",
"=",
"getInteger",
"(",
"name",
",",
"args",
")",
";",
"if",
"(",
"oid",
"<",
"0",
")",
"{",
"oid",
"+=",
"N... | This convenience method assumes that the return value is an oid.
@param name Function name
@param args Function arguments
@return oid of the given call
@throws SQLException if a database-access error occurs or no result | [
"This",
"convenience",
"method",
"assumes",
"that",
"the",
"return",
"value",
"is",
"an",
"oid",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java#L208-L214 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/SimonConsoleRequestProcessor.java | SimonConsoleRequestProcessor.processRequest | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
"""
Processes requests for both HTTP {@code GET} and {@code POST} methods.
@param request servlet request
@param response servlet response
@throws javax.servlet.ServletException if... | java | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String path = request.getRequestURI().substring(request.getContextPath().length() + urlPrefix.length());
ActionContext actionContext = new ActionContext(request, response, path);
... | [
"protected",
"void",
"processRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"String",
"path",
"=",
"request",
".",
"getRequestURI",
"(",
")",
".",
"substring",
"(",
... | Processes requests for both HTTP {@code GET} and {@code POST} methods.
@param request servlet request
@param response servlet response
@throws javax.servlet.ServletException if a servlet-specific error occurs
@throws java.io.IOException if an I/O error occurs | [
"Processes",
"requests",
"for",
"both",
"HTTP",
"{",
"@code",
"GET",
"}",
"and",
"{",
"@code",
"POST",
"}",
"methods",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/SimonConsoleRequestProcessor.java#L206-L214 |
dmerkushov/os-helper | src/main/java/ru/dmerkushov/oshelper/OSHelper.java | OSHelper.procWaitWithProcessReturn | public static ProcessReturn procWaitWithProcessReturn (Process process) throws OSHelperException {
"""
/*public static Thread runCommandInThread (final List<String> toRun) throws OSHelperException {
Thread commandThread;
}
"""
ProcessReturn processReturn = new ProcessReturn ();
try {
processReturn.e... | java | public static ProcessReturn procWaitWithProcessReturn (Process process) throws OSHelperException {
ProcessReturn processReturn = new ProcessReturn ();
try {
processReturn.exitCode = process.waitFor ();
} catch (InterruptedException ex) {
throw new OSHelperException ("Received an InterruptedException when wa... | [
"public",
"static",
"ProcessReturn",
"procWaitWithProcessReturn",
"(",
"Process",
"process",
")",
"throws",
"OSHelperException",
"{",
"ProcessReturn",
"processReturn",
"=",
"new",
"ProcessReturn",
"(",
")",
";",
"try",
"{",
"processReturn",
".",
"exitCode",
"=",
"pr... | /*public static Thread runCommandInThread (final List<String> toRun) throws OSHelperException {
Thread commandThread;
} | [
"/",
"*",
"public",
"static",
"Thread",
"runCommandInThread",
"(",
"final",
"List<String",
">",
"toRun",
")",
"throws",
"OSHelperException",
"{",
"Thread",
"commandThread",
";"
] | train | https://github.com/dmerkushov/os-helper/blob/a7c2b72d289d9bc23ae106d1c5e11769cf3463d6/src/main/java/ru/dmerkushov/oshelper/OSHelper.java#L77-L92 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/data/SenBotReferenceService.java | SenBotReferenceService.getElementLocatorForElementReference | public By getElementLocatorForElementReference(String elementReference, String apendix) {
"""
Find a {@link By} locator by its reference name and add something to the xpath before the element gets returned
The drawback of using this method is, that all locators are converted into By.xpath
@param elementReferen... | java | public By getElementLocatorForElementReference(String elementReference, String apendix) {
Map<String, By> objectReferenceMap = getObjectReferenceMap(By.class);
By elementLocator = objectReferenceMap.get(elementReference);
if (elementLocator instanceof ById) {
String xpathExpressio... | [
"public",
"By",
"getElementLocatorForElementReference",
"(",
"String",
"elementReference",
",",
"String",
"apendix",
")",
"{",
"Map",
"<",
"String",
",",
"By",
">",
"objectReferenceMap",
"=",
"getObjectReferenceMap",
"(",
"By",
".",
"class",
")",
";",
"By",
"ele... | Find a {@link By} locator by its reference name and add something to the xpath before the element gets returned
The drawback of using this method is, that all locators are converted into By.xpath
@param elementReference The name under which the refference is found
@param apendix The part of the xpath that shall be add... | [
"Find",
"a",
"{",
"@link",
"By",
"}",
"locator",
"by",
"its",
"reference",
"name",
"and",
"add",
"something",
"to",
"the",
"xpath",
"before",
"the",
"element",
"gets",
"returned",
"The",
"drawback",
"of",
"using",
"this",
"method",
"is",
"that",
"all",
"... | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/data/SenBotReferenceService.java#L167-L185 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.serializeRow | private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out) {
"""
Get portion of the columns and serialize in loop while not more columns left in the row
@param row SSTableIdentityIterator row representation with Column Family
@param key Decorated Key for the required row
... | java | private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out)
{
serializeRow(row.getColumnFamily().deletionInfo(), row, row.getColumnFamily().metadata(), key, out);
} | [
"private",
"static",
"void",
"serializeRow",
"(",
"SSTableIdentityIterator",
"row",
",",
"DecoratedKey",
"key",
",",
"PrintStream",
"out",
")",
"{",
"serializeRow",
"(",
"row",
".",
"getColumnFamily",
"(",
")",
".",
"deletionInfo",
"(",
")",
",",
"row",
",",
... | Get portion of the columns and serialize in loop while not more columns left in the row
@param row SSTableIdentityIterator row representation with Column Family
@param key Decorated Key for the required row
@param out output stream | [
"Get",
"portion",
"of",
"the",
"columns",
"and",
"serialize",
"in",
"loop",
"while",
"not",
"more",
"columns",
"left",
"in",
"the",
"row"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L179-L182 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.addFilter | public void addFilter(final String columnFamily, Filter filter) {
"""
Adds the filter.
@param columnFamily
the column family
@param filter
the filter
"""
FilterList filterList = this.filters.get(columnFamily);
if (filterList == null)
{
filterList = new FilterList();
... | java | public void addFilter(final String columnFamily, Filter filter)
{
FilterList filterList = this.filters.get(columnFamily);
if (filterList == null)
{
filterList = new FilterList();
}
if (filter != null)
{
filterList.addFilter(filter);
}
... | [
"public",
"void",
"addFilter",
"(",
"final",
"String",
"columnFamily",
",",
"Filter",
"filter",
")",
"{",
"FilterList",
"filterList",
"=",
"this",
".",
"filters",
".",
"get",
"(",
"columnFamily",
")",
";",
"if",
"(",
"filterList",
"==",
"null",
")",
"{",
... | Adds the filter.
@param columnFamily
the column family
@param filter
the filter | [
"Adds",
"the",
"filter",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L716-L728 |
i-net-software/jlessc | src/com/inet/lib/less/HashMultimap.java | HashMultimap.addAll | void addAll( HashMultimap<K, V> m ) {
"""
Add all values of the mappings from the specified map to this map.
@param m
mappings to be stored in this map
"""
if( m == this ) {
return;
}
for( Entry<K, List<V>> entry : m.map.entrySet() ) {
K key = entry.getKey();... | java | void addAll( HashMultimap<K, V> m ) {
if( m == this ) {
return;
}
for( Entry<K, List<V>> entry : m.map.entrySet() ) {
K key = entry.getKey();
List<V> rules = map.get( key );
if( rules == null ) {
rules = new ArrayList<>();
... | [
"void",
"addAll",
"(",
"HashMultimap",
"<",
"K",
",",
"V",
">",
"m",
")",
"{",
"if",
"(",
"m",
"==",
"this",
")",
"{",
"return",
";",
"}",
"for",
"(",
"Entry",
"<",
"K",
",",
"List",
"<",
"V",
">",
">",
"entry",
":",
"m",
".",
"map",
".",
... | Add all values of the mappings from the specified map to this map.
@param m
mappings to be stored in this map | [
"Add",
"all",
"values",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"map",
"to",
"this",
"map",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/HashMultimap.java#L110-L127 |
windup/windup | rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/VendorSpecificationExtensionService.java | VendorSpecificationExtensionService.associateAsVendorExtension | public VendorSpecificationExtensionModel associateAsVendorExtension(FileModel model, String localFileName) {
"""
Makes the file model a vendor extension, and references a local file (if exists)
@param model
@param localFileName
"""
String pathToDescriptor = model.getFilePath();
pathToDescr... | java | public VendorSpecificationExtensionModel associateAsVendorExtension(FileModel model, String localFileName)
{
String pathToDescriptor = model.getFilePath();
pathToDescriptor = StringUtils.removeEnd(pathToDescriptor, model.getFileName());
pathToDescriptor += localFileName;
// now loo... | [
"public",
"VendorSpecificationExtensionModel",
"associateAsVendorExtension",
"(",
"FileModel",
"model",
",",
"String",
"localFileName",
")",
"{",
"String",
"pathToDescriptor",
"=",
"model",
".",
"getFilePath",
"(",
")",
";",
"pathToDescriptor",
"=",
"StringUtils",
".",
... | Makes the file model a vendor extension, and references a local file (if exists)
@param model
@param localFileName | [
"Makes",
"the",
"file",
"model",
"a",
"vendor",
"extension",
"and",
"references",
"a",
"local",
"file",
"(",
"if",
"exists",
")"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/VendorSpecificationExtensionService.java#L51-L73 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.setInt | public void setInt(@NotNull final String key, @NotNull final int value) {
"""
Sets a property value.
@param key the key for the property
@param value the value for the property
"""
props.setProperty(key, String.valueOf(value));
LOGGER.debug("Setting: {}='{}'", key, value);
} | java | public void setInt(@NotNull final String key, @NotNull final int value) {
props.setProperty(key, String.valueOf(value));
LOGGER.debug("Setting: {}='{}'", key, value);
} | [
"public",
"void",
"setInt",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"NotNull",
"final",
"int",
"value",
")",
"{",
"props",
".",
"setProperty",
"(",
"key",
",",
"String",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"LOGGER",
".",
"de... | Sets a property value.
@param key the key for the property
@param value the value for the property | [
"Sets",
"a",
"property",
"value",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L746-L749 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginGetVpnProfilePackageUrlAsync | public Observable<String> beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
@param res... | java | public Observable<String> beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<String>, String>() {
@Override
... | [
"public",
"Observable",
"<",
"String",
">",
"beginGetVpnProfilePackageUrlAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"beginGetVpnProfilePackageUrlWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNe... | Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws Ille... | [
"Gets",
"pre",
"-",
"generated",
"VPN",
"profile",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
".",
"The",
"profile",
"needs",
"to",
"be",
"generated",
"first",
"using",
"generateVpnProfi... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1891-L1898 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java | Infer.reportBoundError | void reportBoundError(UndetVar uv, InferenceBound ib1, InferenceBound ib2) {
"""
Incorporation error: mismatch between two (or more) bounds of different kinds.
"""
reportInferenceError(
String.format("incompatible.%s.%s.bounds",
StringUtils.toLowerCase(ib1.name()... | java | void reportBoundError(UndetVar uv, InferenceBound ib1, InferenceBound ib2) {
reportInferenceError(
String.format("incompatible.%s.%s.bounds",
StringUtils.toLowerCase(ib1.name()),
StringUtils.toLowerCase(ib2.name())),
uv.qtype,
... | [
"void",
"reportBoundError",
"(",
"UndetVar",
"uv",
",",
"InferenceBound",
"ib1",
",",
"InferenceBound",
"ib2",
")",
"{",
"reportInferenceError",
"(",
"String",
".",
"format",
"(",
"\"incompatible.%s.%s.bounds\"",
",",
"StringUtils",
".",
"toLowerCase",
"(",
"ib1",
... | Incorporation error: mismatch between two (or more) bounds of different kinds. | [
"Incorporation",
"error",
":",
"mismatch",
"between",
"two",
"(",
"or",
"more",
")",
"bounds",
"of",
"different",
"kinds",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java#L1290-L1298 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java | CouchDatabaseBase.removeAttachment | public Response removeAttachment(String id, String rev, String attachmentName) {
"""
Removes an attachment from a document given both a document <code>_id</code> and
<code>_rev</code> and <code>attachmentName</code> values.
@param id The document _id field.
@param rev The document _rev field.
@param attachm... | java | public Response removeAttachment(String id, String rev, String attachmentName) {
assertNotEmpty(id, "id");
assertNotEmpty(rev, "rev");
assertNotEmpty(attachmentName, "attachmentName");
final URI uri = new DatabaseURIHelper(dbUri).attachmentUri(id, rev, attachmentName);
return cou... | [
"public",
"Response",
"removeAttachment",
"(",
"String",
"id",
",",
"String",
"rev",
",",
"String",
"attachmentName",
")",
"{",
"assertNotEmpty",
"(",
"id",
",",
"\"id\"",
")",
";",
"assertNotEmpty",
"(",
"rev",
",",
"\"rev\"",
")",
";",
"assertNotEmpty",
"(... | Removes an attachment from a document given both a document <code>_id</code> and
<code>_rev</code> and <code>attachmentName</code> values.
@param id The document _id field.
@param rev The document _rev field.
@param attachmentName The document attachment field.
@return {@link Response}
@throws NoDocumentException If ... | [
"Removes",
"an",
"attachment",
"from",
"a",
"document",
"given",
"both",
"a",
"document",
"<code",
">",
"_id<",
"/",
"code",
">",
"and",
"<code",
">",
"_rev<",
"/",
"code",
">",
"and",
"<code",
">",
"attachmentName<",
"/",
"code",
">",
"values",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java#L411-L417 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.randomSample | public static DBIDs randomSample(DBIDs ids, double rate, RandomFactory random) {
"""
Produce a random sample of the given DBIDs.
@param ids Original ids, no duplicates allowed
@param rate Sampling rate
@param random Random generator
@return Sample
"""
return randomSample(ids, rate, random.getSingleTh... | java | public static DBIDs randomSample(DBIDs ids, double rate, RandomFactory random) {
return randomSample(ids, rate, random.getSingleThreadedRandom());
} | [
"public",
"static",
"DBIDs",
"randomSample",
"(",
"DBIDs",
"ids",
",",
"double",
"rate",
",",
"RandomFactory",
"random",
")",
"{",
"return",
"randomSample",
"(",
"ids",
",",
"rate",
",",
"random",
".",
"getSingleThreadedRandom",
"(",
")",
")",
";",
"}"
] | Produce a random sample of the given DBIDs.
@param ids Original ids, no duplicates allowed
@param rate Sampling rate
@param random Random generator
@return Sample | [
"Produce",
"a",
"random",
"sample",
"of",
"the",
"given",
"DBIDs",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L684-L686 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/platform/PersistentSettings.java | PersistentSettings.saveProperty | public PersistentSettings saveProperty(DbSession dbSession, String key, @Nullable String value) {
"""
Insert property into database if value is not {@code null}, else delete property from
database. Session is not committed but {@link org.sonar.api.config.GlobalPropertyChangeHandler}
are executed.
"""
sav... | java | public PersistentSettings saveProperty(DbSession dbSession, String key, @Nullable String value) {
savePropertyImpl(dbSession, key, value);
changeNotifier.onGlobalPropertyChange(key, value);
return this;
} | [
"public",
"PersistentSettings",
"saveProperty",
"(",
"DbSession",
"dbSession",
",",
"String",
"key",
",",
"@",
"Nullable",
"String",
"value",
")",
"{",
"savePropertyImpl",
"(",
"dbSession",
",",
"key",
",",
"value",
")",
";",
"changeNotifier",
".",
"onGlobalProp... | Insert property into database if value is not {@code null}, else delete property from
database. Session is not committed but {@link org.sonar.api.config.GlobalPropertyChangeHandler}
are executed. | [
"Insert",
"property",
"into",
"database",
"if",
"value",
"is",
"not",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/platform/PersistentSettings.java#L51-L55 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.createTable | @NonNull
public static CreateTableStart createTable(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier tableName) {
"""
Starts a CREATE TABLE query with the given table name for the given keyspace name.
"""
return new DefaultCreateTable(keyspace, tableName);
} | java | @NonNull
public static CreateTableStart createTable(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier tableName) {
return new DefaultCreateTable(keyspace, tableName);
} | [
"@",
"NonNull",
"public",
"static",
"CreateTableStart",
"createTable",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"tableName",
")",
"{",
"return",
"new",
"DefaultCreateTable",
"(",
"keyspace",
",",
"tableName",
")",
";... | Starts a CREATE TABLE query with the given table name for the given keyspace name. | [
"Starts",
"a",
"CREATE",
"TABLE",
"query",
"with",
"the",
"given",
"table",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L118-L122 |
kochedykov/jlibmodbus | src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java | ModbusMaster.readDeviceIdentification | final public MEIReadDeviceIdentification readDeviceIdentification(int serverAddress, int objectId, ReadDeviceIdentificationCode readDeviceId) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
"""
This function code allows reading the identification and additional information re... | java | final public MEIReadDeviceIdentification readDeviceIdentification(int serverAddress, int objectId, ReadDeviceIdentificationCode readDeviceId) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
EncapsulatedInterfaceTransportResponse response = (EncapsulatedInterfaceTransportRe... | [
"final",
"public",
"MEIReadDeviceIdentification",
"readDeviceIdentification",
"(",
"int",
"serverAddress",
",",
"int",
"objectId",
",",
"ReadDeviceIdentificationCode",
"readDeviceId",
")",
"throws",
"ModbusProtocolException",
",",
"ModbusNumberException",
",",
"ModbusIOExceptio... | This function code allows reading the identification and additional information relative to the
physical and functional description of a remote device, only.
The Read Device Identification interface is modeled as an address space composed of a set
of addressable data elements. The data elements are called objects and a... | [
"This",
"function",
"code",
"allows",
"reading",
"the",
"identification",
"and",
"additional",
"information",
"relative",
"to",
"the",
"physical",
"and",
"functional",
"description",
"of",
"a",
"remote",
"device",
"only",
".",
"The",
"Read",
"Device",
"Identificat... | train | https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java#L741-L745 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java | IfmapJ.createSsrc | @Deprecated
public static SSRC createSsrc(String url, KeyManager[] kms, TrustManager[] tms)
throws InitializationException {
"""
Create a new {@link SSRC} object to operate on the given URL
using certificate-based authentication.
The keystore and truststore to be used have to be set using
the {@link Syste... | java | @Deprecated
public static SSRC createSsrc(String url, KeyManager[] kms, TrustManager[] tms)
throws InitializationException {
return new SsrcImpl(url, kms, tms, 120 * 1000);
} | [
"@",
"Deprecated",
"public",
"static",
"SSRC",
"createSsrc",
"(",
"String",
"url",
",",
"KeyManager",
"[",
"]",
"kms",
",",
"TrustManager",
"[",
"]",
"tms",
")",
"throws",
"InitializationException",
"{",
"return",
"new",
"SsrcImpl",
"(",
"url",
",",
"kms",
... | Create a new {@link SSRC} object to operate on the given URL
using certificate-based authentication.
The keystore and truststore to be used have to be set using
the {@link System#setProperty(String, String)} method using
the keys javax.net.ssl.keyStore, and javax.net.ssl.trustStore
respectively.
@param url
the URL to... | [
"Create",
"a",
"new",
"{",
"@link",
"SSRC",
"}",
"object",
"to",
"operate",
"on",
"the",
"given",
"URL",
"using",
"certificate",
"-",
"based",
"authentication",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java#L147-L151 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java | ProxiedFileSystemUtils.createProxiedFileSystemUsingKeytab | static FileSystem createProxiedFileSystemUsingKeytab(State state, URI fsURI, Configuration conf)
throws IOException, InterruptedException {
"""
Create a {@link FileSystem} that can perform any operations allowed the by the specified userNameToProxyAs. This
method uses the {@link #createProxiedFileSystemUsin... | java | static FileSystem createProxiedFileSystemUsingKeytab(State state, URI fsURI, Configuration conf)
throws IOException, InterruptedException {
Preconditions.checkArgument(state.contains(ConfigurationKeys.FS_PROXY_AS_USER_NAME));
Preconditions.checkArgument(state.contains(ConfigurationKeys.SUPER_USER_NAME_TO_... | [
"static",
"FileSystem",
"createProxiedFileSystemUsingKeytab",
"(",
"State",
"state",
",",
"URI",
"fsURI",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"state",
".",
"contains"... | Create a {@link FileSystem} that can perform any operations allowed the by the specified userNameToProxyAs. This
method uses the {@link #createProxiedFileSystemUsingKeytab(String, String, Path, URI, Configuration)} object to perform
all its work. A specific set of configuration keys are required to be set in the given ... | [
"Create",
"a",
"{",
"@link",
"FileSystem",
"}",
"that",
"can",
"perform",
"any",
"operations",
"allowed",
"the",
"by",
"the",
"specified",
"userNameToProxyAs",
".",
"This",
"method",
"uses",
"the",
"{",
"@link",
"#createProxiedFileSystemUsingKeytab",
"(",
"String"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java#L153-L162 |
j256/ormlite-core | src/main/java/com/j256/ormlite/dao/DaoManager.java | DaoManager.registerDaoWithTableConfig | public static synchronized void registerDaoWithTableConfig(ConnectionSource connectionSource, Dao<?, ?> dao) {
"""
Same as {@link #registerDao(ConnectionSource, Dao)} but this allows you to register it just with its
{@link DatabaseTableConfig}. This allows multiple versions of the DAO to be configured if necessar... | java | public static synchronized void registerDaoWithTableConfig(ConnectionSource connectionSource, Dao<?, ?> dao) {
if (connectionSource == null) {
throw new IllegalArgumentException("connectionSource argument cannot be null");
}
if (dao instanceof BaseDaoImpl) {
DatabaseTableConfig<?> tableConfig = ((BaseDaoImp... | [
"public",
"static",
"synchronized",
"void",
"registerDaoWithTableConfig",
"(",
"ConnectionSource",
"connectionSource",
",",
"Dao",
"<",
"?",
",",
"?",
">",
"dao",
")",
"{",
"if",
"(",
"connectionSource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentEx... | Same as {@link #registerDao(ConnectionSource, Dao)} but this allows you to register it just with its
{@link DatabaseTableConfig}. This allows multiple versions of the DAO to be configured if necessary. | [
"Same",
"as",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/DaoManager.java#L200-L212 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallPlugin | public static PluginBean unmarshallPlugin(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the plugin
"""
if (source == null) {
return null;
}
PluginBean bean = new PluginBean();
bean.setId(asLong(sourc... | java | public static PluginBean unmarshallPlugin(Map<String, Object> source) {
if (source == null) {
return null;
}
PluginBean bean = new PluginBean();
bean.setId(asLong(source.get("id")));
bean.setName(asString(source.get("name")));
bean.setDescription(asString(sour... | [
"public",
"static",
"PluginBean",
"unmarshallPlugin",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"PluginBean",
"bean",
"=",
"new",
"PluginBean",
"(",
")",
... | Unmarshals the given map source into a bean.
@param source the source
@return the plugin | [
"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#L1310-L1328 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java | TokenProvider.createAzureActiveDirectoryTokenProvider | public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String clientSecret) throws MalformedURLException {
"""
Creates an Azure Active Directory token provider that acquires a token from the given active directory instance using the given clientId and client secre... | java | public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String clientSecret) throws MalformedURLException
{
AuthenticationContext authContext = createAuthenticationContext(authorityUrl);
return new AzureActiveDirectoryTokenProvider(authContext, new C... | [
"public",
"static",
"TokenProvider",
"createAzureActiveDirectoryTokenProvider",
"(",
"String",
"authorityUrl",
",",
"String",
"clientId",
",",
"String",
"clientSecret",
")",
"throws",
"MalformedURLException",
"{",
"AuthenticationContext",
"authContext",
"=",
"createAuthentica... | Creates an Azure Active Directory token provider that acquires a token from the given active directory instance using the given clientId and client secret.
This is a utility method.
@param authorityUrl URL of the Azure Active Directory instance
@param clientId client id of the application
@param clientSecret client sec... | [
"Creates",
"an",
"Azure",
"Active",
"Directory",
"token",
"provider",
"that",
"acquires",
"a",
"token",
"from",
"the",
"given",
"active",
"directory",
"instance",
"using",
"the",
"given",
"clientId",
"and",
"client",
"secret",
".",
"This",
"is",
"a",
"utility"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java#L75-L79 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_secondaryDnsDomains_POST | public void serviceName_secondaryDnsDomains_POST(String serviceName, String domain, String ip) throws IOException {
"""
add a domain on secondary dns
REST: POST /dedicated/server/{serviceName}/secondaryDnsDomains
@param domain [required] The domain to add
@param ip [required]
@param serviceName [required] Th... | java | public void serviceName_secondaryDnsDomains_POST(String serviceName, String domain, String ip) throws IOException {
String qPath = "/dedicated/server/{serviceName}/secondaryDnsDomains";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "domain", do... | [
"public",
"void",
"serviceName_secondaryDnsDomains_POST",
"(",
"String",
"serviceName",
",",
"String",
"domain",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/secondaryDnsDomains\"",
";",
"StringBuilder",
... | add a domain on secondary dns
REST: POST /dedicated/server/{serviceName}/secondaryDnsDomains
@param domain [required] The domain to add
@param ip [required]
@param serviceName [required] The internal name of your dedicated server | [
"add",
"a",
"domain",
"on",
"secondary",
"dns"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L2003-L2010 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.setFont | public void setFont (final PDFont font, final float fontSize) throws IOException {
"""
Set the font and font size to draw text with.
@param font
The font to use.
@param fontSize
The font size to draw the text.
@throws IOException
If there is an error writing the font information.
"""
if (fontStack.... | java | public void setFont (final PDFont font, final float fontSize) throws IOException
{
if (fontStack.isEmpty ())
fontStack.add (font);
else
fontStack.set (fontStack.size () - 1, font);
PDDocumentHelper.handleFontSubset (m_aDoc, font);
writeOperand (resources.add (font));
writeOperand (fo... | [
"public",
"void",
"setFont",
"(",
"final",
"PDFont",
"font",
",",
"final",
"float",
"fontSize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fontStack",
".",
"isEmpty",
"(",
")",
")",
"fontStack",
".",
"add",
"(",
"font",
")",
";",
"else",
"fontStack",... | Set the font and font size to draw text with.
@param font
The font to use.
@param fontSize
The font size to draw the text.
@throws IOException
If there is an error writing the font information. | [
"Set",
"the",
"font",
"and",
"font",
"size",
"to",
"draw",
"text",
"with",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L332-L344 |
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.standaloneLogon | public void standaloneLogon (BootstrapData data, DObjectManager omgr) {
"""
Logs this client on in standalone mode with the faked bootstrap data and shared local
distributed object manager.
"""
if (!_standalone) {
throw new IllegalStateException("Must call prepareStandaloneLogon() first.")... | java | public void standaloneLogon (BootstrapData data, DObjectManager omgr)
{
if (!_standalone) {
throw new IllegalStateException("Must call prepareStandaloneLogon() first.");
}
gotBootstrap(data, omgr);
} | [
"public",
"void",
"standaloneLogon",
"(",
"BootstrapData",
"data",
",",
"DObjectManager",
"omgr",
")",
"{",
"if",
"(",
"!",
"_standalone",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Must call prepareStandaloneLogon() first.\"",
")",
";",
"}",
"gotBoo... | Logs this client on in standalone mode with the faked bootstrap data and shared local
distributed object manager. | [
"Logs",
"this",
"client",
"on",
"in",
"standalone",
"mode",
"with",
"the",
"faked",
"bootstrap",
"data",
"and",
"shared",
"local",
"distributed",
"object",
"manager",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L635-L641 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.data_afnicAssociationInformation_POST | public OvhAssociationContact data_afnicAssociationInformation_POST(Long contactId, Date declarationDate, Date publicationDate, String publicationNumber, String publicationPageNumber) throws IOException {
"""
Post a new association information according to Afnic
REST: POST /domain/data/afnicAssociationInformatio... | java | public OvhAssociationContact data_afnicAssociationInformation_POST(Long contactId, Date declarationDate, Date publicationDate, String publicationNumber, String publicationPageNumber) throws IOException {
String qPath = "/domain/data/afnicAssociationInformation";
StringBuilder sb = path(qPath);
HashMap<String, Obj... | [
"public",
"OvhAssociationContact",
"data_afnicAssociationInformation_POST",
"(",
"Long",
"contactId",
",",
"Date",
"declarationDate",
",",
"Date",
"publicationDate",
",",
"String",
"publicationNumber",
",",
"String",
"publicationPageNumber",
")",
"throws",
"IOException",
"{... | Post a new association information according to Afnic
REST: POST /domain/data/afnicAssociationInformation
@param declarationDate [required] Date of the declaration of the association
@param publicationDate [required] Date of the publication of the declaration of the association
@param publicationNumber [required] Numb... | [
"Post",
"a",
"new",
"association",
"information",
"according",
"to",
"Afnic"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L198-L209 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.candidateMethods | public static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes) {
"""
Selects the best equally-matching methods for the given argument types.
@param methods
@param argTypes
@return methods
"""
return candidates(methods, collectSignatures(methods), collectVarArgs(methods), argTypes);
... | java | public static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes) {
return candidates(methods, collectSignatures(methods), collectVarArgs(methods), argTypes);
} | [
"public",
"static",
"Method",
"[",
"]",
"candidateMethods",
"(",
"Method",
"[",
"]",
"methods",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"{",
"return",
"candidates",
"(",
"methods",
",",
"collectSignatures",
"(",
"methods",
")",
",",
"coll... | Selects the best equally-matching methods for the given argument types.
@param methods
@param argTypes
@return methods | [
"Selects",
"the",
"best",
"equally",
"-",
"matching",
"methods",
"for",
"the",
"given",
"argument",
"types",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L207-L209 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/AnnotationUtils.java | AnnotationUtils.annotationArrayMemberEquals | @GwtIncompatible("incompatible method")
private static boolean annotationArrayMemberEquals(final Annotation[] a1, final Annotation[] a2) {
"""
Helper method for comparing two arrays of annotations.
@param a1 the first array
@param a2 the second array
@return a flag whether these arrays are equal
"""
... | java | @GwtIncompatible("incompatible method")
private static boolean annotationArrayMemberEquals(final Annotation[] a1, final Annotation[] a2) {
if (a1.length != a2.length) {
return false;
}
for (int i = 0; i < a1.length; i++) {
if (!equals(a1[i], a2[i])) {
... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"private",
"static",
"boolean",
"annotationArrayMemberEquals",
"(",
"final",
"Annotation",
"[",
"]",
"a1",
",",
"final",
"Annotation",
"[",
"]",
"a2",
")",
"{",
"if",
"(",
"a1",
".",
"length",
"!=",
... | Helper method for comparing two arrays of annotations.
@param a1 the first array
@param a2 the second array
@return a flag whether these arrays are equal | [
"Helper",
"method",
"for",
"comparing",
"two",
"arrays",
"of",
"annotations",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/AnnotationUtils.java#L333-L344 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ReplicationLinksInner.java | ReplicationLinksInner.getAsync | public Observable<ReplicationLinkInner> getAsync(String resourceGroupName, String serverName, String databaseName, String linkId) {
"""
Gets a database replication link.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager ... | java | public Observable<ReplicationLinkInner> getAsync(String resourceGroupName, String serverName, String databaseName, String linkId) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, linkId).map(new Func1<ServiceResponse<ReplicationLinkInner>, ReplicationLinkInner>() {
@... | [
"public",
"Observable",
"<",
"ReplicationLinkInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"linkId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets a database replication link.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database to get the link for.
@param linkId Th... | [
"Gets",
"a",
"database",
"replication",
"link",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ReplicationLinksInner.java#L228-L235 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.getBooleanFromMap | public static boolean getBooleanFromMap(String key, Map<?, ?> map, boolean defaultValue) {
"""
Retrieves a boolean value from a Map for the given key
@param key The key that references the boolean value
@param map The map to look in
@return A boolean value which will be false if the map is null, the map doesn... | java | public static boolean getBooleanFromMap(String key, Map<?, ?> map, boolean defaultValue) {
if (map == null) return defaultValue;
if (map.containsKey(key)) {
Object o = map.get(key);
if (o == null) {
return defaultValue;
}
if (o instanceof B... | [
"public",
"static",
"boolean",
"getBooleanFromMap",
"(",
"String",
"key",
",",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"return",
"defaultValue",
";",
"if",
"(",
"map",
".",
... | Retrieves a boolean value from a Map for the given key
@param key The key that references the boolean value
@param map The map to look in
@return A boolean value which will be false if the map is null, the map doesn't contain the key or the value is false | [
"Retrieves",
"a",
"boolean",
"value",
"from",
"a",
"Map",
"for",
"the",
"given",
"key"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L824-L837 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/client/AtsdServerExceptionFactory.java | AtsdServerExceptionFactory.fromResponse | static AtsdServerException fromResponse(final Response response) {
"""
Generate {@link AtsdServerException} from Http Response.
@param response {@link Response} class from jersey.
@return AtsdServerException instance with extracted message from response.
"""
final int status = response.getStatus();... | java | static AtsdServerException fromResponse(final Response response) {
final int status = response.getStatus();
try {
final ServerError serverError = response.readEntity(ServerError.class);
final String message = AtsdServerMessageFactory.from(serverError);
return new Atsd... | [
"static",
"AtsdServerException",
"fromResponse",
"(",
"final",
"Response",
"response",
")",
"{",
"final",
"int",
"status",
"=",
"response",
".",
"getStatus",
"(",
")",
";",
"try",
"{",
"final",
"ServerError",
"serverError",
"=",
"response",
".",
"readEntity",
... | Generate {@link AtsdServerException} from Http Response.
@param response {@link Response} class from jersey.
@return AtsdServerException instance with extracted message from response. | [
"Generate",
"{",
"@link",
"AtsdServerException",
"}",
"from",
"Http",
"Response",
"."
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/client/AtsdServerExceptionFactory.java#L22-L31 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/hashing/DataHasher.java | DataHasher.addData | public final DataHasher addData(InputStream inStream, int bufferSize) {
"""
Adds data to the digest using the specified input stream of bytes, starting at an offset of 0.
@param inStream input stream of bytes.
@param bufferSize maximum allowed buffer size for reading data.
@return The same {@link DataHash... | java | public final DataHasher addData(InputStream inStream, int bufferSize) {
Util.notNull(inStream, "Input stream");
try {
byte[] buffer = new byte[bufferSize];
while (true) {
int bytesRead = inStream.read(buffer);
if (bytesRead == -1) {
... | [
"public",
"final",
"DataHasher",
"addData",
"(",
"InputStream",
"inStream",
",",
"int",
"bufferSize",
")",
"{",
"Util",
".",
"notNull",
"(",
"inStream",
",",
"\"Input stream\"",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"... | Adds data to the digest using the specified input stream of bytes, starting at an offset of 0.
@param inStream input stream of bytes.
@param bufferSize maximum allowed buffer size for reading data.
@return The same {@link DataHasher} object for chaining calls.
@throws HashException when hash calculation fai... | [
"Adds",
"data",
"to",
"the",
"digest",
"using",
"the",
"specified",
"input",
"stream",
"of",
"bytes",
"starting",
"at",
"an",
"offset",
"of",
"0",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/hashing/DataHasher.java#L218-L233 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/ArchiveUtils.java | ArchiveUtils.getLicenseAgreement | public static String getLicenseAgreement(final JarFile jar, final Map<String, String> manifestAttrs) {
"""
Gets the license agreement for the jar file.
@param jar the jar file
@param manifestAttrs the manifest file for the jar file
@return the license agreement as a String
"""
String licenseAgreem... | java | public static String getLicenseAgreement(final JarFile jar, final Map<String, String> manifestAttrs) {
String licenseAgreement = null;
if (manifestAttrs.isEmpty()) {
return licenseAgreement;
}
String licenseAgreementPrefix = manifestAttrs.get(ArchiveUtils.LICENSE_AGREEMENT)... | [
"public",
"static",
"String",
"getLicenseAgreement",
"(",
"final",
"JarFile",
"jar",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"manifestAttrs",
")",
"{",
"String",
"licenseAgreement",
"=",
"null",
";",
"if",
"(",
"manifestAttrs",
".",
"isEmpty",
... | Gets the license agreement for the jar file.
@param jar the jar file
@param manifestAttrs the manifest file for the jar file
@return the license agreement as a String | [
"Gets",
"the",
"license",
"agreement",
"for",
"the",
"jar",
"file",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/ArchiveUtils.java#L168-L183 |
kiswanij/jk-util | src/main/java/com/jk/util/JKHttpUtil.java | JKHttpUtil.getValueFromUrl | public static String getValueFromUrl(String url, String preText, int length) {
"""
Gets the value from url based on pre-text value from the response.
@param url the url
@param preText the pre text
@param length the length
@return the value from url
"""
String urlContents = getUrlContents(url);
i... | java | public static String getValueFromUrl(String url, String preText, int length) {
String urlContents = getUrlContents(url);
int indexOf = urlContents.indexOf(preText);
if (indexOf != -1) {
indexOf += preText.length();
String substring = urlContents.substring(indexOf, indexOf + length);
return substring;
}... | [
"public",
"static",
"String",
"getValueFromUrl",
"(",
"String",
"url",
",",
"String",
"preText",
",",
"int",
"length",
")",
"{",
"String",
"urlContents",
"=",
"getUrlContents",
"(",
"url",
")",
";",
"int",
"indexOf",
"=",
"urlContents",
".",
"indexOf",
"(",
... | Gets the value from url based on pre-text value from the response.
@param url the url
@param preText the pre text
@param length the length
@return the value from url | [
"Gets",
"the",
"value",
"from",
"url",
"based",
"on",
"pre",
"-",
"text",
"value",
"from",
"the",
"response",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKHttpUtil.java#L184-L193 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java | ST_FurthestCoordinate.getFurthestCoordinate | public static Geometry getFurthestCoordinate(Point point, Geometry geom) {
"""
Computes the furthest coordinate(s) contained in the given geometry starting
from the given point, using the 2D distance.
@param point Point
@param geom Geometry
@return The furthest coordinate(s) contained in the given geometry ... | java | public static Geometry getFurthestCoordinate(Point point, Geometry geom) {
if (point == null || geom == null) {
return null;
}
double maxDistance = Double.NEGATIVE_INFINITY;
Coordinate pointCoordinate = point.getCoordinate();
Set<Coordinate> furthestCoordinates = new ... | [
"public",
"static",
"Geometry",
"getFurthestCoordinate",
"(",
"Point",
"point",
",",
"Geometry",
"geom",
")",
"{",
"if",
"(",
"point",
"==",
"null",
"||",
"geom",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"double",
"maxDistance",
"=",
"Double",
... | Computes the furthest coordinate(s) contained in the given geometry starting
from the given point, using the 2D distance.
@param point Point
@param geom Geometry
@return The furthest coordinate(s) contained in the given geometry starting from
the given point, using the 2D distance | [
"Computes",
"the",
"furthest",
"coordinate",
"(",
"s",
")",
"contained",
"in",
"the",
"given",
"geometry",
"starting",
"from",
"the",
"given",
"point",
"using",
"the",
"2D",
"distance",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/distance/ST_FurthestCoordinate.java#L64-L87 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/WaitHelper.java | WaitHelper.waitUntilNoMoreException | public void waitUntilNoMoreException(final Runnable runnable, final List<Class<? extends Exception>> expectedExceptions) {
"""
Wait until no more expected exception is thrown or the number of wait cycles has been exceeded.
@param runnable
Code to run.
@param expectedExceptions
List of expected exceptions.
... | java | public void waitUntilNoMoreException(final Runnable runnable, final List<Class<? extends Exception>> expectedExceptions) {
final List<RuntimeException> actualExceptions = new ArrayList<>();
int tries = 0;
while (tries < maxTries) {
try {
runnable.run();
... | [
"public",
"void",
"waitUntilNoMoreException",
"(",
"final",
"Runnable",
"runnable",
",",
"final",
"List",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
">",
">",
"expectedExceptions",
")",
"{",
"final",
"List",
"<",
"RuntimeException",
">",
"actualExceptions",
... | Wait until no more expected exception is thrown or the number of wait cycles has been exceeded.
@param runnable
Code to run.
@param expectedExceptions
List of expected exceptions. | [
"Wait",
"until",
"no",
"more",
"expected",
"exception",
"is",
"thrown",
"or",
"the",
"number",
"of",
"wait",
"cycles",
"has",
"been",
"exceeded",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/WaitHelper.java#L55-L75 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java | TelegramBot.editInlineMessageText | public boolean editInlineMessageText(String inlineMessageId, String text, ParseMode parseMode, boolean disableWebPagePreview, InlineReplyMarkup inlineReplyMarkup) {
"""
This allows you to edit the text of an inline message you have sent previously. (The inline message must have an
InlineReplyMarkup object attache... | java | public boolean editInlineMessageText(String inlineMessageId, String text, ParseMode parseMode, boolean disableWebPagePreview, InlineReplyMarkup inlineReplyMarkup) {
if(inlineMessageId != null && text != null) {
JSONObject jsonResponse = this.editMessageText(null, null, inlineMessageId, text, parse... | [
"public",
"boolean",
"editInlineMessageText",
"(",
"String",
"inlineMessageId",
",",
"String",
"text",
",",
"ParseMode",
"parseMode",
",",
"boolean",
"disableWebPagePreview",
",",
"InlineReplyMarkup",
"inlineReplyMarkup",
")",
"{",
"if",
"(",
"inlineMessageId",
"!=",
... | This allows you to edit the text of an inline message you have sent previously. (The inline message must have an
InlineReplyMarkup object attached in order to be editable)
@param inlineMessageId The ID of the inline message you want to edit
@param text The new text you want to display
@p... | [
"This",
"allows",
"you",
"to",
"edit",
"the",
"text",
"of",
"an",
"inline",
"message",
"you",
"have",
"sent",
"previously",
".",
"(",
"The",
"inline",
"message",
"must",
"have",
"an",
"InlineReplyMarkup",
"object",
"attached",
"in",
"order",
"to",
"be",
"e... | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L712-L725 |
ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java | MappingDataTypeCompletion.insertOperationDatatyping | private void insertOperationDatatyping(Term term, Function atom, int position) throws UnknownDatatypeException {
"""
Following r2rml standard we do not infer the datatype for operation but we return the default value string
"""
ImmutableTerm immutableTerm = immutabilityTools.convertIntoImmutableTerm(t... | java | private void insertOperationDatatyping(Term term, Function atom, int position) throws UnknownDatatypeException {
ImmutableTerm immutableTerm = immutabilityTools.convertIntoImmutableTerm(term);
if (immutableTerm instanceof ImmutableFunctionalTerm) {
ImmutableFunctionalTerm castTerm = (Immut... | [
"private",
"void",
"insertOperationDatatyping",
"(",
"Term",
"term",
",",
"Function",
"atom",
",",
"int",
"position",
")",
"throws",
"UnknownDatatypeException",
"{",
"ImmutableTerm",
"immutableTerm",
"=",
"immutabilityTools",
".",
"convertIntoImmutableTerm",
"(",
"term"... | Following r2rml standard we do not infer the datatype for operation but we return the default value string | [
"Following",
"r2rml",
"standard",
"we",
"do",
"not",
"infer",
"the",
"datatype",
"for",
"operation",
"but",
"we",
"return",
"the",
"default",
"value",
"string"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/transformer/impl/MappingDataTypeCompletion.java#L145-L185 |
influxdata/influxdb-java | src/main/java/org/influxdb/impl/Preconditions.java | Preconditions.checkPositiveNumber | public static void checkPositiveNumber(final Number number, final String name) throws IllegalArgumentException {
"""
Enforces that the number is larger than 0.
@param number the number to test
@param name variable name for reporting
@throws IllegalArgumentException if the number is less or equal to 0
"""
... | java | public static void checkPositiveNumber(final Number number, final String name) throws IllegalArgumentException {
if (number == null || number.doubleValue() <= 0) {
throw new IllegalArgumentException("Expecting a positive number for " + name);
}
} | [
"public",
"static",
"void",
"checkPositiveNumber",
"(",
"final",
"Number",
"number",
",",
"final",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"number",
"==",
"null",
"||",
"number",
".",
"doubleValue",
"(",
")",
"<=",
"0",
"... | Enforces that the number is larger than 0.
@param number the number to test
@param name variable name for reporting
@throws IllegalArgumentException if the number is less or equal to 0 | [
"Enforces",
"that",
"the",
"number",
"is",
"larger",
"than",
"0",
"."
] | train | https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/Preconditions.java#L33-L37 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java | ConstructorBuilder.getInstance | public static ConstructorBuilder getInstance(Context context,
ClassDoc classDoc, ConstructorWriter writer) {
"""
Construct a new ConstructorBuilder.
@param context the build context.
@param classDoc the class whoses members are being documented.
@param writer the doclet specific writer.
"""
... | java | public static ConstructorBuilder getInstance(Context context,
ClassDoc classDoc, ConstructorWriter writer) {
return new ConstructorBuilder(context, classDoc, writer);
} | [
"public",
"static",
"ConstructorBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"ClassDoc",
"classDoc",
",",
"ConstructorWriter",
"writer",
")",
"{",
"return",
"new",
"ConstructorBuilder",
"(",
"context",
",",
"classDoc",
",",
"writer",
")",
";",
"}"
] | Construct a new ConstructorBuilder.
@param context the build context.
@param classDoc the class whoses members are being documented.
@param writer the doclet specific writer. | [
"Construct",
"a",
"new",
"ConstructorBuilder",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java#L116-L119 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/topic/topicAccess/TopicAccessManager.java | TopicAccessManager.checkAccessTopicGlobalAC | boolean checkAccessTopicGlobalAC(UserContext ctx, String topic) throws IllegalAccessException {
"""
Check if global access control is allowed
@param ctx
@param topic
@return true if at least one global topicAccessControl exist
@throws IllegalAccessException
"""
logger.debug("Looking for accessController ... | java | boolean checkAccessTopicGlobalAC(UserContext ctx, String topic) throws IllegalAccessException {
logger.debug("Looking for accessController for topic '{}' from GlobalAccess", topic);
Iterable<JsTopicAccessController> accessControls = topicAccessController.select(DEFAULT_AT);
return checkAccessTopicFromControllers(... | [
"boolean",
"checkAccessTopicGlobalAC",
"(",
"UserContext",
"ctx",
",",
"String",
"topic",
")",
"throws",
"IllegalAccessException",
"{",
"logger",
".",
"debug",
"(",
"\"Looking for accessController for topic '{}' from GlobalAccess\"",
",",
"topic",
")",
";",
"Iterable",
"<... | Check if global access control is allowed
@param ctx
@param topic
@return true if at least one global topicAccessControl exist
@throws IllegalAccessException | [
"Check",
"if",
"global",
"access",
"control",
"is",
"allowed"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/topicAccess/TopicAccessManager.java#L67-L71 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.fieldName | public static String fieldName(Class<?> aClass,String regex) {
"""
This method returns the name of the field whose name matches with regex.
@param aClass a class to control
@param regex field name
@return true if exists a field with this name in aClass, false otherwise
"""
if(isNestedMapping(regex))
... | java | public static String fieldName(Class<?> aClass,String regex){
if(isNestedMapping(regex))
return regex;
String result = null;
for(Class<?> clazz: getAllsuperClasses(aClass))
if(!isNull(result = getFieldName(clazz, regex)))
return result;
return result;
} | [
"public",
"static",
"String",
"fieldName",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"regex",
")",
"{",
"if",
"(",
"isNestedMapping",
"(",
"regex",
")",
")",
"return",
"regex",
";",
"String",
"result",
"=",
"null",
";",
"for",
"(",
"Class",... | This method returns the name of the field whose name matches with regex.
@param aClass a class to control
@param regex field name
@return true if exists a field with this name in aClass, false otherwise | [
"This",
"method",
"returns",
"the",
"name",
"of",
"the",
"field",
"whose",
"name",
"matches",
"with",
"regex",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L393-L405 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterList.java | FilterList.findInList | public boolean findInList(int[] address) {
"""
Determine if an address, represented by an integer array, is in the address
tree
@param address
integer array representing the address, leftmost number
in the address should start at array offset 0.
@return true if this address is found in the address tree, fal... | java | public boolean findInList(int[] address) {
int len = address.length;
if (len < IP_ADDR_NUMBERS) {
int j = IP_ADDR_NUMBERS - 1;
// for performace, hard code the size here
int a[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
// int a[] = new int[IP_ADDR_NUMBERS];
... | [
"public",
"boolean",
"findInList",
"(",
"int",
"[",
"]",
"address",
")",
"{",
"int",
"len",
"=",
"address",
".",
"length",
";",
"if",
"(",
"len",
"<",
"IP_ADDR_NUMBERS",
")",
"{",
"int",
"j",
"=",
"IP_ADDR_NUMBERS",
"-",
"1",
";",
"// for performace, har... | Determine if an address, represented by an integer array, is in the address
tree
@param address
integer array representing the address, leftmost number
in the address should start at array offset 0.
@return true if this address is found in the address tree, false if
it is not. | [
"Determine",
"if",
"an",
"address",
"represented",
"by",
"an",
"integer",
"array",
"is",
"in",
"the",
"address",
"tree"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterList.java#L228-L249 |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/util/factory/AlexaSpeechletFactory.java | AlexaSpeechletFactory.createSpeechletFromRequest | public static <T extends AlexaSpeechlet> T createSpeechletFromRequest(final byte[] serializedSpeechletRequest, final Class<T> speechletClass, final UtteranceReader utteranceReader) throws IOException {
"""
Creates an AlexaSpeechlet from bytes of a speechlet request. It will extract the
locale from the request and... | java | public static <T extends AlexaSpeechlet> T createSpeechletFromRequest(final byte[] serializedSpeechletRequest, final Class<T> speechletClass, final UtteranceReader utteranceReader) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
final JsonNode parser = mapper.readTree(serializedSpe... | [
"public",
"static",
"<",
"T",
"extends",
"AlexaSpeechlet",
">",
"T",
"createSpeechletFromRequest",
"(",
"final",
"byte",
"[",
"]",
"serializedSpeechletRequest",
",",
"final",
"Class",
"<",
"T",
">",
"speechletClass",
",",
"final",
"UtteranceReader",
"utteranceReader... | Creates an AlexaSpeechlet from bytes of a speechlet request. It will extract the
locale from the request and uses it for creating a new instance of AlexaSpeechlet
@param serializedSpeechletRequest bytes of a speechlet request
@param speechletClass the class of your AlexaSpeechlet to instantiate
@param utteranceReader t... | [
"Creates",
"an",
"AlexaSpeechlet",
"from",
"bytes",
"of",
"a",
"speechlet",
"request",
".",
"It",
"will",
"extract",
"the",
"locale",
"from",
"the",
"request",
"and",
"uses",
"it",
"for",
"creating",
"a",
"new",
"instance",
"of",
"AlexaSpeechlet"
] | train | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/util/factory/AlexaSpeechletFactory.java#L37-L54 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.readFile | public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat,
String filePath) {
"""
Reads the contents of the user-specified {@code filePath} based on the given {@link FileInputFormat}.
<p>Since all data streams need specific information about their types, this method needs to deter... | java | public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat,
String filePath) {
return readFile(inputFormat, filePath, FileProcessingMode.PROCESS_ONCE, -1);
} | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"readFile",
"(",
"FileInputFormat",
"<",
"OUT",
">",
"inputFormat",
",",
"String",
"filePath",
")",
"{",
"return",
"readFile",
"(",
"inputFormat",
",",
"filePath",
",",
"FileProcessingMode",
".",
... | Reads the contents of the user-specified {@code filePath} based on the given {@link FileInputFormat}.
<p>Since all data streams need specific information about their types, this method needs to determine the
type of the data produced by the input format. It will attempt to determine the data type by reflection,
unless... | [
"Reads",
"the",
"contents",
"of",
"the",
"user",
"-",
"specified",
"{",
"@code",
"filePath",
"}",
"based",
"on",
"the",
"given",
"{",
"@link",
"FileInputFormat",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L994-L997 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.initializeOrgUnit | public void initializeOrgUnit(CmsRequestContext context, CmsOrganizationalUnit ou) {
"""
Initializes the default groups for an organizational unit.<p>
@param context the request context
@param ou the organizational unit
"""
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
m_dri... | java | public void initializeOrgUnit(CmsRequestContext context, CmsOrganizationalUnit ou) {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
m_driverManager.initOrgUnit(dbc, ou);
} | [
"public",
"void",
"initializeOrgUnit",
"(",
"CmsRequestContext",
"context",
",",
"CmsOrganizationalUnit",
"ou",
")",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"m_driverManager",
".",
"initOrgUnit",
"(",
"db... | Initializes the default groups for an organizational unit.<p>
@param context the request context
@param ou the organizational unit | [
"Initializes",
"the",
"default",
"groups",
"for",
"an",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3477-L3482 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/ReturnValueIgnored.java | ReturnValueIgnored.functionalMethod | private static boolean functionalMethod(ExpressionTree tree, VisitorState state) {
"""
Methods in {@link java.util.function} are pure, and their returnvalues should not be discarded.
"""
Symbol symbol = ASTHelpers.getSymbol(tree);
return symbol instanceof MethodSymbol
&& ((MethodSymbol) symbol)... | java | private static boolean functionalMethod(ExpressionTree tree, VisitorState state) {
Symbol symbol = ASTHelpers.getSymbol(tree);
return symbol instanceof MethodSymbol
&& ((MethodSymbol) symbol)
.owner
.packge()
.getQualifiedName()
.contentEquals("java.util.f... | [
"private",
"static",
"boolean",
"functionalMethod",
"(",
"ExpressionTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"Symbol",
"symbol",
"=",
"ASTHelpers",
".",
"getSymbol",
"(",
"tree",
")",
";",
"return",
"symbol",
"instanceof",
"MethodSymbol",
"&&",
"("... | Methods in {@link java.util.function} are pure, and their returnvalues should not be discarded. | [
"Methods",
"in",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ReturnValueIgnored.java#L126-L134 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.zipDir | private static void zipDir(final File srcDir, final FileFilter filter, final String destPath, final ZipOutputStream out)
throws IOException {
"""
Add a directory to a ZIP output stream.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param filter
Filt... | java | private static void zipDir(final File srcDir, final FileFilter filter, final String destPath, final ZipOutputStream out)
throws IOException {
final File[] files = listFiles(srcDir, filter);
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
... | [
"private",
"static",
"void",
"zipDir",
"(",
"final",
"File",
"srcDir",
",",
"final",
"FileFilter",
"filter",
",",
"final",
"String",
"destPath",
",",
"final",
"ZipOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"final",
"File",
"[",
"]",
"files",
"=... | Add a directory to a ZIP output stream.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param filter
Filter or <code>null</code> for all files.
@param destPath
Path to use for the ZIP archive - May be <code>null</code> or an empyt string.
@param out
Destination stream - Can... | [
"Add",
"a",
"directory",
"to",
"a",
"ZIP",
"output",
"stream",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1349-L1361 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_migrationToken_POST | public OvhIpMigrationToken ip_migrationToken_POST(String ip, String customerId) throws IOException {
"""
Generate a migration token
REST: POST /ip/{ip}/migrationToken
@param customerId [required] destination customer ID
@param ip [required]
"""
String qPath = "/ip/{ip}/migrationToken";
StringBuilder s... | java | public OvhIpMigrationToken ip_migrationToken_POST(String ip, String customerId) throws IOException {
String qPath = "/ip/{ip}/migrationToken";
StringBuilder sb = path(qPath, ip);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "customerId", customerId);
String resp = exec(qPath, "POST", s... | [
"public",
"OvhIpMigrationToken",
"ip_migrationToken_POST",
"(",
"String",
"ip",
",",
"String",
"customerId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/migrationToken\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
... | Generate a migration token
REST: POST /ip/{ip}/migrationToken
@param customerId [required] destination customer ID
@param ip [required] | [
"Generate",
"a",
"migration",
"token"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L312-L319 |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java | SmilesParser.parseMolCXSMILES | private void parseMolCXSMILES(String title, IAtomContainer mol) {
"""
Parses CXSMILES layer and set attributes for atoms and bonds on the provided molecule.
@param title SMILES title field
@param mol molecule
"""
CxSmilesState cxstate;
int pos;
if (title != null && title.startsWit... | java | private void parseMolCXSMILES(String title, IAtomContainer mol) {
CxSmilesState cxstate;
int pos;
if (title != null && title.startsWith("|")) {
if ((pos = CxSmilesParser.processCx(title, cxstate = new CxSmilesState())) >= 0) {
// set the correct title
... | [
"private",
"void",
"parseMolCXSMILES",
"(",
"String",
"title",
",",
"IAtomContainer",
"mol",
")",
"{",
"CxSmilesState",
"cxstate",
";",
"int",
"pos",
";",
"if",
"(",
"title",
"!=",
"null",
"&&",
"title",
".",
"startsWith",
"(",
"\"|\"",
")",
")",
"{",
"i... | Parses CXSMILES layer and set attributes for atoms and bonds on the provided molecule.
@param title SMILES title field
@param mol molecule | [
"Parses",
"CXSMILES",
"layer",
"and",
"set",
"attributes",
"for",
"atoms",
"and",
"bonds",
"on",
"the",
"provided",
"molecule",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java#L310-L330 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.addPageInput | public static void addPageInput( String name, Object value, ServletRequest request ) {
"""
Set a named action output, which corresponds to an input declared by the <code>pageInput</code> JSP tag.
The actual value can be read from within a JSP using the <code>"pageInput"</code> databinding context.
@deprecated ... | java | public static void addPageInput( String name, Object value, ServletRequest request )
{
addActionOutput( name, value, request );
} | [
"public",
"static",
"void",
"addPageInput",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"ServletRequest",
"request",
")",
"{",
"addActionOutput",
"(",
"name",
",",
"value",
",",
"request",
")",
";",
"}"
] | Set a named action output, which corresponds to an input declared by the <code>pageInput</code> JSP tag.
The actual value can be read from within a JSP using the <code>"pageInput"</code> databinding context.
@deprecated Use {@link #addActionOutput} instead.
@param name the name of the action output.
@param value the v... | [
"Set",
"a",
"named",
"action",
"output",
"which",
"corresponds",
"to",
"an",
"input",
"declared",
"by",
"the",
"<code",
">",
"pageInput<",
"/",
"code",
">",
"JSP",
"tag",
".",
"The",
"actual",
"value",
"can",
"be",
"read",
"from",
"within",
"a",
"JSP",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L921-L924 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.mgetDocuments | public <T> List<T> mgetDocuments(String index, Class<T> type, Object... ids) throws ElasticSearchException {
"""
For Elasticsearch 7 and 7+
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html
@param index _mget
test/_mget
test/type/_mget
test/type/_mget?stored_fields=field1,fi... | java | public <T> List<T> mgetDocuments(String index, Class<T> type, Object... ids) throws ElasticSearchException{
return mgetDocuments( index, _doc,type, ids);
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"mgetDocuments",
"(",
"String",
"index",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Object",
"...",
"ids",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"mgetDocuments",
"(",
"index",
",",
"_doc",... | For Elasticsearch 7 and 7+
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html
@param index _mget
test/_mget
test/type/_mget
test/type/_mget?stored_fields=field1,field2
_mget?routing=key1
@param type
@param ids
@param <T>
@return
@throws ElasticSearchException | [
"For",
"Elasticsearch",
"7",
"and",
"7",
"+",
"https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"docs",
"-",
"multi",
"-",
"get",
".",
"html"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L5085-L5087 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Table.java | Table.addCell | public Table addCell(Object o, String attributes) {
"""
/* Add a new Cell in the current row.
Adds to the table after this call and before next call to newRow,
newCell or newHeader are added to the cell.
@return This table for call chaining
"""
addCell(o);
cell.attribute(attributes);
... | java | public Table addCell(Object o, String attributes)
{
addCell(o);
cell.attribute(attributes);
return this;
} | [
"public",
"Table",
"addCell",
"(",
"Object",
"o",
",",
"String",
"attributes",
")",
"{",
"addCell",
"(",
"o",
")",
";",
"cell",
".",
"attribute",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | /* Add a new Cell in the current row.
Adds to the table after this call and before next call to newRow,
newCell or newHeader are added to the cell.
@return This table for call chaining | [
"/",
"*",
"Add",
"a",
"new",
"Cell",
"in",
"the",
"current",
"row",
".",
"Adds",
"to",
"the",
"table",
"after",
"this",
"call",
"and",
"before",
"next",
"call",
"to",
"newRow",
"newCell",
"or",
"newHeader",
"are",
"added",
"to",
"the",
"cell",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Table.java#L171-L176 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java | ObjFileImporter.addVertex | private void addVertex(String data) {
"""
Creates a new {@link Vertex} from data and adds it to {@link #vertexes}.
@param data the data
"""
String coords[] = data.split("\\s+");
float x = 0;
float y = 0;
float z = 0;
if (coords.length != 3)
{
MalisisCore.log.error("[ObjFileImporter] Wrong coo... | java | private void addVertex(String data)
{
String coords[] = data.split("\\s+");
float x = 0;
float y = 0;
float z = 0;
if (coords.length != 3)
{
MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, lineNumber, currentLine);
}
else
{
x = Float.parseFl... | [
"private",
"void",
"addVertex",
"(",
"String",
"data",
")",
"{",
"String",
"coords",
"[",
"]",
"=",
"data",
".",
"split",
"(",
"\"\\\\s+\"",
")",
";",
"float",
"x",
"=",
"0",
";",
"float",
"y",
"=",
"0",
";",
"float",
"z",
"=",
"0",
";",
"if",
... | Creates a new {@link Vertex} from data and adds it to {@link #vertexes}.
@param data the data | [
"Creates",
"a",
"new",
"{",
"@link",
"Vertex",
"}",
"from",
"data",
"and",
"adds",
"it",
"to",
"{",
"@link",
"#vertexes",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java#L206-L224 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.createOrUpdate | public SyncMemberInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) {
"""
Creates or updates a sync member.
@param resourceGroupName The name of the resource group that contains the resource. You can obt... | java | public SyncMemberInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters)... | [
"public",
"SyncMemberInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
",",
"SyncMemberInner",
"parameters",
")",
"{",
"return",
"c... | Creates or updates a sync member.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
@p... | [
"Creates",
"or",
"updates",
"a",
"sync",
"member",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L241-L243 |
skjolber/3d-bin-container-packing | src/main/java/com/github/skjolberg/packing/LargestAreaFitFirstPackager.java | LargestAreaFitFirstPackager.isBetter3D | protected int isBetter3D(Box a, Box b, Space space) {
"""
Is box b strictly better than a?
@param a box
@param b box
@param space free space
@return -1 if b is better, 0 if equal, 1 if b is better
"""
int compare = Long.compare(a.getVolume(), b.getVolume());
if(compare != 0) {
return compare;
}
... | java | protected int isBetter3D(Box a, Box b, Space space) {
int compare = Long.compare(a.getVolume(), b.getVolume());
if(compare != 0) {
return compare;
}
// determine lowest fit
a.fitRotate3DSmallestFootprint(space);
b.fitRotate3DSmallestFootprint(space);
return Long.compare(b.getFootprint(), a.getFootprin... | [
"protected",
"int",
"isBetter3D",
"(",
"Box",
"a",
",",
"Box",
"b",
",",
"Space",
"space",
")",
"{",
"int",
"compare",
"=",
"Long",
".",
"compare",
"(",
"a",
".",
"getVolume",
"(",
")",
",",
"b",
".",
"getVolume",
"(",
")",
")",
";",
"if",
"(",
... | Is box b strictly better than a?
@param a box
@param b box
@param space free space
@return -1 if b is better, 0 if equal, 1 if b is better | [
"Is",
"box",
"b",
"strictly",
"better",
"than",
"a?"
] | train | https://github.com/skjolber/3d-bin-container-packing/blob/9609bc7515322b2de2cad0dfb3d2f72607e71aae/src/main/java/com/github/skjolberg/packing/LargestAreaFitFirstPackager.java#L450-L460 |
Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/connection/ThrowingIllegalOperationHandler.java | ThrowingIllegalOperationHandler.handleMismatchData | @Override
public BleIllegalOperationException handleMismatchData(BluetoothGattCharacteristic characteristic, int neededProperties) {
"""
This method logs an error and returns a {@link BleIllegalOperationException}.
@param characteristic the characteristic upon which the operation was requested
@param neededP... | java | @Override
public BleIllegalOperationException handleMismatchData(BluetoothGattCharacteristic characteristic, int neededProperties) {
String message = messageCreator.createMismatchMessage(characteristic, neededProperties);
return new BleIllegalOperationException(message,
characteristi... | [
"@",
"Override",
"public",
"BleIllegalOperationException",
"handleMismatchData",
"(",
"BluetoothGattCharacteristic",
"characteristic",
",",
"int",
"neededProperties",
")",
"{",
"String",
"message",
"=",
"messageCreator",
".",
"createMismatchMessage",
"(",
"characteristic",
... | This method logs an error and returns a {@link BleIllegalOperationException}.
@param characteristic the characteristic upon which the operation was requested
@param neededProperties bitmask of properties needed by the operation | [
"This",
"method",
"logs",
"an",
"error",
"and",
"returns",
"a",
"{"
] | train | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/connection/ThrowingIllegalOperationHandler.java#L25-L32 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.writeProject | public void writeProject(CmsDbContext dbc, CmsProject project) throws CmsException {
"""
Writes an already existing project.<p>
The project id has to be a valid OpenCms project id.<br>
The project with the given id will be completely overridden
by the given data.<p>
@param dbc the current database contex... | java | public void writeProject(CmsDbContext dbc, CmsProject project) throws CmsException {
m_monitor.uncacheProject(project);
getProjectDriver(dbc).writeProject(dbc, project);
m_monitor.cacheProject(project);
} | [
"public",
"void",
"writeProject",
"(",
"CmsDbContext",
"dbc",
",",
"CmsProject",
"project",
")",
"throws",
"CmsException",
"{",
"m_monitor",
".",
"uncacheProject",
"(",
"project",
")",
";",
"getProjectDriver",
"(",
"dbc",
")",
".",
"writeProject",
"(",
"dbc",
... | Writes an already existing project.<p>
The project id has to be a valid OpenCms project id.<br>
The project with the given id will be completely overridden
by the given data.<p>
@param dbc the current database context
@param project the project that should be written
@throws CmsException if operation was not succes... | [
"Writes",
"an",
"already",
"existing",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9945-L9950 |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/BackendUser.java | BackendUser.signIn | public static SignInResponse signIn(String email, String password) {
"""
Perform syncronously login attempt.
@param email user email address
@param password user password
@return login results.
"""
return signIn(new LoginCredentials(email,password));
} | java | public static SignInResponse signIn(String email, String password){
return signIn(new LoginCredentials(email,password));
} | [
"public",
"static",
"SignInResponse",
"signIn",
"(",
"String",
"email",
",",
"String",
"password",
")",
"{",
"return",
"signIn",
"(",
"new",
"LoginCredentials",
"(",
"email",
",",
"password",
")",
")",
";",
"}"
] | Perform syncronously login attempt.
@param email user email address
@param password user password
@return login results. | [
"Perform",
"syncronously",
"login",
"attempt",
"."
] | train | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/BackendUser.java#L152-L154 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java | MSPDIReader.readAssignmentExtendedAttributes | private void readAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx) {
"""
This method processes any extended attributes associated with a
resource assignment.
@param xml MSPDI resource assignment instance
@param mpx MPX task instance
"""
for (Project.Assignments... | java | private void readAssignmentExtendedAttributes(Project.Assignments.Assignment xml, ResourceAssignment mpx)
{
for (Project.Assignments.Assignment.ExtendedAttribute attrib : xml.getExtendedAttribute())
{
int xmlFieldID = Integer.parseInt(attrib.getFieldID()) & 0x0000FFFF;
AssignmentField m... | [
"private",
"void",
"readAssignmentExtendedAttributes",
"(",
"Project",
".",
"Assignments",
".",
"Assignment",
"xml",
",",
"ResourceAssignment",
"mpx",
")",
"{",
"for",
"(",
"Project",
".",
"Assignments",
".",
"Assignment",
".",
"ExtendedAttribute",
"attrib",
":",
... | This method processes any extended attributes associated with a
resource assignment.
@param xml MSPDI resource assignment instance
@param mpx MPX task instance | [
"This",
"method",
"processes",
"any",
"extended",
"attributes",
"associated",
"with",
"a",
"resource",
"assignment",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L1721-L1730 |
brianwhu/xillium | base/src/main/java/org/xillium/base/Singleton.java | Singleton.get | public T get(Factory<T> factory, Object... args) throws Exception {
"""
Retrieves the singleton object, creating it by calling a provider if it is not created yet. This method uses
double-checked locking to ensure that only one instance will ever be created, while keeping retrieval cost at
minimum.
@see <a hr... | java | public T get(Factory<T> factory, Object... args) throws Exception {
T result = _value;
if (isMissing(result)) synchronized(this) {
result = _value;
if (isMissing(result)) {
_value = result = factory.make(args);
}
}
return result... | [
"public",
"T",
"get",
"(",
"Factory",
"<",
"T",
">",
"factory",
",",
"Object",
"...",
"args",
")",
"throws",
"Exception",
"{",
"T",
"result",
"=",
"_value",
";",
"if",
"(",
"isMissing",
"(",
"result",
")",
")",
"synchronized",
"(",
"this",
")",
"{",
... | Retrieves the singleton object, creating it by calling a provider if it is not created yet. This method uses
double-checked locking to ensure that only one instance will ever be created, while keeping retrieval cost at
minimum.
@see <a href="http://en.wikipedia.org/wiki/Double-checked_locking">Double-checked locking</... | [
"Retrieves",
"the",
"singleton",
"object",
"creating",
"it",
"by",
"calling",
"a",
"provider",
"if",
"it",
"is",
"not",
"created",
"yet",
".",
"This",
"method",
"uses",
"double",
"-",
"checked",
"locking",
"to",
"ensure",
"that",
"only",
"one",
"instance",
... | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/Singleton.java#L82-L91 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.globPathsLevel | private Path[] globPathsLevel(Path[] parents, String[] filePattern,
int level, boolean[] hasGlob) throws IOException {
"""
/*
For a path of N components, return a list of paths that match the
components [<code>level</code>, <code>N-1</code>].
"""
if (level == filePattern.length - 1)
return pa... | java | private Path[] globPathsLevel(Path[] parents, String[] filePattern,
int level, boolean[] hasGlob) throws IOException {
if (level == filePattern.length - 1)
return parents;
if (parents == null || parents.length == 0) {
return null;
}
GlobFilter fp = new GlobFilter(filePattern[level]);
... | [
"private",
"Path",
"[",
"]",
"globPathsLevel",
"(",
"Path",
"[",
"]",
"parents",
",",
"String",
"[",
"]",
"filePattern",
",",
"int",
"level",
",",
"boolean",
"[",
"]",
"hasGlob",
")",
"throws",
"IOException",
"{",
"if",
"(",
"level",
"==",
"filePattern",... | /*
For a path of N components, return a list of paths that match the
components [<code>level</code>, <code>N-1</code>]. | [
"/",
"*",
"For",
"a",
"path",
"of",
"N",
"components",
"return",
"a",
"list",
"of",
"paths",
"that",
"match",
"the",
"components",
"[",
"<code",
">",
"level<",
"/",
"code",
">",
"<code",
">",
"N",
"-",
"1<",
"/",
"code",
">",
"]",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1422-L1439 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparityScoreRowFormat.java | DisparityScoreRowFormat.process | public void process( Input left , Input right , Disparity disparity ) {
"""
Computes disparity between two stereo images
@param left Left rectified stereo image. Input
@param right Right rectified stereo image. Input
@param disparity Disparity between the two images. Output
"""
// initialize data struct... | java | public void process( Input left , Input right , Disparity disparity ) {
// initialize data structures
InputSanityCheck.checkSameShape(left, right, disparity);
if( maxDisparity > left.width-2*radiusX )
throw new RuntimeException(
"The maximum disparity is too large for this image size: max size "+(left.w... | [
"public",
"void",
"process",
"(",
"Input",
"left",
",",
"Input",
"right",
",",
"Disparity",
"disparity",
")",
"{",
"// initialize data structures",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"left",
",",
"right",
",",
"disparity",
")",
";",
"if",
"(",
"ma... | Computes disparity between two stereo images
@param left Left rectified stereo image. Input
@param right Right rectified stereo image. Input
@param disparity Disparity between the two images. Output | [
"Computes",
"disparity",
"between",
"two",
"stereo",
"images"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/DisparityScoreRowFormat.java#L92-L103 |
itfsw/QueryBuilder | src/main/java/com/itfsw/query/builder/support/utils/spring/Assert.java | Assert.notEmpty | public static void notEmpty(Map<?, ?> map, String message) {
"""
Assert that a Map contains entries; that is, it must not be {@code null}
and must contain at least one entry.
<pre class="code">Assert.notEmpty(map, "Map must contain entries");</pre>
@param map the map to check
@param message the exception messa... | java | public static void notEmpty(Map<?, ?> map, String message) {
if (CollectionUtils.isEmpty(map)) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"String",
"message",
")",
"{",
"if",
"(",
"CollectionUtils",
".",
"isEmpty",
"(",
"map",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
... | Assert that a Map contains entries; that is, it must not be {@code null}
and must contain at least one entry.
<pre class="code">Assert.notEmpty(map, "Map must contain entries");</pre>
@param map the map to check
@param message the exception message to use if the assertion fails
@throws IllegalArgumentException if the m... | [
"Assert",
"that",
"a",
"Map",
"contains",
"entries",
";",
"that",
"is",
"it",
"must",
"not",
"be",
"{"
] | train | https://github.com/itfsw/QueryBuilder/blob/231dc9a334d54cf98755cfcb236202201ddee162/src/main/java/com/itfsw/query/builder/support/utils/spring/Assert.java#L298-L302 |
iipc/webarchive-commons | src/main/java/org/archive/util/Recorder.java | Recorder.wrapInputStreamWithHttpRecord | public static Recorder wrapInputStreamWithHttpRecord(File dir,
String basename, InputStream in, String encoding)
throws IOException {
"""
Record the input stream for later playback by an extractor, etc.
This is convenience method used to setup an artificial HttpRecorder
scenario used in unit tests, e... | java | public static Recorder wrapInputStreamWithHttpRecord(File dir,
String basename, InputStream in, String encoding)
throws IOException {
Recorder rec = new Recorder(dir, basename);
if (encoding != null && encoding.length() > 0) {
rec.setCharset(Charset.forName(encoding));
}
... | [
"public",
"static",
"Recorder",
"wrapInputStreamWithHttpRecord",
"(",
"File",
"dir",
",",
"String",
"basename",
",",
"InputStream",
"in",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"Recorder",
"rec",
"=",
"new",
"Recorder",
"(",
"dir",
",",
... | Record the input stream for later playback by an extractor, etc.
This is convenience method used to setup an artificial HttpRecorder
scenario used in unit tests, etc.
@param dir Directory to write backing file to.
@param basename of what we're recording.
@param in Stream to read.
@param encoding Stream encoding.
@throw... | [
"Record",
"the",
"input",
"stream",
"for",
"later",
"playback",
"by",
"an",
"extractor",
"etc",
".",
"This",
"is",
"convenience",
"method",
"used",
"to",
"setup",
"an",
"artificial",
"HttpRecorder",
"scenario",
"used",
"in",
"unit",
"tests",
"etc",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/Recorder.java#L554-L575 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java | ScriptRequestState.mapLegacyTagId | public String mapLegacyTagId(IScriptReporter scriptReporter, String tagId, String value) {
"""
This method will add a tagId and value to the ScriptRepoter TagId map.
The a ScriptContainer tag will create a JavaScript table that allows
the container, such as a portal, to rewrite the id so it's unique.
The real n... | java | public String mapLegacyTagId(IScriptReporter scriptReporter, String tagId, String value)
{
if (scriptReporter != null) {
scriptReporter.addLegacyTagIdMappings(tagId, value);
return null;
}
// without a scripRepoter we need to create the actual JavaScript that will be... | [
"public",
"String",
"mapLegacyTagId",
"(",
"IScriptReporter",
"scriptReporter",
",",
"String",
"tagId",
",",
"String",
"value",
")",
"{",
"if",
"(",
"scriptReporter",
"!=",
"null",
")",
"{",
"scriptReporter",
".",
"addLegacyTagIdMappings",
"(",
"tagId",
",",
"va... | This method will add a tagId and value to the ScriptRepoter TagId map.
The a ScriptContainer tag will create a JavaScript table that allows
the container, such as a portal, to rewrite the id so it's unique.
The real name may be looked up based upon the tagId.
If the no ScriptReporter is found, a script string will be... | [
"This",
"method",
"will",
"add",
"a",
"tagId",
"and",
"value",
"to",
"the",
"ScriptRepoter",
"TagId",
"map",
".",
"The",
"a",
"ScriptContainer",
"tag",
"will",
"create",
"a",
"JavaScript",
"table",
"that",
"allows",
"the",
"container",
"such",
"as",
"a",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptRequestState.java#L192-L204 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/HerokuAPI.java | HerokuAPI.getLogs | public LogStreamResponse getLogs(String appName, Boolean tail) {
"""
Get logs for an app.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@return log stream response
"""
return connection.execute(new Log(appName, tail), apiKey);
} | java | public LogStreamResponse getLogs(String appName, Boolean tail) {
return connection.execute(new Log(appName, tail), apiKey);
} | [
"public",
"LogStreamResponse",
"getLogs",
"(",
"String",
"appName",
",",
"Boolean",
"tail",
")",
"{",
"return",
"connection",
".",
"execute",
"(",
"new",
"Log",
"(",
"appName",
",",
"tail",
")",
",",
"apiKey",
")",
";",
"}"
] | Get logs for an app.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@return log stream response | [
"Get",
"logs",
"for",
"an",
"app",
"."
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L365-L367 |
playn/playn | core/src/playn/core/json/JsonParser.java | JsonParser.createParseException | private JsonParserException createParseException(Exception e, String message, boolean tokenPos) {
"""
Creates a {@link JsonParserException} and fills it from the current line and char position.
"""
if (tokenPos)
return new JsonParserException(e, message + " on line " + tokenLinePos + ", char " + toke... | java | private JsonParserException createParseException(Exception e, String message, boolean tokenPos) {
if (tokenPos)
return new JsonParserException(e, message + " on line " + tokenLinePos + ", char " + tokenCharPos,
tokenLinePos, tokenCharPos, tokenCharOffset);
else {
int charPos = Math.max(1, ... | [
"private",
"JsonParserException",
"createParseException",
"(",
"Exception",
"e",
",",
"String",
"message",
",",
"boolean",
"tokenPos",
")",
"{",
"if",
"(",
"tokenPos",
")",
"return",
"new",
"JsonParserException",
"(",
"e",
",",
"message",
"+",
"\" on line \"",
"... | Creates a {@link JsonParserException} and fills it from the current line and char position. | [
"Creates",
"a",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonParser.java#L462-L471 |
xwiki/xwiki-rendering | xwiki-rendering-macros/xwiki-rendering-macro-ctsreport/src/main/java/org/xwiki/rendering/internal/macro/ctsreport/ResultExtractor.java | ResultExtractor.normalize | public void normalize(Set<String> testNames, Map<String, Pair<Set<Test>, Set<Test>>> tests) {
"""
Add not applicable tests for all syntaxes.
@param testNames the test names (eg "simple/bold/bold1")
@param tests the tests by syntaxes
"""
for (Pair<Set<Test>, Set<Test>> inOutTests : tests.values()) {... | java | public void normalize(Set<String> testNames, Map<String, Pair<Set<Test>, Set<Test>>> tests)
{
for (Pair<Set<Test>, Set<Test>> inOutTests : tests.values()) {
addNotApplicableTests(testNames, inOutTests.getLeft());
addNotApplicableTests(testNames, inOutTests.getRight());
}
... | [
"public",
"void",
"normalize",
"(",
"Set",
"<",
"String",
">",
"testNames",
",",
"Map",
"<",
"String",
",",
"Pair",
"<",
"Set",
"<",
"Test",
">",
",",
"Set",
"<",
"Test",
">",
">",
">",
"tests",
")",
"{",
"for",
"(",
"Pair",
"<",
"Set",
"<",
"T... | Add not applicable tests for all syntaxes.
@param testNames the test names (eg "simple/bold/bold1")
@param tests the tests by syntaxes | [
"Add",
"not",
"applicable",
"tests",
"for",
"all",
"syntaxes",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-macros/xwiki-rendering-macro-ctsreport/src/main/java/org/xwiki/rendering/internal/macro/ctsreport/ResultExtractor.java#L95-L101 |
lotaris/rox-client-java | rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterUtils.java | FilterUtils.isRunnable | private static boolean isRunnable(FilterTargetData targetData, String[] filters) {
"""
Define if a test is runnable based on the object that represents the test
meta data
@param targetData The meta data
@param filters The filters
@return True if the test can be run
"""
if (filters == null || filters.le... | java | private static boolean isRunnable(FilterTargetData targetData, String[] filters) {
if (filters == null || filters.length == 0) {
return true;
}
for (String filter : filters) {
String[] filterSplitted = filter.split(":");
// We must evaluate all the filters and return only when there is a valid match
... | [
"private",
"static",
"boolean",
"isRunnable",
"(",
"FilterTargetData",
"targetData",
",",
"String",
"[",
"]",
"filters",
")",
"{",
"if",
"(",
"filters",
"==",
"null",
"||",
"filters",
".",
"length",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"for",... | Define if a test is runnable based on the object that represents the test
meta data
@param targetData The meta data
@param filters The filters
@return True if the test can be run | [
"Define",
"if",
"a",
"test",
"is",
"runnable",
"based",
"on",
"the",
"object",
"that",
"represents",
"the",
"test",
"meta",
"data"
] | train | https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterUtils.java#L76-L97 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RelativeDateTimeFormatter.java | RelativeDateTimeFormatter.getAbsoluteUnitString | private String getAbsoluteUnitString(Style style, AbsoluteUnit unit, Direction direction) {
"""
Gets the string value from qualitativeUnitMap with fallback based on style.
"""
EnumMap<AbsoluteUnit, EnumMap<Direction, String>> unitMap;
EnumMap<Direction, String> dirMap;
do {
... | java | private String getAbsoluteUnitString(Style style, AbsoluteUnit unit, Direction direction) {
EnumMap<AbsoluteUnit, EnumMap<Direction, String>> unitMap;
EnumMap<Direction, String> dirMap;
do {
unitMap = qualitativeUnitMap.get(style);
if (unitMap != null) {
... | [
"private",
"String",
"getAbsoluteUnitString",
"(",
"Style",
"style",
",",
"AbsoluteUnit",
"unit",
",",
"Direction",
"direction",
")",
"{",
"EnumMap",
"<",
"AbsoluteUnit",
",",
"EnumMap",
"<",
"Direction",
",",
"String",
">",
">",
"unitMap",
";",
"EnumMap",
"<"... | Gets the string value from qualitativeUnitMap with fallback based on style. | [
"Gets",
"the",
"string",
"value",
"from",
"qualitativeUnitMap",
"with",
"fallback",
"based",
"on",
"style",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RelativeDateTimeFormatter.java#L636-L657 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/configuration/ConfigurationMetadataBuilder.java | ConfigurationMetadataBuilder.writeAttribute | static void writeAttribute(Writer out, String name, String value) throws IOException {
"""
Write a quoted attribute with a value to a writer.
@param out The out writer
@param name The name of the attribute
@param value The value
@throws IOException If an error occurred writing output
"""
out.w... | java | static void writeAttribute(Writer out, String name, String value) throws IOException {
out.write('"');
out.write(name);
out.write("\":");
out.write(quote(value));
} | [
"static",
"void",
"writeAttribute",
"(",
"Writer",
"out",
",",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"'",
"'",
")",
";",
"out",
".",
"write",
"(",
"name",
")",
";",
"out",
".",
"write",... | Write a quoted attribute with a value to a writer.
@param out The out writer
@param name The name of the attribute
@param value The value
@throws IOException If an error occurred writing output | [
"Write",
"a",
"quoted",
"attribute",
"with",
"a",
"value",
"to",
"a",
"writer",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/configuration/ConfigurationMetadataBuilder.java#L261-L266 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java | OtpInputStream.read_atom | @SuppressWarnings("fallthrough")
public String read_atom() throws OtpErlangDecodeException {
"""
Read an Erlang atom from the stream.
@return a String containing the value of the atom.
@exception OtpErlangDecodeException
if the next term in the stream is not an atom.
"""
int tag;
int... | java | @SuppressWarnings("fallthrough")
public String read_atom() throws OtpErlangDecodeException {
int tag;
int len = -1;
byte[] strbuf;
String atom;
tag = read1skip_version();
switch (tag) {
case OtpExternal.atomTag:
len = read2BE();
strb... | [
"@",
"SuppressWarnings",
"(",
"\"fallthrough\"",
")",
"public",
"String",
"read_atom",
"(",
")",
"throws",
"OtpErlangDecodeException",
"{",
"int",
"tag",
";",
"int",
"len",
"=",
"-",
"1",
";",
"byte",
"[",
"]",
"strbuf",
";",
"String",
"atom",
";",
"tag",
... | Read an Erlang atom from the stream.
@return a String containing the value of the atom.
@exception OtpErlangDecodeException
if the next term in the stream is not an atom. | [
"Read",
"an",
"Erlang",
"atom",
"from",
"the",
"stream",
"."
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java#L350-L413 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java | StreamTask.handleAsyncException | @Override
public void handleAsyncException(String message, Throwable exception) {
"""
Handles an exception thrown by another thread (e.g. a TriggerTask),
other than the one executing the main task by failing the task entirely.
<p>In more detail, it marks task execution failed for an external reason
(a reason... | java | @Override
public void handleAsyncException(String message, Throwable exception) {
if (isRunning) {
// only fail if the task is still running
getEnvironment().failExternally(exception);
}
} | [
"@",
"Override",
"public",
"void",
"handleAsyncException",
"(",
"String",
"message",
",",
"Throwable",
"exception",
")",
"{",
"if",
"(",
"isRunning",
")",
"{",
"// only fail if the task is still running",
"getEnvironment",
"(",
")",
".",
"failExternally",
"(",
"exce... | Handles an exception thrown by another thread (e.g. a TriggerTask),
other than the one executing the main task by failing the task entirely.
<p>In more detail, it marks task execution failed for an external reason
(a reason other than the task code itself throwing an exception). If the task
is already in a terminal st... | [
"Handles",
"an",
"exception",
"thrown",
"by",
"another",
"thread",
"(",
"e",
".",
"g",
".",
"a",
"TriggerTask",
")",
"other",
"than",
"the",
"one",
"executing",
"the",
"main",
"task",
"by",
"failing",
"the",
"task",
"entirely",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java#L851-L857 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/security/CERTConverter.java | CERTConverter.buildRecord | public static CERTRecord
buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag,
int alg) {
"""
Builds a CERT record from a Certificate associated with a key also in DNS
"""
int type;
byte [] data;
try {
if (cert instanceof X509Certificate) {
type = CERTRecord.PKIX;
data = cert... | java | public static CERTRecord
buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag,
int alg)
{
int type;
byte [] data;
try {
if (cert instanceof X509Certificate) {
type = CERTRecord.PKIX;
data = cert.getEncoded();
}
else
return null;
return new CERTRecord(name, dclass, ttl, type,... | [
"public",
"static",
"CERTRecord",
"buildRecord",
"(",
"Name",
"name",
",",
"int",
"dclass",
",",
"long",
"ttl",
",",
"Certificate",
"cert",
",",
"int",
"tag",
",",
"int",
"alg",
")",
"{",
"int",
"type",
";",
"byte",
"[",
"]",
"data",
";",
"try",
"{",... | Builds a CERT record from a Certificate associated with a key also in DNS | [
"Builds",
"a",
"CERT",
"record",
"from",
"a",
"Certificate",
"associated",
"with",
"a",
"key",
"also",
"in",
"DNS"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/CERTConverter.java#L56-L78 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/boot/impl/OgmServiceRegistryInitializer.java | OgmServiceRegistryInitializer.isOgmImplicitEnabled | private boolean isOgmImplicitEnabled(Map<?, ?> settings) {
"""
Decides if we need to start OGM when {@link OgmProperties#ENABLED} is not set.
At the moment, if a dialect class is not declared, Hibernate ORM requires a datasource or a JDBC connector when a dialect is not declared.
If none of those properties are ... | java | private boolean isOgmImplicitEnabled(Map<?, ?> settings) {
String jdbcUrl = new ConfigurationPropertyReader( settings )
.property( Environment.URL, String.class )
.getValue();
String jndiDatasource = new ConfigurationPropertyReader( settings )
.property( Environment.DATASOURCE, String.class )
.getV... | [
"private",
"boolean",
"isOgmImplicitEnabled",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"settings",
")",
"{",
"String",
"jdbcUrl",
"=",
"new",
"ConfigurationPropertyReader",
"(",
"settings",
")",
".",
"property",
"(",
"Environment",
".",
"URL",
",",
"String",
"."... | Decides if we need to start OGM when {@link OgmProperties#ENABLED} is not set.
At the moment, if a dialect class is not declared, Hibernate ORM requires a datasource or a JDBC connector when a dialect is not declared.
If none of those properties are declared, we assume the user wants to start Hibernate OGM.
@param set... | [
"Decides",
"if",
"we",
"need",
"to",
"start",
"OGM",
"when",
"{",
"@link",
"OgmProperties#ENABLED",
"}",
"is",
"not",
"set",
".",
"At",
"the",
"moment",
"if",
"a",
"dialect",
"class",
"is",
"not",
"declared",
"Hibernate",
"ORM",
"requires",
"a",
"datasourc... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/boot/impl/OgmServiceRegistryInitializer.java#L108-L122 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.setQuery | public DynamicReportBuilder setQuery(String text, String language) {
"""
Adds main report query.
@param text
@param language use constants from {@link DJConstants}
@return
"""
this.report.setQuery(new DJQuery(text, language));
return this;
} | java | public DynamicReportBuilder setQuery(String text, String language) {
this.report.setQuery(new DJQuery(text, language));
return this;
} | [
"public",
"DynamicReportBuilder",
"setQuery",
"(",
"String",
"text",
",",
"String",
"language",
")",
"{",
"this",
".",
"report",
".",
"setQuery",
"(",
"new",
"DJQuery",
"(",
"text",
",",
"language",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds main report query.
@param text
@param language use constants from {@link DJConstants}
@return | [
"Adds",
"main",
"report",
"query",
"."
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L1424-L1427 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.isIdCol | private boolean isIdCol(EntityMetadata m, String colName) {
"""
Checks if is id col.
@param m
the m
@param colName
the col name
@return true, if is id col
"""
return ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName().equals(colName);
} | java | private boolean isIdCol(EntityMetadata m, String colName)
{
return ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName().equals(colName);
} | [
"private",
"boolean",
"isIdCol",
"(",
"EntityMetadata",
"m",
",",
"String",
"colName",
")",
"{",
"return",
"(",
"(",
"AbstractAttribute",
")",
"m",
".",
"getIdAttribute",
"(",
")",
")",
".",
"getJPAColumnName",
"(",
")",
".",
"equals",
"(",
"colName",
")",... | Checks if is id col.
@param m
the m
@param colName
the col name
@return true, if is id col | [
"Checks",
"if",
"is",
"id",
"col",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L898-L901 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/ListenerList.java | ListenerList.addListener | public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener) {
"""
Adds a listener to the listener list in the supplied map. If no list exists, one will be
created and mapped to the supplied key.
"""
ListenerList<L> list = map.get(key);
if (list == null) {
... | java | public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener)
{
ListenerList<L> list = map.get(key);
if (list == null) {
map.put(key, list = new ListenerList<L>());
}
list.add(listener);
} | [
"public",
"static",
"<",
"L",
",",
"K",
">",
"void",
"addListener",
"(",
"Map",
"<",
"K",
",",
"ListenerList",
"<",
"L",
">",
">",
"map",
",",
"K",
"key",
",",
"L",
"listener",
")",
"{",
"ListenerList",
"<",
"L",
">",
"list",
"=",
"map",
".",
"... | Adds a listener to the listener list in the supplied map. If no list exists, one will be
created and mapped to the supplied key. | [
"Adds",
"a",
"listener",
"to",
"the",
"listener",
"list",
"in",
"the",
"supplied",
"map",
".",
"If",
"no",
"list",
"exists",
"one",
"will",
"be",
"created",
"and",
"mapped",
"to",
"the",
"supplied",
"key",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/ListenerList.java#L56-L63 |
casmi/casmi | src/main/java/casmi/graphics/element/Bezier.java | Bezier.setNode | public void setNode(int number, Vector3D v) {
"""
Sets coordinate of nodes of this Bezier.
@param number The number of a node. The node whose number is 0 or 3 is a anchor point, and
the node whose number is 1 or 2 is a control point.
@param v The coordinates of this node.
"""
setNode(number, v.g... | java | public void setNode(int number, Vector3D v) {
setNode(number, v.getX(), v.getY(), v.getZ());
} | [
"public",
"void",
"setNode",
"(",
"int",
"number",
",",
"Vector3D",
"v",
")",
"{",
"setNode",
"(",
"number",
",",
"v",
".",
"getX",
"(",
")",
",",
"v",
".",
"getY",
"(",
")",
",",
"v",
".",
"getZ",
"(",
")",
")",
";",
"}"
] | Sets coordinate of nodes of this Bezier.
@param number The number of a node. The node whose number is 0 or 3 is a anchor point, and
the node whose number is 1 or 2 is a control point.
@param v The coordinates of this node. | [
"Sets",
"coordinate",
"of",
"nodes",
"of",
"this",
"Bezier",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Bezier.java#L179-L181 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuModuleLoadDataEx | public static int cuModuleLoadDataEx(CUmodule phMod, String string, int numOptions, int options[], Pointer optionValues) {
"""
A wrapper function for
{@link JCudaDriver#cuModuleLoadDataEx(CUmodule, Pointer, int, int[], Pointer)}
which allows passing in the image data as a string.
@param module Returned module... | java | public static int cuModuleLoadDataEx(CUmodule phMod, String string, int numOptions, int options[], Pointer optionValues)
{
byte bytes[] = string.getBytes();
byte image[] = Arrays.copyOf(bytes, bytes.length+1);
return cuModuleLoadDataEx(phMod, Pointer.to(image), numOptions, options, optio... | [
"public",
"static",
"int",
"cuModuleLoadDataEx",
"(",
"CUmodule",
"phMod",
",",
"String",
"string",
",",
"int",
"numOptions",
",",
"int",
"options",
"[",
"]",
",",
"Pointer",
"optionValues",
")",
"{",
"byte",
"bytes",
"[",
"]",
"=",
"string",
".",
"getByte... | A wrapper function for
{@link JCudaDriver#cuModuleLoadDataEx(CUmodule, Pointer, int, int[], Pointer)}
which allows passing in the image data as a string.
@param module Returned module
@param image Module data to load
@param numOptions Number of options
@param options Options for JIT
@param optionValues Option values f... | [
"A",
"wrapper",
"function",
"for",
"{",
"@link",
"JCudaDriver#cuModuleLoadDataEx",
"(",
"CUmodule",
"Pointer",
"int",
"int",
"[]",
"Pointer",
")",
"}",
"which",
"allows",
"passing",
"in",
"the",
"image",
"data",
"as",
"a",
"string",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L416-L421 |
Talend/tesb-rt-se | sam/sam-agent/src/main/java/org/talend/esb/sam/agent/flowidprocessor/FlowIdSoapCodec.java | FlowIdSoapCodec.writeFlowId | public static void writeFlowId(Message message, String flowId) {
"""
Write flow id to message.
@param message the message
@param flowId the flow id
"""
if (!(message instanceof SoapMessage)) {
return;
}
SoapMessage soapMessage = (SoapMessage)message;
Header hdFlo... | java | public static void writeFlowId(Message message, String flowId) {
if (!(message instanceof SoapMessage)) {
return;
}
SoapMessage soapMessage = (SoapMessage)message;
Header hdFlowId = soapMessage.getHeader(FLOW_ID_QNAME);
if (hdFlowId != null) {
LOG.warning(... | [
"public",
"static",
"void",
"writeFlowId",
"(",
"Message",
"message",
",",
"String",
"flowId",
")",
"{",
"if",
"(",
"!",
"(",
"message",
"instanceof",
"SoapMessage",
")",
")",
"{",
"return",
";",
"}",
"SoapMessage",
"soapMessage",
"=",
"(",
"SoapMessage",
... | Write flow id to message.
@param message the message
@param flowId the flow id | [
"Write",
"flow",
"id",
"to",
"message",
"."
] | train | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/sam/sam-agent/src/main/java/org/talend/esb/sam/agent/flowidprocessor/FlowIdSoapCodec.java#L81-L102 |
primefaces/primefaces | src/main/java/org/primefaces/util/CalendarUtils.java | CalendarUtils.encodeListValue | public static void encodeListValue(FacesContext context, UICalendar uicalendar, String optionName, List<Object> values) throws IOException {
"""
Write the value of Calendar options
@param context
@param uicalendar component
@param optionName the name of an option
@param values the List values of an option
@... | java | public static void encodeListValue(FacesContext context, UICalendar uicalendar, String optionName, List<Object> values) throws IOException {
if (values == null) {
return;
}
ResponseWriter writer = context.getResponseWriter();
writer.write("," + optionName + ":[");
f... | [
"public",
"static",
"void",
"encodeListValue",
"(",
"FacesContext",
"context",
",",
"UICalendar",
"uicalendar",
",",
"String",
"optionName",
",",
"List",
"<",
"Object",
">",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"values",
"==",
"null",
")",
... | Write the value of Calendar options
@param context
@param uicalendar component
@param optionName the name of an option
@param values the List values of an option
@throws java.io.IOException if writer is null | [
"Write",
"the",
"value",
"of",
"Calendar",
"options"
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/util/CalendarUtils.java#L221-L242 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/VariantCustom.java | VariantCustom.addParamQuery | public void addParamQuery(String name, String value) {
"""
Support method to add a new QueryString param to this custom variant
@param name the param name
@param value the value of this parameter
"""
addParam(name, value, NameValuePair.TYPE_QUERY_STRING);
} | java | public void addParamQuery(String name, String value) {
addParam(name, value, NameValuePair.TYPE_QUERY_STRING);
} | [
"public",
"void",
"addParamQuery",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"addParam",
"(",
"name",
",",
"value",
",",
"NameValuePair",
".",
"TYPE_QUERY_STRING",
")",
";",
"}"
] | Support method to add a new QueryString param to this custom variant
@param name the param name
@param value the value of this parameter | [
"Support",
"method",
"to",
"add",
"a",
"new",
"QueryString",
"param",
"to",
"this",
"custom",
"variant"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/VariantCustom.java#L152-L154 |
codelibs/jcifs | src/main/java/jcifs/smb1/Config.java | Config.getLong | public static long getLong( String key, long def ) {
"""
Retrieve a <code>long</code>. If the key does not exist or
cannot be converted to a <code>long</code>, the provided default
argument will be returned.
"""
String s = prp.getProperty( key );
if( s != null ) {
try {
... | java | public static long getLong( String key, long def ) {
String s = prp.getProperty( key );
if( s != null ) {
try {
def = Long.parseLong( s );
} catch( NumberFormatException nfe ) {
if( log.level > 0 )
nfe.printStackTrace( log );
... | [
"public",
"static",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"def",
")",
"{",
"String",
"s",
"=",
"prp",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"try",
"{",
"def",
"=",
"Long",
".",
"parseLon... | Retrieve a <code>long</code>. If the key does not exist or
cannot be converted to a <code>long</code>, the provided default
argument will be returned. | [
"Retrieve",
"a",
"<code",
">",
"long<",
"/",
"code",
">",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"or",
"cannot",
"be",
"converted",
"to",
"a",
"<code",
">",
"long<",
"/",
"code",
">",
"the",
"provided",
"default",
"argument",
"will",
"be",
... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/Config.java#L259-L270 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java | AnycastOutputHandler.writeStartedFlush | public final Item writeStartedFlush(TransactionCommon t, AOStream stream) throws Exception {
"""
Helper method used by AOStream to persistently record that flush has been started
@param t the transaction
@param stream the stream making this call
@return the Item written
@throws Exception
"""
if (TraceC... | java | public final Item writeStartedFlush(TransactionCommon t, AOStream stream) throws Exception
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "writeStartedFlush");
String key =
SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid()... | [
"public",
"final",
"Item",
"writeStartedFlush",
"(",
"TransactionCommon",
"t",
",",
"AOStream",
"stream",
")",
"throws",
"Exception",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Sib... | Helper method used by AOStream to persistently record that flush has been started
@param t the transaction
@param stream the stream making this call
@return the Item written
@throws Exception | [
"Helper",
"method",
"used",
"by",
"AOStream",
"to",
"persistently",
"record",
"that",
"flush",
"has",
"been",
"started"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java#L2740-L2782 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.buildSelect | public String buildSelect(String parameters, List<String> options, List<String> values, int selected) {
"""
Generates a html select box out of the provided values.<p>
@param parameters a string that will be inserted into the initial select tag,
if null no parameters will be inserted
@param options the options... | java | public String buildSelect(String parameters, List<String> options, List<String> values, int selected) {
return buildSelect(parameters, options, values, selected, true);
} | [
"public",
"String",
"buildSelect",
"(",
"String",
"parameters",
",",
"List",
"<",
"String",
">",
"options",
",",
"List",
"<",
"String",
">",
"values",
",",
"int",
"selected",
")",
"{",
"return",
"buildSelect",
"(",
"parameters",
",",
"options",
",",
"value... | Generates a html select box out of the provided values.<p>
@param parameters a string that will be inserted into the initial select tag,
if null no parameters will be inserted
@param options the options
@param values the option values, if null the select will have no value attributes
@param selected the index of the p... | [
"Generates",
"a",
"html",
"select",
"box",
"out",
"of",
"the",
"provided",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1109-L1112 |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/Term.java | Term.findParameters | protected void findParameters(final List<Parameter> parms, final Term trm) {
"""
Find all parameters in <tt>term</tt> in a left-to-right, depth-first
fashion. The term's function arguments are read in order and the
following rules apply:
<ul>
<li>If the function argument is a parameter:
<ul>
<li>Add it to th... | java | protected void findParameters(final List<Parameter> parms, final Term trm) {
List<BELObject> tfa = trm.getFunctionArguments();
if (hasItems(tfa)) {
for (BELObject bmo : tfa) {
if (Parameter.class.isAssignableFrom(bmo.getClass())) {
Parameter p = (Parameter... | [
"protected",
"void",
"findParameters",
"(",
"final",
"List",
"<",
"Parameter",
">",
"parms",
",",
"final",
"Term",
"trm",
")",
"{",
"List",
"<",
"BELObject",
">",
"tfa",
"=",
"trm",
".",
"getFunctionArguments",
"(",
")",
";",
"if",
"(",
"hasItems",
"(",
... | Find all parameters in <tt>term</tt> in a left-to-right, depth-first
fashion. The term's function arguments are read in order and the
following rules apply:
<ul>
<li>If the function argument is a parameter:
<ul>
<li>Add it to the parameter list (<tt>ps</tt>).</li>
</ul>
</li>
<li>If the function argument is a term:
<ul... | [
"Find",
"all",
"parameters",
"in",
"<tt",
">",
"term<",
"/",
"tt",
">",
"in",
"a",
"left",
"-",
"to",
"-",
"right",
"depth",
"-",
"first",
"fashion",
".",
"The",
"term",
"s",
"function",
"arguments",
"are",
"read",
"in",
"order",
"and",
"the",
"follo... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/model/Term.java#L534-L552 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateDocString | protected static boolean generateDocString(String comment, PyAppendable it) {
"""
Generate a Python docstring with the given comment.
@param comment the comment.
@param it the receiver of the docstring.
@return {@code true} if the docstring is added, {@code false} otherwise.
"""
final String cmt = comme... | java | protected static boolean generateDocString(String comment, PyAppendable it) {
final String cmt = comment == null ? null : comment.trim();
if (!Strings.isEmpty(cmt)) {
assert cmt != null;
it.append("\"\"\"").increaseIndentation(); //$NON-NLS-1$
for (final String line : cmt.split("[\n\r\f]+")) { //$NON-NLS-... | [
"protected",
"static",
"boolean",
"generateDocString",
"(",
"String",
"comment",
",",
"PyAppendable",
"it",
")",
"{",
"final",
"String",
"cmt",
"=",
"comment",
"==",
"null",
"?",
"null",
":",
"comment",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"String... | Generate a Python docstring with the given comment.
@param comment the comment.
@param it the receiver of the docstring.
@return {@code true} if the docstring is added, {@code false} otherwise. | [
"Generate",
"a",
"Python",
"docstring",
"with",
"the",
"given",
"comment",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L288-L301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.