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
groundupworks/wings
wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java
FacebookEndpoint.requestAlbums
boolean requestAlbums(String id, Callback callback) { """ Asynchronously requests the albums associated with the linked account. Requires an opened active {@link Session}. @param id may be {@link #ME} or a Page id. @param callback a {@link Callback} when the request completes. @return true if the reques...
java
boolean requestAlbums(String id, Callback callback) { boolean isSuccessful = false; Session session = Session.getActiveSession(); if (session != null && session.isOpened()) { // Construct fields to request. Bundle params = new Bundle(); params.putString(ALBUM...
[ "boolean", "requestAlbums", "(", "String", "id", ",", "Callback", "callback", ")", "{", "boolean", "isSuccessful", "=", "false", ";", "Session", "session", "=", "Session", ".", "getActiveSession", "(", ")", ";", "if", "(", "session", "!=", "null", "&&", "s...
Asynchronously requests the albums associated with the linked account. Requires an opened active {@link Session}. @param id may be {@link #ME} or a Page id. @param callback a {@link Callback} when the request completes. @return true if the request is made; false if no opened {@link Session} is active.
[ "Asynchronously", "requests", "the", "albums", "associated", "with", "the", "linked", "account", ".", "Requires", "an", "opened", "active", "{", "@link", "Session", "}", "." ]
train
https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java#L700-L717
alkacon/opencms-core
src/org/opencms/loader/CmsJspLoader.java
CmsJspLoader.getController
protected CmsFlexController getController( CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res, boolean streaming, boolean top) { """ Delivers a Flex controller, either by creating a new one, or by re-using an existing one.<p> @par...
java
protected CmsFlexController getController( CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res, boolean streaming, boolean top) { CmsFlexController controller = null; if (top) { // only check for existing contr...
[ "protected", "CmsFlexController", "getController", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ",", "HttpServletRequest", "req", ",", "HttpServletResponse", "res", ",", "boolean", "streaming", ",", "boolean", "top", ")", "{", "CmsFlexController", "control...
Delivers a Flex controller, either by creating a new one, or by re-using an existing one.<p> @param cms the initial CmsObject to wrap in the controller @param resource the resource requested @param req the current request @param res the current response @param streaming indicates if the response is streaming @param to...
[ "Delivers", "a", "Flex", "controller", "either", "by", "creating", "a", "new", "one", "or", "by", "re", "-", "using", "an", "existing", "one", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsJspLoader.java#L1136-L1166
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java
ParsedScheduleExpression.getNextDayOfWeek
private int getNextDayOfWeek(int day, int dayOfWeek) { """ Returns the next day of the month after <tt>day</tt> that satisfies the dayOfWeek constraint. @param day the current 0-based day of the month @param dayOfWeek the current 0-based day of the week @return a value greater than or equal to <tt>day</tt> ...
java
private int getNextDayOfWeek(int day, int dayOfWeek) { if (!contains(daysOfWeek, dayOfWeek)) { long higher = higher(daysOfWeek, dayOfWeek); if (higher != 0) { return day + (first(higher) - dayOfWeek); } return day + (7 - da...
[ "private", "int", "getNextDayOfWeek", "(", "int", "day", ",", "int", "dayOfWeek", ")", "{", "if", "(", "!", "contains", "(", "daysOfWeek", ",", "dayOfWeek", ")", ")", "{", "long", "higher", "=", "higher", "(", "daysOfWeek", ",", "dayOfWeek", ")", ";", ...
Returns the next day of the month after <tt>day</tt> that satisfies the dayOfWeek constraint. @param day the current 0-based day of the month @param dayOfWeek the current 0-based day of the week @return a value greater than or equal to <tt>day</tt>
[ "Returns", "the", "next", "day", "of", "the", "month", "after", "<tt", ">", "day<", "/", "tt", ">", "that", "satisfies", "the", "dayOfWeek", "constraint", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java#L969-L983
the-fascinator/plugin-roles-internal
src/main/java/com/googlecode/fascinator/roles/internal/InternalRoles.java
InternalRoles.renameRole
@Override public void renameRole(String oldrole, String newrole) throws RolesException { """ Rename a role. @param oldrole The name role currently has. @param newrole The name role is changing to. @throws RolesException if there was an error during rename. """ if (role_list.containsKey(oldrole)) { ...
java
@Override public void renameRole(String oldrole, String newrole) throws RolesException { if (role_list.containsKey(oldrole)) { List<String> users_with_role = role_list.get(oldrole); for (String user : users_with_role) { // Remove the role from this user List<String> roles_of_user = user_list.get(user);...
[ "@", "Override", "public", "void", "renameRole", "(", "String", "oldrole", ",", "String", "newrole", ")", "throws", "RolesException", "{", "if", "(", "role_list", ".", "containsKey", "(", "oldrole", ")", ")", "{", "List", "<", "String", ">", "users_with_role...
Rename a role. @param oldrole The name role currently has. @param newrole The name role is changing to. @throws RolesException if there was an error during rename.
[ "Rename", "a", "role", "." ]
train
https://github.com/the-fascinator/plugin-roles-internal/blob/5f75f802a92ef907acf030692d462aec4b4d3aae/src/main/java/com/googlecode/fascinator/roles/internal/InternalRoles.java#L435-L463
OpenLiberty/open-liberty
dev/com.ibm.ws.security.credentials.ssotoken/src/com/ibm/ws/security/credentials/ssotoken/internal/SSOTokenCredentialProvider.java
SSOTokenCredentialProvider.setSsoTokenCredential
private void setSsoTokenCredential(Subject subject, String principalAccessId) throws CredentialException { """ Create an SSO token for the specified accessId. @param subject @param principalAccessId @throws TokenCreationFailedException """ try { TokenManager tokenMa...
java
private void setSsoTokenCredential(Subject subject, String principalAccessId) throws CredentialException { try { TokenManager tokenManager = tokenManagerRef.getService(); SingleSignonToken ssoToken = null; Set<Token> tokens = subject.getPrivateCredentials(...
[ "private", "void", "setSsoTokenCredential", "(", "Subject", "subject", ",", "String", "principalAccessId", ")", "throws", "CredentialException", "{", "try", "{", "TokenManager", "tokenManager", "=", "tokenManagerRef", ".", "getService", "(", ")", ";", "SingleSignonTok...
Create an SSO token for the specified accessId. @param subject @param principalAccessId @throws TokenCreationFailedException
[ "Create", "an", "SSO", "token", "for", "the", "specified", "accessId", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.ssotoken/src/com/ibm/ws/security/credentials/ssotoken/internal/SSOTokenCredentialProvider.java#L95-L115
vdurmont/emoji-java
src/main/java/com/vdurmont/emoji/EmojiParser.java
EmojiParser.removeEmojis
public static String removeEmojis( String str, final Collection<Emoji> emojisToRemove ) { """ Removes a set of emojis from a String @param str the string to process @param emojisToRemove the emojis to remove from this string @return the string without the emojis that were removed ""...
java
public static String removeEmojis( String str, final Collection<Emoji> emojisToRemove ) { EmojiTransformer emojiTransformer = new EmojiTransformer() { public String transform(UnicodeCandidate unicodeCandidate) { if (!emojisToRemove.contains(unicodeCandidate.getEmoji())) { return un...
[ "public", "static", "String", "removeEmojis", "(", "String", "str", ",", "final", "Collection", "<", "Emoji", ">", "emojisToRemove", ")", "{", "EmojiTransformer", "emojiTransformer", "=", "new", "EmojiTransformer", "(", ")", "{", "public", "String", "transform", ...
Removes a set of emojis from a String @param str the string to process @param emojisToRemove the emojis to remove from this string @return the string without the emojis that were removed
[ "Removes", "a", "set", "of", "emojis", "from", "a", "String" ]
train
https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L308-L323
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java
SqlTileWriter.getRowCount
protected long getRowCount(final String pWhereClause, final String[] pWhereClauseArgs) { """ Count cache tiles: helper method @since 6.0.2 @return the number of tiles, or -1 if a problem occurred """ Cursor cursor = null; try { final SQLiteDatabase db = getDb(); if (db...
java
protected long getRowCount(final String pWhereClause, final String[] pWhereClauseArgs) { Cursor cursor = null; try { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { return -1; } cursor = db.rawQuery( ...
[ "protected", "long", "getRowCount", "(", "final", "String", "pWhereClause", ",", "final", "String", "[", "]", "pWhereClauseArgs", ")", "{", "Cursor", "cursor", "=", "null", ";", "try", "{", "final", "SQLiteDatabase", "db", "=", "getDb", "(", ")", ";", "if"...
Count cache tiles: helper method @since 6.0.2 @return the number of tiles, or -1 if a problem occurred
[ "Count", "cache", "tiles", ":", "helper", "method" ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L424-L445
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java
KafkaUtils.containsPartitionAvgRecordSize
public static boolean containsPartitionAvgRecordSize(State state, KafkaPartition partition) { """ Determines whether the given {@link State} contains "[topicname].[partitionid].avg.record.size". """ return state.contains( getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + Kaf...
java
public static boolean containsPartitionAvgRecordSize(State state, KafkaPartition partition) { return state.contains( getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + KafkaSource.AVG_RECORD_SIZE); }
[ "public", "static", "boolean", "containsPartitionAvgRecordSize", "(", "State", "state", ",", "KafkaPartition", "partition", ")", "{", "return", "state", ".", "contains", "(", "getPartitionPropName", "(", "partition", ".", "getTopicName", "(", ")", ",", "partition", ...
Determines whether the given {@link State} contains "[topicname].[partitionid].avg.record.size".
[ "Determines", "whether", "the", "given", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java#L111-L114
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java
TypeRegistry.rememberReloadableType
public void rememberReloadableType(int typeId, ReloadableType rtype) { """ Sometimes we discover the reloadabletype during program execution, for example A calls B and we haven't yet seen B. We find B has been loaded by a parent classloader, let's remember B here so we can do fast lookups for it. @param typeId...
java
public void rememberReloadableType(int typeId, ReloadableType rtype) { if (typeId >= reloadableTypes.length) { resizeReloadableTypeArray(typeId); } reloadableTypes[typeId] = rtype; if ((typeId + 1) > reloadableTypesSize) { reloadableTypesSize = typeId + 1; } }
[ "public", "void", "rememberReloadableType", "(", "int", "typeId", ",", "ReloadableType", "rtype", ")", "{", "if", "(", "typeId", ">=", "reloadableTypes", ".", "length", ")", "{", "resizeReloadableTypeArray", "(", "typeId", ")", ";", "}", "reloadableTypes", "[", ...
Sometimes we discover the reloadabletype during program execution, for example A calls B and we haven't yet seen B. We find B has been loaded by a parent classloader, let's remember B here so we can do fast lookups for it. @param typeId the id for the type @param rtype the ReloadableType to associate with the id
[ "Sometimes", "we", "discover", "the", "reloadabletype", "during", "program", "execution", "for", "example", "A", "calls", "B", "and", "we", "haven", "t", "yet", "seen", "B", ".", "We", "find", "B", "has", "been", "loaded", "by", "a", "parent", "classloader...
train
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L1195-L1203
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java
KunderaQuery.setParameter
public final void setParameter(int position, Object value) { """ Sets the parameter. @param position the position @param value the value """ if (isNative()) { bindParameters.add(new BindParameter(position, value)); } else { setParameterValue("?" + position, value);...
java
public final void setParameter(int position, Object value) { if (isNative()) { bindParameters.add(new BindParameter(position, value)); } else { setParameterValue("?" + position, value); } parametersMap.put("?" + position, value); }
[ "public", "final", "void", "setParameter", "(", "int", "position", ",", "Object", "value", ")", "{", "if", "(", "isNative", "(", ")", ")", "{", "bindParameters", ".", "add", "(", "new", "BindParameter", "(", "position", ",", "value", ")", ")", ";", "}"...
Sets the parameter. @param position the position @param value the value
[ "Sets", "the", "parameter", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java#L839-L847
exoplatform/jcr
exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java
UserProfileHandlerImpl.writeProfile
private void writeProfile(UserProfile userProfile, Node profileNode) throws RepositoryException { """ Write profile to storage. @param profileNode the node which stores profile attributes as properties with prefix {@link #ATTRIBUTE_PREFIX} @param userProfile the profile to store @throws RepositoryException...
java
private void writeProfile(UserProfile userProfile, Node profileNode) throws RepositoryException { for (Entry<String, String> attribute : userProfile.getUserInfoMap().entrySet()) { profileNode.setProperty(ATTRIBUTE_PREFIX + attribute.getKey(), attribute.getValue()); } }
[ "private", "void", "writeProfile", "(", "UserProfile", "userProfile", ",", "Node", "profileNode", ")", "throws", "RepositoryException", "{", "for", "(", "Entry", "<", "String", ",", "String", ">", "attribute", ":", "userProfile", ".", "getUserInfoMap", "(", ")",...
Write profile to storage. @param profileNode the node which stores profile attributes as properties with prefix {@link #ATTRIBUTE_PREFIX} @param userProfile the profile to store @throws RepositoryException if unexpected exception is occurred during writing
[ "Write", "profile", "to", "storage", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserProfileHandlerImpl.java#L365-L371
lessthanoptimal/ejml
main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java
CommonOps_ZDRM.transposeConjugate
public static ZMatrixRMaj transposeConjugate(ZMatrixRMaj input , ZMatrixRMaj output ) { """ <p> Conjugate transposes input matrix 'a' and stores the results in output matrix 'b':<br> <br> b-real<sub>i,j</sub> = a-real<sub>j,i</sub><br> b-imaginary<sub>i,j</sub> = -1*a-imaginary<sub>j,i</sub><br> where 'b' is ...
java
public static ZMatrixRMaj transposeConjugate(ZMatrixRMaj input , ZMatrixRMaj output ) { if( output == null ) { output = new ZMatrixRMaj(input.numCols,input.numRows); } else if( input.numCols != output.numRows || input.numRows != output.numCols ) { throw new IllegalArgumentExc...
[ "public", "static", "ZMatrixRMaj", "transposeConjugate", "(", "ZMatrixRMaj", "input", ",", "ZMatrixRMaj", "output", ")", "{", "if", "(", "output", "==", "null", ")", "{", "output", "=", "new", "ZMatrixRMaj", "(", "input", ".", "numCols", ",", "input", ".", ...
<p> Conjugate transposes input matrix 'a' and stores the results in output matrix 'b':<br> <br> b-real<sub>i,j</sub> = a-real<sub>j,i</sub><br> b-imaginary<sub>i,j</sub> = -1*a-imaginary<sub>j,i</sub><br> where 'b' is the transpose of 'a'. </p> @param input The original matrix. Not modified. @param output Where the t...
[ "<p", ">", "Conjugate", "transposes", "input", "matrix", "a", "and", "stores", "the", "results", "in", "output", "matrix", "b", ":", "<br", ">", "<br", ">", "b", "-", "real<sub", ">", "i", "j<", "/", "sub", ">", "=", "a", "-", "real<sub", ">", "j",...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L779-L790
kejunxia/AndroidMvc
library/poke/src/main/java/com/shipdream/lib/poke/Provider.java
Provider.notifyReferenced
void notifyReferenced(Provider provider, T instance) { """ Notify the instance with the given type is <b>FULLY</b> injected which means all of its nested injectable fields are injected and ready <b>RECURSIVELY</b>. <p>This method should get called every time the instance is injected, no matter if it's a newly c...
java
void notifyReferenced(Provider provider, T instance) { notifyInstanceCreationWhenNeeded(); if (referencedListeners != null) { int len = referencedListeners.size(); for(int i = 0; i < len; i++) { referencedListeners.get(i).onReferenced(provider, instance); ...
[ "void", "notifyReferenced", "(", "Provider", "provider", ",", "T", "instance", ")", "{", "notifyInstanceCreationWhenNeeded", "(", ")", ";", "if", "(", "referencedListeners", "!=", "null", ")", "{", "int", "len", "=", "referencedListeners", ".", "size", "(", ")...
Notify the instance with the given type is <b>FULLY</b> injected which means all of its nested injectable fields are injected and ready <b>RECURSIVELY</b>. <p>This method should get called every time the instance is injected, no matter if it's a newly created instance or it's a reused cached instance.</p> @param insta...
[ "Notify", "the", "instance", "with", "the", "given", "type", "is", "<b", ">", "FULLY<", "/", "b", ">", "injected", "which", "means", "all", "of", "its", "nested", "injectable", "fields", "are", "injected", "and", "ready", "<b", ">", "RECURSIVELY<", "/", ...
train
https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/Provider.java#L401-L410
OpenLiberty/open-liberty
dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/taglib/GlobalTagLibraryCache.java
GlobalTagLibraryCache.addGlobalTagLibConfig
public void addGlobalTagLibConfig(GlobalTagLibConfig globalTagLibConfig) { """ add some GlobalTabLibConfig to the global tag libs we know about. If the provided config provides a classloader, we will load the TLDs via that class loaders, otherwise the JAR URL will be used to find the TLDs. @param globalTagLib...
java
public void addGlobalTagLibConfig(GlobalTagLibConfig globalTagLibConfig) { try { TldParser tldParser = new TldParser(this, configManager, false, globalTagLibConfig.getClassloader()); if (globalTagLibConfig.getClassloader() == null) loadTldFromJarInputStream(globalTagLibC...
[ "public", "void", "addGlobalTagLibConfig", "(", "GlobalTagLibConfig", "globalTagLibConfig", ")", "{", "try", "{", "TldParser", "tldParser", "=", "new", "TldParser", "(", "this", ",", "configManager", ",", "false", ",", "globalTagLibConfig", ".", "getClassloader", "(...
add some GlobalTabLibConfig to the global tag libs we know about. If the provided config provides a classloader, we will load the TLDs via that class loaders, otherwise the JAR URL will be used to find the TLDs. @param globalTagLibConfig The global tag lib config
[ "add", "some", "GlobalTabLibConfig", "to", "the", "global", "tag", "libs", "we", "know", "about", ".", "If", "the", "provided", "config", "provides", "a", "classloader", "we", "will", "load", "the", "TLDs", "via", "that", "class", "loaders", "otherwise", "th...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/taglib/GlobalTagLibraryCache.java#L596-L612
UrielCh/ovh-java-sdk
ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java
ApiOvhDbaaslogs.serviceName_role_roleId_GET
public OvhRole serviceName_role_roleId_GET(String serviceName, String roleId) throws IOException { """ Returns details of specified role REST: GET /dbaas/logs/{serviceName}/role/{roleId} @param serviceName [required] Service name @param roleId [required] Role ID """ String qPath = "/dbaas/logs/{serviceN...
java
public OvhRole serviceName_role_roleId_GET(String serviceName, String roleId) throws IOException { String qPath = "/dbaas/logs/{serviceName}/role/{roleId}"; StringBuilder sb = path(qPath, serviceName, roleId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhRole.class); }
[ "public", "OvhRole", "serviceName_role_roleId_GET", "(", "String", "serviceName", ",", "String", "roleId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dbaas/logs/{serviceName}/role/{roleId}\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ...
Returns details of specified role REST: GET /dbaas/logs/{serviceName}/role/{roleId} @param serviceName [required] Service name @param roleId [required] Role ID
[ "Returns", "details", "of", "specified", "role" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L733-L738
riversun/d6
src/main/java/org/riversun/d6/core/ModelWrapper.java
ModelWrapper.setValue
public void setValue(String columnName, Object value) { """ Set the value to a field of the model object.The field is associated with DB column name by DBColumn annotation. @param columnName @param value """ D6ModelClassFieldInfo fieldInfo = mFieldMap.get(columnName); if (fieldInfo !...
java
public void setValue(String columnName, Object value) { D6ModelClassFieldInfo fieldInfo = mFieldMap.get(columnName); if (fieldInfo != null) { fieldInfo.value = value; } else { // case field info is null final String[] parts = columnN...
[ "public", "void", "setValue", "(", "String", "columnName", ",", "Object", "value", ")", "{", "D6ModelClassFieldInfo", "fieldInfo", "=", "mFieldMap", ".", "get", "(", "columnName", ")", ";", "if", "(", "fieldInfo", "!=", "null", ")", "{", "fieldInfo", ".", ...
Set the value to a field of the model object.The field is associated with DB column name by DBColumn annotation. @param columnName @param value
[ "Set", "the", "value", "to", "a", "field", "of", "the", "model", "object", ".", "The", "field", "is", "associated", "with", "DB", "column", "name", "by", "DBColumn", "annotation", "." ]
train
https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/ModelWrapper.java#L74-L101
box/box-android-sdk
box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java
BoxApiFile.getUploadRequest
public BoxRequestsFile.UploadFile getUploadRequest(File file, String destinationFolderId) { """ Gets a request that uploads a file from an existing file @param file file to upload @param destinationFolderId id of the parent folder for the new file @return request to upload a file from an existing file "...
java
public BoxRequestsFile.UploadFile getUploadRequest(File file, String destinationFolderId) { BoxRequestsFile.UploadFile request = new BoxRequestsFile.UploadFile(file, destinationFolderId, getFileUploadUrl(), mSession); return request; }
[ "public", "BoxRequestsFile", ".", "UploadFile", "getUploadRequest", "(", "File", "file", ",", "String", "destinationFolderId", ")", "{", "BoxRequestsFile", ".", "UploadFile", "request", "=", "new", "BoxRequestsFile", ".", "UploadFile", "(", "file", ",", "destination...
Gets a request that uploads a file from an existing file @param file file to upload @param destinationFolderId id of the parent folder for the new file @return request to upload a file from an existing file
[ "Gets", "a", "request", "that", "uploads", "a", "file", "from", "an", "existing", "file" ]
train
https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L324-L327
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java
RuntimeExceptionsFactory.newRuntimeException
public static RuntimeException newRuntimeException(Throwable cause, String message, Object... args) { """ Constructs and initializes a new {@link RuntimeException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throwabl...
java
public static RuntimeException newRuntimeException(Throwable cause, String message, Object... args) { return new RuntimeException(format(message, args), cause); }
[ "public", "static", "RuntimeException", "newRuntimeException", "(", "Throwable", "cause", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "new", "RuntimeException", "(", "format", "(", "message", ",", "args", ")", ",", "cause", ")",...
Constructs and initializes a new {@link RuntimeException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throwable} identified as the reason this {@link RuntimeException} was thrown. @param message {@link String} describing the...
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "RuntimeException", "}", "with", "the", "given", "{", "@link", "Throwable", "cause", "}", "and", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Object"...
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L204-L206
lucee/Lucee
core/src/main/java/lucee/commons/net/HTTPUtil.java
HTTPUtil.toURL
public static URL toURL(String strUrl, int port, boolean encodeIfNecessary) throws MalformedURLException { """ cast a string to a url @param strUrl string represent a url @return url from string @throws MalformedURLException """ URL url; try { url = new URL(strUrl); } catch (MalformedURLException...
java
public static URL toURL(String strUrl, int port, boolean encodeIfNecessary) throws MalformedURLException { URL url; try { url = new URL(strUrl); } catch (MalformedURLException mue) { url = new URL("http://" + strUrl); } if (!encodeIfNecessary) return url; return encodeURL(url, port); }
[ "public", "static", "URL", "toURL", "(", "String", "strUrl", ",", "int", "port", ",", "boolean", "encodeIfNecessary", ")", "throws", "MalformedURLException", "{", "URL", "url", ";", "try", "{", "url", "=", "new", "URL", "(", "strUrl", ")", ";", "}", "cat...
cast a string to a url @param strUrl string represent a url @return url from string @throws MalformedURLException
[ "cast", "a", "string", "to", "a", "url" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/net/HTTPUtil.java#L117-L127
haraldk/TwelveMonkeys
common/common-image/src/main/java/com/twelvemonkeys/image/CopyDither.java
CopyDither.filter
public final WritableRaster filter(final Raster pSource, WritableRaster pDest, IndexColorModel pColorModel) { """ Performs a single-input/single-output pixel copy operation. @param pSource @param pDest @param pColorModel @return the destination raster, or a new raster, if {@code pDest} was {@code null}. ...
java
public final WritableRaster filter(final Raster pSource, WritableRaster pDest, IndexColorModel pColorModel) { int width = pSource.getWidth(); int height = pSource.getHeight(); if (pDest == null) { pDest = createCompatibleDestRaster(pSource, pColorModel); } /...
[ "public", "final", "WritableRaster", "filter", "(", "final", "Raster", "pSource", ",", "WritableRaster", "pDest", ",", "IndexColorModel", "pColorModel", ")", "{", "int", "width", "=", "pSource", ".", "getWidth", "(", ")", ";", "int", "height", "=", "pSource", ...
Performs a single-input/single-output pixel copy operation. @param pSource @param pDest @param pColorModel @return the destination raster, or a new raster, if {@code pDest} was {@code null}.
[ "Performs", "a", "single", "-", "input", "/", "single", "-", "output", "pixel", "copy", "operation", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/CopyDither.java#L249-L281
samskivert/samskivert
src/main/java/com/samskivert/util/StringUtil.java
StringUtil.parseLongArray
public static long[] parseLongArray (String source) { """ Parses an array of longs from it's string representation. The array should be represented as a bare list of numbers separated by commas, for example: <pre>25, 17125141422, 21, 99</pre> Any inability to parse the long array will result in the function...
java
public static long[] parseLongArray (String source) { StringTokenizer tok = new StringTokenizer(source, ","); long[] vals = new long[tok.countTokens()]; for (int i = 0; tok.hasMoreTokens(); i++) { try { // trim the whitespace from the token vals[i]...
[ "public", "static", "long", "[", "]", "parseLongArray", "(", "String", "source", ")", "{", "StringTokenizer", "tok", "=", "new", "StringTokenizer", "(", "source", ",", "\",\"", ")", ";", "long", "[", "]", "vals", "=", "new", "long", "[", "tok", ".", "c...
Parses an array of longs from it's string representation. The array should be represented as a bare list of numbers separated by commas, for example: <pre>25, 17125141422, 21, 99</pre> Any inability to parse the long array will result in the function returning null.
[ "Parses", "an", "array", "of", "longs", "from", "it", "s", "string", "representation", ".", "The", "array", "should", "be", "represented", "as", "a", "bare", "list", "of", "numbers", "separated", "by", "commas", "for", "example", ":" ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L821-L834
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/Tetrahedron.java
Tetrahedron.getVertices
@Override public Point3d[] getVertices() { """ Returns the vertices of an n-fold polygon of given radius and center @param n @param radius @param center @return """ double x = getSideLengthFromCircumscribedRadius(circumscribedRadius)/2; double z = x/Math.sqrt(2); Point3d[] tetrahedron = new Point3d...
java
@Override public Point3d[] getVertices() { double x = getSideLengthFromCircumscribedRadius(circumscribedRadius)/2; double z = x/Math.sqrt(2); Point3d[] tetrahedron = new Point3d[4]; tetrahedron[0] = new Point3d(-x, 0, -z); tetrahedron[1] = new Point3d( x, 0, -z); tetrahedron[2] = new Point3d( 0, -x, z)...
[ "@", "Override", "public", "Point3d", "[", "]", "getVertices", "(", ")", "{", "double", "x", "=", "getSideLengthFromCircumscribedRadius", "(", "circumscribedRadius", ")", "/", "2", ";", "double", "z", "=", "x", "/", "Math", ".", "sqrt", "(", "2", ")", ";...
Returns the vertices of an n-fold polygon of given radius and center @param n @param radius @param center @return
[ "Returns", "the", "vertices", "of", "an", "n", "-", "fold", "polygon", "of", "given", "radius", "and", "center" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/Tetrahedron.java#L104-L123
vlingo/vlingo-http
src/main/java/io/vlingo/http/resource/StaticFilesResource.java
StaticFilesResource.serveFile
public void serveFile(final String contentFile, final String root, final String validSubPaths) { """ Completes with {@code Ok} and the file content or {@code NotFound}. @param contentFile the String name of the content file to be served @param root the String root path of the static content @param validSubPaths...
java
public void serveFile(final String contentFile, final String root, final String validSubPaths) { if (rootPath == null) { final String slash = root.endsWith("/") ? "" : "/"; rootPath = root + slash; } final String contentPath = rootPath + context.request.uri; try { final byte[] fileCo...
[ "public", "void", "serveFile", "(", "final", "String", "contentFile", ",", "final", "String", "root", ",", "final", "String", "validSubPaths", ")", "{", "if", "(", "rootPath", "==", "null", ")", "{", "final", "String", "slash", "=", "root", ".", "endsWith"...
Completes with {@code Ok} and the file content or {@code NotFound}. @param contentFile the String name of the content file to be served @param root the String root path of the static content @param validSubPaths the String indicating the valid file paths under the root
[ "Completes", "with", "{" ]
train
https://github.com/vlingo/vlingo-http/blob/746065fb1eaf1609c550ae45e96e3dbb9bfa37a2/src/main/java/io/vlingo/http/resource/StaticFilesResource.java#L38-L54
vlingo/vlingo-actors
src/main/java/io/vlingo/actors/Stage.java
Stage.actorAs
public <T> T actorAs(final Actor actor, final Class<T> protocol) { """ Answers the {@code T} protocol type as the means to message the backing {@code Actor}. @param actor the {@code Actor} that implements the {@code Class<T>} protocol @param protocol the {@code Class<T>} protocol @param <T> the protocol type @...
java
public <T> T actorAs(final Actor actor, final Class<T> protocol) { return actorProxyFor(protocol, actor, actor.lifeCycle.environment.mailbox); }
[ "public", "<", "T", ">", "T", "actorAs", "(", "final", "Actor", "actor", ",", "final", "Class", "<", "T", ">", "protocol", ")", "{", "return", "actorProxyFor", "(", "protocol", ",", "actor", ",", "actor", ".", "lifeCycle", ".", "environment", ".", "mai...
Answers the {@code T} protocol type as the means to message the backing {@code Actor}. @param actor the {@code Actor} that implements the {@code Class<T>} protocol @param protocol the {@code Class<T>} protocol @param <T> the protocol type @return T
[ "Answers", "the", "{" ]
train
https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L37-L39
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectPropertyRangeAxiomImpl_CustomFieldSerializer.java
OWLObjectPropertyRangeAxiomImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLObjectPropertyRangeAxiomImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.go...
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLObjectPropertyRangeAxiomImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLObjectPropertyRangeAxiomImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "}" ]
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.clie...
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectPropertyRangeAxiomImpl_CustomFieldSerializer.java#L76-L79
jeppetto/jeppetto
jeppetto-enhance/src/main/java/org/iternine/jeppetto/enhance/ClassLoadingUtil.java
ClassLoadingUtil.toClass
public static <T> Class<T> toClass(CtClass ctClass, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException { """ Installs the given {@code CtClass} into the given class-loader and returns it as a new class. @param ctClass class to load @param loader class-loader to install into @param dom...
java
public static <T> Class<T> toClass(CtClass ctClass, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException { try { byte[] byteCode = ctClass.toBytecode(); if (domain == null) { return bruteForceDefineClass(DEFINE_METHOD_NO_DOMAIN, loader, ctClass.getN...
[ "public", "static", "<", "T", ">", "Class", "<", "T", ">", "toClass", "(", "CtClass", "ctClass", ",", "ClassLoader", "loader", ",", "ProtectionDomain", "domain", ")", "throws", "CannotCompileException", "{", "try", "{", "byte", "[", "]", "byteCode", "=", "...
Installs the given {@code CtClass} into the given class-loader and returns it as a new class. @param ctClass class to load @param loader class-loader to install into @param domain protection domain, may be null @param <T> class type @return new class @throws CannotCompileException if the class cannot be compiled
[ "Installs", "the", "given", "{", "@code", "CtClass", "}", "into", "the", "given", "class", "-", "loader", "and", "returns", "it", "as", "a", "new", "class", "." ]
train
https://github.com/jeppetto/jeppetto/blob/bd2796dcf53376052f590e727931990a2902a933/jeppetto-enhance/src/main/java/org/iternine/jeppetto/enhance/ClassLoadingUtil.java#L134-L151
netplex/json-smart-v2
json-smart/src/main/java/net/minidev/json/parser/JSONParser.java
JSONParser.parse
public <T> T parse(String in, Class<T> mapTo) throws ParseException { """ use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory """ return getPString().parse(in, JSONValue.defaultReader.getMapper(mapTo)); }
java
public <T> T parse(String in, Class<T> mapTo) throws ParseException { return getPString().parse(in, JSONValue.defaultReader.getMapper(mapTo)); }
[ "public", "<", "T", ">", "T", "parse", "(", "String", "in", ",", "Class", "<", "T", ">", "mapTo", ")", "throws", "ParseException", "{", "return", "getPString", "(", ")", ".", "parse", "(", "in", ",", "JSONValue", ".", "defaultReader", ".", "getMapper",...
use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory
[ "use", "to", "return", "Primitive", "Type", "or", "String", "Or", "JsonObject", "or", "JsonArray", "generated", "by", "a", "ContainerFactory" ]
train
https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParser.java#L278-L280
sarl/sarl
main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java
AbstractSarlMojo.unix2os
protected static File unix2os(String filename) { """ Create a file from a unix-like representation of the filename. @param filename the unix-like filename. @return the file. """ File file = null; for (final String base : filename.split(Pattern.quote("/"))) { //$NON-NLS-1$ if (file == null) { fil...
java
protected static File unix2os(String filename) { File file = null; for (final String base : filename.split(Pattern.quote("/"))) { //$NON-NLS-1$ if (file == null) { file = new File(base); } else { file = new File(file, base); } } return file; }
[ "protected", "static", "File", "unix2os", "(", "String", "filename", ")", "{", "File", "file", "=", "null", ";", "for", "(", "final", "String", "base", ":", "filename", ".", "split", "(", "Pattern", ".", "quote", "(", "\"/\"", ")", ")", ")", "{", "//...
Create a file from a unix-like representation of the filename. @param filename the unix-like filename. @return the file.
[ "Create", "a", "file", "from", "a", "unix", "-", "like", "representation", "of", "the", "filename", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java#L137-L147
OpenBEL/openbel-framework
org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseTwoApplication.java
PhaseTwoApplication.stage3Term
private void stage3Term(final ProtoNetwork network, int pct) { """ Stage three term equivalencing. @param network the {@link ProtoNetwork network} to equivalence @param pct the parameter equivalencing count to control output """ stageOutput("Equivalencing terms"); int tct = p2.stage3Equival...
java
private void stage3Term(final ProtoNetwork network, int pct) { stageOutput("Equivalencing terms"); int tct = p2.stage3EquivalenceTerms(network); stageOutput("(" + tct + " equivalences)"); }
[ "private", "void", "stage3Term", "(", "final", "ProtoNetwork", "network", ",", "int", "pct", ")", "{", "stageOutput", "(", "\"Equivalencing terms\"", ")", ";", "int", "tct", "=", "p2", ".", "stage3EquivalenceTerms", "(", "network", ")", ";", "stageOutput", "("...
Stage three term equivalencing. @param network the {@link ProtoNetwork network} to equivalence @param pct the parameter equivalencing count to control output
[ "Stage", "three", "term", "equivalencing", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseTwoApplication.java#L363-L367
alibaba/java-dns-cache-manipulator
library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java
DnsCacheManipulator.setDnsCache
public static void setDnsCache(String host, String... ips) { """ Set a <b>never expired</b> dns cache entry @param host host @param ips ips @throws DnsCacheManipulatorException Operation fail @see DnsCacheManipulator#setDnsCache(long, java.lang.String, java.lang.String...) """ try { ...
java
public static void setDnsCache(String host, String... ips) { try { InetAddressCacheUtil.setInetAddressCache(host, ips, NEVER_EXPIRATION); } catch (Exception e) { final String message = String.format("Fail to setDnsCache for host %s ip %s, cause: %s", host, Arr...
[ "public", "static", "void", "setDnsCache", "(", "String", "host", ",", "String", "...", "ips", ")", "{", "try", "{", "InetAddressCacheUtil", ".", "setInetAddressCache", "(", "host", ",", "ips", ",", "NEVER_EXPIRATION", ")", ";", "}", "catch", "(", "Exception...
Set a <b>never expired</b> dns cache entry @param host host @param ips ips @throws DnsCacheManipulatorException Operation fail @see DnsCacheManipulator#setDnsCache(long, java.lang.String, java.lang.String...)
[ "Set", "a", "<b", ">", "never", "expired<", "/", "b", ">", "dns", "cache", "entry" ]
train
https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L35-L43
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/stores/PEMKeyStore.java
PEMKeyStore.engineGetKey
@Override public Key engineGetKey(String s, char[] chars) throws NoSuchAlgorithmException, UnrecoverableKeyException { """ Get the key referenced by the specified alias. @param s The key's alias. @param chars The key's password. @return The key reference by the alias or null. @throws NoSuchAlgorithmExc...
java
@Override public Key engineGetKey(String s, char[] chars) throws NoSuchAlgorithmException, UnrecoverableKeyException { CredentialWrapper credential = getKeyEntry(s); Key key = null; if (credential != null) { try { String password = null; if (chars != null) { password = new String(chars); ...
[ "@", "Override", "public", "Key", "engineGetKey", "(", "String", "s", ",", "char", "[", "]", "chars", ")", "throws", "NoSuchAlgorithmException", ",", "UnrecoverableKeyException", "{", "CredentialWrapper", "credential", "=", "getKeyEntry", "(", "s", ")", ";", "Ke...
Get the key referenced by the specified alias. @param s The key's alias. @param chars The key's password. @return The key reference by the alias or null. @throws NoSuchAlgorithmException If the key is encoded with an invalid algorithm. @throws UnrecoverableKeyException If the key can not be retrieved.
[ "Get", "the", "key", "referenced", "by", "the", "specified", "alias", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/stores/PEMKeyStore.java#L139-L159
spotify/apollo
examples/spotify-api-example/src/main/java/com/spotify/apollo/example/ArtistResource.java
ArtistResource.parseFirstArtistId
private String parseFirstArtistId(String json) { """ Parses the first artist id from a JSON response from a <a href="https://developer.spotify.com/web-api/search-item/">Spotify API search query</a>. @param json The json response @return The id of the first artist in the response. null if response was empty. ...
java
private String parseFirstArtistId(String json) { try { JsonNode jsonNode = this.objectMapper.readTree(json); for (JsonNode node : jsonNode.get("artists").get("items")) { return node.get("id").asText(); } } catch (IOException e) { throw new RuntimeException("Failed to parse JSON",...
[ "private", "String", "parseFirstArtistId", "(", "String", "json", ")", "{", "try", "{", "JsonNode", "jsonNode", "=", "this", ".", "objectMapper", ".", "readTree", "(", "json", ")", ";", "for", "(", "JsonNode", "node", ":", "jsonNode", ".", "get", "(", "\...
Parses the first artist id from a JSON response from a <a href="https://developer.spotify.com/web-api/search-item/">Spotify API search query</a>. @param json The json response @return The id of the first artist in the response. null if response was empty.
[ "Parses", "the", "first", "artist", "id", "from", "a", "JSON", "response", "from", "a", "<a", "href", "=", "https", ":", "//", "developer", ".", "spotify", ".", "com", "/", "web", "-", "api", "/", "search", "-", "item", "/", ">", "Spotify", "API", ...
train
https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/examples/spotify-api-example/src/main/java/com/spotify/apollo/example/ArtistResource.java#L112-L122
weld/core
impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java
DecoratorProxyFactory.addHandlerInitializerMethod
private void addHandlerInitializerMethod(ClassFile proxyClassType, ClassMethod staticConstructor) throws Exception { """ calls _initMH on the method handler and then stores the result in the methodHandler field as then new methodHandler """ ClassMethod classMethod = proxyClassType.addMethod(AccessFlag...
java
private void addHandlerInitializerMethod(ClassFile proxyClassType, ClassMethod staticConstructor) throws Exception { ClassMethod classMethod = proxyClassType.addMethod(AccessFlag.PRIVATE, INIT_MH_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_OBJECT); final CodeAttribute b = classMethod.ge...
[ "private", "void", "addHandlerInitializerMethod", "(", "ClassFile", "proxyClassType", ",", "ClassMethod", "staticConstructor", ")", "throws", "Exception", "{", "ClassMethod", "classMethod", "=", "proxyClassType", ".", "addMethod", "(", "AccessFlag", ".", "PRIVATE", ",",...
calls _initMH on the method handler and then stores the result in the methodHandler field as then new methodHandler
[ "calls", "_initMH", "on", "the", "method", "handler", "and", "then", "stores", "the", "result", "in", "the", "methodHandler", "field", "as", "then", "new", "methodHandler" ]
train
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java#L81-L93
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SubscriptionMessageImpl.java
SubscriptionMessageImpl.getIntKeyForString
private int getIntKeyForString(ArrayList<String> uniqueStrings, Object value) { """ Helper method to get, or assign, a unique key to a string, from an ArrayList containing the unique keys. @param uniqueStrings Current set of unique strings @param value Object to convert to a string, and find/assign an number fo...
java
private int getIntKeyForString(ArrayList<String> uniqueStrings, Object value) { String stringValue = String.valueOf(value); int retval = uniqueStrings.indexOf(stringValue); if (retval < 0) { retval = uniqueStrings.size(); uniqueStrings.add(stringValue); } return retval; }
[ "private", "int", "getIntKeyForString", "(", "ArrayList", "<", "String", ">", "uniqueStrings", ",", "Object", "value", ")", "{", "String", "stringValue", "=", "String", ".", "valueOf", "(", "value", ")", ";", "int", "retval", "=", "uniqueStrings", ".", "inde...
Helper method to get, or assign, a unique key to a string, from an ArrayList containing the unique keys. @param uniqueStrings Current set of unique strings @param value Object to convert to a string, and find/assign an number for @return number associated with the unique string
[ "Helper", "method", "to", "get", "or", "assign", "a", "unique", "key", "to", "a", "string", "from", "an", "ArrayList", "containing", "the", "unique", "keys", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SubscriptionMessageImpl.java#L185-L193
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/core/Base58.java
Base58.encodeChecked
public static String encodeChecked(int version, byte[] payload) { """ Encodes the given version and bytes as a base58 string. A checksum is appended. @param version the version to encode @param payload the bytes to encode, e.g. pubkey hash @return the base58-encoded string """ if (version < 0 || v...
java
public static String encodeChecked(int version, byte[] payload) { if (version < 0 || version > 255) throw new IllegalArgumentException("Version not in range."); // A stringified buffer is: // 1 byte version + data bytes + 4 bytes check code (a truncated hash) byte[] addressB...
[ "public", "static", "String", "encodeChecked", "(", "int", "version", ",", "byte", "[", "]", "payload", ")", "{", "if", "(", "version", "<", "0", "||", "version", ">", "255", ")", "throw", "new", "IllegalArgumentException", "(", "\"Version not in range.\"", ...
Encodes the given version and bytes as a base58 string. A checksum is appended. @param version the version to encode @param payload the bytes to encode, e.g. pubkey hash @return the base58-encoded string
[ "Encodes", "the", "given", "version", "and", "bytes", "as", "a", "base58", "string", ".", "A", "checksum", "is", "appended", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Base58.java#L101-L113
looly/hutool
hutool-json/src/main/java/cn/hutool/json/JSONUtil.java
JSONUtil.readJSONArray
public static JSONArray readJSONArray(File file, Charset charset) throws IORuntimeException { """ 读取JSONArray @param file JSON文件 @param charset 编码 @return JSONArray @throws IORuntimeException IO异常 """ return parseArray(FileReader.create(file, charset).readString()); }
java
public static JSONArray readJSONArray(File file, Charset charset) throws IORuntimeException { return parseArray(FileReader.create(file, charset).readString()); }
[ "public", "static", "JSONArray", "readJSONArray", "(", "File", "file", ",", "Charset", "charset", ")", "throws", "IORuntimeException", "{", "return", "parseArray", "(", "FileReader", ".", "create", "(", "file", ",", "charset", ")", ".", "readString", "(", ")",...
读取JSONArray @param file JSON文件 @param charset 编码 @return JSONArray @throws IORuntimeException IO异常
[ "读取JSONArray" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L236-L238
michael-rapp/AndroidMaterialDialog
example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java
PreferenceFragment.createThemeChangeListener
private OnPreferenceChangeListener createThemeChangeListener() { """ Creates and returns a listener, which allows to adapt the app's theme, when the value of the corresponding preference has been changed. @return The listener, which has been created, as an instance of the type {@link OnPreferenceChangeListene...
java
private OnPreferenceChangeListener createThemeChangeListener() { return new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(final Preference preference, final Object newValue) { getActivity().recreate(); return true; ...
[ "private", "OnPreferenceChangeListener", "createThemeChangeListener", "(", ")", "{", "return", "new", "OnPreferenceChangeListener", "(", ")", "{", "@", "Override", "public", "boolean", "onPreferenceChange", "(", "final", "Preference", "preference", ",", "final", "Object...
Creates and returns a listener, which allows to adapt the app's theme, when the value of the corresponding preference has been changed. @return The listener, which has been created, as an instance of the type {@link OnPreferenceChangeListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "adapt", "the", "app", "s", "theme", "when", "the", "value", "of", "the", "corresponding", "preference", "has", "been", "changed", "." ]
train
https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java#L270-L280
resilience4j/resilience4j
resilience4j-spring/src/main/java/io/github/resilience4j/circuitbreaker/configure/CircuitBreakerAspect.java
CircuitBreakerAspect.handleJoinPointCompletableFuture
private Object handleJoinPointCompletableFuture(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker) { """ handle the CompletionStage return types AOP based into configured circuit-breaker """ return circuitBreaker.executeCompletionStage(() -> { try...
java
private Object handleJoinPointCompletableFuture(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker) { return circuitBreaker.executeCompletionStage(() -> { try { return (CompletionStage<?>) proceedingJoinPoint.proceed(); } catch (Throwable throwable) ...
[ "private", "Object", "handleJoinPointCompletableFuture", "(", "ProceedingJoinPoint", "proceedingJoinPoint", ",", "io", ".", "github", ".", "resilience4j", ".", "circuitbreaker", ".", "CircuitBreaker", "circuitBreaker", ")", "{", "return", "circuitBreaker", ".", "executeCo...
handle the CompletionStage return types AOP based into configured circuit-breaker
[ "handle", "the", "CompletionStage", "return", "types", "AOP", "based", "into", "configured", "circuit", "-", "breaker" ]
train
https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-spring/src/main/java/io/github/resilience4j/circuitbreaker/configure/CircuitBreakerAspect.java#L110-L118
OnyxDevTools/onyx-database-parent
onyx-database-examples/relationships/src/main/java/com/onyxdevtools/relationship/AbstractDemo.java
AbstractDemo.assertEquals
static void assertEquals(String message, Object comparison1, Object comparison2) { """ Helper method to verify 2 objects have the same key @param message Message to display if the assert fails @param comparison1 First object to compare @param comparison2 Second object to compare against """ if(com...
java
static void assertEquals(String message, Object comparison1, Object comparison2) { if(comparison1 == comparison2) { return; } if(comparison1.equals(comparison2)) { return; } System.err.println(message); }
[ "static", "void", "assertEquals", "(", "String", "message", ",", "Object", "comparison1", ",", "Object", "comparison2", ")", "{", "if", "(", "comparison1", "==", "comparison2", ")", "{", "return", ";", "}", "if", "(", "comparison1", ".", "equals", "(", "co...
Helper method to verify 2 objects have the same key @param message Message to display if the assert fails @param comparison1 First object to compare @param comparison2 Second object to compare against
[ "Helper", "method", "to", "verify", "2", "objects", "have", "the", "same", "key" ]
train
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/relationships/src/main/java/com/onyxdevtools/relationship/AbstractDemo.java#L27-L39
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java
HylaFaxClientSpi.submitFaxJob
protected void submitFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception { """ This function will submit a new fax job.<br> The fax job ID may be populated by this method in the provided fax job object. @param client The client instance @param faxJob The fax job object containing the needed...
java
protected void submitFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception { //get job Job job=faxJob.getHylaFaxJob(); //add document to fax String filePath=faxJob.getFilePath(); job.addDocument(filePath); //submit job client.submit(job); ...
[ "protected", "void", "submitFaxJob", "(", "HylaFaxJob", "faxJob", ",", "HylaFAXClient", "client", ")", "throws", "Exception", "{", "//get job", "Job", "job", "=", "faxJob", ".", "getHylaFaxJob", "(", ")", ";", "//add document to fax", "String", "filePath", "=", ...
This function will submit a new fax job.<br> The fax job ID may be populated by this method in the provided fax job object. @param client The client instance @param faxJob The fax job object containing the needed information @throws Exception Any exception
[ "This", "function", "will", "submit", "a", "new", "fax", "job", ".", "<br", ">", "The", "fax", "job", "ID", "may", "be", "populated", "by", "this", "method", "in", "the", "provided", "fax", "job", "object", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L427-L438
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java
Long.getLong
public static Long getLong(String nm, Long val) { """ Returns the {@code long} value of the system property with the specified name. The first argument is treated as the name of a system property. System properties are accessible through the {@link java.lang.System#getProperty(java.lang.String)} method. The ...
java
public static Long getLong(String nm, Long val) { String v = null; try { v = System.getProperty(nm); } catch (IllegalArgumentException | NullPointerException e) { } if (v != null) { try { return Long.decode(v); } catch (NumberFo...
[ "public", "static", "Long", "getLong", "(", "String", "nm", ",", "Long", "val", ")", "{", "String", "v", "=", "null", ";", "try", "{", "v", "=", "System", ".", "getProperty", "(", "nm", ")", ";", "}", "catch", "(", "IllegalArgumentException", "|", "N...
Returns the {@code long} value of the system property with the specified name. The first argument is treated as the name of a system property. System properties are accessible through the {@link java.lang.System#getProperty(java.lang.String)} method. The string value of this property is then interpreted as a {@code l...
[ "Returns", "the", "{", "@code", "long", "}", "value", "of", "the", "system", "property", "with", "the", "specified", "name", ".", "The", "first", "argument", "is", "treated", "as", "the", "name", "of", "a", "system", "property", ".", "System", "properties"...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java#L1053-L1066
brunocvcunha/inutils4j
src/main/java/org/brunocvcunha/inutils4j/MyStringUtils.java
MyStringUtils.getContent
public static String getContent(String stringUrl, Map<String, String> requestProperties) { """ Returns content for the given URL @param stringUrl URL @param requestProperties Properties @return Response content """ try { URL url = new URL(stringUrl); URLConnection conn = url.openConnection()...
java
public static String getContent(String stringUrl, Map<String, String> requestProperties) { try { URL url = new URL(stringUrl); URLConnection conn = url.openConnection(); if (requestProperties != null) { for (Entry<String, String> entry : requestProperties.entrySet()) { con...
[ "public", "static", "String", "getContent", "(", "String", "stringUrl", ",", "Map", "<", "String", ",", "String", ">", "requestProperties", ")", "{", "try", "{", "URL", "url", "=", "new", "URL", "(", "stringUrl", ")", ";", "URLConnection", "conn", "=", "...
Returns content for the given URL @param stringUrl URL @param requestProperties Properties @return Response content
[ "Returns", "content", "for", "the", "given", "URL" ]
train
https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyStringUtils.java#L1004-L1026
j256/ormlite-core
src/main/java/com/j256/ormlite/stmt/StatementExecutor.java
StatementExecutor.updateId
public int updateId(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache) throws SQLException { """ Update an object in the database to change its id to the newId parameter. """ if (mappedUpdateId == null) { mappedUpdateId = MappedUpdateId.build(dao, tableInfo); } int re...
java
public int updateId(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache) throws SQLException { if (mappedUpdateId == null) { mappedUpdateId = MappedUpdateId.build(dao, tableInfo); } int result = mappedUpdateId.execute(databaseConnection, data, newId, objectCache); if (dao != n...
[ "public", "int", "updateId", "(", "DatabaseConnection", "databaseConnection", ",", "T", "data", ",", "ID", "newId", ",", "ObjectCache", "objectCache", ")", "throws", "SQLException", "{", "if", "(", "mappedUpdateId", "==", "null", ")", "{", "mappedUpdateId", "=",...
Update an object in the database to change its id to the newId parameter.
[ "Update", "an", "object", "in", "the", "database", "to", "change", "its", "id", "to", "the", "newId", "parameter", "." ]
train
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L482-L492
mailosaur/mailosaur-java
src/main/java/com/mailosaur/Messages.java
Messages.waitFor
public Message waitFor(String server, SearchCriteria criteria) throws IOException, MailosaurException { """ Wait for a specific message. Returns as soon as an message matching the specified search criteria is found. @param server The identifier of the server hosting the message. @param criteria The search cri...
java
public Message waitFor(String server, SearchCriteria criteria) throws IOException, MailosaurException { HashMap<String, String> query = new HashMap<String, String>(); query.put("server", server); return client.request("POST", "api/messages/await", criteria, query).parseAs(Message.class); }
[ "public", "Message", "waitFor", "(", "String", "server", ",", "SearchCriteria", "criteria", ")", "throws", "IOException", ",", "MailosaurException", "{", "HashMap", "<", "String", ",", "String", ">", "query", "=", "new", "HashMap", "<", "String", ",", "String"...
Wait for a specific message. Returns as soon as an message matching the specified search criteria is found. @param server The identifier of the server hosting the message. @param criteria The search criteria to use in order to find a match. @throws MailosaurException thrown if the request is rejected by server @throws...
[ "Wait", "for", "a", "specific", "message", ".", "Returns", "as", "soon", "as", "an", "message", "matching", "the", "specified", "search", "criteria", "is", "found", "." ]
train
https://github.com/mailosaur/mailosaur-java/blob/a580760f2eb41e034127d93104c7050639eced97/src/main/java/com/mailosaur/Messages.java#L106-L110
Netflix/astyanax
astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/QueryGenCache.java
QueryGenCache.getBoundStatement
public BoundStatement getBoundStatement(Q query, boolean useCaching) { """ Get the bound statement from the prepared statement @param query @param useCaching @return BoundStatement """ PreparedStatement pStatement = getPreparedStatement(query, useCaching); return bindValues(pStatement, query); }
java
public BoundStatement getBoundStatement(Q query, boolean useCaching) { PreparedStatement pStatement = getPreparedStatement(query, useCaching); return bindValues(pStatement, query); }
[ "public", "BoundStatement", "getBoundStatement", "(", "Q", "query", ",", "boolean", "useCaching", ")", "{", "PreparedStatement", "pStatement", "=", "getPreparedStatement", "(", "query", ",", "useCaching", ")", ";", "return", "bindValues", "(", "pStatement", ",", "...
Get the bound statement from the prepared statement @param query @param useCaching @return BoundStatement
[ "Get", "the", "bound", "statement", "from", "the", "prepared", "statement" ]
train
https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/QueryGenCache.java#L62-L66
bazaarvoice/emodb
queue-client-common/src/main/java/com/bazaarvoice/emodb/queue/client/AbstractQueueClient.java
AbstractQueueClient.sendAll
public void sendAll(String apiKey, Map<String, ? extends Collection<?>> messagesByQueue) { """ Any server can handle sending messages, no need for @PartitionKey """ checkNotNull(messagesByQueue, "messagesByQueue"); if (messagesByQueue.isEmpty()) { return; } if (messa...
java
public void sendAll(String apiKey, Map<String, ? extends Collection<?>> messagesByQueue) { checkNotNull(messagesByQueue, "messagesByQueue"); if (messagesByQueue.isEmpty()) { return; } if (messagesByQueue.size() == 1) { // Prefer the single queue REST call because ...
[ "public", "void", "sendAll", "(", "String", "apiKey", ",", "Map", "<", "String", ",", "?", "extends", "Collection", "<", "?", ">", ">", "messagesByQueue", ")", "{", "checkNotNull", "(", "messagesByQueue", ",", "\"messagesByQueue\"", ")", ";", "if", "(", "m...
Any server can handle sending messages, no need for @PartitionKey
[ "Any", "server", "can", "handle", "sending", "messages", "no", "need", "for" ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/queue-client-common/src/main/java/com/bazaarvoice/emodb/queue/client/AbstractQueueClient.java#L79-L101
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/Text.java
Text.styledContent
public static Text styledContent(final String text, final TextStyle ts) { """ Create a simple Text object with a style @param text the text content @param ts the style @return the Text """ return Text.builder().parStyledContent(text, ts).build(); }
java
public static Text styledContent(final String text, final TextStyle ts) { return Text.builder().parStyledContent(text, ts).build(); }
[ "public", "static", "Text", "styledContent", "(", "final", "String", "text", ",", "final", "TextStyle", "ts", ")", "{", "return", "Text", ".", "builder", "(", ")", ".", "parStyledContent", "(", "text", ",", "ts", ")", ".", "build", "(", ")", ";", "}" ]
Create a simple Text object with a style @param text the text content @param ts the style @return the Text
[ "Create", "a", "simple", "Text", "object", "with", "a", "style" ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Text.java#L98-L100
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/MultiModification.java
MultiModification.bind
public void bind(Class<?> type, Class<? extends SARLSemanticModification> modification) { """ Add a semantic modification related to the given element type. @param type the type of the element. @param modification the modification """ this.modificationTypes.put(type, modification); }
java
public void bind(Class<?> type, Class<? extends SARLSemanticModification> modification) { this.modificationTypes.put(type, modification); }
[ "public", "void", "bind", "(", "Class", "<", "?", ">", "type", ",", "Class", "<", "?", "extends", "SARLSemanticModification", ">", "modification", ")", "{", "this", ".", "modificationTypes", ".", "put", "(", "type", ",", "modification", ")", ";", "}" ]
Add a semantic modification related to the given element type. @param type the type of the element. @param modification the modification
[ "Add", "a", "semantic", "modification", "related", "to", "the", "given", "element", "type", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/acceptors/MultiModification.java#L73-L75
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java
ServerAzureADAdministratorsInner.beginCreateOrUpdateAsync
public Observable<ServerAzureADAdministratorInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerAzureADAdministratorInner properties) { """ Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator. @param resourceGroupName Th...
java
public Observable<ServerAzureADAdministratorInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerAzureADAdministratorInner properties) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, properties).map(new Func1<ServiceResponse<ServerAzureADAdminist...
[ "public", "Observable", "<", "ServerAzureADAdministratorInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "ServerAzureADAdministratorInner", "properties", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync...
Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator. @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. @p...
[ "Creates", "a", "new", "Server", "Active", "Directory", "Administrator", "or", "updates", "an", "existing", "server", "Active", "Directory", "Administrator", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java#L202-L209
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java
SingleListBox.setValue
@Override public void setValue(String value, boolean fireEvents) { """ Selects the specified value in the list. @param value the new value @param fireEvents if true, a ValueChangeEvent event will be fired @see #setAddMissingValue """ boolean added = setSelectedValue(this, value, addMissingValue); if...
java
@Override public void setValue(String value, boolean fireEvents) { boolean added = setSelectedValue(this, value, addMissingValue); if (added && fireEvents) { ValueChangeEvent.fire(this, getValue()); } }
[ "@", "Override", "public", "void", "setValue", "(", "String", "value", ",", "boolean", "fireEvents", ")", "{", "boolean", "added", "=", "setSelectedValue", "(", "this", ",", "value", ",", "addMissingValue", ")", ";", "if", "(", "added", "&&", "fireEvents", ...
Selects the specified value in the list. @param value the new value @param fireEvents if true, a ValueChangeEvent event will be fired @see #setAddMissingValue
[ "Selects", "the", "specified", "value", "in", "the", "list", "." ]
train
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/SingleListBox.java#L116-L122
integration-technology/amazon-mws-orders
src/main/java/com/amazonservices/mws/client/MwsUtl.java
MwsUtl.calculateStringToSignV2
static String calculateStringToSignV2(URI serviceUri, Map<String, String> parameters) { """ Calculate String to Sign for SignatureVersion 2 @param serviceUri @param parameters request parameters @return String to Sign """ StringBuilder data = new StringBuilder(); data.append("POST"); ...
java
static String calculateStringToSignV2(URI serviceUri, Map<String, String> parameters) { StringBuilder data = new StringBuilder(); data.append("POST"); data.append("\n"); data.append(serviceUri.getHost().toLowerCase()); if (!usesStandardPort(serviceUri)) { data.append(...
[ "static", "String", "calculateStringToSignV2", "(", "URI", "serviceUri", ",", "Map", "<", "String", ",", "String", ">", "parameters", ")", "{", "StringBuilder", "data", "=", "new", "StringBuilder", "(", ")", ";", "data", ".", "append", "(", "\"POST\"", ")", ...
Calculate String to Sign for SignatureVersion 2 @param serviceUri @param parameters request parameters @return String to Sign
[ "Calculate", "String", "to", "Sign", "for", "SignatureVersion", "2" ]
train
https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L163-L191
antlrjavaparser/antlr-java-parser
src/main/java/com/github/antlrjavaparser/ASTHelper.java
ASTHelper.addArgument
public static void addArgument(MethodCallExpr call, Expression arg) { """ Adds the given argument to the method call. The list of arguments will be initialized if it is <code>null</code>. @param call method call @param arg argument value """ List<Expression> args = call.getArgs(); if (ar...
java
public static void addArgument(MethodCallExpr call, Expression arg) { List<Expression> args = call.getArgs(); if (args == null) { args = new ArrayList<Expression>(); call.setArgs(args); } args.add(arg); }
[ "public", "static", "void", "addArgument", "(", "MethodCallExpr", "call", ",", "Expression", "arg", ")", "{", "List", "<", "Expression", ">", "args", "=", "call", ".", "getArgs", "(", ")", ";", "if", "(", "args", "==", "null", ")", "{", "args", "=", ...
Adds the given argument to the method call. The list of arguments will be initialized if it is <code>null</code>. @param call method call @param arg argument value
[ "Adds", "the", "given", "argument", "to", "the", "method", "call", ".", "The", "list", "of", "arguments", "will", "be", "initialized", "if", "it", "is", "<code", ">", "null<", "/", "code", ">", "." ]
train
https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L184-L191
apache/flink
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
RestClusterClient.pollResourceAsync
private <R, A extends AsynchronouslyCreatedResource<R>> CompletableFuture<R> pollResourceAsync( final Supplier<CompletableFuture<A>> resourceFutureSupplier) { """ Creates a {@code CompletableFuture} that polls a {@code AsynchronouslyCreatedResource} until its {@link AsynchronouslyCreatedResource#queueStatus() ...
java
private <R, A extends AsynchronouslyCreatedResource<R>> CompletableFuture<R> pollResourceAsync( final Supplier<CompletableFuture<A>> resourceFutureSupplier) { return pollResourceAsync(resourceFutureSupplier, new CompletableFuture<>(), 0); }
[ "private", "<", "R", ",", "A", "extends", "AsynchronouslyCreatedResource", "<", "R", ">", ">", "CompletableFuture", "<", "R", ">", "pollResourceAsync", "(", "final", "Supplier", "<", "CompletableFuture", "<", "A", ">", ">", "resourceFutureSupplier", ")", "{", ...
Creates a {@code CompletableFuture} that polls a {@code AsynchronouslyCreatedResource} until its {@link AsynchronouslyCreatedResource#queueStatus() QueueStatus} becomes {@link QueueStatus.Id#COMPLETED COMPLETED}. The future completes with the result of {@link AsynchronouslyCreatedResource#resource()}. @param resourceF...
[ "Creates", "a", "{", "@code", "CompletableFuture", "}", "that", "polls", "a", "{", "@code", "AsynchronouslyCreatedResource", "}", "until", "its", "{", "@link", "AsynchronouslyCreatedResource#queueStatus", "()", "QueueStatus", "}", "becomes", "{", "@link", "QueueStatus...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L584-L587
joniles/mpxj
src/main/java/net/sf/mpxj/planner/PlannerReader.java
PlannerReader.readCalendar
private void readCalendar(net.sf.mpxj.planner.schema.Calendar plannerCalendar, ProjectCalendar parentMpxjCalendar) throws MPXJException { """ This method extracts data for a single calendar from a Planner file. @param plannerCalendar Calendar data @param parentMpxjCalendar parent of derived calendar """ ...
java
private void readCalendar(net.sf.mpxj.planner.schema.Calendar plannerCalendar, ProjectCalendar parentMpxjCalendar) throws MPXJException { // // Create a calendar instance // ProjectCalendar mpxjCalendar = m_projectFile.addCalendar(); // // Populate basic details // mp...
[ "private", "void", "readCalendar", "(", "net", ".", "sf", ".", "mpxj", ".", "planner", ".", "schema", ".", "Calendar", "plannerCalendar", ",", "ProjectCalendar", "parentMpxjCalendar", ")", "throws", "MPXJException", "{", "//", "// Create a calendar instance", "//", ...
This method extracts data for a single calendar from a Planner file. @param plannerCalendar Calendar data @param parentMpxjCalendar parent of derived calendar
[ "This", "method", "extracts", "data", "for", "a", "single", "calendar", "from", "a", "Planner", "file", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/planner/PlannerReader.java#L229-L275
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/fragment/AbstractPreferenceFragment.java
AbstractPreferenceFragment.createRestoreDefaultsListener
private DialogInterface.OnClickListener createRestoreDefaultsListener() { """ Creates and returns a listener, which allows to restore the default values of the fragment's preferences. @return The listener, which has been created, as an instance of the type {@link DialogInterface.OnClickListener} """ ...
java
private DialogInterface.OnClickListener createRestoreDefaultsListener() { return new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { restoreDefaults(); } }; }
[ "private", "DialogInterface", ".", "OnClickListener", "createRestoreDefaultsListener", "(", ")", "{", "return", "new", "DialogInterface", ".", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "final", "DialogInterface", "dialog", ...
Creates and returns a listener, which allows to restore the default values of the fragment's preferences. @return The listener, which has been created, as an instance of the type {@link DialogInterface.OnClickListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "restore", "the", "default", "values", "of", "the", "fragment", "s", "preferences", "." ]
train
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/fragment/AbstractPreferenceFragment.java#L58-L67
gallandarakhneorg/afc
core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/AbstractForest.java
AbstractForest.fireTreeAddition
protected synchronized void fireTreeAddition(Tree<D, ?> tree) { """ Fire the addition event. @param tree is the new tree in the forest. """ if (this.listeners != null) { final ForestListener[] list = new ForestListener[this.listeners.size()]; this.listeners.toArray(list); final ForestEvent event ...
java
protected synchronized void fireTreeAddition(Tree<D, ?> tree) { if (this.listeners != null) { final ForestListener[] list = new ForestListener[this.listeners.size()]; this.listeners.toArray(list); final ForestEvent event = new ForestEvent(this, null, tree); for (final ForestListener listener : list) { ...
[ "protected", "synchronized", "void", "fireTreeAddition", "(", "Tree", "<", "D", ",", "?", ">", "tree", ")", "{", "if", "(", "this", ".", "listeners", "!=", "null", ")", "{", "final", "ForestListener", "[", "]", "list", "=", "new", "ForestListener", "[", ...
Fire the addition event. @param tree is the new tree in the forest.
[ "Fire", "the", "addition", "event", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/AbstractForest.java#L351-L360
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java
RoaringBitmap.orCardinality
public static int orCardinality(final RoaringBitmap x1, final RoaringBitmap x2) { """ Cardinality of the bitwise OR (union) operation. The provided bitmaps are *not* modified. This operation is thread-safe as long as the provided bitmaps remain unchanged. If you have more than 2 bitmaps, consider using the Fas...
java
public static int orCardinality(final RoaringBitmap x1, final RoaringBitmap x2) { // we use the fact that the cardinality of the bitmaps is known so that // the union is just the total cardinality minus the intersection return x1.getCardinality() + x2.getCardinality() - andCardinality(x1, x2); }
[ "public", "static", "int", "orCardinality", "(", "final", "RoaringBitmap", "x1", ",", "final", "RoaringBitmap", "x2", ")", "{", "// we use the fact that the cardinality of the bitmaps is known so that", "// the union is just the total cardinality minus the intersection", "return", ...
Cardinality of the bitwise OR (union) operation. The provided bitmaps are *not* modified. This operation is thread-safe as long as the provided bitmaps remain unchanged. If you have more than 2 bitmaps, consider using the FastAggregation class. @param x1 first bitmap @param x2 other bitmap @return cardinality of the ...
[ "Cardinality", "of", "the", "bitwise", "OR", "(", "union", ")", "operation", ".", "The", "provided", "bitmaps", "are", "*", "not", "*", "modified", ".", "This", "operation", "is", "thread", "-", "safe", "as", "long", "as", "the", "provided", "bitmaps", "...
train
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L843-L847
killbilling/recurly-java-library
src/main/java/com/ning/billing/recurly/RecurlyClient.java
RecurlyClient.getAccount
public Account getAccount(final String accountCode) { """ Get Account <p> Returns information about a single account. @param accountCode recurly account id @return account object on success, null otherwise """ if (accountCode == null || accountCode.isEmpty()) throw new RuntimeExceptio...
java
public Account getAccount(final String accountCode) { if (accountCode == null || accountCode.isEmpty()) throw new RuntimeException("accountCode cannot be empty!"); return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode, Account.class); }
[ "public", "Account", "getAccount", "(", "final", "String", "accountCode", ")", "{", "if", "(", "accountCode", "==", "null", "||", "accountCode", ".", "isEmpty", "(", ")", ")", "throw", "new", "RuntimeException", "(", "\"accountCode cannot be empty!\"", ")", ";",...
Get Account <p> Returns information about a single account. @param accountCode recurly account id @return account object on success, null otherwise
[ "Get", "Account", "<p", ">", "Returns", "information", "about", "a", "single", "account", "." ]
train
https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L309-L314
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java
Indexes.markPartitionAsUnindexed
public static void markPartitionAsUnindexed(int partitionId, InternalIndex[] indexes) { """ Marks the given partition as unindexed by the given indexes. @param partitionId the ID of the partition to mark as unindexed. @param indexes the indexes by which the given partition is unindexed. """ for...
java
public static void markPartitionAsUnindexed(int partitionId, InternalIndex[] indexes) { for (InternalIndex index : indexes) { index.markPartitionAsUnindexed(partitionId); } }
[ "public", "static", "void", "markPartitionAsUnindexed", "(", "int", "partitionId", ",", "InternalIndex", "[", "]", "indexes", ")", "{", "for", "(", "InternalIndex", "index", ":", "indexes", ")", "{", "index", ".", "markPartitionAsUnindexed", "(", "partitionId", ...
Marks the given partition as unindexed by the given indexes. @param partitionId the ID of the partition to mark as unindexed. @param indexes the indexes by which the given partition is unindexed.
[ "Marks", "the", "given", "partition", "as", "unindexed", "by", "the", "given", "indexes", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/query/impl/Indexes.java#L93-L97
alkacon/opencms-core
src/org/opencms/staticexport/CmsLinkManager.java
CmsLinkManager.substituteLinkForUnknownTarget
public String substituteLinkForUnknownTarget(CmsObject cms, String link, boolean forceSecure) { """ Returns a link <i>from</i> the URI stored in the provided OpenCms user context <i>to</i> the given <code>link</code>, for use on web pages.<p> A number of tests are performed with the <code>link</code> in order ...
java
public String substituteLinkForUnknownTarget(CmsObject cms, String link, boolean forceSecure) { return substituteLinkForUnknownTarget(cms, link, null, forceSecure); }
[ "public", "String", "substituteLinkForUnknownTarget", "(", "CmsObject", "cms", ",", "String", "link", ",", "boolean", "forceSecure", ")", "{", "return", "substituteLinkForUnknownTarget", "(", "cms", ",", "link", ",", "null", ",", "forceSecure", ")", ";", "}" ]
Returns a link <i>from</i> the URI stored in the provided OpenCms user context <i>to</i> the given <code>link</code>, for use on web pages.<p> A number of tests are performed with the <code>link</code> in order to find out how to create the link:<ul> <li>If <code>link</code> is empty, an empty String is returned. <li>...
[ "Returns", "a", "link", "<i", ">", "from<", "/", "i", ">", "the", "URI", "stored", "in", "the", "provided", "OpenCms", "user", "context", "<i", ">", "to<", "/", "i", ">", "the", "given", "<code", ">", "link<", "/", "code", ">", "for", "use", "on", ...
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L895-L898
OpenBEL/openbel-framework
org.openbel.framework.common/src/main/java/org/openbel/framework/common/record/Record.java
Record.readBuffer
public final T readBuffer(byte[] buffer) { """ Reads {@code <T>} from a byte buffer. @param buffer {@code byte[]}; of size {@link #getRecordSize()} @return {@code <T>} @throws InvalidArgument Thrown if {@code buffer} is null or invalid """ if (buffer == null) { throw new InvalidArgumen...
java
public final T readBuffer(byte[] buffer) { if (buffer == null) { throw new InvalidArgument("buffer", buffer); } else if (buffer.length != recordSize) { final String fmt = "invalid buffer (%d bytes, expected %d)"; final String msg = format(fmt, buffer.length, recordSiz...
[ "public", "final", "T", "readBuffer", "(", "byte", "[", "]", "buffer", ")", "{", "if", "(", "buffer", "==", "null", ")", "{", "throw", "new", "InvalidArgument", "(", "\"buffer\"", ",", "buffer", ")", ";", "}", "else", "if", "(", "buffer", ".", "lengt...
Reads {@code <T>} from a byte buffer. @param buffer {@code byte[]}; of size {@link #getRecordSize()} @return {@code <T>} @throws InvalidArgument Thrown if {@code buffer} is null or invalid
[ "Reads", "{", "@code", "<T", ">", "}", "from", "a", "byte", "buffer", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/record/Record.java#L244-L253
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java
TEEJBInvocationInfo.tracePreInvokeBegins
public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper) { """ This is called by the EJB container server code to write a EJB method call preinvoke begins record to the trace log, if enabled. """ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { ...
java
public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { StringBuffer sbuf = new StringBuffer(); sbuf .append(MthdPreInvokeEntry_Type_Str).append(Dat...
[ "public", "static", "void", "tracePreInvokeBegins", "(", "EJSDeployedSupport", "s", ",", "EJSWrapperBase", "wrapper", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "StringBuffe...
This is called by the EJB container server code to write a EJB method call preinvoke begins record to the trace log, if enabled.
[ "This", "is", "called", "by", "the", "EJB", "container", "server", "code", "to", "write", "a", "EJB", "method", "call", "preinvoke", "begins", "record", "to", "the", "trace", "log", "if", "enabled", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L31-L45
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAccountUrl.java
CustomerAccountUrl.getLoginStateByUserNameUrl
public static MozuUrl getLoginStateByUserNameUrl(String customerSetCode, String responseFields, String userName) { """ Get Resource Url for GetLoginStateByUserName @param customerSetCode The unique idenfitier of the customer set. @param responseFields Filtering syntax appended to an API call to increase or decre...
java
public static MozuUrl getLoginStateByUserNameUrl(String customerSetCode, String responseFields, String userName) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/loginstatebyusername?userName={userName}&customerSetCode={customerSetCode}&responseFields={responseFields}"); formatter.fo...
[ "public", "static", "MozuUrl", "getLoginStateByUserNameUrl", "(", "String", "customerSetCode", ",", "String", "responseFields", ",", "String", "userName", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/customer/accounts/loginstateby...
Get Resource Url for GetLoginStateByUserName @param customerSetCode The unique idenfitier of the customer set. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to updat...
[ "Get", "Resource", "Url", "for", "GetLoginStateByUserName" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAccountUrl.java#L217-L224
phax/ph-commons
ph-xml/src/main/java/com/helger/xml/xpath/XPathHelper.java
XPathHelper.createNewXPathExpression
@Nonnull public static XPathExpression createNewXPathExpression (@Nullable final XPathVariableResolver aVariableResolver, @Nullable final XPathFunctionResolver aFunctionResolver, @Nullable final Namespa...
java
@Nonnull public static XPathExpression createNewXPathExpression (@Nullable final XPathVariableResolver aVariableResolver, @Nullable final XPathFunctionResolver aFunctionResolver, @Nullable final Namespa...
[ "@", "Nonnull", "public", "static", "XPathExpression", "createNewXPathExpression", "(", "@", "Nullable", "final", "XPathVariableResolver", "aVariableResolver", ",", "@", "Nullable", "final", "XPathFunctionResolver", "aFunctionResolver", ",", "@", "Nullable", "final", "Nam...
Create a new XPath expression for evaluation using the default {@link XPathFactory}. @param aVariableResolver Variable resolver to be used. May be <code>null</code>. @param aFunctionResolver Function resolver to be used. May be <code>null</code>. @param aNamespaceContext Namespace context to be used. May be <code>null...
[ "Create", "a", "new", "XPath", "expression", "for", "evaluation", "using", "the", "default", "{", "@link", "XPathFactory", "}", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/XPathHelper.java#L321-L328
VoltDB/voltdb
src/frontend/org/voltdb/utils/CatalogUtil.java
CatalogUtil.makeDeploymentHashForConfig
public static UUID makeDeploymentHashForConfig(byte[] deploymentBytes) { """ Computes a MD5 digest (128 bits -> 2 longs -> UUID which is comprised of two longs) of a deployment file stripped of all comments and its hostcount attribute set to 0. @param deploymentBytes @return MD5 digest for for configuration ...
java
public static UUID makeDeploymentHashForConfig(byte[] deploymentBytes) { String normalized = new String(deploymentBytes, StandardCharsets.UTF_8); Matcher matcher = XML_COMMENT_RE.matcher(normalized); normalized = matcher.replaceAll(""); matcher = HOSTCOUNT_RE.matcher(normalized); ...
[ "public", "static", "UUID", "makeDeploymentHashForConfig", "(", "byte", "[", "]", "deploymentBytes", ")", "{", "String", "normalized", "=", "new", "String", "(", "deploymentBytes", ",", "StandardCharsets", ".", "UTF_8", ")", ";", "Matcher", "matcher", "=", "XML_...
Computes a MD5 digest (128 bits -> 2 longs -> UUID which is comprised of two longs) of a deployment file stripped of all comments and its hostcount attribute set to 0. @param deploymentBytes @return MD5 digest for for configuration
[ "Computes", "a", "MD5", "digest", "(", "128", "bits", "-", ">", "2", "longs", "-", ">", "UUID", "which", "is", "comprised", "of", "two", "longs", ")", "of", "a", "deployment", "file", "stripped", "of", "all", "comments", "and", "its", "hostcount", "att...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L1186-L1193
super-csv/super-csv
super-csv/src/main/java/org/supercsv/util/TwoDHashMap.java
TwoDHashMap.containsKey
public boolean containsKey(final K1 firstKey, final K2 secondKey) { """ Existence check of a value (or <tt>null</tt>) mapped to the keys. @param firstKey first key @param secondKey second key @return true when an element (or <tt>null</tt>) has been stored with the keys """ // existence check on inner ...
java
public boolean containsKey(final K1 firstKey, final K2 secondKey) { // existence check on inner map final HashMap<K2, V> innerMap = map.get(firstKey); if( innerMap == null ) { return false; } return innerMap.containsKey(secondKey); }
[ "public", "boolean", "containsKey", "(", "final", "K1", "firstKey", ",", "final", "K2", "secondKey", ")", "{", "// existence check on inner map", "final", "HashMap", "<", "K2", ",", "V", ">", "innerMap", "=", "map", ".", "get", "(", "firstKey", ")", ";", "...
Existence check of a value (or <tt>null</tt>) mapped to the keys. @param firstKey first key @param secondKey second key @return true when an element (or <tt>null</tt>) has been stored with the keys
[ "Existence", "check", "of", "a", "value", "(", "or", "<tt", ">", "null<", "/", "tt", ">", ")", "mapped", "to", "the", "keys", "." ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/TwoDHashMap.java#L70-L77
google/closure-compiler
src/com/google/javascript/jscomp/CrossChunkMethodMotion.java
CrossChunkMethodMotion.createStubCall
private Node createStubCall(Node originalDefinition, int stubId) { """ Returns a new Node to be used as the stub definition for a method. @param originalDefinition function Node whose definition is being stubbed @param stubId ID to use for stubbing and unstubbing @return a Node that looks like <code>JSCompile...
java
private Node createStubCall(Node originalDefinition, int stubId) { return astFactory .createCall( // We can't look up the type of the stub creating method, because we add its // definition after type checking. astFactory.createNameWithUnknownType(STUB_METHOD_NAME), astFac...
[ "private", "Node", "createStubCall", "(", "Node", "originalDefinition", ",", "int", "stubId", ")", "{", "return", "astFactory", ".", "createCall", "(", "// We can't look up the type of the stub creating method, because we add its", "// definition after type checking.", "astFactor...
Returns a new Node to be used as the stub definition for a method. @param originalDefinition function Node whose definition is being stubbed @param stubId ID to use for stubbing and unstubbing @return a Node that looks like <code>JSCompiler_stubMethod(0)</code>
[ "Returns", "a", "new", "Node", "to", "be", "used", "as", "the", "stub", "definition", "for", "a", "method", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CrossChunkMethodMotion.java#L383-L390
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/GoogleDriveUtils.java
GoogleDriveUtils.getWebViewLink
public static String getWebViewLink(Drive drive, String fileId) { """ Returns web view link for the file @param drive drive client @param fileId file id @return web view link for the file """ try { return getWebViewLink(getFile(drive, fileId)); } catch (IOException e) { logger.log(Le...
java
public static String getWebViewLink(Drive drive, String fileId) { try { return getWebViewLink(getFile(drive, fileId)); } catch (IOException e) { logger.log(Level.SEVERE, String.format( "Failed to build Google Drive URL for file %s", fileId), e); } return null; }
[ "public", "static", "String", "getWebViewLink", "(", "Drive", "drive", ",", "String", "fileId", ")", "{", "try", "{", "return", "getWebViewLink", "(", "getFile", "(", "drive", ",", "fileId", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{",...
Returns web view link for the file @param drive drive client @param fileId file id @return web view link for the file
[ "Returns", "web", "view", "link", "for", "the", "file" ]
train
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/GoogleDriveUtils.java#L286-L294
d-michail/jheaps
src/main/java/org/jheaps/monotone/AbstractRadixHeap.java
AbstractRadixHeap.computeBucket
protected int computeBucket(K key, K minKey) { """ Compute the bucket of a key based on a minimum key. @param key the key @param minKey the minimum key @return the bucket where the key should go """ return 1 + Math.min(msd(key, minKey), buckets.length - 2); }
java
protected int computeBucket(K key, K minKey) { return 1 + Math.min(msd(key, minKey), buckets.length - 2); }
[ "protected", "int", "computeBucket", "(", "K", "key", ",", "K", "minKey", ")", "{", "return", "1", "+", "Math", ".", "min", "(", "msd", "(", "key", ",", "minKey", ")", ",", "buckets", ".", "length", "-", "2", ")", ";", "}" ]
Compute the bucket of a key based on a minimum key. @param key the key @param minKey the minimum key @return the bucket where the key should go
[ "Compute", "the", "bucket", "of", "a", "key", "based", "on", "a", "minimum", "key", "." ]
train
https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/monotone/AbstractRadixHeap.java#L274-L276
netplex/json-smart-v2
json-smart/src/main/java/net/minidev/json/JSONValue.java
JSONValue.parseWithException
public static <T> T parseWithException(String in, Class<T> mapTo) throws ParseException { """ Parse input json as a mapTo class mapTo can be a bean @since 2.0 """ JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE); return p.parse(in, defaultReader.getMapper(mapTo)); }
java
public static <T> T parseWithException(String in, Class<T> mapTo) throws ParseException { JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE); return p.parse(in, defaultReader.getMapper(mapTo)); }
[ "public", "static", "<", "T", ">", "T", "parseWithException", "(", "String", "in", ",", "Class", "<", "T", ">", "mapTo", ")", "throws", "ParseException", "{", "JSONParser", "p", "=", "new", "JSONParser", "(", "DEFAULT_PERMISSIVE_MODE", ")", ";", "return", ...
Parse input json as a mapTo class mapTo can be a bean @since 2.0
[ "Parse", "input", "json", "as", "a", "mapTo", "class" ]
train
https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONValue.java#L425-L428
kiegroup/drools
drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java
DroolsStreamUtils.streamIn
public static Object streamIn(InputStream in, ClassLoader classLoader) throws IOException, ClassNotFoundException { """ This method reads the contents from the given input stream and returns the object. It is expected that the contents in the given stream was not compressed, and it was written by the...
java
public static Object streamIn(InputStream in, ClassLoader classLoader) throws IOException, ClassNotFoundException { return streamIn(in, classLoader, false); }
[ "public", "static", "Object", "streamIn", "(", "InputStream", "in", ",", "ClassLoader", "classLoader", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "return", "streamIn", "(", "in", ",", "classLoader", ",", "false", ")", ";", "}" ]
This method reads the contents from the given input stream and returns the object. It is expected that the contents in the given stream was not compressed, and it was written by the corresponding streamOut methods of this class. @param in @param classLoader @return @throws IOException @throws ClassNotFoundException
[ "This", "method", "reads", "the", "contents", "from", "the", "given", "input", "stream", "and", "returns", "the", "object", ".", "It", "is", "expected", "that", "the", "contents", "in", "the", "given", "stream", "was", "not", "compressed", "and", "it", "wa...
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java#L187-L190
fabric8io/kubernetes-client
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReplaceValueStream.java
ReplaceValueStream.replaceValues
public static InputStream replaceValues(InputStream is, Map<String, String> valuesMap) { """ Returns a stream with the template parameter expressions replaced @param is {@link InputStream} inputstream for @param valuesMap a hashmap containing parameters @return returns stream with template parameter expressio...
java
public static InputStream replaceValues(InputStream is, Map<String, String> valuesMap) { return new ReplaceValueStream(valuesMap).createInputStream(is); }
[ "public", "static", "InputStream", "replaceValues", "(", "InputStream", "is", ",", "Map", "<", "String", ",", "String", ">", "valuesMap", ")", "{", "return", "new", "ReplaceValueStream", "(", "valuesMap", ")", ".", "createInputStream", "(", "is", ")", ";", "...
Returns a stream with the template parameter expressions replaced @param is {@link InputStream} inputstream for @param valuesMap a hashmap containing parameters @return returns stream with template parameter expressions replaced
[ "Returns", "a", "stream", "with", "the", "template", "parameter", "expressions", "replaced" ]
train
https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/ReplaceValueStream.java#L39-L41
jdereg/java-util
src/main/java/com/cedarsoftware/util/ProxyFactory.java
ProxyFactory.create
public static <T> T create(ClassLoader loader, Class<T> intf, InvocationHandler h) { """ Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to the specified invocation handler. @param loader the class loader to define the proxy class @param intf the interface...
java
public static <T> T create(ClassLoader loader, Class<T> intf, InvocationHandler h) { return (T)Proxy.newProxyInstance(loader, new Class[]{intf}, h); }
[ "public", "static", "<", "T", ">", "T", "create", "(", "ClassLoader", "loader", ",", "Class", "<", "T", ">", "intf", ",", "InvocationHandler", "h", ")", "{", "return", "(", "T", ")", "Proxy", ".", "newProxyInstance", "(", "loader", ",", "new", "Class",...
Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to the specified invocation handler. @param loader the class loader to define the proxy class @param intf the interface for the proxy to implement @param h the invocation handler to dispatch method invocations to @re...
[ "Returns", "an", "instance", "of", "a", "proxy", "class", "for", "the", "specified", "interfaces", "that", "dispatches", "method", "invocations", "to", "the", "specified", "invocation", "handler", "." ]
train
https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/ProxyFactory.java#L73-L75
Azure/azure-sdk-for-java
kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java
ClustersInner.beginCreateOrUpdate
public ClusterInner beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { """ Create or update a Kusto cluster. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param parameters The K...
java
public ClusterInner beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); }
[ "public", "ClusterInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "ClusterInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "clusterName", ",", "param...
Create or update a Kusto cluster. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. @throws IllegalArgumentException thrown if parameters fail t...
[ "Create", "or", "update", "a", "Kusto", "cluster", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L308-L310
networknt/light-4j
dump/src/main/java/com/networknt/dump/RootDumper.java
RootDumper.dumpRequest
public void dumpRequest(Map<String, Object> result) { """ create dumpers that can dump http request info, and put http request info into Map<String, Object> result @param result a Map<String, Object> to put http request info to """ if(!dumpConfig.isRequestEnabled()) { return; } Map<String, Ob...
java
public void dumpRequest(Map<String, Object> result) { if(!dumpConfig.isRequestEnabled()) { return; } Map<String, Object> requestResult = new LinkedHashMap<>(); for(IRequestDumpable dumper: dumperFactory.createRequestDumpers(dumpConfig, exchange)) { if(dumper.isApplicableForRequest()...
[ "public", "void", "dumpRequest", "(", "Map", "<", "String", ",", "Object", ">", "result", ")", "{", "if", "(", "!", "dumpConfig", ".", "isRequestEnabled", "(", ")", ")", "{", "return", ";", "}", "Map", "<", "String", ",", "Object", ">", "requestResult"...
create dumpers that can dump http request info, and put http request info into Map<String, Object> result @param result a Map<String, Object> to put http request info to
[ "create", "dumpers", "that", "can", "dump", "http", "request", "info", "and", "put", "http", "request", "info", "into", "Map<String", "Object", ">", "result" ]
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/RootDumper.java#L43-L53
synchronoss/cpo-api
cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java
JdbcCpoXaAdapter.existsObject
@Override public <T> long existsObject(String name, T obj) throws CpoException { """ The CpoAdapter will check to see if this object exists in the datasource. <p> <pre>Example: <code> <p> class SomeObject so = new SomeObject(); long count = 0; class CpoAdapter cpo = null; <p> <p> try { cpo = new JdbcC...
java
@Override public <T> long existsObject(String name, T obj) throws CpoException { return getCurrentResource().existsObject( name, obj); }
[ "@", "Override", "public", "<", "T", ">", "long", "existsObject", "(", "String", "name", ",", "T", "obj", ")", "throws", "CpoException", "{", "return", "getCurrentResource", "(", ")", ".", "existsObject", "(", "name", ",", "obj", ")", ";", "}" ]
The CpoAdapter will check to see if this object exists in the datasource. <p> <pre>Example: <code> <p> class SomeObject so = new SomeObject(); long count = 0; class CpoAdapter cpo = null; <p> <p> try { cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false)); } catch (CpoException ce) { /...
[ "The", "CpoAdapter", "will", "check", "to", "see", "if", "this", "object", "exists", "in", "the", "datasource", ".", "<p", ">", "<pre", ">", "Example", ":", "<code", ">", "<p", ">", "class", "SomeObject", "so", "=", "new", "SomeObject", "()", ";", "lon...
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L910-L913
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.setHeader
public void setHeader(@NonNull View view, boolean padding, boolean divider) { """ method to replace a previous set header @param view @param padding @param divider """ setHeader(view, padding, divider, null); }
java
public void setHeader(@NonNull View view, boolean padding, boolean divider) { setHeader(view, padding, divider, null); }
[ "public", "void", "setHeader", "(", "@", "NonNull", "View", "view", ",", "boolean", "padding", ",", "boolean", "divider", ")", "{", "setHeader", "(", "view", ",", "padding", ",", "divider", ",", "null", ")", ";", "}" ]
method to replace a previous set header @param view @param padding @param divider
[ "method", "to", "replace", "a", "previous", "set", "header" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L324-L326
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4AddressSection.java
IPv4AddressSection.intersect
public IPv4AddressSection intersect(IPv4AddressSection other) throws SizeMismatchException { """ Produces the subnet sections whose addresses are found in both this and the given argument. <p> This is also known as the conjunction of the two sets of address sections. <p> @param other @return the section conta...
java
public IPv4AddressSection intersect(IPv4AddressSection other) throws SizeMismatchException { return intersect(this, other, getAddressCreator(), this::getSegment, other::getSegment); }
[ "public", "IPv4AddressSection", "intersect", "(", "IPv4AddressSection", "other", ")", "throws", "SizeMismatchException", "{", "return", "intersect", "(", "this", ",", "other", ",", "getAddressCreator", "(", ")", ",", "this", "::", "getSegment", ",", "other", "::",...
Produces the subnet sections whose addresses are found in both this and the given argument. <p> This is also known as the conjunction of the two sets of address sections. <p> @param other @return the section containing the sections found in both this and the given subnet sections
[ "Produces", "the", "subnet", "sections", "whose", "addresses", "are", "found", "in", "both", "this", "and", "the", "given", "argument", ".", "<p", ">", "This", "is", "also", "known", "as", "the", "conjunction", "of", "the", "two", "sets", "of", "address", ...
train
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4AddressSection.java#L1086-L1088
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nslimitidentifier_stats.java
nslimitidentifier_stats.get
public static nslimitidentifier_stats get(nitro_service service, String name) throws Exception { """ Use this API to fetch statistics of nslimitidentifier_stats resource of given name . """ nslimitidentifier_stats obj = new nslimitidentifier_stats(); obj.set_name(name); nslimitidentifier_stats response =...
java
public static nslimitidentifier_stats get(nitro_service service, String name) throws Exception{ nslimitidentifier_stats obj = new nslimitidentifier_stats(); obj.set_name(name); nslimitidentifier_stats response = (nslimitidentifier_stats) obj.stat_resource(service); return response; }
[ "public", "static", "nslimitidentifier_stats", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "nslimitidentifier_stats", "obj", "=", "new", "nslimitidentifier_stats", "(", ")", ";", "obj", ".", "set_name", "(", "nam...
Use this API to fetch statistics of nslimitidentifier_stats resource of given name .
[ "Use", "this", "API", "to", "fetch", "statistics", "of", "nslimitidentifier_stats", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nslimitidentifier_stats.java#L216-L221
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java
ServletHolder.setUserRoleLink
public synchronized void setUserRoleLink(String name,String link) { """ Link a user role. Translate the role name used by a servlet, to the link name used by the container. @param name The role name as used by the servlet @param link The role name as used by the container. """ if (_roleMap==null) ...
java
public synchronized void setUserRoleLink(String name,String link) { if (_roleMap==null) _roleMap=new HashMap(); _roleMap.put(name,link); }
[ "public", "synchronized", "void", "setUserRoleLink", "(", "String", "name", ",", "String", "link", ")", "{", "if", "(", "_roleMap", "==", "null", ")", "_roleMap", "=", "new", "HashMap", "(", ")", ";", "_roleMap", ".", "put", "(", "name", ",", "link", "...
Link a user role. Translate the role name used by a servlet, to the link name used by the container. @param name The role name as used by the servlet @param link The role name as used by the container.
[ "Link", "a", "user", "role", ".", "Translate", "the", "role", "name", "used", "by", "a", "servlet", "to", "the", "link", "name", "used", "by", "the", "container", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L170-L175
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.asComparable
public static <T extends Comparable<?>> ComparableExpression<T> asComparable(Expression<T> expr) { """ Create a new ComparableExpression @param expr Expression of type Comparable @return new ComparableExpression """ Expression<T> underlyingMixin = ExpressionUtils.extract(expr); if (underlyi...
java
public static <T extends Comparable<?>> ComparableExpression<T> asComparable(Expression<T> expr) { Expression<T> underlyingMixin = ExpressionUtils.extract(expr); if (underlyingMixin instanceof PathImpl) { return new ComparablePath<T>((PathImpl<T>) underlyingMixin); } else if (underly...
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", ">", ">", "ComparableExpression", "<", "T", ">", "asComparable", "(", "Expression", "<", "T", ">", "expr", ")", "{", "Expression", "<", "T", ">", "underlyingMixin", "=", "ExpressionUtils", "....
Create a new ComparableExpression @param expr Expression of type Comparable @return new ComparableExpression
[ "Create", "a", "new", "ComparableExpression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L1899-L1920
geomajas/geomajas-project-geometry
core/src/main/java/org/geomajas/geometry/service/BboxService.java
BboxService.contains
public static boolean contains(Bbox parent, Bbox child) { """ Does one bounding box contain another? @param parent The parent bounding box in the relation. Does this one contain the child? @param child The child bounding box in the relation. Is this one contained within the parent? @return true if the child...
java
public static boolean contains(Bbox parent, Bbox child) { if (child.getX() < parent.getX()) { return false; } if (child.getY() < parent.getY()) { return false; } if (child.getMaxX() > parent.getMaxX()) { return false; } if (child.getMaxY() > parent.getMaxY()) { return false; } return true;...
[ "public", "static", "boolean", "contains", "(", "Bbox", "parent", ",", "Bbox", "child", ")", "{", "if", "(", "child", ".", "getX", "(", ")", "<", "parent", ".", "getX", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "child", ".", "ge...
Does one bounding box contain another? @param parent The parent bounding box in the relation. Does this one contain the child? @param child The child bounding box in the relation. Is this one contained within the parent? @return true if the child is completely contained(surrounded) by the parent, false otherwise.
[ "Does", "one", "bounding", "box", "contain", "another?" ]
train
https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/BboxService.java#L106-L120
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java
FeatureCollection.fromFeatures
public static FeatureCollection fromFeatures(@NonNull List<Feature> features, @Nullable BoundingBox bbox) { """ Create a new instance of this class by giving the feature collection a list of {@link Feature}s. The list of features itself isn't null but it can be empty...
java
public static FeatureCollection fromFeatures(@NonNull List<Feature> features, @Nullable BoundingBox bbox) { return new FeatureCollection(TYPE, bbox, features); }
[ "public", "static", "FeatureCollection", "fromFeatures", "(", "@", "NonNull", "List", "<", "Feature", ">", "features", ",", "@", "Nullable", "BoundingBox", "bbox", ")", "{", "return", "new", "FeatureCollection", "(", "TYPE", ",", "bbox", ",", "features", ")", ...
Create a new instance of this class by giving the feature collection a list of {@link Feature}s. The list of features itself isn't null but it can be empty and have a size of 0. @param features a list of features @param bbox optionally include a bbox definition as a double array @return a new instance of this clas...
[ "Create", "a", "new", "instance", "of", "this", "class", "by", "giving", "the", "feature", "collection", "a", "list", "of", "{", "@link", "Feature", "}", "s", ".", "The", "list", "of", "features", "itself", "isn", "t", "null", "but", "it", "can", "be",...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java#L125-L128
voldemort/voldemort
src/java/voldemort/store/stats/ClientSocketStats.java
ClientSocketStats.recordSyncOpTimeNs
public void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs) { """ Record operation for sync ops time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param opTimeUs The number of us for...
java
public void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs) { if(dest != null) { getOrCreateNodeStats(dest).recordSyncOpTimeNs(null, opTimeNs); recordSyncOpTimeNs(null, opTimeNs); } else { this.syncOpTimeRequestCounter.addRequest(opTimeNs); } }
[ "public", "void", "recordSyncOpTimeNs", "(", "SocketDestination", "dest", ",", "long", "opTimeNs", ")", "{", "if", "(", "dest", "!=", "null", ")", "{", "getOrCreateNodeStats", "(", "dest", ")", ".", "recordSyncOpTimeNs", "(", "null", ",", "opTimeNs", ")", ";...
Record operation for sync ops time @param dest Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null. @param opTimeUs The number of us for the op to finish
[ "Record", "operation", "for", "sync", "ops", "time" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/stats/ClientSocketStats.java#L213-L220
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java
DataFrameJoiner.rightOuter
public Table rightOuter(Table table2, boolean allowDuplicateColumnNames, String... col2Names) { """ Joins the joiner to the table2, using the given columns for the second table and returns the resulting table @param table2 The table to join with @param allowDuplicateColumnNames if {@code false} the join will...
java
public Table rightOuter(Table table2, boolean allowDuplicateColumnNames, String... col2Names) { Table leftOuter = table2.join(col2Names).leftOuter(table, allowDuplicateColumnNames, columnNames); // reverse the columns Table result = Table.create(leftOuter.name()); // loop on table that ...
[ "public", "Table", "rightOuter", "(", "Table", "table2", ",", "boolean", "allowDuplicateColumnNames", ",", "String", "...", "col2Names", ")", "{", "Table", "leftOuter", "=", "table2", ".", "join", "(", "col2Names", ")", ".", "leftOuter", "(", "table", ",", "...
Joins the joiner to the table2, using the given columns for the second table and returns the resulting table @param table2 The table to join with @param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name if {@code true} the join will succeed and...
[ "Joins", "the", "joiner", "to", "the", "table2", "using", "the", "given", "columns", "for", "the", "second", "table", "and", "returns", "the", "resulting", "table" ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L605-L626
stratosphere/stratosphere
stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobSubmissionServlet.java
JobSubmissionServlet.showErrorPage
private void showErrorPage(HttpServletResponse resp, String message) throws IOException { """ Prints the error page, containing the given message. @param resp The response handler. @param message The message to display. @throws IOException Thrown, if the error page could not be printed due to an I/O proble...
java
private void showErrorPage(HttpServletResponse resp, String message) throws IOException { resp.setStatus(HttpServletResponse.SC_OK); resp.setContentType(GUIServletStub.CONTENT_TYPE_HTML); PrintWriter writer = resp.getWriter(); writer .println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transition...
[ "private", "void", "showErrorPage", "(", "HttpServletResponse", "resp", ",", "String", "message", ")", "throws", "IOException", "{", "resp", ".", "setStatus", "(", "HttpServletResponse", ".", "SC_OK", ")", ";", "resp", ".", "setContentType", "(", "GUIServletStub",...
Prints the error page, containing the given message. @param resp The response handler. @param message The message to display. @throws IOException Thrown, if the error page could not be printed due to an I/O problem.
[ "Prints", "the", "error", "page", "containing", "the", "given", "message", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobSubmissionServlet.java#L343-L373
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/src/main/java/org/deeplearning4j/parallelism/ParallelWrapper.java
ParallelWrapper.setListeners
public void setListeners(StatsStorageRouter statsStorage, Collection<? extends TrainingListener> listeners) { """ Set the listeners, along with a StatsStorageRouter that the results will be shuffled to (in the case of any listeners that implement the {@link RoutingIterationListener} interface) @param statsStor...
java
public void setListeners(StatsStorageRouter statsStorage, Collection<? extends TrainingListener> listeners) { //Check if we have any RoutingIterationListener instances that need a StatsStorage implementation... if (listeners != null) { for (TrainingListener l : listeners) { i...
[ "public", "void", "setListeners", "(", "StatsStorageRouter", "statsStorage", ",", "Collection", "<", "?", "extends", "TrainingListener", ">", "listeners", ")", "{", "//Check if we have any RoutingIterationListener instances that need a StatsStorage implementation...", "if", "(", ...
Set the listeners, along with a StatsStorageRouter that the results will be shuffled to (in the case of any listeners that implement the {@link RoutingIterationListener} interface) @param statsStorage Stats storage router to place the results into @param listeners Listeners to set
[ "Set", "the", "listeners", "along", "with", "a", "StatsStorageRouter", "that", "the", "results", "will", "be", "shuffled", "to", "(", "in", "the", "case", "of", "any", "listeners", "that", "implement", "the", "{", "@link", "RoutingIterationListener", "}", "int...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/src/main/java/org/deeplearning4j/parallelism/ParallelWrapper.java#L447-L466
fuinorg/utils4j
src/main/java/org/fuin/utils4j/JandexUtils.java
JandexUtils.indexClassFile
public static boolean indexClassFile(final Indexer indexer, final List<File> knownFiles, final File classFile) { """ Indexes a single file, except it was already analyzed. @param indexer Indexer to use. @param knownFiles List of files already analyzed. New files will be added within this method. @param clas...
java
public static boolean indexClassFile(final Indexer indexer, final List<File> knownFiles, final File classFile) { if (knownFiles.contains(classFile)) { return false; } knownFiles.add(classFile); try (final InputStream in = classFile.toURI().toURL().openStream()) { ...
[ "public", "static", "boolean", "indexClassFile", "(", "final", "Indexer", "indexer", ",", "final", "List", "<", "File", ">", "knownFiles", ",", "final", "File", "classFile", ")", "{", "if", "(", "knownFiles", ".", "contains", "(", "classFile", ")", ")", "{...
Indexes a single file, except it was already analyzed. @param indexer Indexer to use. @param knownFiles List of files already analyzed. New files will be added within this method. @param classFile Class file to analyze. @return TRUE if the file was indexed or FALSE if it was ignored.
[ "Indexes", "a", "single", "file", "except", "it", "was", "already", "analyzed", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/JandexUtils.java#L55-L69
OpenCompare/OpenCompare
org.opencompare/pcmdata-importers/src/main/java/JSONformating/model/JSONFormat.java
JSONFormat.sameJSONFormat
public boolean sameJSONFormat(JSONFormat jf) { """ Checks if the JSONFormat in parameter is the same as this, omitting ids and jcell.jvalue.value content @param jf the format to compare @return true if this and jf are the same, omits ids """ Map<String,String> featLinks = new HashMap<>(); if(!this.name....
java
public boolean sameJSONFormat(JSONFormat jf){ Map<String,String> featLinks = new HashMap<>(); if(!this.name.equals(jf.name) || !this.creator.equals(jf.creator) || !this.license.equals(jf.license) || !this.source.equals(jf.source)){ return false; }else if(!this.sameFeatures(jf, featLinks)){ System.out.print...
[ "public", "boolean", "sameJSONFormat", "(", "JSONFormat", "jf", ")", "{", "Map", "<", "String", ",", "String", ">", "featLinks", "=", "new", "HashMap", "<>", "(", ")", ";", "if", "(", "!", "this", ".", "name", ".", "equals", "(", "jf", ".", "name", ...
Checks if the JSONFormat in parameter is the same as this, omitting ids and jcell.jvalue.value content @param jf the format to compare @return true if this and jf are the same, omits ids
[ "Checks", "if", "the", "JSONFormat", "in", "parameter", "is", "the", "same", "as", "this", "omitting", "ids", "and", "jcell", ".", "jvalue", ".", "value", "content" ]
train
https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/JSONformating/model/JSONFormat.java#L395-L407
apache/flink
flink-core/src/main/java/org/apache/flink/configuration/Configuration.java
Configuration.getLong
@PublicEvolving public long getLong(ConfigOption<Long> configOption, long overrideDefault) { """ Returns the value associated with the given config option as a long integer. If no value is mapped under any key of the option, it returns the specified default instead of the option's default value. @param confi...
java
@PublicEvolving public long getLong(ConfigOption<Long> configOption, long overrideDefault) { Object o = getRawValueFromOption(configOption); if (o == null) { return overrideDefault; } return convertToLong(o, configOption.defaultValue()); }
[ "@", "PublicEvolving", "public", "long", "getLong", "(", "ConfigOption", "<", "Long", ">", "configOption", ",", "long", "overrideDefault", ")", "{", "Object", "o", "=", "getRawValueFromOption", "(", "configOption", ")", ";", "if", "(", "o", "==", "null", ")"...
Returns the value associated with the given config option as a long integer. If no value is mapped under any key of the option, it returns the specified default instead of the option's default value. @param configOption The configuration option @param overrideDefault The value to return if no value was mapper for any ...
[ "Returns", "the", "value", "associated", "with", "the", "given", "config", "option", "as", "a", "long", "integer", ".", "If", "no", "value", "is", "mapped", "under", "any", "key", "of", "the", "option", "it", "returns", "the", "specified", "default", "inst...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L308-L315
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/image/ImgHTMLRenderer.java
ImgHTMLRenderer.renderImage
@Override public void renderImage(String imgSource, Map<String, Object> attributes, final Writer writer) throws IOException { """ Render the actual tag @param imgSource Source of the image @param attributes Attributes for the tag. @param writer Writer to render the HTML into. Will NOT be closed or flushed...
java
@Override public void renderImage(String imgSource, Map<String, Object> attributes, final Writer writer) throws IOException { StringBuilder sb = new StringBuilder(tagStart); sb.append("src=\"").append(imgSource).append("\" "); for (Entry<String, Object> mapEntry : attributes.entrySet()) { sb.append(mapEntry.g...
[ "@", "Override", "public", "void", "renderImage", "(", "String", "imgSource", ",", "Map", "<", "String", ",", "Object", ">", "attributes", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", ...
Render the actual tag @param imgSource Source of the image @param attributes Attributes for the tag. @param writer Writer to render the HTML into. Will NOT be closed or flushed. @throws IOException if an exception occurs
[ "Render", "the", "actual", "tag" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/renderer/image/ImgHTMLRenderer.java#L72-L83
joniles/mpxj
src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java
DatatypeConverter.getLong
public static final long getLong(InputStream is) throws IOException { """ Read a long int from an input stream. @param is input stream @return long value """ byte[] data = new byte[8]; is.read(data); return getLong(data, 0); }
java
public static final long getLong(InputStream is) throws IOException { byte[] data = new byte[8]; is.read(data); return getLong(data, 0); }
[ "public", "static", "final", "long", "getLong", "(", "InputStream", "is", ")", "throws", "IOException", "{", "byte", "[", "]", "data", "=", "new", "byte", "[", "8", "]", ";", "is", ".", "read", "(", "data", ")", ";", "return", "getLong", "(", "data",...
Read a long int from an input stream. @param is input stream @return long value
[ "Read", "a", "long", "int", "from", "an", "input", "stream", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L169-L174
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/upload/SketchHex.java
SketchHex.create
public static SketchHex create(String sketchName, String hexString) throws HexParsingException { """ Initialize a SketchHex object with a string of Intel Hex data. @param sketchName The name of the sketch. @param hexString The Intel Hex data as a string @return The new SketchHex object @throws com.punchthrou...
java
public static SketchHex create(String sketchName, String hexString) throws HexParsingException { if (sketchName.length() > Constants.MAX_SKETCH_NAME_LENGTH) { sketchName = sketchName.substring(0, Constants.MAX_SKETCH_NAME_LENGTH); } List<Line> lines = parseHexStringToLines(hexStrin...
[ "public", "static", "SketchHex", "create", "(", "String", "sketchName", ",", "String", "hexString", ")", "throws", "HexParsingException", "{", "if", "(", "sketchName", ".", "length", "(", ")", ">", "Constants", ".", "MAX_SKETCH_NAME_LENGTH", ")", "{", "sketchNam...
Initialize a SketchHex object with a string of Intel Hex data. @param sketchName The name of the sketch. @param hexString The Intel Hex data as a string @return The new SketchHex object @throws com.punchthrough.bean.sdk.internal.exception.HexParsingException if the string data being parsed is not valid Intel Hex
[ "Initialize", "a", "SketchHex", "object", "with", "a", "string", "of", "Intel", "Hex", "data", "." ]
train
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/upload/SketchHex.java#L56-L65
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java
StreamingEndpointsInner.beginUpdateAsync
public Observable<StreamingEndpointInner> beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { """ Update StreamingEndpoint. Updates a existing StreamingEndpoint. @param resourceGroupName The name of the resource group within the Azur...
java
public Observable<StreamingEndpointInner> beginUpdateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1<ServiceResponse<...
[ "public", "Observable", "<", "StreamingEndpointInner", ">", "beginUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "streamingEndpointName", ",", "StreamingEndpointInner", "parameters", ")", "{", "return", "beginUpdateWithService...
Update StreamingEndpoint. Updates a existing StreamingEndpoint. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param streamingEndpointName The name of the StreamingEndpoint. @param parameters StreamingEndpoint properties neede...
[ "Update", "StreamingEndpoint", ".", "Updates", "a", "existing", "StreamingEndpoint", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java#L876-L883
looly/hutool
hutool-json/src/main/java/cn/hutool/json/JSONUtil.java
JSONUtil.quote
public static Writer quote(String str, Writer writer) throws IOException { """ 对所有双引号做转义处理(使用双反斜杠做转义)<br> 为了能在HTML中较好的显示,会将&lt;/转义为&lt;\/<br> JSON字符串中不能包含控制字符和未经转义的引号和反斜杠 @param str 字符串 @param writer Writer @return Writer @throws IOException IO异常 """ return quote(str, writer, true); }
java
public static Writer quote(String str, Writer writer) throws IOException { return quote(str, writer, true); }
[ "public", "static", "Writer", "quote", "(", "String", "str", ",", "Writer", "writer", ")", "throws", "IOException", "{", "return", "quote", "(", "str", ",", "writer", ",", "true", ")", ";", "}" ]
对所有双引号做转义处理(使用双反斜杠做转义)<br> 为了能在HTML中较好的显示,会将&lt;/转义为&lt;\/<br> JSON字符串中不能包含控制字符和未经转义的引号和反斜杠 @param str 字符串 @param writer Writer @return Writer @throws IOException IO异常
[ "对所有双引号做转义处理(使用双反斜杠做转义)<br", ">", "为了能在HTML中较好的显示,会将&lt", ";", "/", "转义为&lt", ";", "\\", "/", "<br", ">", "JSON字符串中不能包含控制字符和未经转义的引号和反斜杠" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L482-L484
EdwardRaff/JSAT
JSAT/src/jsat/clustering/hierarchical/PriorityHAC.java
PriorityHAC.getClusterDesignations
public List<List<DataPoint>> getClusterDesignations(int clusters) { """ Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters. @param clusters the number of clusters desired @return the list of data points in each cluster, or <tt>null</tt>...
java
public List<List<DataPoint>> getClusterDesignations(int clusters) { if(!hasStoredClustering()) return null; int[] assignments = new int[curDataSet.size()]; return createClusterListFromAssignmentArray(assignments, curDataSet); }
[ "public", "List", "<", "List", "<", "DataPoint", ">", ">", "getClusterDesignations", "(", "int", "clusters", ")", "{", "if", "(", "!", "hasStoredClustering", "(", ")", ")", "return", "null", ";", "int", "[", "]", "assignments", "=", "new", "int", "[", ...
Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters. @param clusters the number of clusters desired @return the list of data points in each cluster, or <tt>null</tt> if no data set has been clustered. @see #hasStoredClustering()
[ "Returns", "the", "assignment", "array", "for", "that", "would", "have", "been", "computed", "for", "the", "previous", "data", "set", "with", "the", "desired", "number", "of", "clusters", "." ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/clustering/hierarchical/PriorityHAC.java#L278-L284
dbracewell/mango
src/main/java/com/davidbracewell/config/Config.java
Config.hasProperty
public static boolean hasProperty(String propertyPrefix, String... propertyComponents) { """ Checks if a property is in the config or or set on the system. The property name is constructed as <code>propertyPrefix + . + propertyComponent[0] + . + propertyComponent[1] + ...</code> @param propertyPrefix The p...
java
public static boolean hasProperty(String propertyPrefix, String... propertyComponents) { String propertyName = propertyPrefix; if (propertyComponents != null && propertyComponents.length > 0) { propertyName += "." + StringUtils.join(propertyComponents, "."); } return getInstance().prope...
[ "public", "static", "boolean", "hasProperty", "(", "String", "propertyPrefix", ",", "String", "...", "propertyComponents", ")", "{", "String", "propertyName", "=", "propertyPrefix", ";", "if", "(", "propertyComponents", "!=", "null", "&&", "propertyComponents", ".",...
Checks if a property is in the config or or set on the system. The property name is constructed as <code>propertyPrefix + . + propertyComponent[0] + . + propertyComponent[1] + ...</code> @param propertyPrefix The prefix @param propertyComponents The components. @return True if the property is known, false if not.
[ "Checks", "if", "a", "property", "is", "in", "the", "config", "or", "or", "set", "on", "the", "system", ".", "The", "property", "name", "is", "constructed", "as", "<code", ">", "propertyPrefix", "+", ".", "+", "propertyComponent", "[", "0", "]", "+", "...
train
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/config/Config.java#L196-L202
blinkfox/zealot
src/main/java/com/blinkfox/zealot/core/ZealotKhala.java
ZealotKhala.orEqual
public ZealotKhala orEqual(String field, Object value) { """ 生成带" OR "前缀等值查询的SQL片段. @param field 数据库字段 @param value 值 @return ZealotKhala实例 """ return this.doNormal(ZealotConst.OR_PREFIX, field, value, ZealotConst.EQUAL_SUFFIX, true); }
java
public ZealotKhala orEqual(String field, Object value) { return this.doNormal(ZealotConst.OR_PREFIX, field, value, ZealotConst.EQUAL_SUFFIX, true); }
[ "public", "ZealotKhala", "orEqual", "(", "String", "field", ",", "Object", "value", ")", "{", "return", "this", ".", "doNormal", "(", "ZealotConst", ".", "OR_PREFIX", ",", "field", ",", "value", ",", "ZealotConst", ".", "EQUAL_SUFFIX", ",", "true", ")", ";...
生成带" OR "前缀等值查询的SQL片段. @param field 数据库字段 @param value 值 @return ZealotKhala实例
[ "生成带", "OR", "前缀等值查询的SQL片段", "." ]
train
https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L564-L566
liferay/com-liferay-commerce
commerce-api/src/main/java/com/liferay/commerce/model/CommerceShippingMethodWrapper.java
CommerceShippingMethodWrapper.getDescription
@Override public String getDescription(String languageId, boolean useDefault) { """ Returns the localized description of this commerce shipping method in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param us...
java
@Override public String getDescription(String languageId, boolean useDefault) { return _commerceShippingMethod.getDescription(languageId, useDefault); }
[ "@", "Override", "public", "String", "getDescription", "(", "String", "languageId", ",", "boolean", "useDefault", ")", "{", "return", "_commerceShippingMethod", ".", "getDescription", "(", "languageId", ",", "useDefault", ")", ";", "}" ]
Returns the localized description of this commerce shipping method in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault whether to use the default language if no localization exists for the requested lang...
[ "Returns", "the", "localized", "description", "of", "this", "commerce", "shipping", "method", "in", "the", "language", "optionally", "using", "the", "default", "language", "if", "no", "localization", "exists", "for", "the", "requested", "language", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/model/CommerceShippingMethodWrapper.java#L272-L275
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.longUnaryOperator
public static LongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator operator, Consumer<Throwable> handler) { """ Wrap a {@link CheckedLongUnaryOperator} in a {@link LongUnaryOperator} with a custom handler for checked exceptions. <p> Example: <code><pre> LongStream.of(1L, 2L, 3L).map(Unchecked.longUnary...
java
public static LongUnaryOperator longUnaryOperator(CheckedLongUnaryOperator operator, Consumer<Throwable> handler) { return t -> { try { return operator.applyAsLong(t); } catch (Throwable e) { handler.accept(e); throw new Illega...
[ "public", "static", "LongUnaryOperator", "longUnaryOperator", "(", "CheckedLongUnaryOperator", "operator", ",", "Consumer", "<", "Throwable", ">", "handler", ")", "{", "return", "t", "->", "{", "try", "{", "return", "operator", ".", "applyAsLong", "(", "t", ")",...
Wrap a {@link CheckedLongUnaryOperator} in a {@link LongUnaryOperator} with a custom handler for checked exceptions. <p> Example: <code><pre> LongStream.of(1L, 2L, 3L).map(Unchecked.longUnaryOperator( l -> { if (l &lt; 0L) throw new Exception("Only positive numbers allowed"); return l; }, e -> { throw new IllegalState...
[ "Wrap", "a", "{", "@link", "CheckedLongUnaryOperator", "}", "in", "a", "{", "@link", "LongUnaryOperator", "}", "with", "a", "custom", "handler", "for", "checked", "exceptions", ".", "<p", ">", "Example", ":", "<code", ">", "<pre", ">", "LongStream", ".", "...
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L2004-L2015