repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_filter_name_rule_POST | public OvhTaskFilter domain_account_accountName_filter_name_rule_POST(String domain, String accountName, String name, String header, OvhDomainFilterOperandEnum operand, String value) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule";
StringBuilder sb = path(qPath,... | java | public OvhTaskFilter domain_account_accountName_filter_name_rule_POST(String domain, String accountName, String name, String header, OvhDomainFilterOperandEnum operand, String value) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule";
StringBuilder sb = path(qPath,... | [
"public",
"OvhTaskFilter",
"domain_account_accountName_filter_name_rule_POST",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"name",
",",
"String",
"header",
",",
"OvhDomainFilterOperandEnum",
"operand",
",",
"String",
"value",
")",
"throws",
"IO... | Create new rule for filter
REST: POST /email/domain/{domain}/account/{accountName}/filter/{name}/rule
@param value [required] Rule parameter of filter
@param operand [required] Rule of filter
@param header [required] Header to be filtered
@param domain [required] Name of your domain name
@param accountName [required] ... | [
"Create",
"new",
"rule",
"for",
"filter"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L703-L712 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java | IndexImage.getIndexedImage | public static BufferedImage getIndexedImage(BufferedImage pImage, int pNumberOfColors, int pHints) {
return getIndexedImage(pImage, pNumberOfColors, null, pHints);
} | java | public static BufferedImage getIndexedImage(BufferedImage pImage, int pNumberOfColors, int pHints) {
return getIndexedImage(pImage, pNumberOfColors, null, pHints);
} | [
"public",
"static",
"BufferedImage",
"getIndexedImage",
"(",
"BufferedImage",
"pImage",
",",
"int",
"pNumberOfColors",
",",
"int",
"pHints",
")",
"{",
"return",
"getIndexedImage",
"(",
"pImage",
",",
"pNumberOfColors",
",",
"null",
",",
"pHints",
")",
";",
"}"
] | Converts the input image (must be {@code TYPE_INT_RGB} or
{@code TYPE_INT_ARGB}) to an indexed image. Generating an adaptive
palette with the given number of colors.
Dithering, transparency and color selection is controlled with the
{@code pHints}parameter.
<p/>
The image returned is a new image, the input image is no... | [
"Converts",
"the",
"input",
"image",
"(",
"must",
"be",
"{",
"@code",
"TYPE_INT_RGB",
"}",
"or",
"{",
"@code",
"TYPE_INT_ARGB",
"}",
")",
"to",
"an",
"indexed",
"image",
".",
"Generating",
"an",
"adaptive",
"palette",
"with",
"the",
"given",
"number",
"of"... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L1092-L1094 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java | JingleSession.createJingleError | public IQ createJingleError(IQ iq, JingleError jingleError) {
IQ errorPacket = null;
if (jingleError != null) {
// TODO This is wrong according to XEP-166 § 10, but this jingle implementation is deprecated anyways
StanzaError.Builder builder = StanzaError.getBuilder(StanzaError.C... | java | public IQ createJingleError(IQ iq, JingleError jingleError) {
IQ errorPacket = null;
if (jingleError != null) {
// TODO This is wrong according to XEP-166 § 10, but this jingle implementation is deprecated anyways
StanzaError.Builder builder = StanzaError.getBuilder(StanzaError.C... | [
"public",
"IQ",
"createJingleError",
"(",
"IQ",
"iq",
",",
"JingleError",
"jingleError",
")",
"{",
"IQ",
"errorPacket",
"=",
"null",
";",
"if",
"(",
"jingleError",
"!=",
"null",
")",
"{",
"// TODO This is wrong according to XEP-166 § 10, but this jingle implementation i... | Complete and send an error. Complete all the null fields in an IQ error
response, using the session information we have or some info from the
incoming packet.
@param iq
The Jingle stanza we are responding to
@param jingleError
the IQ stanza we want to complete and send | [
"Complete",
"and",
"send",
"an",
"error",
".",
"Complete",
"all",
"the",
"null",
"fields",
"in",
"an",
"IQ",
"error",
"response",
"using",
"the",
"session",
"information",
"we",
"have",
"or",
"some",
"info",
"from",
"the",
"incoming",
"packet",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java#L1052-L1068 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java | CacheableWorkspaceDataManager.getCachedItemData | protected ItemData getCachedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
return cache.isEnabled() ? cache.get(parentData.getIdentifier(), name, itemType) : null;
} | java | protected ItemData getCachedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
throws RepositoryException
{
return cache.isEnabled() ? cache.get(parentData.getIdentifier(), name, itemType) : null;
} | [
"protected",
"ItemData",
"getCachedItemData",
"(",
"NodeData",
"parentData",
",",
"QPathEntry",
"name",
",",
"ItemType",
"itemType",
")",
"throws",
"RepositoryException",
"{",
"return",
"cache",
".",
"isEnabled",
"(",
")",
"?",
"cache",
".",
"get",
"(",
"parentD... | Get cached ItemData.
@param parentData
parent
@param name
Item name
@param itemType
item type
@return ItemData
@throws RepositoryException
error | [
"Get",
"cached",
"ItemData",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L1284-L1288 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/BeatFinder.java | BeatFinder.isPacketLongEnough | private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expectedLength + " bytes and got " +
lengt... | java | private boolean isPacketLongEnough(DatagramPacket packet, int expectedLength, String name) {
final int length = packet.getLength();
if (length < expectedLength) {
logger.warn("Ignoring too-short " + name + " packet; expecting " + expectedLength + " bytes and got " +
lengt... | [
"private",
"boolean",
"isPacketLongEnough",
"(",
"DatagramPacket",
"packet",
",",
"int",
"expectedLength",
",",
"String",
"name",
")",
"{",
"final",
"int",
"length",
"=",
"packet",
".",
"getLength",
"(",
")",
";",
"if",
"(",
"length",
"<",
"expectedLength",
... | Helper method to check that we got the right size packet.
@param packet a packet that has been received
@param expectedLength the number of bytes we expect it to contain
@param name the description of the packet in case we need to report issues with the length
@return {@code true} if enough bytes were received to pro... | [
"Helper",
"method",
"to",
"check",
"that",
"we",
"got",
"the",
"right",
"size",
"packet",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/BeatFinder.java#L72-L86 |
jbundle/jbundle | base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/html/HTMLServlet.java | HTMLServlet.addBrowserProperties | public void addBrowserProperties(HttpServletRequest req, PropertyOwner servletTask)
{
String strBrowser = this.getBrowser(req);
String strOS = this.getOS(req);
servletTask.setProperty(DBParams.BROWSER, strBrowser);
servletTask.setProperty(DBParams.OS, strOS);
} | java | public void addBrowserProperties(HttpServletRequest req, PropertyOwner servletTask)
{
String strBrowser = this.getBrowser(req);
String strOS = this.getOS(req);
servletTask.setProperty(DBParams.BROWSER, strBrowser);
servletTask.setProperty(DBParams.OS, strOS);
} | [
"public",
"void",
"addBrowserProperties",
"(",
"HttpServletRequest",
"req",
",",
"PropertyOwner",
"servletTask",
")",
"{",
"String",
"strBrowser",
"=",
"this",
".",
"getBrowser",
"(",
"req",
")",
";",
"String",
"strOS",
"=",
"this",
".",
"getOS",
"(",
"req",
... | Add the browser properties to this servlet task.
@param req
@param servletTask | [
"Add",
"the",
"browser",
"properties",
"to",
"this",
"servlet",
"task",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/html/HTMLServlet.java#L154-L160 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BidiOrder.java | BidiOrder.setLevels | private void setLevels(int start, int limit, byte newLevel) {
for (int i = start; i < limit; ++i) {
resultLevels[i] = newLevel;
}
} | java | private void setLevels(int start, int limit, byte newLevel) {
for (int i = start; i < limit; ++i) {
resultLevels[i] = newLevel;
}
} | [
"private",
"void",
"setLevels",
"(",
"int",
"start",
",",
"int",
"limit",
",",
"byte",
"newLevel",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"limit",
";",
"++",
"i",
")",
"{",
"resultLevels",
"[",
"i",
"]",
"=",
"newLevel",
"... | Set resultLevels from start up to (but not including) limit to newLevel. | [
"Set",
"resultLevels",
"from",
"start",
"up",
"to",
"(",
"but",
"not",
"including",
")",
"limit",
"to",
"newLevel",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BidiOrder.java#L1068-L1072 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java | SQLInLoop.sawOpcode | @Override
public void sawOpcode(int seen) {
if (seen == Const.INVOKEINTERFACE) {
String clsName = getClassConstantOperand();
String methodName = getNameConstantOperand();
if (queryClasses.contains(clsName) && queryMethods.contains(methodName)) {
queryLoca... | java | @Override
public void sawOpcode(int seen) {
if (seen == Const.INVOKEINTERFACE) {
String clsName = getClassConstantOperand();
String methodName = getNameConstantOperand();
if (queryClasses.contains(clsName) && queryMethods.contains(methodName)) {
queryLoca... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"if",
"(",
"seen",
"==",
"Const",
".",
"INVOKEINTERFACE",
")",
"{",
"String",
"clsName",
"=",
"getClassConstantOperand",
"(",
")",
";",
"String",
"methodName",
"=",
"getNameConstan... | implements the visitor to collect positions of queries and loops
@param seen
the opcode of the currently parsed instruction | [
"implements",
"the",
"visitor",
"to",
"collect",
"positions",
"of",
"queries",
"and",
"loops"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java#L107-L123 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/MainApplication.java | MainApplication.retrieveUserProperties | public PropertyOwner retrieveUserProperties(String strRegistrationKey)
{
if ((strRegistrationKey == null) || (strRegistrationKey.length() == 0))
return this; // Use default user properties
UserProperties regKey = (UserProperties)m_htRegistration.get(strRegistrationKey);
if... | java | public PropertyOwner retrieveUserProperties(String strRegistrationKey)
{
if ((strRegistrationKey == null) || (strRegistrationKey.length() == 0))
return this; // Use default user properties
UserProperties regKey = (UserProperties)m_htRegistration.get(strRegistrationKey);
if... | [
"public",
"PropertyOwner",
"retrieveUserProperties",
"(",
"String",
"strRegistrationKey",
")",
"{",
"if",
"(",
"(",
"strRegistrationKey",
"==",
"null",
")",
"||",
"(",
"strRegistrationKey",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"return",
"this",
";",
... | Retrieve/Create a user properties record with this lookup key.
User properties are accessed in two ways.
<br/>First, if you pass a null, you get the default top-level user properties (such
as background color, fonts, etc.).
<br/>Second, if you pass a registration key, you get a property database for that
specific key (... | [
"Retrieve",
"/",
"Create",
"a",
"user",
"properties",
"record",
"with",
"this",
"lookup",
"key",
".",
"User",
"properties",
"are",
"accessed",
"in",
"two",
"ways",
".",
"<br",
"/",
">",
"First",
"if",
"you",
"pass",
"a",
"null",
"you",
"get",
"the",
"d... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/MainApplication.java#L580-L589 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ScriptVars.java | ScriptVars.setGlobalVar | public static void setGlobalVar(String key, String value) {
validateKey(key);
if (value == null) {
globalVars.remove(key);
} else {
validateValueLength(value);
if (globalVars.size() > MAX_GLOBAL_VARS) {
throw new IllegalArgumentException("Maximum number of global variables reached: " + MAX_GLOBAL_VA... | java | public static void setGlobalVar(String key, String value) {
validateKey(key);
if (value == null) {
globalVars.remove(key);
} else {
validateValueLength(value);
if (globalVars.size() > MAX_GLOBAL_VARS) {
throw new IllegalArgumentException("Maximum number of global variables reached: " + MAX_GLOBAL_VA... | [
"public",
"static",
"void",
"setGlobalVar",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"validateKey",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"globalVars",
".",
"remove",
"(",
"key",
")",
";",
"}",
"else",
"{",
... | Sets or removes a global variable.
<p>
The variable is removed when the {@code value} is {@code null}.
@param key the key of the variable.
@param value the value of the variable.
@throws IllegalArgumentException if one of the following conditions is met:
<ul>
<li>The {@code key} is {@code null} or its length is higher... | [
"Sets",
"or",
"removes",
"a",
"global",
"variable",
".",
"<p",
">",
"The",
"variable",
"is",
"removed",
"when",
"the",
"{",
"@code",
"value",
"}",
"is",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ScriptVars.java#L79-L91 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/resource/PathResourceManager.java | PathResourceManager.getSymlinkBase | private SymlinkResult getSymlinkBase(final String base, final Path file) throws IOException {
int nameCount = file.getNameCount();
Path root = fileSystem.getPath(base);
int rootCount = root.getNameCount();
Path f = file;
for (int i = nameCount - 1; i>=0; i--) {
if (Fi... | java | private SymlinkResult getSymlinkBase(final String base, final Path file) throws IOException {
int nameCount = file.getNameCount();
Path root = fileSystem.getPath(base);
int rootCount = root.getNameCount();
Path f = file;
for (int i = nameCount - 1; i>=0; i--) {
if (Fi... | [
"private",
"SymlinkResult",
"getSymlinkBase",
"(",
"final",
"String",
"base",
",",
"final",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"int",
"nameCount",
"=",
"file",
".",
"getNameCount",
"(",
")",
";",
"Path",
"root",
"=",
"fileSystem",
".",
"getPa... | Returns true is some element of path inside base path is a symlink. | [
"Returns",
"true",
"is",
"some",
"element",
"of",
"path",
"inside",
"base",
"path",
"is",
"a",
"symlink",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/resource/PathResourceManager.java#L300-L313 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java | ProcessGroovyMethods.consumeProcessOutput | public static void consumeProcessOutput(Process self, OutputStream output, OutputStream error) {
consumeProcessOutputStream(self, output);
consumeProcessErrorStream(self, error);
} | java | public static void consumeProcessOutput(Process self, OutputStream output, OutputStream error) {
consumeProcessOutputStream(self, output);
consumeProcessErrorStream(self, error);
} | [
"public",
"static",
"void",
"consumeProcessOutput",
"(",
"Process",
"self",
",",
"OutputStream",
"output",
",",
"OutputStream",
"error",
")",
"{",
"consumeProcessOutputStream",
"(",
"self",
",",
"output",
")",
";",
"consumeProcessErrorStream",
"(",
"self",
",",
"e... | Gets the output and error streams from a process and reads them
to keep the process from blocking due to a full output buffer.
The processed stream data is appended to the supplied OutputStream.
For this, two Threads are started, so this method will return immediately.
The threads will not be join()ed, even if waitFor(... | [
"Gets",
"the",
"output",
"and",
"error",
"streams",
"from",
"a",
"process",
"and",
"reads",
"them",
"to",
"keep",
"the",
"process",
"from",
"blocking",
"due",
"to",
"a",
"full",
"output",
"buffer",
".",
"The",
"processed",
"stream",
"data",
"is",
"appended... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L205-L208 |
xwiki/xwiki-rendering | xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/WikiPageUtil.java | WikiPageUtil.isValidXmlNameStartChar | public static boolean isValidXmlNameStartChar(char ch, boolean colonEnabled)
{
if (ch == ':') {
return colonEnabled;
}
return (ch >= 'A' && ch <= 'Z')
|| ch == '_'
|| (ch >= 'a' && ch <= 'z')
|| (ch >= 0xC0 && ch <= 0xD6)
|| (ch >= ... | java | public static boolean isValidXmlNameStartChar(char ch, boolean colonEnabled)
{
if (ch == ':') {
return colonEnabled;
}
return (ch >= 'A' && ch <= 'Z')
|| ch == '_'
|| (ch >= 'a' && ch <= 'z')
|| (ch >= 0xC0 && ch <= 0xD6)
|| (ch >= ... | [
"public",
"static",
"boolean",
"isValidXmlNameStartChar",
"(",
"char",
"ch",
",",
"boolean",
"colonEnabled",
")",
"{",
"if",
"(",
"ch",
"==",
"'",
"'",
")",
"{",
"return",
"colonEnabled",
";",
"}",
"return",
"(",
"ch",
">=",
"'",
"'",
"&&",
"ch",
"<=",... | Returns <code>true</code> if the given value is a valid first character
of an XML name.
<p>
See http://www.w3.org/TR/xml/#NT-NameStartChar.
</p>
@param ch the character to check
@param colonEnabled if this flag is <code>true</code> then this method
accepts the ':' symbol.
@return <code>true</code> if the given value i... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"value",
"is",
"a",
"valid",
"first",
"character",
"of",
"an",
"XML",
"name",
".",
"<p",
">",
"See",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"xml",... | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/WikiPageUtil.java#L291-L311 |
Jacksgong/JKeyboardPanelSwitch | library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java | KPSwitchConflictUtil.switchPanelAndKeyboard | public static boolean switchPanelAndKeyboard(final View panelLayout, final View focusView) {
boolean switchToPanel = panelLayout.getVisibility() != View.VISIBLE;
if (!switchToPanel) {
showKeyboard(panelLayout, focusView);
} else {
showPanel(panelLayout);
}
... | java | public static boolean switchPanelAndKeyboard(final View panelLayout, final View focusView) {
boolean switchToPanel = panelLayout.getVisibility() != View.VISIBLE;
if (!switchToPanel) {
showKeyboard(panelLayout, focusView);
} else {
showPanel(panelLayout);
}
... | [
"public",
"static",
"boolean",
"switchPanelAndKeyboard",
"(",
"final",
"View",
"panelLayout",
",",
"final",
"View",
"focusView",
")",
"{",
"boolean",
"switchToPanel",
"=",
"panelLayout",
".",
"getVisibility",
"(",
")",
"!=",
"View",
".",
"VISIBLE",
";",
"if",
... | If the keyboard is showing, then going to show the {@code panelLayout},
and hide the keyboard with non-layout-conflict.
<p/>
If the panel is showing, then going to show the keyboard,
and hide the {@code panelLayout} with non-layout-conflict.
<p/>
If the panel and the keyboard are both hiding. then going to show the {@c... | [
"If",
"the",
"keyboard",
"is",
"showing",
"then",
"going",
"to",
"show",
"the",
"{",
"@code",
"panelLayout",
"}",
"and",
"hide",
"the",
"keyboard",
"with",
"non",
"-",
"layout",
"-",
"conflict",
".",
"<p",
"/",
">",
"If",
"the",
"panel",
"is",
"showing... | train | https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/092128023e824c85da63540780c79088b37a0c74/library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java#L227-L236 |
google/flogger | api/src/main/java/com/google/common/flogger/backend/Platform.java | Platform.shouldForceLogging | public static boolean shouldForceLogging(String loggerName, Level level, boolean isEnabled) {
return LazyHolder.INSTANCE.shouldForceLoggingImpl(loggerName, level, isEnabled);
} | java | public static boolean shouldForceLogging(String loggerName, Level level, boolean isEnabled) {
return LazyHolder.INSTANCE.shouldForceLoggingImpl(loggerName, level, isEnabled);
} | [
"public",
"static",
"boolean",
"shouldForceLogging",
"(",
"String",
"loggerName",
",",
"Level",
"level",
",",
"boolean",
"isEnabled",
")",
"{",
"return",
"LazyHolder",
".",
"INSTANCE",
".",
"shouldForceLoggingImpl",
"(",
"loggerName",
",",
"level",
",",
"isEnabled... | Returns whether the given logger should have logging forced at the specified level. When
logging is forced for a log statement it will be emitted regardless or the normal log level
configuration of the logger and ignoring any rate limiting or other filtering.
<p>
This method is intended to be invoked unconditionally fr... | [
"Returns",
"whether",
"the",
"given",
"logger",
"should",
"have",
"logging",
"forced",
"at",
"the",
"specified",
"level",
".",
"When",
"logging",
"is",
"forced",
"for",
"a",
"log",
"statement",
"it",
"will",
"be",
"emitted",
"regardless",
"or",
"the",
"norma... | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/Platform.java#L175-L177 |
stephanenicolas/toothpick | toothpick-runtime/src/main/java/toothpick/ScopeImpl.java | ScopeImpl.installUnBoundProvider | private <T> InternalProviderImpl<? extends T> installUnBoundProvider(Class<T> clazz, String bindingName,
InternalProviderImpl<? extends T> internalProvider) {
return installInternalProvider(clazz, bindingName, internalProvider, false, false);
} | java | private <T> InternalProviderImpl<? extends T> installUnBoundProvider(Class<T> clazz, String bindingName,
InternalProviderImpl<? extends T> internalProvider) {
return installInternalProvider(clazz, bindingName, internalProvider, false, false);
} | [
"private",
"<",
"T",
">",
"InternalProviderImpl",
"<",
"?",
"extends",
"T",
">",
"installUnBoundProvider",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"bindingName",
",",
"InternalProviderImpl",
"<",
"?",
"extends",
"T",
">",
"internalProvider",
")",
... | Install the provider of the class {@code clazz} and name {@code bindingName}
in the pool of unbound providers.
@param clazz the class for which to install the provider.
@param bindingName the name, possibly {@code null}, for which to install the scoped provider.
@param internalProvider the internal provider to install... | [
"Install",
"the",
"provider",
"of",
"the",
"class",
"{",
"@code",
"clazz",
"}",
"and",
"name",
"{",
"@code",
"bindingName",
"}",
"in",
"the",
"pool",
"of",
"unbound",
"providers",
"."
] | train | https://github.com/stephanenicolas/toothpick/blob/54476ca9a5fa48809c15a46e43e38db9ed7e1a75/toothpick-runtime/src/main/java/toothpick/ScopeImpl.java#L459-L462 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Finder.java | Finder.find | public MultiPos<String, String, String> find() {
return new MultiPos<String, String, String>(null, null) {
@Override protected String result() {
return findingReplacing(EMPTY, 'L', pos, position);
}
};
} | java | public MultiPos<String, String, String> find() {
return new MultiPos<String, String, String>(null, null) {
@Override protected String result() {
return findingReplacing(EMPTY, 'L', pos, position);
}
};
} | [
"public",
"MultiPos",
"<",
"String",
",",
"String",
",",
"String",
">",
"find",
"(",
")",
"{",
"return",
"new",
"MultiPos",
"<",
"String",
",",
"String",
",",
"String",
">",
"(",
"null",
",",
"null",
")",
"{",
"@",
"Override",
"protected",
"String",
... | Returns a NegateMultiPos instance with all lookup results
@return | [
"Returns",
"a",
"NegateMultiPos",
"instance",
"with",
"all",
"lookup",
"results"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Finder.java#L90-L97 |
crawljax/crawljax | core/src/main/java/com/crawljax/util/DomUtils.java | DomUtils.getTextContent | public static String getTextContent(Document document, boolean individualTokens) {
String textContent = null;
if (individualTokens) {
List<String> tokens = getTextTokens(document);
textContent = StringUtils.join(tokens, ",");
} else {
textContent =
... | java | public static String getTextContent(Document document, boolean individualTokens) {
String textContent = null;
if (individualTokens) {
List<String> tokens = getTextTokens(document);
textContent = StringUtils.join(tokens, ",");
} else {
textContent =
... | [
"public",
"static",
"String",
"getTextContent",
"(",
"Document",
"document",
",",
"boolean",
"individualTokens",
")",
"{",
"String",
"textContent",
"=",
"null",
";",
"if",
"(",
"individualTokens",
")",
"{",
"List",
"<",
"String",
">",
"tokens",
"=",
"getTextTo... | To get all the textual content in the dom
@param document
@param individualTokens : default True : when set to true, each text node from dom is used to build the
text content : when set to false, the text content of whole is obtained at once.
@return | [
"To",
"get",
"all",
"the",
"textual",
"content",
"in",
"the",
"dom"
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/util/DomUtils.java#L511-L521 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java | AttributeDefinition.marshallAsElement | public void marshallAsElement(final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException {
if (getMarshaller().isMarshallableAsElement()) {
getMarshaller().marshallAsElement(this, resourceModel, marshallDefault, writer);
} else {
... | java | public void marshallAsElement(final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException {
if (getMarshaller().isMarshallableAsElement()) {
getMarshaller().marshallAsElement(this, resourceModel, marshallDefault, writer);
} else {
... | [
"public",
"void",
"marshallAsElement",
"(",
"final",
"ModelNode",
"resourceModel",
",",
"final",
"boolean",
"marshallDefault",
",",
"final",
"XMLStreamWriter",
"writer",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"getMarshaller",
"(",
")",
".",
"isMarshall... | Marshalls the value from the given {@code resourceModel} as an xml element, if it
{@link #isMarshallable(org.jboss.dmr.ModelNode, boolean) is marshallable}.
@param resourceModel the model, a non-null node of {@link org.jboss.dmr.ModelType#OBJECT}.
@param marshallDefault {@code true} if the value should be marshalled... | [
"Marshalls",
"the",
"value",
"from",
"the",
"given",
"{",
"@code",
"resourceModel",
"}",
"as",
"an",
"xml",
"element",
"if",
"it",
"{",
"@link",
"#isMarshallable",
"(",
"org",
".",
"jboss",
".",
"dmr",
".",
"ModelNode",
"boolean",
")",
"is",
"marshallable"... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L756-L762 |
undertow-io/undertow | core/src/main/java/io/undertow/protocols/http2/Http2StreamSourceChannel.java | Http2StreamSourceChannel.updateContentSize | void updateContentSize(long frameLength, boolean last) {
if(contentLengthRemaining != -1) {
contentLengthRemaining -= frameLength;
if(contentLengthRemaining < 0) {
UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length exceeds content size", strea... | java | void updateContentSize(long frameLength, boolean last) {
if(contentLengthRemaining != -1) {
contentLengthRemaining -= frameLength;
if(contentLengthRemaining < 0) {
UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length exceeds content size", strea... | [
"void",
"updateContentSize",
"(",
"long",
"frameLength",
",",
"boolean",
"last",
")",
"{",
"if",
"(",
"contentLengthRemaining",
"!=",
"-",
"1",
")",
"{",
"contentLengthRemaining",
"-=",
"frameLength",
";",
"if",
"(",
"contentLengthRemaining",
"<",
"0",
")",
"{... | Checks that the actual content size matches the expected. We check this proactivly, rather than as the data is read
@param frameLength The amount of data in the frame
@param last If this is the last frame | [
"Checks",
"that",
"the",
"actual",
"content",
"size",
"matches",
"the",
"expected",
".",
"We",
"check",
"this",
"proactivly",
"rather",
"than",
"as",
"the",
"data",
"is",
"read"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/protocols/http2/Http2StreamSourceChannel.java#L277-L288 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.getLogs | public JSONObject getLogs(int offset, int length, LogType logType) throws AlgoliaException {
return this.getLogs(offset, length, logType, RequestOptions.empty);
} | java | public JSONObject getLogs(int offset, int length, LogType logType) throws AlgoliaException {
return this.getLogs(offset, length, logType, RequestOptions.empty);
} | [
"public",
"JSONObject",
"getLogs",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"LogType",
"logType",
")",
"throws",
"AlgoliaException",
"{",
"return",
"this",
".",
"getLogs",
"(",
"offset",
",",
"length",
",",
"logType",
",",
"RequestOptions",
".",
"emp... | Return last logs entries.
@param offset Specify the first entry to retrieve (0-based, 0 is the most recent log entry).
@param length Specify the maximum number of entries to retrieve starting at offset. Maximum allowed value: 1000.
@param logType Specify the type of log to retrieve | [
"Return",
"last",
"logs",
"entries",
"."
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L472-L474 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.getListAttribute | public List<String> getListAttribute(String section, String name) {
return split(getAttribute(section, name));
} | java | public List<String> getListAttribute(String section, String name) {
return split(getAttribute(section, name));
} | [
"public",
"List",
"<",
"String",
">",
"getListAttribute",
"(",
"String",
"section",
",",
"String",
"name",
")",
"{",
"return",
"split",
"(",
"getAttribute",
"(",
"section",
",",
"name",
")",
")",
";",
"}"
] | Returns an attribute's list value from a non-main section of this JAR's manifest.
The attributes string value will be split on whitespace into the returned list.
The returned list may be safely modified.
@param section the manifest's section
@param name the attribute's name | [
"Returns",
"an",
"attribute",
"s",
"list",
"value",
"from",
"a",
"non",
"-",
"main",
"section",
"of",
"this",
"JAR",
"s",
"manifest",
".",
"The",
"attributes",
"string",
"value",
"will",
"be",
"split",
"on",
"whitespace",
"into",
"the",
"returned",
"list",... | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L258-L260 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java | LocalDateTime.plusDays | public LocalDateTime plusDays(long days) {
LocalDate newDate = date.plusDays(days);
return with(newDate, time);
} | java | public LocalDateTime plusDays(long days) {
LocalDate newDate = date.plusDays(days);
return with(newDate, time);
} | [
"public",
"LocalDateTime",
"plusDays",
"(",
"long",
"days",
")",
"{",
"LocalDate",
"newDate",
"=",
"date",
".",
"plusDays",
"(",
"days",
")",
";",
"return",
"with",
"(",
"newDate",
",",
"time",
")",
";",
"}"
] | Returns a copy of this {@code LocalDateTime} with the specified number of days added.
<p>
This method adds the specified amount to the days field incrementing the
month and year fields as necessary to ensure the result remains valid.
The result is only invalid if the maximum/minimum year is exceeded.
<p>
For example, 2... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDateTime",
"}",
"with",
"the",
"specified",
"number",
"of",
"days",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"to",
"the",
"days",
"field",
"incrementing",
"th... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java#L1279-L1282 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getRelevantAtomContainer | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IAtom atom) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | java | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IAtom atom) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | [
"public",
"static",
"IAtomContainer",
"getRelevantAtomContainer",
"(",
"IChemModel",
"chemModel",
",",
"IAtom",
"atom",
")",
"{",
"IAtomContainer",
"result",
"=",
"null",
";",
"if",
"(",
"chemModel",
".",
"getMoleculeSet",
"(",
")",
"!=",
"null",
")",
"{",
"IA... | This badly named methods tries to determine which AtomContainer in the
ChemModel is best suited to contain added Atom's and Bond's. | [
"This",
"badly",
"named",
"methods",
"tries",
"to",
"determine",
"which",
"AtomContainer",
"in",
"the",
"ChemModel",
"is",
"best",
"suited",
"to",
"contain",
"added",
"Atom",
"s",
"and",
"Bond",
"s",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L200-L220 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Image.java | Image.drawEmbedded | public void drawEmbedded(float x, float y, float x2, float y2, float srcx, float srcy, float srcx2, float srcy2, Color filter) {
if (filter != null) {
filter.bind();
}
float mywidth = x2 - x;
float myheight = y2 - y;
float texwidth = srcx2 - srcx;
float texheight = srcy2 - srcy;
float new... | java | public void drawEmbedded(float x, float y, float x2, float y2, float srcx, float srcy, float srcx2, float srcy2, Color filter) {
if (filter != null) {
filter.bind();
}
float mywidth = x2 - x;
float myheight = y2 - y;
float texwidth = srcx2 - srcx;
float texheight = srcy2 - srcy;
float new... | [
"public",
"void",
"drawEmbedded",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"x2",
",",
"float",
"y2",
",",
"float",
"srcx",
",",
"float",
"srcy",
",",
"float",
"srcx2",
",",
"float",
"srcy2",
",",
"Color",
"filter",
")",
"{",
"if",
"(",
"... | Draw a section of this image at a particular location and scale on the screen, while this
is image is "in use", i.e. between calls to startUse and endUse.
@param x The x position to draw the image
@param y The y position to draw the image
@param x2 The x position of the bottom right corner of the drawn image
@param y2... | [
"Draw",
"a",
"section",
"of",
"this",
"image",
"at",
"a",
"particular",
"location",
"and",
"scale",
"on",
"the",
"screen",
"while",
"this",
"is",
"image",
"is",
"in",
"use",
"i",
".",
"e",
".",
"between",
"calls",
"to",
"startUse",
"and",
"endUse",
"."... | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L1094-L1124 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java | ImageIOGreyScale.getImageWritersByMIMEType | public static Iterator<ImageWriter> getImageWritersByMIMEType(String MIMEType) {
if (MIMEType == null) {
throw new IllegalArgumentException("MIMEType == null!");
}
Iterator iter;
// Ensure category is present
try {
iter = theRegistry.getServiceProviders(ImageWriterSpi.class, new ContainsFilter(wr... | java | public static Iterator<ImageWriter> getImageWritersByMIMEType(String MIMEType) {
if (MIMEType == null) {
throw new IllegalArgumentException("MIMEType == null!");
}
Iterator iter;
// Ensure category is present
try {
iter = theRegistry.getServiceProviders(ImageWriterSpi.class, new ContainsFilter(wr... | [
"public",
"static",
"Iterator",
"<",
"ImageWriter",
">",
"getImageWritersByMIMEType",
"(",
"String",
"MIMEType",
")",
"{",
"if",
"(",
"MIMEType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"MIMEType == null!\"",
")",
";",
"}",
"It... | Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that
claim to be able to encode files with the given MIME type.
@param MIMEType
a <code>String</code> containing a file suffix (<i>e.g.</i>, "image/jpeg" or "image/x-bmp").
@return an <code>Iterator</code> containing <code>... | [
"Returns",
"an",
"<code",
">",
"Iterator<",
"/",
"code",
">",
"containing",
"all",
"currently",
"registered",
"<code",
">",
"ImageWriter<",
"/",
"code",
">",
"s",
"that",
"claim",
"to",
"be",
"able",
"to",
"encode",
"files",
"with",
"the",
"given",
"MIME",... | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java#L837-L849 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_hunting_agent_agentId_GET | public OvhOvhPabxHuntingAgent billingAccount_ovhPabx_serviceName_hunting_agent_agentId_GET(String billingAccount, String serviceName, Long agentId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/agent/{agentId}";
StringBuilder sb = path(qPath, billingAccount, serviceN... | java | public OvhOvhPabxHuntingAgent billingAccount_ovhPabx_serviceName_hunting_agent_agentId_GET(String billingAccount, String serviceName, Long agentId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/agent/{agentId}";
StringBuilder sb = path(qPath, billingAccount, serviceN... | [
"public",
"OvhOvhPabxHuntingAgent",
"billingAccount_ovhPabx_serviceName_hunting_agent_agentId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"agentId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/o... | Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/agent/{agentId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param agentId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L6395-L6400 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/Router.java | Router.getControllerPath | protected ControllerPath getControllerPath(String uri) {
boolean rootPath = uri.equals("/");
boolean useRootController = rootPath && rootControllerName != null;
if (useRootController) {
return new ControllerPath(rootControllerName);
} else if (rootControllerName == null && ... | java | protected ControllerPath getControllerPath(String uri) {
boolean rootPath = uri.equals("/");
boolean useRootController = rootPath && rootControllerName != null;
if (useRootController) {
return new ControllerPath(rootControllerName);
} else if (rootControllerName == null && ... | [
"protected",
"ControllerPath",
"getControllerPath",
"(",
"String",
"uri",
")",
"{",
"boolean",
"rootPath",
"=",
"uri",
".",
"equals",
"(",
"\"/\"",
")",
";",
"boolean",
"useRootController",
"=",
"rootPath",
"&&",
"rootControllerName",
"!=",
"null",
";",
"if",
... | Finds a controller path from URI. Controller path includes a package prefix taken from URI, similar to:
<p/>
<code>http://host/context/admin/printers/show/1</code>, where "admin" is a "package_suffix", "printers" is a
"controller_name".
<p/>
for example above, the method will Map with two keys: "package_suffix" and "co... | [
"Finds",
"a",
"controller",
"path",
"from",
"URI",
".",
"Controller",
"path",
"includes",
"a",
"package",
"prefix",
"taken",
"from",
"URI",
"similar",
"to",
":",
"<p",
"/",
">",
"<code",
">",
"http",
":",
"//",
"host",
"/",
"context",
"/",
"admin",
"/"... | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/Router.java#L327-L346 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/BulkLoadFromJdbcRaw.java | BulkLoadFromJdbcRaw.populateTitle | public void populateTitle(ResultSet row, ObjectNode t) throws SQLException {
t.put("employeeId", row.getInt("emp_no"));
t.put("title", row.getString("title"));
Calendar fromDate = Calendar.getInstance();
fromDate.setTime(row.getDate("from_date"));
t.put("fromDate", dateFormat.format(fromDate.getTime... | java | public void populateTitle(ResultSet row, ObjectNode t) throws SQLException {
t.put("employeeId", row.getInt("emp_no"));
t.put("title", row.getString("title"));
Calendar fromDate = Calendar.getInstance();
fromDate.setTime(row.getDate("from_date"));
t.put("fromDate", dateFormat.format(fromDate.getTime... | [
"public",
"void",
"populateTitle",
"(",
"ResultSet",
"row",
",",
"ObjectNode",
"t",
")",
"throws",
"SQLException",
"{",
"t",
".",
"put",
"(",
"\"employeeId\"",
",",
"row",
".",
"getInt",
"(",
"\"emp_no\"",
")",
")",
";",
"t",
".",
"put",
"(",
"\"title\""... | take data from a JDBC ResultSet (row) and populate an ObjectNode (JSON) object | [
"take",
"data",
"from",
"a",
"JDBC",
"ResultSet",
"(",
"row",
")",
"and",
"populate",
"an",
"ObjectNode",
"(",
"JSON",
")",
"object"
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/datamovement/BulkLoadFromJdbcRaw.java#L125-L134 |
apache/groovy | src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java | ClassNodeResolver.tryAsScript | private static LookupResult tryAsScript(String name, CompilationUnit compilationUnit, ClassNode oldClass) {
LookupResult lr = null;
if (oldClass!=null) {
lr = new LookupResult(null, oldClass);
}
if (name.startsWith("java.")) return lr;
//TODO: don't ignore in... | java | private static LookupResult tryAsScript(String name, CompilationUnit compilationUnit, ClassNode oldClass) {
LookupResult lr = null;
if (oldClass!=null) {
lr = new LookupResult(null, oldClass);
}
if (name.startsWith("java.")) return lr;
//TODO: don't ignore in... | [
"private",
"static",
"LookupResult",
"tryAsScript",
"(",
"String",
"name",
",",
"CompilationUnit",
"compilationUnit",
",",
"ClassNode",
"oldClass",
")",
"{",
"LookupResult",
"lr",
"=",
"null",
";",
"if",
"(",
"oldClass",
"!=",
"null",
")",
"{",
"lr",
"=",
"n... | try to find a script using the compilation unit class loader. | [
"try",
"to",
"find",
"a",
"script",
"using",
"the",
"compilation",
"unit",
"class",
"loader",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L279-L302 |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/base/ValueValidator.java | ValueValidator.checkAndGet | public static <T> T checkAndGet(T value, T defaultValue, Validator<T> v) {
if (v.validate(value)) {
return value;
}
return defaultValue;
} | java | public static <T> T checkAndGet(T value, T defaultValue, Validator<T> v) {
if (v.validate(value)) {
return value;
}
return defaultValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkAndGet",
"(",
"T",
"value",
",",
"T",
"defaultValue",
",",
"Validator",
"<",
"T",
">",
"v",
")",
"{",
"if",
"(",
"v",
".",
"validate",
"(",
"value",
")",
")",
"{",
"return",
"value",
";",
"}",
"return... | 对目标值进行校验,并根据校验结果取值
使用示例(校验目标值是否大于0, 如果小于 0 则取值为 1)
ValueValidator.checkAndGet(idleTime, 1, Validator.INTEGER_GT_ZERO_VALIDATOR)
@param value 校验值
@param defaultValue 校验失败默认值
@param v 校验器
@return 经Validator校验后的返回值,校验成功返回 value, 校验失败返回 defaultValue | [
"对目标值进行校验,并根据校验结果取值"
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/base/ValueValidator.java#L30-L36 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/PresenceSubscriber.java | PresenceSubscriber.refreshBuddy | public boolean refreshBuddy(Request req, long timeout) {
if (parent.getBuddyList().get(targetUri) == null) {
setReturnCode(SipSession.INVALID_ARGUMENT);
setErrorMessage("Buddy refresh for URI " + targetUri
+ " failed, uri was not found in the buddy list. Use fetchPresenceInfo() for users n... | java | public boolean refreshBuddy(Request req, long timeout) {
if (parent.getBuddyList().get(targetUri) == null) {
setReturnCode(SipSession.INVALID_ARGUMENT);
setErrorMessage("Buddy refresh for URI " + targetUri
+ " failed, uri was not found in the buddy list. Use fetchPresenceInfo() for users n... | [
"public",
"boolean",
"refreshBuddy",
"(",
"Request",
"req",
",",
"long",
"timeout",
")",
"{",
"if",
"(",
"parent",
".",
"getBuddyList",
"(",
")",
".",
"get",
"(",
"targetUri",
")",
"==",
"null",
")",
"{",
"setReturnCode",
"(",
"SipSession",
".",
"INVALID... | This method is the same as refreshBuddy(duration, eventId, timeout) except that instead of
creating the SUBSCRIBE request from parameters passed in, the given request message parameter
is used for sending out the SUBSCRIBE message.
<p>
The Request parameter passed into this method should come from calling createSubscr... | [
"This",
"method",
"is",
"the",
"same",
"as",
"refreshBuddy",
"(",
"duration",
"eventId",
"timeout",
")",
"except",
"that",
"instead",
"of",
"creating",
"the",
"SUBSCRIBE",
"request",
"from",
"parameters",
"passed",
"in",
"the",
"given",
"request",
"message",
"... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/PresenceSubscriber.java#L387-L397 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/AbstractMultiDataSetNormalizer.java | AbstractMultiDataSetNormalizer.revertLabels | public void revertLabels(@NonNull INDArray labels, INDArray mask, int output) {
if (isFitLabel()) {
strategy.revert(labels, mask, getLabelStats(output));
}
} | java | public void revertLabels(@NonNull INDArray labels, INDArray mask, int output) {
if (isFitLabel()) {
strategy.revert(labels, mask, getLabelStats(output));
}
} | [
"public",
"void",
"revertLabels",
"(",
"@",
"NonNull",
"INDArray",
"labels",
",",
"INDArray",
"mask",
",",
"int",
"output",
")",
"{",
"if",
"(",
"isFitLabel",
"(",
")",
")",
"{",
"strategy",
".",
"revert",
"(",
"labels",
",",
"mask",
",",
"getLabelStats"... | Undo (revert) the normalization applied by this normalizer to a specific labels array.
If labels normalization is disabled (i.e., {@link #isFitLabel()} == false) then this is a no-op.
Can also be used to undo normalization for network output arrays, in the case of regression.
@param labels Labels arrays to revert the ... | [
"Undo",
"(",
"revert",
")",
"the",
"normalization",
"applied",
"by",
"this",
"normalizer",
"to",
"a",
"specific",
"labels",
"array",
".",
"If",
"labels",
"normalization",
"is",
"disabled",
"(",
"i",
".",
"e",
".",
"{",
"@link",
"#isFitLabel",
"()",
"}",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/AbstractMultiDataSetNormalizer.java#L272-L276 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.extendImmutabilityPolicy | public ImmutabilityPolicyInner extendImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) {
return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPer... | java | public ImmutabilityPolicyInner extendImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) {
return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPer... | [
"public",
"ImmutabilityPolicyInner",
"extendImmutabilityPolicy",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"String",
"ifMatch",
",",
"int",
"immutabilityPeriodSinceCreationInDays",
")",
"{",
"return",
"extendImmut... | Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param... | [
"Extends",
"the",
"immutabilityPeriodSinceCreationInDays",
"of",
"a",
"locked",
"immutabilityPolicy",
".",
"The",
"only",
"action",
"allowed",
"on",
"a",
"Locked",
"policy",
"will",
"be",
"this",
"action",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"required",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L1587-L1589 |
JodaOrg/joda-time | src/main/java/org/joda/time/Months.java | Months.monthsBetween | public static Months monthsBetween(ReadableInstant start, ReadableInstant end) {
int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.months());
return Months.months(amount);
} | java | public static Months monthsBetween(ReadableInstant start, ReadableInstant end) {
int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.months());
return Months.months(amount);
} | [
"public",
"static",
"Months",
"monthsBetween",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
")",
"{",
"int",
"amount",
"=",
"BaseSingleFieldPeriod",
".",
"between",
"(",
"start",
",",
"end",
",",
"DurationFieldType",
".",
"months",
"(",
")",
... | Creates a <code>Months</code> representing the number of whole months
between the two specified datetimes. This method correctly handles
any daylight savings time changes that may occur during the interval.
<p>
This method calculates by adding months to the start date until the result
is past the end date. As such, a p... | [
"Creates",
"a",
"<code",
">",
"Months<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"months",
"between",
"the",
"two",
"specified",
"datetimes",
".",
"This",
"method",
"correctly",
"handles",
"any",
"daylight",
"savings",
"time",
"change... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Months.java#L141-L144 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.loadBalancing_serviceName_portsRedirection_srcPort_DELETE | public OvhLoadBalancingTask loadBalancing_serviceName_portsRedirection_srcPort_DELETE(String serviceName, net.minidev.ovh.api.ip.OvhLoadBalancingAdditionalPortEnum srcPort) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/portsRedirection/{srcPort}";
StringBuilder sb = path(qPath, serviceName, s... | java | public OvhLoadBalancingTask loadBalancing_serviceName_portsRedirection_srcPort_DELETE(String serviceName, net.minidev.ovh.api.ip.OvhLoadBalancingAdditionalPortEnum srcPort) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/portsRedirection/{srcPort}";
StringBuilder sb = path(qPath, serviceName, s... | [
"public",
"OvhLoadBalancingTask",
"loadBalancing_serviceName_portsRedirection_srcPort_DELETE",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"ip",
".",
"OvhLoadBalancingAdditionalPortEnum",
"srcPort",
")",
"throws",
"IOException",
... | Delete a port redirection
REST: DELETE /ip/loadBalancing/{serviceName}/portsRedirection/{srcPort}
@param serviceName [required] The internal name of your IP load balancing
@param srcPort [required] The port you want to redirect from | [
"Delete",
"a",
"port",
"redirection"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1513-L1518 |
agmip/acmo | src/main/java/org/agmip/acmo/util/AcmoUtil.java | AcmoUtil.createCsvFile | public static File createCsvFile(String outputCsvPath, String mode) {
return createCsvFile(outputCsvPath, mode, null);
} | java | public static File createCsvFile(String outputCsvPath, String mode) {
return createCsvFile(outputCsvPath, mode, null);
} | [
"public",
"static",
"File",
"createCsvFile",
"(",
"String",
"outputCsvPath",
",",
"String",
"mode",
")",
"{",
"return",
"createCsvFile",
"(",
"outputCsvPath",
",",
"mode",
",",
"null",
")",
";",
"}"
] | Generate an ACMO CSV file object with a non-repeated file name in the
given directory. The naming rule is as follow,
ACMO-[Region]-[stratum]-[climate_id]-[RAP_id]-[Management_id]-[model].csv
@param outputCsvPath The output path for CSV file
@param mode The name of model which provide the model output data
@return The ... | [
"Generate",
"an",
"ACMO",
"CSV",
"file",
"object",
"with",
"a",
"non",
"-",
"repeated",
"file",
"name",
"in",
"the",
"given",
"directory",
".",
"The",
"naming",
"rule",
"is",
"as",
"follow",
"ACMO",
"-",
"[",
"Region",
"]",
"-",
"[",
"stratum",
"]",
... | train | https://github.com/agmip/acmo/blob/cf609b272ed7344abd2e2bef3d0060d2afa81cb0/src/main/java/org/agmip/acmo/util/AcmoUtil.java#L503-L505 |
tuenti/SmsRadar | library/src/main/java/com/tuenti/smsradar/SmsRadar.java | SmsRadar.stopSmsRadarService | public static void stopSmsRadarService(Context context) {
SmsRadar.smsListener = null;
Intent intent = new Intent(context, SmsRadarService.class);
context.stopService(intent);
} | java | public static void stopSmsRadarService(Context context) {
SmsRadar.smsListener = null;
Intent intent = new Intent(context, SmsRadarService.class);
context.stopService(intent);
} | [
"public",
"static",
"void",
"stopSmsRadarService",
"(",
"Context",
"context",
")",
"{",
"SmsRadar",
".",
"smsListener",
"=",
"null",
";",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"context",
",",
"SmsRadarService",
".",
"class",
")",
";",
"context",
"."... | Stops the service and remove the SmsListener added when the SmsRadar was initialized
@param context used to stop the service | [
"Stops",
"the",
"service",
"and",
"remove",
"the",
"SmsListener",
"added",
"when",
"the",
"SmsRadar",
"was",
"initialized"
] | train | https://github.com/tuenti/SmsRadar/blob/598553c69c474634a1d4041a39f015f0b4c33a6d/library/src/main/java/com/tuenti/smsradar/SmsRadar.java#L50-L54 |
kkopacz/agiso-core | bundles/agiso-core-lang/src/main/java/org/agiso/core/lang/util/ThreadUtils.java | ThreadUtils.putAttribute | public static Object putAttribute(String key, Object attribute) {
return putAttribute(key, attribute, false);
} | java | public static Object putAttribute(String key, Object attribute) {
return putAttribute(key, attribute, false);
} | [
"public",
"static",
"Object",
"putAttribute",
"(",
"String",
"key",
",",
"Object",
"attribute",
")",
"{",
"return",
"putAttribute",
"(",
"key",
",",
"attribute",
",",
"false",
")",
";",
"}"
] | Umieszcza wartość atrybutu pod określonym kluczem w lokalnym zasięgu wątku.
@param key Klucz, pod którym atrybut zostanie umieszczony
@param attribute Wartość atrybutu do umieszczenia w lokalnym zasięgu wątku
@return poprzednia wartość atrybutu powiązanego z klluczem, lub <code>null
</code> jeśli atrybut nie został us... | [
"Umieszcza",
"wartość",
"atrybutu",
"pod",
"określonym",
"kluczem",
"w",
"lokalnym",
"zasięgu",
"wątku",
"."
] | train | https://github.com/kkopacz/agiso-core/blob/b994ec0146be1fe3f10829d69cd719bdbdebe1c5/bundles/agiso-core-lang/src/main/java/org/agiso/core/lang/util/ThreadUtils.java#L107-L109 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Clustering.java | Clustering.addChildCluster | public void addChildCluster(Cluster<M> parent, Cluster<M> child) {
hierarchy.add(parent, child);
} | java | public void addChildCluster(Cluster<M> parent, Cluster<M> child) {
hierarchy.add(parent, child);
} | [
"public",
"void",
"addChildCluster",
"(",
"Cluster",
"<",
"M",
">",
"parent",
",",
"Cluster",
"<",
"M",
">",
"child",
")",
"{",
"hierarchy",
".",
"add",
"(",
"parent",
",",
"child",
")",
";",
"}"
] | Add a cluster to the clustering.
@param parent Parent cluster
@param child Child cluster. | [
"Add",
"a",
"cluster",
"to",
"the",
"clustering",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Clustering.java#L116-L118 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java | ReferenceDataUrl.getUnitsOfMeasureUrl | public static MozuUrl getUnitsOfMeasureUrl(String filter, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/reference/unitsofmeasure?filter={filter}&responseFields={responseFields}");
formatter.formatUrl("filter", filter);
formatter.formatUrl("responseFields", responseFields);... | java | public static MozuUrl getUnitsOfMeasureUrl(String filter, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/reference/unitsofmeasure?filter={filter}&responseFields={responseFields}");
formatter.formatUrl("filter", filter);
formatter.formatUrl("responseFields", responseFields);... | [
"public",
"static",
"MozuUrl",
"getUnitsOfMeasureUrl",
"(",
"String",
"filter",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/reference/unitsofmeasure?filter={filter}&responseFields={responseFields}\"",
... | Get Resource Url for GetUnitsOfMeasure
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters.
@param responseFields Filtering syntax ap... | [
"Get",
"Resource",
"Url",
"for",
"GetUnitsOfMeasure"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java#L174-L180 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java | RestProxy.createHttpRequest | @SuppressWarnings("unchecked")
private HttpRequest createHttpRequest(SwaggerMethodParser methodParser, Object[] args) throws IOException {
UrlBuilder urlBuilder;
// Sometimes people pass in a full URL for the value of their PathParam annotated argument.
// This definitely happens in paging ... | java | @SuppressWarnings("unchecked")
private HttpRequest createHttpRequest(SwaggerMethodParser methodParser, Object[] args) throws IOException {
UrlBuilder urlBuilder;
// Sometimes people pass in a full URL for the value of their PathParam annotated argument.
// This definitely happens in paging ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"HttpRequest",
"createHttpRequest",
"(",
"SwaggerMethodParser",
"methodParser",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"UrlBuilder",
"urlBuilder",
";",
"// Sometimes people pass ... | Create a HttpRequest for the provided Swagger method using the provided arguments.
@param methodParser the Swagger method parser to use
@param args the arguments to use to populate the method's annotation values
@return a HttpRequest
@throws IOException thrown if the body contents cannot be serialized | [
"Create",
"a",
"HttpRequest",
"for",
"the",
"provided",
"Swagger",
"method",
"using",
"the",
"provided",
"arguments",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java#L161-L200 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeAlignmentPatternLocator.java | QrCodeAlignmentPatternLocator.centerOnSquare | boolean centerOnSquare(QrCode.Alignment pattern, float guessY, float guessX) {
float step = 1;
float bestMag = Float.MAX_VALUE;
float bestX = guessX;
float bestY = guessY;
for (int i = 0; i < 10; i++) {
for (int row = 0; row < 3; row++) {
float gridy = guessY - 1f + row;
for (int col = 0; col < 3;... | java | boolean centerOnSquare(QrCode.Alignment pattern, float guessY, float guessX) {
float step = 1;
float bestMag = Float.MAX_VALUE;
float bestX = guessX;
float bestY = guessY;
for (int i = 0; i < 10; i++) {
for (int row = 0; row < 3; row++) {
float gridy = guessY - 1f + row;
for (int col = 0; col < 3;... | [
"boolean",
"centerOnSquare",
"(",
"QrCode",
".",
"Alignment",
"pattern",
",",
"float",
"guessY",
",",
"float",
"guessX",
")",
"{",
"float",
"step",
"=",
"1",
";",
"float",
"bestMag",
"=",
"Float",
".",
"MAX_VALUE",
";",
"float",
"bestX",
"=",
"guessX",
"... | If the initial guess is within the inner white circle or black dot this will ensure that it is centered
on the black dot | [
"If",
"the",
"initial",
"guess",
"is",
"within",
"the",
"inner",
"white",
"circle",
"or",
"black",
"dot",
"this",
"will",
"ensure",
"that",
"it",
"is",
"centered",
"on",
"the",
"black",
"dot"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeAlignmentPatternLocator.java#L153-L198 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/metric/PrometheusMeterRegistries.java | PrometheusMeterRegistries.newRegistry | public static PrometheusMeterRegistry newRegistry(CollectorRegistry registry, Clock clock) {
final PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(
PrometheusConfig.DEFAULT, requireNonNull(registry, "registry"), requireNonNull(clock, "clock"));
meterRegistry.config().... | java | public static PrometheusMeterRegistry newRegistry(CollectorRegistry registry, Clock clock) {
final PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(
PrometheusConfig.DEFAULT, requireNonNull(registry, "registry"), requireNonNull(clock, "clock"));
meterRegistry.config().... | [
"public",
"static",
"PrometheusMeterRegistry",
"newRegistry",
"(",
"CollectorRegistry",
"registry",
",",
"Clock",
"clock",
")",
"{",
"final",
"PrometheusMeterRegistry",
"meterRegistry",
"=",
"new",
"PrometheusMeterRegistry",
"(",
"PrometheusConfig",
".",
"DEFAULT",
",",
... | Returns a newly-created {@link PrometheusMeterRegistry} instance with the specified
{@link CollectorRegistry} and {@link Clock}. | [
"Returns",
"a",
"newly",
"-",
"created",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/metric/PrometheusMeterRegistries.java#L59-L65 |
h2oai/h2o-2 | src/main/java/water/Model.java | Model.getDomainMapping | public static int[][] getDomainMapping(String[] modelDom, String[] colDom, boolean exact) {
return getDomainMapping(null, modelDom, colDom, exact);
} | java | public static int[][] getDomainMapping(String[] modelDom, String[] colDom, boolean exact) {
return getDomainMapping(null, modelDom, colDom, exact);
} | [
"public",
"static",
"int",
"[",
"]",
"[",
"]",
"getDomainMapping",
"(",
"String",
"[",
"]",
"modelDom",
",",
"String",
"[",
"]",
"colDom",
",",
"boolean",
"exact",
")",
"{",
"return",
"getDomainMapping",
"(",
"null",
",",
"modelDom",
",",
"colDom",
",",
... | Returns a mapping between values of model domains (<code>modelDom</code>) and given column domain.
@see #getDomainMapping(String, String[], String[], boolean) | [
"Returns",
"a",
"mapping",
"between",
"values",
"of",
"model",
"domains",
"(",
"<code",
">",
"modelDom<",
"/",
"code",
">",
")",
"and",
"given",
"column",
"domain",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L424-L426 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/ButtonlessDfuImpl.java | ButtonlessDfuImpl.getStatusCode | @SuppressWarnings("SameParameterValue")
private int getStatusCode(final byte[] response, final int request) throws UnknownResponseException {
if (response == null || response.length < 3 || response[0] != OP_CODE_RESPONSE_CODE_KEY || response[1] != request ||
(response[2] != DFU_STATUS_SUCCESS && response[2] != S... | java | @SuppressWarnings("SameParameterValue")
private int getStatusCode(final byte[] response, final int request) throws UnknownResponseException {
if (response == null || response.length < 3 || response[0] != OP_CODE_RESPONSE_CODE_KEY || response[1] != request ||
(response[2] != DFU_STATUS_SUCCESS && response[2] != S... | [
"@",
"SuppressWarnings",
"(",
"\"SameParameterValue\"",
")",
"private",
"int",
"getStatusCode",
"(",
"final",
"byte",
"[",
"]",
"response",
",",
"final",
"int",
"request",
")",
"throws",
"UnknownResponseException",
"{",
"if",
"(",
"response",
"==",
"null",
"||",... | Checks whether the response received is valid and returns the status code.
@param response the response received from the DFU device.
@param request the expected Op Code.
@return The status code.
@throws UnknownResponseException if response was not valid. | [
"Checks",
"whether",
"the",
"response",
"received",
"is",
"valid",
"and",
"returns",
"the",
"status",
"code",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/ButtonlessDfuImpl.java#L178-L185 |
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/ServerAutomaticTuningsInner.java | ServerAutomaticTuningsInner.updateAsync | public Observable<ServerAutomaticTuningInner> updateAsync(String resourceGroupName, String serverName, ServerAutomaticTuningInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerAutomaticTuningInner>, ServerAutomaticTuningInner>(... | java | public Observable<ServerAutomaticTuningInner> updateAsync(String resourceGroupName, String serverName, ServerAutomaticTuningInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerAutomaticTuningInner>, ServerAutomaticTuningInner>(... | [
"public",
"Observable",
"<",
"ServerAutomaticTuningInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerAutomaticTuningInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
"... | Update automatic tuning options on server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The requested automatic tuning resource state.
@throws ... | [
"Update",
"automatic",
"tuning",
"options",
"on",
"server",
"."
] | 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/ServerAutomaticTuningsInner.java#L191-L198 |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/external/ExternalType.java | ExternalType.writeInteger | public static void writeInteger(final ObjectOutput out, final Integer i)
throws IOException {
if (i == null) {
out.writeByte(0);
return;
}
out.writeByte(1);
out.writeInt(i);
} | java | public static void writeInteger(final ObjectOutput out, final Integer i)
throws IOException {
if (i == null) {
out.writeByte(0);
return;
}
out.writeByte(1);
out.writeInt(i);
} | [
"public",
"static",
"void",
"writeInteger",
"(",
"final",
"ObjectOutput",
"out",
",",
"final",
"Integer",
"i",
")",
"throws",
"IOException",
"{",
"if",
"(",
"i",
"==",
"null",
")",
"{",
"out",
".",
"writeByte",
"(",
"0",
")",
";",
"return",
";",
"}",
... | Writes the {@link Integer} to the output.
<p>
This method and its equivalent {@link #readInteger(ObjectInput)
read-variant} store {@code i} in a more efficient way than serializing
the {@link Integer} class.
</p>
@param out Non-null {@link ObjectOutput}
@param i {@link Integer}; may be null
@throws IOException Thrown ... | [
"Writes",
"the",
"{",
"@link",
"Integer",
"}",
"to",
"the",
"output",
".",
"<p",
">",
"This",
"method",
"and",
"its",
"equivalent",
"{",
"@link",
"#readInteger",
"(",
"ObjectInput",
")",
"read",
"-",
"variant",
"}",
"store",
"{",
"@code",
"i",
"}",
"in... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/external/ExternalType.java#L102-L110 |
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.verifyDomainOwnershipAsync | public Observable<Void> verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName) {
return verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, certificateOrderName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceRespo... | java | public Observable<Void> verifyDomainOwnershipAsync(String resourceGroupName, String certificateOrderName) {
return verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, certificateOrderName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceRespo... | [
"public",
"Observable",
"<",
"Void",
">",
"verifyDomainOwnershipAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
")",
"{",
"return",
"verifyDomainOwnershipWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"certificateOrderName",
")",
... | Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
".",
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
"."
] | 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#L2171-L2178 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ByteArray.java | ByteArray.put | public void put(byte[] source, int index, int length)
{
// If the buffer is small.
if (mBuffer.capacity() < (mLength + length))
{
expandBuffer(mLength + length + ADDITIONAL_BUFFER_SIZE);
}
mBuffer.put(source, index, length);
mLength += length;
} | java | public void put(byte[] source, int index, int length)
{
// If the buffer is small.
if (mBuffer.capacity() < (mLength + length))
{
expandBuffer(mLength + length + ADDITIONAL_BUFFER_SIZE);
}
mBuffer.put(source, index, length);
mLength += length;
} | [
"public",
"void",
"put",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"index",
",",
"int",
"length",
")",
"{",
"// If the buffer is small.",
"if",
"(",
"mBuffer",
".",
"capacity",
"(",
")",
"<",
"(",
"mLength",
"+",
"length",
")",
")",
"{",
"expandBuff... | Add data at the current position.
@param source
Source data.
@param index
The index in the source data. Data from the index is copied.
@param length
The length of data to copy. | [
"Add",
"data",
"at",
"the",
"current",
"position",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ByteArray.java#L154-L164 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.exportDevices | public JobResponseInner exportDevices(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) {
return exportDevicesWithServiceResponseAsync(resourceGroupName, resourceName, exportDevicesParameters).toBlocking().single().body();
} | java | public JobResponseInner exportDevices(String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) {
return exportDevicesWithServiceResponseAsync(resourceGroupName, resourceName, exportDevicesParameters).toBlocking().single().body();
} | [
"public",
"JobResponseInner",
"exportDevices",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ExportDevicesRequest",
"exportDevicesParameters",
")",
"{",
"return",
"exportDevicesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
... | Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
Exports all the device identities in the IoT hub identity registry to an Azur... | [
"Exports",
"all",
"the",
"device",
"identities",
"in",
"the",
"IoT",
"hub",
"identity",
"registry",
"to",
"an",
"Azure",
"Storage",
"blob",
"container",
".",
"For",
"more",
"information",
"see",
":",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L3067-L3069 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/crypto/CryptoUtils.java | CryptoUtils.matchPassword | public static boolean matchPassword(String hashedPswdAndSalt, String clearPswd) {
if (StringUtils.isNotEmpty(hashedPswdAndSalt) && StringUtils.isNotEmpty(clearPswd)) {
int idxOfSep = hashedPswdAndSalt.indexOf(PASSWORD_SEP);
String storedHash = hashedPswdAndSalt.substring(0, idxOfSep);
... | java | public static boolean matchPassword(String hashedPswdAndSalt, String clearPswd) {
if (StringUtils.isNotEmpty(hashedPswdAndSalt) && StringUtils.isNotEmpty(clearPswd)) {
int idxOfSep = hashedPswdAndSalt.indexOf(PASSWORD_SEP);
String storedHash = hashedPswdAndSalt.substring(0, idxOfSep);
... | [
"public",
"static",
"boolean",
"matchPassword",
"(",
"String",
"hashedPswdAndSalt",
",",
"String",
"clearPswd",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"hashedPswdAndSalt",
")",
"&&",
"StringUtils",
".",
"isNotEmpty",
"(",
"clearPswd",
")",
"... | Returns true if it's a password match, that is, if the hashed clear password equals the given hash.
@param hashedPswdAndSalt the hashed password + {@link #PASSWORD_SEP} + salt, as returned by
{@link #hashPassword(String)}
@param clearPswd the password that we're trying to match, in clear
@return if the passwor... | [
"Returns",
"true",
"if",
"it",
"s",
"a",
"password",
"match",
"that",
"is",
"if",
"the",
"hashed",
"clear",
"password",
"equals",
"the",
"given",
"hash",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/crypto/CryptoUtils.java#L120-L137 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/config/internal/MultivalueProperty.java | MultivalueProperty.retroTrim | private static int retroTrim(char[] res, int resI) {
int i = resI;
while (i >= 1) {
if (!istrimmable(res[i - 1])) {
return i;
}
i--;
}
return i;
} | java | private static int retroTrim(char[] res, int resI) {
int i = resI;
while (i >= 1) {
if (!istrimmable(res[i - 1])) {
return i;
}
i--;
}
return i;
} | [
"private",
"static",
"int",
"retroTrim",
"(",
"char",
"[",
"]",
"res",
",",
"int",
"resI",
")",
"{",
"int",
"i",
"=",
"resI",
";",
"while",
"(",
"i",
">=",
"1",
")",
"{",
"if",
"(",
"!",
"istrimmable",
"(",
"res",
"[",
"i",
"-",
"1",
"]",
")"... | Reads from index {@code resI} to the beginning into {@code res} looking up the location of the trimmable char with
the lowest index before encountering a non-trimmable char.
<p>
This basically trims {@code res} from any trimmable char at its end.
@return index of next location to put new char in res | [
"Reads",
"from",
"index",
"{",
"@code",
"resI",
"}",
"to",
"the",
"beginning",
"into",
"{",
"@code",
"res",
"}",
"looking",
"up",
"the",
"location",
"of",
"the",
"trimmable",
"char",
"with",
"the",
"lowest",
"index",
"before",
"encountering",
"a",
"non",
... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/MultivalueProperty.java#L199-L208 |
haraldk/TwelveMonkeys | imageio/imageio-jpeg/src/main/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGLosslessDecoderWrapper.java | JPEGLosslessDecoderWrapper.to16Bit1ComponentGrayScale | private BufferedImage to16Bit1ComponentGrayScale(int[][] decoded, int precision, int width, int height) {
BufferedImage image;
if (precision == 16) {
image = new BufferedImage(width, height, BufferedImage.TYPE_USHORT_GRAY);
}
else {
ColorModel colorModel = new Com... | java | private BufferedImage to16Bit1ComponentGrayScale(int[][] decoded, int precision, int width, int height) {
BufferedImage image;
if (precision == 16) {
image = new BufferedImage(width, height, BufferedImage.TYPE_USHORT_GRAY);
}
else {
ColorModel colorModel = new Com... | [
"private",
"BufferedImage",
"to16Bit1ComponentGrayScale",
"(",
"int",
"[",
"]",
"[",
"]",
"decoded",
",",
"int",
"precision",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"BufferedImage",
"image",
";",
"if",
"(",
"precision",
"==",
"16",
")",
"{",
... | Converts the decoded buffer into a BufferedImage.
precision: 16 bit, componentCount = 1
@param decoded data buffer
@param precision
@param width of the image
@param height of the image @return a BufferedImage.TYPE_USHORT_GRAY | [
"Converts",
"the",
"decoded",
"buffer",
"into",
"a",
"BufferedImage",
".",
"precision",
":",
"16",
"bit",
"componentCount",
"=",
"1"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-jpeg/src/main/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGLosslessDecoderWrapper.java#L132-L149 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/RespondToAuthChallengeRequest.java | RespondToAuthChallengeRequest.withChallengeResponses | public RespondToAuthChallengeRequest withChallengeResponses(java.util.Map<String, String> challengeResponses) {
setChallengeResponses(challengeResponses);
return this;
} | java | public RespondToAuthChallengeRequest withChallengeResponses(java.util.Map<String, String> challengeResponses) {
setChallengeResponses(challengeResponses);
return this;
} | [
"public",
"RespondToAuthChallengeRequest",
"withChallengeResponses",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"challengeResponses",
")",
"{",
"setChallengeResponses",
"(",
"challengeResponses",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The challenge responses. These are inputs corresponding to the value of <code>ChallengeName</code>, for example:
</p>
<ul>
<li>
<p>
<code>SMS_MFA</code>: <code>SMS_MFA_CODE</code>, <code>USERNAME</code>, <code>SECRET_HASH</code> (if app client
is configured with client secret).
</p>
</li>
<li>
<p>
<code>PASSWORD_VE... | [
"<p",
">",
"The",
"challenge",
"responses",
".",
"These",
"are",
"inputs",
"corresponding",
"to",
"the",
"value",
"of",
"<code",
">",
"ChallengeName<",
"/",
"code",
">",
"for",
"example",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"<... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/RespondToAuthChallengeRequest.java#L453-L456 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/LogQueryTool.java | LogQueryTool.exceptionWithQuery | public SQLException exceptionWithQuery(ParameterHolder[] parameters, SQLException sqlEx,
PrepareResult serverPrepareResult) {
if (sqlEx.getCause() instanceof SocketTimeoutException) {
return new SQLException("Connection timed out", CONNECTION_EXCEPTION.getSqlState(), sqlEx);
}
if (options.dumpQu... | java | public SQLException exceptionWithQuery(ParameterHolder[] parameters, SQLException sqlEx,
PrepareResult serverPrepareResult) {
if (sqlEx.getCause() instanceof SocketTimeoutException) {
return new SQLException("Connection timed out", CONNECTION_EXCEPTION.getSqlState(), sqlEx);
}
if (options.dumpQu... | [
"public",
"SQLException",
"exceptionWithQuery",
"(",
"ParameterHolder",
"[",
"]",
"parameters",
",",
"SQLException",
"sqlEx",
",",
"PrepareResult",
"serverPrepareResult",
")",
"{",
"if",
"(",
"sqlEx",
".",
"getCause",
"(",
")",
"instanceof",
"SocketTimeoutException",
... | Return exception with query information's.
@param parameters query parameters
@param sqlEx current exception
@param serverPrepareResult prepare results
@return exception with query information | [
"Return",
"exception",
"with",
"query",
"information",
"s",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/LogQueryTool.java#L155-L166 |
b3dgs/lionengine | lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java | ToolsAwt.applyMask | public static BufferedImage applyMask(BufferedImage image, int rgba)
{
final BufferedImage mask = copyImage(image);
final int height = mask.getHeight();
final int width = mask.getWidth();
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
... | java | public static BufferedImage applyMask(BufferedImage image, int rgba)
{
final BufferedImage mask = copyImage(image);
final int height = mask.getHeight();
final int width = mask.getWidth();
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
... | [
"public",
"static",
"BufferedImage",
"applyMask",
"(",
"BufferedImage",
"image",
",",
"int",
"rgba",
")",
"{",
"final",
"BufferedImage",
"mask",
"=",
"copyImage",
"(",
"image",
")",
";",
"final",
"int",
"height",
"=",
"mask",
".",
"getHeight",
"(",
")",
";... | Apply a mask to an existing image.
@param image The existing image.
@param rgba The rgba color value.
@return The masked image. | [
"Apply",
"a",
"mask",
"to",
"an",
"existing",
"image",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java#L188-L207 |
threerings/narya | core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java | PlaceRegistry.createPlace | public PlaceManager createPlace (PlaceConfig config, PreStartupHook hook)
throws InstantiationException, InvocationException
{
return createPlace(config, null, hook);
} | java | public PlaceManager createPlace (PlaceConfig config, PreStartupHook hook)
throws InstantiationException, InvocationException
{
return createPlace(config, null, hook);
} | [
"public",
"PlaceManager",
"createPlace",
"(",
"PlaceConfig",
"config",
",",
"PreStartupHook",
"hook",
")",
"throws",
"InstantiationException",
",",
"InvocationException",
"{",
"return",
"createPlace",
"(",
"config",
",",
"null",
",",
"hook",
")",
";",
"}"
] | Don't use this method, see {@link #createPlace(PlaceConfig)}.
@param hook an optional pre-startup hook that allows a place manager to be configured prior
to having {@link PlaceManager#startup} called. This mainly exists because it used to be
possible to do such things. Try not to use this in new code. | [
"Don",
"t",
"use",
"this",
"method",
"see",
"{",
"@link",
"#createPlace",
"(",
"PlaceConfig",
")",
"}",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L122-L126 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getAverageWindowLoadTime | public double getAverageWindowLoadTime(final String intervalName, final TimeUnit unit) {
return unit.transformMillis(totalWindowLoadTime.getValueAsLong(intervalName)) / numberOfLoads.getValueAsDouble(intervalName);
} | java | public double getAverageWindowLoadTime(final String intervalName, final TimeUnit unit) {
return unit.transformMillis(totalWindowLoadTime.getValueAsLong(intervalName)) / numberOfLoads.getValueAsDouble(intervalName);
} | [
"public",
"double",
"getAverageWindowLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"return",
"unit",
".",
"transformMillis",
"(",
"totalWindowLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
")",
"/",
"nu... | Returns the average web page load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return average web page load time | [
"Returns",
"the",
"average",
"web",
"page",
"load",
"time",
"for",
"given",
"interval",
"and",
"{",
"@link",
"TimeUnit",
"}",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L221-L223 |
apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.produceToken | public static final String produceToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken authToken = createAuthToken(principal, roles, expiresInMillis);
String json = toJSON(authToken);
return StringUtils.newStringUtf8(Base64.encodeBase64(StringUtils.getBytesUtf8(json)));
... | java | public static final String produceToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken authToken = createAuthToken(principal, roles, expiresInMillis);
String json = toJSON(authToken);
return StringUtils.newStringUtf8(Base64.encodeBase64(StringUtils.getBytesUtf8(json)));
... | [
"public",
"static",
"final",
"String",
"produceToken",
"(",
"String",
"principal",
",",
"Set",
"<",
"String",
">",
"roles",
",",
"int",
"expiresInMillis",
")",
"{",
"AuthToken",
"authToken",
"=",
"createAuthToken",
"(",
"principal",
",",
"roles",
",",
"expires... | Produce a token suitable for transmission. This will generate the auth token,
then serialize it to a JSON string, then Base64 encode the JSON.
@param principal the auth principal
@param roles the auth roles
@param expiresInMillis the number of millis to expiry
@return the token | [
"Produce",
"a",
"token",
"suitable",
"for",
"transmission",
".",
"This",
"will",
"generate",
"the",
"auth",
"token",
"then",
"serialize",
"it",
"to",
"a",
"JSON",
"string",
"then",
"Base64",
"encode",
"the",
"JSON",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L74-L78 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FeatureDependencyChecker.java | FeatureDependencyChecker.toBeUninstalled | public boolean toBeUninstalled(String name, List<UninstallAsset> list) {
for (UninstallAsset asset : list) {
String featureName = InstallUtils.getShortName(asset.getProvisioningFeatureDefinition());
if (asset.getName().equals(name) ||
(featureName != null && featureName.e... | java | public boolean toBeUninstalled(String name, List<UninstallAsset> list) {
for (UninstallAsset asset : list) {
String featureName = InstallUtils.getShortName(asset.getProvisioningFeatureDefinition());
if (asset.getName().equals(name) ||
(featureName != null && featureName.e... | [
"public",
"boolean",
"toBeUninstalled",
"(",
"String",
"name",
",",
"List",
"<",
"UninstallAsset",
">",
"list",
")",
"{",
"for",
"(",
"UninstallAsset",
"asset",
":",
"list",
")",
"{",
"String",
"featureName",
"=",
"InstallUtils",
".",
"getShortName",
"(",
"a... | Verify the name is on the uninstall list
@param name symbolic name of the feature
@param list list of the uninstalling features
@return true if the feature is going to be uninstalled, otherwise, return false. | [
"Verify",
"the",
"name",
"is",
"on",
"the",
"uninstall",
"list"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FeatureDependencyChecker.java#L42-L52 |
advantageous/boon | reflekt/src/main/java/io/advantageous/boon/core/reflection/ClassMeta.java | ClassMeta.respondsTo | public static boolean respondsTo(Object object, String method) {
if (object instanceof Class) {
return Reflection.respondsTo((Class) object, method);
} else {
return Reflection.respondsTo(object, method);
}
} | java | public static boolean respondsTo(Object object, String method) {
if (object instanceof Class) {
return Reflection.respondsTo((Class) object, method);
} else {
return Reflection.respondsTo(object, method);
}
} | [
"public",
"static",
"boolean",
"respondsTo",
"(",
"Object",
"object",
",",
"String",
"method",
")",
"{",
"if",
"(",
"object",
"instanceof",
"Class",
")",
"{",
"return",
"Reflection",
".",
"respondsTo",
"(",
"(",
"Class",
")",
"object",
",",
"method",
")",
... | Checks to see if an object responds to a method.
Helper facade over Reflection library.
@param object object in question
@param method method name in question.
@return true or false | [
"Checks",
"to",
"see",
"if",
"an",
"object",
"responds",
"to",
"a",
"method",
".",
"Helper",
"facade",
"over",
"Reflection",
"library",
"."
] | train | https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/core/reflection/ClassMeta.java#L596-L602 |
overturetool/overture | ide/ui/src/main/java/org/overture/ide/ui/VdmPluginImages.java | VdmPluginImages.createUnManaged | private static ImageDescriptor createUnManaged(String prefix, String name)
{
return create(prefix, name, true);
} | java | private static ImageDescriptor createUnManaged(String prefix, String name)
{
return create(prefix, name, true);
} | [
"private",
"static",
"ImageDescriptor",
"createUnManaged",
"(",
"String",
"prefix",
",",
"String",
"name",
")",
"{",
"return",
"create",
"(",
"prefix",
",",
"name",
",",
"true",
")",
";",
"}"
] | /*
Creates an image descriptor for the given prefix and name in the JDT UI bundle. The path can contain variables
like $NL$. If no image could be found, the 'missing image descriptor' is returned. | [
"/",
"*",
"Creates",
"an",
"image",
"descriptor",
"for",
"the",
"given",
"prefix",
"and",
"name",
"in",
"the",
"JDT",
"UI",
"bundle",
".",
"The",
"path",
"can",
"contain",
"variables",
"like",
"$NL$",
".",
"If",
"no",
"image",
"could",
"be",
"found",
"... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/ui/src/main/java/org/overture/ide/ui/VdmPluginImages.java#L793-L796 |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java | ImmutableMatrixFactory.zeros | public static ImmutableMatrix zeros(final int rows, final int cols) {
if (rows <= 0 || cols <= 0) throw new IllegalArgumentException("Invalid dimensions");
return create(new ImmutableData(rows, cols) {
@Override
public double getQuick(int row, int col) {
return 0;
}
});
} | java | public static ImmutableMatrix zeros(final int rows, final int cols) {
if (rows <= 0 || cols <= 0) throw new IllegalArgumentException("Invalid dimensions");
return create(new ImmutableData(rows, cols) {
@Override
public double getQuick(int row, int col) {
return 0;
}
});
} | [
"public",
"static",
"ImmutableMatrix",
"zeros",
"(",
"final",
"int",
"rows",
",",
"final",
"int",
"cols",
")",
"{",
"if",
"(",
"rows",
"<=",
"0",
"||",
"cols",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid dimensions\"",
")",
... | Returns an immutable matrix of the specified size whose elements are all 0.
@param rows the number of rows
@param cols the number of columns
@return a <code>rows</code>×<code>cols</code> matrix whose elements are all 0
@throws IllegalArgumentException if either argument is non-positive | [
"Returns",
"an",
"immutable",
"matrix",
"of",
"the",
"specified",
"size",
"whose",
"elements",
"are",
"all",
"0",
"."
] | train | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java#L223-L231 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker08.java | WebSocketClientHandshaker08.newHandshakeRequest | @Override
protected FullHttpRequest newHandshakeRequest() {
// Get path
URI wsURL = uri();
String path = rawPath(wsURL);
// Get 16 bit nonce and base 64 encode it
byte[] nonce = WebSocketUtil.randomBytes(16);
String key = WebSocketUtil.base64(nonce);
String ... | java | @Override
protected FullHttpRequest newHandshakeRequest() {
// Get path
URI wsURL = uri();
String path = rawPath(wsURL);
// Get 16 bit nonce and base 64 encode it
byte[] nonce = WebSocketUtil.randomBytes(16);
String key = WebSocketUtil.base64(nonce);
String ... | [
"@",
"Override",
"protected",
"FullHttpRequest",
"newHandshakeRequest",
"(",
")",
"{",
"// Get path",
"URI",
"wsURL",
"=",
"uri",
"(",
")",
";",
"String",
"path",
"=",
"rawPath",
"(",
"wsURL",
")",
";",
"// Get 16 bit nonce and base 64 encode it",
"byte",
"[",
"... | /**
<p>
Sends the opening request to the server:
</p>
<pre>
GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 8
</pre> | [
"/",
"**",
"<p",
">",
"Sends",
"the",
"opening",
"request",
"to",
"the",
"server",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker08.java#L159-L200 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/HString.java | HString.annotationGraph | public RelationGraph annotationGraph(@NonNull Tuple relationTypes, @NonNull AnnotationType... annotationTypes) {
RelationGraph g = new RelationGraph();
List<Annotation> vertices = interleaved(annotationTypes);
Set<RelationType> relationTypeList = Streams
.... | java | public RelationGraph annotationGraph(@NonNull Tuple relationTypes, @NonNull AnnotationType... annotationTypes) {
RelationGraph g = new RelationGraph();
List<Annotation> vertices = interleaved(annotationTypes);
Set<RelationType> relationTypeList = Streams
.... | [
"public",
"RelationGraph",
"annotationGraph",
"(",
"@",
"NonNull",
"Tuple",
"relationTypes",
",",
"@",
"NonNull",
"AnnotationType",
"...",
"annotationTypes",
")",
"{",
"RelationGraph",
"g",
"=",
"new",
"RelationGraph",
"(",
")",
";",
"List",
"<",
"Annotation",
"... | <p>Constructs a relation graph with the given relation types as the edges and the given annotation types as the
vertices (the {@link #interleaved(AnnotationType...)} method is used to get the annotations). Relations will be
determine for annotations by including the relations of their sub-annotations (i.e. sub-spans). ... | [
"<p",
">",
"Constructs",
"a",
"relation",
"graph",
"with",
"the",
"given",
"relation",
"types",
"as",
"the",
"edges",
"and",
"the",
"given",
"annotation",
"types",
"as",
"the",
"vertices",
"(",
"the",
"{",
"@link",
"#interleaved",
"(",
"AnnotationType",
"...... | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/HString.java#L132-L167 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/FastStringBuffer.java | FastStringBuffer.isWhitespace | public boolean isWhitespace(int start, int length)
{
int sourcechunk = start >>> m_chunkBits;
int sourcecolumn = start & m_chunkMask;
int available = m_chunkSize - sourcecolumn;
boolean chunkOK;
while (length > 0)
{
int runlength = (length <= available) ? length : available;
if ... | java | public boolean isWhitespace(int start, int length)
{
int sourcechunk = start >>> m_chunkBits;
int sourcecolumn = start & m_chunkMask;
int available = m_chunkSize - sourcecolumn;
boolean chunkOK;
while (length > 0)
{
int runlength = (length <= available) ? length : available;
if ... | [
"public",
"boolean",
"isWhitespace",
"(",
"int",
"start",
",",
"int",
"length",
")",
"{",
"int",
"sourcechunk",
"=",
"start",
">>>",
"m_chunkBits",
";",
"int",
"sourcecolumn",
"=",
"start",
"&",
"m_chunkMask",
";",
"int",
"available",
"=",
"m_chunkSize",
"-"... | @return true if the specified range of characters are all whitespace,
as defined by XMLCharacterRecognizer.
<p>
CURRENTLY DOES NOT CHECK FOR OUT-OF-RANGE.
@param start Offset of first character in the range.
@param length Number of characters to send. | [
"@return",
"true",
"if",
"the",
"specified",
"range",
"of",
"characters",
"are",
"all",
"whitespace",
"as",
"defined",
"by",
"XMLCharacterRecognizer",
".",
"<p",
">",
"CURRENTLY",
"DOES",
"NOT",
"CHECK",
"FOR",
"OUT",
"-",
"OF",
"-",
"RANGE",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/FastStringBuffer.java#L824-L854 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/MirageUtil.java | MirageUtil.buildSelectSQL | public static String buildSelectSQL(BeanDescFactory beanDescFactory, EntityOperator entityOperator, Class<?> clazz, NameConverter nameConverter){
StringBuilder sb = new StringBuilder();
BeanDesc beanDesc = beanDescFactory.getBeanDesc(clazz);
sb.append("SELECT * FROM ");
sb.append(M... | java | public static String buildSelectSQL(BeanDescFactory beanDescFactory, EntityOperator entityOperator, Class<?> clazz, NameConverter nameConverter){
StringBuilder sb = new StringBuilder();
BeanDesc beanDesc = beanDescFactory.getBeanDesc(clazz);
sb.append("SELECT * FROM ");
sb.append(M... | [
"public",
"static",
"String",
"buildSelectSQL",
"(",
"BeanDescFactory",
"beanDescFactory",
",",
"EntityOperator",
"entityOperator",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"NameConverter",
"nameConverter",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuild... | Builds select (by primary keys) SQL from the entity class.
@param beanDescFactory the bean descriptor factory
@param entityOperator the entity operator
@param clazz the entity class to select
@param nameConverter the name converter
@return Select SQL
@throws RuntimeException the entity class has no primary keys
@dep... | [
"Builds",
"select",
"(",
"by",
"primary",
"keys",
")",
"SQL",
"from",
"the",
"entity",
"class",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/MirageUtil.java#L124-L152 |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.createNewObject | private String createNewObject(FedoraClient fedora, String oid)
throws Exception {
InputStream in = null;
byte[] template = null;
// Start by reading our FOXML template into memory
try {
if (foxmlTemplate != null) {
// We have a user provided templ... | java | private String createNewObject(FedoraClient fedora, String oid)
throws Exception {
InputStream in = null;
byte[] template = null;
// Start by reading our FOXML template into memory
try {
if (foxmlTemplate != null) {
// We have a user provided templ... | [
"private",
"String",
"createNewObject",
"(",
"FedoraClient",
"fedora",
",",
"String",
"oid",
")",
"throws",
"Exception",
"{",
"InputStream",
"in",
"=",
"null",
";",
"byte",
"[",
"]",
"template",
"=",
"null",
";",
"// Start by reading our FOXML template into memory",... | Create a new VITAL object and return the PID.
@param fedora An instantiated fedora client
@param oid The ID of the ReDBox object we will store here. For logging
@return String The new VITAL PID that was just created | [
"Create",
"a",
"new",
"VITAL",
"object",
"and",
"return",
"the",
"PID",
"."
] | train | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L667-L696 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/Record.java | Record.getField | @SuppressWarnings("unchecked")
public <T extends Value> T getField(int fieldNum, T target) {
// range check
if (fieldNum < 0 || fieldNum >= this.numFields) {
throw new IndexOutOfBoundsException();
}
if (target == null) {
throw new NullPointerException("The target object may not be null");
}
// get... | java | @SuppressWarnings("unchecked")
public <T extends Value> T getField(int fieldNum, T target) {
// range check
if (fieldNum < 0 || fieldNum >= this.numFields) {
throw new IndexOutOfBoundsException();
}
if (target == null) {
throw new NullPointerException("The target object may not be null");
}
// get... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"Value",
">",
"T",
"getField",
"(",
"int",
"fieldNum",
",",
"T",
"target",
")",
"{",
"// range check",
"if",
"(",
"fieldNum",
"<",
"0",
"||",
"fieldNum",
">=",
"this",
"."... | Gets the field at the given position. The method tries to deserialize the fields into the given target value.
If the fields has been changed since the last (de)serialization, or is null, them the target value is left
unchanged and the changed value (or null) is returned.
<p>
In all cases, the returned value contains th... | [
"Gets",
"the",
"field",
"at",
"the",
"given",
"position",
".",
"The",
"method",
"tries",
"to",
"deserialize",
"the",
"fields",
"into",
"the",
"given",
"target",
"value",
".",
"If",
"the",
"fields",
"has",
"been",
"changed",
"since",
"the",
"last",
"(",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Record.java#L269-L293 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpUtil.java | HttpUtil.download | public static long download(String url, OutputStream out, boolean isCloseOut) {
return download(url, out, isCloseOut, null);
} | java | public static long download(String url, OutputStream out, boolean isCloseOut) {
return download(url, out, isCloseOut, null);
} | [
"public",
"static",
"long",
"download",
"(",
"String",
"url",
",",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
")",
"{",
"return",
"download",
"(",
"url",
",",
"out",
",",
"isCloseOut",
",",
"null",
")",
";",
"}"
] | 下载远程文件
@param url 请求的url
@param out 将下载内容写到输出流中 {@link OutputStream}
@param isCloseOut 是否关闭输出流
@return 文件大小 | [
"下载远程文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L326-L328 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/DenoiseVisuShrink_F32.java | DenoiseVisuShrink_F32.denoise | @Override
public void denoise(GrayF32 transform , int numLevels ) {
int scale = UtilWavelet.computeScale(numLevels);
final int h = transform.height;
final int w = transform.width;
// width and height of scaling image
final int innerWidth = w/scale;
final int innerHeight = h/scale;
GrayF32 subbandHH = ... | java | @Override
public void denoise(GrayF32 transform , int numLevels ) {
int scale = UtilWavelet.computeScale(numLevels);
final int h = transform.height;
final int w = transform.width;
// width and height of scaling image
final int innerWidth = w/scale;
final int innerHeight = h/scale;
GrayF32 subbandHH = ... | [
"@",
"Override",
"public",
"void",
"denoise",
"(",
"GrayF32",
"transform",
",",
"int",
"numLevels",
")",
"{",
"int",
"scale",
"=",
"UtilWavelet",
".",
"computeScale",
"(",
"numLevels",
")",
";",
"final",
"int",
"h",
"=",
"transform",
".",
"height",
";",
... | Applies VisuShrink denoising to the provided multilevel wavelet transform using
the provided threshold.
@param transform Mult-level wavelet transform. Modified.
@param numLevels Number of levels in the transform. | [
"Applies",
"VisuShrink",
"denoising",
"to",
"the",
"provided",
"multilevel",
"wavelet",
"transform",
"using",
"the",
"provided",
"threshold",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/DenoiseVisuShrink_F32.java#L51-L69 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/sorting/SortUtils.java | SortUtils.getChain | public static IntComparatorChain getChain(Table table, Sort key) {
Iterator<Map.Entry<String, Sort.Order>> entries = key.iterator();
Map.Entry<String, Sort.Order> sort = entries.next();
Column<?> column = table.column(sort.getKey());
IntComparator comparator = rowComparator(column, sort.... | java | public static IntComparatorChain getChain(Table table, Sort key) {
Iterator<Map.Entry<String, Sort.Order>> entries = key.iterator();
Map.Entry<String, Sort.Order> sort = entries.next();
Column<?> column = table.column(sort.getKey());
IntComparator comparator = rowComparator(column, sort.... | [
"public",
"static",
"IntComparatorChain",
"getChain",
"(",
"Table",
"table",
",",
"Sort",
"key",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Sort",
".",
"Order",
">",
">",
"entries",
"=",
"key",
".",
"iterator",
"(",
")",
";",
... | Returns a comparator chain for sorting according to the given key | [
"Returns",
"a",
"comparator",
"chain",
"for",
"sorting",
"according",
"to",
"the",
"given",
"key"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/sorting/SortUtils.java#L17-L29 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newPasswordTextField | public static PasswordTextField newPasswordTextField(final String id,
final IModel<String> model)
{
final PasswordTextField passwordTextField = new PasswordTextField(id, model);
passwordTextField.setOutputMarkupId(true);
return passwordTextField;
} | java | public static PasswordTextField newPasswordTextField(final String id,
final IModel<String> model)
{
final PasswordTextField passwordTextField = new PasswordTextField(id, model);
passwordTextField.setOutputMarkupId(true);
return passwordTextField;
} | [
"public",
"static",
"PasswordTextField",
"newPasswordTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"String",
">",
"model",
")",
"{",
"final",
"PasswordTextField",
"passwordTextField",
"=",
"new",
"PasswordTextField",
"(",
"id",
",",
"model... | Factory method for create a new {@link PasswordTextField}.
@param id
the id
@param model
the model
@return the new {@link PasswordTextField} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"PasswordTextField",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L536-L542 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.initiateConference | public void initiateConference(
String connId,
String destination,
String location,
String outboundCallerId,
KeyValueCollection userData,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiExcepti... | java | public void initiateConference(
String connId,
String destination,
String location,
String outboundCallerId,
KeyValueCollection userData,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiExcepti... | [
"public",
"void",
"initiateConference",
"(",
"String",
"connId",
",",
"String",
"destination",
",",
"String",
"location",
",",
"String",
"outboundCallerId",
",",
"KeyValueCollection",
"userData",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensio... | Initiate a two-step conference to the specified destination. This places the existing call on
hold and creates a new call in the dialing state. After initiating the conference you can use
completeConference to complete the conference and bring all parties into the same call.
@param connId The connection ID of the call ... | [
"Initiate",
"a",
"two",
"-",
"step",
"conference",
"to",
"the",
"specified",
"destination",
".",
"This",
"places",
"the",
"existing",
"call",
"on",
"hold",
"and",
"creates",
"a",
"new",
"call",
"in",
"the",
"dialing",
"state",
".",
"After",
"initiating",
"... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L695-L721 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsDetailOnlyContainerUtil.java | CmsDetailOnlyContainerUtil.isDetailContainersPage | public static boolean isDetailContainersPage(CmsObject cms, String detailContainersPage) {
boolean result = false;
try {
String detailName = CmsResource.getName(detailContainersPage);
String parentFolder = CmsResource.getParentFolder(detailContainersPage);
if (!paren... | java | public static boolean isDetailContainersPage(CmsObject cms, String detailContainersPage) {
boolean result = false;
try {
String detailName = CmsResource.getName(detailContainersPage);
String parentFolder = CmsResource.getParentFolder(detailContainersPage);
if (!paren... | [
"public",
"static",
"boolean",
"isDetailContainersPage",
"(",
"CmsObject",
"cms",
",",
"String",
"detailContainersPage",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"String",
"detailName",
"=",
"CmsResource",
".",
"getName",
"(",
"detailContainer... | Checks whether the given resource path is of a detail containers page.<p>
@param cms the cms context
@param detailContainersPage the resource site path
@return <code>true</code> if the given resource path is of a detail containers page | [
"Checks",
"whether",
"the",
"given",
"resource",
"path",
"is",
"of",
"a",
"detail",
"containers",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsDetailOnlyContainerUtil.java#L305-L323 |
ribot/easy-adapter | library/src/main/java/uk/co/ribot/easyadapter/annotations/FieldAnnotationParser.java | FieldAnnotationParser.setViewFields | public static void setViewFields(final Object object, final View view) {
setViewFields(object, new ViewFinder() {
@Override
public View findViewById(int viewId) {
return view.findViewById(viewId);
}
});
} | java | public static void setViewFields(final Object object, final View view) {
setViewFields(object, new ViewFinder() {
@Override
public View findViewById(int viewId) {
return view.findViewById(viewId);
}
});
} | [
"public",
"static",
"void",
"setViewFields",
"(",
"final",
"Object",
"object",
",",
"final",
"View",
"view",
")",
"{",
"setViewFields",
"(",
"object",
",",
"new",
"ViewFinder",
"(",
")",
"{",
"@",
"Override",
"public",
"View",
"findViewById",
"(",
"int",
"... | Parse {@link ViewId} annotation and try to assign the view with that id to the annotated field.
It will throw a {@link ClassCastException} if the field and the view with the given ID have different types.
@param object object where the annotation is.
@param view parent view that contains a view with the viewId given... | [
"Parse",
"{",
"@link",
"ViewId",
"}",
"annotation",
"and",
"try",
"to",
"assign",
"the",
"view",
"with",
"that",
"id",
"to",
"the",
"annotated",
"field",
".",
"It",
"will",
"throw",
"a",
"{",
"@link",
"ClassCastException",
"}",
"if",
"the",
"field",
"and... | train | https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/library/src/main/java/uk/co/ribot/easyadapter/annotations/FieldAnnotationParser.java#L33-L40 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheEventListenerConfigurationBuilder.java | CacheEventListenerConfigurationBuilder.constructedWith | public CacheEventListenerConfigurationBuilder constructedWith(Object... arguments) {
if (this.listenerClass == null) {
throw new IllegalArgumentException("Arguments only are meaningful with class-based builder, this one seems to be an instance-based one");
}
CacheEventListenerConfigurationBuilder othe... | java | public CacheEventListenerConfigurationBuilder constructedWith(Object... arguments) {
if (this.listenerClass == null) {
throw new IllegalArgumentException("Arguments only are meaningful with class-based builder, this one seems to be an instance-based one");
}
CacheEventListenerConfigurationBuilder othe... | [
"public",
"CacheEventListenerConfigurationBuilder",
"constructedWith",
"(",
"Object",
"...",
"arguments",
")",
"{",
"if",
"(",
"this",
".",
"listenerClass",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Arguments only are meaningful with clas... | Adds arguments that will be passed to the constructor of the {@link CacheEventListener} subclass configured
previously.
@param arguments the constructor arguments
@return a new builder with the added constructor arguments
@throws IllegalArgumentException if this builder is instance based | [
"Adds",
"arguments",
"that",
"will",
"be",
"passed",
"to",
"the",
"constructor",
"of",
"the",
"{",
"@link",
"CacheEventListener",
"}",
"subclass",
"configured",
"previously",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheEventListenerConfigurationBuilder.java#L159-L166 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java | SunCalc.getPosition | public static Coordinate getPosition(Date date, double lat,
double lng) {
if (isGeographic(lat, lng)) {
double lw = rad * -lng;
double phi = rad * lat;
double J = dateToJulianDate(date);
double M = getSolarMeanAnomaly(J);
double C = getEqua... | java | public static Coordinate getPosition(Date date, double lat,
double lng) {
if (isGeographic(lat, lng)) {
double lw = rad * -lng;
double phi = rad * lat;
double J = dateToJulianDate(date);
double M = getSolarMeanAnomaly(J);
double C = getEqua... | [
"public",
"static",
"Coordinate",
"getPosition",
"(",
"Date",
"date",
",",
"double",
"lat",
",",
"double",
"lng",
")",
"{",
"if",
"(",
"isGeographic",
"(",
"lat",
",",
"lng",
")",
")",
"{",
"double",
"lw",
"=",
"rad",
"*",
"-",
"lng",
";",
"double",
... | Returns the sun position as a coordinate with the following properties
x: sun azimuth in radians (direction along the horizon, measured from south to
west), e.g. 0 is south and Math.PI * 3/4 is northwest.
y: sun altitude above the horizon in radians, e.g. 0 at the
horizon and PI/2 at the zenith (straight over your hea... | [
"Returns",
"the",
"sun",
"position",
"as",
"a",
"coordinate",
"with",
"the",
"following",
"properties"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/SunCalc.java#L155-L172 |
alkacon/opencms-core | src/org/opencms/xml/page/CmsXmlPage.java | CmsXmlPage.renameValue | public void renameValue(String oldValue, String newValue, Locale locale) throws CmsIllegalArgumentException {
CmsXmlHtmlValue oldXmlHtmlValue = (CmsXmlHtmlValue)getValue(oldValue, locale);
if (oldXmlHtmlValue == null) {
throw new CmsIllegalArgumentException(
Messages.get().c... | java | public void renameValue(String oldValue, String newValue, Locale locale) throws CmsIllegalArgumentException {
CmsXmlHtmlValue oldXmlHtmlValue = (CmsXmlHtmlValue)getValue(oldValue, locale);
if (oldXmlHtmlValue == null) {
throw new CmsIllegalArgumentException(
Messages.get().c... | [
"public",
"void",
"renameValue",
"(",
"String",
"oldValue",
",",
"String",
"newValue",
",",
"Locale",
"locale",
")",
"throws",
"CmsIllegalArgumentException",
"{",
"CmsXmlHtmlValue",
"oldXmlHtmlValue",
"=",
"(",
"CmsXmlHtmlValue",
")",
"getValue",
"(",
"oldValue",
",... | Renames the page-element value from the old to the new one.<p>
@param oldValue the old value
@param newValue the new value
@param locale the locale
@throws CmsIllegalArgumentException if the name contains an index ("[<number>]"), the new value for the
given locale already exists in the xmlpage or the the old va... | [
"Renames",
"the",
"page",
"-",
"element",
"value",
"from",
"the",
"old",
"to",
"the",
"new",
"one",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/page/CmsXmlPage.java#L371-L396 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadUrlRequest | public BoxRequestsFile.DownloadFile getDownloadUrlRequest(File target, String url) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(target, url,mSession);
return request;
... | java | public BoxRequestsFile.DownloadFile getDownloadUrlRequest(File target, String url) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(target, url,mSession);
return request;
... | [
"public",
"BoxRequestsFile",
".",
"DownloadFile",
"getDownloadUrlRequest",
"(",
"File",
"target",
",",
"String",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"target",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"("... | Gets a request that downloads a given asset from the url to a target file
This is used to download miscellaneous url assets for instance from the representations endpoint.
@param target target file to download to, target can be either a directory or a file
@param url url of the asset to download
@return request ... | [
"Gets",
"a",
"request",
"that",
"downloads",
"a",
"given",
"asset",
"from",
"the",
"url",
"to",
"a",
"target",
"file",
"This",
"is",
"used",
"to",
"download",
"miscellaneous",
"url",
"assets",
"for",
"instance",
"from",
"the",
"representations",
"endpoint",
... | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L383-L389 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java | WButton.setPressed | protected void setPressed(final boolean pressed, final Request request) {
if (pressed && isDisabled()) {
// Protect against client-side tampering of disabled/read-only fields.
LOG.warn("A disabled button has been triggered. " + getText() + ". " + getId());
return;
}
if (pressed != isPressed()) {
getO... | java | protected void setPressed(final boolean pressed, final Request request) {
if (pressed && isDisabled()) {
// Protect against client-side tampering of disabled/read-only fields.
LOG.warn("A disabled button has been triggered. " + getText() + ". " + getId());
return;
}
if (pressed != isPressed()) {
getO... | [
"protected",
"void",
"setPressed",
"(",
"final",
"boolean",
"pressed",
",",
"final",
"Request",
"request",
")",
"{",
"if",
"(",
"pressed",
"&&",
"isDisabled",
"(",
")",
")",
"{",
"// Protect against client-side tampering of disabled/read-only fields.",
"LOG",
".",
"... | Sets whether this button is pressed. You probably do not want to invoke this manually, it is called from
{@link #handleRequest}. If the button is pressed its Action is queued so it is invoked after the entire request
has been handled.
@param pressed true for pressed, false for not pressed
@param request the Request th... | [
"Sets",
"whether",
"this",
"button",
"is",
"pressed",
".",
"You",
"probably",
"do",
"not",
"want",
"to",
"invoke",
"this",
"manually",
"it",
"is",
"called",
"from",
"{",
"@link",
"#handleRequest",
"}",
".",
"If",
"the",
"button",
"is",
"pressed",
"its",
... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WButton.java#L194-L237 |
casmi/casmi | src/main/java/casmi/graphics/element/Polygon.java | Polygon.setCornerColor | public void setCornerColor(int index, Color color) {
if (cornerColor == null) {
for (int i = 0; i < cornerX.size(); i++) {
cornerColor.add(new RGBColor(this.fillColor.getRed(), this.fillColor.getGreen(),
this.fillColor.getBlue(), this.fillColor.getAlpha()));
... | java | public void setCornerColor(int index, Color color) {
if (cornerColor == null) {
for (int i = 0; i < cornerX.size(); i++) {
cornerColor.add(new RGBColor(this.fillColor.getRed(), this.fillColor.getGreen(),
this.fillColor.getBlue(), this.fillColor.getAlpha()));
... | [
"public",
"void",
"setCornerColor",
"(",
"int",
"index",
",",
"Color",
"color",
")",
"{",
"if",
"(",
"cornerColor",
"==",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cornerX",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
... | Sets the color of a corner.
@param index The index number of a corner.
@param color The color of a corner. | [
"Sets",
"the",
"color",
"of",
"a",
"corner",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Polygon.java#L286-L301 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java | UriReader.readString | public String readString(URI uri, Charset charset) {
return searchForSupportedProcessor(uri).readString(uri, charset);
} | java | public String readString(URI uri, Charset charset) {
return searchForSupportedProcessor(uri).readString(uri, charset);
} | [
"public",
"String",
"readString",
"(",
"URI",
"uri",
",",
"Charset",
"charset",
")",
"{",
"return",
"searchForSupportedProcessor",
"(",
"uri",
")",
".",
"readString",
"(",
"uri",
",",
"charset",
")",
";",
"}"
] | Reads all characters from uri, using the given character set.
It throws an unchecked exception if an error occurs. | [
"Reads",
"all",
"characters",
"from",
"uri",
"using",
"the",
"given",
"character",
"set",
".",
"It",
"throws",
"an",
"unchecked",
"exception",
"if",
"an",
"error",
"occurs",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java#L69-L71 |
bazaarvoice/emodb | databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java | DatabusClient.replayAsync | @Override
public String replayAsync(String apiKey, String subscription) {
return replayAsyncSince(apiKey, subscription, null);
} | java | @Override
public String replayAsync(String apiKey, String subscription) {
return replayAsyncSince(apiKey, subscription, null);
} | [
"@",
"Override",
"public",
"String",
"replayAsync",
"(",
"String",
"apiKey",
",",
"String",
"subscription",
")",
"{",
"return",
"replayAsyncSince",
"(",
"apiKey",
",",
"subscription",
",",
"null",
")",
";",
"}"
] | Any server can initiate a replay request, no need for @PartitionKey | [
"Any",
"server",
"can",
"initiate",
"a",
"replay",
"request",
"no",
"need",
"for"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus-client-common/src/main/java/com/bazaarvoice/emodb/databus/client/DatabusClient.java#L289-L292 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuRefactorUtil.java | GosuRefactorUtil.boundingParent | public static IParsedElement boundingParent( List<IParseTree> locations, int position, Class<? extends IParsedElement>... possibleTypes )
{
IParseTree location = IParseTree.Search.getDeepestLocation( locations, position, true );
IParsedElement pe = null;
if( location != null )
{
pe = location.g... | java | public static IParsedElement boundingParent( List<IParseTree> locations, int position, Class<? extends IParsedElement>... possibleTypes )
{
IParseTree location = IParseTree.Search.getDeepestLocation( locations, position, true );
IParsedElement pe = null;
if( location != null )
{
pe = location.g... | [
"public",
"static",
"IParsedElement",
"boundingParent",
"(",
"List",
"<",
"IParseTree",
">",
"locations",
",",
"int",
"position",
",",
"Class",
"<",
"?",
"extends",
"IParsedElement",
">",
"...",
"possibleTypes",
")",
"{",
"IParseTree",
"location",
"=",
"IParseTr... | Finds a bounding parent of any of the possible types passed in from the list of locations, starting at the position
given. | [
"Finds",
"a",
"bounding",
"parent",
"of",
"any",
"of",
"the",
"possible",
"types",
"passed",
"in",
"from",
"the",
"list",
"of",
"locations",
"starting",
"at",
"the",
"position",
"given",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuRefactorUtil.java#L23-L37 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java | JpaSystemManagement.createInitialTenantMetaData | private TenantMetaData createInitialTenantMetaData(final String tenant) {
return systemSecurityContext.runAsSystemAsTenant(
() -> DeploymentHelper.runInNewTransaction(txManager, "initial-tenant-creation", status -> {
final DistributionSetType defaultDsType = createStandardSof... | java | private TenantMetaData createInitialTenantMetaData(final String tenant) {
return systemSecurityContext.runAsSystemAsTenant(
() -> DeploymentHelper.runInNewTransaction(txManager, "initial-tenant-creation", status -> {
final DistributionSetType defaultDsType = createStandardSof... | [
"private",
"TenantMetaData",
"createInitialTenantMetaData",
"(",
"final",
"String",
"tenant",
")",
"{",
"return",
"systemSecurityContext",
".",
"runAsSystemAsTenant",
"(",
"(",
")",
"->",
"DeploymentHelper",
".",
"runInNewTransaction",
"(",
"txManager",
",",
"\"initial-... | Creating the initial tenant meta-data in a new transaction. Due the
{@link MultiTenantJpaTransactionManager} is using the current tenant to
set the necessary tenant discriminator to the query. This is not working
if we don't have a current tenant set. Due the
{@link #getTenantMetadata(String)} is maybe called without h... | [
"Creating",
"the",
"initial",
"tenant",
"meta",
"-",
"data",
"in",
"a",
"new",
"transaction",
".",
"Due",
"the",
"{",
"@link",
"MultiTenantJpaTransactionManager",
"}",
"is",
"using",
"the",
"current",
"tenant",
"to",
"set",
"the",
"necessary",
"tenant",
"discr... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java#L208-L214 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.toInputStream | public static InputStream toInputStream(String str, Charset charset) {
return new ByteArrayInputStream(str.getBytes(charset));
} | java | public static InputStream toInputStream(String str, Charset charset) {
return new ByteArrayInputStream(str.getBytes(charset));
} | [
"public",
"static",
"InputStream",
"toInputStream",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"{",
"return",
"new",
"ByteArrayInputStream",
"(",
"str",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | Turns a {@code String} into an {@code InputStream} containing the string's encoded characters.
@param str the string
@param charset the {@link Charset} to use when encoding the string.
@return an {@link InputStream} containing the string's encoded characters. | [
"Turns",
"a",
"{",
"@code",
"String",
"}",
"into",
"an",
"{",
"@code",
"InputStream",
"}",
"containing",
"the",
"string",
"s",
"encoded",
"characters",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L767-L769 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/agent/AgentService.java | AgentService.setupZookeeperClient | private ZooKeeperClient setupZookeeperClient(final AgentConfig config, final String id,
final CountDownLatch zkRegistrationSignal) {
ACLProvider aclProvider = null;
List<AuthInfo> authorization = null;
final String agentUser = config.getZookeeperAclAgentUser()... | java | private ZooKeeperClient setupZookeeperClient(final AgentConfig config, final String id,
final CountDownLatch zkRegistrationSignal) {
ACLProvider aclProvider = null;
List<AuthInfo> authorization = null;
final String agentUser = config.getZookeeperAclAgentUser()... | [
"private",
"ZooKeeperClient",
"setupZookeeperClient",
"(",
"final",
"AgentConfig",
"config",
",",
"final",
"String",
"id",
",",
"final",
"CountDownLatch",
"zkRegistrationSignal",
")",
"{",
"ACLProvider",
"aclProvider",
"=",
"null",
";",
"List",
"<",
"AuthInfo",
">",... | Create a Zookeeper client and create the control and state nodes if needed.
@param config The service configuration.
@return A zookeeper client. | [
"Create",
"a",
"Zookeeper",
"client",
"and",
"create",
"the",
"control",
"and",
"state",
"nodes",
"if",
"needed",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/agent/AgentService.java#L398-L457 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java | SoundStore.getOggStream | public Audio getOggStream(String ref) throws IOException {
if (!soundWorks) {
return new NullAudio();
}
setMOD(null);
setStream(null);
if (currentMusic != -1) {
AL10.alSourceStop(sources.get(0));
}
getMusicSource();
currentMusic = sources.get(0);
return new StreamSound... | java | public Audio getOggStream(String ref) throws IOException {
if (!soundWorks) {
return new NullAudio();
}
setMOD(null);
setStream(null);
if (currentMusic != -1) {
AL10.alSourceStop(sources.get(0));
}
getMusicSource();
currentMusic = sources.get(0);
return new StreamSound... | [
"public",
"Audio",
"getOggStream",
"(",
"String",
"ref",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"soundWorks",
")",
"{",
"return",
"new",
"NullAudio",
"(",
")",
";",
"}",
"setMOD",
"(",
"null",
")",
";",
"setStream",
"(",
"null",
")",
";",
... | Get the Sound based on a specified OGG file
@param ref The reference to the OGG file in the classpath
@return The Sound read from the OGG file
@throws IOException Indicates a failure to load the OGG | [
"Get",
"the",
"Sound",
"based",
"on",
"a",
"specified",
"OGG",
"file"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java#L742-L758 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.gtProperty | public PropertyConstraint gtProperty(String propertyName, String otherPropertyName) {
return valueProperties(propertyName, GreaterThan.instance(), otherPropertyName);
} | java | public PropertyConstraint gtProperty(String propertyName, String otherPropertyName) {
return valueProperties(propertyName, GreaterThan.instance(), otherPropertyName);
} | [
"public",
"PropertyConstraint",
"gtProperty",
"(",
"String",
"propertyName",
",",
"String",
"otherPropertyName",
")",
"{",
"return",
"valueProperties",
"(",
"propertyName",
",",
"GreaterThan",
".",
"instance",
"(",
")",
",",
"otherPropertyName",
")",
";",
"}"
] | Apply a "greater than" constraint to two properties
@param propertyName The first property
@param otherPropertyName The other property
@return The constraint | [
"Apply",
"a",
"greater",
"than",
"constraint",
"to",
"two",
"properties"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L853-L855 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/build/Factory.java | Factory.registerAsType | public void registerAsType(Object locator, Class<?> type) {
if (locator == null)
throw new NullPointerException("Locator cannot be null");
if (type == null)
throw new NullPointerException("Type cannot be null");
IComponentFactory factory = new DefaultComponentFactory(type);
_registrations.add(new Registr... | java | public void registerAsType(Object locator, Class<?> type) {
if (locator == null)
throw new NullPointerException("Locator cannot be null");
if (type == null)
throw new NullPointerException("Type cannot be null");
IComponentFactory factory = new DefaultComponentFactory(type);
_registrations.add(new Registr... | [
"public",
"void",
"registerAsType",
"(",
"Object",
"locator",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"locator",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Locator cannot be null\"",
")",
";",
"if",
"(",
"type",
"=... | Registers a component using its type (a constructor function).
@param locator a locator to identify component to be created.
@param type a component type. | [
"Registers",
"a",
"component",
"using",
"its",
"type",
"(",
"a",
"constructor",
"function",
")",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/build/Factory.java#L94-L102 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureFromHomographies.java | ProjectiveStructureFromHomographies.constructLinearSystem | void constructLinearSystem(List<DMatrixRMaj> homographies,
List<List<PointIndex2D_F64>> observations) {
// parameters are encoded points first then the
int startView = totalFeatures*3;
A.reshape(numEquations,numUnknown);
DMatrixRMaj H = new DMatrixRMaj(3,3);
Point2D_F64 p = new Point2D_F64();
i... | java | void constructLinearSystem(List<DMatrixRMaj> homographies,
List<List<PointIndex2D_F64>> observations) {
// parameters are encoded points first then the
int startView = totalFeatures*3;
A.reshape(numEquations,numUnknown);
DMatrixRMaj H = new DMatrixRMaj(3,3);
Point2D_F64 p = new Point2D_F64();
i... | [
"void",
"constructLinearSystem",
"(",
"List",
"<",
"DMatrixRMaj",
">",
"homographies",
",",
"List",
"<",
"List",
"<",
"PointIndex2D_F64",
">",
">",
"observations",
")",
"{",
"// parameters are encoded points first then the",
"int",
"startView",
"=",
"totalFeatures",
"... | Constructs the linear systems. Unknowns are sorted in index order. structure (3D points) are first followed
by unknown t from projective. | [
"Constructs",
"the",
"linear",
"systems",
".",
"Unknowns",
"are",
"sorted",
"in",
"index",
"order",
".",
"structure",
"(",
"3D",
"points",
")",
"are",
"first",
"followed",
"by",
"unknown",
"t",
"from",
"projective",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/structure/ProjectiveStructureFromHomographies.java#L156-L204 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/Period.java | Period.plusMonths | public Period plusMonths(long monthsToAdd) {
if (monthsToAdd == 0) {
return this;
}
return create(years, Jdk8Methods.safeToInt(Jdk8Methods.safeAdd(months, monthsToAdd)), days);
} | java | public Period plusMonths(long monthsToAdd) {
if (monthsToAdd == 0) {
return this;
}
return create(years, Jdk8Methods.safeToInt(Jdk8Methods.safeAdd(months, monthsToAdd)), days);
} | [
"public",
"Period",
"plusMonths",
"(",
"long",
"monthsToAdd",
")",
"{",
"if",
"(",
"monthsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"return",
"create",
"(",
"years",
",",
"Jdk8Methods",
".",
"safeToInt",
"(",
"Jdk8Methods",
".",
"safeAdd",
... | Returns a copy of this period with the specified months added.
<p>
This adds the amount to the months unit in a copy of this period.
The years and days units are unaffected.
For example, "1 year, 6 months and 3 days" plus 2 months returns "1 year, 8 months and 3 days".
<p>
This instance is immutable and unaffected by t... | [
"Returns",
"a",
"copy",
"of",
"this",
"period",
"with",
"the",
"specified",
"months",
"added",
".",
"<p",
">",
"This",
"adds",
"the",
"amount",
"to",
"the",
"months",
"unit",
"in",
"a",
"copy",
"of",
"this",
"period",
".",
"The",
"years",
"and",
"days"... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/Period.java#L589-L594 |
alkacon/opencms-core | src/org/opencms/workflow/CmsExtendedWorkflowManager.java | CmsExtendedWorkflowManager.actionRelease | protected CmsWorkflowResponse actionRelease(CmsObject userCms, List<CmsResource> resources) throws CmsException {
checkNewParentsInList(userCms, resources);
String projectName = generateProjectName(userCms);
String projectDescription = generateProjectDescription(userCms);
CmsObject... | java | protected CmsWorkflowResponse actionRelease(CmsObject userCms, List<CmsResource> resources) throws CmsException {
checkNewParentsInList(userCms, resources);
String projectName = generateProjectName(userCms);
String projectDescription = generateProjectDescription(userCms);
CmsObject... | [
"protected",
"CmsWorkflowResponse",
"actionRelease",
"(",
"CmsObject",
"userCms",
",",
"List",
"<",
"CmsResource",
">",
"resources",
")",
"throws",
"CmsException",
"{",
"checkNewParentsInList",
"(",
"userCms",
",",
"resources",
")",
";",
"String",
"projectName",
"="... | Implementation of the 'release' workflow action.<p>
@param userCms the current user's CMS context
@param resources the resources which should be released
@return the workflow response for this action
@throws CmsException if something goes wrong | [
"Implementation",
"of",
"the",
"release",
"workflow",
"action",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/CmsExtendedWorkflowManager.java#L318-L358 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/assembly/GrokHandler.java | GrokHandler.endElement | @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (null != qName) {
switch (qName) {
case COMPANY_NAME:
data.setCompanyName(currentText.toString());
break;
case PRODUCT_NAM... | java | @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (null != qName) {
switch (qName) {
case COMPANY_NAME:
data.setCompanyName(currentText.toString());
break;
case PRODUCT_NAM... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"null",
"!=",
"qName",
")",
"{",
"switch",
"(",
"qName",
")",
"{",
"case",
"COMPANY_... | Handles the end element event.
@param uri the URI of the element
@param localName the local name of the element
@param qName the qName of the element
@throws SAXException thrown if there is an exception processing | [
"Handles",
"the",
"end",
"element",
"event",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/assembly/GrokHandler.java#L117-L164 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/common/rdf/JRDF.java | JRDF.sameResource | public static boolean sameResource(URIReference u1, URIReference u2) {
return sameResource(u1, u2.getURI().toString());
} | java | public static boolean sameResource(URIReference u1, URIReference u2) {
return sameResource(u1, u2.getURI().toString());
} | [
"public",
"static",
"boolean",
"sameResource",
"(",
"URIReference",
"u1",
",",
"URIReference",
"u2",
")",
"{",
"return",
"sameResource",
"(",
"u1",
",",
"u2",
".",
"getURI",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Tells whether the given resources are equivalent.
<p>
Two resources are equivalent if their URIs match.
@param u1
first resource.
@param u2
second resource.
@return true if equivalent, false otherwise. | [
"Tells",
"whether",
"the",
"given",
"resources",
"are",
"equivalent",
".",
"<p",
">",
"Two",
"resources",
"are",
"equivalent",
"if",
"their",
"URIs",
"match",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/common/rdf/JRDF.java#L56-L58 |
Azure/azure-sdk-for-java | mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java | SpatialAnchorsAccountsInner.getByResourceGroup | public SpatialAnchorsAccountInner getByResourceGroup(String resourceGroupName, String spatialAnchorsAccountName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName).toBlocking().single().body();
} | java | public SpatialAnchorsAccountInner getByResourceGroup(String resourceGroupName, String spatialAnchorsAccountName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName).toBlocking().single().body();
} | [
"public",
"SpatialAnchorsAccountInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"spatialAnchorsAccountName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"spatialAnchorsAccountName",
")",
".",
... | Retrieve a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by ... | [
"Retrieve",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L430-L432 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditor.java | CmsEditor.decodeParamValue | @Override
protected String decodeParamValue(String paramName, String paramValue) {
if ((paramName != null) && (paramValue != null)) {
if (PARAM_CONTENT.equals(paramName)) {
// content will be always encoded in UTF-8 unicode by the editor client
return CmsEncoder.... | java | @Override
protected String decodeParamValue(String paramName, String paramValue) {
if ((paramName != null) && (paramValue != null)) {
if (PARAM_CONTENT.equals(paramName)) {
// content will be always encoded in UTF-8 unicode by the editor client
return CmsEncoder.... | [
"@",
"Override",
"protected",
"String",
"decodeParamValue",
"(",
"String",
"paramName",
",",
"String",
"paramValue",
")",
"{",
"if",
"(",
"(",
"paramName",
"!=",
"null",
")",
"&&",
"(",
"paramValue",
"!=",
"null",
")",
")",
"{",
"if",
"(",
"PARAM_CONTENT",... | Decodes an individual parameter value, ensuring the content is always decoded in UTF-8.<p>
For editors the content is always encoded using the
JavaScript encodeURIComponent() method on the client,
which always encodes in UTF-8.<p>
@param paramName the name of the parameter
@param paramValue the unencoded value of the... | [
"Decodes",
"an",
"individual",
"parameter",
"value",
"ensuring",
"the",
"content",
"is",
"always",
"decoded",
"in",
"UTF",
"-",
"8",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditor.java#L876-L896 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/converters/StringToClassInstance.java | StringToClassInstance.decode | @Override
public T decode(final String s) {
checkNotNull(s);
try {
return constructor.newInstance(s);
} catch (final IllegalAccessException iae) {
throw new ConversionException("Cannot access a single-string constructor for type " + type,
iae);
} catch (final InstantiationExcepti... | java | @Override
public T decode(final String s) {
checkNotNull(s);
try {
return constructor.newInstance(s);
} catch (final IllegalAccessException iae) {
throw new ConversionException("Cannot access a single-string constructor for type " + type,
iae);
} catch (final InstantiationExcepti... | [
"@",
"Override",
"public",
"T",
"decode",
"(",
"final",
"String",
"s",
")",
"{",
"checkNotNull",
"(",
"s",
")",
";",
"try",
"{",
"return",
"constructor",
".",
"newInstance",
"(",
"s",
")",
";",
"}",
"catch",
"(",
"final",
"IllegalAccessException",
"iae",... | Constructs a new instance of {@code T} by invoking its single-string constructor.
@param s the string to convert from
@return a new instance of {@code T}, instantiated as though {@code new T(s)} had been invoked
@throws ConversionException if the constructor isn't accessible, {@code T} isn't a concrete
type, an excep... | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@code",
"T",
"}",
"by",
"invoking",
"its",
"single",
"-",
"string",
"constructor",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/converters/StringToClassInstance.java#L58-L75 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.