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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/ui/CmsContainerPageElementPanel.java | CmsContainerPageElementPanel.isOptionbarIFrameCollision | private boolean isOptionbarIFrameCollision(int optionTop, int optionWidth) {
"""
Returns if the option bar position collides with any iframe child elements.<p>
@param optionTop the option bar absolute top
@param optionWidth the option bar width
@return <code>true</code> if there are iframe child elements lo... | java | private boolean isOptionbarIFrameCollision(int optionTop, int optionWidth) {
if (RootPanel.getBodyElement().isOrHasChild(getElement())) {
NodeList<Element> frames = getElement().getElementsByTagName(CmsDomUtil.Tag.iframe.name());
for (int i = 0; i < frames.getLength(); i++) {
... | [
"private",
"boolean",
"isOptionbarIFrameCollision",
"(",
"int",
"optionTop",
",",
"int",
"optionWidth",
")",
"{",
"if",
"(",
"RootPanel",
".",
"getBodyElement",
"(",
")",
".",
"isOrHasChild",
"(",
"getElement",
"(",
")",
")",
")",
"{",
"NodeList",
"<",
"Elem... | Returns if the option bar position collides with any iframe child elements.<p>
@param optionTop the option bar absolute top
@param optionWidth the option bar width
@return <code>true</code> if there are iframe child elements located no less than 25px below the upper edge of the element | [
"Returns",
"if",
"the",
"option",
"bar",
"position",
"collides",
"with",
"any",
"iframe",
"child",
"elements",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/CmsContainerPageElementPanel.java#L1252-L1269 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/controller/MsgSettingController.java | MsgSettingController.deleteValidationDataLists | @DeleteMapping("/setting/delete/param/from/url")
public void deleteValidationDataLists(HttpServletRequest req, @RequestBody List<ValidationData> datas) {
"""
Delete validation data lists.
@param req the req
@param datas the datas
"""
this.validationSessionComponent.sessionCheck(req);
... | java | @DeleteMapping("/setting/delete/param/from/url")
public void deleteValidationDataLists(HttpServletRequest req, @RequestBody List<ValidationData> datas) {
this.validationSessionComponent.sessionCheck(req);
this.msgSettingService.deleteValidationData(datas);
} | [
"@",
"DeleteMapping",
"(",
"\"/setting/delete/param/from/url\"",
")",
"public",
"void",
"deleteValidationDataLists",
"(",
"HttpServletRequest",
"req",
",",
"@",
"RequestBody",
"List",
"<",
"ValidationData",
">",
"datas",
")",
"{",
"this",
".",
"validationSessionComponen... | Delete validation data lists.
@param req the req
@param datas the datas | [
"Delete",
"validation",
"data",
"lists",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/controller/MsgSettingController.java#L181-L185 |
Azure/azure-sdk-for-java | devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java | ControllersInner.listConnectionDetailsAsync | public Observable<ControllerConnectionDetailsListInner> listConnectionDetailsAsync(String resourceGroupName, String name) {
"""
Lists connection details for an Azure Dev Spaces Controller.
Lists connection details for the underlying container resources of an Azure Dev Spaces Controller.
@param resourceGroupNam... | java | public Observable<ControllerConnectionDetailsListInner> listConnectionDetailsAsync(String resourceGroupName, String name) {
return listConnectionDetailsWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<ControllerConnectionDetailsListInner>, ControllerConnectionDetailsListInner>() {... | [
"public",
"Observable",
"<",
"ControllerConnectionDetailsListInner",
">",
"listConnectionDetailsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"listConnectionDetailsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
... | Lists connection details for an Azure Dev Spaces Controller.
Lists connection details for the underlying container resources of an Azure Dev Spaces Controller.
@param resourceGroupName Resource group to which the resource belongs.
@param name Name of the resource.
@throws IllegalArgumentException thrown if parameters ... | [
"Lists",
"connection",
"details",
"for",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
".",
"Lists",
"connection",
"details",
"for",
"the",
"underlying",
"container",
"resources",
"of",
"an",
"Azure",
"Dev",
"Spaces",
"Controller",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/devspaces/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/devspaces/v2018_06_01_preview/implementation/ControllersInner.java#L1003-L1010 |
alkacon/opencms-core | src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java | CmsSetupXmlHelper.setValue | public int setValue(String xmlFilename, String xPath, String value, String nodeToInsert) throws CmsXmlException {
"""
Sets the given value in all nodes identified by the given xpath of the given xml file.<p>
If value is <code>null</code>, all nodes identified by the given xpath will be deleted.<p>
If the nod... | java | public int setValue(String xmlFilename, String xPath, String value, String nodeToInsert) throws CmsXmlException {
return setValue(getDocument(xmlFilename), xPath, value, nodeToInsert);
} | [
"public",
"int",
"setValue",
"(",
"String",
"xmlFilename",
",",
"String",
"xPath",
",",
"String",
"value",
",",
"String",
"nodeToInsert",
")",
"throws",
"CmsXmlException",
"{",
"return",
"setValue",
"(",
"getDocument",
"(",
"xmlFilename",
")",
",",
"xPath",
",... | Sets the given value in all nodes identified by the given xpath of the given xml file.<p>
If value is <code>null</code>, all nodes identified by the given xpath will be deleted.<p>
If the node identified by the given xpath does not exists, the missing nodes will be created
(if <code>value</code> not <code>null</code>... | [
"Sets",
"the",
"given",
"value",
"in",
"all",
"nodes",
"identified",
"by",
"the",
"given",
"xpath",
"of",
"the",
"given",
"xml",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java#L486-L489 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.writeStringToFileNoExceptions | public static void writeStringToFileNoExceptions(String contents, String path, String encoding) {
"""
Writes a string to a file, squashing exceptions
@param contents The string to write
@param path The file path
@param encoding The encoding to encode in
"""
OutputStream writer = null;
try{
if (p... | java | public static void writeStringToFileNoExceptions(String contents, String path, String encoding) {
OutputStream writer = null;
try{
if (path.endsWith(".gz")) {
writer = new GZIPOutputStream(new FileOutputStream(path));
} else {
writer = new BufferedOutputStream(new FileOutputStream(path));
}
... | [
"public",
"static",
"void",
"writeStringToFileNoExceptions",
"(",
"String",
"contents",
",",
"String",
"path",
",",
"String",
"encoding",
")",
"{",
"OutputStream",
"writer",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"path",
".",
"endsWith",
"(",
"\".gz\"",
")... | Writes a string to a file, squashing exceptions
@param contents The string to write
@param path The file path
@param encoding The encoding to encode in | [
"Writes",
"a",
"string",
"to",
"a",
"file",
"squashing",
"exceptions"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L190-L204 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java | XPathParser.Literal | protected void Literal() throws javax.xml.transform.TransformerException {
"""
The value of the Literal is the sequence of characters inside
the " or ' characters>.
Literal ::= '"' [^"]* '"'
| "'" [^']* "'"
@throws javax.xml.transform.TransformerException
"""
int last = m_token.length() - 1;
... | java | protected void Literal() throws javax.xml.transform.TransformerException
{
int last = m_token.length() - 1;
char c0 = m_tokenChar;
char cX = m_token.charAt(last);
if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\'')))
{
// Mutate the token to remove the quotes and have the ... | [
"protected",
"void",
"Literal",
"(",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"int",
"last",
"=",
"m_token",
".",
"length",
"(",
")",
"-",
"1",
";",
"char",
"c0",
"=",
"m_tokenChar",
";",
"char",
"cX",
"="... | The value of the Literal is the sequence of characters inside
the " or ' characters>.
Literal ::= '"' [^"]* '"'
| "'" [^']* "'"
@throws javax.xml.transform.TransformerException | [
"The",
"value",
"of",
"the",
"Literal",
"is",
"the",
"sequence",
"of",
"characters",
"inside",
"the",
"or",
"characters",
">",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/XPathParser.java#L2017-L2048 |
graphhopper/map-matching | hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java | ViterbiAlgorithm.hmmBreak | private boolean hmmBreak(Map<S, Double> message) {
"""
Returns whether the specified message is either empty or only contains state candidates
with zero probability and thus causes the HMM to break.
"""
for (double logProbability : message.values()) {
if (logProbability != Double.NEGATIVE_... | java | private boolean hmmBreak(Map<S, Double> message) {
for (double logProbability : message.values()) {
if (logProbability != Double.NEGATIVE_INFINITY) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"hmmBreak",
"(",
"Map",
"<",
"S",
",",
"Double",
">",
"message",
")",
"{",
"for",
"(",
"double",
"logProbability",
":",
"message",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"logProbability",
"!=",
"Double",
".",
"NEGATIVE_INFINI... | Returns whether the specified message is either empty or only contains state candidates
with zero probability and thus causes the HMM to break. | [
"Returns",
"whether",
"the",
"specified",
"message",
"is",
"either",
"empty",
"or",
"only",
"contains",
"state",
"candidates",
"with",
"zero",
"probability",
"and",
"thus",
"causes",
"the",
"HMM",
"to",
"break",
"."
] | train | https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/hmm-lib/src/main/java/com/bmw/hmm/ViterbiAlgorithm.java#L298-L305 |
albfernandez/itext2 | src/main/java/com/lowagie/text/xml/xmp/XmpSchema.java | XmpSchema.setProperty | public Object setProperty(String key, XmpArray value) {
"""
@see java.util.Properties#setProperty(java.lang.String, java.lang.String)
@param key
@param value
@return the previous property (null if there wasn't one)
"""
return super.setProperty(key, value.toString());
} | java | public Object setProperty(String key, XmpArray value) {
return super.setProperty(key, value.toString());
} | [
"public",
"Object",
"setProperty",
"(",
"String",
"key",
",",
"XmpArray",
"value",
")",
"{",
"return",
"super",
".",
"setProperty",
"(",
"key",
",",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] | @see java.util.Properties#setProperty(java.lang.String, java.lang.String)
@param key
@param value
@return the previous property (null if there wasn't one) | [
"@see",
"java",
".",
"util",
".",
"Properties#setProperty",
"(",
"java",
".",
"lang",
".",
"String",
"java",
".",
"lang",
".",
"String",
")"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/xml/xmp/XmpSchema.java#L127-L129 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/StatementsForClassFactory.java | StatementsForClassFactory.getStatementsForClass | public StatementsForClassIF getStatementsForClass(JdbcConnectionDescriptor cds, ClassDescriptor cld) {
"""
Get an instance of {@link org.apache.ojb.broker.accesslayer.StatementsForClassIF}
@param cds our connection descriptor
@param cld the class descriptor of the persistant object
@return an instance of {@link... | java | public StatementsForClassIF getStatementsForClass(JdbcConnectionDescriptor cds, ClassDescriptor cld)
{
return (StatementsForClassIF) this.createNewInstance(new Class[]{JdbcConnectionDescriptor.class, ClassDescriptor.class},
new Object[]{cds, cld});
} | [
"public",
"StatementsForClassIF",
"getStatementsForClass",
"(",
"JdbcConnectionDescriptor",
"cds",
",",
"ClassDescriptor",
"cld",
")",
"{",
"return",
"(",
"StatementsForClassIF",
")",
"this",
".",
"createNewInstance",
"(",
"new",
"Class",
"[",
"]",
"{",
"JdbcConnectio... | Get an instance of {@link org.apache.ojb.broker.accesslayer.StatementsForClassIF}
@param cds our connection descriptor
@param cld the class descriptor of the persistant object
@return an instance of {@link org.apache.ojb.broker.accesslayer.StatementsForClassIF} | [
"Get",
"an",
"instance",
"of",
"{"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassFactory.java#L69-L73 |
cycorp/model-generator-suite | model-generator/src/main/java/com/cyc/model/objects/ClassObj.java | ClassObj.getMethodPredicates | public List<KbPredicate> getMethodPredicates() {
"""
This returns an ordered list of the Predicates which underly the class's
MethodObjs, with no duplicate elements. This is valuable because a single
predicate may be the basis for multiple MethodObjs (getters, setters, etc.)
@return
"""
Set<KbPredicat... | java | public List<KbPredicate> getMethodPredicates() {
Set<KbPredicate> set = new HashSet<KbPredicate>();
for (MethodObj method : getMethods()) {
set.add(method.getPredicate());
}
List<KbPredicate> list = new ArrayList(set);
Collections.sort(list, new Comparator<KbPredicate>() {
@Override
... | [
"public",
"List",
"<",
"KbPredicate",
">",
"getMethodPredicates",
"(",
")",
"{",
"Set",
"<",
"KbPredicate",
">",
"set",
"=",
"new",
"HashSet",
"<",
"KbPredicate",
">",
"(",
")",
";",
"for",
"(",
"MethodObj",
"method",
":",
"getMethods",
"(",
")",
")",
... | This returns an ordered list of the Predicates which underly the class's
MethodObjs, with no duplicate elements. This is valuable because a single
predicate may be the basis for multiple MethodObjs (getters, setters, etc.)
@return | [
"This",
"returns",
"an",
"ordered",
"list",
"of",
"the",
"Predicates",
"which",
"underly",
"the",
"class",
"s",
"MethodObjs",
"with",
"no",
"duplicate",
"elements",
".",
"This",
"is",
"valuable",
"because",
"a",
"single",
"predicate",
"may",
"be",
"the",
"ba... | train | https://github.com/cycorp/model-generator-suite/blob/8995984c5dcf668acad813d24e4fe9c544b7aa91/model-generator/src/main/java/com/cyc/model/objects/ClassObj.java#L283-L299 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.email_pro_email_changePassword_POST | public net.minidev.ovh.api.xdsl.email.pro.OvhTask email_pro_email_changePassword_POST(String email, String password) throws IOException {
"""
Change the email password
REST: POST /xdsl/email/pro/{email}/changePassword
@param password [required] New email password
@param email [required] The email address if t... | java | public net.minidev.ovh.api.xdsl.email.pro.OvhTask email_pro_email_changePassword_POST(String email, String password) throws IOException {
String qPath = "/xdsl/email/pro/{email}/changePassword";
StringBuilder sb = path(qPath, email);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "password... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"xdsl",
".",
"email",
".",
"pro",
".",
"OvhTask",
"email_pro_email_changePassword_POST",
"(",
"String",
"email",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=... | Change the email password
REST: POST /xdsl/email/pro/{email}/changePassword
@param password [required] New email password
@param email [required] The email address if the XDSL Email Pro | [
"Change",
"the",
"email",
"password"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1949-L1956 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertClob | public static Object convertClob(Object clob, byte[] value) throws SQLException {
"""
Transfers data from byte[] into sql.Clob
@param clob sql.Clob which would be filled
@param value array of bytes
@return sql.Clob from array of bytes
@throws SQLException
"""
ByteArrayInputStream input = new Byt... | java | public static Object convertClob(Object clob, byte[] value) throws SQLException {
ByteArrayInputStream input = new ByteArrayInputStream(value);
//OutputStream output = clob.setAsciiStream(1);
OutputStream output = null;
try {
output = (OutputStream) MappingUtils.invokeFunctio... | [
"public",
"static",
"Object",
"convertClob",
"(",
"Object",
"clob",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"SQLException",
"{",
"ByteArrayInputStream",
"input",
"=",
"new",
"ByteArrayInputStream",
"(",
"value",
")",
";",
"//OutputStream output = clob.setAsci... | Transfers data from byte[] into sql.Clob
@param clob sql.Clob which would be filled
@param value array of bytes
@return sql.Clob from array of bytes
@throws SQLException | [
"Transfers",
"data",
"from",
"byte",
"[]",
"into",
"sql",
".",
"Clob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L216-L236 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java | GenericResource.lockDiscovery | public static HierarchicalProperty lockDiscovery(String token, String lockOwner, String timeOut) {
"""
Returns the information about lock.
@param token lock token
@param lockOwner lockowner
@param timeOut lock timeout
@return lock information
"""
HierarchicalProperty lockDiscovery = new Hierarchic... | java | public static HierarchicalProperty lockDiscovery(String token, String lockOwner, String timeOut)
{
HierarchicalProperty lockDiscovery = new HierarchicalProperty(new QName("DAV:", "lockdiscovery"));
HierarchicalProperty activeLock =
lockDiscovery.addChild(new HierarchicalProperty(new QName(... | [
"public",
"static",
"HierarchicalProperty",
"lockDiscovery",
"(",
"String",
"token",
",",
"String",
"lockOwner",
",",
"String",
"timeOut",
")",
"{",
"HierarchicalProperty",
"lockDiscovery",
"=",
"new",
"HierarchicalProperty",
"(",
"new",
"QName",
"(",
"\"DAV:\"",
",... | Returns the information about lock.
@param token lock token
@param lockOwner lockowner
@param timeOut lock timeout
@return lock information | [
"Returns",
"the",
"information",
"about",
"lock",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java#L146-L179 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/Identity.java | Identity.checkForPrimaryKeys | protected void checkForPrimaryKeys(final Object realObject) throws ClassNotPersistenceCapableException {
"""
OJB can handle only classes that declare at least one primary key attribute,
this method checks this condition.
@param realObject The real object to check
@throws ClassNotPersistenceCapableException th... | java | protected void checkForPrimaryKeys(final Object realObject) throws ClassNotPersistenceCapableException
{
// if no PKs are specified OJB can't handle this class !
if (m_pkValues == null || m_pkValues.length == 0)
{
throw createException("OJB needs at least one primary key att... | [
"protected",
"void",
"checkForPrimaryKeys",
"(",
"final",
"Object",
"realObject",
")",
"throws",
"ClassNotPersistenceCapableException",
"{",
"// if no PKs are specified OJB can't handle this class !\r",
"if",
"(",
"m_pkValues",
"==",
"null",
"||",
"m_pkValues",
".",
"length",... | OJB can handle only classes that declare at least one primary key attribute,
this method checks this condition.
@param realObject The real object to check
@throws ClassNotPersistenceCapableException thrown if no primary key is specified for the objects class | [
"OJB",
"can",
"handle",
"only",
"classes",
"that",
"declare",
"at",
"least",
"one",
"primary",
"key",
"attribute",
"this",
"method",
"checks",
"this",
"condition",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/Identity.java#L369-L379 |
Wikidata/Wikidata-Toolkit | wdtk-examples/src/main/java/org/wikidata/wdtk/examples/ClassPropertyUsageAnalyzer.java | ClassPropertyUsageAnalyzer.getPropertyLabel | private String getPropertyLabel(PropertyIdValue propertyIdValue) {
"""
Returns a string that should be used as a label for the given property.
@param propertyIdValue
the property to label
@return the label
"""
PropertyRecord propertyRecord = this.propertyRecords
.get(propertyIdValue);
if (property... | java | private String getPropertyLabel(PropertyIdValue propertyIdValue) {
PropertyRecord propertyRecord = this.propertyRecords
.get(propertyIdValue);
if (propertyRecord == null || propertyRecord.propertyDocument == null) {
return propertyIdValue.getId();
} else {
return getLabel(propertyIdValue, propertyRecord... | [
"private",
"String",
"getPropertyLabel",
"(",
"PropertyIdValue",
"propertyIdValue",
")",
"{",
"PropertyRecord",
"propertyRecord",
"=",
"this",
".",
"propertyRecords",
".",
"get",
"(",
"propertyIdValue",
")",
";",
"if",
"(",
"propertyRecord",
"==",
"null",
"||",
"p... | Returns a string that should be used as a label for the given property.
@param propertyIdValue
the property to label
@return the label | [
"Returns",
"a",
"string",
"that",
"should",
"be",
"used",
"as",
"a",
"label",
"for",
"the",
"given",
"property",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/ClassPropertyUsageAnalyzer.java#L853-L861 |
jcuda/jcufft | JCufftJava/src/main/java/jcuda/jcufft/JCufft.java | JCufft.cufftExecR2C | public static int cufftExecR2C(cufftHandle plan, Pointer rIdata, Pointer cOdata) {
"""
<pre>
Executes a CUFFT real-to-complex (implicitly forward) transform plan.
cufftResult cufftExecR2C( cufftHandle plan, cufftReal *idata, cufftComplex *odata );
CUFFT uses as input data the GPU memory pointed to by the id... | java | public static int cufftExecR2C(cufftHandle plan, Pointer rIdata, Pointer cOdata)
{
return checkResult(cufftExecR2CNative(plan, rIdata, cOdata));
} | [
"public",
"static",
"int",
"cufftExecR2C",
"(",
"cufftHandle",
"plan",
",",
"Pointer",
"rIdata",
",",
"Pointer",
"cOdata",
")",
"{",
"return",
"checkResult",
"(",
"cufftExecR2CNative",
"(",
"plan",
",",
"rIdata",
",",
"cOdata",
")",
")",
";",
"}"
] | <pre>
Executes a CUFFT real-to-complex (implicitly forward) transform plan.
cufftResult cufftExecR2C( cufftHandle plan, cufftReal *idata, cufftComplex *odata );
CUFFT uses as input data the GPU memory pointed to by the idata
parameter. This function stores the non-redundant Fourier coefficients
in the odata array. If... | [
"<pre",
">",
"Executes",
"a",
"CUFFT",
"real",
"-",
"to",
"-",
"complex",
"(",
"implicitly",
"forward",
")",
"transform",
"plan",
"."
] | train | https://github.com/jcuda/jcufft/blob/833c87ffb0864f7ee7270fddef8af57f48939b3a/JCufftJava/src/main/java/jcuda/jcufft/JCufft.java#L952-L955 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/EpicsApi.java | EpicsApi.updateIssue | public EpicIssue updateIssue(Object groupIdOrPath, Integer epicIid, Integer issueIid, Integer moveBeforeId, Integer moveAfterId) throws GitLabApiException {
"""
Updates an epic - issue association.
<pre><code>GitLab Endpoint: PUT /groups/:id/epics/:epic_iid/issues/:issue_id</code></pre>
@param groupIdOrPath ... | java | public EpicIssue updateIssue(Object groupIdOrPath, Integer epicIid, Integer issueIid, Integer moveBeforeId, Integer moveAfterId) throws GitLabApiException {
GitLabApiForm form = new GitLabApiForm()
.withParam("move_before_id", moveBeforeId)
.withParam("move_after_id", moveAfterId);
... | [
"public",
"EpicIssue",
"updateIssue",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"epicIid",
",",
"Integer",
"issueIid",
",",
"Integer",
"moveBeforeId",
",",
"Integer",
"moveAfterId",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"form",
"=",
"new",... | Updates an epic - issue association.
<pre><code>GitLab Endpoint: PUT /groups/:id/epics/:epic_iid/issues/:issue_id</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
@param epicIid the Epic IID that the issue is assigned to
@param issueIid the issue IID ... | [
"Updates",
"an",
"epic",
"-",
"issue",
"association",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/EpicsApi.java#L452-L459 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/http/Headers.java | Headers.of | public static Headers of(Map<String, String> headers) {
"""
Returns headers for the header names and values in the {@link Map}.
"""
if (headers == null) throw new NullPointerException("headers == null");
// Make a defensive copy and clean it up.
String[] namesAndValues = new String[hea... | java | public static Headers of(Map<String, String> headers) {
if (headers == null) throw new NullPointerException("headers == null");
// Make a defensive copy and clean it up.
String[] namesAndValues = new String[headers.size() * 2];
int i = 0;
for (Map.Entry<String, String> header : ... | [
"public",
"static",
"Headers",
"of",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"headers == null\"",
")",
";",
"// Make a defensive copy and clean it... | Returns headers for the header names and values in the {@link Map}. | [
"Returns",
"headers",
"for",
"the",
"header",
"names",
"and",
"values",
"in",
"the",
"{"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/http/Headers.java#L107-L128 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java | DisksInner.grantAccessAsync | public Observable<AccessUriInner> grantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
"""
Grants access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed af... | java | public Observable<AccessUriInner> grantAccessAsync(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
return grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).map(new Func1<ServiceResponse<AccessUriInner>, AccessUriInner>() {
@Override
... | [
"public",
"Observable",
"<",
"AccessUriInner",
">",
"grantAccessAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
",",
"GrantAccessData",
"grantAccessData",
")",
"{",
"return",
"grantAccessWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"dis... | Grants access to a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param grantAcc... | [
"Grants",
"access",
"to",
"a",
"disk",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java#L978-L985 |
alkacon/opencms-core | src/org/opencms/util/CmsRequestUtil.java | CmsRequestUtil.appendParameter | public static String appendParameter(String url, String paramName, String paramValue) {
"""
Appends a request parameter to the given URL.<p>
This method takes care about the adding the parameter as an additional
parameter (appending <code>¶m=value</code>) or as the first parameter
(appending <code>?param=... | java | public static String appendParameter(String url, String paramName, String paramValue) {
if (CmsStringUtil.isEmpty(url)) {
return null;
}
int pos = url.indexOf(URL_DELIMITER);
StringBuffer result = new StringBuffer(256);
result.append(url);
if (pos >= 0) {
... | [
"public",
"static",
"String",
"appendParameter",
"(",
"String",
"url",
",",
"String",
"paramName",
",",
"String",
"paramValue",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmpty",
"(",
"url",
")",
")",
"{",
"return",
"null",
";",
"}",
"int",
"pos",
"="... | Appends a request parameter to the given URL.<p>
This method takes care about the adding the parameter as an additional
parameter (appending <code>¶m=value</code>) or as the first parameter
(appending <code>?param=value</code>).<p>
@param url the URL where to append the parameter to
@param paramName the paramter ... | [
"Appends",
"a",
"request",
"parameter",
"to",
"the",
"given",
"URL",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsRequestUtil.java#L182-L201 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java | EffectUtil.colorValue | static public Value colorValue(String name, Color currentValue) {
"""
Prompts the user for a colour value
@param name Thename of the value being configured
@param currentValue The default value that should be selected
@return The value selected
"""
return new DefaultValue(name, EffectUtil.toString(curr... | java | static public Value colorValue(String name, Color currentValue) {
return new DefaultValue(name, EffectUtil.toString(currentValue)) {
public void showDialog () {
Color newColor = JColorChooser.showDialog(null, "Choose a color", EffectUtil.fromString(value));
if (newColor != null) value = EffectUtil.toSt... | [
"static",
"public",
"Value",
"colorValue",
"(",
"String",
"name",
",",
"Color",
"currentValue",
")",
"{",
"return",
"new",
"DefaultValue",
"(",
"name",
",",
"EffectUtil",
".",
"toString",
"(",
"currentValue",
")",
")",
"{",
"public",
"void",
"showDialog",
"(... | Prompts the user for a colour value
@param name Thename of the value being configured
@param currentValue The default value that should be selected
@return The value selected | [
"Prompts",
"the",
"user",
"for",
"a",
"colour",
"value"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java#L64-L75 |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Request.java | Request.jsonifyData | private String jsonifyData(Map<String, ? extends Object> data) {
"""
converts Map of data to json string
@param data map data to converted to json
@return {@link String}
"""
JSONObject jsonData = new JSONObject(data);
return jsonData.toString();
} | java | private String jsonifyData(Map<String, ? extends Object> data) {
JSONObject jsonData = new JSONObject(data);
return jsonData.toString();
} | [
"private",
"String",
"jsonifyData",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"data",
")",
"{",
"JSONObject",
"jsonData",
"=",
"new",
"JSONObject",
"(",
"data",
")",
";",
"return",
"jsonData",
".",
"toString",
"(",
")",
";",
"}"
] | converts Map of data to json string
@param data map data to converted to json
@return {@link String} | [
"converts",
"Map",
"of",
"data",
"to",
"json",
"string"
] | train | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Request.java#L273-L277 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletResponseStreamDelegate.java | ServletResponseStreamDelegate.getWriter | public final PrintWriter getWriter() throws IOException {
"""
NOTE: Intentionally NOT thread safe, as one request/response should be handled by one thread ONLY.
"""
if (out == null) {
// NOTE: getCharacterEncoding may/should not return null
OutputStream out = createOutputStre... | java | public final PrintWriter getWriter() throws IOException {
if (out == null) {
// NOTE: getCharacterEncoding may/should not return null
OutputStream out = createOutputStream();
String charEncoding = response.getCharacterEncoding();
this.out = new PrintWriter(ch... | [
"public",
"final",
"PrintWriter",
"getWriter",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"{",
"// NOTE: getCharacterEncoding may/should not return null\r",
"OutputStream",
"out",
"=",
"createOutputStream",
"(",
")",
";",
"String",
... | NOTE: Intentionally NOT thread safe, as one request/response should be handled by one thread ONLY. | [
"NOTE",
":",
"Intentionally",
"NOT",
"thread",
"safe",
"as",
"one",
"request",
"/",
"response",
"should",
"be",
"handled",
"by",
"one",
"thread",
"ONLY",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletResponseStreamDelegate.java#L74-L86 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/ImageMath.java | ImageMath.smoothStep | public static float smoothStep(float a, float b, float x) {
"""
A smoothed step function. A cubic function is used to smooth the step between two thresholds.
@param a the lower threshold position
@param b the upper threshold position
@param x the input parameter
@return the output value
"""
if (x < a)
... | java | public static float smoothStep(float a, float b, float x) {
if (x < a)
return 0;
if (x >= b)
return 1;
x = (x - a) / (b - a);
return x*x * (3 - 2*x);
} | [
"public",
"static",
"float",
"smoothStep",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"x",
")",
"{",
"if",
"(",
"x",
"<",
"a",
")",
"return",
"0",
";",
"if",
"(",
"x",
">=",
"b",
")",
"return",
"1",
";",
"x",
"=",
"(",
"x",
"-",
"a... | A smoothed step function. A cubic function is used to smooth the step between two thresholds.
@param a the lower threshold position
@param b the upper threshold position
@param x the input parameter
@return the output value | [
"A",
"smoothed",
"step",
"function",
".",
"A",
"cubic",
"function",
"is",
"used",
"to",
"smooth",
"the",
"step",
"between",
"two",
"thresholds",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/ImageMath.java#L132-L139 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java | SslPolicyClient.insertSslPolicy | @BetaApi
public final Operation insertSslPolicy(ProjectName project, SslPolicy sslPolicyResource) {
"""
Returns the specified SSL policy resource. Gets a list of available SSL policies by making a
list() request.
<p>Sample code:
<pre><code>
try (SslPolicyClient sslPolicyClient = SslPolicyClient.create())... | java | @BetaApi
public final Operation insertSslPolicy(ProjectName project, SslPolicy sslPolicyResource) {
InsertSslPolicyHttpRequest request =
InsertSslPolicyHttpRequest.newBuilder()
.setProject(project == null ? null : project.toString())
.setSslPolicyResource(sslPolicyResource)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertSslPolicy",
"(",
"ProjectName",
"project",
",",
"SslPolicy",
"sslPolicyResource",
")",
"{",
"InsertSslPolicyHttpRequest",
"request",
"=",
"InsertSslPolicyHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setProject",... | Returns the specified SSL policy resource. Gets a list of available SSL policies by making a
list() request.
<p>Sample code:
<pre><code>
try (SslPolicyClient sslPolicyClient = SslPolicyClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
SslPolicy sslPolicyResource = SslPolicy.newBuilder().build();
O... | [
"Returns",
"the",
"specified",
"SSL",
"policy",
"resource",
".",
"Gets",
"a",
"list",
"of",
"available",
"SSL",
"policies",
"by",
"making",
"a",
"list",
"()",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SslPolicyClient.java#L378-L387 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/tree/checkbox/CheckBoxTree.java | CheckBoxTree.fireStateChanged | private void fireStateChanged(Object node, State oldState, State newState) {
"""
Notify all {@link StateListener}s about a {@link State} change
@param node The node whose state changed
@param oldState The old state
@param newState The new state
"""
for (StateListener stateListener : stateListener... | java | private void fireStateChanged(Object node, State oldState, State newState)
{
for (StateListener stateListener : stateListeners)
{
stateListener.stateChanged(node, oldState, newState);
}
} | [
"private",
"void",
"fireStateChanged",
"(",
"Object",
"node",
",",
"State",
"oldState",
",",
"State",
"newState",
")",
"{",
"for",
"(",
"StateListener",
"stateListener",
":",
"stateListeners",
")",
"{",
"stateListener",
".",
"stateChanged",
"(",
"node",
",",
"... | Notify all {@link StateListener}s about a {@link State} change
@param node The node whose state changed
@param oldState The old state
@param newState The new state | [
"Notify",
"all",
"{",
"@link",
"StateListener",
"}",
"s",
"about",
"a",
"{",
"@link",
"State",
"}",
"change"
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/tree/checkbox/CheckBoxTree.java#L185-L191 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ReflectiveVisitorHelper.java | ReflectiveVisitorHelper.getMethod | private Method getMethod(Class visitorClass, Object argument) {
"""
Determines the most appropriate visit method for the given visitor class
and argument.
"""
ClassVisitMethods visitMethods = (ClassVisitMethods) this.visitorClassVisitMethods
.get(visitorClass);
return visitMethods.getVisitMethod(argum... | java | private Method getMethod(Class visitorClass, Object argument) {
ClassVisitMethods visitMethods = (ClassVisitMethods) this.visitorClassVisitMethods
.get(visitorClass);
return visitMethods.getVisitMethod(argument != null ? argument
.getClass() : null);
} | [
"private",
"Method",
"getMethod",
"(",
"Class",
"visitorClass",
",",
"Object",
"argument",
")",
"{",
"ClassVisitMethods",
"visitMethods",
"=",
"(",
"ClassVisitMethods",
")",
"this",
".",
"visitorClassVisitMethods",
".",
"get",
"(",
"visitorClass",
")",
";",
"retur... | Determines the most appropriate visit method for the given visitor class
and argument. | [
"Determines",
"the",
"most",
"appropriate",
"visit",
"method",
"for",
"the",
"given",
"visitor",
"class",
"and",
"argument",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ReflectiveVisitorHelper.java#L114-L119 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithoutTrailingChars | @Nonnull
public static String getWithoutTrailingChars (@Nullable final String sStr, @Nonnegative final int nCount) {
"""
Get the passed string without the specified number of trailing chars.
@param sStr
The source string. May be <code>null</code>.
@param nCount
The number of chars to remove.
@return An em... | java | @Nonnull
public static String getWithoutTrailingChars (@Nullable final String sStr, @Nonnegative final int nCount)
{
ValueEnforcer.isGE0 (nCount, "Count");
if (nCount == 0)
return sStr;
final int nLength = getLength (sStr);
return nLength <= nCount ? "" : sStr.substring (0, nLength - nCount);... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithoutTrailingChars",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nCount",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nCount",
",",
"\"Count\"",
")",
";",
"... | Get the passed string without the specified number of trailing chars.
@param sStr
The source string. May be <code>null</code>.
@param nCount
The number of chars to remove.
@return An empty, non-<code>null</code> string if the passed string has a
length ≤ <code>nCount</code>. | [
"Get",
"the",
"passed",
"string",
"without",
"the",
"specified",
"number",
"of",
"trailing",
"chars",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4700-L4709 |
SeunMatt/mysql-backup4j | src/main/java/com/smattme/MysqlBaseService.java | MysqlBaseService.getEmptyTableSQL | static String getEmptyTableSQL(String database, String table) {
"""
This function is an helper function
that'll generate a DELETE FROM database.table
SQL to clear existing table
@param database database
@param table table
@return String sql to delete the all records from the table
"""
String saf... | java | static String getEmptyTableSQL(String database, String table) {
String safeDeleteSQL = "SELECT IF( \n" +
"(SELECT COUNT(1) as table_exists FROM information_schema.tables \n" +
"WHERE table_schema='" + database + "' AND table_name='" + table + "') > 1, \n" +
... | [
"static",
"String",
"getEmptyTableSQL",
"(",
"String",
"database",
",",
"String",
"table",
")",
"{",
"String",
"safeDeleteSQL",
"=",
"\"SELECT IF( \\n\"",
"+",
"\"(SELECT COUNT(1) as table_exists FROM information_schema.tables \\n\"",
"+",
"\"WHERE table_schema='\"",
"+",
"da... | This function is an helper function
that'll generate a DELETE FROM database.table
SQL to clear existing table
@param database database
@param table table
@return String sql to delete the all records from the table | [
"This",
"function",
"is",
"an",
"helper",
"function",
"that",
"ll",
"generate",
"a",
"DELETE",
"FROM",
"database",
".",
"table",
"SQL",
"to",
"clear",
"existing",
"table"
] | train | https://github.com/SeunMatt/mysql-backup4j/blob/7e31aac33fe63948d4ad64a053394759457da636/src/main/java/com/smattme/MysqlBaseService.java#L104-L116 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/processors/impl/AddSecurityCookiesProcessor.java | AddSecurityCookiesProcessor.processRequest | @Override
public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
"""
Wraps the response in a wrapper that adds (or deletes) the security cookies before the response is sent.
@param context the context which holds the current request and res... | java | @Override
public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
AddSecurityCookiesResponseWrapper response = wrapResponse(context);
context.setResponse(response);
logger.debug("Wrapped response in a {}", response.getClass().getNa... | [
"@",
"Override",
"public",
"void",
"processRequest",
"(",
"RequestContext",
"context",
",",
"RequestSecurityProcessorChain",
"processorChain",
")",
"throws",
"Exception",
"{",
"AddSecurityCookiesResponseWrapper",
"response",
"=",
"wrapResponse",
"(",
"context",
")",
";",
... | Wraps the response in a wrapper that adds (or deletes) the security cookies before the response is sent.
@param context the context which holds the current request and response
@param processorChain the {@link RequestSecurityProcessorChain}, used to call the next processor | [
"Wraps",
"the",
"response",
"in",
"a",
"wrapper",
"that",
"adds",
"(",
"or",
"deletes",
")",
"the",
"security",
"cookies",
"before",
"the",
"response",
"is",
"sent",
"."
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/processors/impl/AddSecurityCookiesProcessor.java#L66-L78 |
OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/client/ClientWorldConnection.java | ClientWorldConnection.getRangeRequest | public synchronized StepResponse getRangeRequest(final String idRegex,
final long start, final long end, String... attributes) {
"""
Sends a range request to the world model for the specified Identifier
regular expression, Attribute regular expressions, between the start and
end times.
@param idRegex
r... | java | public synchronized StepResponse getRangeRequest(final String idRegex,
final long start, final long end, String... attributes) {
RangeRequestMessage req = new RangeRequestMessage();
req.setIdRegex(idRegex);
req.setBeginTimestamp(start);
req.setEndTimestamp(end);
if (attributes != null) {
... | [
"public",
"synchronized",
"StepResponse",
"getRangeRequest",
"(",
"final",
"String",
"idRegex",
",",
"final",
"long",
"start",
",",
"final",
"long",
"end",
",",
"String",
"...",
"attributes",
")",
"{",
"RangeRequestMessage",
"req",
"=",
"new",
"RangeRequestMessage... | Sends a range request to the world model for the specified Identifier
regular expression, Attribute regular expressions, between the start and
end times.
@param idRegex
regular expression for matching the identifier.
@param start
the beginning of the range..
@param end
the end of the range.
@param attributes
the attri... | [
"Sends",
"a",
"range",
"request",
"to",
"the",
"world",
"model",
"for",
"the",
"specified",
"Identifier",
"regular",
"expression",
"Attribute",
"regular",
"expressions",
"between",
"the",
"start",
"and",
"end",
"times",
"."
] | train | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/client/ClientWorldConnection.java#L348-L379 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asFloat | public static Float asFloat(String expression, Node node, XPath xpath)
throws XPathExpressionException {
"""
Same as {@link #asFloat(String, Node)} but allows an xpath to be passed
in explicitly for reuse.
"""
String floatString = evaluateAsString(expression, node, xpath);
return (... | java | public static Float asFloat(String expression, Node node, XPath xpath)
throws XPathExpressionException {
String floatString = evaluateAsString(expression, node, xpath);
return (isEmptyString(floatString)) ? null : Float.valueOf(floatString);
} | [
"public",
"static",
"Float",
"asFloat",
"(",
"String",
"expression",
",",
"Node",
"node",
",",
"XPath",
"xpath",
")",
"throws",
"XPathExpressionException",
"{",
"String",
"floatString",
"=",
"evaluateAsString",
"(",
"expression",
",",
"node",
",",
"xpath",
")",
... | Same as {@link #asFloat(String, Node)} but allows an xpath to be passed
in explicitly for reuse. | [
"Same",
"as",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L356-L360 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getTime | private long getTime(Date start, Date end) {
"""
Retrieves the amount of time between two date time values. Note that
these values are converted into canonical values to remove the
date component.
@param start start time
@param end end time
@return length of time
"""
long total = 0;
if (star... | java | private long getTime(Date start, Date end)
{
long total = 0;
if (start != null && end != null)
{
Date startTime = DateHelper.getCanonicalTime(start);
Date endTime = DateHelper.getCanonicalTime(end);
Date startDay = DateHelper.getDayStartDate(start);
Date finishD... | [
"private",
"long",
"getTime",
"(",
"Date",
"start",
",",
"Date",
"end",
")",
"{",
"long",
"total",
"=",
"0",
";",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"Date",
"startTime",
"=",
"DateHelper",
".",
"getCanonicalTime",
... | Retrieves the amount of time between two date time values. Note that
these values are converted into canonical values to remove the
date component.
@param start start time
@param end end time
@return length of time | [
"Retrieves",
"the",
"amount",
"of",
"time",
"between",
"two",
"date",
"time",
"values",
".",
"Note",
"that",
"these",
"values",
"are",
"converted",
"into",
"canonical",
"values",
"to",
"remove",
"the",
"date",
"component",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L1566-L1589 |
yanzhenjie/Album | album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java | AlbumUtils.applyLanguageForContext | @NonNull
public static Context applyLanguageForContext(@NonNull Context context, @NonNull Locale locale) {
"""
Setting {@link Locale} for {@link Context}.
@param context to set the specified locale context.
@param locale locale.
"""
Resources resources = context.getResources();
Configu... | java | @NonNull
public static Context applyLanguageForContext(@NonNull Context context, @NonNull Locale locale) {
Resources resources = context.getResources();
Configuration config = resources.getConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
config.setLocale(loc... | [
"@",
"NonNull",
"public",
"static",
"Context",
"applyLanguageForContext",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"Locale",
"locale",
")",
"{",
"Resources",
"resources",
"=",
"context",
".",
"getResources",
"(",
")",
";",
"Configuration",... | Setting {@link Locale} for {@link Context}.
@param context to set the specified locale context.
@param locale locale. | [
"Setting",
"{",
"@link",
"Locale",
"}",
"for",
"{",
"@link",
"Context",
"}",
"."
] | train | https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L93-L105 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java | EJSContainer.getUserTransactionThreadData | public static EJBThreadData getUserTransactionThreadData() {
"""
Returns the EJB thread data if an EJB context is active on the current
thread and that EJB may use UserTransaction.
@return verified EJB thread data
@throws EJBException if the pre-conditions aren't met
"""
EJBThreadData threadData =... | java | public static EJBThreadData getUserTransactionThreadData() {
EJBThreadData threadData = getThreadData();
BeanO beanO = threadData.getCallbackBeanO();
if (beanO == null) {
EJBException ex = new EJBException("EJB UserTransaction can only be used from an EJB");
if (TraceCom... | [
"public",
"static",
"EJBThreadData",
"getUserTransactionThreadData",
"(",
")",
"{",
"EJBThreadData",
"threadData",
"=",
"getThreadData",
"(",
")",
";",
"BeanO",
"beanO",
"=",
"threadData",
".",
"getCallbackBeanO",
"(",
")",
";",
"if",
"(",
"beanO",
"==",
"null",... | Returns the EJB thread data if an EJB context is active on the current
thread and that EJB may use UserTransaction.
@return verified EJB thread data
@throws EJBException if the pre-conditions aren't met | [
"Returns",
"the",
"EJB",
"thread",
"data",
"if",
"an",
"EJB",
"context",
"is",
"active",
"on",
"the",
"current",
"thread",
"and",
"that",
"EJB",
"may",
"use",
"UserTransaction",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L1373-L1394 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java | TransitionManager.setTransitionName | public static void setTransitionName(@NonNull View v, @Nullable String transitionName) {
"""
Sets the name of the View to be used to identify Views in Transitions.
Names should be unique in the View hierarchy.
@param transitionName The name of the View to uniquely identify it for Transitions.
"""
V... | java | public static void setTransitionName(@NonNull View v, @Nullable String transitionName) {
ViewUtils.setTransitionName(v, transitionName);
} | [
"public",
"static",
"void",
"setTransitionName",
"(",
"@",
"NonNull",
"View",
"v",
",",
"@",
"Nullable",
"String",
"transitionName",
")",
"{",
"ViewUtils",
".",
"setTransitionName",
"(",
"v",
",",
"transitionName",
")",
";",
"}"
] | Sets the name of the View to be used to identify Views in Transitions.
Names should be unique in the View hierarchy.
@param transitionName The name of the View to uniquely identify it for Transitions. | [
"Sets",
"the",
"name",
"of",
"the",
"View",
"to",
"be",
"used",
"to",
"identify",
"Views",
"in",
"Transitions",
".",
"Names",
"should",
"be",
"unique",
"in",
"the",
"View",
"hierarchy",
"."
] | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java#L481-L483 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java | AbstractX509FileSystemStore.writeHeader | private static void writeHeader(BufferedWriter out, String type) throws IOException {
"""
Write a PEM like header.
@param out the output buffered writer to write to.
@param type the type to be written in the header.
@throws IOException on error.
"""
out.write(PEM_BEGIN + type + DASHES);
ou... | java | private static void writeHeader(BufferedWriter out, String type) throws IOException
{
out.write(PEM_BEGIN + type + DASHES);
out.newLine();
} | [
"private",
"static",
"void",
"writeHeader",
"(",
"BufferedWriter",
"out",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"PEM_BEGIN",
"+",
"type",
"+",
"DASHES",
")",
";",
"out",
".",
"newLine",
"(",
")",
";",
"}"
] | Write a PEM like header.
@param out the output buffered writer to write to.
@param type the type to be written in the header.
@throws IOException on error. | [
"Write",
"a",
"PEM",
"like",
"header",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L117-L121 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/reporting/SimpleReporter.java | SimpleReporter.appendEscapedAndQuoted | protected void appendEscapedAndQuoted(final StringBuilder sb, final String value) {
"""
<p>
Encloses the given value into double-quotes. Quote characters are escaped with an additional quote character. Line breaks
are replaced with a space character. Multiple line breaks are collapsed to a single space.
</p>
<... | java | protected void appendEscapedAndQuoted(final StringBuilder sb, final String value) {
boolean foundLineBreak = false;
if (sb.length() > 0) {
sb.append(DELIMITER);
}
sb.append(CSV_QUOTE);
if (value != null) {
for (int i = 0, len = value.length(); i < len; ++i) {
char c = value.charAt(i);
... | [
"protected",
"void",
"appendEscapedAndQuoted",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"value",
")",
"{",
"boolean",
"foundLineBreak",
"=",
"false",
";",
"if",
"(",
"sb",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"sb",
".",
"appen... | <p>
Encloses the given value into double-quotes. Quote characters are escaped with an additional quote character. Line breaks
are replaced with a space character. Multiple line breaks are collapsed to a single space.
</p>
<p>
If the specified StringBuilder is non-empty, a semi-colon is appended first.
</p>
@param sb
t... | [
"<p",
">",
"Encloses",
"the",
"given",
"value",
"into",
"double",
"-",
"quotes",
".",
"Quote",
"characters",
"are",
"escaped",
"with",
"an",
"additional",
"quote",
"character",
".",
"Line",
"breaks",
"are",
"replaced",
"with",
"a",
"space",
"character",
".",... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/reporting/SimpleReporter.java#L181-L215 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/GenericsUtils.java | GenericsUtils.resolveTypeVariables | public static Type[] resolveTypeVariables(final Type[] types, final Map<String, Type> generics) {
"""
Shortcut for {@link #resolveTypeVariables(Type, Map)} to process multiple types at once.
@param types types to replace named generics in
@param generics known generics
@return types without named generics
... | java | public static Type[] resolveTypeVariables(final Type[] types, final Map<String, Type> generics) {
return resolveTypeVariables(types, generics, false);
} | [
"public",
"static",
"Type",
"[",
"]",
"resolveTypeVariables",
"(",
"final",
"Type",
"[",
"]",
"types",
",",
"final",
"Map",
"<",
"String",
",",
"Type",
">",
"generics",
")",
"{",
"return",
"resolveTypeVariables",
"(",
"types",
",",
"generics",
",",
"false"... | Shortcut for {@link #resolveTypeVariables(Type, Map)} to process multiple types at once.
@param types types to replace named generics in
@param generics known generics
@return types without named generics
@see TypeVariableUtils#resolveAllTypeVariables(Type[], Map) | [
"Shortcut",
"for",
"{",
"@link",
"#resolveTypeVariables",
"(",
"Type",
"Map",
")",
"}",
"to",
"process",
"multiple",
"types",
"at",
"once",
"."
] | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericsUtils.java#L298-L300 |
apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.compareToUnchecked | private int compareToUnchecked(byte[] bytes, int offset, int len) {
"""
Compares this to the passed bytes, byte by byte, returning a negative, zero, or positive result
if the first sequence is less than, equal to, or greater than the second. The comparison is
performed starting with the first byte of each sequen... | java | private int compareToUnchecked(byte[] bytes, int offset, int len) {
if (this.length == this.data.length && len == bytes.length) {
return UnsignedBytes.lexicographicalComparator().compare(this.data, bytes);
} else {
int minLen = Math.min(this.length, len);
for (int i = this.offset, j = offset; ... | [
"private",
"int",
"compareToUnchecked",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"if",
"(",
"this",
".",
"length",
"==",
"this",
".",
"data",
".",
"length",
"&&",
"len",
"==",
"bytes",
".",
"length",
")",
"... | Compares this to the passed bytes, byte by byte, returning a negative, zero, or positive result
if the first sequence is less than, equal to, or greater than the second. The comparison is
performed starting with the first byte of each sequence, and proceeds until a pair of bytes
differs, or one sequence runs out of byt... | [
"Compares",
"this",
"to",
"the",
"passed",
"bytes",
"byte",
"by",
"byte",
"returning",
"a",
"negative",
"zero",
"or",
"positive",
"result",
"if",
"the",
"first",
"sequence",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
"."... | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L250-L264 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toPoint | public Point toPoint(LatLng latLng, boolean hasZ, boolean hasM) {
"""
Convert a {@link LatLng} to a {@link Point}
@param latLng lat lng
@param hasZ has z flag
@param hasM has m flag
@return point
"""
double y = latLng.latitude;
double x = latLng.longitude;
Point point = new Po... | java | public Point toPoint(LatLng latLng, boolean hasZ, boolean hasM) {
double y = latLng.latitude;
double x = latLng.longitude;
Point point = new Point(hasZ, hasM, x, y);
point = toProjection(point);
return point;
} | [
"public",
"Point",
"toPoint",
"(",
"LatLng",
"latLng",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"double",
"y",
"=",
"latLng",
".",
"latitude",
";",
"double",
"x",
"=",
"latLng",
".",
"longitude",
";",
"Point",
"point",
"=",
"new",
"Poi... | Convert a {@link LatLng} to a {@link Point}
@param latLng lat lng
@param hasZ has z flag
@param hasM has m flag
@return point | [
"Convert",
"a",
"{",
"@link",
"LatLng",
"}",
"to",
"a",
"{",
"@link",
"Point",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L247-L253 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/JXLCellFormatter.java | JXLCellFormatter.getCellValue | private CellFormatResult getCellValue(final Cell cell, final Locale locale, final boolean isStartDate1904) {
"""
セルの値をフォーマットする。
@param cell フォーマット対象のセル
@param locale ロケール
@param isStartDate1904 1904年始まりかどうか。
@return
"""
final JXLCell jxlCell = new JXLCell(cell, isStartDate1904);
... | java | private CellFormatResult getCellValue(final Cell cell, final Locale locale, final boolean isStartDate1904) {
final JXLCell jxlCell = new JXLCell(cell, isStartDate1904);
final short formatIndex = jxlCell.getFormatIndex();
final String formatPattern = jxlCell.getFormatPattern();
... | [
"private",
"CellFormatResult",
"getCellValue",
"(",
"final",
"Cell",
"cell",
",",
"final",
"Locale",
"locale",
",",
"final",
"boolean",
"isStartDate1904",
")",
"{",
"final",
"JXLCell",
"jxlCell",
"=",
"new",
"JXLCell",
"(",
"cell",
",",
"isStartDate1904",
")",
... | セルの値をフォーマットする。
@param cell フォーマット対象のセル
@param locale ロケール
@param isStartDate1904 1904年始まりかどうか。
@return | [
"セルの値をフォーマットする。"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/JXLCellFormatter.java#L257-L281 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/database/SqlDocument.java | SqlDocument.insertString | public void insertString( int offset, String str, AttributeSet a ) throws BadLocationException {
"""
/*
Override to apply syntax highlighting after the document has been updated
"""
if (str.equals("{"))
str = addMatchingBrace(offset);
super.insertString(offset, str, a);
pro... | java | public void insertString( int offset, String str, AttributeSet a ) throws BadLocationException {
if (str.equals("{"))
str = addMatchingBrace(offset);
super.insertString(offset, str, a);
processChangedLines(offset, str.length());
} | [
"public",
"void",
"insertString",
"(",
"int",
"offset",
",",
"String",
"str",
",",
"AttributeSet",
"a",
")",
"throws",
"BadLocationException",
"{",
"if",
"(",
"str",
".",
"equals",
"(",
"\"{\"",
")",
")",
"str",
"=",
"addMatchingBrace",
"(",
"offset",
")",... | /*
Override to apply syntax highlighting after the document has been updated | [
"/",
"*",
"Override",
"to",
"apply",
"syntax",
"highlighting",
"after",
"the",
"document",
"has",
"been",
"updated"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/database/SqlDocument.java#L87-L92 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/http/ContextData.java | ContextData.addData | public ContextData addData(Object key, Object value) {
"""
Adds a new immutable {@link ContextData} object with the specified key-value pair to
the existing {@link ContextData} chain.
@param key the key
@param value the value
@return the new {@link ContextData} object containing the specified pair added to t... | java | public ContextData addData(Object key, Object value) {
if (key == null) {
throw new IllegalArgumentException("key cannot be null");
}
return new ContextData(this, key, value);
} | [
"public",
"ContextData",
"addData",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"key cannot be null\"",
")",
";",
"}",
"return",
"new",
"ContextData",
"(... | Adds a new immutable {@link ContextData} object with the specified key-value pair to
the existing {@link ContextData} chain.
@param key the key
@param value the value
@return the new {@link ContextData} object containing the specified pair added to the set of pairs | [
"Adds",
"a",
"new",
"immutable",
"{",
"@link",
"ContextData",
"}",
"object",
"with",
"the",
"specified",
"key",
"-",
"value",
"pair",
"to",
"the",
"existing",
"{",
"@link",
"ContextData",
"}",
"chain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/http/ContextData.java#L56-L61 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/core/OrderComparator.java | OrderComparator.getOrder | private int getOrder(Object obj, OrderSourceProvider sourceProvider) {
"""
Determine the order value for the given object.
<p>The default implementation checks against the given {@link OrderSourceProvider}
using {@link #findOrder} and falls back to a regular {@link #getOrder(Object)} call.
@param obj the object... | java | private int getOrder(Object obj, OrderSourceProvider sourceProvider) {
Integer order = null;
if (sourceProvider != null) {
order = findOrder(sourceProvider.getOrderSource(obj));
}
return (order != null ? order : getOrder(obj));
} | [
"private",
"int",
"getOrder",
"(",
"Object",
"obj",
",",
"OrderSourceProvider",
"sourceProvider",
")",
"{",
"Integer",
"order",
"=",
"null",
";",
"if",
"(",
"sourceProvider",
"!=",
"null",
")",
"{",
"order",
"=",
"findOrder",
"(",
"sourceProvider",
".",
"get... | Determine the order value for the given object.
<p>The default implementation checks against the given {@link OrderSourceProvider}
using {@link #findOrder} and falls back to a regular {@link #getOrder(Object)} call.
@param obj the object to check
@return the order value, or {@code Ordered.LOWEST_PRECEDENCE} as fallback | [
"Determine",
"the",
"order",
"value",
"for",
"the",
"given",
"object",
".",
"<p",
">",
"The",
"default",
"implementation",
"checks",
"against",
"the",
"given",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/core/OrderComparator.java#L89-L95 |
apereo/cas | support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/web/WSFederationValidateRequestController.java | WSFederationValidateRequestController.handleFederationRequest | @GetMapping(path = WSFederationConstants.ENDPOINT_FEDERATION_REQUEST)
protected void handleFederationRequest(final HttpServletResponse response, final HttpServletRequest request) throws Exception {
"""
Handle federation request.
@param response the response
@param request the request
@throws Exception th... | java | @GetMapping(path = WSFederationConstants.ENDPOINT_FEDERATION_REQUEST)
protected void handleFederationRequest(final HttpServletResponse response, final HttpServletRequest request) throws Exception {
val fedRequest = WSFederationRequest.of(request);
val wa = fedRequest.getWa();
if (StringUtils... | [
"@",
"GetMapping",
"(",
"path",
"=",
"WSFederationConstants",
".",
"ENDPOINT_FEDERATION_REQUEST",
")",
"protected",
"void",
"handleFederationRequest",
"(",
"final",
"HttpServletResponse",
"response",
",",
"final",
"HttpServletRequest",
"request",
")",
"throws",
"Exception... | Handle federation request.
@param response the response
@param request the request
@throws Exception the exception | [
"Handle",
"federation",
"request",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/web/WSFederationValidateRequestController.java#L41-L61 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java | KnowledgeSwitchYardScanner.toManifestModel | protected ManifestModel toManifestModel(Manifest[] manifestAnnotations, KnowledgeNamespace knowledgeNamespace) {
"""
Converts manifest annotations to manifest model.
@param manifestAnnotations annotations
@param knowledgeNamespace knowledgeNamespace
@return model
"""
if (manifestAnnotations == nul... | java | protected ManifestModel toManifestModel(Manifest[] manifestAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (manifestAnnotations == null || manifestAnnotations.length == 0) {
return null;
}
Manifest manifestAnnotation = manifestAnnotations[0];
ManifestModel manifestMo... | [
"protected",
"ManifestModel",
"toManifestModel",
"(",
"Manifest",
"[",
"]",
"manifestAnnotations",
",",
"KnowledgeNamespace",
"knowledgeNamespace",
")",
"{",
"if",
"(",
"manifestAnnotations",
"==",
"null",
"||",
"manifestAnnotations",
".",
"length",
"==",
"0",
")",
... | Converts manifest annotations to manifest model.
@param manifestAnnotations annotations
@param knowledgeNamespace knowledgeNamespace
@return model | [
"Converts",
"manifest",
"annotations",
"to",
"manifest",
"model",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java#L210-L222 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.removePeer | public void removePeer(Peer peer) throws InvalidArgumentException {
"""
Removes the peer connection from the channel.
This does NOT unjoin the peer from from the channel.
Fabric does not support that at this time -- maybe some day, but not today
@param peer
"""
if (shutdown) {
throw ne... | java | public void removePeer(Peer peer) throws InvalidArgumentException {
if (shutdown) {
throw new InvalidArgumentException(format("Can not remove peer from channel %s already shutdown.", name));
}
logger.debug(format("removePeer %s from channel %s", peer, toString()));
checkPeer... | [
"public",
"void",
"removePeer",
"(",
"Peer",
"peer",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"shutdown",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Can not remove peer from channel %s already shutdown.\"",
",",
"name"... | Removes the peer connection from the channel.
This does NOT unjoin the peer from from the channel.
Fabric does not support that at this time -- maybe some day, but not today
@param peer | [
"Removes",
"the",
"peer",
"connection",
"from",
"the",
"channel",
".",
"This",
"does",
"NOT",
"unjoin",
"the",
"peer",
"from",
"from",
"the",
"channel",
".",
"Fabric",
"does",
"not",
"support",
"that",
"at",
"this",
"time",
"--",
"maybe",
"some",
"day",
... | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L890-L900 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/PluralRulesLoader.java | PluralRulesLoader.forLocale | public PluralRules forLocale(ULocale locale, PluralRules.PluralType type) {
"""
Returns the plural rules for the the locale. If we don't have data,
android.icu.text.PluralRules.DEFAULT is returned.
"""
String rulesId = getRulesIdForLocale(locale, type);
if (rulesId == null || rulesId.trim().le... | java | public PluralRules forLocale(ULocale locale, PluralRules.PluralType type) {
String rulesId = getRulesIdForLocale(locale, type);
if (rulesId == null || rulesId.trim().length() == 0) {
return PluralRules.DEFAULT;
}
PluralRules rules = getRulesForRulesId(rulesId);
if (ru... | [
"public",
"PluralRules",
"forLocale",
"(",
"ULocale",
"locale",
",",
"PluralRules",
".",
"PluralType",
"type",
")",
"{",
"String",
"rulesId",
"=",
"getRulesIdForLocale",
"(",
"locale",
",",
"type",
")",
";",
"if",
"(",
"rulesId",
"==",
"null",
"||",
"rulesId... | Returns the plural rules for the the locale. If we don't have data,
android.icu.text.PluralRules.DEFAULT is returned. | [
"Returns",
"the",
"plural",
"rules",
"for",
"the",
"the",
"locale",
".",
"If",
"we",
"don",
"t",
"have",
"data",
"android",
".",
"icu",
".",
"text",
".",
"PluralRules",
".",
"DEFAULT",
"is",
"returned",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/PluralRulesLoader.java#L239-L249 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.beginCreateOrUpdateCertificate | public AppServiceCertificateResourceInner beginCreateOrUpdateCertificate(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) {
"""
Creates or updates a certificate and associates with key vault secret.
Creates or updates a certificate and ass... | java | public AppServiceCertificateResourceInner beginCreateOrUpdateCertificate(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) {
return beginCreateOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyV... | [
"public",
"AppServiceCertificateResourceInner",
"beginCreateOrUpdateCertificate",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"String",
"name",
",",
"AppServiceCertificateResourceInner",
"keyVaultCertificate",
")",
"{",
"return",
"beginCreateOr... | Creates or updates a certificate and associates with key vault secret.
Creates or updates a certificate and associates with key vault secret.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param name Name of the certificate... | [
"Creates",
"or",
"updates",
"a",
"certificate",
"and",
"associates",
"with",
"key",
"vault",
"secret",
".",
"Creates",
"or",
"updates",
"a",
"certificate",
"and",
"associates",
"with",
"key",
"vault",
"secret",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1277-L1279 |
google/closure-templates | java/src/com/google/template/soy/i18ndirectives/I18nUtils.java | I18nUtils.parseLocale | public static Locale parseLocale(String localeString) {
"""
Given a string representing a Locale, returns the Locale object for that string.
@return A Locale object built from the string provided
"""
if (localeString == null) {
return Locale.US;
}
String[] groups = localeString.split("[-_]... | java | public static Locale parseLocale(String localeString) {
if (localeString == null) {
return Locale.US;
}
String[] groups = localeString.split("[-_]");
switch (groups.length) {
case 1:
return new Locale(groups[0]);
case 2:
return new Locale(groups[0], Ascii.toUpperCase(gr... | [
"public",
"static",
"Locale",
"parseLocale",
"(",
"String",
"localeString",
")",
"{",
"if",
"(",
"localeString",
"==",
"null",
")",
"{",
"return",
"Locale",
".",
"US",
";",
"}",
"String",
"[",
"]",
"groups",
"=",
"localeString",
".",
"split",
"(",
"\"[-_... | Given a string representing a Locale, returns the Locale object for that string.
@return A Locale object built from the string provided | [
"Given",
"a",
"string",
"representing",
"a",
"Locale",
"returns",
"the",
"Locale",
"object",
"for",
"that",
"string",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/i18ndirectives/I18nUtils.java#L37-L52 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/NLS.java | NLS.getInteger | public int getInteger(String key) throws MissingResourceException {
"""
Not sure why this is here. Looks like it is a replacement for
Integer.getInteger.
"""
String result = getString(key);
try {
return Integer.parseInt(result);
} catch (NumberFormatException nfe) {
... | java | public int getInteger(String key) throws MissingResourceException {
String result = getString(key);
try {
return Integer.parseInt(result);
} catch (NumberFormatException nfe) {
if (tc.isEventEnabled()) {
Tr.event(tc, "Unable to parse " + result + " as Inte... | [
"public",
"int",
"getInteger",
"(",
"String",
"key",
")",
"throws",
"MissingResourceException",
"{",
"String",
"result",
"=",
"getString",
"(",
"key",
")",
";",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"result",
")",
";",
"}",
"catch",
"(",
... | Not sure why this is here. Looks like it is a replacement for
Integer.getInteger. | [
"Not",
"sure",
"why",
"this",
"is",
"here",
".",
"Looks",
"like",
"it",
"is",
"a",
"replacement",
"for",
"Integer",
".",
"getInteger",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/NLS.java#L408-L424 |
ykrasik/jaci | jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/command/CliCommand.java | CliCommand.fromDef | public static CliCommand fromDef(CommandDef def) {
"""
Construct a CLI command from a {@link CommandDef}.
@param def CommandDef to construct a CLI command from.
@return A CLI command constructed from the CommandDef.
"""
final Identifier identifier = def.getIdentifier();
final List<CliParam>... | java | public static CliCommand fromDef(CommandDef def) {
final Identifier identifier = def.getIdentifier();
final List<CliParam> params = createParams(def.getParamDefs());
final CommandExecutor executor = def.getExecutor();
return from(identifier, params, executor);
} | [
"public",
"static",
"CliCommand",
"fromDef",
"(",
"CommandDef",
"def",
")",
"{",
"final",
"Identifier",
"identifier",
"=",
"def",
".",
"getIdentifier",
"(",
")",
";",
"final",
"List",
"<",
"CliParam",
">",
"params",
"=",
"createParams",
"(",
"def",
".",
"g... | Construct a CLI command from a {@link CommandDef}.
@param def CommandDef to construct a CLI command from.
@return A CLI command constructed from the CommandDef. | [
"Construct",
"a",
"CLI",
"command",
"from",
"a",
"{",
"@link",
"CommandDef",
"}",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/command/CliCommand.java#L103-L108 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerBlobAuditingPoliciesInner.java | ServerBlobAuditingPoliciesInner.getAsync | public Observable<ServerBlobAuditingPolicyInner> getAsync(String resourceGroupName, String serverName) {
"""
Gets a server's blob auditing policy.
@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.
@pa... | java | public Observable<ServerBlobAuditingPolicyInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerBlobAuditingPolicyInner>, ServerBlobAuditingPolicyInner>() {
@Override
public Ser... | [
"public",
"Observable",
"<",
"ServerBlobAuditingPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"new",... | Gets a server's blob auditing policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@ret... | [
"Gets",
"a",
"server",
"s",
"blob",
"auditing",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ServerBlobAuditingPoliciesInner.java#L106-L113 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsInvalidQuerySortValue | public FessMessages addErrorsInvalidQuerySortValue(String property, String arg0) {
"""
Add the created action message for the key 'errors.invalid_query_sort_value' with parameters.
<pre>
message: The given sort ({0}) is invalid.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 T... | java | public FessMessages addErrorsInvalidQuerySortValue(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_invalid_query_sort_value, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsInvalidQuerySortValue",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_invalid_query_sort_value",
",",
... | Add the created action message for the key 'errors.invalid_query_sort_value' with parameters.
<pre>
message: The given sort ({0}) is invalid.
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"invalid_query_sort_value",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"The",
"given",
"sort",
"(",
"{",
"0",
"}",
")",
"is",
"invalid",
".",
"<",
"/",
"pre",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2050-L2054 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UniversalTimeScale.java | UniversalTimeScale.toLong | public static long toLong(long universalTime, int timeScale) {
"""
Convert a datetime from the universal time scale stored as a <code>BigDecimal</code> to a
<code>long</code> in the given time scale.
Since this calculation requires a divide, we must round. The straight forward
way to round by adding half of t... | java | public static long toLong(long universalTime, int timeScale)
{
TimeScaleData data = toRangeCheck(universalTime, timeScale);
if (universalTime < 0) {
if (universalTime < data.minRound) {
return (universalTime + data.unitsRound) / data.units - data.epochOffsetP1;
... | [
"public",
"static",
"long",
"toLong",
"(",
"long",
"universalTime",
",",
"int",
"timeScale",
")",
"{",
"TimeScaleData",
"data",
"=",
"toRangeCheck",
"(",
"universalTime",
",",
"timeScale",
")",
";",
"if",
"(",
"universalTime",
"<",
"0",
")",
"{",
"if",
"("... | Convert a datetime from the universal time scale stored as a <code>BigDecimal</code> to a
<code>long</code> in the given time scale.
Since this calculation requires a divide, we must round. The straight forward
way to round by adding half of the divisor will push the sum out of range for values
within have the divisor... | [
"Convert",
"a",
"datetime",
"from",
"the",
"universal",
"time",
"scale",
"stored",
"as",
"a",
"<code",
">",
"BigDecimal<",
"/",
"code",
">",
"to",
"a",
"<code",
">",
"long<",
"/",
"code",
">",
"in",
"the",
"given",
"time",
"scale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UniversalTimeScale.java#L440-L457 |
strator-dev/greenpepper | greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/phpDriver/PHPDriverHelper.java | PHPDriverHelper.createTmpPhpFileFromResource | public static File createTmpPhpFileFromResource(String resourceName, boolean deleteOnExit) throws IOException {
"""
<p>createTmpPhpFileFromResource.</p>
@param resourceName a {@link java.lang.String} object.
@param deleteOnExit a boolean.
@return a {@link java.io.File} object.
@throws java.io.IOException if ... | java | public static File createTmpPhpFileFromResource(String resourceName, boolean deleteOnExit) throws IOException {
InputStream is = getInstance().getClass().getResourceAsStream(resourceName);
if (is == null) {
throw new IOException("Unable to find php file " + resourceName);
}
return copyFile(is, deleteOnExit);... | [
"public",
"static",
"File",
"createTmpPhpFileFromResource",
"(",
"String",
"resourceName",
",",
"boolean",
"deleteOnExit",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"getInstance",
"(",
")",
".",
"getClass",
"(",
")",
".",
"getResourceAsStream",
... | <p>createTmpPhpFileFromResource.</p>
@param resourceName a {@link java.lang.String} object.
@param deleteOnExit a boolean.
@return a {@link java.io.File} object.
@throws java.io.IOException if any. | [
"<p",
">",
"createTmpPhpFileFromResource",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/php/src/main/java/com/greenpepper/phpsud/phpDriver/PHPDriverHelper.java#L127-L133 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.mergePublishLists | public CmsPublishList mergePublishLists(CmsRequestContext context, CmsPublishList pubList1, CmsPublishList pubList2)
throws CmsException {
"""
Returns a new publish list that contains all resources of both given publish lists.<p>
@param context the current request context
@param pubList1 the first publish ... | java | public CmsPublishList mergePublishLists(CmsRequestContext context, CmsPublishList pubList1, CmsPublishList pubList2)
throws CmsException {
CmsPublishList ret = null;
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
// get all resources from the first list
... | [
"public",
"CmsPublishList",
"mergePublishLists",
"(",
"CmsRequestContext",
"context",
",",
"CmsPublishList",
"pubList1",
",",
"CmsPublishList",
"pubList2",
")",
"throws",
"CmsException",
"{",
"CmsPublishList",
"ret",
"=",
"null",
";",
"CmsDbContext",
"dbc",
"=",
"m_db... | Returns a new publish list that contains all resources of both given publish lists.<p>
@param context the current request context
@param pubList1 the first publish list
@param pubList2 the second publish list
@return a new publish list that contains all resources of both given publish lists
@throws CmsException if s... | [
"Returns",
"a",
"new",
"publish",
"list",
"that",
"contains",
"all",
"resources",
"of",
"both",
"given",
"publish",
"lists",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3696-L3725 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapDNDController.java | CmsSitemapDNDController.handleDropNewEntry | private void handleDropNewEntry(CmsCreatableListItem createItem, final CmsClientSitemapEntry parent) {
"""
Handles a dropped detail page.<p>
@param createItem the detail page which was dropped into the sitemap
@param parent the parent sitemap entry
"""
final CmsNewResourceInfo typeInfo = createIte... | java | private void handleDropNewEntry(CmsCreatableListItem createItem, final CmsClientSitemapEntry parent) {
final CmsNewResourceInfo typeInfo = createItem.getResourceTypeInfo();
final CmsClientSitemapEntry entry = new CmsClientSitemapEntry();
entry.setNew(true);
entry.setVfsPath(null);
... | [
"private",
"void",
"handleDropNewEntry",
"(",
"CmsCreatableListItem",
"createItem",
",",
"final",
"CmsClientSitemapEntry",
"parent",
")",
"{",
"final",
"CmsNewResourceInfo",
"typeInfo",
"=",
"createItem",
".",
"getResourceTypeInfo",
"(",
")",
";",
"final",
"CmsClientSit... | Handles a dropped detail page.<p>
@param createItem the detail page which was dropped into the sitemap
@param parent the parent sitemap entry | [
"Handles",
"a",
"dropped",
"detail",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapDNDController.java#L309-L377 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/App.java | App.isDeniedExplicitly | final boolean isDeniedExplicitly(String subjectid, String resourcePath, String httpMethod) {
"""
Check if a subject is explicitly denied access to a resource.
@param subjectid subject id
@param resourcePath resource path or object type
@param httpMethod HTTP method name
@return true if access is explicitly den... | java | final boolean isDeniedExplicitly(String subjectid, String resourcePath, String httpMethod) {
if (StringUtils.isBlank(subjectid) || StringUtils.isBlank(resourcePath) ||
StringUtils.isBlank(httpMethod) || getResourcePermissions().isEmpty()) {
return false;
}
// urlDecode resource path
resourcePath = Utils.... | [
"final",
"boolean",
"isDeniedExplicitly",
"(",
"String",
"subjectid",
",",
"String",
"resourcePath",
",",
"String",
"httpMethod",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"subjectid",
")",
"||",
"StringUtils",
".",
"isBlank",
"(",
"resourcePath",... | Check if a subject is explicitly denied access to a resource.
@param subjectid subject id
@param resourcePath resource path or object type
@param httpMethod HTTP method name
@return true if access is explicitly denied | [
"Check",
"if",
"a",
"subject",
"is",
"explicitly",
"denied",
"access",
"to",
"a",
"resource",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L799-L814 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.beginStopAsync | public Observable<Void> beginStopAsync(String groupName, String serviceName) {
"""
Stop service.
The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the s... | java | public Observable<Void> beginStopAsync(String groupName, String serviceName) {
return beginStopWithServiceResponseAsync(groupName, serviceName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body... | [
"public",
"Observable",
"<",
"Void",
">",
"beginStopAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
")",
"{",
"return",
"beginStopWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"Servi... | Stop service.
The services resource is the top-level resource that represents the Data Migration Service. This action stops the service and the service cannot be used for data migration. The service owner won't be billed when the service is stopped.
@param groupName Name of the resource group
@param serviceName Name o... | [
"Stop",
"service",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"This",
"action",
"stops",
"the",
"service",
"and",
"the",
"service",
"cannot",
"be",
"used... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L1290-L1297 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/xml/AnnotationReader.java | AnnotationReader.getAnnotation | @SuppressWarnings("unchecked")
public <A extends Annotation> A getAnnotation(final Class<?> clazz, final Class<A> annClass) throws AnnotationReadException {
"""
Returns a class annotation for the specified type if such an annotation is present, else null.
@param <A> the type of the annotation
@param clazz... | java | @SuppressWarnings("unchecked")
public <A extends Annotation> A getAnnotation(final Class<?> clazz, final Class<A> annClass) throws AnnotationReadException {
if(xmlInfo != null && xmlInfo.containsClassInfo(clazz.getName())) {
final ClassInfo classInfo = xmlInfo.getClassInfo(clazz.getName());
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Class",
"<",
"A",
">",
"annClass",
")",
"throws",
"AnnotationReadExcepti... | Returns a class annotation for the specified type if such an annotation is present, else null.
@param <A> the type of the annotation
@param clazz the target class
@param annClass the Class object corresponding to the annotation type
@return the target class's annotation for the specified annotation type if present on ... | [
"Returns",
"a",
"class",
"annotation",
"for",
"the",
"specified",
"type",
"if",
"such",
"an",
"annotation",
"is",
"present",
"else",
"null",
"."
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/AnnotationReader.java#L89-L105 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2maps/impl/ColumnRef.java | ColumnRef.wildMatch | public static boolean wildMatch(String text, String pattern) {
"""
The following Java method tests if a string matches a wildcard expression
(supporting ? for exactly one character or * for an arbitrary number of characters):
@param text Text to test
@param pattern (Wildcard) pattern to test
@return True ... | java | public static boolean wildMatch(String text, String pattern) {
if (pattern == null) return false;
return text.matches(pattern.replace("?", ".?")
.replace("*", ".*?"));
} | [
"public",
"static",
"boolean",
"wildMatch",
"(",
"String",
"text",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"return",
"false",
";",
"return",
"text",
".",
"matches",
"(",
"pattern",
".",
"replace",
"(",
"\"?\"",
",",
... | The following Java method tests if a string matches a wildcard expression
(supporting ? for exactly one character or * for an arbitrary number of characters):
@param text Text to test
@param pattern (Wildcard) pattern to test
@return True if the text matches the wildcard pattern | [
"The",
"following",
"Java",
"method",
"tests",
"if",
"a",
"string",
"matches",
"a",
"wildcard",
"expression",
"(",
"supporting",
"?",
"for",
"exactly",
"one",
"character",
"or",
"*",
"for",
"an",
"arbitrary",
"number",
"of",
"characters",
")",
":"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2maps/impl/ColumnRef.java#L31-L36 |
structr/structr | structr-ui/src/main/java/org/structr/websocket/command/AbstractCommand.java | AbstractCommand.getRelationship | public AbstractRelationship getRelationship(final String id, final String nodeId) {
"""
Returns the relationship with the given id by looking up a node
with the given nodeId and filtering the relationships.
This avoids the performance issues of getRelationshipById due to missing index support.
If nodeId is ... | java | public AbstractRelationship getRelationship(final String id, final String nodeId) {
if (id == null) {
return null;
}
if (nodeId == null) {
return getRelationship(id);
}
final SecurityContext securityContext = getWebSocket().getSecurityContext();
final App app = StructrApp.getInstance(securityContex... | [
"public",
"AbstractRelationship",
"getRelationship",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"nodeId",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"nodeId",
"==",
"null",
")",
"{",
"return",
"... | Returns the relationship with the given id by looking up a node
with the given nodeId and filtering the relationships.
This avoids the performance issues of getRelationshipById due to missing index support.
If nodeId is null, the method falls back to {@link getRelationship(id)}.
@param id
@param nodeId
@return the ... | [
"Returns",
"the",
"relationship",
"with",
"the",
"given",
"id",
"by",
"looking",
"up",
"a",
"node",
"with",
"the",
"given",
"nodeId",
"and",
"filtering",
"the",
"relationships",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/websocket/command/AbstractCommand.java#L194-L226 |
kiegroup/drools | kie-dmn/kie-dmn-backend/src/main/java/org/kie/dmn/backend/marshalling/v1_1/xstream/XStreamMarshaller.java | XStreamMarshaller.marshalMarshall | @Deprecated
public void marshalMarshall(Object o, OutputStream out) {
"""
Unnecessary as was a tentative UTF-8 preamble output but still not working.
"""
try {
XStream xStream = newXStream();
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".getBytes());
O... | java | @Deprecated
public void marshalMarshall(Object o, OutputStream out) {
try {
XStream xStream = newXStream();
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".getBytes());
OutputStreamWriter ows = new OutputStreamWriter(out, "UTF-8");
xStream.toXML(o, ow... | [
"@",
"Deprecated",
"public",
"void",
"marshalMarshall",
"(",
"Object",
"o",
",",
"OutputStream",
"out",
")",
"{",
"try",
"{",
"XStream",
"xStream",
"=",
"newXStream",
"(",
")",
";",
"out",
".",
"write",
"(",
"\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n... | Unnecessary as was a tentative UTF-8 preamble output but still not working. | [
"Unnecessary",
"as",
"was",
"a",
"tentative",
"UTF",
"-",
"8",
"preamble",
"output",
"but",
"still",
"not",
"working",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-backend/src/main/java/org/kie/dmn/backend/marshalling/v1_1/xstream/XStreamMarshaller.java#L197-L207 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java | CalendarCodeGenerator.addPattern | private void addPattern(MethodSpec.Builder method, String pattern) {
"""
Add a named date-time pattern, adding statements to the formatting and indexing methods.
Returns true if the pattern corresponds to a date; false if a time.
"""
// Parse the pattern and populate the method body with instructions to f... | java | private void addPattern(MethodSpec.Builder method, String pattern) {
// Parse the pattern and populate the method body with instructions to format the date.
for (Node node : DATETIME_PARSER.parse(pattern)) {
if (node instanceof Text) {
method.addStatement("b.append($S)", ((Text)node).text());
... | [
"private",
"void",
"addPattern",
"(",
"MethodSpec",
".",
"Builder",
"method",
",",
"String",
"pattern",
")",
"{",
"// Parse the pattern and populate the method body with instructions to format the date.",
"for",
"(",
"Node",
"node",
":",
"DATETIME_PARSER",
".",
"parse",
"... | Add a named date-time pattern, adding statements to the formatting and indexing methods.
Returns true if the pattern corresponds to a date; false if a time. | [
"Add",
"a",
"named",
"date",
"-",
"time",
"pattern",
"adding",
"statements",
"to",
"the",
"formatting",
"and",
"indexing",
"methods",
".",
"Returns",
"true",
"if",
"the",
"pattern",
"corresponds",
"to",
"a",
"date",
";",
"false",
"if",
"a",
"time",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L297-L307 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildConstantSummary | public void buildConstantSummary(XMLNode node, Content contentTree) throws DocletException {
"""
Build the constant summary.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
@throws DocletException if there is ... | java | public void buildConstantSummary(XMLNode node, Content contentTree) throws DocletException {
contentTree = writer.getHeader();
buildChildren(node, contentTree);
writer.addFooter(contentTree);
writer.printDocument(contentTree);
} | [
"public",
"void",
"buildConstantSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"throws",
"DocletException",
"{",
"contentTree",
"=",
"writer",
".",
"getHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"contentTree",
")",
";",
"... | Build the constant summary.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
@throws DocletException if there is a problem while building the documentation | [
"Build",
"the",
"constant",
"summary",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstantsSummaryBuilder.java#L154-L159 |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexAggregateFuture.java | VortexAggregateFuture.completedTasklets | private void completedTasklets(final TOutput output, final List<Integer> taskletIds)
throws InterruptedException {
"""
Create and queue result for Tasklets that are expected and invoke callback.
"""
final List<TInput> inputs = getInputs(taskletIds);
final AggregateResult result = new AggregateRes... | java | private void completedTasklets(final TOutput output, final List<Integer> taskletIds)
throws InterruptedException {
final List<TInput> inputs = getInputs(taskletIds);
final AggregateResult result = new AggregateResult(output, inputs);
if (callbackHandler != null) {
executor.execute(new Runnable(... | [
"private",
"void",
"completedTasklets",
"(",
"final",
"TOutput",
"output",
",",
"final",
"List",
"<",
"Integer",
">",
"taskletIds",
")",
"throws",
"InterruptedException",
"{",
"final",
"List",
"<",
"TInput",
">",
"inputs",
"=",
"getInputs",
"(",
"taskletIds",
... | Create and queue result for Tasklets that are expected and invoke callback. | [
"Create",
"and",
"queue",
"result",
"for",
"Tasklets",
"that",
"are",
"expected",
"and",
"invoke",
"callback",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexAggregateFuture.java#L173-L188 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagHeadIncludes.java | CmsJspTagHeadIncludes.getSchemaHeadIncludes | private Set<String> getSchemaHeadIncludes(CmsObject cms, CmsResource res, String type) throws CmsLoaderException {
"""
Gets the head includes of a resource from the content definition.<p>
@param cms the current CMS context
@param res the resource for which the head includes should be fetched
@param type the h... | java | private Set<String> getSchemaHeadIncludes(CmsObject cms, CmsResource res, String type) throws CmsLoaderException {
if (type.equals(TYPE_CSS)) {
return getCSSHeadIncludes(cms, res);
} else if (type.equals(TYPE_JAVASCRIPT)) {
return getJSHeadIncludes(cms, res);
}
r... | [
"private",
"Set",
"<",
"String",
">",
"getSchemaHeadIncludes",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
",",
"String",
"type",
")",
"throws",
"CmsLoaderException",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"TYPE_CSS",
")",
")",
"{",
"return",
... | Gets the head includes of a resource from the content definition.<p>
@param cms the current CMS context
@param res the resource for which the head includes should be fetched
@param type the head include type (CSS or Javascript)
@return the set of schema head includes
@throws CmsLoaderException if something goes wron... | [
"Gets",
"the",
"head",
"includes",
"of",
"a",
"resource",
"from",
"the",
"content",
"definition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagHeadIncludes.java#L778-L786 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/result/ResultHierarchy.java | ResultHierarchy.fireResultRemoved | private void fireResultRemoved(Result child, Result parent) {
"""
Informs all registered {@link ResultListener} that a new result has been
removed.
@param child result that has been removed
@param parent Parent result that has been removed
"""
if(LOG.isDebugging()) {
LOG.debug("Result removed: "... | java | private void fireResultRemoved(Result child, Result parent) {
if(LOG.isDebugging()) {
LOG.debug("Result removed: " + child + " <- " + parent);
}
for(int i = listenerList.size(); --i >= 0;) {
listenerList.get(i).resultRemoved(child, parent);
}
} | [
"private",
"void",
"fireResultRemoved",
"(",
"Result",
"child",
",",
"Result",
"parent",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugging",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Result removed: \"",
"+",
"child",
"+",
"\" <- \"",
"+",
"parent",
"... | Informs all registered {@link ResultListener} that a new result has been
removed.
@param child result that has been removed
@param parent Parent result that has been removed | [
"Informs",
"all",
"registered",
"{",
"@link",
"ResultListener",
"}",
"that",
"a",
"new",
"result",
"has",
"been",
"removed",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/result/ResultHierarchy.java#L146-L153 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/UpdateItemRequest.java | UpdateItemRequest.withAttributeUpdates | public UpdateItemRequest withAttributeUpdates(java.util.Map<String, AttributeValueUpdate> attributeUpdates) {
"""
<p>
This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href=
"https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParame... | java | public UpdateItemRequest withAttributeUpdates(java.util.Map<String, AttributeValueUpdate> attributeUpdates) {
setAttributeUpdates(attributeUpdates);
return this;
} | [
"public",
"UpdateItemRequest",
"withAttributeUpdates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValueUpdate",
">",
"attributeUpdates",
")",
"{",
"setAttributeUpdates",
"(",
"attributeUpdates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href=
"https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html"
>AttributeUpdates</a> in the <i>Amazon DynamoDB Developer Guide</i>.
</p>
@param attributeUp... | [
"<p",
">",
"This",
"is",
"a",
"legacy",
"parameter",
".",
"Use",
"<code",
">",
"UpdateExpression<",
"/",
"code",
">",
"instead",
".",
"For",
"more",
"information",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/UpdateItemRequest.java#L724-L727 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/parsers/SEPAParserFactory.java | SEPAParserFactory.get | public static ISEPAParser get(SepaVersion version) {
"""
Gibt den passenden SEPA Parser für die angegebene PAIN-Version.
@param version die PAIN-Version.
@return ISEPAParser
"""
ISEPAParser parser = null;
String className = version.getParserClass();
try {
log.debug("try... | java | public static ISEPAParser get(SepaVersion version) {
ISEPAParser parser = null;
String className = version.getParserClass();
try {
log.debug("trying to init SEPA parser: " + className);
Class cl = Class.forName(className);
parser = (ISEPAParser) cl.newInstanc... | [
"public",
"static",
"ISEPAParser",
"get",
"(",
"SepaVersion",
"version",
")",
"{",
"ISEPAParser",
"parser",
"=",
"null",
";",
"String",
"className",
"=",
"version",
".",
"getParserClass",
"(",
")",
";",
"try",
"{",
"log",
".",
"debug",
"(",
"\"trying to init... | Gibt den passenden SEPA Parser für die angegebene PAIN-Version.
@param version die PAIN-Version.
@return ISEPAParser | [
"Gibt",
"den",
"passenden",
"SEPA",
"Parser",
"für",
"die",
"angegebene",
"PAIN",
"-",
"Version",
"."
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/parsers/SEPAParserFactory.java#L18-L31 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java | ContentSpecProcessor.doesRelationshipMatch | protected boolean doesRelationshipMatch(final TargetRelationship relationship, final CSRelatedNodeWrapper relatedNode) {
"""
Checks to see if a ContentSpec topic relationship matches a Content Spec Entity topic.
@param relationship The ContentSpec topic relationship object.
@param relatedNode The related Cont... | java | protected boolean doesRelationshipMatch(final TargetRelationship relationship, final CSRelatedNodeWrapper relatedNode) {
// If the relationship node is a node that can't be related to (ie a comment or meta data), than the relationship cannot match
if (relatedNode.getNodeType().equals(CommonConstants.CS_... | [
"protected",
"boolean",
"doesRelationshipMatch",
"(",
"final",
"TargetRelationship",
"relationship",
",",
"final",
"CSRelatedNodeWrapper",
"relatedNode",
")",
"{",
"// If the relationship node is a node that can't be related to (ie a comment or meta data), than the relationship cannot matc... | Checks to see if a ContentSpec topic relationship matches a Content Spec Entity topic.
@param relationship The ContentSpec topic relationship object.
@param relatedNode The related Content Spec Entity topic.
@return True if the topic is determined to match otherwise false. | [
"Checks",
"to",
"see",
"if",
"a",
"ContentSpec",
"topic",
"relationship",
"matches",
"a",
"Content",
"Spec",
"Entity",
"topic",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L2216-L2237 |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/IndexedRun.java | IndexedRun.isTouchedByRange | public boolean isTouchedByRange(int globalStartIndex, int globalEndIndex) {
"""
Determines whether the specified range of start and end index touches this run.
"""
return ((startIndex >= globalStartIndex) && (startIndex <= globalEndIndex))
|| ((endIndex >= globalStartIndex) && (endIndex... | java | public boolean isTouchedByRange(int globalStartIndex, int globalEndIndex) {
return ((startIndex >= globalStartIndex) && (startIndex <= globalEndIndex))
|| ((endIndex >= globalStartIndex) && (endIndex <= globalEndIndex))
|| ((startIndex <= globalStartIndex) && (endIndex >= globalE... | [
"public",
"boolean",
"isTouchedByRange",
"(",
"int",
"globalStartIndex",
",",
"int",
"globalEndIndex",
")",
"{",
"return",
"(",
"(",
"startIndex",
">=",
"globalStartIndex",
")",
"&&",
"(",
"startIndex",
"<=",
"globalEndIndex",
")",
")",
"||",
"(",
"(",
"endInd... | Determines whether the specified range of start and end index touches this run. | [
"Determines",
"whether",
"the",
"specified",
"range",
"of",
"start",
"and",
"end",
"index",
"touches",
"this",
"run",
"."
] | train | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/IndexedRun.java#L46-L51 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/matchers/element/gloss/BasicGlossMatcher.java | BasicGlossMatcher.isWordMoreGeneral | public boolean isWordMoreGeneral(String source, String target) throws MatcherLibraryException {
"""
Checks the source is more general than the target or not.
@param source sense of source
@param target sense of target
@return true if the source is more general than target
@throws MatcherLibraryException Matc... | java | public boolean isWordMoreGeneral(String source, String target) throws MatcherLibraryException {
try {
List<ISense> sSenses = linguisticOracle.getSenses(source);
List<ISense> tSenses = linguisticOracle.getSenses(target);
for (ISense sSense : sSenses) {
for... | [
"public",
"boolean",
"isWordMoreGeneral",
"(",
"String",
"source",
",",
"String",
"target",
")",
"throws",
"MatcherLibraryException",
"{",
"try",
"{",
"List",
"<",
"ISense",
">",
"sSenses",
"=",
"linguisticOracle",
".",
"getSenses",
"(",
"source",
")",
";",
"L... | Checks the source is more general than the target or not.
@param source sense of source
@param target sense of target
@return true if the source is more general than target
@throws MatcherLibraryException MatcherLibraryException | [
"Checks",
"the",
"source",
"is",
"more",
"general",
"than",
"the",
"target",
"or",
"not",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/matchers/element/gloss/BasicGlossMatcher.java#L72-L92 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceService.java | BaseTraceService.updateConduitSyncHandlerConnection | private void updateConduitSyncHandlerConnection(List<String> sourceList, SynchronousHandler handler) {
"""
/*
Based on config (sourceList), need to connect the synchronized handler to configured source/conduit..
Or disconnect it.
"""
if (sourceList.contains("message")) {
logConduit.addSyn... | java | private void updateConduitSyncHandlerConnection(List<String> sourceList, SynchronousHandler handler) {
if (sourceList.contains("message")) {
logConduit.addSyncHandler(handler);
} else {
logConduit.removeSyncHandler(handler);
}
if (sourceList.contains("trace")) {
... | [
"private",
"void",
"updateConduitSyncHandlerConnection",
"(",
"List",
"<",
"String",
">",
"sourceList",
",",
"SynchronousHandler",
"handler",
")",
"{",
"if",
"(",
"sourceList",
".",
"contains",
"(",
"\"message\"",
")",
")",
"{",
"logConduit",
".",
"addSyncHandler"... | /*
Based on config (sourceList), need to connect the synchronized handler to configured source/conduit..
Or disconnect it. | [
"/",
"*",
"Based",
"on",
"config",
"(",
"sourceList",
")",
"need",
"to",
"connect",
"the",
"synchronized",
"handler",
"to",
"configured",
"source",
"/",
"conduit",
"..",
"Or",
"disconnect",
"it",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceService.java#L1375-L1387 |
google/closure-templates | java/src/com/google/template/soy/soytree/TagName.java | TagName.checkCloseTagClosesOptional | public static boolean checkCloseTagClosesOptional(TagName closeTag, TagName optionalOpenTag) {
"""
Checks if the an open tag can be auto-closed by a following close tag which does not have the
same tag name as the open tag.
<p>We throws an {@code IllegalArgumentException} if two inputs have the same tag names,... | java | public static boolean checkCloseTagClosesOptional(TagName closeTag, TagName optionalOpenTag) {
// TODO(b/120994894): Replace this with checkArgument() when HtmlTagEntry can be replaced.
if (!optionalOpenTag.isStatic() || !optionalOpenTag.isDefinitelyOptional()) {
return false;
}
if (!closeTag.isSt... | [
"public",
"static",
"boolean",
"checkCloseTagClosesOptional",
"(",
"TagName",
"closeTag",
",",
"TagName",
"optionalOpenTag",
")",
"{",
"// TODO(b/120994894): Replace this with checkArgument() when HtmlTagEntry can be replaced.",
"if",
"(",
"!",
"optionalOpenTag",
".",
"isStatic",... | Checks if the an open tag can be auto-closed by a following close tag which does not have the
same tag name as the open tag.
<p>We throws an {@code IllegalArgumentException} if two inputs have the same tag names, since
this should never happen (should be handled by previous logic in {@code
StrictHtmlValidationPass}).
... | [
"Checks",
"if",
"the",
"an",
"open",
"tag",
"can",
"be",
"auto",
"-",
"closed",
"by",
"a",
"following",
"close",
"tag",
"which",
"does",
"not",
"have",
"the",
"same",
"tag",
"name",
"as",
"the",
"open",
"tag",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/TagName.java#L276-L291 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java | CqlDataReaderDAO.readBatch | private Iterator<Record> readBatch(final DeltaPlacement placement, final Collection<Key> keys, final ReadConsistency consistency) {
"""
Read a batch of keys that all belong to the same placement (ColumnFamily).
"""
checkNotNull(keys, "keys");
// Convert the keys to ByteBuffer Cassandra row key... | java | private Iterator<Record> readBatch(final DeltaPlacement placement, final Collection<Key> keys, final ReadConsistency consistency) {
checkNotNull(keys, "keys");
// Convert the keys to ByteBuffer Cassandra row keys
List<Map.Entry<ByteBuffer, Key>> rowKeys = Lists.newArrayListWithCapacity(keys.siz... | [
"private",
"Iterator",
"<",
"Record",
">",
"readBatch",
"(",
"final",
"DeltaPlacement",
"placement",
",",
"final",
"Collection",
"<",
"Key",
">",
"keys",
",",
"final",
"ReadConsistency",
"consistency",
")",
"{",
"checkNotNull",
"(",
"keys",
",",
"\"keys\"",
")... | Read a batch of keys that all belong to the same placement (ColumnFamily). | [
"Read",
"a",
"batch",
"of",
"keys",
"that",
"all",
"belong",
"to",
"the",
"same",
"placement",
"(",
"ColumnFamily",
")",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java#L335-L367 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/TaskClient.java | TaskClient.pollTask | public Task pollTask(String taskType, String workerId, String domain) {
"""
Perform a poll for a task of a specific task type.
@param taskType The taskType to poll for
@param domain The domain of the task type
@param workerId Name of the client worker. Used for logging.
@return Task waiting to be executed.... | java | public Task pollTask(String taskType, String workerId, String domain) {
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
Preconditions.checkArgument(StringUtils.isNotBlank(domain), "Domain cannot be blank");
Preconditions.checkArgument(StringUtils.isNot... | [
"public",
"Task",
"pollTask",
"(",
"String",
"taskType",
",",
"String",
"workerId",
",",
"String",
"domain",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"taskType",
")",
",",
"\"Task type cannot be blank\"",
")",
... | Perform a poll for a task of a specific task type.
@param taskType The taskType to poll for
@param domain The domain of the task type
@param workerId Name of the client worker. Used for logging.
@return Task waiting to be executed. | [
"Perform",
"a",
"poll",
"for",
"a",
"task",
"of",
"a",
"specific",
"task",
"type",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/TaskClient.java#L121-L130 |
primefaces/primefaces | src/main/java/org/primefaces/renderkit/InputRenderer.java | InputRenderer.renderAccessibilityAttributes | protected void renderAccessibilityAttributes(FacesContext context, UIInput component) throws IOException {
"""
Adds the following accessibility attributes to an HTML DOM element.
<pre>
"aria-required" if the component is required
"aria-invalid" if the component is invalid
"aria-labelledby" if the component has... | java | protected void renderAccessibilityAttributes(FacesContext context, UIInput component) throws IOException {
renderAccessibilityAttributes(context, component, isDisabled(component), isReadOnly(component));
} | [
"protected",
"void",
"renderAccessibilityAttributes",
"(",
"FacesContext",
"context",
",",
"UIInput",
"component",
")",
"throws",
"IOException",
"{",
"renderAccessibilityAttributes",
"(",
"context",
",",
"component",
",",
"isDisabled",
"(",
"component",
")",
",",
"isR... | Adds the following accessibility attributes to an HTML DOM element.
<pre>
"aria-required" if the component is required
"aria-invalid" if the component is invalid
"aria-labelledby" if the component has a labelledby attribute
"disabled" and "aria-disabled" if the component is disabled
"readonly" and "aria-readonly" if th... | [
"Adds",
"the",
"following",
"accessibility",
"attributes",
"to",
"an",
"HTML",
"DOM",
"element",
".",
"<pre",
">",
"aria",
"-",
"required",
"if",
"the",
"component",
"is",
"required",
"aria",
"-",
"invalid",
"if",
"the",
"component",
"is",
"invalid",
"aria",... | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/renderkit/InputRenderer.java#L115-L117 |
antopen/alipay-sdk-java | src/main/java/com/alipay/api/internal/util/XmlUtils.java | XmlUtils.nodeToString | public static String nodeToString(Node node) throws AlipayApiException {
"""
Converts the Node/Document/Element instance to XML payload.
@param node the node/document/element instance to convert
@return the XML payload representing the node/document/element
@throws ApiException problem converting XML to strin... | java | public static String nodeToString(Node node) throws AlipayApiException {
String payload = null;
try {
Transformer tf = TransformerFactory.newInstance().newTransformer();
Properties props = tf.getOutputProperties();
props.setProperty(OutputKeys.INDENT, LOGIC_YES);
... | [
"public",
"static",
"String",
"nodeToString",
"(",
"Node",
"node",
")",
"throws",
"AlipayApiException",
"{",
"String",
"payload",
"=",
"null",
";",
"try",
"{",
"Transformer",
"tf",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
".",
"newTransformer",
... | Converts the Node/Document/Element instance to XML payload.
@param node the node/document/element instance to convert
@return the XML payload representing the node/document/element
@throws ApiException problem converting XML to string | [
"Converts",
"the",
"Node",
"/",
"Document",
"/",
"Element",
"instance",
"to",
"XML",
"payload",
"."
] | train | https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/util/XmlUtils.java#L436-L456 |
skjolber/3d-bin-container-packing | src/main/java/com/github/skjolberg/packing/LargestAreaFitFirstPackager.java | LargestAreaFitFirstPackager.isBetter2D | protected int isBetter2D(Box a, Box b) {
"""
Is box b better than a?
@param a box
@param b box
@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;
}
return Long.compare(b.getFootprint(), a.getFo... | java | protected int isBetter2D(Box a, Box b) {
int compare = Long.compare(a.getVolume(), b.getVolume());
if(compare != 0) {
return compare;
}
return Long.compare(b.getFootprint(), a.getFootprint()); // i.e. smaller i better
} | [
"protected",
"int",
"isBetter2D",
"(",
"Box",
"a",
",",
"Box",
"b",
")",
"{",
"int",
"compare",
"=",
"Long",
".",
"compare",
"(",
"a",
".",
"getVolume",
"(",
")",
",",
"b",
".",
"getVolume",
"(",
")",
")",
";",
"if",
"(",
"compare",
"!=",
"0",
... | Is box b better than a?
@param a box
@param b box
@return -1 if b is better, 0 if equal, 1 if b is better | [
"Is",
"box",
"b",
"better",
"than",
"a?"
] | train | https://github.com/skjolber/3d-bin-container-packing/blob/9609bc7515322b2de2cad0dfb3d2f72607e71aae/src/main/java/com/github/skjolberg/packing/LargestAreaFitFirstPackager.java#L432-L439 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/ContentModeratorManager.java | ContentModeratorManager.authenticate | public static ContentModeratorClient authenticate(AzureRegionBaseUrl baseUrl, String subscriptionKey) {
"""
Initializes an instance of Content Moderator API client.
@param baseUrl sets Supported Azure regions for Content Moderator endpoints.
@param subscriptionKey the Content Moderator API key
@return the Con... | java | public static ContentModeratorClient authenticate(AzureRegionBaseUrl baseUrl, String subscriptionKey) {
return authenticate("https://{baseUrl}/", subscriptionKey)
.withBaseUrl(baseUrl);
} | [
"public",
"static",
"ContentModeratorClient",
"authenticate",
"(",
"AzureRegionBaseUrl",
"baseUrl",
",",
"String",
"subscriptionKey",
")",
"{",
"return",
"authenticate",
"(",
"\"https://{baseUrl}/\"",
",",
"subscriptionKey",
")",
".",
"withBaseUrl",
"(",
"baseUrl",
")",... | Initializes an instance of Content Moderator API client.
@param baseUrl sets Supported Azure regions for Content Moderator endpoints.
@param subscriptionKey the Content Moderator API key
@return the Content Moderator API client | [
"Initializes",
"an",
"instance",
"of",
"Content",
"Moderator",
"API",
"client",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/ContentModeratorManager.java#L31-L34 |
dynjs/dynjs | src/main/java/org/dynjs/runtime/modules/ModuleProvider.java | ModuleProvider.getLocalVar | public static Object getLocalVar(ExecutionContext context, String name) {
"""
A convenience for module providers. Gets a scoped variable from
the provided ExecutionContext
@param context The context to search for name
@param name The name of the variable
@return The value of the variable
"""
Lexica... | java | public static Object getLocalVar(ExecutionContext context, String name) {
LexicalEnvironment localEnv = context.getLexicalEnvironment();
if (localEnv.getRecord().hasBinding(context, name)) {
return localEnv.getRecord().getBindingValue(context, name, false);
}
return null;
... | [
"public",
"static",
"Object",
"getLocalVar",
"(",
"ExecutionContext",
"context",
",",
"String",
"name",
")",
"{",
"LexicalEnvironment",
"localEnv",
"=",
"context",
".",
"getLexicalEnvironment",
"(",
")",
";",
"if",
"(",
"localEnv",
".",
"getRecord",
"(",
")",
... | A convenience for module providers. Gets a scoped variable from
the provided ExecutionContext
@param context The context to search for name
@param name The name of the variable
@return The value of the variable | [
"A",
"convenience",
"for",
"module",
"providers",
".",
"Gets",
"a",
"scoped",
"variable",
"from",
"the",
"provided",
"ExecutionContext"
] | train | https://github.com/dynjs/dynjs/blob/4bc6715eff8768f8cd92c6a167d621bbfc1e1a91/src/main/java/org/dynjs/runtime/modules/ModuleProvider.java#L58-L64 |
qzagarese/hyaline-dto | hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java | Hyaline.dtoFromScratch | public static <T> T dtoFromScratch(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException {
"""
It lets you create a new DTO from scratch. This means that any annotation
for JAXB, Jackson or whatever serialization framework you are using on
your entity T will be ignored. The only annotation-ba... | java | public static <T> T dtoFromScratch(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException {
try {
return createDTO(entity, dtoTemplate, true, proxyClassName);
} catch (CannotInstantiateProxyException | DTODefinitionException e) {
e.printStackTrace();
throw new HyalineException();
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"dtoFromScratch",
"(",
"T",
"entity",
",",
"DTO",
"dtoTemplate",
",",
"String",
"proxyClassName",
")",
"throws",
"HyalineException",
"{",
"try",
"{",
"return",
"createDTO",
"(",
"entity",
",",
"dtoTemplate",
",",
"true... | It lets you create a new DTO from scratch. This means that any annotation
for JAXB, Jackson or whatever serialization framework you are using on
your entity T will be ignored. The only annotation-based configuration
that will be used is the one you are defining in this invocation.
@param <T>
the generic type
@param en... | [
"It",
"lets",
"you",
"create",
"a",
"new",
"DTO",
"from",
"scratch",
".",
"This",
"means",
"that",
"any",
"annotation",
"for",
"JAXB",
"Jackson",
"or",
"whatever",
"serialization",
"framework",
"you",
"are",
"using",
"on",
"your",
"entity",
"T",
"will",
"b... | train | https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L105-L112 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMResources.java | JMResources.setSystemPropertyIfIsNull | public static void setSystemPropertyIfIsNull(String key, Object value) {
"""
Sets system property if is null.
@param key the key
@param value the value
"""
if (!System.getProperties().containsKey(key))
System.setProperty(key, value.toString());
} | java | public static void setSystemPropertyIfIsNull(String key, Object value) {
if (!System.getProperties().containsKey(key))
System.setProperty(key, value.toString());
} | [
"public",
"static",
"void",
"setSystemPropertyIfIsNull",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"System",
".",
"getProperties",
"(",
")",
".",
"containsKey",
"(",
"key",
")",
")",
"System",
".",
"setProperty",
"(",
"key",
... | Sets system property if is null.
@param key the key
@param value the value | [
"Sets",
"system",
"property",
"if",
"is",
"null",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMResources.java#L31-L34 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.onError | @Override
public void onError(ChannelHandlerContext ctx, boolean outbound, Throwable cause) {
"""
Central handler for all exceptions caught during HTTP/2 processing.
"""
Http2Exception embedded = getEmbeddedHttp2Exception(cause);
if (isStreamError(embedded)) {
onStreamError(ctx,... | java | @Override
public void onError(ChannelHandlerContext ctx, boolean outbound, Throwable cause) {
Http2Exception embedded = getEmbeddedHttp2Exception(cause);
if (isStreamError(embedded)) {
onStreamError(ctx, outbound, cause, (StreamException) embedded);
} else if (embedded instanceof... | [
"@",
"Override",
"public",
"void",
"onError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"boolean",
"outbound",
",",
"Throwable",
"cause",
")",
"{",
"Http2Exception",
"embedded",
"=",
"getEmbeddedHttp2Exception",
"(",
"cause",
")",
";",
"if",
"(",
"isStreamError",
... | Central handler for all exceptions caught during HTTP/2 processing. | [
"Central",
"handler",
"for",
"all",
"exceptions",
"caught",
"during",
"HTTP",
"/",
"2",
"processing",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L622-L636 |
netty/netty | codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttDecoder.java | MqttDecoder.decodeVariableHeader | private static Result<?> decodeVariableHeader(ByteBuf buffer, MqttFixedHeader mqttFixedHeader) {
"""
Decodes the variable header (if any)
@param buffer the buffer to decode from
@param mqttFixedHeader MqttFixedHeader of the same message
@return the variable header
"""
switch (mqttFixedHeader.message... | java | private static Result<?> decodeVariableHeader(ByteBuf buffer, MqttFixedHeader mqttFixedHeader) {
switch (mqttFixedHeader.messageType()) {
case CONNECT:
return decodeConnectionVariableHeader(buffer);
case CONNACK:
return decodeConnAckVariableHeader(buffer)... | [
"private",
"static",
"Result",
"<",
"?",
">",
"decodeVariableHeader",
"(",
"ByteBuf",
"buffer",
",",
"MqttFixedHeader",
"mqttFixedHeader",
")",
"{",
"switch",
"(",
"mqttFixedHeader",
".",
"messageType",
"(",
")",
")",
"{",
"case",
"CONNECT",
":",
"return",
"de... | Decodes the variable header (if any)
@param buffer the buffer to decode from
@param mqttFixedHeader MqttFixedHeader of the same message
@return the variable header | [
"Decodes",
"the",
"variable",
"header",
"(",
"if",
"any",
")"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttDecoder.java#L179-L207 |
ixa-ehu/ixa-pipe-tok | src/main/java/eus/ixa/ixa/pipe/tok/Annotate.java | Annotate.tokensToKAF | public static void tokensToKAF(final Reader breader, final KAFDocument kaf)
throws IOException {
"""
Read already tokenized text (one sentence per line) and builds a NAF
document.
@param breader
the reader
@param kaf
the naf document
@throws IOException
if io problems
"""
int noSents = 0;
... | java | public static void tokensToKAF(final Reader breader, final KAFDocument kaf)
throws IOException {
int noSents = 0;
int noParas = 1;
final List<String> sentences = CharStreams.readLines(breader);
for (final String sentence : sentences) {
noSents = noSents + 1;
final String[] tokens = sen... | [
"public",
"static",
"void",
"tokensToKAF",
"(",
"final",
"Reader",
"breader",
",",
"final",
"KAFDocument",
"kaf",
")",
"throws",
"IOException",
"{",
"int",
"noSents",
"=",
"0",
";",
"int",
"noParas",
"=",
"1",
";",
"final",
"List",
"<",
"String",
">",
"s... | Read already tokenized text (one sentence per line) and builds a NAF
document.
@param breader
the reader
@param kaf
the naf document
@throws IOException
if io problems | [
"Read",
"already",
"tokenized",
"text",
"(",
"one",
"sentence",
"per",
"line",
")",
"and",
"builds",
"a",
"NAF",
"document",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-tok/blob/be38651a1267be37764b08acce9ee12a87fb61e7/src/main/java/eus/ixa/ixa/pipe/tok/Annotate.java#L249-L273 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/route/Route.java | Route.CONNECT | public static Route CONNECT(String uriPattern, RouteHandler routeHandler) {
"""
Create an {@code CONNECT} route.
@param uriPattern
@param routeHandler
@return
"""
return new Route(HttpConstants.Method.CONNECT, uriPattern, routeHandler);
} | java | public static Route CONNECT(String uriPattern, RouteHandler routeHandler) {
return new Route(HttpConstants.Method.CONNECT, uriPattern, routeHandler);
} | [
"public",
"static",
"Route",
"CONNECT",
"(",
"String",
"uriPattern",
",",
"RouteHandler",
"routeHandler",
")",
"{",
"return",
"new",
"Route",
"(",
"HttpConstants",
".",
"Method",
".",
"CONNECT",
",",
"uriPattern",
",",
"routeHandler",
")",
";",
"}"
] | Create an {@code CONNECT} route.
@param uriPattern
@param routeHandler
@return | [
"Create",
"an",
"{",
"@code",
"CONNECT",
"}",
"route",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/Route.java#L147-L149 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java | APIKeysInner.getAsync | public Observable<ApplicationInsightsComponentAPIKeyInner> getAsync(String resourceGroupName, String resourceName, String keyId) {
"""
Get the API Key for this key id.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param k... | java | public Observable<ApplicationInsightsComponentAPIKeyInner> getAsync(String resourceGroupName, String resourceName, String keyId) {
return getWithServiceResponseAsync(resourceGroupName, resourceName, keyId).map(new Func1<ServiceResponse<ApplicationInsightsComponentAPIKeyInner>, ApplicationInsightsComponentAPIKey... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentAPIKeyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"keyId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceN... | Get the API Key for this key id.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param keyId The API Key ID. This is unique within a Application Insights component.
@throws IllegalArgumentException thrown if parameters fail the vali... | [
"Get",
"the",
"API",
"Key",
"for",
"this",
"key",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java#L394-L401 |
apache/incubator-gobblin | gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/writer/commands/BaseJdbcBufferedInserter.java | BaseJdbcBufferedInserter.createInsertStatementStr | protected String createInsertStatementStr(String databaseName, String table) {
"""
Populates the placeholders and constructs the prefix of batch insert statement
@param databaseName name of the database
@param table name of the table
@return {@link #INSERT_STATEMENT_PREFIX_FORMAT} with all its resolved placehol... | java | protected String createInsertStatementStr(String databaseName, String table) {
return String.format(INSERT_STATEMENT_PREFIX_FORMAT, databaseName, table, JOINER_ON_COMMA.join(this.columnNames));
} | [
"protected",
"String",
"createInsertStatementStr",
"(",
"String",
"databaseName",
",",
"String",
"table",
")",
"{",
"return",
"String",
".",
"format",
"(",
"INSERT_STATEMENT_PREFIX_FORMAT",
",",
"databaseName",
",",
"table",
",",
"JOINER_ON_COMMA",
".",
"join",
"(",... | Populates the placeholders and constructs the prefix of batch insert statement
@param databaseName name of the database
@param table name of the table
@return {@link #INSERT_STATEMENT_PREFIX_FORMAT} with all its resolved placeholders | [
"Populates",
"the",
"placeholders",
"and",
"constructs",
"the",
"prefix",
"of",
"batch",
"insert",
"statement"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/writer/commands/BaseJdbcBufferedInserter.java#L175-L177 |
Labs64/swid-generator | src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java | ExtendedSwidProcessor.setReleaseId | public ExtendedSwidProcessor setReleaseId(final String releaseId) {
"""
Defines product release identifier (tag: release_id).
@param releaseId
product release identifier
@return a reference to this object.
"""
swidTag.setReleaseId(new Token(releaseId, idGenerator.nextId()));
return this;
... | java | public ExtendedSwidProcessor setReleaseId(final String releaseId) {
swidTag.setReleaseId(new Token(releaseId, idGenerator.nextId()));
return this;
} | [
"public",
"ExtendedSwidProcessor",
"setReleaseId",
"(",
"final",
"String",
"releaseId",
")",
"{",
"swidTag",
".",
"setReleaseId",
"(",
"new",
"Token",
"(",
"releaseId",
",",
"idGenerator",
".",
"nextId",
"(",
")",
")",
")",
";",
"return",
"this",
";",
"}"
] | Defines product release identifier (tag: release_id).
@param releaseId
product release identifier
@return a reference to this object. | [
"Defines",
"product",
"release",
"identifier",
"(",
"tag",
":",
"release_id",
")",
"."
] | train | https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java#L176-L179 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/cemi/CEMILDataEx.java | CEMILDataEx.addAdditionalInfo | public synchronized void addAdditionalInfo(int infoType, byte[] info) {
"""
Adds additional information to the message.
<p>
It replaces additional information of the same type, if any was previously added.
@param infoType type ID of additional information
@param info additional information data
"""
if... | java | public synchronized void addAdditionalInfo(int infoType, byte[] info)
{
if (infoType < 0 || infoType >= ADDINFO_ESC)
throw new KNXIllegalArgumentException("info type out of range [0..254]");
if (!checkAddInfoLength(infoType, info.length))
throw new KNXIllegalArgumentException("wrong info data length, ex... | [
"public",
"synchronized",
"void",
"addAdditionalInfo",
"(",
"int",
"infoType",
",",
"byte",
"[",
"]",
"info",
")",
"{",
"if",
"(",
"infoType",
"<",
"0",
"||",
"infoType",
">=",
"ADDINFO_ESC",
")",
"throw",
"new",
"KNXIllegalArgumentException",
"(",
"\"info typ... | Adds additional information to the message.
<p>
It replaces additional information of the same type, if any was previously added.
@param infoType type ID of additional information
@param info additional information data | [
"Adds",
"additional",
"information",
"to",
"the",
"message",
".",
"<p",
">",
"It",
"replaces",
"additional",
"information",
"of",
"the",
"same",
"type",
"if",
"any",
"was",
"previously",
"added",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/cemi/CEMILDataEx.java#L326-L334 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.listRegionalByResourceGroupForTopicTypeAsync | public Observable<List<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(String resourceGroupName, String location, String topicTypeName) {
"""
List all regional event subscriptions under an Azure subscription and resource group for a topic type.
List all event subscriptions from the given loc... | java | public Observable<List<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(String resourceGroupName, String location, String topicTypeName) {
return listRegionalByResourceGroupForTopicTypeWithServiceResponseAsync(resourceGroupName, location, topicTypeName).map(new Func1<ServiceResponse<List<Ev... | [
"public",
"Observable",
"<",
"List",
"<",
"EventSubscriptionInner",
">",
">",
"listRegionalByResourceGroupForTopicTypeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"location",
",",
"String",
"topicTypeName",
")",
"{",
"return",
"listRegionalByResourceGroupForTo... | List all regional event subscriptions under an Azure subscription and resource group for a topic type.
List all event subscriptions from the given location under a specific Azure subscription and resource group and topic type.
@param resourceGroupName The name of the resource group within the user's subscription.
@par... | [
"List",
"all",
"regional",
"event",
"subscriptions",
"under",
"an",
"Azure",
"subscription",
"and",
"resource",
"group",
"for",
"a",
"topic",
"type",
".",
"List",
"all",
"event",
"subscriptions",
"from",
"the",
"given",
"location",
"under",
"a",
"specific",
"A... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L1492-L1499 |
inkstand-io/scribble | scribble-ldap/src/main/java/io/inkstand/scribble/rules/ldap/Directory.java | Directory.importLdif | public void importLdif(InputStream ldifData) throws IOException {
"""
Imports directory content that is defined in LDIF format and provided as input stream. The method writes the
stream content into a temporary file.
@param ldifData
the ldif data to import as a stream
@throws IOException
if the temporary ... | java | public void importLdif(InputStream ldifData) throws IOException {
final File ldifFile = getOuterRule().newFile("scribble_import.ldif");
try (final Writer writer = new OutputStreamWriter(new FileOutputStream(ldifFile), Charsets.UTF_8)) {
IOUtils.copy(ldifData, writer);
}
fin... | [
"public",
"void",
"importLdif",
"(",
"InputStream",
"ldifData",
")",
"throws",
"IOException",
"{",
"final",
"File",
"ldifFile",
"=",
"getOuterRule",
"(",
")",
".",
"newFile",
"(",
"\"scribble_import.ldif\"",
")",
";",
"try",
"(",
"final",
"Writer",
"writer",
"... | Imports directory content that is defined in LDIF format and provided as input stream. The method writes the
stream content into a temporary file.
@param ldifData
the ldif data to import as a stream
@throws IOException
if the temporary file can not be created | [
"Imports",
"directory",
"content",
"that",
"is",
"defined",
"in",
"LDIF",
"format",
"and",
"provided",
"as",
"input",
"stream",
".",
"The",
"method",
"writes",
"the",
"stream",
"content",
"into",
"a",
"temporary",
"file",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-ldap/src/main/java/io/inkstand/scribble/rules/ldap/Directory.java#L324-L336 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/query/algebra/multibuffer/MultiBufferProductPlan.java | MultiBufferProductPlan.blocksAccessed | @Override
public long blocksAccessed() {
"""
Returns an estimate of the number of block accesses required to execute
the query. The formula is:
<pre>
B(product(p1, p2)) = B(p2) + B(p1) * C(p2)
</pre>
where C(p2) is the number of chunks of p2. The method uses the current
number of available buffers to c... | java | @Override
public long blocksAccessed() {
// this guesses at the # of chunks
int avail = tx.bufferMgr().available();
long size = new MaterializePlan(rhs, tx).blocksAccessed();
long numchunks = size / avail;
return rhs.blocksAccessed() + (lhs.blocksAccessed() * numchunks);
} | [
"@",
"Override",
"public",
"long",
"blocksAccessed",
"(",
")",
"{",
"// this guesses at the # of chunks\r",
"int",
"avail",
"=",
"tx",
".",
"bufferMgr",
"(",
")",
".",
"available",
"(",
")",
";",
"long",
"size",
"=",
"new",
"MaterializePlan",
"(",
"rhs",
","... | Returns an estimate of the number of block accesses required to execute
the query. The formula is:
<pre>
B(product(p1, p2)) = B(p2) + B(p1) * C(p2)
</pre>
where C(p2) is the number of chunks of p2. The method uses the current
number of available buffers to calculate C(p2), and so this value may
differ when the query ... | [
"Returns",
"an",
"estimate",
"of",
"the",
"number",
"of",
"block",
"accesses",
"required",
"to",
"execute",
"the",
"query",
".",
"The",
"formula",
"is",
":"
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/multibuffer/MultiBufferProductPlan.java#L91-L98 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.sendSharedObjectMessage | public void sendSharedObjectMessage(String name, int currentVersion, boolean persistent, Set<ISharedObjectEvent> events) {
"""
Send a shared object message.
@param name
shared object name
@param currentVersion
the current version
@param persistent
toggle
@param events
shared object events
"""
... | java | public void sendSharedObjectMessage(String name, int currentVersion, boolean persistent, Set<ISharedObjectEvent> events) {
// create a new sync message for every client to avoid concurrent access through multiple threads
SharedObjectMessage syncMessage = state.getEncoding() == Encoding.AMF3 ? new Flex... | [
"public",
"void",
"sendSharedObjectMessage",
"(",
"String",
"name",
",",
"int",
"currentVersion",
",",
"boolean",
"persistent",
",",
"Set",
"<",
"ISharedObjectEvent",
">",
"events",
")",
"{",
"// create a new sync message for every client to avoid concurrent access through mu... | Send a shared object message.
@param name
shared object name
@param currentVersion
the current version
@param persistent
toggle
@param events
shared object events | [
"Send",
"a",
"shared",
"object",
"message",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1573-L1587 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getTempDirectory | public synchronized File getTempDirectory() throws IOException {
"""
Returns the temporary directory.
@return the temporary directory
@throws java.io.IOException if any.
"""
if (tempDirectory == null) {
final File baseTemp = new File(getString(Settings.KEYS.TEMP_DIRECTORY, System.getPro... | java | public synchronized File getTempDirectory() throws IOException {
if (tempDirectory == null) {
final File baseTemp = new File(getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir")));
tempDirectory = FileUtils.createTempDirectory(baseTemp);
}
return t... | [
"public",
"synchronized",
"File",
"getTempDirectory",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"tempDirectory",
"==",
"null",
")",
"{",
"final",
"File",
"baseTemp",
"=",
"new",
"File",
"(",
"getString",
"(",
"Settings",
".",
"KEYS",
".",
"TEMP_DIRE... | Returns the temporary directory.
@return the temporary directory
@throws java.io.IOException if any. | [
"Returns",
"the",
"temporary",
"directory",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L912-L918 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.listEventTypes | public List<EventTypeInner> listEventTypes(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) {
"""
List topic event types.
List event types for a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param providerNamesp... | java | public List<EventTypeInner> listEventTypes(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) {
return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"EventTypeInner",
">",
"listEventTypes",
"(",
"String",
"resourceGroupName",
",",
"String",
"providerNamespace",
",",
"String",
"resourceTypeName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listEventTypesWithServiceResponseAsync",
"(",
"... | List topic event types.
List event types for a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param providerNamespace Namespace of the provider of the topic
@param resourceTypeName Name of the topic type
@param resourceName Name of the topic
@throws IllegalArgumentExcep... | [
"List",
"topic",
"event",
"types",
".",
"List",
"event",
"types",
"for",
"a",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L1267-L1269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.