repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
xiancloud/xian
xian-cache/xian-redis/src/main/java/info/xiancloud/cache/redis/operate/ListCacheOperate.java
ListCacheOperate.remove
public static long remove(Jedis jedis, String key, Object valueObj) { """ List 移除元素 @param jedis jedis object @param key the cache key @param valueObj the value object @return 注意: if count is greater than 0 : 从表头开始向表尾搜索, 移除与 VALUE 相等的元素, 数量为 COUNT if count is lower than 0 : 从表尾开始向表头搜索, 移除与 VALUE 相等...
java
public static long remove(Jedis jedis, String key, Object valueObj) { final int count = 1; // > 0 String value = FormatUtil.formatValue(valueObj); return jedis.lrem(key, count, value); }
[ "public", "static", "long", "remove", "(", "Jedis", "jedis", ",", "String", "key", ",", "Object", "valueObj", ")", "{", "final", "int", "count", "=", "1", ";", "// > 0", "String", "value", "=", "FormatUtil", ".", "formatValue", "(", "valueObj", ")", ";",...
List 移除元素 @param jedis jedis object @param key the cache key @param valueObj the value object @return 注意: if count is greater than 0 : 从表头开始向表尾搜索, 移除与 VALUE 相等的元素, 数量为 COUNT if count is lower than 0 : 从表尾开始向表头搜索, 移除与 VALUE 相等的元素, 数量为 COUNT 的绝对值 if count equals 0 : 移除列表中所有与 VALUE 相等的值
[ "List", "移除元素" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-cache/xian-redis/src/main/java/info/xiancloud/cache/redis/operate/ListCacheOperate.java#L31-L37
gallandarakhneorg/afc
core/references/src/main/java/org/arakhne/afc/references/AbstractReferencedValueMap.java
AbstractReferencedValueMap.makeValue
protected final ReferencableValue<K, V> makeValue(K key, V value) { """ Create a storage object that permits to put the specified elements inside this map. @param key is the key associated to the value @param value is the value @return the new storage object """ return makeValue(key, value, this.queue)...
java
protected final ReferencableValue<K, V> makeValue(K key, V value) { return makeValue(key, value, this.queue); }
[ "protected", "final", "ReferencableValue", "<", "K", ",", "V", ">", "makeValue", "(", "K", "key", ",", "V", "value", ")", "{", "return", "makeValue", "(", "key", ",", "value", ",", "this", ".", "queue", ")", ";", "}" ]
Create a storage object that permits to put the specified elements inside this map. @param key is the key associated to the value @param value is the value @return the new storage object
[ "Create", "a", "storage", "object", "that", "permits", "to", "put", "the", "specified", "elements", "inside", "this", "map", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/references/src/main/java/org/arakhne/afc/references/AbstractReferencedValueMap.java#L242-L244
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/modules/CmsCloneModuleThread.java
CmsCloneModuleThread.replaceModuleName
private void replaceModuleName() throws CmsException, UnsupportedEncodingException { """ Initializes a thread to find and replace all occurrence of the module's path.<p> @throws CmsException in case writing the file fails @throws UnsupportedEncodingException in case of the wrong encoding """ CmsRe...
java
private void replaceModuleName() throws CmsException, UnsupportedEncodingException { CmsResourceFilter filter = CmsResourceFilter.ALL.addRequireFile().addExcludeState( CmsResource.STATE_DELETED).addRequireTimerange().addRequireVisible(); List<CmsResource> resources = getCms().readResources(...
[ "private", "void", "replaceModuleName", "(", ")", "throws", "CmsException", ",", "UnsupportedEncodingException", "{", "CmsResourceFilter", "filter", "=", "CmsResourceFilter", ".", "ALL", ".", "addRequireFile", "(", ")", ".", "addExcludeState", "(", "CmsResource", ".",...
Initializes a thread to find and replace all occurrence of the module's path.<p> @throws CmsException in case writing the file fails @throws UnsupportedEncodingException in case of the wrong encoding
[ "Initializes", "a", "thread", "to", "find", "and", "replace", "all", "occurrence", "of", "the", "module", "s", "path", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsCloneModuleThread.java#L947-L973
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMessageBoxRenderer.java
WMessageBoxRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { """ Paints the given WMessageBox. @param component the WMessageBox to paint. @param renderContext the RenderContext to paint to. """ WMessageBox messageBox = (WMessageBox) component; XmlStringBuilder ...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMessageBox messageBox = (WMessageBox) component; XmlStringBuilder xml = renderContext.getWriter(); if (messageBox.hasMessages()) { xml.appendTagOpen("ui:messagebox"); xml.appendAttribute("id", component....
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMessageBox", "messageBox", "=", "(", "WMessageBox", ")", "component", ";", "XmlStringBuilder", "xml", "=", "re...
Paints the given WMessageBox. @param component the WMessageBox to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMessageBox", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMessageBoxRenderer.java#L24-L66
atomix/atomix
protocols/primary-backup/src/main/java/io/atomix/protocols/backup/service/impl/PrimaryBackupServiceContext.java
PrimaryBackupServiceContext.getOrCreateSession
public PrimaryBackupSession getOrCreateSession(long sessionId, MemberId memberId) { """ Gets or creates a service session. @param sessionId the session to create @param memberId the owning node ID @return the service session """ PrimaryBackupSession session = sessions.get(sessionId); if (session ...
java
public PrimaryBackupSession getOrCreateSession(long sessionId, MemberId memberId) { PrimaryBackupSession session = sessions.get(sessionId); if (session == null) { session = createSession(sessionId, memberId); } return session; }
[ "public", "PrimaryBackupSession", "getOrCreateSession", "(", "long", "sessionId", ",", "MemberId", "memberId", ")", "{", "PrimaryBackupSession", "session", "=", "sessions", ".", "get", "(", "sessionId", ")", ";", "if", "(", "session", "==", "null", ")", "{", "...
Gets or creates a service session. @param sessionId the session to create @param memberId the owning node ID @return the service session
[ "Gets", "or", "creates", "a", "service", "session", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/primary-backup/src/main/java/io/atomix/protocols/backup/service/impl/PrimaryBackupServiceContext.java#L534-L540
wisdom-framework/wisdom-jcr
wisdom-jcr-core/src/main/java/org/wisdom/jcrom/runtime/JcrTools.java
JcrTools.registerMixinType
public static void registerMixinType(Session session, String mixin) throws RepositoryException { """ Register new mixin type if does not exists on workspace @param session the JCR session @param mixin the mixin name to register @throws RepositoryException """ NodeTypeManager nodeTypeManager = sess...
java
public static void registerMixinType(Session session, String mixin) throws RepositoryException { NodeTypeManager nodeTypeManager = session.getWorkspace().getNodeTypeManager(); if (!nodeTypeManager.hasNodeType(mixin)) { NodeTypeTemplate nodeTypeTemplate = nodeTypeManager.createNodeTypeTemplat...
[ "public", "static", "void", "registerMixinType", "(", "Session", "session", ",", "String", "mixin", ")", "throws", "RepositoryException", "{", "NodeTypeManager", "nodeTypeManager", "=", "session", ".", "getWorkspace", "(", ")", ".", "getNodeTypeManager", "(", ")", ...
Register new mixin type if does not exists on workspace @param session the JCR session @param mixin the mixin name to register @throws RepositoryException
[ "Register", "new", "mixin", "type", "if", "does", "not", "exists", "on", "workspace" ]
train
https://github.com/wisdom-framework/wisdom-jcr/blob/2711383dde2239a19b90c226b3fd2aecab5715e4/wisdom-jcr-core/src/main/java/org/wisdom/jcrom/runtime/JcrTools.java#L988-L998
aleksandr-m/gitflow-maven-plugin
src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java
AbstractGitFlowMojo.executeCommand
private CommandResult executeCommand(final Commandline cmd, final boolean failOnError, final String argStr, final String... args) throws CommandLineException, MojoFailureException { """ Executes command line. @param cmd Command line. @param failOnError Whether to throw exc...
java
private CommandResult executeCommand(final Commandline cmd, final boolean failOnError, final String argStr, final String... args) throws CommandLineException, MojoFailureException { // initialize executables initExecutables(); if (getLog().isDebugEnabled()) {...
[ "private", "CommandResult", "executeCommand", "(", "final", "Commandline", "cmd", ",", "final", "boolean", "failOnError", ",", "final", "String", "argStr", ",", "final", "String", "...", "args", ")", "throws", "CommandLineException", ",", "MojoFailureException", "{"...
Executes command line. @param cmd Command line. @param failOnError Whether to throw exception on NOT success exit code. @param argStr Command line arguments as a string. @param args Command line arguments. @return {@link CommandResult} instance holding command exit code, output and error if any. @throws CommandLineExc...
[ "Executes", "command", "line", "." ]
train
https://github.com/aleksandr-m/gitflow-maven-plugin/blob/d7be13c653d885c1cb1d8cd0337fa9db985c381e/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java#L1071-L1112
arquillian/arquillian-extension-warp
impl/src/main/java/org/jboss/arquillian/warp/impl/client/deployment/DeploymentEnricher.java
DeploymentEnricher.process
@Override public void process(TestDeployment testDeployment, Archive<?> protocolArchive) { """ Adds Warp archive to the protocol archive to make it available for WARs and EARs. """ final TestClass testClass = this.testClass.get(); final Archive<?> applicationArchive = testDeployment.getAppl...
java
@Override public void process(TestDeployment testDeployment, Archive<?> protocolArchive) { final TestClass testClass = this.testClass.get(); final Archive<?> applicationArchive = testDeployment.getApplicationArchive(); if (WarpCommons.isWarpTest(testClass.getJavaClass())) { if (...
[ "@", "Override", "public", "void", "process", "(", "TestDeployment", "testDeployment", ",", "Archive", "<", "?", ">", "protocolArchive", ")", "{", "final", "TestClass", "testClass", "=", "this", ".", "testClass", ".", "get", "(", ")", ";", "final", "Archive"...
Adds Warp archive to the protocol archive to make it available for WARs and EARs.
[ "Adds", "Warp", "archive", "to", "the", "protocol", "archive", "to", "make", "it", "available", "for", "WARs", "and", "EARs", "." ]
train
https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/impl/src/main/java/org/jboss/arquillian/warp/impl/client/deployment/DeploymentEnricher.java#L106-L123
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java
MLStructure.getField
public MLArray getField(String name, int index) { """ Gets a value of the field described by name from index'th struct in struct array or null if the field doesn't exist. @param name @param index @return value of the field or null if the field doesn't exist """ if (mlStructArray.isEmpty()) { r...
java
public MLArray getField(String name, int index) { if (mlStructArray.isEmpty()) { return null; } return mlStructArray.get(index).get(name); }
[ "public", "MLArray", "getField", "(", "String", "name", ",", "int", "index", ")", "{", "if", "(", "mlStructArray", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "return", "mlStructArray", ".", "get", "(", "index", ")", ".", "get", "...
Gets a value of the field described by name from index'th struct in struct array or null if the field doesn't exist. @param name @param index @return value of the field or null if the field doesn't exist
[ "Gets", "a", "value", "of", "the", "field", "described", "by", "name", "from", "index", "th", "struct", "in", "struct", "array", "or", "null", "if", "the", "field", "doesn", "t", "exist", "." ]
train
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L198-L204
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java
AdHocCommandManager.getRemoteCommand
public RemoteCommand getRemoteCommand(Jid jid, String node) { """ Returns a command that represents an instance of a command in a remote host. It is used to execute remote commands. The concept is similar to RMI. Every invocation on this command is equivalent to an invocation in the remote command. @param ji...
java
public RemoteCommand getRemoteCommand(Jid jid, String node) { return new RemoteCommand(connection(), node, jid); }
[ "public", "RemoteCommand", "getRemoteCommand", "(", "Jid", "jid", ",", "String", "node", ")", "{", "return", "new", "RemoteCommand", "(", "connection", "(", ")", ",", "node", ",", "jid", ")", ";", "}" ]
Returns a command that represents an instance of a command in a remote host. It is used to execute remote commands. The concept is similar to RMI. Every invocation on this command is equivalent to an invocation in the remote command. @param jid the full JID of the host of the remote command @param node the identifier ...
[ "Returns", "a", "command", "that", "represents", "an", "instance", "of", "a", "command", "in", "a", "remote", "host", ".", "It", "is", "used", "to", "execute", "remote", "commands", ".", "The", "concept", "is", "similar", "to", "RMI", ".", "Every", "invo...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java#L277-L279
vvakame/JsonPullParser
jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java
JsonUtil.put
public static void put(Writer writer, Date value) throws IOException { """ Writes the given value with the given writer. @param writer @param value @throws IOException @author vvakame """ if (value == null) { writer.write("null"); } else { writer.write(String.valueOf(value.getTime())); } }
java
public static void put(Writer writer, Date value) throws IOException { if (value == null) { writer.write("null"); } else { writer.write(String.valueOf(value.getTime())); } }
[ "public", "static", "void", "put", "(", "Writer", "writer", ",", "Date", "value", ")", "throws", "IOException", "{", "if", "(", "value", "==", "null", ")", "{", "writer", ".", "write", "(", "\"null\"", ")", ";", "}", "else", "{", "writer", ".", "writ...
Writes the given value with the given writer. @param writer @param value @throws IOException @author vvakame
[ "Writes", "the", "given", "value", "with", "the", "given", "writer", "." ]
train
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L570-L576
zandero/http
src/main/java/com/zandero/http/RequestUtils.java
RequestUtils.isIpAddressAllowed
public static boolean isIpAddressAllowed(String ipAddress, String... whitelist) { """ Compares ipAddress with one of the ip addresses listed @param ipAddress ip address to compare @param whitelist list of ip addresses ... an be a range ip ... in format 123.123.123.123/28 where last part is a subnet range @ret...
java
public static boolean isIpAddressAllowed(String ipAddress, String... whitelist) { if (StringUtils.isNullOrEmpty(ipAddress) || whitelist == null || whitelist.length == 0) { return false; } for (String address : whitelist) { if (ipAddress.equals(address)) { return true; } if (address.contains("/...
[ "public", "static", "boolean", "isIpAddressAllowed", "(", "String", "ipAddress", ",", "String", "...", "whitelist", ")", "{", "if", "(", "StringUtils", ".", "isNullOrEmpty", "(", "ipAddress", ")", "||", "whitelist", "==", "null", "||", "whitelist", ".", "lengt...
Compares ipAddress with one of the ip addresses listed @param ipAddress ip address to compare @param whitelist list of ip addresses ... an be a range ip ... in format 123.123.123.123/28 where last part is a subnet range @return true if allowed, false if not
[ "Compares", "ipAddress", "with", "one", "of", "the", "ip", "addresses", "listed" ]
train
https://github.com/zandero/http/blob/909eb879f1193adf24545360c3b76bd813865f65/src/main/java/com/zandero/http/RequestUtils.java#L128-L152
QSFT/Doradus
doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java
HelloDory.run
private void run(String[] args) { """ Create a Dory client connection and execute the example commands. """ if (args.length != 2) { usage(); } System.out.println("Opening Doradus server: " + args[0] + ":" + args[1]); try (DoradusClient client = new Dor...
java
private void run(String[] args) { if (args.length != 2) { usage(); } System.out.println("Opening Doradus server: " + args[0] + ":" + args[1]); try (DoradusClient client = new DoradusClient(args[0], Integer.parseInt(args[1]))) { deleteApplication(cl...
[ "private", "void", "run", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "!=", "2", ")", "{", "usage", "(", ")", ";", "}", "System", ".", "out", ".", "println", "(", "\"Opening Doradus server: \"", "+", "args", "[", "0...
Create a Dory client connection and execute the example commands.
[ "Create", "a", "Dory", "client", "connection", "and", "execute", "the", "example", "commands", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java#L84-L97
smurn/jPLY
jply/src/main/java/org/smurn/jply/Element.java
Element.setIntList
public void setIntList(final String propertyName, final int[] values) { """ Sets the value of a property-list. If the property is not a list, the first element is used. @param propertyName Name of the property to set. @param values Values to set for that property. @throws NullPointerException if {@code propert...
java
public void setIntList(final String propertyName, final int[] values) { if (propertyName == null) { throw new NullPointerException("propertyName must not be null."); } Integer index = propertyMap.get(propertyName); if (index == null) { throw new IllegalArgumentExc...
[ "public", "void", "setIntList", "(", "final", "String", "propertyName", ",", "final", "int", "[", "]", "values", ")", "{", "if", "(", "propertyName", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"propertyName must not be null.\"", ")", ...
Sets the value of a property-list. If the property is not a list, the first element is used. @param propertyName Name of the property to set. @param values Values to set for that property. @throws NullPointerException if {@code propertyName} is {@code null}. @throws IllegalArgumentException if the element type does not...
[ "Sets", "the", "value", "of", "a", "property", "-", "list", ".", "If", "the", "property", "is", "not", "a", "list", "the", "first", "element", "is", "used", "." ]
train
https://github.com/smurn/jPLY/blob/77cb8c47fff7549ae1da8d8568ad8bdf374fe89f/jply/src/main/java/org/smurn/jply/Element.java#L244-L264
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java
PermissionUtil.getExplicitPermission
public static long getExplicitPermission(Channel channel, Member member) { """ Retrieves the explicit permissions of the specified {@link net.dv8tion.jda.core.entities.Member Member} in its hosting {@link net.dv8tion.jda.core.entities.Guild Guild} and specific {@link net.dv8tion.jda.core.entities.Channel Channel}...
java
public static long getExplicitPermission(Channel channel, Member member) { Checks.notNull(channel, "Channel"); Checks.notNull(member, "Member"); final Guild guild = member.getGuild(); checkGuild(channel.getGuild(), guild, "Member"); long permission = getExplicitPermission(m...
[ "public", "static", "long", "getExplicitPermission", "(", "Channel", "channel", ",", "Member", "member", ")", "{", "Checks", ".", "notNull", "(", "channel", ",", "\"Channel\"", ")", ";", "Checks", ".", "notNull", "(", "member", ",", "\"Member\"", ")", ";", ...
Retrieves the explicit permissions of the specified {@link net.dv8tion.jda.core.entities.Member Member} in its hosting {@link net.dv8tion.jda.core.entities.Guild Guild} and specific {@link net.dv8tion.jda.core.entities.Channel Channel}. <br>This method does not calculate the owner in. <b>Allowed permissions override de...
[ "Retrieves", "the", "explicit", "permissions", "of", "the", "specified", "{", "@link", "net", ".", "dv8tion", ".", "jda", ".", "core", ".", "entities", ".", "Member", "Member", "}", "in", "its", "hosting", "{", "@link", "net", ".", "dv8tion", ".", "jda",...
train
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L510-L527
tracee/tracee
core/src/main/java/io/tracee/transport/SoapHeaderTransport.java
SoapHeaderTransport.renderSoapHeader
private <T> void renderSoapHeader(final Marshallable<T> marshallable, final Map<String, String> context, T xmlContext) { """ Renders a given context map into a given result that should be the TPIC header node. """ try { final Marshaller marshaller = jaxbContext.createMarshaller(); marshallable.marshal(...
java
private <T> void renderSoapHeader(final Marshallable<T> marshallable, final Map<String, String> context, T xmlContext) { try { final Marshaller marshaller = jaxbContext.createMarshaller(); marshallable.marshal(marshaller, TpicMap.wrap(context), xmlContext); } catch (JAXBException e) { logger.warn("Unable t...
[ "private", "<", "T", ">", "void", "renderSoapHeader", "(", "final", "Marshallable", "<", "T", ">", "marshallable", ",", "final", "Map", "<", "String", ",", "String", ">", "context", ",", "T", "xmlContext", ")", "{", "try", "{", "final", "Marshaller", "ma...
Renders a given context map into a given result that should be the TPIC header node.
[ "Renders", "a", "given", "context", "map", "into", "a", "given", "result", "that", "should", "be", "the", "TPIC", "header", "node", "." ]
train
https://github.com/tracee/tracee/blob/15a68e435248f57757beb8ceac6db5b7f6035bb3/core/src/main/java/io/tracee/transport/SoapHeaderTransport.java#L119-L127
reinert/requestor
requestor/ext/requestor-oauth2/src/main/java/io/reinert/requestor/oauth2/AuthRequest.java
AuthRequest.fromString
static AuthRequest fromString(String str) { """ Returns an {@link AuthRequest} represented by the string serialization. """ String[] parts = str.split("-----"); String clientId = parts[0]; String[] scopes = parts.length == 2 ? parts[1].split(",") : new String[0]; AuthRequest req...
java
static AuthRequest fromString(String str) { String[] parts = str.split("-----"); String clientId = parts[0]; String[] scopes = parts.length == 2 ? parts[1].split(",") : new String[0]; AuthRequest req = new AuthRequest("", clientId).withScopes(scopes); return req; }
[ "static", "AuthRequest", "fromString", "(", "String", "str", ")", "{", "String", "[", "]", "parts", "=", "str", ".", "split", "(", "\"-----\"", ")", ";", "String", "clientId", "=", "parts", "[", "0", "]", ";", "String", "[", "]", "scopes", "=", "part...
Returns an {@link AuthRequest} represented by the string serialization.
[ "Returns", "an", "{" ]
train
https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/ext/requestor-oauth2/src/main/java/io/reinert/requestor/oauth2/AuthRequest.java#L104-L110
sebastiangraf/treetank
coremodules/core/src/main/java/org/treetank/io/IOUtils.java
IOUtils.compareStructure
public static int compareStructure(final File pFile, IConfigurationPath[] pPaths) { """ Checking a structure in a folder to be equal with the data in this enum. @param pFile to be checked @param pPaths containing the elements to be checked against @return -1 if less folders are there, 0 if the structure is...
java
public static int compareStructure(final File pFile, IConfigurationPath[] pPaths) { int existing = 0; for (final IConfigurationPath path : pPaths) { final File currentFile = new File(pFile, path.getFile().getName()); if (currentFile.exists()) { existing++; ...
[ "public", "static", "int", "compareStructure", "(", "final", "File", "pFile", ",", "IConfigurationPath", "[", "]", "pPaths", ")", "{", "int", "existing", "=", "0", ";", "for", "(", "final", "IConfigurationPath", "path", ":", "pPaths", ")", "{", "final", "F...
Checking a structure in a folder to be equal with the data in this enum. @param pFile to be checked @param pPaths containing the elements to be checked against @return -1 if less folders are there, 0 if the structure is equal to the one expected, 1 if the structure has more folders
[ "Checking", "a", "structure", "in", "a", "folder", "to", "be", "equal", "with", "the", "data", "in", "this", "enum", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/core/src/main/java/org/treetank/io/IOUtils.java#L66-L75
aws/aws-sdk-java
aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/EventDetails.java
EventDetails.withEventMetadata
public EventDetails withEventMetadata(java.util.Map<String, String> eventMetadata) { """ <p> Additional metadata about the event. </p> @param eventMetadata Additional metadata about the event. @return Returns a reference to this object so that method calls can be chained together. """ setEventMe...
java
public EventDetails withEventMetadata(java.util.Map<String, String> eventMetadata) { setEventMetadata(eventMetadata); return this; }
[ "public", "EventDetails", "withEventMetadata", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "eventMetadata", ")", "{", "setEventMetadata", "(", "eventMetadata", ")", ";", "return", "this", ";", "}" ]
<p> Additional metadata about the event. </p> @param eventMetadata Additional metadata about the event. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Additional", "metadata", "about", "the", "event", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-health/src/main/java/com/amazonaws/services/health/model/EventDetails.java#L166-L169
alkacon/opencms-core
src/org/opencms/acacia/shared/CmsType.java
CmsType.addAttribute
public void addAttribute(String attributeName, CmsType attributeType, int minOccurrence, int maxOccurrence) { """ Adds an attribute to the type.<p> @param attributeName the attribute name @param attributeType the attribute type @param minOccurrence the minimum occurrence of this attribute @param maxOccurrenc...
java
public void addAttribute(String attributeName, CmsType attributeType, int minOccurrence, int maxOccurrence) { m_names.add(attributeName); m_types.put(attributeName, attributeType); m_mins.put(attributeName, new Integer(minOccurrence)); m_maxs.put(attributeName, new Integer(maxOccur...
[ "public", "void", "addAttribute", "(", "String", "attributeName", ",", "CmsType", "attributeType", ",", "int", "minOccurrence", ",", "int", "maxOccurrence", ")", "{", "m_names", ".", "add", "(", "attributeName", ")", ";", "m_types", ".", "put", "(", "attribute...
Adds an attribute to the type.<p> @param attributeName the attribute name @param attributeType the attribute type @param minOccurrence the minimum occurrence of this attribute @param maxOccurrence the axnimum occurrence of this attribute
[ "Adds", "an", "attribute", "to", "the", "type", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsType.java#L96-L102
spring-projects/spring-android
spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java
UriUtils.encodeUserInfo
public static String encodeUserInfo(String userInfo, String encoding) throws UnsupportedEncodingException { """ Encodes the given URI user info with the given encoding. @param userInfo the user info to be encoded @param encoding the character encoding to encode to @return the encoded user info @throws Unsuppor...
java
public static String encodeUserInfo(String userInfo, String encoding) throws UnsupportedEncodingException { return HierarchicalUriComponents.encodeUriComponent(userInfo, encoding, HierarchicalUriComponents.Type.USER_INFO); }
[ "public", "static", "String", "encodeUserInfo", "(", "String", "userInfo", ",", "String", "encoding", ")", "throws", "UnsupportedEncodingException", "{", "return", "HierarchicalUriComponents", ".", "encodeUriComponent", "(", "userInfo", ",", "encoding", ",", "Hierarchic...
Encodes the given URI user info with the given encoding. @param userInfo the user info to be encoded @param encoding the character encoding to encode to @return the encoded user info @throws UnsupportedEncodingException when the given encoding parameter is not supported
[ "Encodes", "the", "given", "URI", "user", "info", "with", "the", "given", "encoding", "." ]
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L241-L243
liaochong/spring-boot-starter-converter
src/main/java/com/github/liaochong/converter/core/BeansConvertStrategy.java
BeansConvertStrategy.convertBeans
public static <E, T> List<E> convertBeans(List<T> source, Class<E> targetClass, boolean nonNullFilter) { """ 集合转换,无指定异常提供 @param source 需要转换的集合 @param targetClass 需要转换到的类型 @param nonNullFilter 是否非空过滤 @param <E> 转换后的类型 @param <T> 转换前的类型 @return 结果 """ return convertBeans(source, targetClass, nul...
java
public static <E, T> List<E> convertBeans(List<T> source, Class<E> targetClass, boolean nonNullFilter) { return convertBeans(source, targetClass, null, false, nonNullFilter); }
[ "public", "static", "<", "E", ",", "T", ">", "List", "<", "E", ">", "convertBeans", "(", "List", "<", "T", ">", "source", ",", "Class", "<", "E", ">", "targetClass", ",", "boolean", "nonNullFilter", ")", "{", "return", "convertBeans", "(", "source", ...
集合转换,无指定异常提供 @param source 需要转换的集合 @param targetClass 需要转换到的类型 @param nonNullFilter 是否非空过滤 @param <E> 转换后的类型 @param <T> 转换前的类型 @return 结果
[ "集合转换,无指定异常提供" ]
train
https://github.com/liaochong/spring-boot-starter-converter/blob/a36bea44bd23330a6f43b0372906a804a09285c5/src/main/java/com/github/liaochong/converter/core/BeansConvertStrategy.java#L52-L54
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java
SpecializedOps_DDRM.diffNormF
public static double diffNormF(DMatrixD1 a , DMatrixD1 b ) { """ <p> Computes the F norm of the difference between the two Matrices:<br> <br> Sqrt{&sum;<sub>i=1:m</sub> &sum;<sub>j=1:n</sub> ( a<sub>ij</sub> - b<sub>ij</sub>)<sup>2</sup>} </p> <p> This is often used as a cost function. </p> @see NormOps_...
java
public static double diffNormF(DMatrixD1 a , DMatrixD1 b ) { if( a.numRows != b.numRows || a.numCols != b.numCols ) { throw new IllegalArgumentException("Both matrices must have the same shape."); } final int size = a.getNumElements(); DMatrixRMaj diff = new DMatrixRMaj...
[ "public", "static", "double", "diffNormF", "(", "DMatrixD1", "a", ",", "DMatrixD1", "b", ")", "{", "if", "(", "a", ".", "numRows", "!=", "b", ".", "numRows", "||", "a", ".", "numCols", "!=", "b", ".", "numCols", ")", "{", "throw", "new", "IllegalArgu...
<p> Computes the F norm of the difference between the two Matrices:<br> <br> Sqrt{&sum;<sub>i=1:m</sub> &sum;<sub>j=1:n</sub> ( a<sub>ij</sub> - b<sub>ij</sub>)<sup>2</sup>} </p> <p> This is often used as a cost function. </p> @see NormOps_DDRM#fastNormF @param a m by n matrix. Not modified. @param b m by n matrix. N...
[ "<p", ">", "Computes", "the", "F", "norm", "of", "the", "difference", "between", "the", "two", "Matrices", ":", "<br", ">", "<br", ">", "Sqrt", "{", "&sum", ";", "<sub", ">", "i", "=", "1", ":", "m<", "/", "sub", ">", "&sum", ";", "<sub", ">", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java#L209-L223
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/core/client/SdkClientBuilder.java
SdkClientBuilder.proxyCredentials
public SdkClientBuilder proxyCredentials(String user, String password) { """ Specify proxy credentials. @param user user @param password password @return current client builder """ this.proxyCredentials = new UsernamePasswordCredentials(user, password); return this; }
java
public SdkClientBuilder proxyCredentials(String user, String password) { this.proxyCredentials = new UsernamePasswordCredentials(user, password); return this; }
[ "public", "SdkClientBuilder", "proxyCredentials", "(", "String", "user", ",", "String", "password", ")", "{", "this", ".", "proxyCredentials", "=", "new", "UsernamePasswordCredentials", "(", "user", ",", "password", ")", ";", "return", "this", ";", "}" ]
Specify proxy credentials. @param user user @param password password @return current client builder
[ "Specify", "proxy", "credentials", "." ]
train
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/core/client/SdkClientBuilder.java#L367-L370
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Having.java
Having.orderBy
@NonNull @Override public OrderBy orderBy(@NonNull Ordering... orderings) { """ Create and chain an ORDER BY component for specifying the orderings of the query result. @param orderings an array of the ORDER BY expressions. @return the ORDER BY component. """ if (orderings == null) { ...
java
@NonNull @Override public OrderBy orderBy(@NonNull Ordering... orderings) { if (orderings == null) { throw new IllegalArgumentException("orderings is null."); } return new OrderBy(this, Arrays.asList(orderings)); }
[ "@", "NonNull", "@", "Override", "public", "OrderBy", "orderBy", "(", "@", "NonNull", "Ordering", "...", "orderings", ")", "{", "if", "(", "orderings", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"orderings is null.\"", ")", ";",...
Create and chain an ORDER BY component for specifying the orderings of the query result. @param orderings an array of the ORDER BY expressions. @return the ORDER BY component.
[ "Create", "and", "chain", "an", "ORDER", "BY", "component", "for", "specifying", "the", "orderings", "of", "the", "query", "result", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Having.java#L54-L61
apache/incubator-druid
core/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java
Lifecycle.addStartCloseInstance
public <T> T addStartCloseInstance(T o, Stage stage) { """ Adds an instance with a start() and/or close() method to the Lifecycle. If the lifecycle has already been started, it throws an {@link ISE} @param o The object to add to the lifecycle @param stage The stage to add the lifecycle at @throws ISE ...
java
public <T> T addStartCloseInstance(T o, Stage stage) { addHandler(new StartCloseHandler(o), stage); return o; }
[ "public", "<", "T", ">", "T", "addStartCloseInstance", "(", "T", "o", ",", "Stage", "stage", ")", "{", "addHandler", "(", "new", "StartCloseHandler", "(", "o", ")", ",", "stage", ")", ";", "return", "o", ";", "}" ]
Adds an instance with a start() and/or close() method to the Lifecycle. If the lifecycle has already been started, it throws an {@link ISE} @param o The object to add to the lifecycle @param stage The stage to add the lifecycle at @throws ISE {@link Lifecycle#addHandler(Handler, Stage)}
[ "Adds", "an", "instance", "with", "a", "start", "()", "and", "/", "or", "close", "()", "method", "to", "the", "Lifecycle", ".", "If", "the", "lifecycle", "has", "already", "been", "started", "it", "throws", "an", "{", "@link", "ISE", "}" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java#L168-L172
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderpolicy_binding.java
responderpolicy_binding.get
public static responderpolicy_binding get(nitro_service service, String name) throws Exception { """ Use this API to fetch responderpolicy_binding resource of given name . """ responderpolicy_binding obj = new responderpolicy_binding(); obj.set_name(name); responderpolicy_binding response = (responderpol...
java
public static responderpolicy_binding get(nitro_service service, String name) throws Exception{ responderpolicy_binding obj = new responderpolicy_binding(); obj.set_name(name); responderpolicy_binding response = (responderpolicy_binding) obj.get_resource(service); return response; }
[ "public", "static", "responderpolicy_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "responderpolicy_binding", "obj", "=", "new", "responderpolicy_binding", "(", ")", ";", "obj", ".", "set_name", "(", "nam...
Use this API to fetch responderpolicy_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "responderpolicy_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderpolicy_binding.java#L136-L141
graphql-java/java-dataloader
src/main/java/org/dataloader/DataLoader.java
DataLoader.newDataLoader
public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadFunction) { """ Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size). @param batchLoadFunction the batch load function to use @param <K> the ...
java
public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadFunction) { return newDataLoader(batchLoadFunction, null); }
[ "public", "static", "<", "K", ",", "V", ">", "DataLoader", "<", "K", ",", "V", ">", "newDataLoader", "(", "BatchLoader", "<", "K", ",", "V", ">", "batchLoadFunction", ")", "{", "return", "newDataLoader", "(", "batchLoadFunction", ",", "null", ")", ";", ...
Creates new DataLoader with the specified batch loader function and default options (batching, caching and unlimited batch size). @param batchLoadFunction the batch load function to use @param <K> the key type @param <V> the value type @return a new DataLoader
[ "Creates", "new", "DataLoader", "with", "the", "specified", "batch", "loader", "function", "and", "default", "options", "(", "batching", "caching", "and", "unlimited", "batch", "size", ")", "." ]
train
https://github.com/graphql-java/java-dataloader/blob/dfdc8133ead10aa723f896b4a1fa4a1cec9a6fbc/src/main/java/org/dataloader/DataLoader.java#L74-L76
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/CullAboveValueMapping.java
CullAboveValueMapping.findPivot
private Double findPivot(Map<Long, Double> datapoints, Double limit) { """ /* If type is percentile, find out the estimate of the limit(th) percentile in the datapoint sorted values. Then execute the same as type is value. That means to cull the elements greater than value or pivotValue prerequisite: array must ...
java
private Double findPivot(Map<Long, Double> datapoints, Double limit) { double[] doubleValues = new double[datapoints.size()]; int k = 0; for (Map.Entry<Long, Double> entry : datapoints.entrySet()) { doubleValues[k] = entry.getValue(); k++; } Arrays.sort(d...
[ "private", "Double", "findPivot", "(", "Map", "<", "Long", ",", "Double", ">", "datapoints", ",", "Double", "limit", ")", "{", "double", "[", "]", "doubleValues", "=", "new", "double", "[", "datapoints", ".", "size", "(", ")", "]", ";", "int", "k", "...
/* If type is percentile, find out the estimate of the limit(th) percentile in the datapoint sorted values. Then execute the same as type is value. That means to cull the elements greater than value or pivotValue prerequisite: array must be sorted
[ "/", "*", "If", "type", "is", "percentile", "find", "out", "the", "estimate", "of", "the", "limit", "(", "th", ")", "percentile", "in", "the", "datapoint", "sorted", "values", ".", "Then", "execute", "the", "same", "as", "type", "is", "value", ".", "Th...
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/CullAboveValueMapping.java#L99-L117
LAW-Unimi/BUbiNG
src/it/unimi/di/law/bubing/StartupConfiguration.java
StartupConfiguration.subDir
public static File subDir(final String parent, final String child) { """ Returns a {@link File} object representing a child relative to a parent, or just the child, if absolute. @param parent a parent directory. @param child a (possibly absolute) child file or directory. @return {@code child}, if it is absol...
java
public static File subDir(final String parent, final String child) { final File d = new File(child); return d.isAbsolute() ? d : new File(parent, child); }
[ "public", "static", "File", "subDir", "(", "final", "String", "parent", ",", "final", "String", "child", ")", "{", "final", "File", "d", "=", "new", "File", "(", "child", ")", ";", "return", "d", ".", "isAbsolute", "(", ")", "?", "d", ":", "new", "...
Returns a {@link File} object representing a child relative to a parent, or just the child, if absolute. @param parent a parent directory. @param child a (possibly absolute) child file or directory. @return {@code child}, if it is absolute; {@code child} relative to {@code parent}, if it is relative.
[ "Returns", "a", "{", "@link", "File", "}", "object", "representing", "a", "child", "relative", "to", "a", "parent", "or", "just", "the", "child", "if", "absolute", "." ]
train
https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/StartupConfiguration.java#L440-L443
google/closure-compiler
src/com/google/javascript/jscomp/JsIterables.java
JsIterables.maybeBoxIterableOrAsyncIterable
static final MaybeBoxedIterableOrAsyncIterable maybeBoxIterableOrAsyncIterable( JSType type, JSTypeRegistry typeRegistry) { """ Given a type, if it is an iterable or async iterable, will return its template. If not a subtype of Iterable|AsyncIterable, returns an object that has no match, and will indicate t...
java
static final MaybeBoxedIterableOrAsyncIterable maybeBoxIterableOrAsyncIterable( JSType type, JSTypeRegistry typeRegistry) { List<JSType> templatedTypes = new ArrayList<>(); // Note: we don't just use JSType.autobox() here because that removes null and undefined. // We want to keep null and undefined ...
[ "static", "final", "MaybeBoxedIterableOrAsyncIterable", "maybeBoxIterableOrAsyncIterable", "(", "JSType", "type", ",", "JSTypeRegistry", "typeRegistry", ")", "{", "List", "<", "JSType", ">", "templatedTypes", "=", "new", "ArrayList", "<>", "(", ")", ";", "// Note: we ...
Given a type, if it is an iterable or async iterable, will return its template. If not a subtype of Iterable|AsyncIterable, returns an object that has no match, and will indicate the mismatch. e.g. both {@code number} and {@code number|Iterable} are not subtypes of Iterable|AsyncIterable.
[ "Given", "a", "type", "if", "it", "is", "an", "iterable", "or", "async", "iterable", "will", "return", "its", "template", ".", "If", "not", "a", "subtype", "of", "Iterable|AsyncIterable", "returns", "an", "object", "that", "has", "no", "match", "and", "wil...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JsIterables.java#L131-L163
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java
UtilWavelet.borderForwardUpper
public static int borderForwardUpper( WlCoef desc , int dataLength) { """ Returns the upper border (offset from image edge) for a forward wavelet transform. """ int w = Math.max( desc.offsetScaling+desc.getScalingLength() , desc.offsetWavelet+desc.getWaveletLength()); int a = dataLength%2; w -= a; re...
java
public static int borderForwardUpper( WlCoef desc , int dataLength) { int w = Math.max( desc.offsetScaling+desc.getScalingLength() , desc.offsetWavelet+desc.getWaveletLength()); int a = dataLength%2; w -= a; return Math.max((w + (w%2))-2,0)+a; }
[ "public", "static", "int", "borderForwardUpper", "(", "WlCoef", "desc", ",", "int", "dataLength", ")", "{", "int", "w", "=", "Math", ".", "max", "(", "desc", ".", "offsetScaling", "+", "desc", ".", "getScalingLength", "(", ")", ",", "desc", ".", "offsetW...
Returns the upper border (offset from image edge) for a forward wavelet transform.
[ "Returns", "the", "upper", "border", "(", "offset", "from", "image", "edge", ")", "for", "a", "forward", "wavelet", "transform", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/wavelet/UtilWavelet.java#L181-L188
Jasig/uPortal
uPortal-webapp/src/main/java/org/apereo/portal/context/rendering/RenderingPipelineConfiguration.java
RenderingPipelineConfiguration.getPortalRenderingPipeline
@Bean(name = "portalRenderingPipeline") @Qualifier(value = "main") public IPortalRenderingPipeline getPortalRenderingPipeline() { """ This bean is the entry point into the uPortal Rendering Pipeline. It supports {@link RenderingPipelineBranchPoint} beans, which are an extension point for adopters. """...
java
@Bean(name = "portalRenderingPipeline") @Qualifier(value = "main") public IPortalRenderingPipeline getPortalRenderingPipeline() { // Rendering Pipeline Branches (adopter extension point) final List<RenderingPipelineBranchPoint> sortedList = (branchPoints != null) ? new LinkedLis...
[ "@", "Bean", "(", "name", "=", "\"portalRenderingPipeline\"", ")", "@", "Qualifier", "(", "value", "=", "\"main\"", ")", "public", "IPortalRenderingPipeline", "getPortalRenderingPipeline", "(", ")", "{", "// Rendering Pipeline Branches (adopter extension point)", "final", ...
This bean is the entry point into the uPortal Rendering Pipeline. It supports {@link RenderingPipelineBranchPoint} beans, which are an extension point for adopters.
[ "This", "bean", "is", "the", "entry", "point", "into", "the", "uPortal", "Rendering", "Pipeline", ".", "It", "supports", "{" ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-webapp/src/main/java/org/apereo/portal/context/rendering/RenderingPipelineConfiguration.java#L150-L204
alkacon/opencms-core
src/org/opencms/relations/CmsExternalLinksValidator.java
CmsExternalLinksValidator.checkUrl
public static boolean checkUrl(CmsObject cms, String check) { """ Checks if the given url is valid.<p> @param check the url to check @param cms a OpenCms context object @return false if the url could not be accessed """ // first, create an URI from the string representation URI uri = nu...
java
public static boolean checkUrl(CmsObject cms, String check) { // first, create an URI from the string representation URI uri = null; try { uri = new CmsUriSplitter(check, true).toURI(); } catch (URISyntaxException exc) { return false; } try { ...
[ "public", "static", "boolean", "checkUrl", "(", "CmsObject", "cms", ",", "String", "check", ")", "{", "// first, create an URI from the string representation", "URI", "uri", "=", "null", ";", "try", "{", "uri", "=", "new", "CmsUriSplitter", "(", "check", ",", "t...
Checks if the given url is valid.<p> @param check the url to check @param cms a OpenCms context object @return false if the url could not be accessed
[ "Checks", "if", "the", "given", "url", "is", "valid", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsExternalLinksValidator.java#L70-L99
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/Image.java
Image.getSubImage
public Image getSubImage(int x,int y,int width,int height) { """ Get a sub-part of this image. Note that the create image retains a reference to the image data so should anything change it will affect sub-images too. @param x The x coordinate of the sub-image @param y The y coordinate of the sub-image @param...
java
public Image getSubImage(int x,int y,int width,int height) { init(); float newTextureOffsetX = ((x / (float) this.width) * textureWidth) + textureOffsetX; float newTextureOffsetY = ((y / (float) this.height) * textureHeight) + textureOffsetY; float newTextureWidth = ((width / (float) this.width) * textu...
[ "public", "Image", "getSubImage", "(", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "init", "(", ")", ";", "float", "newTextureOffsetX", "=", "(", "(", "x", "/", "(", "float", ")", "this", ".", "width", ")", "...
Get a sub-part of this image. Note that the create image retains a reference to the image data so should anything change it will affect sub-images too. @param x The x coordinate of the sub-image @param y The y coordinate of the sub-image @param width The width of the sub-image @param height The height of the sub-image...
[ "Get", "a", "sub", "-", "part", "of", "this", "image", ".", "Note", "that", "the", "create", "image", "retains", "a", "reference", "to", "the", "image", "data", "so", "should", "anything", "change", "it", "will", "affect", "sub", "-", "images", "too", ...
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L958-L981
jbundle/webapp
upload/src/main/java/org/jbundle/util/webapp/upload/UploadServlet.java
UploadServlet.doGet
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { """ Process an HTML get. @exception ServletException From inherited class. @exception IOException From inherited class. """ this.doProcess(req, res); }
java
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { this.doProcess(req, res); }
[ "public", "void", "doGet", "(", "HttpServletRequest", "req", ",", "HttpServletResponse", "res", ")", "throws", "ServletException", ",", "IOException", "{", "this", ".", "doProcess", "(", "req", ",", "res", ")", ";", "}" ]
Process an HTML get. @exception ServletException From inherited class. @exception IOException From inherited class.
[ "Process", "an", "HTML", "get", "." ]
train
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/upload/src/main/java/org/jbundle/util/webapp/upload/UploadServlet.java#L85-L89
opentok/Opentok-Java-SDK
src/main/java/com/opentok/OpenTok.java
OpenTok.listArchives
public ArchiveList listArchives(String sessionId, int offset, int count) throws OpenTokException { """ Returns a List of {@link Archive} objects, representing archives that are both both completed and in-progress, for your API key. @param offset The index offset of the first archive. 0 is offset of the most re...
java
public ArchiveList listArchives(String sessionId, int offset, int count) throws OpenTokException { String archives = this.client.getArchives(sessionId, offset, count); try { return archiveListReader.readValue(archives); } catch (JsonProcessingException e) { throw new Requ...
[ "public", "ArchiveList", "listArchives", "(", "String", "sessionId", ",", "int", "offset", ",", "int", "count", ")", "throws", "OpenTokException", "{", "String", "archives", "=", "this", ".", "client", ".", "getArchives", "(", "sessionId", ",", "offset", ",", ...
Returns a List of {@link Archive} objects, representing archives that are both both completed and in-progress, for your API key. @param offset The index offset of the first archive. 0 is offset of the most recently started archive. 1 is the offset of the archive that started prior to the most recent archive. @param co...
[ "Returns", "a", "List", "of", "{", "@link", "Archive", "}", "objects", "representing", "archives", "that", "are", "both", "both", "completed", "and", "in", "-", "progress", "for", "your", "API", "key", "." ]
train
https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/OpenTok.java#L403-L412
atomix/atomix
agent/src/main/java/io/atomix/agent/AtomixAgent.java
AtomixAgent.buildRestService
private static ManagedRestService buildRestService(Atomix atomix, Namespace namespace) { """ Builds a REST service for the given Atomix instance from the given namespace. @param atomix the Atomix instance @param namespace the namespace from which to build the service @return the managed REST service """ ...
java
private static ManagedRestService buildRestService(Atomix atomix, Namespace namespace) { final String httpHost = namespace.getString("http_host"); final Integer httpPort = namespace.getInt("http_port"); return RestService.builder() .withAtomix(atomix) .withAddress(Address.from(httpHost, http...
[ "private", "static", "ManagedRestService", "buildRestService", "(", "Atomix", "atomix", ",", "Namespace", "namespace", ")", "{", "final", "String", "httpHost", "=", "namespace", ".", "getString", "(", "\"http_host\"", ")", ";", "final", "Integer", "httpPort", "=",...
Builds a REST service for the given Atomix instance from the given namespace. @param atomix the Atomix instance @param namespace the namespace from which to build the service @return the managed REST service
[ "Builds", "a", "REST", "service", "for", "the", "given", "Atomix", "instance", "from", "the", "given", "namespace", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/agent/src/main/java/io/atomix/agent/AtomixAgent.java#L370-L377
apache/flink
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBNativeMetricMonitor.java
RocksDBNativeMetricMonitor.setProperty
private void setProperty(ColumnFamilyHandle handle, String property, RocksDBNativeMetricView metricView) { """ Updates the value of metricView if the reference is still valid. """ if (metricView.isClosed()) { return; } try { synchronized (lock) { if (rocksDB != null) { long value = rocksDB...
java
private void setProperty(ColumnFamilyHandle handle, String property, RocksDBNativeMetricView metricView) { if (metricView.isClosed()) { return; } try { synchronized (lock) { if (rocksDB != null) { long value = rocksDB.getLongProperty(handle, property); metricView.setValue(value); } } ...
[ "private", "void", "setProperty", "(", "ColumnFamilyHandle", "handle", ",", "String", "property", ",", "RocksDBNativeMetricView", "metricView", ")", "{", "if", "(", "metricView", ".", "isClosed", "(", ")", ")", "{", "return", ";", "}", "try", "{", "synchronize...
Updates the value of metricView if the reference is still valid.
[ "Updates", "the", "value", "of", "metricView", "if", "the", "reference", "is", "still", "valid", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBNativeMetricMonitor.java#L85-L100
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java
Camera.moveLocation
public void moveLocation(double extrp, double vx, double vy) { """ Move camera by using specified vector. @param extrp The extrapolation value. @param vx The horizontal vector. @param vy The vertical vector. """ checkHorizontalLimit(extrp, vx); checkVerticalLimit(extrp, vy); }
java
public void moveLocation(double extrp, double vx, double vy) { checkHorizontalLimit(extrp, vx); checkVerticalLimit(extrp, vy); }
[ "public", "void", "moveLocation", "(", "double", "extrp", ",", "double", "vx", ",", "double", "vy", ")", "{", "checkHorizontalLimit", "(", "extrp", ",", "vx", ")", ";", "checkVerticalLimit", "(", "extrp", ",", "vy", ")", ";", "}" ]
Move camera by using specified vector. @param extrp The extrapolation value. @param vx The horizontal vector. @param vy The vertical vector.
[ "Move", "camera", "by", "using", "specified", "vector", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java#L117-L121
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
ArrayBlockingQueue.offer
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException { """ Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full. @throws InterruptedException {@inheritDoc} @throws NullPointerExc...
java
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException { Objects.requireNonNull(e); long nanos = unit.toNanos(timeout); final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { while (count == items.length) { ...
[ "public", "boolean", "offer", "(", "E", "e", ",", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", "{", "Objects", ".", "requireNonNull", "(", "e", ")", ";", "long", "nanos", "=", "unit", ".", "toNanos", "(", "timeout", ...
Inserts the specified element at the tail of this queue, waiting up to the specified wait time for space to become available if the queue is full. @throws InterruptedException {@inheritDoc} @throws NullPointerException {@inheritDoc}
[ "Inserts", "the", "specified", "element", "at", "the", "tail", "of", "this", "queue", "waiting", "up", "to", "the", "specified", "wait", "time", "for", "space", "to", "become", "available", "if", "the", "queue", "is", "full", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ArrayBlockingQueue.java#L355-L373
albfernandez/itext2
src/main/java/com/lowagie/text/Table.java
Table.insertTable
public void insertTable(Table aTable, int row, int column) { """ To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns. @param aTable The <CODE>Table</CODE> to add @param row The row where the <CODE>Cell</CODE> will be...
java
public void insertTable(Table aTable, int row, int column) { if (aTable == null) throw new NullPointerException("insertTable - table has null-value"); insertTable(aTable, new Point(row, column)); }
[ "public", "void", "insertTable", "(", "Table", "aTable", ",", "int", "row", ",", "int", "column", ")", "{", "if", "(", "aTable", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"insertTable - table has null-value\"", ")", ";", "insertTable", ...
To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns. @param aTable The <CODE>Table</CODE> to add @param row The row where the <CODE>Cell</CODE> will be added @param column The column where the <CODE>Cell</CODE> will be...
[ "To", "put", "a", "table", "within", "the", "existing", "table", "at", "the", "given", "position", "generateTable", "will", "of", "course", "re", "-", "arrange", "the", "widths", "of", "the", "columns", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L808-L811
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java
TaskOperations.terminateTask
public void terminateTask(String jobId, String taskId) throws BatchErrorException, IOException { """ Terminates the specified task. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @throws BatchErrorException Exception thrown when an error response is received from the ...
java
public void terminateTask(String jobId, String taskId) throws BatchErrorException, IOException { terminateTask(jobId, taskId, null); }
[ "public", "void", "terminateTask", "(", "String", "jobId", ",", "String", "taskId", ")", "throws", "BatchErrorException", ",", "IOException", "{", "terminateTask", "(", "jobId", ",", "taskId", ",", "null", ")", ";", "}" ]
Terminates the specified task. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOException Exception thrown when there is an error in serialization/deserialization of da...
[ "Terminates", "the", "specified", "task", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java#L729-L731
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java
VirtualNetworkGatewaysInner.updateTags
public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName) { """ Updates a virtual network gateway tags. @param resourceGroupName The name of the resource group. @param virtualNetworkGatewayName The name of the virtual network gateway. @throws IllegalArgumentExcep...
java
public VirtualNetworkGatewayInner updateTags(String resourceGroupName, String virtualNetworkGatewayName) { return updateTagsWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body(); }
[ "public", "VirtualNetworkGatewayInner", "updateTags", "(", "String", "resourceGroupName", ",", "String", "virtualNetworkGatewayName", ")", "{", "return", "updateTagsWithServiceResponseAsync", "(", "resourceGroupName", ",", "virtualNetworkGatewayName", ")", ".", "toBlocking", ...
Updates a virtual network gateway tags. @param resourceGroupName The name of the resource group. @param virtualNetworkGatewayName The name of the virtual network gateway. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws...
[ "Updates", "a", "virtual", "network", "gateway", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L611-L613
ironjacamar/ironjacamar
codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java
AbstractCodeGen.writeLogging
protected void writeLogging(Definition def, Writer out, int indent, String level, String content, String... params) throws IOException { """ output logging @param def definition @param out Writer @param indent indent @param level logging level @param content logging content @param param...
java
protected void writeLogging(Definition def, Writer out, int indent, String level, String content, String... params) throws IOException { writeIndent(out, indent); if (def.isSupportJbossLogging()) { out.write("log.trace"); int size = params.length; if (size > 0) ...
[ "protected", "void", "writeLogging", "(", "Definition", "def", ",", "Writer", "out", ",", "int", "indent", ",", "String", "level", ",", "String", "content", ",", "String", "...", "params", ")", "throws", "IOException", "{", "writeIndent", "(", "out", ",", ...
output logging @param def definition @param out Writer @param indent indent @param level logging level @param content logging content @param params logging params @throws IOException ioException
[ "output", "logging" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java#L360-L390
TNG/JGiven
jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java
Attachment.fromBinaryFile
public static Attachment fromBinaryFile( File file, MediaType mediaType ) throws IOException { """ Creates an attachment from the given binary file {@code file}. The content of the file will be transformed into a Base64 encoded string. @throws IOException if an I/O error occurs @throws java.lang.IllegalArgument...
java
public static Attachment fromBinaryFile( File file, MediaType mediaType ) throws IOException { FileInputStream stream = new FileInputStream( file ); try { return fromBinaryInputStream( stream, mediaType ); } finally { ResourceUtil.close( stream ); } }
[ "public", "static", "Attachment", "fromBinaryFile", "(", "File", "file", ",", "MediaType", "mediaType", ")", "throws", "IOException", "{", "FileInputStream", "stream", "=", "new", "FileInputStream", "(", "file", ")", ";", "try", "{", "return", "fromBinaryInputStre...
Creates an attachment from the given binary file {@code file}. The content of the file will be transformed into a Base64 encoded string. @throws IOException if an I/O error occurs @throws java.lang.IllegalArgumentException if mediaType is not binary
[ "Creates", "an", "attachment", "from", "the", "given", "binary", "file", "{" ]
train
https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java#L186-L193
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
TagletManager.addCustomTag
public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { """ Add a new <code>Taglet</code>. Print a message to indicate whether or not the Taglet was registered properly. @param classname the name of the class representing the custom tag. @param tagletPath the path to the ...
java
public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; ...
[ "public", "void", "addCustomTag", "(", "String", "classname", ",", "JavaFileManager", "fileManager", ",", "String", "tagletPath", ")", "{", "try", "{", "Class", "<", "?", ">", "customTagClass", "=", "null", ";", "// construct class loader", "String", "cpString", ...
Add a new <code>Taglet</code>. Print a message to indicate whether or not the Taglet was registered properly. @param classname the name of the class representing the custom tag. @param tagletPath the path to the class representing the custom tag.
[ "Add", "a", "new", "<code", ">", "Taglet<", "/", "code", ">", ".", "Print", "a", "message", "to", "indicate", "whether", "or", "not", "the", "Taglet", "was", "registered", "properly", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java#L219-L259
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/UserMappingDao.java
UserMappingDao.queryByIds
public UserCustomResultSet queryByIds(long baseId, long relatedId) { """ Query by both base id and related id @param baseId base id @param relatedId related id @return result set """ return query(buildWhereIds(baseId, relatedId), buildWhereIdsArgs(baseId, relatedId)); }
java
public UserCustomResultSet queryByIds(long baseId, long relatedId) { return query(buildWhereIds(baseId, relatedId), buildWhereIdsArgs(baseId, relatedId)); }
[ "public", "UserCustomResultSet", "queryByIds", "(", "long", "baseId", ",", "long", "relatedId", ")", "{", "return", "query", "(", "buildWhereIds", "(", "baseId", ",", "relatedId", ")", ",", "buildWhereIdsArgs", "(", "baseId", ",", "relatedId", ")", ")", ";", ...
Query by both base id and related id @param baseId base id @param relatedId related id @return result set
[ "Query", "by", "both", "base", "id", "and", "related", "id" ]
train
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/UserMappingDao.java#L188-L191
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/MediaRule.java
MediaRule.apply
@Override public JType apply(String nodeName, JsonNode mediaNode, JsonNode parent, JType baseType, Schema schema) { """ <p> Applies this schema rule. </p> @param nodeName the name of the property. @param mediaNode the media node @param parent the parent node @param baseType the type with the media ...
java
@Override public JType apply(String nodeName, JsonNode mediaNode, JsonNode parent, JType baseType, Schema schema) { if (!mediaNode.has(BINARY_ENCODING)) { return baseType; } return baseType.owner().ref(byte[].class); }
[ "@", "Override", "public", "JType", "apply", "(", "String", "nodeName", ",", "JsonNode", "mediaNode", ",", "JsonNode", "parent", ",", "JType", "baseType", ",", "Schema", "schema", ")", "{", "if", "(", "!", "mediaNode", ".", "has", "(", "BINARY_ENCODING", "...
<p> Applies this schema rule. </p> @param nodeName the name of the property. @param mediaNode the media node @param parent the parent node @param baseType the type with the media node. This must be java.lang.String. @param schema the schema containing the property. @return byte[] when a binary encoding is specified, ...
[ "<p", ">", "Applies", "this", "schema", "rule", ".", "<", "/", "p", ">" ]
train
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/MediaRule.java#L67-L74
pryzach/midao
midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java
TypeHandlerUtils.convertClob
public static Object convertClob(Object clob, String value) throws SQLException { """ Transfers data from String into sql.Clob @param clob sql.Clob which would be filled @param value String @return sql.Clob from String @throws SQLException """ return convertClob(clob, value.getBytes()); }
java
public static Object convertClob(Object clob, String value) throws SQLException { return convertClob(clob, value.getBytes()); }
[ "public", "static", "Object", "convertClob", "(", "Object", "clob", ",", "String", "value", ")", "throws", "SQLException", "{", "return", "convertClob", "(", "clob", ",", "value", ".", "getBytes", "(", ")", ")", ";", "}" ]
Transfers data from String into sql.Clob @param clob sql.Clob which would be filled @param value String @return sql.Clob from String @throws SQLException
[ "Transfers", "data", "from", "String", "into", "sql", ".", "Clob" ]
train
https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L246-L248
VoltDB/voltdb
src/frontend/org/voltdb/utils/HTTPAdminListener.java
HTTPAdminListener.getHTMLForAdminPage
String getHTMLForAdminPage(Map<String,String> params) { """ Load a template for the admin page, fill it out and return the value. @param params The key-value set of variables to replace in the template. @return The completed template. """ try { String template = m_htmlTemplates.get("admin...
java
String getHTMLForAdminPage(Map<String,String> params) { try { String template = m_htmlTemplates.get("admintemplate.html"); for (Entry<String, String> e : params.entrySet()) { String key = e.getKey().toUpperCase(); String value = e.getValue(); ...
[ "String", "getHTMLForAdminPage", "(", "Map", "<", "String", ",", "String", ">", "params", ")", "{", "try", "{", "String", "template", "=", "m_htmlTemplates", ".", "get", "(", "\"admintemplate.html\"", ")", ";", "for", "(", "Entry", "<", "String", ",", "Str...
Load a template for the admin page, fill it out and return the value. @param params The key-value set of variables to replace in the template. @return The completed template.
[ "Load", "a", "template", "for", "the", "admin", "page", "fill", "it", "out", "and", "return", "the", "value", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/HTTPAdminListener.java#L139-L155
sagiegurari/fax4j
src/main/java/org/fax4j/spi/FaxJobImpl.java
FaxJobImpl.getProperty
public String getProperty(String key,String defaultValue) { """ This function returns the fax job property for the given key. @param key The property key @param defaultValue The default value @return The property value """ //get property value return this.PROPERTIES.getProperty(key...
java
public String getProperty(String key,String defaultValue) { //get property value return this.PROPERTIES.getProperty(key,defaultValue); }
[ "public", "String", "getProperty", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "//get property value", "return", "this", ".", "PROPERTIES", ".", "getProperty", "(", "key", ",", "defaultValue", ")", ";", "}" ]
This function returns the fax job property for the given key. @param key The property key @param defaultValue The default value @return The property value
[ "This", "function", "returns", "the", "fax", "job", "property", "for", "the", "given", "key", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/FaxJobImpl.java#L259-L263
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
HtmlDocletWriter.getMarkerAnchor
public Content getMarkerAnchor(SectionName sectionName, String anchorName) { """ Get the marker anchor which will be added to the documentation tree. @param sectionName the section name anchor attribute for page @param anchorName the anchor name combined with section name attribute for the page @return a cont...
java
public Content getMarkerAnchor(SectionName sectionName, String anchorName) { return getMarkerAnchor(sectionName.getName() + getName(anchorName), null); }
[ "public", "Content", "getMarkerAnchor", "(", "SectionName", "sectionName", ",", "String", "anchorName", ")", "{", "return", "getMarkerAnchor", "(", "sectionName", ".", "getName", "(", ")", "+", "getName", "(", "anchorName", ")", ",", "null", ")", ";", "}" ]
Get the marker anchor which will be added to the documentation tree. @param sectionName the section name anchor attribute for page @param anchorName the anchor name combined with section name attribute for the page @return a content tree for the marker anchor
[ "Get", "the", "marker", "anchor", "which", "will", "be", "added", "to", "the", "documentation", "tree", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L828-L830
prestodb/presto
presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java
SemiTransactionalHiveMetastore.getTableSource
@GuardedBy("this") private TableSource getTableSource(String databaseName, String tableName) { """ This method can only be called when the table is known to exist """ checkHoldsLock(); checkReadable(); Action<TableAndMore> tableAction = tableActions.get(new SchemaTableName(database...
java
@GuardedBy("this") private TableSource getTableSource(String databaseName, String tableName) { checkHoldsLock(); checkReadable(); Action<TableAndMore> tableAction = tableActions.get(new SchemaTableName(databaseName, tableName)); if (tableAction == null) { return Tabl...
[ "@", "GuardedBy", "(", "\"this\"", ")", "private", "TableSource", "getTableSource", "(", "String", "databaseName", ",", "String", "tableName", ")", "{", "checkHoldsLock", "(", ")", ";", "checkReadable", "(", ")", ";", "Action", "<", "TableAndMore", ">", "table...
This method can only be called when the table is known to exist
[ "This", "method", "can", "only", "be", "called", "when", "the", "table", "is", "known", "to", "exist" ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java#L245-L267
groupon/robo-remote
RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java
Solo2.enterTextAndWait
public void enterTextAndWait(int fieldResource, String value) { """ Enter text into a given field resource id @param fieldResource - Resource id of a field (R.id.*) @param value - value to enter into the given field """ EditText textBox = (EditText) this.getView(fieldResource); this.enterText...
java
public void enterTextAndWait(int fieldResource, String value) { EditText textBox = (EditText) this.getView(fieldResource); this.enterText(textBox, value); this.waitForText(value); }
[ "public", "void", "enterTextAndWait", "(", "int", "fieldResource", ",", "String", "value", ")", "{", "EditText", "textBox", "=", "(", "EditText", ")", "this", ".", "getView", "(", "fieldResource", ")", ";", "this", ".", "enterText", "(", "textBox", ",", "v...
Enter text into a given field resource id @param fieldResource - Resource id of a field (R.id.*) @param value - value to enter into the given field
[ "Enter", "text", "into", "a", "given", "field", "resource", "id" ]
train
https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L274-L279
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/util/selenium/CookieConverter.java
CookieConverter.copySeleniumCookies
public void copySeleniumCookies(Set<Cookie> browserCookies, CookieStore cookieStore) { """ Converts Selenium cookies to Apache http client ones. @param browserCookies cookies in Selenium format. @param cookieStore store to place coverted cookies in. """ for (Cookie browserCookie : browserCookies) { ...
java
public void copySeleniumCookies(Set<Cookie> browserCookies, CookieStore cookieStore) { for (Cookie browserCookie : browserCookies) { ClientCookie cookie = convertCookie(browserCookie); cookieStore.addCookie(cookie); } }
[ "public", "void", "copySeleniumCookies", "(", "Set", "<", "Cookie", ">", "browserCookies", ",", "CookieStore", "cookieStore", ")", "{", "for", "(", "Cookie", "browserCookie", ":", "browserCookies", ")", "{", "ClientCookie", "cookie", "=", "convertCookie", "(", "...
Converts Selenium cookies to Apache http client ones. @param browserCookies cookies in Selenium format. @param cookieStore store to place coverted cookies in.
[ "Converts", "Selenium", "cookies", "to", "Apache", "http", "client", "ones", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/CookieConverter.java#L19-L24
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/GrowingSparseMatrix.java
GrowingSparseMatrix.setRow
public void setRow(int row, double[] columns) { """ {@inheritDoc} The size of the matrix will be expanded if either row or col is larger than the largest previously seen row or column value. When the matrix is expanded by either dimension, the values for the new row/column will all be assumed to be zero. ...
java
public void setRow(int row, double[] columns) { checkIndices(row, columns.length - 1); if (cols <= columns.length) cols = columns.length; SparseDoubleVector rowVec = updateRow(row); for (int col = 0; col < cols; ++col) { double val = columns[col]; ...
[ "public", "void", "setRow", "(", "int", "row", ",", "double", "[", "]", "columns", ")", "{", "checkIndices", "(", "row", ",", "columns", ".", "length", "-", "1", ")", ";", "if", "(", "cols", "<=", "columns", ".", "length", ")", "cols", "=", "column...
{@inheritDoc} The size of the matrix will be expanded if either row or col is larger than the largest previously seen row or column value. When the matrix is expanded by either dimension, the values for the new row/column will all be assumed to be zero.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/GrowingSparseMatrix.java#L236-L248
facebookarchive/hadoop-20
src/tools/org/apache/hadoop/tools/HadoopArchives.java
HadoopArchives.recursivels
private void recursivels(FileSystem fs, Path p, List<FileStatus> out) throws IOException { """ this assumes that there are two types of files file/dir @param fs the input filesystem @param p the top level path @param out the list of paths output of recursive ls @throws IOException """ FileStatus fst...
java
private void recursivels(FileSystem fs, Path p, List<FileStatus> out) throws IOException { FileStatus fstatus = fs.getFileStatus(p); if (!fstatus.isDir()) { out.add(fstatus); return; } else { out.add(fstatus); FileStatus[] listStatus = fs.listStatus(p); for (FileStatus s...
[ "private", "void", "recursivels", "(", "FileSystem", "fs", ",", "Path", "p", ",", "List", "<", "FileStatus", ">", "out", ")", "throws", "IOException", "{", "FileStatus", "fstatus", "=", "fs", ".", "getFileStatus", "(", "p", ")", ";", "if", "(", "!", "f...
this assumes that there are two types of files file/dir @param fs the input filesystem @param p the top level path @param out the list of paths output of recursive ls @throws IOException
[ "this", "assumes", "that", "there", "are", "two", "types", "of", "files", "file", "/", "dir" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/tools/org/apache/hadoop/tools/HadoopArchives.java#L179-L193
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/VariableStack.java
VariableStack.clearLocalSlots
public void clearLocalSlots(int start, int len) { """ Use this to clear the variables in a section of the stack. This is used to clear the parameter section of the stack, so that default param values can tell if they've already been set. It is important to note that this function has a 1K limitation. @para...
java
public void clearLocalSlots(int start, int len) { start += _currentFrameBottom; System.arraycopy(m_nulls, 0, _stackFrames, start, len); }
[ "public", "void", "clearLocalSlots", "(", "int", "start", ",", "int", "len", ")", "{", "start", "+=", "_currentFrameBottom", ";", "System", ".", "arraycopy", "(", "m_nulls", ",", "0", ",", "_stackFrames", ",", "start", ",", "len", ")", ";", "}" ]
Use this to clear the variables in a section of the stack. This is used to clear the parameter section of the stack, so that default param values can tell if they've already been set. It is important to note that this function has a 1K limitation. @param start The start position, relative to the current local stack ...
[ "Use", "this", "to", "clear", "the", "variables", "in", "a", "section", "of", "the", "stack", ".", "This", "is", "used", "to", "clear", "the", "parameter", "section", "of", "the", "stack", "so", "that", "default", "param", "values", "can", "tell", "if", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/VariableStack.java#L408-L414
xiancloud/xian
xian-core/src/main/java/info/xiancloud/core/util/file/StreamUtil.java
StreamUtil.partByPart
public static void partByPart(InputStream _inputStream, String delimiter, Function<String, Object> function) { """ 读取流,并且一段一段的处理;完毕之后,此方法会帮你把流关闭。 @param _inputStream 输入流 @param delimiter 分段分隔符 @param function 处理函数,入参为一个分段 """ try (Scanner scanner = new Scanner(_inputStream);) { ...
java
public static void partByPart(InputStream _inputStream, String delimiter, Function<String, Object> function) { try (Scanner scanner = new Scanner(_inputStream);) { scanner.useDelimiter(delimiter); while (scanner.hasNext()) { String next = scanner.next(); f...
[ "public", "static", "void", "partByPart", "(", "InputStream", "_inputStream", ",", "String", "delimiter", ",", "Function", "<", "String", ",", "Object", ">", "function", ")", "{", "try", "(", "Scanner", "scanner", "=", "new", "Scanner", "(", "_inputStream", ...
读取流,并且一段一段的处理;完毕之后,此方法会帮你把流关闭。 @param _inputStream 输入流 @param delimiter 分段分隔符 @param function 处理函数,入参为一个分段
[ "读取流,并且一段一段的处理;完毕之后,此方法会帮你把流关闭。" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/file/StreamUtil.java#L34-L42
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
TypeAnnotations.organizeTypeAnnotationsSignatures
public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) { """ Separate type annotations from declaration annotations and determine the correct positions for type annotations. This version only visits types in signatures and should be called from MemberEnter. """ ...
java
public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) { annotate.afterTypes(() -> { JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile); try { new TypeAnnotationPositions(true).scan(tree); } finally { ...
[ "public", "void", "organizeTypeAnnotationsSignatures", "(", "final", "Env", "<", "AttrContext", ">", "env", ",", "final", "JCClassDecl", "tree", ")", "{", "annotate", ".", "afterTypes", "(", "(", ")", "->", "{", "JavaFileObject", "oldSource", "=", "log", ".", ...
Separate type annotations from declaration annotations and determine the correct positions for type annotations. This version only visits types in signatures and should be called from MemberEnter.
[ "Separate", "type", "annotations", "from", "declaration", "annotations", "and", "determine", "the", "correct", "positions", "for", "type", "annotations", ".", "This", "version", "only", "visits", "types", "in", "signatures", "and", "should", "be", "called", "from"...
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java#L118-L127
alipay/sofa-rpc
extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/codec/bolt/SimpleMapSerializer.java
SimpleMapSerializer.writeString
protected void writeString(OutputStream out, String str) throws IOException { """ 写一个String @param out 输出流 @param str 字符串 @throws IOException 写入异常 """ if (str == null) { writeInt(out, -1); } else if (str.isEmpty()) { writeInt(out, 0); } else { by...
java
protected void writeString(OutputStream out, String str) throws IOException { if (str == null) { writeInt(out, -1); } else if (str.isEmpty()) { writeInt(out, 0); } else { byte[] bs = StringSerializer.encode(str); writeInt(out, bs.length); ...
[ "protected", "void", "writeString", "(", "OutputStream", "out", ",", "String", "str", ")", "throws", "IOException", "{", "if", "(", "str", "==", "null", ")", "{", "writeInt", "(", "out", ",", "-", "1", ")", ";", "}", "else", "if", "(", "str", ".", ...
写一个String @param out 输出流 @param str 字符串 @throws IOException 写入异常
[ "写一个String" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/codec/bolt/SimpleMapSerializer.java#L98-L108
WASdev/ci.maven
liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/MavenProjectUtil.java
MavenProjectUtil.getPluginGoalConfigurationString
public static String getPluginGoalConfigurationString(MavenProject project, String pluginKey, String goal, String configName) throws PluginScenarioException { """ Get a configuration value from a goal from a plugin @param project @param pluginKey @param goal @param configName @return the value of the configur...
java
public static String getPluginGoalConfigurationString(MavenProject project, String pluginKey, String goal, String configName) throws PluginScenarioException { PluginExecution execution = getPluginGoalExecution(project, pluginKey, goal); final Xpp3Dom config = (Xpp3Dom)execution.getConfiguration...
[ "public", "static", "String", "getPluginGoalConfigurationString", "(", "MavenProject", "project", ",", "String", "pluginKey", ",", "String", "goal", ",", "String", "configName", ")", "throws", "PluginScenarioException", "{", "PluginExecution", "execution", "=", "getPlug...
Get a configuration value from a goal from a plugin @param project @param pluginKey @param goal @param configName @return the value of the configuration parameter @throws PluginScenarioException
[ "Get", "a", "configuration", "value", "from", "a", "goal", "from", "a", "plugin" ]
train
https://github.com/WASdev/ci.maven/blob/4fcf2d314299a4c02e2c740e4fc99a4f6aba6918/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/MavenProjectUtil.java#L59-L71
OpenLiberty/open-liberty
dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/CommonExpectations.java
CommonExpectations.successfullyReachedProtectedResourceWithLtpaCookie
public static Expectations successfullyReachedProtectedResourceWithLtpaCookie(String testAction, WebClient webClient, String protectedUrl, String username) { """ Sets expectations that will check: <ol> <li>Successfully reached the specified URL <li>Response text includes LTPA cookie and principal information <...
java
public static Expectations successfullyReachedProtectedResourceWithLtpaCookie(String testAction, WebClient webClient, String protectedUrl, String username) { Expectations expectations = new Expectations(); expectations.addExpectations(successfullyReachedUrl(testAction, protectedUrl)); expectatio...
[ "public", "static", "Expectations", "successfullyReachedProtectedResourceWithLtpaCookie", "(", "String", "testAction", ",", "WebClient", "webClient", ",", "String", "protectedUrl", ",", "String", "username", ")", "{", "Expectations", "expectations", "=", "new", "Expectati...
Sets expectations that will check: <ol> <li>Successfully reached the specified URL <li>Response text includes LTPA cookie and principal information </ol>
[ "Sets", "expectations", "that", "will", "check", ":", "<ol", ">", "<li", ">", "Successfully", "reached", "the", "specified", "URL", "<li", ">", "Response", "text", "includes", "LTPA", "cookie", "and", "principal", "information", "<", "/", "ol", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/CommonExpectations.java#L57-L62
spring-projects/spring-security-oauth
spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/filter/OAuthConsumerProcessingFilter.java
OAuthConsumerProcessingFilter.getAccessTokenDependencies
protected Set<String> getAccessTokenDependencies(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) { """ Loads the access token dependencies for the given request. This will be a set of {@link ProtectedResourceDetails#getId() resource ids} for which an OAuth access token is requir...
java
protected Set<String> getAccessTokenDependencies(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) { Set<String> deps = new TreeSet<String>(); if (getObjectDefinitionSource() != null) { FilterInvocation invocation = new FilterInvocation(request, response, filterChain); ...
[ "protected", "Set", "<", "String", ">", "getAccessTokenDependencies", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "FilterChain", "filterChain", ")", "{", "Set", "<", "String", ">", "deps", "=", "new", "TreeSet", "<", "String"...
Loads the access token dependencies for the given request. This will be a set of {@link ProtectedResourceDetails#getId() resource ids} for which an OAuth access token is required. @param request The request. @param response The response @param filterChain The filter chain @return The access token dependencies (...
[ "Loads", "the", "access", "token", "dependencies", "for", "the", "given", "request", ".", "This", "will", "be", "a", "set", "of", "{", "@link", "ProtectedResourceDetails#getId", "()", "resource", "ids", "}", "for", "which", "an", "OAuth", "access", "token", ...
train
https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/filter/OAuthConsumerProcessingFilter.java#L123-L136
alkacon/opencms-core
src/org/opencms/db/generic/CmsUserDriver.java
CmsUserDriver.internalCreateOrgUnitFromResource
protected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc, CmsResource resource) throws CmsException { """ Returns the organizational unit represented by the given resource.<p> @param dbc the current db context @param resource the resource that represents an organizational unit ...
java
protected CmsOrganizationalUnit internalCreateOrgUnitFromResource(CmsDbContext dbc, CmsResource resource) throws CmsException { if (!resource.getRootPath().startsWith(ORGUNIT_BASE_FOLDER)) { throw new CmsDataAccessException( Messages.get().container(Messages.ERR_READ_ORGUNIT_1, ...
[ "protected", "CmsOrganizationalUnit", "internalCreateOrgUnitFromResource", "(", "CmsDbContext", "dbc", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "if", "(", "!", "resource", ".", "getRootPath", "(", ")", ".", "startsWith", "(", "ORGUNIT_BASE_F...
Returns the organizational unit represented by the given resource.<p> @param dbc the current db context @param resource the resource that represents an organizational unit @return the organizational unit represented by the given resource @throws CmsException if something goes wrong
[ "Returns", "the", "organizational", "unit", "represented", "by", "the", "given", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserDriver.java#L2406-L2436
JM-Lab/utils-elasticsearch
src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchBulk.java
JMElasticsearchBulk.deleteBulkDocs
public boolean deleteBulkDocs(String index, String type) { """ Delete bulk docs boolean. @param index the index @param type the type @return the boolean """ return executeBulkRequest(buildDeleteBulkRequestBuilder( buildAllDeleteRequestBuilderList(index, type))).hasFailures(); ...
java
public boolean deleteBulkDocs(String index, String type) { return executeBulkRequest(buildDeleteBulkRequestBuilder( buildAllDeleteRequestBuilderList(index, type))).hasFailures(); }
[ "public", "boolean", "deleteBulkDocs", "(", "String", "index", ",", "String", "type", ")", "{", "return", "executeBulkRequest", "(", "buildDeleteBulkRequestBuilder", "(", "buildAllDeleteRequestBuilderList", "(", "index", ",", "type", ")", ")", ")", ".", "hasFailures...
Delete bulk docs boolean. @param index the index @param type the type @return the boolean
[ "Delete", "bulk", "docs", "boolean", "." ]
train
https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchBulk.java#L459-L462
BioPAX/Paxtools
pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java
LinkedPE.enrichWithGenerics
protected void enrichWithGenerics(Set<BioPAXElement> seed, Set<BioPAXElement> all) { """ Gets the linked homologies and then switches to complex-relationship mode. These two enrich methods call each other recursively. @param seed to get the linked elements from @param all already found links """ Set addit...
java
protected void enrichWithGenerics(Set<BioPAXElement> seed, Set<BioPAXElement> all) { Set addition; if (type == Type.TO_GENERAL) addition = access(upperGenAcc, seed, all); else addition = access(lowerGenAcc, seed, all); all.addAll(addition); seed.addAll(addition); enrichWithCM(seed, all); }
[ "protected", "void", "enrichWithGenerics", "(", "Set", "<", "BioPAXElement", ">", "seed", ",", "Set", "<", "BioPAXElement", ">", "all", ")", "{", "Set", "addition", ";", "if", "(", "type", "==", "Type", ".", "TO_GENERAL", ")", "addition", "=", "access", ...
Gets the linked homologies and then switches to complex-relationship mode. These two enrich methods call each other recursively. @param seed to get the linked elements from @param all already found links
[ "Gets", "the", "linked", "homologies", "and", "then", "switches", "to", "complex", "-", "relationship", "mode", ".", "These", "two", "enrich", "methods", "call", "each", "other", "recursively", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/LinkedPE.java#L117-L127
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/distort/NarrowToWidePtoP_F32.java
NarrowToWidePtoP_F32.compute
@Override public void compute(float x, float y, Point2D_F32 out) { """ Apply the transformation @param x x-coordinate of point in pixels. Synthetic narrow FOV camera @param y y-coordinate of point in pixels. Synthetic narrow FOV camera @param out Pixel location of point in wide FOV camera. """ narrow...
java
@Override public void compute(float x, float y, Point2D_F32 out) { narrowToNorm.compute(x,y, norm); // Convert from 2D homogenous to 3D unit.set( norm.x , norm.y , 1.0f); // Rotate then make it a unit vector GeometryMath_F32.mult(rotateWideToNarrow,unit,unit); float n = unit.norm(); unit.x /= n; unit...
[ "@", "Override", "public", "void", "compute", "(", "float", "x", ",", "float", "y", ",", "Point2D_F32", "out", ")", "{", "narrowToNorm", ".", "compute", "(", "x", ",", "y", ",", "norm", ")", ";", "// Convert from 2D homogenous to 3D", "unit", ".", "set", ...
Apply the transformation @param x x-coordinate of point in pixels. Synthetic narrow FOV camera @param y y-coordinate of point in pixels. Synthetic narrow FOV camera @param out Pixel location of point in wide FOV camera.
[ "Apply", "the", "transformation" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/NarrowToWidePtoP_F32.java#L74-L89
SimplicityApks/ReminderDatePicker
lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java
TimeSpinner.setSelectedTime
public void setSelectedTime(int hour, int minute) { """ Sets the Spinner's selection as time in hour and minute. If the time was not in the possible selections, a temporary item is created and passed to selectTemporary(). @param hour The hour to be selected. @param minute The minute in the hour. """ ...
java
public void setSelectedTime(int hour, int minute) { final int count = getAdapter().getCount() - 1; int itemPosition = -1; for(int i=0; i<count; i++) { final TimeItem item = ((TimeItem) getAdapter().getItem(i)); if(item.getHour() == hour && item.getMinute() == minute) { ...
[ "public", "void", "setSelectedTime", "(", "int", "hour", ",", "int", "minute", ")", "{", "final", "int", "count", "=", "getAdapter", "(", ")", ".", "getCount", "(", ")", "-", "1", ";", "int", "itemPosition", "=", "-", "1", ";", "for", "(", "int", "...
Sets the Spinner's selection as time in hour and minute. If the time was not in the possible selections, a temporary item is created and passed to selectTemporary(). @param hour The hour to be selected. @param minute The minute in the hour.
[ "Sets", "the", "Spinner", "s", "selection", "as", "time", "in", "hour", "and", "minute", ".", "If", "the", "time", "was", "not", "in", "the", "possible", "selections", "a", "temporary", "item", "is", "created", "and", "passed", "to", "selectTemporary", "()...
train
https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/TimeSpinner.java#L227-L243
apache/groovy
subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxDocumentFilter.java
StructuredSyntaxDocumentFilter.parseDocument
protected void parseDocument(int offset, int length) throws BadLocationException { """ Parse the Document to update the character styles given an initial start position. Called by the filter after it has updated the text. @param offset @param length @throws BadLocationException """ // initialize...
java
protected void parseDocument(int offset, int length) throws BadLocationException { // initialize the segment with the complete document so the segment doesn't // have an underlying gap in the buffer styledDocument.getText(0, styledDocument.getLength(), segment); buffer = CharBuf...
[ "protected", "void", "parseDocument", "(", "int", "offset", ",", "int", "length", ")", "throws", "BadLocationException", "{", "// initialize the segment with the complete document so the segment doesn't", "// have an underlying gap in the buffer", "styledDocument", ".", "getText", ...
Parse the Document to update the character styles given an initial start position. Called by the filter after it has updated the text. @param offset @param length @throws BadLocationException
[ "Parse", "the", "Document", "to", "update", "the", "character", "styles", "given", "an", "initial", "start", "position", ".", "Called", "by", "the", "filter", "after", "it", "has", "updated", "the", "text", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxDocumentFilter.java#L186-L216
jfinal/jfinal
src/main/java/com/jfinal/plugin/redis/Cache.java
Cache.getSet
@SuppressWarnings("unchecked") public <T> T getSet(Object key, Object value) { """ 将给定 key 的值设为 value ,并返回 key 的旧值(old value)。 当 key 存在但不是字符串类型时,返回一个错误。 """ Jedis jedis = getJedis(); try { return (T)valueFromBytes(jedis.getSet(keyToBytes(key), valueToBytes(value))); } finally {close(jedis);}...
java
@SuppressWarnings("unchecked") public <T> T getSet(Object key, Object value) { Jedis jedis = getJedis(); try { return (T)valueFromBytes(jedis.getSet(keyToBytes(key), valueToBytes(value))); } finally {close(jedis);} }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "getSet", "(", "Object", "key", ",", "Object", "value", ")", "{", "Jedis", "jedis", "=", "getJedis", "(", ")", ";", "try", "{", "return", "(", "T", ")", "valueFromBytes",...
将给定 key 的值设为 value ,并返回 key 的旧值(old value)。 当 key 存在但不是字符串类型时,返回一个错误。
[ "将给定", "key", "的值设为", "value", ",并返回", "key", "的旧值", "(", "old", "value", ")", "。", "当", "key", "存在但不是字符串类型时,返回一个错误。" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L363-L370
poetix/protonpack
src/main/java/com/codepoetics/protonpack/StreamUtils.java
StreamUtils.takeUntil
public static <T> Stream<T> takeUntil(Stream<T> source, Predicate<T> condition) { """ Construct a stream which takes values from the source stream until one of them meets the supplied condition, and then stops. @param source The source stream. @param condition The condition to apply to elements of the source st...
java
public static <T> Stream<T> takeUntil(Stream<T> source, Predicate<T> condition) { return takeWhile(source, condition.negate()); }
[ "public", "static", "<", "T", ">", "Stream", "<", "T", ">", "takeUntil", "(", "Stream", "<", "T", ">", "source", ",", "Predicate", "<", "T", ">", "condition", ")", "{", "return", "takeWhile", "(", "source", ",", "condition", ".", "negate", "(", ")", ...
Construct a stream which takes values from the source stream until one of them meets the supplied condition, and then stops. @param source The source stream. @param condition The condition to apply to elements of the source stream. @param <T> The type over which the stream streams. @return A condition-bounded stream.
[ "Construct", "a", "stream", "which", "takes", "values", "from", "the", "source", "stream", "until", "one", "of", "them", "meets", "the", "supplied", "condition", "and", "then", "stops", "." ]
train
https://github.com/poetix/protonpack/blob/00c55a05a4779926d02d5f4e6c820560a773f9f1/src/main/java/com/codepoetics/protonpack/StreamUtils.java#L155-L157
alkacon/opencms-core
src/org/opencms/ade/configuration/CmsADEConfigData.java
CmsADEConfigData.hasFormatters
public boolean hasFormatters(CmsObject cms, I_CmsResourceType resType, Collection<CmsContainer> containers) { """ Checks if there are any matching formatters for the given set of containers.<p> @param cms the current CMS context @param resType the resource type for which the formatter configuration should be r...
java
public boolean hasFormatters(CmsObject cms, I_CmsResourceType resType, Collection<CmsContainer> containers) { try { if (CmsXmlDynamicFunctionHandler.TYPE_FUNCTION.equals(resType.getTypeName()) || CmsResourceTypeFunctionConfig.TYPE_NAME.equals(resType.getTypeName())) { ...
[ "public", "boolean", "hasFormatters", "(", "CmsObject", "cms", ",", "I_CmsResourceType", "resType", ",", "Collection", "<", "CmsContainer", ">", "containers", ")", "{", "try", "{", "if", "(", "CmsXmlDynamicFunctionHandler", ".", "TYPE_FUNCTION", ".", "equals", "("...
Checks if there are any matching formatters for the given set of containers.<p> @param cms the current CMS context @param resType the resource type for which the formatter configuration should be retrieved @param containers the page containers @return if there are any matching formatters
[ "Checks", "if", "there", "are", "any", "matching", "formatters", "for", "the", "given", "set", "of", "containers", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEConfigData.java#L854-L878
biojava/biojava
biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java
Location.prefix
public Location prefix( Location other ) { """ The part of this location before the other location (not inclusive). @param other The other location. @return The part of this location before the other location. @throws IllegalArgumentException Locations are on opposite strands. @throws IndexOutOfBoundsExcepti...
java
public Location prefix( Location other ) { if( isSameStrand( other ) ) { if( other.mStart >= mStart ) { return new Location( mStart, (other.mStart < mEnd)? other.mStart: mEnd ); } else { //other is out of bounds -- no prefix throw new IndexOutOfBoundsException( "Specified location not w...
[ "public", "Location", "prefix", "(", "Location", "other", ")", "{", "if", "(", "isSameStrand", "(", "other", ")", ")", "{", "if", "(", "other", ".", "mStart", ">=", "mStart", ")", "{", "return", "new", "Location", "(", "mStart", ",", "(", "other", "....
The part of this location before the other location (not inclusive). @param other The other location. @return The part of this location before the other location. @throws IllegalArgumentException Locations are on opposite strands. @throws IndexOutOfBoundsException This location does not contain other location.
[ "The", "part", "of", "this", "location", "before", "the", "other", "location", "(", "not", "inclusive", ")", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java#L499-L518
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java
InodeTreePersistentState.applyAndJournal
public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) { """ Deletes an inode (may be either a file or directory). @param context journal context supplier @param entry delete file entry """ // Unlike most entries, the delete file entry must be applied *before* making the i...
java
public void applyAndJournal(Supplier<JournalContext> context, DeleteFileEntry entry) { // Unlike most entries, the delete file entry must be applied *before* making the in-memory // change. This is because delete file and create file are performed with only a read lock on // the parent directory. As soon as...
[ "public", "void", "applyAndJournal", "(", "Supplier", "<", "JournalContext", ">", "context", ",", "DeleteFileEntry", "entry", ")", "{", "// Unlike most entries, the delete file entry must be applied *before* making the in-memory", "// change. This is because delete file and create file...
Deletes an inode (may be either a file or directory). @param context journal context supplier @param entry delete file entry
[ "Deletes", "an", "inode", "(", "may", "be", "either", "a", "file", "or", "directory", ")", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L158-L176
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/Constant.java
Constant.getSystemProperty
public static String getSystemProperty(String property, String def) { """ Get the system property. If the property is not valid due to a {@link SecurityException}, an empty string is returned. @param property The system property (must not be <code>null</code>). @param def The default value used if property is...
java
public static String getSystemProperty(String property, String def) { Check.notNull(property); try { return System.getProperty(property, def); } catch (final SecurityException exception) { Verbose.exception(exception, ...
[ "public", "static", "String", "getSystemProperty", "(", "String", "property", ",", "String", "def", ")", "{", "Check", ".", "notNull", "(", "property", ")", ";", "try", "{", "return", "System", ".", "getProperty", "(", "property", ",", "def", ")", ";", "...
Get the system property. If the property is not valid due to a {@link SecurityException}, an empty string is returned. @param property The system property (must not be <code>null</code>). @param def The default value used if property is not available (can be <code>null</code>). @return The system property value.
[ "Get", "the", "system", "property", ".", "If", "the", "property", "is", "not", "valid", "due", "to", "a", "{", "@link", "SecurityException", "}", "an", "empty", "string", "is", "returned", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Constant.java#L121-L140
assertthat/selenium-shutterbug
src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java
PageSnapshot.blurExcept
public PageSnapshot blurExcept(WebElement element) { """ Blurs all the page except the element provided. @param element WebElement to stay not blurred @return instance of type PageSnapshot """ try{ image = ImageProcessor.blurExceptArea(image, new Coordinates(element,devicePixelRatio)); ...
java
public PageSnapshot blurExcept(WebElement element) { try{ image = ImageProcessor.blurExceptArea(image, new Coordinates(element,devicePixelRatio)); }catch(RasterFormatException rfe){ throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE,rfe); } ...
[ "public", "PageSnapshot", "blurExcept", "(", "WebElement", "element", ")", "{", "try", "{", "image", "=", "ImageProcessor", ".", "blurExceptArea", "(", "image", ",", "new", "Coordinates", "(", "element", ",", "devicePixelRatio", ")", ")", ";", "}", "catch", ...
Blurs all the page except the element provided. @param element WebElement to stay not blurred @return instance of type PageSnapshot
[ "Blurs", "all", "the", "page", "except", "the", "element", "provided", "." ]
train
https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L150-L157
threerings/nenya
core/src/main/java/com/threerings/miso/data/SparseMisoSceneModel.java
SparseMisoSceneModel.visitObjects
public void visitObjects (ObjectVisitor visitor, boolean interestingOnly) { """ Informs the supplied visitor of each object in this scene. @param interestingOnly if true, only the interesting objects will be visited. """ for (Iterator<Section> iter = getSections(); iter.hasNext(); ) { S...
java
public void visitObjects (ObjectVisitor visitor, boolean interestingOnly) { for (Iterator<Section> iter = getSections(); iter.hasNext(); ) { Section sect = iter.next(); for (ObjectInfo oinfo : sect.objectInfo) { visitor.visit(oinfo); } if (!int...
[ "public", "void", "visitObjects", "(", "ObjectVisitor", "visitor", ",", "boolean", "interestingOnly", ")", "{", "for", "(", "Iterator", "<", "Section", ">", "iter", "=", "getSections", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "Sect...
Informs the supplied visitor of each object in this scene. @param interestingOnly if true, only the interesting objects will be visited.
[ "Informs", "the", "supplied", "visitor", "of", "each", "object", "in", "this", "scene", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/data/SparseMisoSceneModel.java#L318-L335
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderRole.java
LeaderRole.appendAndCompact
private <E extends RaftLogEntry> CompletableFuture<Indexed<E>> appendAndCompact(E entry) { """ Appends an entry to the Raft log and compacts logs if necessary. @param entry the entry to append @param <E> the entry type @return a completable future to be completed once the entry has been appended """ ...
java
private <E extends RaftLogEntry> CompletableFuture<Indexed<E>> appendAndCompact(E entry) { return appendAndCompact(entry, 0); }
[ "private", "<", "E", "extends", "RaftLogEntry", ">", "CompletableFuture", "<", "Indexed", "<", "E", ">", ">", "appendAndCompact", "(", "E", "entry", ")", "{", "return", "appendAndCompact", "(", "entry", ",", "0", ")", ";", "}" ]
Appends an entry to the Raft log and compacts logs if necessary. @param entry the entry to append @param <E> the entry type @return a completable future to be completed once the entry has been appended
[ "Appends", "an", "entry", "to", "the", "Raft", "log", "and", "compacts", "logs", "if", "necessary", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderRole.java#L1053-L1055
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java
ClassDocImpl.findConstructor
public ConstructorDoc findConstructor(String constrName, String[] paramTypes) { """ Find constructor in this class. @param constrName the unqualified name to search for. @param paramTypes the array of Strings for constructor parameters. @return the first ConstructorDo...
java
public ConstructorDoc findConstructor(String constrName, String[] paramTypes) { Names names = tsym.name.table.names; for (Symbol sym : tsym.members().getSymbolsByName(names.fromString("<init>"))) { if (sym.kind == MTH) { if (hasParame...
[ "public", "ConstructorDoc", "findConstructor", "(", "String", "constrName", ",", "String", "[", "]", "paramTypes", ")", "{", "Names", "names", "=", "tsym", ".", "name", ".", "table", ".", "names", ";", "for", "(", "Symbol", "sym", ":", "tsym", ".", "memb...
Find constructor in this class. @param constrName the unqualified name to search for. @param paramTypes the array of Strings for constructor parameters. @return the first ConstructorDocImpl which matches, null if not found.
[ "Find", "constructor", "in", "this", "class", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java#L999-L1019
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java
MercatorProjection.latitudeToTileYWithScaleFactor
public static int latitudeToTileYWithScaleFactor(double latitude, double scaleFactor) { """ Converts a latitude coordinate (in degrees) to a tile Y number at a certain scale. @param latitude the latitude coordinate that should be converted. @param scaleFactor the scale factor at which the coordinate should ...
java
public static int latitudeToTileYWithScaleFactor(double latitude, double scaleFactor) { return pixelYToTileYWithScaleFactor(latitudeToPixelYWithScaleFactor(latitude, scaleFactor, DUMMY_TILE_SIZE), scaleFactor, DUMMY_TILE_SIZE); }
[ "public", "static", "int", "latitudeToTileYWithScaleFactor", "(", "double", "latitude", ",", "double", "scaleFactor", ")", "{", "return", "pixelYToTileYWithScaleFactor", "(", "latitudeToPixelYWithScaleFactor", "(", "latitude", ",", "scaleFactor", ",", "DUMMY_TILE_SIZE", "...
Converts a latitude coordinate (in degrees) to a tile Y number at a certain scale. @param latitude the latitude coordinate that should be converted. @param scaleFactor the scale factor at which the coordinate should be converted. @return the tile Y number of the latitude value.
[ "Converts", "a", "latitude", "coordinate", "(", "in", "degrees", ")", "to", "a", "tile", "Y", "number", "at", "a", "certain", "scale", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L231-L233
infinispan/infinispan
server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheAdd.java
CacheAdd.populate
void populate(ModelNode fromModel, ModelNode toModel) throws OperationFailedException { """ Transfer elements common to both operations and models @param fromModel @param toModel """ for(AttributeDefinition attr : CacheResource.CACHE_ATTRIBUTES) { attr.validateAndSet(fromModel, toModel)...
java
void populate(ModelNode fromModel, ModelNode toModel) throws OperationFailedException { for(AttributeDefinition attr : CacheResource.CACHE_ATTRIBUTES) { attr.validateAndSet(fromModel, toModel); } }
[ "void", "populate", "(", "ModelNode", "fromModel", ",", "ModelNode", "toModel", ")", "throws", "OperationFailedException", "{", "for", "(", "AttributeDefinition", "attr", ":", "CacheResource", ".", "CACHE_ATTRIBUTES", ")", "{", "attr", ".", "validateAndSet", "(", ...
Transfer elements common to both operations and models @param fromModel @param toModel
[ "Transfer", "elements", "common", "to", "both", "operations", "and", "models" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/CacheAdd.java#L270-L274
wg/lettuce
src/main/java/com/lambdaworks/redis/RedisConnection.java
RedisConnection.setTimeout
public void setTimeout(long timeout, TimeUnit unit) { """ Set the command timeout for this connection. @param timeout Command timeout. @param unit Unit of time for the timeout. """ this.timeout = timeout; this.unit = unit; c.setTimeout(timeout, unit); }
java
public void setTimeout(long timeout, TimeUnit unit) { this.timeout = timeout; this.unit = unit; c.setTimeout(timeout, unit); }
[ "public", "void", "setTimeout", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "{", "this", ".", "timeout", "=", "timeout", ";", "this", ".", "unit", "=", "unit", ";", "c", ".", "setTimeout", "(", "timeout", ",", "unit", ")", ";", "}" ]
Set the command timeout for this connection. @param timeout Command timeout. @param unit Unit of time for the timeout.
[ "Set", "the", "command", "timeout", "for", "this", "connection", "." ]
train
https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/RedisConnection.java#L49-L53
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java
ArrayFunctions.arrayConcat
public static Expression arrayConcat(Expression expression1, Expression expression2) { """ Returned expression results in new array with the concatenation of the input arrays. """ return x("ARRAY_CONCAT(" + expression1.toString() + ", " + expression2.toString() + ")"); }
java
public static Expression arrayConcat(Expression expression1, Expression expression2) { return x("ARRAY_CONCAT(" + expression1.toString() + ", " + expression2.toString() + ")"); }
[ "public", "static", "Expression", "arrayConcat", "(", "Expression", "expression1", ",", "Expression", "expression2", ")", "{", "return", "x", "(", "\"ARRAY_CONCAT(\"", "+", "expression1", ".", "toString", "(", ")", "+", "\", \"", "+", "expression2", ".", "toStri...
Returned expression results in new array with the concatenation of the input arrays.
[ "Returned", "expression", "results", "in", "new", "array", "with", "the", "concatenation", "of", "the", "input", "arrays", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java#L90-L92
advantageous/boon
reflekt/src/main/java/io/advantageous/boon/core/Str.java
Str.idx
public static String idx( String str, int index, char c ) { """ Puts character at index @param str string @param index index @param c char to put in @return new string """ char[] chars = str.toCharArray(); Chr.idx( chars, index, c ); return new String( chars ); }
java
public static String idx( String str, int index, char c ) { char[] chars = str.toCharArray(); Chr.idx( chars, index, c ); return new String( chars ); }
[ "public", "static", "String", "idx", "(", "String", "str", ",", "int", "index", ",", "char", "c", ")", "{", "char", "[", "]", "chars", "=", "str", ".", "toCharArray", "(", ")", ";", "Chr", ".", "idx", "(", "chars", ",", "index", ",", "c", ")", ...
Puts character at index @param str string @param index index @param c char to put in @return new string
[ "Puts", "character", "at", "index" ]
train
https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/core/Str.java#L201-L206
Azure/azure-sdk-for-java
hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java
ExtensionsInner.createAsync
public Observable<Void> createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { """ Creates an HDInsight cluster extension. @param resourceGroupName The name of the resource group. @param clusterName The name of the cluster. @param extensionName The name of...
java
public Observable<Void> createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { return createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1<ServiceResponse<Void>, Void>() { @Override p...
[ "public", "Observable", "<", "Void", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "String", "extensionName", ",", "ExtensionInner", "parameters", ")", "{", "return", "createWithServiceResponseAsync", "(", "resourceGroupName"...
Creates an HDInsight cluster extension. @param resourceGroupName The name of the resource group. @param clusterName The name of the cluster. @param extensionName The name of the cluster extension. @param parameters The cluster extensions create request. @throws IllegalArgumentException thrown if parameters fail the va...
[ "Creates", "an", "HDInsight", "cluster", "extension", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java#L551-L558
neo4j/neo4j-java-driver
driver/src/main/java/org/neo4j/driver/internal/logging/Slf4jLogger.java
Slf4jLogger.formatMessage
private static String formatMessage( String messageTemplate, Object... params ) { """ Creates a fully formatted message. Such formatting is needed because driver uses {@link String#format(String, Object...)} parameters in message templates, i.e. '%s' or '%d' while SLF4J uses '{}'. Thus this logger passes fully fo...
java
private static String formatMessage( String messageTemplate, Object... params ) { return String.format( messageTemplate, params ); }
[ "private", "static", "String", "formatMessage", "(", "String", "messageTemplate", ",", "Object", "...", "params", ")", "{", "return", "String", ".", "format", "(", "messageTemplate", ",", "params", ")", ";", "}" ]
Creates a fully formatted message. Such formatting is needed because driver uses {@link String#format(String, Object...)} parameters in message templates, i.e. '%s' or '%d' while SLF4J uses '{}'. Thus this logger passes fully formatted messages to SLF4J. @param messageTemplate the message template. @param params the p...
[ "Creates", "a", "fully", "formatted", "message", ".", "Such", "formatting", "is", "needed", "because", "driver", "uses", "{", "@link", "String#format", "(", "String", "Object", "...", ")", "}", "parameters", "in", "message", "templates", "i", ".", "e", ".", ...
train
https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/logging/Slf4jLogger.java#L108-L111
podio/podio-java
src/main/java/com/podio/rating/RatingAPI.java
RatingAPI.deleteRating
public void deleteRating(Reference reference, RatingType type) { """ Deletes the rating of the given type on the object by the active user @param reference The reference ot the object @param type The type of the rating """ getResourceFactory().getApiResource( "/rating/" + reference.toURLFragment(...
java
public void deleteRating(Reference reference, RatingType type) { getResourceFactory().getApiResource( "/rating/" + reference.toURLFragment() + type).delete(); }
[ "public", "void", "deleteRating", "(", "Reference", "reference", ",", "RatingType", "type", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/rating/\"", "+", "reference", ".", "toURLFragment", "(", ")", "+", "type", ")", ".", "delete",...
Deletes the rating of the given type on the object by the active user @param reference The reference ot the object @param type The type of the rating
[ "Deletes", "the", "rating", "of", "the", "given", "type", "on", "the", "object", "by", "the", "active", "user" ]
train
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/rating/RatingAPI.java#L57-L60
tvesalainen/util
util/src/main/java/org/vesalainen/ui/ScanlineFiller.java
ScanlineFiller.floodFill
public void floodFill(int xx, int yy, Rectangle clip, IntPredicate target, int replacement) { """ Fills clipped area starting at xx,yy. Area must be surrounded with replacement (or clip) @param xx @param yy @param clip @param target @param replacement """ floodFill(xx, yy, clip.x, clip.y, clip.x...
java
public void floodFill(int xx, int yy, Rectangle clip, IntPredicate target, int replacement) { floodFill(xx, yy, clip.x, clip.y, clip.x+clip.width, clip.y+clip.height, target, replacement); }
[ "public", "void", "floodFill", "(", "int", "xx", ",", "int", "yy", ",", "Rectangle", "clip", ",", "IntPredicate", "target", ",", "int", "replacement", ")", "{", "floodFill", "(", "xx", ",", "yy", ",", "clip", ".", "x", ",", "clip", ".", "y", ",", "...
Fills clipped area starting at xx,yy. Area must be surrounded with replacement (or clip) @param xx @param yy @param clip @param target @param replacement
[ "Fills", "clipped", "area", "starting", "at", "xx", "yy", ".", "Area", "must", "be", "surrounded", "with", "replacement", "(", "or", "clip", ")" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/ScanlineFiller.java#L100-L103
google/closure-compiler
src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java
SemanticReverseAbstractInterpreter.caseIn
@CheckReturnValue private FlowScope caseIn(Node object, String propertyName, FlowScope blindScope) { """ Given 'property in object', ensures that the object has the property in the informed scope by defining it as a qualified name if the object type lacks the property and it's not in the blind scope. @param...
java
@CheckReturnValue private FlowScope caseIn(Node object, String propertyName, FlowScope blindScope) { JSType jsType = object.getJSType(); jsType = this.getRestrictedWithoutNull(jsType); jsType = this.getRestrictedWithoutUndefined(jsType); boolean hasProperty = false; ObjectType objectType = Object...
[ "@", "CheckReturnValue", "private", "FlowScope", "caseIn", "(", "Node", "object", ",", "String", "propertyName", ",", "FlowScope", "blindScope", ")", "{", "JSType", "jsType", "=", "object", ".", "getJSType", "(", ")", ";", "jsType", "=", "this", ".", "getRes...
Given 'property in object', ensures that the object has the property in the informed scope by defining it as a qualified name if the object type lacks the property and it's not in the blind scope. @param object The node of the right-side of the in. @param propertyName The string of the left-side of the in.
[ "Given", "property", "in", "object", "ensures", "that", "the", "object", "has", "the", "property", "in", "the", "informed", "scope", "by", "defining", "it", "as", "a", "qualified", "name", "if", "the", "object", "type", "lacks", "the", "property", "and", "...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/SemanticReverseAbstractInterpreter.java#L486-L509
selenide/selenide
src/main/java/com/codeborne/selenide/logevents/SelenideLogger.java
SelenideLogger.addListener
public static void addListener(String name, LogEventListener listener) { """ Add a listener (to the current thread). @param name unique name of this listener (per thread). Can be used later to remove listener using method {@link #removeListener(String)} @param listener event listener """ Map<String, Log...
java
public static void addListener(String name, LogEventListener listener) { Map<String, LogEventListener> threadListeners = listeners.get(); if (threadListeners == null) { threadListeners = new HashMap<>(); } threadListeners.put(name, listener); listeners.set(threadListeners); }
[ "public", "static", "void", "addListener", "(", "String", "name", ",", "LogEventListener", "listener", ")", "{", "Map", "<", "String", ",", "LogEventListener", ">", "threadListeners", "=", "listeners", ".", "get", "(", ")", ";", "if", "(", "threadListeners", ...
Add a listener (to the current thread). @param name unique name of this listener (per thread). Can be used later to remove listener using method {@link #removeListener(String)} @param listener event listener
[ "Add", "a", "listener", "(", "to", "the", "current", "thread", ")", "." ]
train
https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/logevents/SelenideLogger.java#L22-L30
cdk/cdk
tool/charges/src/main/java/org/openscience/cdk/charges/Polarizability.java
Polarizability.calculateBondPolarizability
public double calculateBondPolarizability(IAtomContainer atomContainer, IBond bond) { """ calculate bond polarizability. @param atomContainer AtomContainer @param bond Bond bond for which the polarizabilitiy should be calculated @return polarizabilitiy """ double polarizabilitiy = 0; ...
java
public double calculateBondPolarizability(IAtomContainer atomContainer, IBond bond) { double polarizabilitiy = 0; IAtomContainer acH = atomContainer.getBuilder().newInstance(IAtomContainer.class, atomContainer); addExplicitHydrogens(acH); if (bond.getAtomCount() == 2) { polar...
[ "public", "double", "calculateBondPolarizability", "(", "IAtomContainer", "atomContainer", ",", "IBond", "bond", ")", "{", "double", "polarizabilitiy", "=", "0", ";", "IAtomContainer", "acH", "=", "atomContainer", ".", "getBuilder", "(", ")", ".", "newInstance", "...
calculate bond polarizability. @param atomContainer AtomContainer @param bond Bond bond for which the polarizabilitiy should be calculated @return polarizabilitiy
[ "calculate", "bond", "polarizability", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/Polarizability.java#L190-L199
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/zeromq/ZeroMQNetworkService.java
ZeroMQNetworkService.extractEnvelope
private static EventEnvelope extractEnvelope(Socket socket) throws IOException { """ Receive data from the network. @param socket - network reader. @return the envelope received over the network. @throws IOException if the envelope cannot be read from the network. """ // To-Do: Read the ZeroMQ s...
java
private static EventEnvelope extractEnvelope(Socket socket) throws IOException { // To-Do: Read the ZeroMQ socket via a NIO wrapper to support large data: // indeed the arrays has a maximal size bounded by a native int value, and // the real data could be larger than this limit. byte[] ...
[ "private", "static", "EventEnvelope", "extractEnvelope", "(", "Socket", "socket", ")", "throws", "IOException", "{", "// To-Do: Read the ZeroMQ socket via a NIO wrapper to support large data:", "// indeed the arrays has a maximal size bounded by a native int value, and", "// the real data ...
Receive data from the network. @param socket - network reader. @return the envelope received over the network. @throws IOException if the envelope cannot be read from the network.
[ "Receive", "data", "from", "the", "network", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/zeromq/ZeroMQNetworkService.java#L319-L352
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BreakIterator.java
BreakIterator.getBreakInstance
@Deprecated public static BreakIterator getBreakInstance(ULocale where, int kind) { """ Returns a particular kind of BreakIterator for a locale. Avoids writing a switch statement with getXYZInstance(where) calls. @deprecated This API is ICU internal only. @hide original deprecated declaration @hide draft /...
java
@Deprecated public static BreakIterator getBreakInstance(ULocale where, int kind) { if (where == null) { throw new NullPointerException("Specified locale is null"); } if (iterCache[kind] != null) { BreakIteratorCache cache = (BreakIteratorCache)iterCache[kind].get(); ...
[ "@", "Deprecated", "public", "static", "BreakIterator", "getBreakInstance", "(", "ULocale", "where", ",", "int", "kind", ")", "{", "if", "(", "where", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Specified locale is null\"", ")", ";", ...
Returns a particular kind of BreakIterator for a locale. Avoids writing a switch statement with getXYZInstance(where) calls. @deprecated This API is ICU internal only. @hide original deprecated declaration @hide draft / provisional / internal are hidden on Android
[ "Returns", "a", "particular", "kind", "of", "BreakIterator", "for", "a", "locale", ".", "Avoids", "writing", "a", "switch", "statement", "with", "getXYZInstance", "(", "where", ")", "calls", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BreakIterator.java#L806-L831
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java
Window.adaptActiveRegionToEnvelope
public static Window adaptActiveRegionToEnvelope( Envelope bounds, Window activeRegion ) { """ Takes an envelope and an active region and creates a new region to match the bounds of the envelope, but the resolutions of the active region. This is important if the region has to match some feature layer. The bounds...
java
public static Window adaptActiveRegionToEnvelope( Envelope bounds, Window activeRegion ) { Point2D eastNorth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMaxX(), bounds.getMaxY(), activeRegion); Point2D westsouth = Window.snapToNextHigherInActiveRegionResolution(bounds.getMinX() - activeR...
[ "public", "static", "Window", "adaptActiveRegionToEnvelope", "(", "Envelope", "bounds", ",", "Window", "activeRegion", ")", "{", "Point2D", "eastNorth", "=", "Window", ".", "snapToNextHigherInActiveRegionResolution", "(", "bounds", ".", "getMaxX", "(", ")", ",", "bo...
Takes an envelope and an active region and creates a new region to match the bounds of the envelope, but the resolutions of the active region. This is important if the region has to match some feature layer. The bounds are assured to contain completely the envelope. @param bounds @param activeRegion
[ "Takes", "an", "envelope", "and", "an", "active", "region", "and", "creates", "a", "new", "region", "to", "match", "the", "bounds", "of", "the", "envelope", "but", "the", "resolutions", "of", "the", "active", "region", ".", "This", "is", "important", "if",...
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Window.java#L504-L512
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/LexerEngine.java
LexerEngine.accept
public void accept(final TokenType tokenType) { """ Assert current token type should equals input token and go to next token type. @param tokenType token type """ if (lexer.getCurrentToken().getType() != tokenType) { throw new SQLParsingException(lexer, tokenType); } lexe...
java
public void accept(final TokenType tokenType) { if (lexer.getCurrentToken().getType() != tokenType) { throw new SQLParsingException(lexer, tokenType); } lexer.nextToken(); }
[ "public", "void", "accept", "(", "final", "TokenType", "tokenType", ")", "{", "if", "(", "lexer", ".", "getCurrentToken", "(", ")", ".", "getType", "(", ")", "!=", "tokenType", ")", "{", "throw", "new", "SQLParsingException", "(", "lexer", ",", "tokenType"...
Assert current token type should equals input token and go to next token type. @param tokenType token type
[ "Assert", "current", "token", "type", "should", "equals", "input", "token", "and", "go", "to", "next", "token", "type", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/lexer/LexerEngine.java#L120-L125
openbase/jul
exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java
ExceptionPrinter.printHistory
public static <T extends Throwable> void printHistory(final T th, final Printer printer) { """ Prints a human readable Exception cause chain of the given Exception. Builds a human readable Exception Print Exception messages without StackTrace in non debug mode. Method prints recursive all messages of the given ex...
java
public static <T extends Throwable> void printHistory(final T th, final Printer printer) { if (beQuiet) { return; } printHistory(th, printer, "", ""); // Print normal stacktrace in debug mode for all errors. if (printer.isDebugEnabled()) { printer.print(S...
[ "public", "static", "<", "T", "extends", "Throwable", ">", "void", "printHistory", "(", "final", "T", "th", ",", "final", "Printer", "printer", ")", "{", "if", "(", "beQuiet", ")", "{", "return", ";", "}", "printHistory", "(", "th", ",", "printer", ","...
Prints a human readable Exception cause chain of the given Exception. Builds a human readable Exception Print Exception messages without StackTrace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app -v) the stacktrace is pri...
[ "Prints", "a", "human", "readable", "Exception", "cause", "chain", "of", "the", "given", "Exception", ".", "Builds", "a", "human", "readable", "Exception", "Print", "Exception", "messages", "without", "StackTrace", "in", "non", "debug", "mode", ".", "Method", ...
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java#L303-L315
graknlabs/grakn
server/src/server/kb/concept/ElementFactory.java
ElementFactory.buildRelationReified
RelationReified buildRelationReified(VertexElement vertex, RelationType type) { """ Used by RelationEdge when it needs to reify a relation. Used by this factory when need to build an explicit relation @return ReifiedRelation """ return RelationReified.create(vertex, type); }
java
RelationReified buildRelationReified(VertexElement vertex, RelationType type) { return RelationReified.create(vertex, type); }
[ "RelationReified", "buildRelationReified", "(", "VertexElement", "vertex", ",", "RelationType", "type", ")", "{", "return", "RelationReified", ".", "create", "(", "vertex", ",", "type", ")", ";", "}" ]
Used by RelationEdge when it needs to reify a relation. Used by this factory when need to build an explicit relation @return ReifiedRelation
[ "Used", "by", "RelationEdge", "when", "it", "needs", "to", "reify", "a", "relation", ".", "Used", "by", "this", "factory", "when", "need", "to", "build", "an", "explicit", "relation" ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/ElementFactory.java#L122-L124
AlmogBaku/IntlPhoneInput
intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java
IntlPhoneInput.setError
@SuppressWarnings("unused") public void setError(CharSequence error, Drawable icon) { """ Sets an error message that will be displayed in a popup when the EditText has focus along with an icon displayed at the right-hand side. @param error error message to show """ mPhoneEdit.setError(error, ic...
java
@SuppressWarnings("unused") public void setError(CharSequence error, Drawable icon) { mPhoneEdit.setError(error, icon); }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "void", "setError", "(", "CharSequence", "error", ",", "Drawable", "icon", ")", "{", "mPhoneEdit", ".", "setError", "(", "error", ",", "icon", ")", ";", "}" ]
Sets an error message that will be displayed in a popup when the EditText has focus along with an icon displayed at the right-hand side. @param error error message to show
[ "Sets", "an", "error", "message", "that", "will", "be", "displayed", "in", "a", "popup", "when", "the", "EditText", "has", "focus", "along", "with", "an", "icon", "displayed", "at", "the", "right", "-", "hand", "side", "." ]
train
https://github.com/AlmogBaku/IntlPhoneInput/blob/ac7313a2d1683feb4d535d5dbee6676b53879059/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java#L373-L376