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
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsMapMessageImpl.java
JsJmsMapMessageImpl.setChar
public void setChar(String name, char value) throws UnsupportedEncodingException { """ /* Set a Unicode character value with the given name, into the Map. Javadoc description supplied by JsJmsMessage interface. """ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "...
java
public void setChar(String name, char value) throws UnsupportedEncodingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setChar", Character.valueOf(value)); getBodyMap().put(name, Character.valueOf(value)); if (TraceComponent.isAnyTracingEnabled() && tc.isE...
[ "public", "void", "setChar", "(", "String", "name", ",", "char", "value", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "...
/* Set a Unicode character value with the given name, into the Map. Javadoc description supplied by JsJmsMessage interface.
[ "/", "*", "Set", "a", "Unicode", "character", "value", "with", "the", "given", "name", "into", "the", "Map", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsMapMessageImpl.java#L306-L310
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/FastPathResolver.java
FastPathResolver.unescapePercentEncoding
private static void unescapePercentEncoding(final String path, final int startIdx, final int endIdx, final StringBuilder buf) { """ Unescape runs of percent encoding, e.g. "%20%43%20" -> " + " @param path the path @param startIdx the start index @param endIdx the end index @param buf the buf ...
java
private static void unescapePercentEncoding(final String path, final int startIdx, final int endIdx, final StringBuilder buf) { if (endIdx - startIdx == 3 && path.charAt(startIdx + 1) == '2' && path.charAt(startIdx + 2) == '0') { // Fast path for "%20" buf.append(' '); ...
[ "private", "static", "void", "unescapePercentEncoding", "(", "final", "String", "path", ",", "final", "int", "startIdx", ",", "final", "int", "endIdx", ",", "final", "StringBuilder", "buf", ")", "{", "if", "(", "endIdx", "-", "startIdx", "==", "3", "&&", "...
Unescape runs of percent encoding, e.g. "%20%43%20" -> " + " @param path the path @param startIdx the start index @param endIdx the end index @param buf the buf
[ "Unescape", "runs", "of", "percent", "encoding", "e", ".", "g", ".", "%20%43%20", "-", ">", "+" ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/FastPathResolver.java#L113-L133
google/truth
core/src/main/java/com/google/common/truth/MathUtil.java
MathUtil.equalWithinTolerance
public static boolean equalWithinTolerance(double left, double right, double tolerance) { """ Returns true iff {@code left} and {@code right} are finite values within {@code tolerance} of each other. Note that both this method and {@link #notEqualWithinTolerance} returns false if either {@code left} or {@code ri...
java
public static boolean equalWithinTolerance(double left, double right, double tolerance) { return Math.abs(left - right) <= Math.abs(tolerance); }
[ "public", "static", "boolean", "equalWithinTolerance", "(", "double", "left", ",", "double", "right", ",", "double", "tolerance", ")", "{", "return", "Math", ".", "abs", "(", "left", "-", "right", ")", "<=", "Math", ".", "abs", "(", "tolerance", ")", ";"...
Returns true iff {@code left} and {@code right} are finite values within {@code tolerance} of each other. Note that both this method and {@link #notEqualWithinTolerance} returns false if either {@code left} or {@code right} is infinite or NaN.
[ "Returns", "true", "iff", "{" ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MathUtil.java#L30-L32
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.addGroupMember
public GitlabGroupMember addGroupMember(Integer groupId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { """ Add a group member. @param groupId the group id @param userId the user id @param accessLevel the GitlabAccessLevel @return the GitlabGroupMember @throws IOException on gi...
java
public GitlabGroupMember addGroupMember(Integer groupId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { Query query = new Query() .appendIf("id", groupId) .appendIf("user_id", userId) .appendIf("access_level", accessLevel); String tail...
[ "public", "GitlabGroupMember", "addGroupMember", "(", "Integer", "groupId", ",", "Integer", "userId", ",", "GitlabAccessLevel", "accessLevel", ")", "throws", "IOException", "{", "Query", "query", "=", "new", "Query", "(", ")", ".", "appendIf", "(", "\"id\"", ","...
Add a group member. @param groupId the group id @param userId the user id @param accessLevel the GitlabAccessLevel @return the GitlabGroupMember @throws IOException on gitlab api call error
[ "Add", "a", "group", "member", "." ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L732-L739
EdwardRaff/JSAT
JSAT/src/jsat/linear/RowColumnOps.java
RowColumnOps.swapRow
public static void swapRow(Matrix A, int j, int k, int start, int to) { """ Swaps the rows <tt>j</tt> and <tt>k</tt> in the given matrix. @param A the matrix to perform he update on @param j the first row to swap @param k the second row to swap @param start the first column that will be included in the swap (i...
java
public static void swapRow(Matrix A, int j, int k, int start, int to) { double t; for(int i = start; i < to; i++) { t = A.get(j, i); A.set(j, i, A.get(k, i)); A.set(k, i, t); } }
[ "public", "static", "void", "swapRow", "(", "Matrix", "A", ",", "int", "j", ",", "int", "k", ",", "int", "start", ",", "int", "to", ")", "{", "double", "t", ";", "for", "(", "int", "i", "=", "start", ";", "i", "<", "to", ";", "i", "++", ")", ...
Swaps the rows <tt>j</tt> and <tt>k</tt> in the given matrix. @param A the matrix to perform he update on @param j the first row to swap @param k the second row to swap @param start the first column that will be included in the swap (inclusive) @param to the last column to be included in the swap (exclusive)
[ "Swaps", "the", "rows", "<tt", ">", "j<", "/", "tt", ">", "and", "<tt", ">", "k<", "/", "tt", ">", "in", "the", "given", "matrix", "." ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L388-L397
UrielCh/ovh-java-sdk
ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java
ApiOvhRouter.serviceName_vpn_POST
public OvhVpn serviceName_vpn_POST(String serviceName, String clientIp, String clientPrivNet, String psk, String serverPrivNet) throws IOException { """ Add a VPN to your router REST: POST /router/{serviceName}/vpn @param serverPrivNet [required] Server's private network @param psk [required] Your PSK key @p...
java
public OvhVpn serviceName_vpn_POST(String serviceName, String clientIp, String clientPrivNet, String psk, String serverPrivNet) throws IOException { String qPath = "/router/{serviceName}/vpn"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "clie...
[ "public", "OvhVpn", "serviceName_vpn_POST", "(", "String", "serviceName", ",", "String", "clientIp", ",", "String", "clientPrivNet", ",", "String", "psk", ",", "String", "serverPrivNet", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/router/{serviceN...
Add a VPN to your router REST: POST /router/{serviceName}/vpn @param serverPrivNet [required] Server's private network @param psk [required] Your PSK key @param clientIp [required] IP you will be connecting from / NULL (allow all) @param clientPrivNet [required] Client's private network @param serviceName [required] T...
[ "Add", "a", "VPN", "to", "your", "router" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L151-L161
alkacon/opencms-core
src/org/opencms/ui/apps/sessions/CmsSessionsApp.java
CmsSessionsApp.showSendBroadcastDialog
protected static void showSendBroadcastDialog(Set<String> ids, String caption, final CmsSessionsTable table) { """ Shows dialog to send broadcast.<p> @param ids of sessions to send broadcast to @param caption of window @param table instance of table to be refreshed after sending broadcast """ fin...
java
protected static void showSendBroadcastDialog(Set<String> ids, String caption, final CmsSessionsTable table) { final Window window = CmsBasicDialog.prepareWindow(); window.setCaption(caption); CmsBasicDialog dialog = new CmsSendBroadcastDialog(ids, CmsSessionsTable.getCloseRunnable(window, tab...
[ "protected", "static", "void", "showSendBroadcastDialog", "(", "Set", "<", "String", ">", "ids", ",", "String", "caption", ",", "final", "CmsSessionsTable", "table", ")", "{", "final", "Window", "window", "=", "CmsBasicDialog", ".", "prepareWindow", "(", ")", ...
Shows dialog to send broadcast.<p> @param ids of sessions to send broadcast to @param caption of window @param table instance of table to be refreshed after sending broadcast
[ "Shows", "dialog", "to", "send", "broadcast", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sessions/CmsSessionsApp.java#L180-L190
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java
ELKIServiceScanner.comparePackageClass
private static int comparePackageClass(Class<?> o1, Class<?> o2) { """ Compare two classes, by package name first. @param o1 First class @param o2 Second class @return Comparison result """ return o1.getPackage() == o2.getPackage() ? // o1.getCanonicalName().compareTo(o2.getCanonicalName()) //...
java
private static int comparePackageClass(Class<?> o1, Class<?> o2) { return o1.getPackage() == o2.getPackage() ? // o1.getCanonicalName().compareTo(o2.getCanonicalName()) // : o1.getPackage() == null ? -1 : o2.getPackage() == null ? +1 // : o1.getPackage().getName().compareTo(o2.getPackage...
[ "private", "static", "int", "comparePackageClass", "(", "Class", "<", "?", ">", "o1", ",", "Class", "<", "?", ">", "o2", ")", "{", "return", "o1", ".", "getPackage", "(", ")", "==", "o2", ".", "getPackage", "(", ")", "?", "//", "o1", ".", "getCanon...
Compare two classes, by package name first. @param o1 First class @param o2 Second class @return Comparison result
[ "Compare", "two", "classes", "by", "package", "name", "first", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceScanner.java#L274-L279
Alluxio/alluxio
core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java
GrpcServerBuilder.addService
public GrpcServerBuilder addService(ServiceType serviceType, GrpcService serviceDefinition) { """ Add a service to this server. @param serviceType the type of service @param serviceDefinition the service definition of new service @return an updated instance of this {@link GrpcServerBuilder} """ mServi...
java
public GrpcServerBuilder addService(ServiceType serviceType, GrpcService serviceDefinition) { mServices.add(serviceType); return addService(serviceDefinition); }
[ "public", "GrpcServerBuilder", "addService", "(", "ServiceType", "serviceType", ",", "GrpcService", "serviceDefinition", ")", "{", "mServices", ".", "add", "(", "serviceType", ")", ";", "return", "addService", "(", "serviceDefinition", ")", ";", "}" ]
Add a service to this server. @param serviceType the type of service @param serviceDefinition the service definition of new service @return an updated instance of this {@link GrpcServerBuilder}
[ "Add", "a", "service", "to", "this", "server", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java#L202-L205
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.addTransport
private void addTransport(String classname, String configFilename) throws ResponderConfigException, TransportConfigException { """ Add a new handler given the classname and config filename. It instantiates the class and then calls its initialization method to get the handler ready to process inbound probes. @...
java
private void addTransport(String classname, String configFilename) throws ResponderConfigException, TransportConfigException { ClassLoader cl = ClassLoader.getSystemClassLoader(); Class<?> transportClass; try { transportClass = cl.loadClass(classname); } catch (ClassNotFoundException e1) { ...
[ "private", "void", "addTransport", "(", "String", "classname", ",", "String", "configFilename", ")", "throws", "ResponderConfigException", ",", "TransportConfigException", "{", "ClassLoader", "cl", "=", "ClassLoader", ".", "getSystemClassLoader", "(", ")", ";", "Class...
Add a new handler given the classname and config filename. It instantiates the class and then calls its initialization method to get the handler ready to process inbound probes. @param classname is the FQCN of the handler class @param configFilename is the full path name of the config file name specific for the handle...
[ "Add", "a", "new", "handler", "given", "the", "classname", "and", "config", "filename", ".", "It", "instantiates", "the", "class", "and", "then", "calls", "its", "initialization", "method", "to", "get", "the", "handler", "ready", "to", "process", "inbound", ...
train
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L301-L323
CleverTap/clevertap-android-sdk
clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java
CleverTapAPI.setMultiValuesForKey
@SuppressWarnings( { """ Set a collection of unique values as a multi-value user profile property, any existing value will be overwritten. Max 100 values, on reaching 100 cap, oldest value(s) will be removed. Values must be Strings and are limited to 512 characters. @param key String @param values {@link ...
java
@SuppressWarnings({"unused", "WeakerAccess"}) public void setMultiValuesForKey(final String key, final ArrayList<String> values) { postAsyncSafely("setMultiValuesForKey", new Runnable() { @Override public void run() { _handleMultiValues(values, key, Constants.COMMAND_...
[ "@", "SuppressWarnings", "(", "{", "\"unused\"", ",", "\"WeakerAccess\"", "}", ")", "public", "void", "setMultiValuesForKey", "(", "final", "String", "key", ",", "final", "ArrayList", "<", "String", ">", "values", ")", "{", "postAsyncSafely", "(", "\"setMultiVal...
Set a collection of unique values as a multi-value user profile property, any existing value will be overwritten. Max 100 values, on reaching 100 cap, oldest value(s) will be removed. Values must be Strings and are limited to 512 characters. @param key String @param values {@link ArrayList} with String values
[ "Set", "a", "collection", "of", "unique", "values", "as", "a", "multi", "-", "value", "user", "profile", "property", "any", "existing", "value", "will", "be", "overwritten", ".", "Max", "100", "values", "on", "reaching", "100", "cap", "oldest", "value", "(...
train
https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L3371-L3379
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.matchIndex
public InternalIndex matchIndex(String pattern, QueryContext.IndexMatchHint matchHint) { """ Matches an index for the given pattern and match hint. @param pattern the pattern to match an index for. May be either an attribute name or an exact index name. @param matchHint the match hint. @return the matched ...
java
public InternalIndex matchIndex(String pattern, QueryContext.IndexMatchHint matchHint) { if (matchHint == QueryContext.IndexMatchHint.EXACT_NAME) { return indexesByName.get(pattern); } else { return attributeIndexRegistry.match(pattern, matchHint); } }
[ "public", "InternalIndex", "matchIndex", "(", "String", "pattern", ",", "QueryContext", ".", "IndexMatchHint", "matchHint", ")", "{", "if", "(", "matchHint", "==", "QueryContext", ".", "IndexMatchHint", ".", "EXACT_NAME", ")", "{", "return", "indexesByName", ".", ...
Matches an index for the given pattern and match hint. @param pattern the pattern to match an index for. May be either an attribute name or an exact index name. @param matchHint the match hint. @return the matched index or {@code null} if nothing matched. @see QueryContext.IndexMatchHint @see Indexes#matchIndex
[ "Matches", "an", "index", "for", "the", "given", "pattern", "and", "match", "hint", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L303-L309
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/dataaccess/file/VersionControlGit.java
VersionControlGit.sparseCheckout
public void sparseCheckout(String branch, String path) throws Exception { """ Actually a workaround since JGit does not support sparse checkout: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383772. Performs a HARD reset and FORCED checkout then deletes non-path items. Only to be used on server (not Designer). ...
java
public void sparseCheckout(String branch, String path) throws Exception { fetch(); // in case the branch is not known locally hardReset(); checkout(branch); pull(branch); // pull before delete or next pull may add non-path items back // delete non-path items List<File> ...
[ "public", "void", "sparseCheckout", "(", "String", "branch", ",", "String", "path", ")", "throws", "Exception", "{", "fetch", "(", ")", ";", "// in case the branch is not known locally", "hardReset", "(", ")", ";", "checkout", "(", "branch", ")", ";", "pull", ...
Actually a workaround since JGit does not support sparse checkout: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383772. Performs a HARD reset and FORCED checkout then deletes non-path items. Only to be used on server (not Designer).
[ "Actually", "a", "workaround", "since", "JGit", "does", "not", "support", "sparse", "checkout", ":", "https", ":", "//", "bugs", ".", "eclipse", ".", "org", "/", "bugs", "/", "show_bug", ".", "cgi?id", "=", "383772", ".", "Performs", "a", "HARD", "reset"...
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/dataaccess/file/VersionControlGit.java#L365-L376
defei/codelogger-utils
src/main/java/org/codelogger/utils/DateUtils.java
DateUtils.getDateOfSecondsBack
public static Date getDateOfSecondsBack(final int secondsBack, final Date date) { """ Get specify seconds back form given date. @param secondsBack how many second want to be back. @param date date to be handled. @return a new Date object. """ return dateBack(Calendar.SECOND, secondsBack, date); }
java
public static Date getDateOfSecondsBack(final int secondsBack, final Date date) { return dateBack(Calendar.SECOND, secondsBack, date); }
[ "public", "static", "Date", "getDateOfSecondsBack", "(", "final", "int", "secondsBack", ",", "final", "Date", "date", ")", "{", "return", "dateBack", "(", "Calendar", ".", "SECOND", ",", "secondsBack", ",", "date", ")", ";", "}" ]
Get specify seconds back form given date. @param secondsBack how many second want to be back. @param date date to be handled. @return a new Date object.
[ "Get", "specify", "seconds", "back", "form", "given", "date", "." ]
train
https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L149-L152
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_UserGroupSearchBases.java
URAPIs_UserGroupSearchBases.setupldapServer
private static void setupldapServer() throws Exception { """ Configure the embedded LDAP server. @throws Exception If the server failed to start for some reason. """ ds = new InMemoryLDAPServer(SUB_DN); Entry entry = new Entry(SUB_DN); entry.addAttribute("objectclass", "top"); ...
java
private static void setupldapServer() throws Exception { ds = new InMemoryLDAPServer(SUB_DN); Entry entry = new Entry(SUB_DN); entry.addAttribute("objectclass", "top"); entry.addAttribute("objectclass", "domain"); ds.add(entry); /* * Add the partition entries. ...
[ "private", "static", "void", "setupldapServer", "(", ")", "throws", "Exception", "{", "ds", "=", "new", "InMemoryLDAPServer", "(", "SUB_DN", ")", ";", "Entry", "entry", "=", "new", "Entry", "(", "SUB_DN", ")", ";", "entry", ".", "addAttribute", "(", "\"obj...
Configure the embedded LDAP server. @throws Exception If the server failed to start for some reason.
[ "Configure", "the", "embedded", "LDAP", "server", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_UserGroupSearchBases.java#L153-L216
wildfly/wildfly-core
server/src/main/java/org/jboss/as/server/deployment/Services.java
Services.deploymentUnitName
public static ServiceName deploymentUnitName(String parent, String name, Phase phase) { """ Get the service name of a subdeployment. @param parent the parent deployment name @param name the subdeployment name @param phase the deployment phase @return the service name """ return JBOSS_DEPLOYMENT_S...
java
public static ServiceName deploymentUnitName(String parent, String name, Phase phase) { return JBOSS_DEPLOYMENT_SUB_UNIT.append(parent, name, phase.name()); }
[ "public", "static", "ServiceName", "deploymentUnitName", "(", "String", "parent", ",", "String", "name", ",", "Phase", "phase", ")", "{", "return", "JBOSS_DEPLOYMENT_SUB_UNIT", ".", "append", "(", "parent", ",", "name", ",", "phase", ".", "name", "(", ")", "...
Get the service name of a subdeployment. @param parent the parent deployment name @param name the subdeployment name @param phase the deployment phase @return the service name
[ "Get", "the", "service", "name", "of", "a", "subdeployment", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/Services.java#L95-L97
jfinal/jfinal
src/main/java/com/jfinal/i18n/I18nInterceptor.java
I18nInterceptor.switchView
public void switchView(String locale, Controller c) { """ 在有些 web 系统中,页面需要国际化的文本过多,并且 css 以及 html 也因为际化而大不相同, 对于这种应用场景先直接制做多套同名称的国际化视图,并将这些视图以 locale 为子目录分类存放, 最后使用本拦截器根据 locale 动态切换视图,而不必对视图中的文本逐个进行国际化切换,省时省力。 """ Render render = c.getRender(); if (render != null) { String view = render.getView();...
java
public void switchView(String locale, Controller c) { Render render = c.getRender(); if (render != null) { String view = render.getView(); if (view != null) { if (view.startsWith("/")) { view = "/" + locale + view; } else { view = locale + "/" + view; } render.setView...
[ "public", "void", "switchView", "(", "String", "locale", ",", "Controller", "c", ")", "{", "Render", "render", "=", "c", ".", "getRender", "(", ")", ";", "if", "(", "render", "!=", "null", ")", "{", "String", "view", "=", "render", ".", "getView", "(...
在有些 web 系统中,页面需要国际化的文本过多,并且 css 以及 html 也因为际化而大不相同, 对于这种应用场景先直接制做多套同名称的国际化视图,并将这些视图以 locale 为子目录分类存放, 最后使用本拦截器根据 locale 动态切换视图,而不必对视图中的文本逐个进行国际化切换,省时省力。
[ "在有些", "web", "系统中,页面需要国际化的文本过多,并且", "css", "以及", "html", "也因为际化而大不相同,", "对于这种应用场景先直接制做多套同名称的国际化视图,并将这些视图以", "locale", "为子目录分类存放,", "最后使用本拦截器根据", "locale", "动态切换视图,而不必对视图中的文本逐个进行国际化切换,省时省力。" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/i18n/I18nInterceptor.java#L120-L134
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java
ScreenshotTaker.startScreenshotSequence
public void startScreenshotSequence(final String name, final int quality, final int frameDelay, final int maxFrames) { """ Takes a screenshot sequence and saves the images with the name prefix in the {@link Config} objects save path. The name prefix is appended with "_" + sequence_number for each image in the s...
java
public void startScreenshotSequence(final String name, final int quality, final int frameDelay, final int maxFrames) { initScreenShotSaver(); if(screenshotSequenceThread != null) { throw new RuntimeException("only one screenshot sequence is supported at a time"); } screenshotSequenceThread = new Screenshot...
[ "public", "void", "startScreenshotSequence", "(", "final", "String", "name", ",", "final", "int", "quality", ",", "final", "int", "frameDelay", ",", "final", "int", "maxFrames", ")", "{", "initScreenShotSaver", "(", ")", ";", "if", "(", "screenshotSequenceThread...
Takes a screenshot sequence and saves the images with the name prefix in the {@link Config} objects save path. The name prefix is appended with "_" + sequence_number for each image in the sequence, where numbering starts at 0. Requires write permission (android.permission.WRITE_EXTERNAL_STORAGE) in the AndroidManifes...
[ "Takes", "a", "screenshot", "sequence", "and", "saves", "the", "images", "with", "the", "name", "prefix", "in", "the", "{", "@link", "Config", "}", "objects", "save", "path", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L121-L131
mapbox/mapbox-navigation-android
libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/OfflineTileVersions.java
OfflineTileVersions.fetchRouteTileVersions
void fetchRouteTileVersions(String accessToken, final OnTileVersionsFoundCallback callback) { """ Call to receive all the available versions of Offline Tiles available. @param accessToken for the API call @param callback to be updated with the versions """ MapboxRouteTileVersions mapboxRouteTileVers...
java
void fetchRouteTileVersions(String accessToken, final OnTileVersionsFoundCallback callback) { MapboxRouteTileVersions mapboxRouteTileVersions = buildTileVersionsWith(accessToken); mapboxRouteTileVersions.enqueueCall(new Callback<RouteTileVersionsResponse>() { @Override public void onResponse(@NonNul...
[ "void", "fetchRouteTileVersions", "(", "String", "accessToken", ",", "final", "OnTileVersionsFoundCallback", "callback", ")", "{", "MapboxRouteTileVersions", "mapboxRouteTileVersions", "=", "buildTileVersionsWith", "(", "accessToken", ")", ";", "mapboxRouteTileVersions", ".",...
Call to receive all the available versions of Offline Tiles available. @param accessToken for the API call @param callback to be updated with the versions
[ "Call", "to", "receive", "all", "the", "available", "versions", "of", "Offline", "Tiles", "available", "." ]
train
https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/OfflineTileVersions.java#L25-L44
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java
CommercePriceListUserSegmentEntryRelPersistenceImpl.findAll
@Override public List<CommercePriceListUserSegmentEntryRel> findAll() { """ Returns all the commerce price list user segment entry rels. @return the commerce price list user segment entry rels """ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CommercePriceListUserSegmentEntryRel> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CommercePriceListUserSegmentEntryRel", ">", "findAll", "(", ")", "{", "return", "findAll", "(", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the commerce price list user segment entry rels. @return the commerce price list user segment entry rels
[ "Returns", "all", "the", "commerce", "price", "list", "user", "segment", "entry", "rels", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java#L2989-L2992
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueRange.java
ResidueRange.getResidue
public ResidueNumber getResidue(int positionInRange, AtomPositionMap map) { """ Returns the ResidueNumber that is at position {@code positionInRange} in <em>this</em> ResidueRange. @return The ResidueNumber, or false if it does not exist or is not within this ResidueRange """ if (map == null) throw new Nul...
java
public ResidueNumber getResidue(int positionInRange, AtomPositionMap map) { if (map == null) throw new NullPointerException("The AtomPositionMap must be non-null"); int i = 0; for (Map.Entry<ResidueNumber, Integer> entry : map.getNavMap().entrySet()) { if (i == positionInRange) return entry.getKey(); if (co...
[ "public", "ResidueNumber", "getResidue", "(", "int", "positionInRange", ",", "AtomPositionMap", "map", ")", "{", "if", "(", "map", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"The AtomPositionMap must be non-null\"", ")", ";", "int", "i", "="...
Returns the ResidueNumber that is at position {@code positionInRange} in <em>this</em> ResidueRange. @return The ResidueNumber, or false if it does not exist or is not within this ResidueRange
[ "Returns", "the", "ResidueNumber", "that", "is", "at", "position", "{" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueRange.java#L215-L225
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java
JSONSerializer.serializeFromField
public static String serializeFromField(final Object containingObject, final String fieldName, final int indentWidth, final boolean onlySerializePublicFields, final ClassFieldCache classFieldCache) { """ Recursively serialize the named field of an object, skipping transient and final fields. @param ...
java
public static String serializeFromField(final Object containingObject, final String fieldName, final int indentWidth, final boolean onlySerializePublicFields, final ClassFieldCache classFieldCache) { final FieldTypeInfo fieldResolvedTypeInfo = classFieldCache .get(containingObject.ge...
[ "public", "static", "String", "serializeFromField", "(", "final", "Object", "containingObject", ",", "final", "String", "fieldName", ",", "final", "int", "indentWidth", ",", "final", "boolean", "onlySerializePublicFields", ",", "final", "ClassFieldCache", "classFieldCac...
Recursively serialize the named field of an object, skipping transient and final fields. @param containingObject The object containing the field value to serialize. @param fieldName The name of the field to serialize. @param indentWidth If indentWidth == 0, no prettyprinting indentation is performed, otherwise this sp...
[ "Recursively", "serialize", "the", "named", "field", "of", "an", "object", "skipping", "transient", "and", "final", "fields", "." ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONSerializer.java#L547-L567
OpenLiberty/open-liberty
dev/com.ibm.ws.rest.handler/src/com/ibm/wsspi/rest/handler/helper/DefaultRoutingHelper.java
DefaultRoutingHelper.containsRoutingContext
public static boolean containsRoutingContext(RESTRequest request) { """ Quick check for multiple routing context, without actually fetching all pieces """ if (request.getHeader(RESTHandlerContainer.COLLECTIVE_HOST_NAMES) != null) { return true; } //No routing header found, ...
java
public static boolean containsRoutingContext(RESTRequest request) { if (request.getHeader(RESTHandlerContainer.COLLECTIVE_HOST_NAMES) != null) { return true; } //No routing header found, so check query strings return getQueryParameterValue(request, RESTHandlerContainer.COLLE...
[ "public", "static", "boolean", "containsRoutingContext", "(", "RESTRequest", "request", ")", "{", "if", "(", "request", ".", "getHeader", "(", "RESTHandlerContainer", ".", "COLLECTIVE_HOST_NAMES", ")", "!=", "null", ")", "{", "return", "true", ";", "}", "//No ro...
Quick check for multiple routing context, without actually fetching all pieces
[ "Quick", "check", "for", "multiple", "routing", "context", "without", "actually", "fetching", "all", "pieces" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.rest.handler/src/com/ibm/wsspi/rest/handler/helper/DefaultRoutingHelper.java#L106-L113
google/closure-compiler
src/com/google/javascript/jscomp/ModuleIdentifier.java
ModuleIdentifier.forClosure
public static ModuleIdentifier forClosure(String name) { """ Returns an identifier for a Closure namespace. @param name The Closure namespace. It may be in one of the formats `name.space`, `goog:name.space` or `goog:moduleName:name.space`, where the latter specifies that the module and namespace names are dif...
java
public static ModuleIdentifier forClosure(String name) { String normalizedName = name; if (normalizedName.startsWith("goog:")) { normalizedName = normalizedName.substring("goog:".length()); } String namespace = normalizedName; String moduleName = normalizedName; int splitPoint = normalize...
[ "public", "static", "ModuleIdentifier", "forClosure", "(", "String", "name", ")", "{", "String", "normalizedName", "=", "name", ";", "if", "(", "normalizedName", ".", "startsWith", "(", "\"goog:\"", ")", ")", "{", "normalizedName", "=", "normalizedName", ".", ...
Returns an identifier for a Closure namespace. @param name The Closure namespace. It may be in one of the formats `name.space`, `goog:name.space` or `goog:moduleName:name.space`, where the latter specifies that the module and namespace names are different.
[ "Returns", "an", "identifier", "for", "a", "Closure", "namespace", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ModuleIdentifier.java#L59-L74
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/system/SystemProperties.java
SystemProperties.setPropertyValue
@Nonnull public static EChange setPropertyValue (@Nonnull final String sKey, final long nValue) { """ Set a system property value under consideration of an eventually present {@link SecurityManager}. @param sKey The key of the system property. May not be <code>null</code>. @param nValue The value of the s...
java
@Nonnull public static EChange setPropertyValue (@Nonnull final String sKey, final long nValue) { return setPropertyValue (sKey, Long.toString (nValue)); }
[ "@", "Nonnull", "public", "static", "EChange", "setPropertyValue", "(", "@", "Nonnull", "final", "String", "sKey", ",", "final", "long", "nValue", ")", "{", "return", "setPropertyValue", "(", "sKey", ",", "Long", ".", "toString", "(", "nValue", ")", ")", "...
Set a system property value under consideration of an eventually present {@link SecurityManager}. @param sKey The key of the system property. May not be <code>null</code>. @param nValue The value of the system property. @since 8.5.7 @return {@link EChange}
[ "Set", "a", "system", "property", "value", "under", "consideration", "of", "an", "eventually", "present", "{", "@link", "SecurityManager", "}", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/system/SystemProperties.java#L179-L183
aws/aws-sdk-java
aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/GetIdentityMailFromDomainAttributesResult.java
GetIdentityMailFromDomainAttributesResult.setMailFromDomainAttributes
public void setMailFromDomainAttributes(java.util.Map<String, IdentityMailFromDomainAttributes> mailFromDomainAttributes) { """ <p> A map of identities to custom MAIL FROM attributes. </p> @param mailFromDomainAttributes A map of identities to custom MAIL FROM attributes. """ this.mailFromDomainA...
java
public void setMailFromDomainAttributes(java.util.Map<String, IdentityMailFromDomainAttributes> mailFromDomainAttributes) { this.mailFromDomainAttributes = mailFromDomainAttributes == null ? null : new com.amazonaws.internal.SdkInternalMap<String, IdentityMailFromDomainAttributes>(mailFromDomain...
[ "public", "void", "setMailFromDomainAttributes", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "IdentityMailFromDomainAttributes", ">", "mailFromDomainAttributes", ")", "{", "this", ".", "mailFromDomainAttributes", "=", "mailFromDomainAttributes", "==", "nul...
<p> A map of identities to custom MAIL FROM attributes. </p> @param mailFromDomainAttributes A map of identities to custom MAIL FROM attributes.
[ "<p", ">", "A", "map", "of", "identities", "to", "custom", "MAIL", "FROM", "attributes", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/GetIdentityMailFromDomainAttributesResult.java#L61-L64
Netflix/conductor
core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java
TaskServiceImpl.getExternalStorageLocation
public ExternalStorageLocation getExternalStorageLocation(String path, String operation, String type) { """ Get the external storage location where the task output payload is stored/to be stored @param path the path for which the external storage location is to be populated @param operation the operation ...
java
public ExternalStorageLocation getExternalStorageLocation(String path, String operation, String type) { try { ExternalPayloadStorage.Operation payloadOperation = ExternalPayloadStorage.Operation.valueOf(StringUtils.upperCase(operation)); ExternalPayloadStorage.PayloadType payloadType = E...
[ "public", "ExternalStorageLocation", "getExternalStorageLocation", "(", "String", "path", ",", "String", "operation", ",", "String", "type", ")", "{", "try", "{", "ExternalPayloadStorage", ".", "Operation", "payloadOperation", "=", "ExternalPayloadStorage", ".", "Operat...
Get the external storage location where the task output payload is stored/to be stored @param path the path for which the external storage location is to be populated @param operation the operation to be performed (read or write) @param type the type of payload (input or output) @return {@link ExternalStorag...
[ "Get", "the", "external", "storage", "location", "where", "the", "task", "output", "payload", "is", "stored", "/", "to", "be", "stored" ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java#L323-L333
liferay/com-liferay-commerce
commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java
CommerceTaxMethodPersistenceImpl.fetchByG_E
@Override public CommerceTaxMethod fetchByG_E(long groupId, String engineKey) { """ Returns the commerce tax method where groupId = &#63; and engineKey = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param groupId the group ID @param engineKey the engine key @return the...
java
@Override public CommerceTaxMethod fetchByG_E(long groupId, String engineKey) { return fetchByG_E(groupId, engineKey, true); }
[ "@", "Override", "public", "CommerceTaxMethod", "fetchByG_E", "(", "long", "groupId", ",", "String", "engineKey", ")", "{", "return", "fetchByG_E", "(", "groupId", ",", "engineKey", ",", "true", ")", ";", "}" ]
Returns the commerce tax method where groupId = &#63; and engineKey = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param groupId the group ID @param engineKey the engine key @return the matching commerce tax method, or <code>null</code> if a matching commerce tax method could no...
[ "Returns", "the", "commerce", "tax", "method", "where", "groupId", "=", "&#63", ";", "and", "engineKey", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", ".", "Uses", "the", "finder"...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java#L659-L662
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java
LocaleDisplayNames.getInstance
public static LocaleDisplayNames getInstance(Locale locale, DisplayContext... contexts) { """ Returns an instance of LocaleDisplayNames that returns names formatted for the provided {@link java.util.Locale}, using the provided DisplayContext settings @param locale the display {@link java.util.Locale} @param con...
java
public static LocaleDisplayNames getInstance(Locale locale, DisplayContext... contexts) { return getInstance(ULocale.forLocale(locale), contexts); }
[ "public", "static", "LocaleDisplayNames", "getInstance", "(", "Locale", "locale", ",", "DisplayContext", "...", "contexts", ")", "{", "return", "getInstance", "(", "ULocale", ".", "forLocale", "(", "locale", ")", ",", "contexts", ")", ";", "}" ]
Returns an instance of LocaleDisplayNames that returns names formatted for the provided {@link java.util.Locale}, using the provided DisplayContext settings @param locale the display {@link java.util.Locale} @param contexts one or more context settings (e.g. for dialect handling, capitalization, etc. @return a LocaleDi...
[ "Returns", "an", "instance", "of", "LocaleDisplayNames", "that", "returns", "names", "formatted", "for", "the", "provided", "{" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java#L128-L130
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java
EntrySerializer.serializeRemoval
void serializeRemoval(@NonNull Collection<TableKey> keys, byte[] target) { """ Serializes the given {@link TableKey} collection for removal into the given byte array. @param keys A Collection of {@link TableKey} to serialize for removals. @param target The byte array to serialize into. """ int of...
java
void serializeRemoval(@NonNull Collection<TableKey> keys, byte[] target) { int offset = 0; for (TableKey e : keys) { offset = serializeRemoval(e, target, offset); } }
[ "void", "serializeRemoval", "(", "@", "NonNull", "Collection", "<", "TableKey", ">", "keys", ",", "byte", "[", "]", "target", ")", "{", "int", "offset", "=", "0", ";", "for", "(", "TableKey", "e", ":", "keys", ")", "{", "offset", "=", "serializeRemoval...
Serializes the given {@link TableKey} collection for removal into the given byte array. @param keys A Collection of {@link TableKey} to serialize for removals. @param target The byte array to serialize into.
[ "Serializes", "the", "given", "{", "@link", "TableKey", "}", "collection", "for", "removal", "into", "the", "given", "byte", "array", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java#L141-L146
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
DocTreeScanner.visitProvides
@Override public R visitProvides(ProvidesTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ R r = scan(node.getServiceType(), p); r = scanAndReduce(node...
java
@Override public R visitProvides(ProvidesTree node, P p) { R r = scan(node.getServiceType(), p); r = scanAndReduce(node.getDescription(), p, r); return r; }
[ "@", "Override", "public", "R", "visitProvides", "(", "ProvidesTree", "node", ",", "P", "p", ")", "{", "R", "r", "=", "scan", "(", "node", ".", "getServiceType", "(", ")", ",", "p", ")", ";", "r", "=", "scanAndReduce", "(", "node", ".", "getDescripti...
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L334-L339
alkacon/opencms-core
src-setup/org/opencms/setup/ui/CmsSetupErrorDialog.java
CmsSetupErrorDialog.showErrorDialog
public static void showErrorDialog(String message, String details) { """ Shows error dialog, manually supplying details instead of getting them from an exception stack trace. @param message the error message @param details the details """ Window window = prepareWindow(DialogWidth.wide); wi...
java
public static void showErrorDialog(String message, String details) { Window window = prepareWindow(DialogWidth.wide); window.setCaption("Error"); window.setContent(new CmsSetupErrorDialog(message, details, null, window)); A_CmsUI.get().addWindow(window); }
[ "public", "static", "void", "showErrorDialog", "(", "String", "message", ",", "String", "details", ")", "{", "Window", "window", "=", "prepareWindow", "(", "DialogWidth", ".", "wide", ")", ";", "window", ".", "setCaption", "(", "\"Error\"", ")", ";", "window...
Shows error dialog, manually supplying details instead of getting them from an exception stack trace. @param message the error message @param details the details
[ "Shows", "error", "dialog", "manually", "supplying", "details", "instead", "of", "getting", "them", "from", "an", "exception", "stack", "trace", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/ui/CmsSetupErrorDialog.java#L154-L161
aoindustries/aocode-public
src/main/java/com/aoindustries/servlet/http/ServletUtil.java
ServletUtil.resourceExists
@Deprecated public static boolean resourceExists(ServletContext servletContext, HttpServletRequest request, String relativeUrlPath) throws MalformedURLException { """ Checks if a resource with the possibly-relative path exists. @deprecated Use regular methods directly @see #getAbsoluteURL(javax.servlet.ht...
java
@Deprecated public static boolean resourceExists(ServletContext servletContext, HttpServletRequest request, String relativeUrlPath) throws MalformedURLException { return getResource(servletContext, request, relativeUrlPath)!=null; }
[ "@", "Deprecated", "public", "static", "boolean", "resourceExists", "(", "ServletContext", "servletContext", ",", "HttpServletRequest", "request", ",", "String", "relativeUrlPath", ")", "throws", "MalformedURLException", "{", "return", "getResource", "(", "servletContext"...
Checks if a resource with the possibly-relative path exists. @deprecated Use regular methods directly @see #getAbsoluteURL(javax.servlet.http.HttpServletRequest, java.lang.String) @see ServletContext#getResource(java.lang.String) @see ServletContextCache#getResource(java.lang.String) @see ServletContextCache#get...
[ "Checks", "if", "a", "resource", "with", "the", "possibly", "-", "relative", "path", "exists", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L204-L207
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/ssh/components/ComponentFactory.java
ComponentFactory.getInstance
public Object getInstance(String name) throws SshException { """ Get a new instance of a supported component. @param name The name of the component; for example "3des-cbc" @return the newly instantiated object @throws ClassNotFoundException """ if (supported.containsKey(name)) { try { return cre...
java
public Object getInstance(String name) throws SshException { if (supported.containsKey(name)) { try { return createInstance(name, (Class<?>) supported.get(name)); } catch (Throwable t) { throw new SshException(t.getMessage(), SshException.INTERNAL_ERROR); } } throw new SshException(name + "...
[ "public", "Object", "getInstance", "(", "String", "name", ")", "throws", "SshException", "{", "if", "(", "supported", ".", "containsKey", "(", "name", ")", ")", "{", "try", "{", "return", "createInstance", "(", "name", ",", "(", "Class", "<", "?", ">", ...
Get a new instance of a supported component. @param name The name of the component; for example "3des-cbc" @return the newly instantiated object @throws ClassNotFoundException
[ "Get", "a", "new", "instance", "of", "a", "supported", "component", "." ]
train
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/components/ComponentFactory.java#L171-L182
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Audio.java
Audio.getValue
public static Number getValue(ByteBuffer buffer, SampleFormat format, int index) { """ Read a {@code Number} at specified index from {@code ByteBuffer} for specified {@code SampleFormat}. Depending on the sample format the value is represented by a {@code byte, short, integer, float or double} number. @param ...
java
public static Number getValue(ByteBuffer buffer, SampleFormat format, int index) { switch (format) { case U8: case U8P: return buffer.get(index); case S16: case S16P: return buffer.getShort(index); case S32: case S32P: return buffer.getInt(index); case FLT: case FLTP: return bu...
[ "public", "static", "Number", "getValue", "(", "ByteBuffer", "buffer", ",", "SampleFormat", "format", ",", "int", "index", ")", "{", "switch", "(", "format", ")", "{", "case", "U8", ":", "case", "U8P", ":", "return", "buffer", ".", "get", "(", "index", ...
Read a {@code Number} at specified index from {@code ByteBuffer} for specified {@code SampleFormat}. Depending on the sample format the value is represented by a {@code byte, short, integer, float or double} number. @param buffer {@code ByteBuffer} with audio samples. @param format {@code SampleFormat} of audio sample...
[ "Read", "a", "{", "@code", "Number", "}", "at", "specified", "index", "from", "{", "@code", "ByteBuffer", "}", "for", "specified", "{", "@code", "SampleFormat", "}", ".", "Depending", "on", "the", "sample", "format", "the", "value", "is", "represented", "b...
train
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Audio.java#L83-L104
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.updatePomProperty
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { """ Updates the given maven property value if value is not null and returns true if the pom has been changed @return true if the value changed and was non null or updated was true """ if (val...
java
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { if (value != null) { Object oldValue = properties.get(name); if (!Objects.equal(oldValue, value)) { getLOG().debug("Updating pom.xml property: " + name + " to " + ...
[ "public", "static", "boolean", "updatePomProperty", "(", "Properties", "properties", ",", "String", "name", ",", "Object", "value", ",", "boolean", "updated", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "Object", "oldValue", "=", "properties", ".",...
Updates the given maven property value if value is not null and returns true if the pom has been changed @return true if the value changed and was non null or updated was true
[ "Updates", "the", "given", "maven", "property", "value", "if", "value", "is", "not", "null", "and", "returns", "true", "if", "the", "pom", "has", "been", "changed" ]
train
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L261-L272
op4j/op4j
src/main/java/org/op4j/functions/FnNumber.java
FnNumber.toFloat
public static final Function<Number,Float> toFloat(final int scale, final RoundingMode roundingMode) { """ <p> It converts the target object into a {@link Float} using the given scale and {@link RoundingMode} </p> @param scale the scale to be used @param roundingMode the {@link RoundingMode} to round the inp...
java
public static final Function<Number,Float> toFloat(final int scale, final RoundingMode roundingMode) { return new ToFloat(scale, roundingMode); }
[ "public", "static", "final", "Function", "<", "Number", ",", "Float", ">", "toFloat", "(", "final", "int", "scale", ",", "final", "RoundingMode", "roundingMode", ")", "{", "return", "new", "ToFloat", "(", "scale", ",", "roundingMode", ")", ";", "}" ]
<p> It converts the target object into a {@link Float} using the given scale and {@link RoundingMode} </p> @param scale the scale to be used @param roundingMode the {@link RoundingMode} to round the input with @return the {@link Float}
[ "<p", ">", "It", "converts", "the", "target", "object", "into", "a", "{", "@link", "Float", "}", "using", "the", "given", "scale", "and", "{", "@link", "RoundingMode", "}", "<", "/", "p", ">" ]
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L157-L159
Azure/azure-sdk-for-java
recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesInner.java
ProtectionPoliciesInner.createOrUpdate
public ProtectionPolicyResourceInner createOrUpdate(String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner resourceProtectionPolicy) { """ Creates or modifies a backup policy. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. ...
java
public ProtectionPolicyResourceInner createOrUpdate(String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner resourceProtectionPolicy) { return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, policyName, resourceProtectionPolicy).toBlocking().single().bod...
[ "public", "ProtectionPolicyResourceInner", "createOrUpdate", "(", "String", "vaultName", ",", "String", "resourceGroupName", ",", "String", "policyName", ",", "ProtectionPolicyResourceInner", "resourceProtectionPolicy", ")", "{", "return", "createOrUpdateWithServiceResponseAsync"...
Creates or modifies a backup policy. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. @param vaultName The name of the Recovery Services vault. @param resourceGroupName The name of the resource group associated with the Recovery Services vault. @param policyName The ...
[ "Creates", "or", "modifies", "a", "backup", "policy", ".", "This", "is", "an", "asynchronous", "operation", ".", "Use", "the", "GetPolicyOperationResult", "API", "to", "Get", "the", "operation", "status", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesInner.java#L182-L184
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/DeltaCollectionValuedMap.java
DeltaCollectionValuedMap.entrySet
@Override public Set<Entry<K, Collection<V>>> entrySet() { """ This is cheap. @return a set view of the mappings contained in this map. """ return new AbstractSet<Entry<K, Collection<V>>>() { @Override public Iterator<Map.Entry<K, Collection<V>>> iterator() { Filter<Map.Entry<...
java
@Override public Set<Entry<K, Collection<V>>> entrySet() { return new AbstractSet<Entry<K, Collection<V>>>() { @Override public Iterator<Map.Entry<K, Collection<V>>> iterator() { Filter<Map.Entry<K, Collection<V>>> filter1 = new Filter<Map.Entry<K, Collection<V>>>() { private s...
[ "@", "Override", "public", "Set", "<", "Entry", "<", "K", ",", "Collection", "<", "V", ">", ">", ">", "entrySet", "(", ")", "{", "return", "new", "AbstractSet", "<", "Entry", "<", "K", ",", "Collection", "<", "V", ">", ">", ">", "(", ")", "{", ...
This is cheap. @return a set view of the mappings contained in this map.
[ "This", "is", "cheap", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/DeltaCollectionValuedMap.java#L212-L261
datumbox/datumbox-framework
datumbox-framework-common/src/main/java/com/datumbox/framework/common/utilities/ReflectionMethods.java
ReflectionMethods.invokeMethod
public static Object invokeMethod(Object obj, Method method, Object... params) { """ Invokes a method on the object using reflection. @param obj @param method @param params @return """ try { method.setAccessible(true); return method.invoke(obj, params); } c...
java
public static Object invokeMethod(Object obj, Method method, Object... params) { try { method.setAccessible(true); return method.invoke(obj, params); } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException ex) { throw new Runtime...
[ "public", "static", "Object", "invokeMethod", "(", "Object", "obj", ",", "Method", "method", ",", "Object", "...", "params", ")", "{", "try", "{", "method", ".", "setAccessible", "(", "true", ")", ";", "return", "method", ".", "invoke", "(", "obj", ",", ...
Invokes a method on the object using reflection. @param obj @param method @param params @return
[ "Invokes", "a", "method", "on", "the", "object", "using", "reflection", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/utilities/ReflectionMethods.java#L103-L111
OpenLiberty/open-liberty
dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAConfigurationImpl.java
LTPAConfigurationImpl.isKeysConfigChanged
private boolean isKeysConfigChanged(String oldKeyImportFile, Long oldKeyTokenExpiration) { """ The keys config is changed if the file or expiration were modified. Changing the password by itself must not be considered a config change that should trigger a keys reload. """ return ((oldKeyImportFile.equ...
java
private boolean isKeysConfigChanged(String oldKeyImportFile, Long oldKeyTokenExpiration) { return ((oldKeyImportFile.equals(keyImportFile) == false) || (oldKeyTokenExpiration != keyTokenExpiration)); }
[ "private", "boolean", "isKeysConfigChanged", "(", "String", "oldKeyImportFile", ",", "Long", "oldKeyTokenExpiration", ")", "{", "return", "(", "(", "oldKeyImportFile", ".", "equals", "(", "keyImportFile", ")", "==", "false", ")", "||", "(", "oldKeyTokenExpiration", ...
The keys config is changed if the file or expiration were modified. Changing the password by itself must not be considered a config change that should trigger a keys reload.
[ "The", "keys", "config", "is", "changed", "if", "the", "file", "or", "expiration", "were", "modified", ".", "Changing", "the", "password", "by", "itself", "must", "not", "be", "considered", "a", "config", "change", "that", "should", "trigger", "a", "keys", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAConfigurationImpl.java#L214-L216
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java
ServletHttpContext.addServlet
public synchronized ServletHolder addServlet(String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { """ Add a servlet to the context. Conveniance method. If no Servle...
java
public synchronized ServletHolder addServlet(String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { return addServlet(className,pathSpec,className); }
[ "public", "synchronized", "ServletHolder", "addServlet", "(", "String", "pathSpec", ",", "String", "className", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "return", "addServlet", "(", "className", ",", "pa...
Add a servlet to the context. Conveniance method. If no ServletHandler is found in the context, a new one is added. @param pathSpec The pathspec within the context @param className The classname of the servlet. @return The ServletHolder. @exception ClassNotFoundException @exception InstantiationException @exception Ill...
[ "Add", "a", "servlet", "to", "the", "context", ".", "Conveniance", "method", ".", "If", "no", "ServletHandler", "is", "found", "in", "the", "context", "a", "new", "one", "is", "added", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L90-L97
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/FileTransferHandlerVaadinUpload.java
FileTransferHandlerVaadinUpload.updateProgress
@Override public void updateProgress(final long readBytes, final long contentLength) { """ Reports progress in {@link Upload} variant. @see com.vaadin.ui.Upload.ProgressListener#updateProgress(long, long) """ if (readBytes > maxSize || contentLength > maxSize) { LOG.error("User tried...
java
@Override public void updateProgress(final long readBytes, final long contentLength) { if (readBytes > maxSize || contentLength > maxSize) { LOG.error("User tried to upload more than was allowed ({}).", maxSize); interruptUploadDueToFileSizeExceeded(maxSize); return; ...
[ "@", "Override", "public", "void", "updateProgress", "(", "final", "long", "readBytes", ",", "final", "long", "contentLength", ")", "{", "if", "(", "readBytes", ">", "maxSize", "||", "contentLength", ">", "maxSize", ")", "{", "LOG", ".", "error", "(", "\"U...
Reports progress in {@link Upload} variant. @see com.vaadin.ui.Upload.ProgressListener#updateProgress(long, long)
[ "Reports", "progress", "in", "{", "@link", "Upload", "}", "variant", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/FileTransferHandlerVaadinUpload.java#L147-L161
aws/aws-sdk-java
aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java
StepFunctionBuilder.gte
public static TimestampGreaterThanOrEqualCondition.Builder gte(String variable, Date expectedValue) { """ Binary condition for Timestamp greater than or equal to comparison. Dates are converted to ISO8601 UTC timestamps. @param variable The JSONPath expression that determines which piece of the input docum...
java
public static TimestampGreaterThanOrEqualCondition.Builder gte(String variable, Date expectedValue) { return TimestampGreaterThanOrEqualCondition.builder().variable(variable).expectedValue(expectedValue); }
[ "public", "static", "TimestampGreaterThanOrEqualCondition", ".", "Builder", "gte", "(", "String", "variable", ",", "Date", "expectedValue", ")", "{", "return", "TimestampGreaterThanOrEqualCondition", ".", "builder", "(", ")", ".", "variable", "(", "variable", ")", "...
Binary condition for Timestamp greater than or equal to comparison. Dates are converted to ISO8601 UTC timestamps. @param variable The JSONPath expression that determines which piece of the input document is used for the comparison. @param expectedValue The expected value for this condition. @see <a href="https:/...
[ "Binary", "condition", "for", "Timestamp", "greater", "than", "or", "equal", "to", "comparison", ".", "Dates", "are", "converted", "to", "ISO8601", "UTC", "timestamps", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java#L356-L358
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.readFolder
public CmsFolder readFolder(CmsRequestContext context, String resourcename, CmsResourceFilter filter) throws CmsException { """ Reads a folder resource from the VFS, using the specified resource filter.<p> The specified filter controls what kind of resources should be "found" during the read operation. Th...
java
public CmsFolder readFolder(CmsRequestContext context, String resourcename, CmsResourceFilter filter) throws CmsException { CmsFolder result = null; CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { result = readFolder(dbc, resourcename, filter); } catch...
[ "public", "CmsFolder", "readFolder", "(", "CmsRequestContext", "context", ",", "String", "resourcename", ",", "CmsResourceFilter", "filter", ")", "throws", "CmsException", "{", "CmsFolder", "result", "=", "null", ";", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ...
Reads a folder resource from the VFS, using the specified resource filter.<p> The specified filter controls what kind of resources should be "found" during the read operation. This will depend on the application. For example, using <code>{@link CmsResourceFilter#DEFAULT}</code> will only return currently "valid" resou...
[ "Reads", "a", "folder", "resource", "from", "the", "VFS", "using", "the", "specified", "resource", "filter", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4305-L4318
tvesalainen/bcc
src/main/java/org/vesalainen/bcc/MethodCompiler.java
MethodCompiler.addExceptionHandler
public void addExceptionHandler(Block block, String handler, List<? extends TypeMirror> thrownTypes) { """ Adds an exception handler. If one of catchTypes is thrown inside block the execution continues at handler address. Thrown object is pushed in stack. @param block @param handler @param thrownTypes Throwa...
java
public void addExceptionHandler(Block block, String handler, List<? extends TypeMirror> thrownTypes) { Label label = getLabel(handler); if (!thrownTypes.isEmpty()) { for (TypeMirror thrownType : thrownTypes) { exceptionTableList.add(new Exceptio...
[ "public", "void", "addExceptionHandler", "(", "Block", "block", ",", "String", "handler", ",", "List", "<", "?", "extends", "TypeMirror", ">", "thrownTypes", ")", "{", "Label", "label", "=", "getLabel", "(", "handler", ")", ";", "if", "(", "!", "thrownType...
Adds an exception handler. If one of catchTypes is thrown inside block the execution continues at handler address. Thrown object is pushed in stack. @param block @param handler @param thrownTypes Throwable objects which are caught. If none is present then all throwables are caught. Note! This is not the same as finall...
[ "Adds", "an", "exception", "handler", ".", "If", "one", "of", "catchTypes", "is", "thrown", "inside", "block", "the", "execution", "continues", "at", "handler", "address", ".", "Thrown", "object", "is", "pushed", "in", "stack", "." ]
train
https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L1669-L1683
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/GlobalMercator.java
GlobalMercator.TileLatLonBounds
public Envelope TileLatLonBounds( int tx, int ty, int zoom ) { """ Returns bounds of the given tile in latitude/longitude using WGS84 datum return the array of [w, s, e, n] """ double[] wsenBounds = TileBounds(tx, ty, zoom); double[] sw = MetersToLatLon(wsenBounds[0], wsenBounds[1]); ...
java
public Envelope TileLatLonBounds( int tx, int ty, int zoom ) { double[] wsenBounds = TileBounds(tx, ty, zoom); double[] sw = MetersToLatLon(wsenBounds[0], wsenBounds[1]); double[] ne = MetersToLatLon(wsenBounds[2], wsenBounds[3]); return new Envelope(sw[1], ne[1], sw[0], ne[0]); }
[ "public", "Envelope", "TileLatLonBounds", "(", "int", "tx", ",", "int", "ty", ",", "int", "zoom", ")", "{", "double", "[", "]", "wsenBounds", "=", "TileBounds", "(", "tx", ",", "ty", ",", "zoom", ")", ";", "double", "[", "]", "sw", "=", "MetersToLatL...
Returns bounds of the given tile in latitude/longitude using WGS84 datum return the array of [w, s, e, n]
[ "Returns", "bounds", "of", "the", "given", "tile", "in", "latitude", "/", "longitude", "using", "WGS84", "datum" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/GlobalMercator.java#L277-L282
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.stripAccents
@GwtIncompatible("incompatible method") public static String stripAccents(final String input) { """ See also Lucene's ASCIIFoldingFilter (Lucene 2.9) that replaces accented characters by their unaccented equivalent (and uncommitted bug fix: https://issues.apache.org/jira/browse/LUCENE-1343?focusedCommentId=128...
java
@GwtIncompatible("incompatible method") public static String stripAccents(final String input) { if(input == null) { return null; } final Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");//$NON-NLS-1$ final StringBuilder decomposed = new StringBuilder...
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "String", "stripAccents", "(", "final", "String", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "final", "Pattern", "pattern", "=", ...
See also Lucene's ASCIIFoldingFilter (Lucene 2.9) that replaces accented characters by their unaccented equivalent (and uncommitted bug fix: https://issues.apache.org/jira/browse/LUCENE-1343?focusedCommentId=12858907&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12858907).
[ "See", "also", "Lucene", "s", "ASCIIFoldingFilter", "(", "Lucene", "2", ".", "9", ")", "that", "replaces", "accented", "characters", "by", "their", "unaccented", "equivalent", "(", "and", "uncommitted", "bug", "fix", ":", "https", ":", "//", "issues", ".", ...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L950-L960
twitter/hraven
hraven-core/src/main/java/com/twitter/hraven/util/JSONUtil.java
JSONUtil.writeJson
public static void writeJson(Writer writer, Object object) throws IOException { """ Writes object to the writer as JSON using Jackson and adds a new-line before flushing. @param writer the writer to write the JSON to @param object the object to write as JSON @throws IOException if the object can't be serialized...
java
public static void writeJson(Writer writer, Object object) throws IOException { ObjectMapper om = ObjectMapperProvider.createCustomMapper(); om.configure(SerializationConfig.Feature.INDENT_OUTPUT, true); om.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false); writer.write(om.writeValueAs...
[ "public", "static", "void", "writeJson", "(", "Writer", "writer", ",", "Object", "object", ")", "throws", "IOException", "{", "ObjectMapper", "om", "=", "ObjectMapperProvider", ".", "createCustomMapper", "(", ")", ";", "om", ".", "configure", "(", "Serialization...
Writes object to the writer as JSON using Jackson and adds a new-line before flushing. @param writer the writer to write the JSON to @param object the object to write as JSON @throws IOException if the object can't be serialized as JSON or written to the writer
[ "Writes", "object", "to", "the", "writer", "as", "JSON", "using", "Jackson", "and", "adds", "a", "new", "-", "line", "before", "flushing", "." ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/util/JSONUtil.java#L44-L53
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberFormat.java
NumberFormat.getInstance
public static NumberFormat getInstance(ULocale desiredLocale, int choice) { """ Returns a specific style number format for a specific locale. @param desiredLocale the specific locale. @param choice number format style @throws IllegalArgumentException if choice is not one of NUMBERSTYLE, CURRENCYSTYLE...
java
public static NumberFormat getInstance(ULocale desiredLocale, int choice) { if (choice < NUMBERSTYLE || choice > STANDARDCURRENCYSTYLE) { throw new IllegalArgumentException( "choice should be from NUMBERSTYLE to STANDARDCURRENCYSTYLE"); } // if (shim == null) { // ...
[ "public", "static", "NumberFormat", "getInstance", "(", "ULocale", "desiredLocale", ",", "int", "choice", ")", "{", "if", "(", "choice", "<", "NUMBERSTYLE", "||", "choice", ">", "STANDARDCURRENCYSTYLE", ")", "{", "throw", "new", "IllegalArgumentException", "(", ...
Returns a specific style number format for a specific locale. @param desiredLocale the specific locale. @param choice number format style @throws IllegalArgumentException if choice is not one of NUMBERSTYLE, CURRENCYSTYLE, PERCENTSTYLE, SCIENTIFICSTYLE, INTEGERSTYLE, ISOCURRENCYSTYLE, PLURALCURRENCYSTYLE, ACC...
[ "Returns", "a", "specific", "style", "number", "format", "for", "a", "specific", "locale", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberFormat.java#L1237-L1249
pravega/pravega
controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java
StreamTransactionMetadataTasks.pingTxn
public CompletableFuture<PingTxnStatus> pingTxn(final String scope, final String stream, final UUID txId, final long lease, ...
java
public CompletableFuture<PingTxnStatus> pingTxn(final String scope, final String stream, final UUID txId, final long lease, ...
[ "public", "CompletableFuture", "<", "PingTxnStatus", ">", "pingTxn", "(", "final", "String", "scope", ",", "final", "String", "stream", ",", "final", "UUID", "txId", ",", "final", "long", "lease", ",", "final", "OperationContext", "contextOpt", ")", "{", "fina...
Transaction heartbeat, that increases transaction timeout by lease number of milliseconds. @param scope Stream scope. @param stream Stream name. @param txId Transaction identifier. @param lease Amount of time in milliseconds by which to extend the transaction lease. @param contextOpt operational context @return ...
[ "Transaction", "heartbeat", "that", "increases", "transaction", "timeout", "by", "lease", "number", "of", "milliseconds", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L212-L219
alkacon/opencms-core
src/org/opencms/file/CmsObject.java
CmsObject.deleteUser
public void deleteUser(CmsUUID userId, CmsUUID replacementId) throws CmsException { """ Deletes a user, where all permissions and resources attributes of the user were transfered to a replacement user.<p> @param userId the id of the user to be deleted @param replacementId the id of the user to be transfered, ...
java
public void deleteUser(CmsUUID userId, CmsUUID replacementId) throws CmsException { m_securityManager.deleteUser(m_context, userId, replacementId); }
[ "public", "void", "deleteUser", "(", "CmsUUID", "userId", ",", "CmsUUID", "replacementId", ")", "throws", "CmsException", "{", "m_securityManager", ".", "deleteUser", "(", "m_context", ",", "userId", ",", "replacementId", ")", ";", "}" ]
Deletes a user, where all permissions and resources attributes of the user were transfered to a replacement user.<p> @param userId the id of the user to be deleted @param replacementId the id of the user to be transfered, can be <code>null</code> @throws CmsException if operation was not successful
[ "Deletes", "a", "user", "where", "all", "permissions", "and", "resources", "attributes", "of", "the", "user", "were", "transfered", "to", "a", "replacement", "user", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1111-L1114
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/IntStream.java
IntStream.scan
@NotNull public IntStream scan(final int identity, @NotNull final IntBinaryOperator accumulator) { """ Returns a {@code IntStream} produced by iterative application of a accumulation function to an initial element {@code identity} and next element of the current stream. Produces a {...
java
@NotNull public IntStream scan(final int identity, @NotNull final IntBinaryOperator accumulator) { Objects.requireNonNull(accumulator); return new IntStream(params, new IntScanIdentity(iterator, identity, accumulator)); }
[ "@", "NotNull", "public", "IntStream", "scan", "(", "final", "int", "identity", ",", "@", "NotNull", "final", "IntBinaryOperator", "accumulator", ")", "{", "Objects", ".", "requireNonNull", "(", "accumulator", ")", ";", "return", "new", "IntStream", "(", "para...
Returns a {@code IntStream} produced by iterative application of a accumulation function to an initial element {@code identity} and next element of the current stream. Produces a {@code IntStream} consisting of {@code identity}, {@code acc(identity, value1)}, {@code acc(acc(identity, value1), value2)}, etc. <p>This is...
[ "Returns", "a", "{", "@code", "IntStream", "}", "produced", "by", "iterative", "application", "of", "a", "accumulation", "function", "to", "an", "initial", "element", "{", "@code", "identity", "}", "and", "next", "element", "of", "the", "current", "stream", ...
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L733-L738
jpaoletti/java-presentation-manager
modules/jpm-core/src/main/java/jpaoletti/jpm/security/core/BCrypt.java
BCrypt.checkpw
public static boolean checkpw(String plaintext, String hashed) { """ Check that a plaintext password matches a previously hashed one @param plaintext the plaintext password to verify @param hashed the previously-hashed password @return true if the passwords match, false otherwise """ return (hashed...
java
public static boolean checkpw(String plaintext, String hashed) { return (hashed.compareTo(hashpw(plaintext, hashed)) == 0); }
[ "public", "static", "boolean", "checkpw", "(", "String", "plaintext", ",", "String", "hashed", ")", "{", "return", "(", "hashed", ".", "compareTo", "(", "hashpw", "(", "plaintext", ",", "hashed", ")", ")", "==", "0", ")", ";", "}" ]
Check that a plaintext password matches a previously hashed one @param plaintext the plaintext password to verify @param hashed the previously-hashed password @return true if the passwords match, false otherwise
[ "Check", "that", "a", "plaintext", "password", "matches", "a", "previously", "hashed", "one" ]
train
https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/security/core/BCrypt.java#L764-L766
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgObject.java
JsMsgObject.encodePartToBuffer
private final int encodePartToBuffer(JsMsgPart jsPart, boolean header, byte[] buffer, int offset) throws MessageEncodeFailedException { """ Encode the message part into a byte array buffer. The buffer will be used for transmitting over the wire, hardening into a database and any other need for 'serialization' L...
java
private final int encodePartToBuffer(JsMsgPart jsPart, boolean header, byte[] buffer, int offset) throws MessageEncodeFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "encodePartToBuffer", new Object[]{jsPart, header, buffer, offset}); JMFMessage msg = (J...
[ "private", "final", "int", "encodePartToBuffer", "(", "JsMsgPart", "jsPart", ",", "boolean", "header", ",", "byte", "[", "]", "buffer", ",", "int", "offset", ")", "throws", "MessageEncodeFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled...
Encode the message part into a byte array buffer. The buffer will be used for transmitting over the wire, hardening into a database and any other need for 'serialization' Locking: The caller MUST have already synchronized on getPartLockArtefact(jsPart) before calling this method. (This would have to be true in any case...
[ "Encode", "the", "message", "part", "into", "a", "byte", "array", "buffer", ".", "The", "buffer", "will", "be", "used", "for", "transmitting", "over", "the", "wire", "hardening", "into", "a", "database", "and", "any", "other", "need", "for", "serialization",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgObject.java#L1091-L1129
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java
InterfaceEndpointsInner.beginCreateOrUpdate
public InterfaceEndpointInner beginCreateOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { """ Creates or updates an interface endpoint in the specified resource group. @param resourceGroupName The name of the resource group. @param interfaceEndpointName The ...
java
public InterfaceEndpointInner beginCreateOrUpdate(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).toBlocking().single().body(); }
[ "public", "InterfaceEndpointInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "interfaceEndpointName", ",", "InterfaceEndpointInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", ...
Creates or updates an interface endpoint in the specified resource group. @param resourceGroupName The name of the resource group. @param interfaceEndpointName The name of the interface endpoint. @param parameters Parameters supplied to the create or update interface endpoint operation @throws IllegalArgumentException...
[ "Creates", "or", "updates", "an", "interface", "endpoint", "in", "the", "specified", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java#L508-L510
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/render/R.java
R.addClass2Component
protected static void addClass2Component(UIComponent c, String aclass) { """ Adds a CSS class to a component in the view tree. The class is appended to the styleClass value. @param c the component @param aclass the CSS class to be added """ Map<String, Object> a = c.getAttributes(); if (a.containsKe...
java
protected static void addClass2Component(UIComponent c, String aclass) { Map<String, Object> a = c.getAttributes(); if (a.containsKey("styleClass")) { a.put("styleClass", a.get("styleClass") + " " + aclass); } else { a.put("styleClass", aclass); } }
[ "protected", "static", "void", "addClass2Component", "(", "UIComponent", "c", ",", "String", "aclass", ")", "{", "Map", "<", "String", ",", "Object", ">", "a", "=", "c", ".", "getAttributes", "(", ")", ";", "if", "(", "a", ".", "containsKey", "(", "\"s...
Adds a CSS class to a component in the view tree. The class is appended to the styleClass value. @param c the component @param aclass the CSS class to be added
[ "Adds", "a", "CSS", "class", "to", "a", "component", "in", "the", "view", "tree", ".", "The", "class", "is", "appended", "to", "the", "styleClass", "value", "." ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/R.java#L196-L203
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/preprocessing/StandardScaler.java
StandardScaler.scale
private Double scale(Double value, Double mean, Double std) { """ Performs the actual rescaling handling corner cases. @param value @param mean @param std @return """ if(std.equals(0.0)) { if(value > mean) { return 1.0; } else if(value < mean) {...
java
private Double scale(Double value, Double mean, Double std) { if(std.equals(0.0)) { if(value > mean) { return 1.0; } else if(value < mean) { return -1.0; } else { return Math.signum(value); } ...
[ "private", "Double", "scale", "(", "Double", "value", ",", "Double", "mean", ",", "Double", "std", ")", "{", "if", "(", "std", ".", "equals", "(", "0.0", ")", ")", "{", "if", "(", "value", ">", "mean", ")", "{", "return", "1.0", ";", "}", "else",...
Performs the actual rescaling handling corner cases. @param value @param mean @param std @return
[ "Performs", "the", "actual", "rescaling", "handling", "corner", "cases", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/preprocessing/StandardScaler.java#L208-L223
groupon/robo-remote
RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Client.java
Client.mapField
public JSONArray mapField(String query, String field_name) throws Exception { """ Used to get the value from a field @param query @param field_name @return @throws Exception """ QueryBuilder builder = new QueryBuilder(API_PORT); builder.mapField(query, field_name); return builder.ex...
java
public JSONArray mapField(String query, String field_name) throws Exception { QueryBuilder builder = new QueryBuilder(API_PORT); builder.mapField(query, field_name); return builder.execute(); }
[ "public", "JSONArray", "mapField", "(", "String", "query", ",", "String", "field_name", ")", "throws", "Exception", "{", "QueryBuilder", "builder", "=", "new", "QueryBuilder", "(", "API_PORT", ")", ";", "builder", ".", "mapField", "(", "query", ",", "field_nam...
Used to get the value from a field @param query @param field_name @return @throws Exception
[ "Used", "to", "get", "the", "value", "from", "a", "field" ]
train
https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/Client.java#L116-L120
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java
CmsGalleryController.getSubFolders
public void getSubFolders(final String folder, final AsyncCallback<List<CmsVfsEntryBean>> callback) { """ Retrieves the sub-folders of a given folder.<p> @param folder the folder whose sub-folders should be retrieved @param callback the callback for processing the sub-folders """ CmsRpcAction<List...
java
public void getSubFolders(final String folder, final AsyncCallback<List<CmsVfsEntryBean>> callback) { CmsRpcAction<List<CmsVfsEntryBean>> action = new CmsRpcAction<List<CmsVfsEntryBean>>() { @Override public void execute() { start(0, false); getGalleryS...
[ "public", "void", "getSubFolders", "(", "final", "String", "folder", ",", "final", "AsyncCallback", "<", "List", "<", "CmsVfsEntryBean", ">", ">", "callback", ")", "{", "CmsRpcAction", "<", "List", "<", "CmsVfsEntryBean", ">>", "action", "=", "new", "CmsRpcAct...
Retrieves the sub-folders of a given folder.<p> @param folder the folder whose sub-folders should be retrieved @param callback the callback for processing the sub-folders
[ "Retrieves", "the", "sub", "-", "folders", "of", "a", "given", "folder", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L770-L790
alkacon/opencms-core
src/org/opencms/jsp/CmsJspActionElement.java
CmsJspActionElement.getMessages
public CmsMessages getMessages(String bundleName, String language, String defaultLanguage) { """ Generates an initialized instance of {@link CmsMessages} for convenient access to localized resource bundles.<p> @param bundleName the name of the ResourceBundle to use @param language language identifier for the ...
java
public CmsMessages getMessages(String bundleName, String language, String defaultLanguage) { return getMessages(bundleName, language, "", "", defaultLanguage); }
[ "public", "CmsMessages", "getMessages", "(", "String", "bundleName", ",", "String", "language", ",", "String", "defaultLanguage", ")", "{", "return", "getMessages", "(", "bundleName", ",", "language", ",", "\"\"", ",", "\"\"", ",", "defaultLanguage", ")", ";", ...
Generates an initialized instance of {@link CmsMessages} for convenient access to localized resource bundles.<p> @param bundleName the name of the ResourceBundle to use @param language language identifier for the locale of the bundle @param defaultLanguage default for the language, will be used if language is null or ...
[ "Generates", "an", "initialized", "instance", "of", "{", "@link", "CmsMessages", "}", "for", "convenient", "access", "to", "localized", "resource", "bundles", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspActionElement.java#L301-L304
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/convert/MultipleFieldConverter.java
MultipleFieldConverter.setState
public int setState(boolean state, boolean bDisplayOption, int iMoveMode) { """ For binary fields, set the current state. @param state The state to set this field. @param bDisplayOption Display changed fields if true. @param iMoveMode The move mode. @return The error code (or NORMAL_RETURN). """ // M...
java
public int setState(boolean state, boolean bDisplayOption, int iMoveMode) { // Must be overidden m_bSetData = true; // Make sure getNextConverter is called correctly (if it is called). int iErrorCode = super.setState(state, bDisplayOption, iMoveMode); m_bSetData = false; retur...
[ "public", "int", "setState", "(", "boolean", "state", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "// Must be overidden", "m_bSetData", "=", "true", ";", "// Make sure getNextConverter is called correctly (if it is called).", "int", "iErrorCode", ...
For binary fields, set the current state. @param state The state to set this field. @param bDisplayOption Display changed fields if true. @param iMoveMode The move mode. @return The error code (or NORMAL_RETURN).
[ "For", "binary", "fields", "set", "the", "current", "state", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/MultipleFieldConverter.java#L143-L149
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/mapped/MappedRefresh.java
MappedRefresh.executeRefresh
public int executeRefresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { """ Execute our refresh query statement and then update all of the fields in data with the fields from the result. @return 1 if we found the object in the table by id or 0 if not. """ ...
java
public int executeRefresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { @SuppressWarnings("unchecked") ID id = (ID) idField.extractJavaFieldValue(data); // we don't care about the cache here T result = super.execute(databaseConnection, id, null); if (result =...
[ "public", "int", "executeRefresh", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "ID", "id", "=", "(", "ID", ")", "idF...
Execute our refresh query statement and then update all of the fields in data with the fields from the result. @return 1 if we found the object in the table by id or 0 if not.
[ "Execute", "our", "refresh", "query", "statement", "and", "then", "update", "all", "of", "the", "fields", "in", "data", "with", "the", "fields", "from", "the", "result", "." ]
train
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedRefresh.java#L29-L46
Alluxio/alluxio
integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java
SparkIntegrationChecker.run
private Status run(JavaSparkContext sc, PrintWriter reportWriter, AlluxioConfiguration conf) { """ Implements Spark with Alluxio integration checker. @param sc current JavaSparkContext @param reportWriter save user-facing messages to a generated file @return performIntegrationChecks results """ // Che...
java
private Status run(JavaSparkContext sc, PrintWriter reportWriter, AlluxioConfiguration conf) { // Check whether Spark driver can recognize Alluxio classes and filesystem Status driverStatus = CheckerUtils.performIntegrationChecks(); String driverAddress = sc.getConf().get("spark.driver.host"); switch (d...
[ "private", "Status", "run", "(", "JavaSparkContext", "sc", ",", "PrintWriter", "reportWriter", ",", "AlluxioConfiguration", "conf", ")", "{", "// Check whether Spark driver can recognize Alluxio classes and filesystem", "Status", "driverStatus", "=", "CheckerUtils", ".", "per...
Implements Spark with Alluxio integration checker. @param sc current JavaSparkContext @param reportWriter save user-facing messages to a generated file @return performIntegrationChecks results
[ "Implements", "Spark", "with", "Alluxio", "integration", "checker", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L77-L101
prestodb/presto
presto-spi/src/main/java/com/facebook/presto/spi/block/ArrayBlock.java
ArrayBlock.createArrayBlockInternal
static ArrayBlock createArrayBlockInternal(int arrayOffset, int positionCount, @Nullable boolean[] valueIsNull, int[] offsets, Block values) { """ Create an array block directly without per element validations. """ validateConstructorArguments(arrayOffset, positionCount, valueIsNull, offsets, values); ...
java
static ArrayBlock createArrayBlockInternal(int arrayOffset, int positionCount, @Nullable boolean[] valueIsNull, int[] offsets, Block values) { validateConstructorArguments(arrayOffset, positionCount, valueIsNull, offsets, values); return new ArrayBlock(arrayOffset, positionCount, valueIsNull, offset...
[ "static", "ArrayBlock", "createArrayBlockInternal", "(", "int", "arrayOffset", ",", "int", "positionCount", ",", "@", "Nullable", "boolean", "[", "]", "valueIsNull", ",", "int", "[", "]", "offsets", ",", "Block", "values", ")", "{", "validateConstructorArguments",...
Create an array block directly without per element validations.
[ "Create", "an", "array", "block", "directly", "without", "per", "element", "validations", "." ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/block/ArrayBlock.java#L65-L69
coursera/courier
typescript-lite/generator/src/main/java/org/coursera/courier/tslite/TSSyntax.java
TSSyntax.importString
private static String importString(String typeName, String moduleName) { """ Creates a valid typescript import string given a type name (e.g. "Fortune") and the module name, which is usually the pegasus object's namespace. @param typeName Name of the type to import (e.g. "Fortune") @param moduleName That same...
java
private static String importString(String typeName, String moduleName) { return new StringBuilder() .append("import { ") .append(typeName) .append(" } from \"./") .append(moduleName) .append(".") .append(typeName) .append("\";") .toString(); }
[ "private", "static", "String", "importString", "(", "String", "typeName", ",", "String", "moduleName", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "\"import { \"", ")", ".", "append", "(", "typeName", ")", ".", "append", "(", ...
Creates a valid typescript import string given a type name (e.g. "Fortune") and the module name, which is usually the pegasus object's namespace. @param typeName Name of the type to import (e.g. "Fortune") @param moduleName That same type's namespace (e.g. "org.example") @return A fully formed import statement. e.g: ...
[ "Creates", "a", "valid", "typescript", "import", "string", "given", "a", "type", "name", "(", "e", ".", "g", ".", "Fortune", ")", "and", "the", "module", "name", "which", "is", "usually", "the", "pegasus", "object", "s", "namespace", "." ]
train
https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/typescript-lite/generator/src/main/java/org/coursera/courier/tslite/TSSyntax.java#L182-L192
jbundle/jbundle
base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java
HBasePanel.printScreenFieldData
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions) { """ Output this screen using HTML. @exception DBException File exception. """ ((ScreenField)sField).printData(out, iPrintOptions); }
java
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions) { ((ScreenField)sField).printData(out, iPrintOptions); }
[ "public", "void", "printScreenFieldData", "(", "ScreenComponent", "sField", ",", "PrintWriter", "out", ",", "int", "iPrintOptions", ")", "{", "(", "(", "ScreenField", ")", "sField", ")", ".", "printData", "(", "out", ",", "iPrintOptions", ")", ";", "}" ]
Output this screen using HTML. @exception DBException File exception.
[ "Output", "this", "screen", "using", "HTML", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L515-L518
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java
ST_GeometryShadow.moveCoordinate
private static Coordinate moveCoordinate(Coordinate inputCoordinate, double[] shadowOffset) { """ Move the input coordinate according X and Y offset @param inputCoordinate @param shadowOffset @return """ return new Coordinate(inputCoordinate.x + shadowOffset[0], inputCoordinate.y + shadowOffset[1]...
java
private static Coordinate moveCoordinate(Coordinate inputCoordinate, double[] shadowOffset) { return new Coordinate(inputCoordinate.x + shadowOffset[0], inputCoordinate.y + shadowOffset[1], 0); }
[ "private", "static", "Coordinate", "moveCoordinate", "(", "Coordinate", "inputCoordinate", ",", "double", "[", "]", "shadowOffset", ")", "{", "return", "new", "Coordinate", "(", "inputCoordinate", ".", "x", "+", "shadowOffset", "[", "0", "]", ",", "inputCoordina...
Move the input coordinate according X and Y offset @param inputCoordinate @param shadowOffset @return
[ "Move", "the", "input", "coordinate", "according", "X", "and", "Y", "offset" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/earth/ST_GeometryShadow.java#L223-L225
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoRegularClusters.java
SquaresIntoRegularClusters.areMiddlePointsClose
boolean areMiddlePointsClose( Point2D_F64 p0 , Point2D_F64 p1 , Point2D_F64 p2 , Point2D_F64 p3 ) { """ Returns true if point p1 and p2 are close to the line defined by points p0 and p3. """ UtilLine2D_F64.convert(p0,p3,line); // (computed expected length of a square) * (fractional tolerance) double tol...
java
boolean areMiddlePointsClose( Point2D_F64 p0 , Point2D_F64 p1 , Point2D_F64 p2 , Point2D_F64 p3 ) { UtilLine2D_F64.convert(p0,p3,line); // (computed expected length of a square) * (fractional tolerance) double tol1 = p0.distance(p1)*distanceTol; // see if inner points are close to the line if(Distance2D_F64...
[ "boolean", "areMiddlePointsClose", "(", "Point2D_F64", "p0", ",", "Point2D_F64", "p1", ",", "Point2D_F64", "p2", ",", "Point2D_F64", "p3", ")", "{", "UtilLine2D_F64", ".", "convert", "(", "p0", ",", "p3", ",", "line", ")", ";", "// (computed expected length of a...
Returns true if point p1 and p2 are close to the line defined by points p0 and p3.
[ "Returns", "true", "if", "point", "p1", "and", "p2", "are", "close", "to", "the", "line", "defined", "by", "points", "p0", "and", "p3", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquaresIntoRegularClusters.java#L204-L230
minio/minio-java
api/src/main/java/io/minio/MinioClient.java
MinioClient.makeBucket
public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, RegionConflictException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalExc...
java
public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, RegionConflictException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalExc...
[ "public", "void", "makeBucket", "(", "String", "bucketName", ",", "String", "region", ")", "throws", "InvalidBucketNameException", ",", "RegionConflictException", ",", "NoSuchAlgorithmException", ",", "InsufficientDataException", ",", "IOException", ",", "InvalidKeyExceptio...
Creates a bucket with given region. </p><b>Example:</b><br> <pre>{@code minioClient.makeBucket("my-bucketname"); System.out.println("my-bucketname is created successfully"); }</pre> @param bucketName Bucket name. @param region region in which the bucket will be created. @throws InvalidBucketNameException upon i...
[ "Creates", "a", "bucket", "with", "given", "region", "." ]
train
https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L3349-L3374
jbundle/jbundle
base/model/src/main/java/org/jbundle/base/model/Utility.java
Utility.replaceResources
public static String replaceResources(String string, ResourceBundle reg, Map<String, Object> map, PropertyOwner propertyOwner, boolean systemProperties) { """ Replace the {} resources in this string. @param reg @param map A map of key/values @param strResource @return """ if (string != null) ...
java
public static String replaceResources(String string, ResourceBundle reg, Map<String, Object> map, PropertyOwner propertyOwner, boolean systemProperties) { if (string != null) if (string.indexOf('{') == -1) return string; return Utility.replaceResources(new StringBuilder(s...
[ "public", "static", "String", "replaceResources", "(", "String", "string", ",", "ResourceBundle", "reg", ",", "Map", "<", "String", ",", "Object", ">", "map", ",", "PropertyOwner", "propertyOwner", ",", "boolean", "systemProperties", ")", "{", "if", "(", "stri...
Replace the {} resources in this string. @param reg @param map A map of key/values @param strResource @return
[ "Replace", "the", "{}", "resources", "in", "this", "string", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/model/src/main/java/org/jbundle/base/model/Utility.java#L302-L308
apache/incubator-druid
core/src/main/java/org/apache/druid/concurrent/Threads.java
Threads.sleepFor
public static void sleepFor(long sleepTime, TimeUnit unit) throws InterruptedException { """ Equivalent of {@link Thread#sleep(long)} with arguments and semantics of timed wait methods in classes from {@link java.util.concurrent} (like {@link java.util.concurrent.Semaphore#tryAcquire(long, TimeUnit)}, {@link jav...
java
public static void sleepFor(long sleepTime, TimeUnit unit) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } if (sleepTime <= 0) { return; } long sleepTimeLimitNanos = System.nanoTime() + unit.toNanos(sleepTime); while (true) { long...
[ "public", "static", "void", "sleepFor", "(", "long", "sleepTime", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", "{", "if", "(", "Thread", ".", "interrupted", "(", ")", ")", "{", "throw", "new", "InterruptedException", "(", ")", ";", "}", ...
Equivalent of {@link Thread#sleep(long)} with arguments and semantics of timed wait methods in classes from {@link java.util.concurrent} (like {@link java.util.concurrent.Semaphore#tryAcquire(long, TimeUnit)}, {@link java.util.concurrent.locks.Lock#tryLock(long, TimeUnit)}, etc.): if the sleepTime argument is negative ...
[ "Equivalent", "of", "{", "@link", "Thread#sleep", "(", "long", ")", "}", "with", "arguments", "and", "semantics", "of", "timed", "wait", "methods", "in", "classes", "from", "{", "@link", "java", ".", "util", ".", "concurrent", "}", "(", "like", "{", "@li...
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/concurrent/Threads.java#L37-L56
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java
CPDefinitionLinkPersistenceImpl.removeByUuid_C
@Override public void removeByUuid_C(String uuid, long companyId) { """ Removes all the cp definition links where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID """ for (CPDefinitionLink cpDefinitionLink : findByUuid_C(uuid, companyId, Quer...
java
@Override public void removeByUuid_C(String uuid, long companyId) { for (CPDefinitionLink cpDefinitionLink : findByUuid_C(uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpDefinitionLink); } }
[ "@", "Override", "public", "void", "removeByUuid_C", "(", "String", "uuid", ",", "long", "companyId", ")", "{", "for", "(", "CPDefinitionLink", "cpDefinitionLink", ":", "findByUuid_C", "(", "uuid", ",", "companyId", ",", "QueryUtil", ".", "ALL_POS", ",", "Quer...
Removes all the cp definition links where uuid = &#63; and companyId = &#63; from the database. @param uuid the uuid @param companyId the company ID
[ "Removes", "all", "the", "cp", "definition", "links", "where", "uuid", "=", "&#63", ";", "and", "companyId", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L1403-L1409
js-lib-com/commons
src/main/java/js/util/Files.java
Files.createBufferedReader
public static BufferedReader createBufferedReader(InputStream stream) { """ Create buffered reader from bytes stream using UTF-8 charset. This library always uses UTF-8 encoding and this method does not rely on JVM default since there is no standard way to enforce it. JRE specification states that <code>file.enc...
java
public static BufferedReader createBufferedReader(InputStream stream) { try { return new BufferedReader(new InputStreamReader(stream, "UTF-8")); } catch(UnsupportedEncodingException unused) { throw new BugError("Unsupported UTF-8 ecoding."); } }
[ "public", "static", "BufferedReader", "createBufferedReader", "(", "InputStream", "stream", ")", "{", "try", "{", "return", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "stream", ",", "\"UTF-8\"", ")", ")", ";", "}", "catch", "(", "UnsupportedE...
Create buffered reader from bytes stream using UTF-8 charset. This library always uses UTF-8 encoding and this method does not rely on JVM default since there is no standard way to enforce it. JRE specification states that <code>file.encoding</code> is not the standard way to set default charset and to use host setting...
[ "Create", "buffered", "reader", "from", "bytes", "stream", "using", "UTF", "-", "8", "charset", ".", "This", "library", "always", "uses", "UTF", "-", "8", "encoding", "and", "this", "method", "does", "not", "rely", "on", "JVM", "default", "since", "there",...
train
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L84-L92
soi-toolkit/soi-toolkit-mule
tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java
ModelFactory.setModelClass
@SuppressWarnings("unchecked") public static void setModelClass(Class<?> modelClass) throws IllegalArgumentException { """ Register a custom model class, must be a subclass to DefaultModelImpl. @param modelClass @throws IllegalArgumentException if supplied class is not a subclass of DefaultModelImpl """ ...
java
@SuppressWarnings("unchecked") public static void setModelClass(Class<?> modelClass) throws IllegalArgumentException { if (!DefaultModelImpl.class.isAssignableFrom(modelClass)) { throw new IllegalArgumentException("Modelclass, " + modelClass.getName() + ", is not a subtype of " + DefaultModelImpl.class.getN...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "void", "setModelClass", "(", "Class", "<", "?", ">", "modelClass", ")", "throws", "IllegalArgumentException", "{", "if", "(", "!", "DefaultModelImpl", ".", "class", ".", "isAssignableFrom", ...
Register a custom model class, must be a subclass to DefaultModelImpl. @param modelClass @throws IllegalArgumentException if supplied class is not a subclass of DefaultModelImpl
[ "Register", "a", "custom", "model", "class", "must", "be", "a", "subclass", "to", "DefaultModelImpl", "." ]
train
https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java#L49-L55
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java
SVGPath.lineTo
public SVGPath lineTo(double x, double y) { """ Draw a line to the given coordinates. @param x new coordinates @param y new coordinates @return path object, for compact syntax. """ return append(PATH_LINE_TO).append(x).append(y); }
java
public SVGPath lineTo(double x, double y) { return append(PATH_LINE_TO).append(x).append(y); }
[ "public", "SVGPath", "lineTo", "(", "double", "x", ",", "double", "y", ")", "{", "return", "append", "(", "PATH_LINE_TO", ")", ".", "append", "(", "x", ")", ".", "append", "(", "y", ")", ";", "}" ]
Draw a line to the given coordinates. @param x new coordinates @param y new coordinates @return path object, for compact syntax.
[ "Draw", "a", "line", "to", "the", "given", "coordinates", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L229-L231
spotify/crtauth-java
src/main/java/com/spotify/crtauth/CrtAuthServer.java
CrtAuthServer.createChallenge
public String createChallenge(String request) throws IllegalArgumentException, ProtocolVersionException { """ Create a challenge to authenticate a given user. The userName needs to be provided at this stage to encode a fingerprint of the public key stored in the server encoded in the challenge. This is req...
java
public String createChallenge(String request) throws IllegalArgumentException, ProtocolVersionException { String userName; userName = CrtAuthCodec.deserializeRequest(request); Fingerprint fingerprint; try { fingerprint = new Fingerprint(getKeyForUser(userName)); } catch (KeyNotFoundExc...
[ "public", "String", "createChallenge", "(", "String", "request", ")", "throws", "IllegalArgumentException", ",", "ProtocolVersionException", "{", "String", "userName", ";", "userName", "=", "CrtAuthCodec", ".", "deserializeRequest", "(", "request", ")", ";", "Fingerpr...
Create a challenge to authenticate a given user. The userName needs to be provided at this stage to encode a fingerprint of the public key stored in the server encoded in the challenge. This is required because a client can hold more than one private key and would need this information to pick the right key to sign the...
[ "Create", "a", "challenge", "to", "authenticate", "a", "given", "user", ".", "The", "userName", "needs", "to", "be", "provided", "at", "this", "stage", "to", "encode", "a", "fingerprint", "of", "the", "public", "key", "stored", "in", "the", "server", "enco...
train
https://github.com/spotify/crtauth-java/blob/90f3b40323848740c915b195ad1b547fbeb41700/src/main/java/com/spotify/crtauth/CrtAuthServer.java#L187-L214
datacleaner/DataCleaner
desktop/api/src/main/java/org/datacleaner/util/WidgetUtils.java
WidgetUtils.addToGridBag
public static void addToGridBag(final Component comp, final JPanel panel, final int gridx, final int gridy) { """ Adds a component to a panel with a grid bag layout @param comp @param panel @param gridx @param gridy """ addToGridBag(comp, panel, gridx, gridy, 1, 1); }
java
public static void addToGridBag(final Component comp, final JPanel panel, final int gridx, final int gridy) { addToGridBag(comp, panel, gridx, gridy, 1, 1); }
[ "public", "static", "void", "addToGridBag", "(", "final", "Component", "comp", ",", "final", "JPanel", "panel", ",", "final", "int", "gridx", ",", "final", "int", "gridy", ")", "{", "addToGridBag", "(", "comp", ",", "panel", ",", "gridx", ",", "gridy", "...
Adds a component to a panel with a grid bag layout @param comp @param panel @param gridx @param gridy
[ "Adds", "a", "component", "to", "a", "panel", "with", "a", "grid", "bag", "layout" ]
train
https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/api/src/main/java/org/datacleaner/util/WidgetUtils.java#L404-L406
contentful/contentful-management.java
src/main/java/com/contentful/java/cma/ModuleApiKeys.java
ModuleApiKeys.fetchOne
public CMAApiKey fetchOne(String spaceId, String keyId) { """ Fetch only one delivery api key. <p> This method will override the configuration specified through {@link CMAClient.Builder#setSpaceId(String)} and will ignore {@link CMAClient.Builder#setEnvironmentId(String)}. @param spaceId the id of the space...
java
public CMAApiKey fetchOne(String spaceId, String keyId) { assertNotNull(spaceId, "entry"); assertNotNull(keyId, "keyId"); return service.fetchOne(spaceId, keyId).blockingFirst(); }
[ "public", "CMAApiKey", "fetchOne", "(", "String", "spaceId", ",", "String", "keyId", ")", "{", "assertNotNull", "(", "spaceId", ",", "\"entry\"", ")", ";", "assertNotNull", "(", "keyId", ",", "\"keyId\"", ")", ";", "return", "service", ".", "fetchOne", "(", ...
Fetch only one delivery api key. <p> This method will override the configuration specified through {@link CMAClient.Builder#setSpaceId(String)} and will ignore {@link CMAClient.Builder#setEnvironmentId(String)}. @param spaceId the id of the space this is valid on. @param keyId the id of the key itself. @return one d...
[ "Fetch", "only", "one", "delivery", "api", "key", ".", "<p", ">", "This", "method", "will", "override", "the", "configuration", "specified", "through", "{", "@link", "CMAClient", ".", "Builder#setSpaceId", "(", "String", ")", "}", "and", "will", "ignore", "{...
train
https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleApiKeys.java#L155-L160
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java
XHTMLText.appendOpenAnchorTag
public XHTMLText appendOpenAnchorTag(String href, String style) { """ Appends a tag that indicates that an anchor section begins. @param href indicates the URL being linked to @param style the XHTML style of the anchor @return this. """ text.halfOpenElement(A); text.optAttribute(HREF, href...
java
public XHTMLText appendOpenAnchorTag(String href, String style) { text.halfOpenElement(A); text.optAttribute(HREF, href); text.optAttribute(STYLE, style); text.rightAngleBracket(); return this; }
[ "public", "XHTMLText", "appendOpenAnchorTag", "(", "String", "href", ",", "String", "style", ")", "{", "text", ".", "halfOpenElement", "(", "A", ")", ";", "text", ".", "optAttribute", "(", "HREF", ",", "href", ")", ";", "text", ".", "optAttribute", "(", ...
Appends a tag that indicates that an anchor section begins. @param href indicates the URL being linked to @param style the XHTML style of the anchor @return this.
[ "Appends", "a", "tag", "that", "indicates", "that", "an", "anchor", "section", "begins", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java#L56-L62
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java
TransliteratorParser.appendVariableDef
private void appendVariableDef(String name, StringBuffer buf) { """ Append the value of the given variable name to the given StringBuffer. @exception IllegalIcuArgumentException if the name is unknown. """ char[] ch = variableNames.get(name); if (ch == null) { // We allow one unde...
java
private void appendVariableDef(String name, StringBuffer buf) { char[] ch = variableNames.get(name); if (ch == null) { // We allow one undefined variable so that variable definition // statements work. For the first undefined variable we return // the special placeho...
[ "private", "void", "appendVariableDef", "(", "String", "name", ",", "StringBuffer", "buf", ")", "{", "char", "[", "]", "ch", "=", "variableNames", ".", "get", "(", "name", ")", ";", "if", "(", "ch", "==", "null", ")", "{", "// We allow one undefined variab...
Append the value of the given variable name to the given StringBuffer. @exception IllegalIcuArgumentException if the name is unknown.
[ "Append", "the", "value", "of", "the", "given", "variable", "name", "to", "the", "given", "StringBuffer", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorParser.java#L1542-L1562
jbundle/jbundle
thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java
Application.setLanguage
public void setLanguage(String language) { """ Set the current language. Change the current resource bundle to the new language. <p>In your overriding code you might convert the actual language names to the two letter code: <code> if (language != null) if (language.length() > 2) if (language.indexOf('_') == -1...
java
public void setLanguage(String language) { Locale currentLocale = null; if (language == null) language = this.getProperty(Params.LANGUAGE); if (language != null) { currentLocale = new Locale(language, Constants.BLANK); m_resources = null; }...
[ "public", "void", "setLanguage", "(", "String", "language", ")", "{", "Locale", "currentLocale", "=", "null", ";", "if", "(", "language", "==", "null", ")", "language", "=", "this", ".", "getProperty", "(", "Params", ".", "LANGUAGE", ")", ";", "if", "(",...
Set the current language. Change the current resource bundle to the new language. <p>In your overriding code you might convert the actual language names to the two letter code: <code> if (language != null) if (language.length() > 2) if (language.indexOf('_') == -1) language = this.findLocaleFromLanguage(language); </co...
[ "Set", "the", "current", "language", ".", "Change", "the", "current", "resource", "bundle", "to", "the", "new", "language", ".", "<p", ">", "In", "your", "overriding", "code", "you", "might", "convert", "the", "actual", "language", "names", "to", "the", "t...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java#L816-L834
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/rule/jaxb/loader/RuleDefinitionFileConstant.java
RuleDefinitionFileConstant.getFillerRuleDefinitionFileName
public static String getFillerRuleDefinitionFileName(final String rootDir, final DatabaseType databaseType) { """ Get extractor rule definition file name. @param rootDir root dir @param databaseType database type @return extractor rule definition file name """ return Joiner.on('/').join(rootDir, d...
java
public static String getFillerRuleDefinitionFileName(final String rootDir, final DatabaseType databaseType) { return Joiner.on('/').join(rootDir, databaseType.name().toLowerCase(), FILLER_DEFINITION_FILE_NAME); }
[ "public", "static", "String", "getFillerRuleDefinitionFileName", "(", "final", "String", "rootDir", ",", "final", "DatabaseType", "databaseType", ")", "{", "return", "Joiner", ".", "on", "(", "'", "'", ")", ".", "join", "(", "rootDir", ",", "databaseType", "."...
Get extractor rule definition file name. @param rootDir root dir @param databaseType database type @return extractor rule definition file name
[ "Get", "extractor", "rule", "definition", "file", "name", "." ]
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/antlr/rule/jaxb/loader/RuleDefinitionFileConstant.java#L76-L78
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java
ExceptionFactory.apiVersionAlreadyExistsException
public static final ApiVersionAlreadyExistsException apiVersionAlreadyExistsException(String apiName, String version) { """ Creates an exception from an API name. @param apiName the API name @param version the version @return the exception """ return new ApiVersionAlreadyExistsException(Messages.i18...
java
public static final ApiVersionAlreadyExistsException apiVersionAlreadyExistsException(String apiName, String version) { return new ApiVersionAlreadyExistsException(Messages.i18n.format("ApiVersionAlreadyExists", apiName, version)); //$NON-NLS-1$ }
[ "public", "static", "final", "ApiVersionAlreadyExistsException", "apiVersionAlreadyExistsException", "(", "String", "apiName", ",", "String", "version", ")", "{", "return", "new", "ApiVersionAlreadyExistsException", "(", "Messages", ".", "i18n", ".", "format", "(", "\"A...
Creates an exception from an API name. @param apiName the API name @param version the version @return the exception
[ "Creates", "an", "exception", "from", "an", "API", "name", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L210-L212
raydac/java-comment-preprocessor
jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java
Assertions.fail
@Nonnull public static Error fail(@Nullable final String message) { """ Throw assertion error for some cause @param message description of the cause. @return generated error, but it throws AssertionError before return so that the value just for IDE. @throws AssertionError will be thrown @since 1.0 """ ...
java
@Nonnull public static Error fail(@Nullable final String message) { final AssertionError error = new AssertionError(GetUtils.ensureNonNull(message, "failed")); MetaErrorListeners.fireError("Asserion error", error); if (true) { throw error; } return error; }
[ "@", "Nonnull", "public", "static", "Error", "fail", "(", "@", "Nullable", "final", "String", "message", ")", "{", "final", "AssertionError", "error", "=", "new", "AssertionError", "(", "GetUtils", ".", "ensureNonNull", "(", "message", ",", "\"failed\"", ")", ...
Throw assertion error for some cause @param message description of the cause. @return generated error, but it throws AssertionError before return so that the value just for IDE. @throws AssertionError will be thrown @since 1.0
[ "Throw", "assertion", "error", "for", "some", "cause" ]
train
https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java#L56-L64
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.roundDown
public static BigDecimal roundDown(BigDecimal value, int scale) { """ 保留固定小数位数,舍去多余位数 @param value 需要科学计算的数据 @param scale 保留的小数位 @return 结果 @since 4.1.0 """ return round(value, scale, RoundingMode.DOWN); }
java
public static BigDecimal roundDown(BigDecimal value, int scale) { return round(value, scale, RoundingMode.DOWN); }
[ "public", "static", "BigDecimal", "roundDown", "(", "BigDecimal", "value", ",", "int", "scale", ")", "{", "return", "round", "(", "value", ",", "scale", ",", "RoundingMode", ".", "DOWN", ")", ";", "}" ]
保留固定小数位数,舍去多余位数 @param value 需要科学计算的数据 @param scale 保留的小数位 @return 结果 @since 4.1.0
[ "保留固定小数位数,舍去多余位数" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L969-L971
Tourenathan-G5organisation/SiliCompressor
silicompressor/src/main/java/com/iceteck/silicompressorr/FileUtils.java
FileUtils.getThumbnail
public static Bitmap getThumbnail(Context context, File file) { """ Attempt to retrieve the thumbnail of given File from the MediaStore. This should not be called on the UI thread. @param context @param file @return @author paulburke """ return getThumbnail(context, getUri(context, file), getMim...
java
public static Bitmap getThumbnail(Context context, File file) { return getThumbnail(context, getUri(context, file), getMimeType(file)); }
[ "public", "static", "Bitmap", "getThumbnail", "(", "Context", "context", ",", "File", "file", ")", "{", "return", "getThumbnail", "(", "context", ",", "getUri", "(", "context", ",", "file", ")", ",", "getMimeType", "(", "file", ")", ")", ";", "}" ]
Attempt to retrieve the thumbnail of given File from the MediaStore. This should not be called on the UI thread. @param context @param file @return @author paulburke
[ "Attempt", "to", "retrieve", "the", "thumbnail", "of", "given", "File", "from", "the", "MediaStore", ".", "This", "should", "not", "be", "called", "on", "the", "UI", "thread", "." ]
train
https://github.com/Tourenathan-G5organisation/SiliCompressor/blob/546f6cd7b2a7a783e1122df46c1e237f8938fe72/silicompressor/src/main/java/com/iceteck/silicompressorr/FileUtils.java#L392-L394
banq/jdonframework
src/main/java/com/jdon/bussinessproxy/dyncproxy/cglib/CGLIBDynamicProxyWeaving.java
CGLIBDynamicProxyWeaving.invoke
public Object invoke(Object p_proxy, Method m, Object[] args) throws Throwable { """ 方法调用 需要拦截方法在这里实现。目前实现arround intercept @param p_proxy Object @param m Method @param args Object[] @throws Throwable @return Object """ Debug.logVerbose("<################################>Action: JdonFramework core...
java
public Object invoke(Object p_proxy, Method m, Object[] args) throws Throwable { Debug.logVerbose("<################################>Action: JdonFramework core entrance", module); Debug.logVerbose("[JdonFramework]<################>execute method=" + m.getDeclaringClass().getName() + "." + m.getName(), module); ...
[ "public", "Object", "invoke", "(", "Object", "p_proxy", ",", "Method", "m", ",", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "Debug", ".", "logVerbose", "(", "\"<################################>Action: JdonFramework core entrance\"", ",", "module", ...
方法调用 需要拦截方法在这里实现。目前实现arround intercept @param p_proxy Object @param m Method @param args Object[] @throws Throwable @return Object
[ "方法调用", "需要拦截方法在这里实现。目前实现arround", "intercept" ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/bussinessproxy/dyncproxy/cglib/CGLIBDynamicProxyWeaving.java#L93-L110
openbase/jul
visual/javafx/src/main/java/org/openbase/jul/visual/javafx/execution/JFXTaskExecutor.java
JFXTaskExecutor.executeTask
private <V> Future<V> executeTask(final Callable<V> callable, final TargetThread targetThread, final Logger logger) { """ Method forces the task execution on the gui/nongui thread. @param <V> the type of the future @param callable the task @param targetThread the target thread where the task will be executed in...
java
private <V> Future<V> executeTask(final Callable<V> callable, final TargetThread targetThread, final Logger logger) { try { switch (targetThread) { // force execution on gui thread case GUI_THREAD: if (Platform.isFxApplicationThread()) { ...
[ "private", "<", "V", ">", "Future", "<", "V", ">", "executeTask", "(", "final", "Callable", "<", "V", ">", "callable", ",", "final", "TargetThread", "targetThread", ",", "final", "Logger", "logger", ")", "{", "try", "{", "switch", "(", "targetThread", ")...
Method forces the task execution on the gui/nongui thread. @param <V> the type of the future @param callable the task @param targetThread the target thread where the task will be executed independent of the current thread which has called this method. @param logger the logger to print logging in error case. @return a f...
[ "Method", "forces", "the", "task", "execution", "on", "the", "gui", "/", "nongui", "thread", "." ]
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/execution/JFXTaskExecutor.java#L55-L89
mozilla/rhino
src/org/mozilla/javascript/ScriptRuntime.java
ScriptRuntime.typeErrorThrower
public static BaseFunction typeErrorThrower(Context cx) { """ Returns representation of the [[ThrowTypeError]] object. See ECMA 5 spec, 13.2.3 """ if (cx.typeErrorThrower == null) { BaseFunction thrower = new BaseFunction() { private static final long serialVersionUID = -589174096215...
java
public static BaseFunction typeErrorThrower(Context cx) { if (cx.typeErrorThrower == null) { BaseFunction thrower = new BaseFunction() { private static final long serialVersionUID = -5891740962154902286L; @Override public Object call(Context cx, Scriptable scope, Scriptabl...
[ "public", "static", "BaseFunction", "typeErrorThrower", "(", "Context", "cx", ")", "{", "if", "(", "cx", ".", "typeErrorThrower", "==", "null", ")", "{", "BaseFunction", "thrower", "=", "new", "BaseFunction", "(", ")", "{", "private", "static", "final", "lon...
Returns representation of the [[ThrowTypeError]] object. See ECMA 5 spec, 13.2.3
[ "Returns", "representation", "of", "the", "[[", "ThrowTypeError", "]]", "object", ".", "See", "ECMA", "5", "spec", "13", ".", "2", ".", "3" ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L51-L70
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java
HivePurgerSource.sortHiveDatasets
protected List<HivePartitionDataset> sortHiveDatasets(List<HivePartitionDataset> datasets) { """ Sort all HiveDatasets on the basis of complete name ie dbName.tableName """ Collections.sort(datasets, new Comparator<HivePartitionDataset>() { @Override public int compare(HivePartitionDataset o1, ...
java
protected List<HivePartitionDataset> sortHiveDatasets(List<HivePartitionDataset> datasets) { Collections.sort(datasets, new Comparator<HivePartitionDataset>() { @Override public int compare(HivePartitionDataset o1, HivePartitionDataset o2) { return o1.datasetURN().compareTo(o2.datasetURN()); ...
[ "protected", "List", "<", "HivePartitionDataset", ">", "sortHiveDatasets", "(", "List", "<", "HivePartitionDataset", ">", "datasets", ")", "{", "Collections", ".", "sort", "(", "datasets", ",", "new", "Comparator", "<", "HivePartitionDataset", ">", "(", ")", "{"...
Sort all HiveDatasets on the basis of complete name ie dbName.tableName
[ "Sort", "all", "HiveDatasets", "on", "the", "basis", "of", "complete", "name", "ie", "dbName", ".", "tableName" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerSource.java#L220-L228
landawn/AbacusUtil
src/com/landawn/abacus/util/Primitives.java
Primitives.box
@SafeVarargs public static Long[] box(final long... a) { """ <p> Converts an array of primitive longs to objects. </p> <p> This method returns {@code null} for a {@code null} input array. </p> @param a a {@code long} array @return a {@code Long} array, {@code null} if null array input """ ...
java
@SafeVarargs public static Long[] box(final long... a) { if (a == null) { return null; } return box(a, 0, a.length); }
[ "@", "SafeVarargs", "public", "static", "Long", "[", "]", "box", "(", "final", "long", "...", "a", ")", "{", "if", "(", "a", "==", "null", ")", "{", "return", "null", ";", "}", "return", "box", "(", "a", ",", "0", ",", "a", ".", "length", ")", ...
<p> Converts an array of primitive longs to objects. </p> <p> This method returns {@code null} for a {@code null} input array. </p> @param a a {@code long} array @return a {@code Long} array, {@code null} if null array input
[ "<p", ">", "Converts", "an", "array", "of", "primitive", "longs", "to", "objects", ".", "<", "/", "p", ">" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L313-L320
Azure/azure-sdk-for-java
sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java
FailoverGroupsInner.createOrUpdateAsync
public Observable<FailoverGroupInner> createOrUpdateAsync(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupInner parameters) { """ Creates or updates a failover group. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value...
java
public Observable<FailoverGroupInner> createOrUpdateAsync(String resourceGroupName, String serverName, String failoverGroupName, FailoverGroupInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName, parameters).map(new Func1<ServiceResponse<FailoverGrou...
[ "public", "Observable", "<", "FailoverGroupInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "failoverGroupName", ",", "FailoverGroupInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceRespons...
Creates or updates a failover group. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server containing the failover group. @param failoverGroupName The name of the failover...
[ "Creates", "or", "updates", "a", "failover", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L255-L262
landawn/AbacusUtil
src/com/landawn/abacus/util/Multimap.java
Multimap.merge
public <X extends Exception> V merge(K key, E e, Try.BiFunction<? super V, ? super E, ? extends V, X> remappingFunction) throws X { """ The implementation is equivalent to performing the following steps for this Multimap: <pre> final V oldValue = get(key); if (N.isNullOrEmpty(oldValue)) { put(key, e); ret...
java
public <X extends Exception> V merge(K key, E e, Try.BiFunction<? super V, ? super E, ? extends V, X> remappingFunction) throws X { N.checkArgNotNull(remappingFunction); N.checkArgNotNull(e); final V oldValue = get(key); if (N.isNullOrEmpty(oldValue)) { put(key, e); ...
[ "public", "<", "X", "extends", "Exception", ">", "V", "merge", "(", "K", "key", ",", "E", "e", ",", "Try", ".", "BiFunction", "<", "?", "super", "V", ",", "?", "super", "E", ",", "?", "extends", "V", ",", "X", ">", "remappingFunction", ")", "thro...
The implementation is equivalent to performing the following steps for this Multimap: <pre> final V oldValue = get(key); if (N.isNullOrEmpty(oldValue)) { put(key, e); return get(key); } final V newValue = remappingFunction.apply(oldValue, e); if (N.notNullOrEmpty(newValue)) { valueMap.put(key, newValue); } else { i...
[ "The", "implementation", "is", "equivalent", "to", "performing", "the", "following", "steps", "for", "this", "Multimap", ":" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Multimap.java#L1264-L1286
datumbox/lpsolve
src/main/java/lpsolve/LpSolve.java
LpSolve.putBbBranchfunc
public void putBbBranchfunc(BbListener listener, Object userhandle) throws LpSolveException { """ Register an <code>BbBranchListener</code> for callback. @param listener the listener that should be called by lp_solve @param userhandle an arbitrary object that is passed to the listener on call """ bbBran...
java
public void putBbBranchfunc(BbListener listener, Object userhandle) throws LpSolveException { bbBranchListener = listener; bbBranchUserhandle = (listener != null) ? userhandle : null; addLp(this); registerBbBranchfunc(); }
[ "public", "void", "putBbBranchfunc", "(", "BbListener", "listener", ",", "Object", "userhandle", ")", "throws", "LpSolveException", "{", "bbBranchListener", "=", "listener", ";", "bbBranchUserhandle", "=", "(", "listener", "!=", "null", ")", "?", "userhandle", ":"...
Register an <code>BbBranchListener</code> for callback. @param listener the listener that should be called by lp_solve @param userhandle an arbitrary object that is passed to the listener on call
[ "Register", "an", "<code", ">", "BbBranchListener<", "/", "code", ">", "for", "callback", "." ]
train
https://github.com/datumbox/lpsolve/blob/201b3e99153d907bb99c189e5647bc71a3a1add6/src/main/java/lpsolve/LpSolve.java#L1649-L1654
EdwardRaff/JSAT
JSAT/src/jsat/distributions/kernels/PukKernel.java
PukKernel.setSigma
public void setSigma(double sigma) { """ Sets the sigma parameter value, which controls the width of the kernel @param sigma the positive parameter value """ if(sigma <= 0 || Double.isNaN(sigma) || Double.isInfinite(sigma)) throw new ArithmeticException("sigma must be positive, not " + sig...
java
public void setSigma(double sigma) { if(sigma <= 0 || Double.isNaN(sigma) || Double.isInfinite(sigma)) throw new ArithmeticException("sigma must be positive, not " + sigma); this.sigma = sigma; }
[ "public", "void", "setSigma", "(", "double", "sigma", ")", "{", "if", "(", "sigma", "<=", "0", "||", "Double", ".", "isNaN", "(", "sigma", ")", "||", "Double", ".", "isInfinite", "(", "sigma", ")", ")", "throw", "new", "ArithmeticException", "(", "\"si...
Sets the sigma parameter value, which controls the width of the kernel @param sigma the positive parameter value
[ "Sets", "the", "sigma", "parameter", "value", "which", "controls", "the", "width", "of", "the", "kernel" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/PukKernel.java#L64-L69
GerdHolz/TOVAL
src/de/invation/code/toval/graphic/diagrams/panels/TickInfo.java
TickInfo.setTickSpacing
public void setTickSpacing(double minorTickSpacing, int multiplicator) { """ Sets the tick spacing.<br> <code>minorTickSpacing</code> sets the minor tick spacing, major tick spacing is a multiple of minor tick spacing and determined with the help of <code>multiplicator</code> @param minorTickSpacing Minor tick ...
java
public void setTickSpacing(double minorTickSpacing, int multiplicator) { if(Double.isInfinite(minorTickSpacing) || Double.isNaN(minorTickSpacing)) throw new NumberFormatException("Infinite or NaN"); if(multiplicator <= 0) throw new IllegalArgumentException("Multiplicator negative or 0"); this.mino...
[ "public", "void", "setTickSpacing", "(", "double", "minorTickSpacing", ",", "int", "multiplicator", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "minorTickSpacing", ")", "||", "Double", ".", "isNaN", "(", "minorTickSpacing", ")", ")", "throw", "new",...
Sets the tick spacing.<br> <code>minorTickSpacing</code> sets the minor tick spacing, major tick spacing is a multiple of minor tick spacing and determined with the help of <code>multiplicator</code> @param minorTickSpacing Minor tick spacing @param multiplicator Multiplicator for detrermining the major tick spacing.
[ "Sets", "the", "tick", "spacing", ".", "<br", ">", "<code", ">", "minorTickSpacing<", "/", "code", ">", "sets", "the", "minor", "tick", "spacing", "major", "tick", "spacing", "is", "a", "multiple", "of", "minor", "tick", "spacing", "and", "determined", "wi...
train
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/panels/TickInfo.java#L219-L228
spring-projects/spring-android
spring-android-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java
ConvertingComparator.mapEntryValues
public static <K, V> ConvertingComparator<Map.Entry<K, V>, V> mapEntryValues( Comparator<V> comparator) { """ Create a new {@link ConvertingComparator} that compares {@link java.util.Map.Entry map entries} based on their {@link java.util.Map.Entry#getValue() values}. @param comparator the underlying compara...
java
public static <K, V> ConvertingComparator<Map.Entry<K, V>, V> mapEntryValues( Comparator<V> comparator) { return new ConvertingComparator<Map.Entry<K,V>, V>(comparator, new Converter<Map.Entry<K, V>, V>() { public V convert(Map.Entry<K, V> source) { return source.getValue(); } }); }
[ "public", "static", "<", "K", ",", "V", ">", "ConvertingComparator", "<", "Map", ".", "Entry", "<", "K", ",", "V", ">", ",", "V", ">", "mapEntryValues", "(", "Comparator", "<", "V", ">", "comparator", ")", "{", "return", "new", "ConvertingComparator", ...
Create a new {@link ConvertingComparator} that compares {@link java.util.Map.Entry map entries} based on their {@link java.util.Map.Entry#getValue() values}. @param comparator the underlying comparator used to compare values @return a new {@link ConvertingComparator} instance
[ "Create", "a", "new", "{", "@link", "ConvertingComparator", "}", "that", "compares", "{", "@link", "java", ".", "util", ".", "Map", ".", "Entry", "map", "entries", "}", "based", "on", "their", "{", "@link", "java", ".", "util", ".", "Map", ".", "Entry#...
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java#L110-L118
apache/incubator-shardingsphere
sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/OptimizeEngineFactory.java
OptimizeEngineFactory.newInstance
public static OptimizeEngine newInstance(final ShardingRule shardingRule, final SQLStatement sqlStatement, final List<Object> parameters, final GeneratedKey generatedKey) { """ Create optimize engine instance. @param shardingRule sharding rule @param sqlStatement SQL statement @param parameters parameters @p...
java
public static OptimizeEngine newInstance(final ShardingRule shardingRule, final SQLStatement sqlStatement, final List<Object> parameters, final GeneratedKey generatedKey) { if (sqlStatement instanceof InsertStatement) { return new InsertOptimizeEngine(shardingRule, (InsertStatement) sqlStatement, pa...
[ "public", "static", "OptimizeEngine", "newInstance", "(", "final", "ShardingRule", "shardingRule", ",", "final", "SQLStatement", "sqlStatement", ",", "final", "List", "<", "Object", ">", "parameters", ",", "final", "GeneratedKey", "generatedKey", ")", "{", "if", "...
Create optimize engine instance. @param shardingRule sharding rule @param sqlStatement SQL statement @param parameters parameters @param generatedKey generated key @return optimize engine instance
[ "Create", "optimize", "engine", "instance", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/OptimizeEngineFactory.java#L55-L64
UrielCh/ovh-java-sdk
ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java
ApiOvhIp.ip_license_plesk_GET
public ArrayList<String> ip_license_plesk_GET(String ip, String ipAddress) throws IOException { """ Plesk licenses associated to this IP REST: GET /ip/{ip}/license/plesk @param ipAddress [required] Filter the value of ipAddress property (=) @param ip [required] """ String qPath = "/ip/{ip}/license/plesk...
java
public ArrayList<String> ip_license_plesk_GET(String ip, String ipAddress) throws IOException { String qPath = "/ip/{ip}/license/plesk"; StringBuilder sb = path(qPath, ip); query(sb, "ipAddress", ipAddress); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t2); }
[ "public", "ArrayList", "<", "String", ">", "ip_license_plesk_GET", "(", "String", "ip", ",", "String", "ipAddress", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ip/{ip}/license/plesk\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",...
Plesk licenses associated to this IP REST: GET /ip/{ip}/license/plesk @param ipAddress [required] Filter the value of ipAddress property (=) @param ip [required]
[ "Plesk", "licenses", "associated", "to", "this", "IP" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L642-L648