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
networknt/light-4j
resource/src/main/java/com/networknt/resource/ResourceHelpers.java
ResourceHelpers.addProvidersToPathHandler
public static void addProvidersToPathHandler(PathResourceProvider[] pathResourceProviders, PathHandler pathHandler) { """ Helper to add given PathResourceProviders to a PathHandler. @param pathResourceProviders List of instances of classes implementing PathResourceProvider. @param pathHandler The handler that ...
java
public static void addProvidersToPathHandler(PathResourceProvider[] pathResourceProviders, PathHandler pathHandler) { if (pathResourceProviders != null && pathResourceProviders.length > 0) { for (PathResourceProvider pathResourceProvider : pathResourceProviders) { if (pathResourcePro...
[ "public", "static", "void", "addProvidersToPathHandler", "(", "PathResourceProvider", "[", "]", "pathResourceProviders", ",", "PathHandler", "pathHandler", ")", "{", "if", "(", "pathResourceProviders", "!=", "null", "&&", "pathResourceProviders", ".", "length", ">", "...
Helper to add given PathResourceProviders to a PathHandler. @param pathResourceProviders List of instances of classes implementing PathResourceProvider. @param pathHandler The handler that will have these handlers added to it.
[ "Helper", "to", "add", "given", "PathResourceProviders", "to", "a", "PathHandler", "." ]
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/resource/src/main/java/com/networknt/resource/ResourceHelpers.java#L38-L48
avianey/facebook-api-android-maven
facebook/src/main/java/com/facebook/NativeAppCallAttachmentStore.java
NativeAppCallAttachmentStore.cleanupAttachmentsForCall
public void cleanupAttachmentsForCall(Context context, UUID callId) { """ Removes any temporary files associated with a particular native app call. @param context the Context the call is being made from @param callId the unique ID of the call """ File dir = getAttachmentsDirectoryForCall(callId, fa...
java
public void cleanupAttachmentsForCall(Context context, UUID callId) { File dir = getAttachmentsDirectoryForCall(callId, false); Utility.deleteDirectory(dir); }
[ "public", "void", "cleanupAttachmentsForCall", "(", "Context", "context", ",", "UUID", "callId", ")", "{", "File", "dir", "=", "getAttachmentsDirectoryForCall", "(", "callId", ",", "false", ")", ";", "Utility", ".", "deleteDirectory", "(", "dir", ")", ";", "}"...
Removes any temporary files associated with a particular native app call. @param context the Context the call is being made from @param callId the unique ID of the call
[ "Removes", "any", "temporary", "files", "associated", "with", "a", "particular", "native", "app", "call", "." ]
train
https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/NativeAppCallAttachmentStore.java#L164-L167
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java
JsApiMessageImpl.getJmsUserPropertyMap
final JsMsgMap getJmsUserPropertyMap() { """ Helper method used by the main Message Property methods to obtain the JMS-valid Property items in the form of a map. <p> The method has package level visibility as it is used by JsJmsMessageImpl and JsSdoMessageimpl. @return A JsMsgMap containing the Message Prop...
java
final JsMsgMap getJmsUserPropertyMap() { if (jmsUserPropertyMap == null) { List<String> keys = (List<String>) getApi().getField(JsApiAccess.JMSPROPERTY_NAME); List<Object> values = (List<Object>) getApi().getField(JsApiAccess.JMSPROPERTY_VALUE); jmsUserPropertyMap = new JsMsg...
[ "final", "JsMsgMap", "getJmsUserPropertyMap", "(", ")", "{", "if", "(", "jmsUserPropertyMap", "==", "null", ")", "{", "List", "<", "String", ">", "keys", "=", "(", "List", "<", "String", ">", ")", "getApi", "(", ")", ".", "getField", "(", "JsApiAccess", ...
Helper method used by the main Message Property methods to obtain the JMS-valid Property items in the form of a map. <p> The method has package level visibility as it is used by JsJmsMessageImpl and JsSdoMessageimpl. @return A JsMsgMap containing the Message Property name-value pairs.
[ "Helper", "method", "used", "by", "the", "main", "Message", "Property", "methods", "to", "obtain", "the", "JMS", "-", "valid", "Property", "items", "in", "the", "form", "of", "a", "map", ".", "<p", ">", "The", "method", "has", "package", "level", "visibi...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiMessageImpl.java#L815-L822
lightbend/config
config/src/main/java/com/typesafe/config/ConfigFactory.java
ConfigFactory.parseResourcesAnySyntax
public static Config parseResourcesAnySyntax(ClassLoader loader, String resourceBasename) { """ Like {@link #parseResourcesAnySyntax(ClassLoader,String,ConfigParseOptions)} but always uses default parse options. @param loader will be used to load resources @param resourceBasename a resource name as in {@li...
java
public static Config parseResourcesAnySyntax(ClassLoader loader, String resourceBasename) { return parseResourcesAnySyntax(loader, resourceBasename, ConfigParseOptions.defaults()); }
[ "public", "static", "Config", "parseResourcesAnySyntax", "(", "ClassLoader", "loader", ",", "String", "resourceBasename", ")", "{", "return", "parseResourcesAnySyntax", "(", "loader", ",", "resourceBasename", ",", "ConfigParseOptions", ".", "defaults", "(", ")", ")", ...
Like {@link #parseResourcesAnySyntax(ClassLoader,String,ConfigParseOptions)} but always uses default parse options. @param loader will be used to load resources @param resourceBasename a resource name as in {@link java.lang.ClassLoader#getResource}, with or without extension @return the parsed configuration
[ "Like", "{", "@link", "#parseResourcesAnySyntax", "(", "ClassLoader", "String", "ConfigParseOptions", ")", "}", "but", "always", "uses", "default", "parse", "options", "." ]
train
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigFactory.java#L993-L995
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java
LoadJobConfiguration.of
public static LoadJobConfiguration of(TableId destinationTable, String sourceUri) { """ Returns a BigQuery Load Job Configuration for the given destination table and source URI. """ return of(destinationTable, ImmutableList.of(sourceUri)); }
java
public static LoadJobConfiguration of(TableId destinationTable, String sourceUri) { return of(destinationTable, ImmutableList.of(sourceUri)); }
[ "public", "static", "LoadJobConfiguration", "of", "(", "TableId", "destinationTable", ",", "String", "sourceUri", ")", "{", "return", "of", "(", "destinationTable", ",", "ImmutableList", ".", "of", "(", "sourceUri", ")", ")", ";", "}" ]
Returns a BigQuery Load Job Configuration for the given destination table and source URI.
[ "Returns", "a", "BigQuery", "Load", "Job", "Configuration", "for", "the", "given", "destination", "table", "and", "source", "URI", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L537-L539
openskynetwork/java-adsb
src/main/java/org/opensky/libadsb/PositionDecoder.java
PositionDecoder.decodePosition
public Position decodePosition(SurfacePositionV0Msg msg, Position reference) { """ Shortcut for live decoding; no reasonableness check on distance to receiver @param reference used for reasonableness test and to decide which of the four resulting positions of the CPR algorithm is the right one @param msg airborn...
java
public Position decodePosition(SurfacePositionV0Msg msg, Position reference) { return decodePosition(System.currentTimeMillis()/1000.0, msg, reference); }
[ "public", "Position", "decodePosition", "(", "SurfacePositionV0Msg", "msg", ",", "Position", "reference", ")", "{", "return", "decodePosition", "(", "System", ".", "currentTimeMillis", "(", ")", "/", "1000.0", ",", "msg", ",", "reference", ")", ";", "}" ]
Shortcut for live decoding; no reasonableness check on distance to receiver @param reference used for reasonableness test and to decide which of the four resulting positions of the CPR algorithm is the right one @param msg airborne position message @return WGS84 coordinates with latitude and longitude in dec degrees, a...
[ "Shortcut", "for", "live", "decoding", ";", "no", "reasonableness", "check", "on", "distance", "to", "receiver" ]
train
https://github.com/openskynetwork/java-adsb/blob/01d497d3e74ad10063ab443ab583e9c8653a8b8d/src/main/java/org/opensky/libadsb/PositionDecoder.java#L461-L463
googleapis/google-cloud-java
google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java
SecurityCenterClient.createFinding
public final Finding createFinding(SourceName parent, String findingId, Finding finding) { """ Creates a finding. The corresponding source must exist for finding creation to succeed. <p>Sample code: <pre><code> try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName par...
java
public final Finding createFinding(SourceName parent, String findingId, Finding finding) { CreateFindingRequest request = CreateFindingRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setFindingId(findingId) .setFinding(finding) .bu...
[ "public", "final", "Finding", "createFinding", "(", "SourceName", "parent", ",", "String", "findingId", ",", "Finding", "finding", ")", "{", "CreateFindingRequest", "request", "=", "CreateFindingRequest", ".", "newBuilder", "(", ")", ".", "setParent", "(", "parent...
Creates a finding. The corresponding source must exist for finding creation to succeed. <p>Sample code: <pre><code> try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); String findingId = ""; Finding finding = Finding.newBui...
[ "Creates", "a", "finding", ".", "The", "corresponding", "source", "must", "exist", "for", "finding", "creation", "to", "succeed", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L311-L320
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.updateProjectMember
public GitlabProjectMember updateProjectMember(Integer projectId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { """ Updates a project member. @param projectId the project id @param userId the user id @param accessLevel the updated access level for the specified user @return GitLa...
java
public GitlabProjectMember updateProjectMember(Integer projectId, Integer userId, GitlabAccessLevel accessLevel) throws IOException { return updateProjectMember(projectId, userId, accessLevel, null); }
[ "public", "GitlabProjectMember", "updateProjectMember", "(", "Integer", "projectId", ",", "Integer", "userId", ",", "GitlabAccessLevel", "accessLevel", ")", "throws", "IOException", "{", "return", "updateProjectMember", "(", "projectId", ",", "userId", ",", "accessLevel...
Updates a project member. @param projectId the project id @param userId the user id @param accessLevel the updated access level for the specified user @return GitLabProjectMember with updated access level on success @throws IOException on Gitlab API call error
[ "Updates", "a", "project", "member", "." ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3082-L3084
alkacon/opencms-core
src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java
CmsDefaultXmlContentHandler.initValidationRules
protected void initValidationRules(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException { """ Initializes the validation rules this content handler.<p> OpenCms always performs XML schema validation for all XML contents. However, for most projects in the real world a more fine-grained...
java
protected void initValidationRules(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException { List<Element> elements = new ArrayList<Element>(CmsXmlGenericWrapper.elements(root, APPINFO_RULE)); elements.addAll(CmsXmlGenericWrapper.elements(root, APPINFO_VALIDATIONRULE)); ...
[ "protected", "void", "initValidationRules", "(", "Element", "root", ",", "CmsXmlContentDefinition", "contentDefinition", ")", "throws", "CmsXmlException", "{", "List", "<", "Element", ">", "elements", "=", "new", "ArrayList", "<", "Element", ">", "(", "CmsXmlGeneric...
Initializes the validation rules this content handler.<p> OpenCms always performs XML schema validation for all XML contents. However, for most projects in the real world a more fine-grained control over the validation process is required. For these cases, individual validation rules can be defined for the appinfo nod...
[ "Initializes", "the", "validation", "rules", "this", "content", "handler", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L3194-L3219
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java
IntegrationAccountsInner.getCallbackUrl
public CallbackUrlInner getCallbackUrl(String resourceGroupName, String integrationAccountName, GetCallbackUrlParameters parameters) { """ Gets the integration account callback URL. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @param parameters ...
java
public CallbackUrlInner getCallbackUrl(String resourceGroupName, String integrationAccountName, GetCallbackUrlParameters parameters) { return getCallbackUrlWithServiceResponseAsync(resourceGroupName, integrationAccountName, parameters).toBlocking().single().body(); }
[ "public", "CallbackUrlInner", "getCallbackUrl", "(", "String", "resourceGroupName", ",", "String", "integrationAccountName", ",", "GetCallbackUrlParameters", "parameters", ")", "{", "return", "getCallbackUrlWithServiceResponseAsync", "(", "resourceGroupName", ",", "integrationA...
Gets the integration account callback URL. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @param parameters The callback URL parameters. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request ...
[ "Gets", "the", "integration", "account", "callback", "URL", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java#L938-L940
Esri/geometry-api-java
src/main/java/com/esri/core/geometry/MultiVertexGeometryImpl.java
MultiVertexGeometryImpl.setAttributeStreamRef
public void setAttributeStreamRef(int semantics, AttributeStreamBase stream) { """ Sets a reference to the given AttributeStream of the Geometry. Once the buffer has been obtained, the vertices of the Geometry can be manipulated directly. The AttributeStream parameters are not checked for the size. <br> If the ...
java
public void setAttributeStreamRef(int semantics, AttributeStreamBase stream) { // int test1 = VertexDescription.getPersistence(semantics); // int test2 = stream.getPersistence(); if ((stream != null) && VertexDescription.getPersistence(semantics) != stream .getPersistence())// input stream has wrong pe...
[ "public", "void", "setAttributeStreamRef", "(", "int", "semantics", ",", "AttributeStreamBase", "stream", ")", "{", "// int test1 = VertexDescription.getPersistence(semantics);", "// int test2 = stream.getPersistence();", "if", "(", "(", "stream", "!=", "null", ")", "&&", "...
Sets a reference to the given AttributeStream of the Geometry. Once the buffer has been obtained, the vertices of the Geometry can be manipulated directly. The AttributeStream parameters are not checked for the size. <br> If the attribute is missing, it will be added. <br> Note, that this method does not change the ver...
[ "Sets", "a", "reference", "to", "the", "given", "AttributeStream", "of", "the", "Geometry", ".", "Once", "the", "buffer", "has", "been", "obtained", "the", "vertices", "of", "the", "Geometry", "can", "be", "manipulated", "directly", ".", "The", "AttributeStrea...
train
https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiVertexGeometryImpl.java#L404-L423
wuman/orientdb-android
core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java
OMMapManagerNew.mapNew
private OMMapBufferEntry mapNew(final OFileMMap file, final long beginOffset) throws IOException { """ This method maps new part of file if not all file content is mapped. @param file that will be mapped. @param beginOffset position in file from what mapping should be applied. @return mapped entry. @throws...
java
private OMMapBufferEntry mapNew(final OFileMMap file, final long beginOffset) throws IOException { return new OMMapBufferEntry(file, file.map(beginOffset, file.getFileSize() - (int) beginOffset), beginOffset, file.getFileSize() - (int) beginOffset); }
[ "private", "OMMapBufferEntry", "mapNew", "(", "final", "OFileMMap", "file", ",", "final", "long", "beginOffset", ")", "throws", "IOException", "{", "return", "new", "OMMapBufferEntry", "(", "file", ",", "file", ".", "map", "(", "beginOffset", ",", "file", ".",...
This method maps new part of file if not all file content is mapped. @param file that will be mapped. @param beginOffset position in file from what mapping should be applied. @return mapped entry. @throws IOException is thrown if mapping is unsuccessfully.
[ "This", "method", "maps", "new", "part", "of", "file", "if", "not", "all", "file", "content", "is", "mapped", "." ]
train
https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerNew.java#L328-L331
dvasilen/Hive-XML-SerDe
src/main/java/com/ibm/spss/hive/serde2/xml/processor/java/JavaXmlProcessor.java
JavaXmlProcessor.populateMap
@SuppressWarnings( { """ Given the node populates the map @param map the map @param node the node """"unchecked", "rawtypes"}) private void populateMap(Map map, Node node) { Map.Entry entry = getMapEntry(node); if (entry != null) { map.put(entry.getKey(), entry.getValue())...
java
@SuppressWarnings({"unchecked", "rawtypes"}) private void populateMap(Map map, Node node) { Map.Entry entry = getMapEntry(node); if (entry != null) { map.put(entry.getKey(), entry.getValue()); } }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "private", "void", "populateMap", "(", "Map", "map", ",", "Node", "node", ")", "{", "Map", ".", "Entry", "entry", "=", "getMapEntry", "(", "node", ")", ";", "if", "(", "...
Given the node populates the map @param map the map @param node the node
[ "Given", "the", "node", "populates", "the", "map" ]
train
https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/java/JavaXmlProcessor.java#L385-L391
Wolfgang-Schuetzelhofer/jcypher
src/main/java/iot/jcypher/query/values/JcValue.java
JcValue.asNumber
public JcNumber asNumber() { """ <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div> <div color='red' style="font-size:18px;color:red"><i>return the receiver as a JcNumber</i></div> <br/> """ JcNumber ret = new JcNumber(null, this, null); QueryRecorder.recordInvocationCon...
java
public JcNumber asNumber() { JcNumber ret = new JcNumber(null, this, null); QueryRecorder.recordInvocationConditional(this, "asNumber", ret); return ret; }
[ "public", "JcNumber", "asNumber", "(", ")", "{", "JcNumber", "ret", "=", "new", "JcNumber", "(", "null", ",", "this", ",", "null", ")", ";", "QueryRecorder", ".", "recordInvocationConditional", "(", "this", ",", "\"asNumber\"", ",", "ret", ")", ";", "retur...
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div> <div color='red' style="font-size:18px;color:red"><i>return the receiver as a JcNumber</i></div> <br/>
[ "<div", "color", "=", "red", "style", "=", "font", "-", "size", ":", "24px", ";", "color", ":", "red", ">", "<b", ">", "<i", ">", "<u", ">", "JCYPHER<", "/", "u", ">", "<", "/", "i", ">", "<", "/", "b", ">", "<", "/", "div", ">", "<div", ...
train
https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcValue.java#L59-L63
jtrfp/javamod
src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java
ID3v2Tag.setTextFrame
public void setTextFrame(String id, String data) { """ Set the data contained in a text frame. This includes all frames with an id that starts with 'T' but excludes "TXXX". If an improper id is passed, then nothing will happen. @param id the id of the frame to set the data for @param data the data for the ...
java
public void setTextFrame(String id, String data) { if ((id.charAt(0) == 'T') && !id.equals(ID3v2Frames.USER_DEFINED_TEXT_INFO)) { try { byte[] b = new byte[data.length() + 1]; b[0] = 0; System.arraycopy(data.getBytes(ENC_TYPE), 0, b, 1, data.length()); updateFrameData(id, b); } catch ...
[ "public", "void", "setTextFrame", "(", "String", "id", ",", "String", "data", ")", "{", "if", "(", "(", "id", ".", "charAt", "(", "0", ")", "==", "'", "'", ")", "&&", "!", "id", ".", "equals", "(", "ID3v2Frames", ".", "USER_DEFINED_TEXT_INFO", ")", ...
Set the data contained in a text frame. This includes all frames with an id that starts with 'T' but excludes "TXXX". If an improper id is passed, then nothing will happen. @param id the id of the frame to set the data for @param data the data for the frame
[ "Set", "the", "data", "contained", "in", "a", "text", "frame", ".", "This", "includes", "all", "frames", "with", "an", "id", "that", "starts", "with", "T", "but", "excludes", "TXXX", ".", "If", "an", "improper", "id", "is", "passed", "then", "nothing", ...
train
https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L299-L317
VoltDB/voltdb
third_party/java/src/org/HdrHistogram_voltpatches/SynchronizedHistogram.java
SynchronizedHistogram.decodeFromCompressedByteBuffer
public static SynchronizedHistogram decodeFromCompressedByteBuffer(final ByteBuffer buffer, final long minBarForHighestTrackableValue) throws DataFormatException { """ Construct a new histogram by decoding it from a compressed form in a ByteBuf...
java
public static SynchronizedHistogram decodeFromCompressedByteBuffer(final ByteBuffer buffer, final long minBarForHighestTrackableValue) throws DataFormatException { return decodeFromCompressedByteBuffer(buffer, SynchronizedHistogram.class, mi...
[ "public", "static", "SynchronizedHistogram", "decodeFromCompressedByteBuffer", "(", "final", "ByteBuffer", "buffer", ",", "final", "long", "minBarForHighestTrackableValue", ")", "throws", "DataFormatException", "{", "return", "decodeFromCompressedByteBuffer", "(", "buffer", "...
Construct a new histogram by decoding it from a compressed form in a ByteBuffer. @param buffer The buffer to decode from @param minBarForHighestTrackableValue Force highestTrackableValue to be set at least this high @return The newly constructed histogram @throws DataFormatException on error parsing/decompressing the b...
[ "Construct", "a", "new", "histogram", "by", "decoding", "it", "from", "a", "compressed", "form", "in", "a", "ByteBuffer", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/SynchronizedHistogram.java#L115-L118
SeaCloudsEU/SeaCloudsPlatform
discoverer/src/main/java/eu/seaclouds/platform/discoverer/core/OfferingManager.java
OfferingManager.getOffering
public Offering getOffering(String offeringName) { """ Get an offering @param offeringName the name of the offering @return the offering identified by offeringId """ BasicDBObject query = new BasicDBObject("offering_name", offeringName); FindIterable<Document> cursor = this.offeringsCollect...
java
public Offering getOffering(String offeringName) { BasicDBObject query = new BasicDBObject("offering_name", offeringName); FindIterable<Document> cursor = this.offeringsCollection.find(query); return Offering.fromDB(cursor.first()); }
[ "public", "Offering", "getOffering", "(", "String", "offeringName", ")", "{", "BasicDBObject", "query", "=", "new", "BasicDBObject", "(", "\"offering_name\"", ",", "offeringName", ")", ";", "FindIterable", "<", "Document", ">", "cursor", "=", "this", ".", "offer...
Get an offering @param offeringName the name of the offering @return the offering identified by offeringId
[ "Get", "an", "offering" ]
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/discoverer/src/main/java/eu/seaclouds/platform/discoverer/core/OfferingManager.java#L53-L58
jenkinsci/jenkins
core/src/main/java/hudson/util/ClasspathBuilder.java
ClasspathBuilder.addAll
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException { """ Adds all the files that matches the given glob in the directory. @see FilePath#list(String) """ for(FilePath item : base.list(glob)) add(item); return this; } /** ...
java
public ClasspathBuilder addAll(FilePath base, String glob) throws IOException, InterruptedException { for(FilePath item : base.list(glob)) add(item); return this; } /** * Returns the string representation of the classpath. */ @Override public String toString() { ...
[ "public", "ClasspathBuilder", "addAll", "(", "FilePath", "base", ",", "String", "glob", ")", "throws", "IOException", ",", "InterruptedException", "{", "for", "(", "FilePath", "item", ":", "base", ".", "list", "(", "glob", ")", ")", "add", "(", "item", ")"...
Adds all the files that matches the given glob in the directory. @see FilePath#list(String)
[ "Adds", "all", "the", "files", "that", "matches", "the", "given", "glob", "in", "the", "directory", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ClasspathBuilder.java#L57-L70
nextreports/nextreports-server
src/ro/nextreports/server/pivot/DefaultPivotModel.java
DefaultPivotModel.acceptValue
private boolean acceptValue(int row, Map<Integer, Object> filter) { """ /* @SuppressWarnings("unchecked") private Set<Object> getUniqueValues2(PivotField field, Map<Integer, Object> filter) { return new TreeSet<Object>((List<Object>) getValues2(field, filter).get(filter)); } """ boolean accept = true; ...
java
private boolean acceptValue(int row, Map<Integer, Object> filter) { boolean accept = true; Set<Integer> keys = filter.keySet(); for (int index : keys) { if (!filter.get(index).equals(dataSource.getValueAt(row, fields.get(index)))) { // System.out.println(" + " + filter.get(j)); // System.out.println(" ...
[ "private", "boolean", "acceptValue", "(", "int", "row", ",", "Map", "<", "Integer", ",", "Object", ">", "filter", ")", "{", "boolean", "accept", "=", "true", ";", "Set", "<", "Integer", ">", "keys", "=", "filter", ".", "keySet", "(", ")", ";", "for",...
/* @SuppressWarnings("unchecked") private Set<Object> getUniqueValues2(PivotField field, Map<Integer, Object> filter) { return new TreeSet<Object>((List<Object>) getValues2(field, filter).get(filter)); }
[ "/", "*" ]
train
https://github.com/nextreports/nextreports-server/blob/cfce12f5c6d52cb6a739388d50142c6e2e07c55e/src/ro/nextreports/server/pivot/DefaultPivotModel.java#L387-L400
line/armeria
core/src/main/java/com/linecorp/armeria/common/util/InetAddressPredicates.java
InetAddressPredicates.ofCidr
public static Predicate<InetAddress> ofCidr(String cidr) { """ Returns a {@link Predicate} which returns {@code true} if the given {@link InetAddress} is in the range of a <a href="https://tools.ietf.org/html/rfc4632">Classless Inter-domain Routing (CIDR)</a> block. @param cidr the CIDR notation of an address ...
java
public static Predicate<InetAddress> ofCidr(String cidr) { requireNonNull(cidr, "cidr"); final int delim = cidr.indexOf('/'); checkArgument(delim >= 0, "Invalid CIDR notation: %s", cidr); final InetAddress baseAddress; try { baseAddress = InetAddress.getByName(cidr....
[ "public", "static", "Predicate", "<", "InetAddress", ">", "ofCidr", "(", "String", "cidr", ")", "{", "requireNonNull", "(", "cidr", ",", "\"cidr\"", ")", ";", "final", "int", "delim", "=", "cidr", ".", "indexOf", "(", "'", "'", ")", ";", "checkArgument",...
Returns a {@link Predicate} which returns {@code true} if the given {@link InetAddress} is in the range of a <a href="https://tools.ietf.org/html/rfc4632">Classless Inter-domain Routing (CIDR)</a> block. @param cidr the CIDR notation of an address block, e.g. {@code 10.0.0.0/8}, {@code 192.168.1.0/24}, {@code 1080:0:0...
[ "Returns", "a", "{", "@link", "Predicate", "}", "which", "returns", "{", "@code", "true", "}", "if", "the", "given", "{", "@link", "InetAddress", "}", "is", "in", "the", "range", "of", "a", "<a", "href", "=", "https", ":", "//", "tools", ".", "ietf",...
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/InetAddressPredicates.java#L130-L159
CenturyLinkCloud/mdw
mdw-hub/src/com/centurylink/mdw/hub/servlet/SoapServlet.java
SoapServlet.createSoapFaultResponse
protected String createSoapFaultResponse(String code, String message) throws SOAPException, TransformerException { """ Original API (Defaults to using MessageFactory.newInstance(), i.e. SOAP 1.1) @param code @param message @return Soap fault as string @throws SOAPException @throws TransformerEx...
java
protected String createSoapFaultResponse(String code, String message) throws SOAPException, TransformerException { return createSoapFaultResponse(SOAPConstants.SOAP_1_1_PROTOCOL, code, message); }
[ "protected", "String", "createSoapFaultResponse", "(", "String", "code", ",", "String", "message", ")", "throws", "SOAPException", ",", "TransformerException", "{", "return", "createSoapFaultResponse", "(", "SOAPConstants", ".", "SOAP_1_1_PROTOCOL", ",", "code", ",", ...
Original API (Defaults to using MessageFactory.newInstance(), i.e. SOAP 1.1) @param code @param message @return Soap fault as string @throws SOAPException @throws TransformerException
[ "Original", "API", "(", "Defaults", "to", "using", "MessageFactory", ".", "newInstance", "()", "i", ".", "e", ".", "SOAP", "1", ".", "1", ")" ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-hub/src/com/centurylink/mdw/hub/servlet/SoapServlet.java#L391-L394
kohsuke/com4j
runtime/src/main/java/com4j/COM4J.java
COM4J.createInstance
public static<T extends Com4jObject> T createInstance( Class<T> primaryInterface, String clsid ) throws ComException { """ Creates a new COM object of the given CLSID and returns it in a wrapped interface. @param primaryInterface The created COM object is returned as this interface. Must be non-null. Pass...
java
public static<T extends Com4jObject> T createInstance( Class<T> primaryInterface, String clsid ) throws ComException { // create instance return createInstance(primaryInterface,clsid,CLSCTX.ALL); }
[ "public", "static", "<", "T", "extends", "Com4jObject", ">", "T", "createInstance", "(", "Class", "<", "T", ">", "primaryInterface", ",", "String", "clsid", ")", "throws", "ComException", "{", "// create instance", "return", "createInstance", "(", "primaryInterfac...
Creates a new COM object of the given CLSID and returns it in a wrapped interface. @param primaryInterface The created COM object is returned as this interface. Must be non-null. Passing in {@link Com4jObject} allows the caller to create a new instance without knowing its primary interface. @param clsid The CLSID of t...
[ "Creates", "a", "new", "COM", "object", "of", "the", "given", "CLSID", "and", "returns", "it", "in", "a", "wrapped", "interface", "." ]
train
https://github.com/kohsuke/com4j/blob/1e690b805fb0e4e9ef61560e20a56335aecb0b24/runtime/src/main/java/com4j/COM4J.java#L70-L75
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java
GeneratedDUserDaoImpl.queryByState
public Iterable<DUser> queryByState(java.lang.Integer state) { """ query-by method for field state @param state the specified attribute @return an Iterable of DUsers for the specified state """ return queryByField(null, DUserMapper.Field.STATE.getFieldName(), state); }
java
public Iterable<DUser> queryByState(java.lang.Integer state) { return queryByField(null, DUserMapper.Field.STATE.getFieldName(), state); }
[ "public", "Iterable", "<", "DUser", ">", "queryByState", "(", "java", ".", "lang", ".", "Integer", "state", ")", "{", "return", "queryByField", "(", "null", ",", "DUserMapper", ".", "Field", ".", "STATE", ".", "getFieldName", "(", ")", ",", "state", ")",...
query-by method for field state @param state the specified attribute @return an Iterable of DUsers for the specified state
[ "query", "-", "by", "method", "for", "field", "state" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L232-L234
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/crf/FactorTable.java
FactorTable.conditionalLogProbGivenPrevious
public double conditionalLogProbGivenPrevious(int[] given, int of) { """ Computes the probability of the tag OF being at the end of the table given that the previous tag sequence in table is GIVEN. given is at the beginning, of is at the end. @return the probability of the tag OF being at the end of the table...
java
public double conditionalLogProbGivenPrevious(int[] given, int of) { if (given.length != windowSize - 1) { throw new IllegalArgumentException("conditionalLogProbGivenPrevious requires given one less than clique size (" + windowSize + ") but was " + Arrays.toString(given)); } // Note...
[ "public", "double", "conditionalLogProbGivenPrevious", "(", "int", "[", "]", "given", ",", "int", "of", ")", "{", "if", "(", "given", ".", "length", "!=", "windowSize", "-", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"conditionalLogProbG...
Computes the probability of the tag OF being at the end of the table given that the previous tag sequence in table is GIVEN. given is at the beginning, of is at the end. @return the probability of the tag OF being at the end of the table
[ "Computes", "the", "probability", "of", "the", "tag", "OF", "being", "at", "the", "end", "of", "the", "table", "given", "that", "the", "previous", "tag", "sequence", "in", "table", "is", "GIVEN", ".", "given", "is", "at", "the", "beginning", "of", "is", ...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/FactorTable.java#L213-L232
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java
HttpRequestFactory.buildPostRequest
public HttpRequest buildPostRequest(GenericUrl url, HttpContent content) throws IOException { """ Builds a {@code POST} request for the given URL and content. @param url HTTP request URL or {@code null} for none @param content HTTP request content or {@code null} for none @return new HTTP request """ ...
java
public HttpRequest buildPostRequest(GenericUrl url, HttpContent content) throws IOException { return buildRequest(HttpMethods.POST, url, content); }
[ "public", "HttpRequest", "buildPostRequest", "(", "GenericUrl", "url", ",", "HttpContent", "content", ")", "throws", "IOException", "{", "return", "buildRequest", "(", "HttpMethods", ".", "POST", ",", "url", ",", "content", ")", ";", "}" ]
Builds a {@code POST} request for the given URL and content. @param url HTTP request URL or {@code null} for none @param content HTTP request content or {@code null} for none @return new HTTP request
[ "Builds", "a", "{", "@code", "POST", "}", "request", "for", "the", "given", "URL", "and", "content", "." ]
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java#L127-L129
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java
ValueMap.withMap
public ValueMap withMap(String key, Map<String, ?> val) { """ Sets the value of the specified key in the current ValueMap to the given value. """ super.put(key, val); return this; }
java
public ValueMap withMap(String key, Map<String, ?> val) { super.put(key, val); return this; }
[ "public", "ValueMap", "withMap", "(", "String", "key", ",", "Map", "<", "String", ",", "?", ">", "val", ")", "{", "super", ".", "put", "(", "key", ",", "val", ")", ";", "return", "this", ";", "}" ]
Sets the value of the specified key in the current ValueMap to the given value.
[ "Sets", "the", "value", "of", "the", "specified", "key", "in", "the", "current", "ValueMap", "to", "the", "given", "value", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java#L177-L180
knowm/XChange
xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java
CexIOAdapters.adaptTrades
public static Trades adaptTrades(CexIOTrade[] cexioTrades, CurrencyPair currencyPair) { """ Adapts a CexIOTrade[] to a Trades Object @param cexioTrades The CexIO trade data returned by API @param currencyPair trade currencies @return The trades """ List<Trade> tradesList = new ArrayList<>(); long...
java
public static Trades adaptTrades(CexIOTrade[] cexioTrades, CurrencyPair currencyPair) { List<Trade> tradesList = new ArrayList<>(); long lastTradeId = 0; for (CexIOTrade trade : cexioTrades) { long tradeId = trade.getTid(); if (tradeId > lastTradeId) { lastTradeId = tradeId; } ...
[ "public", "static", "Trades", "adaptTrades", "(", "CexIOTrade", "[", "]", "cexioTrades", ",", "CurrencyPair", "currencyPair", ")", "{", "List", "<", "Trade", ">", "tradesList", "=", "new", "ArrayList", "<>", "(", ")", ";", "long", "lastTradeId", "=", "0", ...
Adapts a CexIOTrade[] to a Trades Object @param cexioTrades The CexIO trade data returned by API @param currencyPair trade currencies @return The trades
[ "Adapts", "a", "CexIOTrade", "[]", "to", "a", "Trades", "Object" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java#L62-L75
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java
FastDateFormat.getDateInstance
public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone, final Locale locale) { """ 获得 {@link FastDateFormat} 实例<br> 支持缓存 @param style date style: FULL, LONG, MEDIUM, or SHORT @param timeZone 时区{@link TimeZone} @param locale {@link Locale} 日期地理位置 @return 本地化 {@link FastDateForm...
java
public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone, final Locale locale) { return cache.getDateInstance(style, timeZone, locale); }
[ "public", "static", "FastDateFormat", "getDateInstance", "(", "final", "int", "style", ",", "final", "TimeZone", "timeZone", ",", "final", "Locale", "locale", ")", "{", "return", "cache", ".", "getDateInstance", "(", "style", ",", "timeZone", ",", "locale", ")...
获得 {@link FastDateFormat} 实例<br> 支持缓存 @param style date style: FULL, LONG, MEDIUM, or SHORT @param timeZone 时区{@link TimeZone} @param locale {@link Locale} 日期地理位置 @return 本地化 {@link FastDateFormat}
[ "获得", "{", "@link", "FastDateFormat", "}", "实例<br", ">", "支持缓存" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java#L158-L160
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/QuickSelect.java
QuickSelect.bestPivot
private static final int bestPivot(int rank, int m1, int m2, int m3, int m4, int m5) { """ Choose the best pivot for the given rank. @param rank Rank @param m1 Pivot candidate @param m2 Pivot candidate @param m3 Pivot candidate @param m4 Pivot candidate @param m5 Pivot candidate @return Best pivot candida...
java
private static final int bestPivot(int rank, int m1, int m2, int m3, int m4, int m5) { if(rank < m1) { return m1; } if(rank > m5) { return m5; } if(rank < m2) { return m2; } if(rank > m4) { return m4; } return m3; }
[ "private", "static", "final", "int", "bestPivot", "(", "int", "rank", ",", "int", "m1", ",", "int", "m2", ",", "int", "m3", ",", "int", "m4", ",", "int", "m5", ")", "{", "if", "(", "rank", "<", "m1", ")", "{", "return", "m1", ";", "}", "if", ...
Choose the best pivot for the given rank. @param rank Rank @param m1 Pivot candidate @param m2 Pivot candidate @param m3 Pivot candidate @param m4 Pivot candidate @param m5 Pivot candidate @return Best pivot candidate
[ "Choose", "the", "best", "pivot", "for", "the", "given", "rank", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/QuickSelect.java#L69-L83
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/convert/encode/MaskConverter.java
MaskConverter.setString
public int setString(String strValue, boolean bDisplayOption, int iMoveMode) { """ Convert and move string to this field. @param strString the state to set the data to. @param bDisplayOption Display the data on the screen if true. @param iMoveMode INIT, SCREEN, or READ move mode. @return The error code (or NOR...
java
public int setString(String strValue, boolean bDisplayOption, int iMoveMode) { if ((strValue == null) || (strValue.length() == 0)) return super.setString(strValue, bDisplayOption, iMoveMode); // Don't trip change or display if (strValue.charAt(0) == FILLER) return DBConstant...
[ "public", "int", "setString", "(", "String", "strValue", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "if", "(", "(", "strValue", "==", "null", ")", "||", "(", "strValue", ".", "length", "(", ")", "==", "0", ")", ")", "return", ...
Convert and move string to this field. @param strString the state to set the data to. @param bDisplayOption Display the data on the screen if true. @param iMoveMode INIT, SCREEN, or READ move mode. @return The error code (or NORMAL_RETURN).
[ "Convert", "and", "move", "string", "to", "this", "field", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/encode/MaskConverter.java#L83-L90
sarl/sarl
main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/markdown/MarkdownParser.java
MarkdownParser.setOutlineDepthRange
public void setOutlineDepthRange(IntegerRange level) { """ Change the level at which the titles may appear in the outline. @param level the level, at least 1. """ if (level == null) { this.outlineDepthRange = new IntegerRange(DEFAULT_OUTLINE_TOP_LEVEL, DEFAULT_OUTLINE_TOP_LEVEL); } else { this.out...
java
public void setOutlineDepthRange(IntegerRange level) { if (level == null) { this.outlineDepthRange = new IntegerRange(DEFAULT_OUTLINE_TOP_LEVEL, DEFAULT_OUTLINE_TOP_LEVEL); } else { this.outlineDepthRange = level; } }
[ "public", "void", "setOutlineDepthRange", "(", "IntegerRange", "level", ")", "{", "if", "(", "level", "==", "null", ")", "{", "this", ".", "outlineDepthRange", "=", "new", "IntegerRange", "(", "DEFAULT_OUTLINE_TOP_LEVEL", ",", "DEFAULT_OUTLINE_TOP_LEVEL", ")", ";"...
Change the level at which the titles may appear in the outline. @param level the level, at least 1.
[ "Change", "the", "level", "at", "which", "the", "titles", "may", "appear", "in", "the", "outline", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/markdown/MarkdownParser.java#L420-L426
Netflix/ribbon
ribbon-transport/src/main/java/com/netflix/ribbon/transport/netty/http/LoadBalancingHttpClient.java
LoadBalancingHttpClient.submitToServerInURI
private Observable<HttpClientResponse<O>> submitToServerInURI( HttpClientRequest<I> request, IClientConfig requestConfig, ClientConfig config, RetryHandler errorHandler, ExecutionContext<HttpClientRequest<I>> context) { """ Submits the request to the server indicated in the URI @param requ...
java
private Observable<HttpClientResponse<O>> submitToServerInURI( HttpClientRequest<I> request, IClientConfig requestConfig, ClientConfig config, RetryHandler errorHandler, ExecutionContext<HttpClientRequest<I>> context) { // First, determine server from the URI URI uri; tr...
[ "private", "Observable", "<", "HttpClientResponse", "<", "O", ">", ">", "submitToServerInURI", "(", "HttpClientRequest", "<", "I", ">", "request", ",", "IClientConfig", "requestConfig", ",", "ClientConfig", "config", ",", "RetryHandler", "errorHandler", ",", "Execut...
Submits the request to the server indicated in the URI @param request @param requestConfig @param config @param errorHandler @param context @return
[ "Submits", "the", "request", "to", "the", "server", "indicated", "in", "the", "URI" ]
train
https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-transport/src/main/java/com/netflix/ribbon/transport/netty/http/LoadBalancingHttpClient.java#L443-L474
tango-controls/JTango
client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java
TypeConversionUtil.castToArray
public static <T> Object castToArray(final Class<T> type, final Object val) throws DevFailed { """ Convert an array of primitives or Objects like double[][] or Double[] into the requested type. 2D array will be converted to a 1D array @param <T> @param type the componant type @param val @return @throws De...
java
public static <T> Object castToArray(final Class<T> type, final Object val) throws DevFailed { Object result = null; final Object array1D = val; if (val == null || type.isAssignableFrom(val.getClass())) { result = val; } else { LOGGER.debug("converting {} to {}", val.getClass().getCanonicalName(), type.ge...
[ "public", "static", "<", "T", ">", "Object", "castToArray", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Object", "val", ")", "throws", "DevFailed", "{", "Object", "result", "=", "null", ";", "final", "Object", "array1D", "=", "val", ";...
Convert an array of primitives or Objects like double[][] or Double[] into the requested type. 2D array will be converted to a 1D array @param <T> @param type the componant type @param val @return @throws DevFailed
[ "Convert", "an", "array", "of", "primitives", "or", "Objects", "like", "double", "[]", "[]", "or", "Double", "[]", "into", "the", "requested", "type", ".", "2D", "array", "will", "be", "converted", "to", "a", "1D", "array" ]
train
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java#L65-L82
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/Bindings.java
Bindings.bindVisible
public static void bindVisible (final Value<Boolean> value, final Thunk thunk) { """ Binds the visible state of a to-be-created widget to the supplied boolean value. The supplied thunk will be called to create the widget (and add it to the appropriate parent) the first time the value transitions to true, at whic...
java
public static void bindVisible (final Value<Boolean> value, final Thunk thunk) { Preconditions.checkNotNull(thunk, "thunk"); value.addListenerAndTrigger(new Value.Listener<Boolean>() { public void valueChanged (Boolean visible) { if (visible) { value.r...
[ "public", "static", "void", "bindVisible", "(", "final", "Value", "<", "Boolean", ">", "value", ",", "final", "Thunk", "thunk", ")", "{", "Preconditions", ".", "checkNotNull", "(", "thunk", ",", "\"thunk\"", ")", ";", "value", ".", "addListenerAndTrigger", "...
Binds the visible state of a to-be-created widget to the supplied boolean value. The supplied thunk will be called to create the widget (and add it to the appropriate parent) the first time the value transitions to true, at which point the visiblity of the created widget will be bound to subsequent changes of the value...
[ "Binds", "the", "visible", "state", "of", "a", "to", "-", "be", "-", "created", "widget", "to", "the", "supplied", "boolean", "value", ".", "The", "supplied", "thunk", "will", "be", "called", "to", "create", "the", "widget", "(", "and", "add", "it", "t...
train
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Bindings.java#L90-L101
Azure/azure-sdk-for-java
datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java
FilesInner.createOrUpdate
public ProjectFileInner createOrUpdate(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { """ Create a file resource. The PUT method creates a new file or updates an existing one. @param groupName Name of the resource group @param serviceName Name of the ...
java
public ProjectFileInner createOrUpdate(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).toBlocking().single().body(); }
[ "public", "ProjectFileInner", "createOrUpdate", "(", "String", "groupName", ",", "String", "serviceName", ",", "String", "projectName", ",", "String", "fileName", ",", "ProjectFileInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "...
Create a file resource. The PUT method creates a new file or updates an existing one. @param groupName Name of the resource group @param serviceName Name of the service @param projectName Name of the project @param fileName Name of the File @param parameters Information about the file @throws IllegalArgumentException ...
[ "Create", "a", "file", "resource", ".", "The", "PUT", "method", "creates", "a", "new", "file", "or", "updates", "an", "existing", "one", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L354-L356
beangle/beangle3
orm/hibernate/src/main/java/org/beangle/orm/hibernate/tool/HbmGenerator.java
HbmGenerator.findAnnotation
private <T extends Annotation> T findAnnotation(Class<?> cls, Class<T> annotationClass, String name) { """ find annotation on specified member @param cls @param annotationClass @param name @return """ Class<?> curr = cls; T ann = null; while (ann == null && curr != null && !curr.equals(Object...
java
private <T extends Annotation> T findAnnotation(Class<?> cls, Class<T> annotationClass, String name) { Class<?> curr = cls; T ann = null; while (ann == null && curr != null && !curr.equals(Object.class)) { ann = findAnnotationLocal(curr, annotationClass, name); curr = curr.getSuperclass(); }...
[ "private", "<", "T", "extends", "Annotation", ">", "T", "findAnnotation", "(", "Class", "<", "?", ">", "cls", ",", "Class", "<", "T", ">", "annotationClass", ",", "String", "name", ")", "{", "Class", "<", "?", ">", "curr", "=", "cls", ";", "T", "an...
find annotation on specified member @param cls @param annotationClass @param name @return
[ "find", "annotation", "on", "specified", "member" ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/orm/hibernate/src/main/java/org/beangle/orm/hibernate/tool/HbmGenerator.java#L106-L114
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java
PojoSerializerSnapshot.newPojoSerializerIsCompatibleWithReconfiguredSerializer
private static <T> boolean newPojoSerializerIsCompatibleWithReconfiguredSerializer( PojoSerializer<T> newPojoSerializer, IntermediateCompatibilityResult<T> fieldSerializerCompatibility, IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility, LinkedOptionalMap<Class<?>, TypeSerializerSnapsh...
java
private static <T> boolean newPojoSerializerIsCompatibleWithReconfiguredSerializer( PojoSerializer<T> newPojoSerializer, IntermediateCompatibilityResult<T> fieldSerializerCompatibility, IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility, LinkedOptionalMap<Class<?>, TypeSerializerSnapsh...
[ "private", "static", "<", "T", ">", "boolean", "newPojoSerializerIsCompatibleWithReconfiguredSerializer", "(", "PojoSerializer", "<", "T", ">", "newPojoSerializer", ",", "IntermediateCompatibilityResult", "<", "T", ">", "fieldSerializerCompatibility", ",", "IntermediateCompat...
Checks if the new {@link PojoSerializer} is compatible with a reconfigured instance.
[ "Checks", "if", "the", "new", "{" ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java#L358-L368
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java
SqlSelectBuilder.getNameParameterOfType
public static String getNameParameterOfType(ModelMethod method, TypeName parameter) { """ Gets the name parameter of type. @param method the method @param parameter the parameter @return the name parameter of type """ for (Pair<String, TypeName> item : method.getParameters()) { if (item.value1.equa...
java
public static String getNameParameterOfType(ModelMethod method, TypeName parameter) { for (Pair<String, TypeName> item : method.getParameters()) { if (item.value1.equals(parameter)) { return item.value0; } } return null; }
[ "public", "static", "String", "getNameParameterOfType", "(", "ModelMethod", "method", ",", "TypeName", "parameter", ")", "{", "for", "(", "Pair", "<", "String", ",", "TypeName", ">", "item", ":", "method", ".", "getParameters", "(", ")", ")", "{", "if", "(...
Gets the name parameter of type. @param method the method @param parameter the parameter @return the name parameter of type
[ "Gets", "the", "name", "parameter", "of", "type", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlSelectBuilder.java#L69-L77
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/ui/SeaGlassProgressBarUI.java
SeaGlassProgressBarUI.getPreferredInnerVertical
protected Dimension getPreferredInnerVertical() { """ Overwritten to fix a very strange issue on Java 7 in BasicProgressBarUI The super method does exactly the same thing but has vertDim == null We with the same code in our overwritten method get a correct vertDim? Why? I don't know, but it fixes the issue. As...
java
protected Dimension getPreferredInnerVertical() { Dimension vertDim = (Dimension)DefaultLookup.get(progressBar, this, "ProgressBar.vertictalSize"); if (vertDim == null) { vertDim = new Dimension(19, 150); } return vertDim; }
[ "protected", "Dimension", "getPreferredInnerVertical", "(", ")", "{", "Dimension", "vertDim", "=", "(", "Dimension", ")", "DefaultLookup", ".", "get", "(", "progressBar", ",", "this", ",", "\"ProgressBar.vertictalSize\"", ")", ";", "if", "(", "vertDim", "==", "n...
Overwritten to fix a very strange issue on Java 7 in BasicProgressBarUI The super method does exactly the same thing but has vertDim == null We with the same code in our overwritten method get a correct vertDim? Why? I don't know, but it fixes the issue. As a small modification I adjusted only the default hardcoded val...
[ "Overwritten", "to", "fix", "a", "very", "strange", "issue", "on", "Java", "7", "in", "BasicProgressBarUI", "The", "super", "method", "does", "exactly", "the", "same", "thing", "but", "has", "vertDim", "==", "null", "We", "with", "the", "same", "code", "in...
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassProgressBarUI.java#L146-L153
apache/incubator-heron
heron/scheduler-core/src/java/org/apache/heron/scheduler/client/HttpServiceSchedulerClient.java
HttpServiceSchedulerClient.requestSchedulerService
protected boolean requestSchedulerService(Command command, byte[] data) { """ Send payload to target HTTP connection to request a service @param data the byte[] to send @return true if got OK response successfully """ String endpoint = getCommandEndpoint(schedulerHttpEndpoint, command); final HttpU...
java
protected boolean requestSchedulerService(Command command, byte[] data) { String endpoint = getCommandEndpoint(schedulerHttpEndpoint, command); final HttpURLConnection connection = NetworkUtils.getHttpConnection(endpoint); if (connection == null) { LOG.severe("Scheduler not found."); return fals...
[ "protected", "boolean", "requestSchedulerService", "(", "Command", "command", ",", "byte", "[", "]", "data", ")", "{", "String", "endpoint", "=", "getCommandEndpoint", "(", "schedulerHttpEndpoint", ",", "command", ")", ";", "final", "HttpURLConnection", "connection"...
Send payload to target HTTP connection to request a service @param data the byte[] to send @return true if got OK response successfully
[ "Send", "payload", "to", "target", "HTTP", "connection", "to", "request", "a", "service" ]
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/scheduler-core/src/java/org/apache/heron/scheduler/client/HttpServiceSchedulerClient.java#L74-L112
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/configuration/impl/ConfigurationAbstractImpl.java
ConfigurationAbstractImpl.getClass
public Class getClass(String key, Class defaultValue, Class assignable) { """ Returns the class specified by the value for the specified key. If no value for this key is found in the configuration, no class of this name can be found or the specified class is not assignable <code>assignable defaultValue</code> i...
java
public Class getClass(String key, Class defaultValue, Class assignable) { return getClass(key, defaultValue, new Class[]{assignable}); }
[ "public", "Class", "getClass", "(", "String", "key", ",", "Class", "defaultValue", ",", "Class", "assignable", ")", "{", "return", "getClass", "(", "key", ",", "defaultValue", ",", "new", "Class", "[", "]", "{", "assignable", "}", ")", ";", "}" ]
Returns the class specified by the value for the specified key. If no value for this key is found in the configuration, no class of this name can be found or the specified class is not assignable <code>assignable defaultValue</code> is returned. @param key the key @param defaultValue the default Value @param assignabl...
[ "Returns", "the", "class", "specified", "by", "the", "value", "for", "the", "specified", "key", ".", "If", "no", "value", "for", "this", "key", "is", "found", "in", "the", "configuration", "no", "class", "of", "this", "name", "can", "be", "found", "or", ...
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/configuration/impl/ConfigurationAbstractImpl.java#L386-L389
liferay/com-liferay-commerce
commerce-payment-api/src/main/java/com/liferay/commerce/payment/model/CommercePaymentMethodGroupRelWrapper.java
CommercePaymentMethodGroupRelWrapper.getName
@Override public String getName(String languageId, boolean useDefault) { """ Returns the localized name of this commerce payment method group rel in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefa...
java
@Override public String getName(String languageId, boolean useDefault) { return _commercePaymentMethodGroupRel.getName(languageId, useDefault); }
[ "@", "Override", "public", "String", "getName", "(", "String", "languageId", ",", "boolean", "useDefault", ")", "{", "return", "_commercePaymentMethodGroupRel", ".", "getName", "(", "languageId", ",", "useDefault", ")", ";", "}" ]
Returns the localized name of this commerce payment method group rel 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 la...
[ "Returns", "the", "localized", "name", "of", "this", "commerce", "payment", "method", "group", "rel", "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-payment-api/src/main/java/com/liferay/commerce/payment/model/CommercePaymentMethodGroupRelWrapper.java#L403-L406
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/dataformats/json/jackson/MultiLineStringSerializer.java
MultiLineStringSerializer.writeShapeSpecificSerialization
@Override public void writeShapeSpecificSerialization(MultiLineString value, JsonGenerator jgen, SerializerProvider provider) throws IOException { """ Method that can be called to ask implementation to serialize values of type this serializer handles. @param value Value to serialize; can not be null....
java
@Override public void writeShapeSpecificSerialization(MultiLineString value, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeFieldName( "type"); jgen.writeString( "MultiLineString"); jgen.writeArrayFieldStart( "coordinates"); // set beanproperty to null since w...
[ "@", "Override", "public", "void", "writeShapeSpecificSerialization", "(", "MultiLineString", "value", ",", "JsonGenerator", "jgen", ",", "SerializerProvider", "provider", ")", "throws", "IOException", "{", "jgen", ".", "writeFieldName", "(", "\"type\"", ")", ";", "...
Method that can be called to ask implementation to serialize values of type this serializer handles. @param value Value to serialize; can not be null. @param jgen Generator used to output resulting Json content @param provider Provider that can be used to get serializers for serializing Objects value contains, if any. ...
[ "Method", "that", "can", "be", "called", "to", "ask", "implementation", "to", "serialize", "values", "of", "type", "this", "serializer", "handles", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/MultiLineStringSerializer.java#L61-L82
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java
DefaultSwidProcessor.setSoftwareLicensor
public DefaultSwidProcessor setSoftwareLicensor(final String softwareLicensorName, final String softwareLicensorRegId) { """ Identifies the licensor of the software (tag: software_licensor). @param softwareLicensorName software licensor name @param softwareLicensorRegId software licensor registra...
java
public DefaultSwidProcessor setSoftwareLicensor(final String softwareLicensorName, final String softwareLicensorRegId) { swidTag.setSoftwareLicensor( new EntityComplexType( new Token(softwareLicensorName, idGenerator.nextId()), new Regi...
[ "public", "DefaultSwidProcessor", "setSoftwareLicensor", "(", "final", "String", "softwareLicensorName", ",", "final", "String", "softwareLicensorRegId", ")", "{", "swidTag", ".", "setSoftwareLicensor", "(", "new", "EntityComplexType", "(", "new", "Token", "(", "softwar...
Identifies the licensor of the software (tag: software_licensor). @param softwareLicensorName software licensor name @param softwareLicensorRegId software licensor registration ID @return a reference to this object.
[ "Identifies", "the", "licensor", "of", "the", "software", "(", "tag", ":", "software_licensor", ")", "." ]
train
https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java#L155-L163
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/DiagonalMatrix.java
DiagonalMatrix.setRow
public void setRow(int row, double[] values) { """ {@inheritDoc} Note that any values are not on the diagonal are ignored. """ checkIndices(row, values.length - 1); values[row] = values[row]; }
java
public void setRow(int row, double[] values) { checkIndices(row, values.length - 1); values[row] = values[row]; }
[ "public", "void", "setRow", "(", "int", "row", ",", "double", "[", "]", "values", ")", "{", "checkIndices", "(", "row", ",", "values", ".", "length", "-", "1", ")", ";", "values", "[", "row", "]", "=", "values", "[", "row", "]", ";", "}" ]
{@inheritDoc} Note that any values are not on the diagonal are ignored.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/DiagonalMatrix.java#L187-L191
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java
ResourceManager.getBaseResources
public static Resources getBaseResources( String baseName, ClassLoader classLoader ) { """ Retrieve resource with specified basename. @param baseName the basename @param classLoader the classLoader to load resources from @return the Resources """ synchronized( ResourceManager.class ) ...
java
public static Resources getBaseResources( String baseName, ClassLoader classLoader ) { synchronized( ResourceManager.class ) { Resources resources = getCachedResource( baseName ); if( null == resources ) { resources = new Resources( baseName, class...
[ "public", "static", "Resources", "getBaseResources", "(", "String", "baseName", ",", "ClassLoader", "classLoader", ")", "{", "synchronized", "(", "ResourceManager", ".", "class", ")", "{", "Resources", "resources", "=", "getCachedResource", "(", "baseName", ")", "...
Retrieve resource with specified basename. @param baseName the basename @param classLoader the classLoader to load resources from @return the Resources
[ "Retrieve", "resource", "with", "specified", "basename", "." ]
train
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L72-L85
OpenTSDB/opentsdb
src/uid/UniqueId.java
UniqueId.getUsedUIDs
public static Deferred<Map<String, Long>> getUsedUIDs(final TSDB tsdb, final byte[][] kinds) { """ Returns a map of max UIDs from storage for the given list of UID types @param tsdb The TSDB to which we belong @param kinds A list of qualifiers to fetch @return A map with the "kind" as the key and the maxi...
java
public static Deferred<Map<String, Long>> getUsedUIDs(final TSDB tsdb, final byte[][] kinds) { /** * Returns a map with 0 if the max ID row hasn't been initialized yet, * otherwise the map has actual data */ final class GetCB implements Callback<Map<String, Long>, ArrayList<Key...
[ "public", "static", "Deferred", "<", "Map", "<", "String", ",", "Long", ">", ">", "getUsedUIDs", "(", "final", "TSDB", "tsdb", ",", "final", "byte", "[", "]", "[", "]", "kinds", ")", "{", "/**\n * Returns a map with 0 if the max ID row hasn't been initialized ...
Returns a map of max UIDs from storage for the given list of UID types @param tsdb The TSDB to which we belong @param kinds A list of qualifiers to fetch @return A map with the "kind" as the key and the maximum assigned UID as the value @since 2.0
[ "Returns", "a", "map", "of", "max", "UIDs", "from", "storage", "for", "the", "given", "list", "of", "UID", "types" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1700-L1746
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor
SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/view/filter/FilterViewUI.java
FilterViewUI.isSubsetContainedIn
protected boolean isSubsetContainedIn(Set<String> selectedListItems, Set<String> distinctFacetValues) { """ check if *any* of items in selectedListItems is present in distinctFacetValues @param selectedListItems @param distinctFacetValues @return """ boolean isPresent = false; for (String se...
java
protected boolean isSubsetContainedIn(Set<String> selectedListItems, Set<String> distinctFacetValues) { boolean isPresent = false; for (String selectedListItem : selectedListItems) { isPresent = distinctFacetValues.contains(selectedListItem); } return isPresent; }
[ "protected", "boolean", "isSubsetContainedIn", "(", "Set", "<", "String", ">", "selectedListItems", ",", "Set", "<", "String", ">", "distinctFacetValues", ")", "{", "boolean", "isPresent", "=", "false", ";", "for", "(", "String", "selectedListItem", ":", "select...
check if *any* of items in selectedListItems is present in distinctFacetValues @param selectedListItems @param distinctFacetValues @return
[ "check", "if", "*", "any", "*", "of", "items", "in", "selectedListItems", "is", "present", "in", "distinctFacetValues" ]
train
https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/view/filter/FilterViewUI.java#L290-L296
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java
CPDefinitionPersistenceImpl.findByCompanyId
@Override public List<CPDefinition> findByCompanyId(long companyId, int start, int end) { """ Returns a range of all the cp definitions where companyId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary ...
java
@Override public List<CPDefinition> findByCompanyId(long companyId, int start, int end) { return findByCompanyId(companyId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CPDefinition", ">", "findByCompanyId", "(", "long", "companyId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCompanyId", "(", "companyId", ",", "start", ",", "end", ",", "null", ")", ";", "}...
Returns a range of all the cp definitions where companyId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. S...
[ "Returns", "a", "range", "of", "all", "the", "cp", "definitions", "where", "companyId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L2030-L2033
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java
ColorHsv.rgbToHsv
public static <T extends ImageGray<T>> void rgbToHsv(Planar<T> rgb , Planar<T> hsv ) { """ Converts an image from RGB into HSV. Pixels must have a value within the range of [0,1]. @param rgb (Input) Image in RGB format @param hsv (Output) Image in HSV format """ hsv.reshape(rgb.width,rgb.height,3); ...
java
public static <T extends ImageGray<T>> void rgbToHsv(Planar<T> rgb , Planar<T> hsv ) { hsv.reshape(rgb.width,rgb.height,3); if( hsv.getBandType() == GrayF32.class ) { if(BoofConcurrency.USE_CONCURRENT ) { ImplColorHsv_MT.rgbToHsv_F32((Planar<GrayF32>)rgb,(Planar<GrayF32>)hsv); } else { ImplColorHsv....
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "void", "rgbToHsv", "(", "Planar", "<", "T", ">", "rgb", ",", "Planar", "<", "T", ">", "hsv", ")", "{", "hsv", ".", "reshape", "(", "rgb", ".", "width", ",", "rgb", ".", ...
Converts an image from RGB into HSV. Pixels must have a value within the range of [0,1]. @param rgb (Input) Image in RGB format @param hsv (Output) Image in HSV format
[ "Converts", "an", "image", "from", "RGB", "into", "HSV", ".", "Pixels", "must", "have", "a", "value", "within", "the", "range", "of", "[", "0", "1", "]", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorHsv.java#L306-L319
jblas-project/jblas
src/main/java/org/jblas/util/SanityChecks.java
SanityChecks.checkVectorAddition
public static void checkVectorAddition() { """ Check whether vector addition works. This is pure Java code and should work. """ DoubleMatrix x = new DoubleMatrix(3, 1, 1.0, 2.0, 3.0); DoubleMatrix y = new DoubleMatrix(3, 1, 4.0, 5.0, 6.0); DoubleMatrix z = new DoubleMatrix(3, 1, 5.0, 7....
java
public static void checkVectorAddition() { DoubleMatrix x = new DoubleMatrix(3, 1, 1.0, 2.0, 3.0); DoubleMatrix y = new DoubleMatrix(3, 1, 4.0, 5.0, 6.0); DoubleMatrix z = new DoubleMatrix(3, 1, 5.0, 7.0, 9.0); check("checking vector addition", x.add(y).equals(z)); }
[ "public", "static", "void", "checkVectorAddition", "(", ")", "{", "DoubleMatrix", "x", "=", "new", "DoubleMatrix", "(", "3", ",", "1", ",", "1.0", ",", "2.0", ",", "3.0", ")", ";", "DoubleMatrix", "y", "=", "new", "DoubleMatrix", "(", "3", ",", "1", ...
Check whether vector addition works. This is pure Java code and should work.
[ "Check", "whether", "vector", "addition", "works", ".", "This", "is", "pure", "Java", "code", "and", "should", "work", "." ]
train
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/SanityChecks.java#L64-L70
ReactiveX/RxNetty
rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/ws/server/WebSocketHandshaker.java
WebSocketHandshaker.selectSubprotocol
protected static String selectSubprotocol(String requestedSubprotocols, String[] supportedSubProtocols) { """ <b>This is copied from {@link WebSocketServerHandshaker}</b> Selects the first matching supported sub protocol @param requestedSubprotocols CSV of protocols to be supported. e.g. "chat, superchat" @...
java
protected static String selectSubprotocol(String requestedSubprotocols, String[] supportedSubProtocols) { if (requestedSubprotocols == null || supportedSubProtocols.length == 0) { return null; } String[] requestedSubprotocolArray = requestedSubprotocols.split(","); for (Str...
[ "protected", "static", "String", "selectSubprotocol", "(", "String", "requestedSubprotocols", ",", "String", "[", "]", "supportedSubProtocols", ")", "{", "if", "(", "requestedSubprotocols", "==", "null", "||", "supportedSubProtocols", ".", "length", "==", "0", ")", ...
<b>This is copied from {@link WebSocketServerHandshaker}</b> Selects the first matching supported sub protocol @param requestedSubprotocols CSV of protocols to be supported. e.g. "chat, superchat" @return First matching supported sub protocol. Null if not found.
[ "<b", ">", "This", "is", "copied", "from", "{", "@link", "WebSocketServerHandshaker", "}", "<", "/", "b", ">" ]
train
https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/ws/server/WebSocketHandshaker.java#L71-L91
alkacon/opencms-core
src/org/opencms/ui/apps/modules/CmsModuleApp.java
CmsModuleApp.openReport
public void openReport(String newState, A_CmsReportThread thread, String label) { """ Changes to a new sub-view and stores a report to be displayed by that subview.<p< @param newState the new state @param thread the report thread which should be displayed in the sub view @param label the label to display for ...
java
public void openReport(String newState, A_CmsReportThread thread, String label) { setReport(newState, thread); m_labels.put(thread, label); openSubView(newState, true); }
[ "public", "void", "openReport", "(", "String", "newState", ",", "A_CmsReportThread", "thread", ",", "String", "label", ")", "{", "setReport", "(", "newState", ",", "thread", ")", ";", "m_labels", ".", "put", "(", "thread", ",", "label", ")", ";", "openSubV...
Changes to a new sub-view and stores a report to be displayed by that subview.<p< @param newState the new state @param thread the report thread which should be displayed in the sub view @param label the label to display for the report
[ "Changes", "to", "a", "new", "sub", "-", "view", "and", "stores", "a", "report", "to", "be", "displayed", "by", "that", "subview", ".", "<p<" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/modules/CmsModuleApp.java#L667-L672
Impetus/Kundera
src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClient.java
DSClient.getCompoundKey
private Object getCompoundKey(Attribute attribute, Object entity) throws InstantiationException, IllegalAccessException { """ Gets the compound key. @param attribute the attribute @param entity the entity @return the compound key @throws InstantiationException the instantiation exception @throws ...
java
private Object getCompoundKey(Attribute attribute, Object entity) throws InstantiationException, IllegalAccessException { Object compoundKeyObject = null; if (entity != null) { compoundKeyObject = PropertyAccessorHelper.getObject(entity, (Field) attribute.getJavaMember()); ...
[ "private", "Object", "getCompoundKey", "(", "Attribute", "attribute", ",", "Object", "entity", ")", "throws", "InstantiationException", ",", "IllegalAccessException", "{", "Object", "compoundKeyObject", "=", "null", ";", "if", "(", "entity", "!=", "null", ")", "{"...
Gets the compound key. @param attribute the attribute @param entity the entity @return the compound key @throws InstantiationException the instantiation exception @throws IllegalAccessException the illegal access exception
[ "Gets", "the", "compound", "key", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClient.java#L1030-L1041
landawn/AbacusUtil
src/com/landawn/abacus/util/StringUtil.java
StringUtil.replacePattern
public static String replacePattern(final String source, final String regex, final String replacement) { """ Replaces each substring of the source String that matches the given regular expression with the given replacement using the {@link Pattern#DOTALL} option. DOTALL is also know as single-line mode in Perl....
java
public static String replacePattern(final String source, final String regex, final String replacement) { return Pattern.compile(regex, Pattern.DOTALL).matcher(source).replaceAll(replacement); }
[ "public", "static", "String", "replacePattern", "(", "final", "String", "source", ",", "final", "String", "regex", ",", "final", "String", "replacement", ")", "{", "return", "Pattern", ".", "compile", "(", "regex", ",", "Pattern", ".", "DOTALL", ")", ".", ...
Replaces each substring of the source String that matches the given regular expression with the given replacement using the {@link Pattern#DOTALL} option. DOTALL is also know as single-line mode in Perl. This call is also equivalent to: <ul> <li>{@code source.replaceAll(&quot;(?s)&quot; + regex, replacement)}</li> <li>...
[ "Replaces", "each", "substring", "of", "the", "source", "String", "that", "matches", "the", "given", "regular", "expression", "with", "the", "given", "replacement", "using", "the", "{", "@link", "Pattern#DOTALL", "}", "option", ".", "DOTALL", "is", "also", "kn...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L1111-L1113
google/closure-templates
java/src/com/google/template/soy/jbcsrc/ProtoUtils.java
ProtoUtils.getHasserMethod
private static MethodRef getHasserMethod(FieldDescriptor descriptor) { """ Returns the {@link MethodRef} for the generated hasser method. """ TypeInfo message = messageRuntimeType(descriptor.getContainingType()); return MethodRef.createInstanceMethod( message, new Method("has" +...
java
private static MethodRef getHasserMethod(FieldDescriptor descriptor) { TypeInfo message = messageRuntimeType(descriptor.getContainingType()); return MethodRef.createInstanceMethod( message, new Method("has" + getFieldName(descriptor, true), Type.BOOLEAN_TYPE, NO_METHOD_ARGS)) .as...
[ "private", "static", "MethodRef", "getHasserMethod", "(", "FieldDescriptor", "descriptor", ")", "{", "TypeInfo", "message", "=", "messageRuntimeType", "(", "descriptor", ".", "getContainingType", "(", ")", ")", ";", "return", "MethodRef", ".", "createInstanceMethod", ...
Returns the {@link MethodRef} for the generated hasser method.
[ "Returns", "the", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/ProtoUtils.java#L1223-L1229
stephenc/redmine-java-api
src/main/java/org/redmine/ta/internal/Transport.java
Transport.getChildEntries
public <T> List<T> getChildEntries(Class<?> parentClass, String parentId, Class<T> classs) throws RedmineException { """ Delivers a list of a child entries. @param classs target class. """ final EntityConfig<T> config = getConfig(classs); final URI uri = getURIConfigurator().getChildObjectsURI(paren...
java
public <T> List<T> getChildEntries(Class<?> parentClass, String parentId, Class<T> classs) throws RedmineException { final EntityConfig<T> config = getConfig(classs); final URI uri = getURIConfigurator().getChildObjectsURI(parentClass, parentId, classs); HttpGet http = new HttpGet(uri); String response ...
[ "public", "<", "T", ">", "List", "<", "T", ">", "getChildEntries", "(", "Class", "<", "?", ">", "parentClass", ",", "String", "parentId", ",", "Class", "<", "T", ">", "classs", ")", "throws", "RedmineException", "{", "final", "EntityConfig", "<", "T", ...
Delivers a list of a child entries. @param classs target class.
[ "Delivers", "a", "list", "of", "a", "child", "entries", "." ]
train
https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/Transport.java#L416-L432
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlEngine.java
BeetlEngine.createGroupTemplate
private static GroupTemplate createGroupTemplate(ResourceLoader loader) { """ 创建自定义的模板组 {@link GroupTemplate},配置文件使用全局默认<br> 此时自定义的配置文件可在ClassPath中放入beetl.properties配置 @param loader {@link ResourceLoader},资源加载器 @return {@link GroupTemplate} @since 3.2.0 """ try { return createGroupTemplate(loader,...
java
private static GroupTemplate createGroupTemplate(ResourceLoader loader) { try { return createGroupTemplate(loader, Configuration.defaultConfiguration()); } catch (IOException e) { throw new IORuntimeException(e); } }
[ "private", "static", "GroupTemplate", "createGroupTemplate", "(", "ResourceLoader", "loader", ")", "{", "try", "{", "return", "createGroupTemplate", "(", "loader", ",", "Configuration", ".", "defaultConfiguration", "(", ")", ")", ";", "}", "catch", "(", "IOExcepti...
创建自定义的模板组 {@link GroupTemplate},配置文件使用全局默认<br> 此时自定义的配置文件可在ClassPath中放入beetl.properties配置 @param loader {@link ResourceLoader},资源加载器 @return {@link GroupTemplate} @since 3.2.0
[ "创建自定义的模板组", "{", "@link", "GroupTemplate", "}", ",配置文件使用全局默认<br", ">", "此时自定义的配置文件可在ClassPath中放入beetl", ".", "properties配置" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlEngine.java#L96-L102
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java
ConnectionManager.matchBranchCoupling
protected boolean matchBranchCoupling(int couplingType1, int couplingType2, ManagedConnectionFactory managedConnectionFactory) { """ May be called if couplingType indicates LOOSE or TIGHT or is UNSET """ final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); boolean matched = true; ...
java
protected boolean matchBranchCoupling(int couplingType1, int couplingType2, ManagedConnectionFactory managedConnectionFactory) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); boolean matched = true; if (isJDBC && couplingType1 != couplingType2) { // ResourceRefInfo....
[ "protected", "boolean", "matchBranchCoupling", "(", "int", "couplingType1", ",", "int", "couplingType2", ",", "ManagedConnectionFactory", "managedConnectionFactory", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ...
May be called if couplingType indicates LOOSE or TIGHT or is UNSET
[ "May", "be", "called", "if", "couplingType", "indicates", "LOOSE", "or", "TIGHT", "or", "is", "UNSET" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1601-L1616
sebastiangraf/jSCSI
bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandDescriptorBlockParser.java
SCSICommandDescriptorBlockParser.createReadWriteMessage
private static final ByteBuffer createReadWriteMessage (final byte opCode, final int logicalBlockAddress, final short transferLength) { """ Creates the Command Descriptor Block for a given Operation Message. @param opCode The Operation Code. @param logicalBlockAddress The Logical Block Address to begin the rea...
java
private static final ByteBuffer createReadWriteMessage (final byte opCode, final int logicalBlockAddress, final short transferLength) { ByteBuffer cdb = ByteBuffer.allocate(DEFAULT_CDB_LENGTH); // operation code cdb.put(opCode); // logical block address cdb.position(LOGICAL_BLO...
[ "private", "static", "final", "ByteBuffer", "createReadWriteMessage", "(", "final", "byte", "opCode", ",", "final", "int", "logicalBlockAddress", ",", "final", "short", "transferLength", ")", "{", "ByteBuffer", "cdb", "=", "ByteBuffer", ".", "allocate", "(", "DEFA...
Creates the Command Descriptor Block for a given Operation Message. @param opCode The Operation Code. @param logicalBlockAddress The Logical Block Address to begin the read operation. @param transferLength The transfer length field specifies the number of contiguous logical blocks of data to be transferred. A transfer...
[ "Creates", "the", "Command", "Descriptor", "Block", "for", "a", "given", "Operation", "Message", "." ]
train
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandDescriptorBlockParser.java#L346-L363
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java
WidgetsUtils.replaceOrAppend
private static void replaceOrAppend(Element oldElement, Element newElement) { """ If the <code>oldElement</code> is a td, th, li tags, the new element will replaced its content. In other cases, the <code>oldElement</code> will be replaced by the <code>newElement</code> and the old element classes will be copied ...
java
private static void replaceOrAppend(Element oldElement, Element newElement) { assert oldElement != null && newElement != null; if (matchesTags(oldElement, appendingTags)) { GQuery.$(oldElement).html("").append(newElement); } else { GQuery.$(oldElement).replaceWith(newElement); // copy cl...
[ "private", "static", "void", "replaceOrAppend", "(", "Element", "oldElement", ",", "Element", "newElement", ")", "{", "assert", "oldElement", "!=", "null", "&&", "newElement", "!=", "null", ";", "if", "(", "matchesTags", "(", "oldElement", ",", "appendingTags", ...
If the <code>oldElement</code> is a td, th, li tags, the new element will replaced its content. In other cases, the <code>oldElement</code> will be replaced by the <code>newElement</code> and the old element classes will be copied to the new element.
[ "If", "the", "<code", ">", "oldElement<", "/", "code", ">", "is", "a", "td", "th", "li", "tags", "the", "new", "element", "will", "replaced", "its", "content", ".", "In", "other", "cases", "the", "<code", ">", "oldElement<", "/", "code", ">", "will", ...
train
https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java#L128-L146
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/RequestXmlFactory.java
RequestXmlFactory.convertToXmlByteArray
public static byte[] convertToXmlByteArray(List<PartETag> partETags) { """ Converts the specified list of PartETags to an XML fragment that can be sent to the CompleteMultipartUpload operation of Amazon S3. @param partETags The list of part ETags containing the data to include in the new XML fragment. @re...
java
public static byte[] convertToXmlByteArray(List<PartETag> partETags) { XmlWriter xml = new XmlWriter(); xml.start("CompleteMultipartUpload"); if (partETags != null) { List<PartETag> sortedPartETags = new ArrayList<PartETag>(partETags); Collections.sort(sortedPartETags, ne...
[ "public", "static", "byte", "[", "]", "convertToXmlByteArray", "(", "List", "<", "PartETag", ">", "partETags", ")", "{", "XmlWriter", "xml", "=", "new", "XmlWriter", "(", ")", ";", "xml", ".", "start", "(", "\"CompleteMultipartUpload\"", ")", ";", "if", "(...
Converts the specified list of PartETags to an XML fragment that can be sent to the CompleteMultipartUpload operation of Amazon S3. @param partETags The list of part ETags containing the data to include in the new XML fragment. @return A byte array containing the data
[ "Converts", "the", "specified", "list", "of", "PartETags", "to", "an", "XML", "fragment", "that", "can", "be", "sent", "to", "the", "CompleteMultipartUpload", "operation", "of", "Amazon", "S3", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/RequestXmlFactory.java#L56-L79
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ConcurrencyUtil.java
ConcurrencyUtil.setMax
public static <E> void setMax(E obj, AtomicLongFieldUpdater<E> updater, long value) { """ Atomically sets the max value. If the current value is larger than the provided value, the call is ignored. So it will not happen that a smaller value will overwrite a larger value. """ for (; ; ) { ...
java
public static <E> void setMax(E obj, AtomicLongFieldUpdater<E> updater, long value) { for (; ; ) { long current = updater.get(obj); if (current >= value) { return; } if (updater.compareAndSet(obj, current, value)) { return; ...
[ "public", "static", "<", "E", ">", "void", "setMax", "(", "E", "obj", ",", "AtomicLongFieldUpdater", "<", "E", ">", "updater", ",", "long", "value", ")", "{", "for", "(", ";", ";", ")", "{", "long", "current", "=", "updater", ".", "get", "(", "obj"...
Atomically sets the max value. If the current value is larger than the provided value, the call is ignored. So it will not happen that a smaller value will overwrite a larger value.
[ "Atomically", "sets", "the", "max", "value", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ConcurrencyUtil.java#L56-L67
jaxio/javaee-lab
javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java
GenericRepository.findProperty
@Transactional public <T> List<T> findProperty(Class<T> propertyType, E entity, SearchParameters sp, Attribute<?, ?>... attributes) { """ /* Find a list of E property. @param propertyType type of the property @param entity a sample entity whose non-null properties may be used as search hints @param...
java
@Transactional public <T> List<T> findProperty(Class<T> propertyType, E entity, SearchParameters sp, Attribute<?, ?>... attributes) { return findProperty(propertyType, entity, sp, newArrayList(attributes)); }
[ "@", "Transactional", "public", "<", "T", ">", "List", "<", "T", ">", "findProperty", "(", "Class", "<", "T", ">", "propertyType", ",", "E", "entity", ",", "SearchParameters", "sp", ",", "Attribute", "<", "?", ",", "?", ">", "...", "attributes", ")", ...
/* Find a list of E property. @param propertyType type of the property @param entity a sample entity whose non-null properties may be used as search hints @param sp carries additional search information @param attributes the list of attributes to the property @return the entities property matching th...
[ "/", "*", "Find", "a", "list", "of", "E", "property", "." ]
train
https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L258-L261
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java
OLAPService.getStatistics
public UNode getStatistics(ApplicationDefinition appDef, String shard, Map<String, String> paramMap) { """ Get detailed shard statistics for the given shard. This command is mostly used for development and diagnostics. @param appDef {@link ApplicationDefinition} of application to query. @param shard Na...
java
public UNode getStatistics(ApplicationDefinition appDef, String shard, Map<String, String> paramMap) { checkServiceState(); CubeSearcher searcher = m_olap.getSearcher(appDef, shard); String file = paramMap.get("file"); if(file != null) { return OlapStatistics.getFileData...
[ "public", "UNode", "getStatistics", "(", "ApplicationDefinition", "appDef", ",", "String", "shard", ",", "Map", "<", "String", ",", "String", ">", "paramMap", ")", "{", "checkServiceState", "(", ")", ";", "CubeSearcher", "searcher", "=", "m_olap", ".", "getSea...
Get detailed shard statistics for the given shard. This command is mostly used for development and diagnostics. @param appDef {@link ApplicationDefinition} of application to query. @param shard Name of shard to query. @param paramMap Map of statistic option key/value pairs. @return Root of statistics ...
[ "Get", "detailed", "shard", "statistics", "for", "the", "given", "shard", ".", "This", "command", "is", "mostly", "used", "for", "development", "and", "diagnostics", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java#L306-L316
CenturyLinkCloud/mdw
mdw-services/src/com/centurylink/mdw/services/event/EventServicesImpl.java
EventServicesImpl.getWorkTransitionInstance
public TransitionInstance getWorkTransitionInstance(Long pId) throws DataAccessException, ProcessException { """ Returns the WorkTransitionVO based on the passed in params @param pId @return WorkTransitionINstance """ TransitionInstance wti; TransactionWrapper transaction = null; ...
java
public TransitionInstance getWorkTransitionInstance(Long pId) throws DataAccessException, ProcessException { TransitionInstance wti; TransactionWrapper transaction = null; EngineDataAccessDB edao = new EngineDataAccessDB(); try { transaction = edao.startTransaction(); ...
[ "public", "TransitionInstance", "getWorkTransitionInstance", "(", "Long", "pId", ")", "throws", "DataAccessException", ",", "ProcessException", "{", "TransitionInstance", "wti", ";", "TransactionWrapper", "transaction", "=", "null", ";", "EngineDataAccessDB", "edao", "=",...
Returns the WorkTransitionVO based on the passed in params @param pId @return WorkTransitionINstance
[ "Returns", "the", "WorkTransitionVO", "based", "on", "the", "passed", "in", "params" ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/event/EventServicesImpl.java#L463-L477
mozilla/rhino
src/org/mozilla/javascript/ScriptableObject.java
ScriptableObject.putConstProperty
public static void putConstProperty(Scriptable obj, String name, Object value) { """ Puts a named property in an object or in an object in its prototype chain. <p> Searches for the named property in the prototype chain. If it is found, the value of the property in <code>obj</code> is changed through a call to ...
java
public static void putConstProperty(Scriptable obj, String name, Object value) { Scriptable base = getBase(obj, name); if (base == null) base = obj; if (base instanceof ConstProperties) ((ConstProperties)base).putConst(name, obj, value); }
[ "public", "static", "void", "putConstProperty", "(", "Scriptable", "obj", ",", "String", "name", ",", "Object", "value", ")", "{", "Scriptable", "base", "=", "getBase", "(", "obj", ",", "name", ")", ";", "if", "(", "base", "==", "null", ")", "base", "=...
Puts a named property in an object or in an object in its prototype chain. <p> Searches for the named property in the prototype chain. If it is found, the value of the property in <code>obj</code> is changed through a call to {@link Scriptable#put(String, Scriptable, Object)} on the prototype passing <code>obj</code> a...
[ "Puts", "a", "named", "property", "in", "an", "object", "or", "in", "an", "object", "in", "its", "prototype", "chain", ".", "<p", ">", "Searches", "for", "the", "named", "property", "in", "the", "prototype", "chain", ".", "If", "it", "is", "found", "th...
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2536-L2543
GumTreeDiff/gumtree
core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java
SequenceAlgorithms.longestCommonSubsequenceWithTypeAndLabel
public static List<int[]> longestCommonSubsequenceWithTypeAndLabel(List<ITree> s0, List<ITree> s1) { """ Returns the longest common subsequence between the two list of nodes. This version use type and label to ensure equality. @see ITree#hasSameTypeAndLabel(ITree) @return a list of size 2 int arrays that corr...
java
public static List<int[]> longestCommonSubsequenceWithTypeAndLabel(List<ITree> s0, List<ITree> s1) { int[][] lengths = new int[s0.size() + 1][s1.size() + 1]; for (int i = 0; i < s0.size(); i++) for (int j = 0; j < s1.size(); j++) if (s0.get(i).hasSameTypeAndLabel(s1.get(j))) ...
[ "public", "static", "List", "<", "int", "[", "]", ">", "longestCommonSubsequenceWithTypeAndLabel", "(", "List", "<", "ITree", ">", "s0", ",", "List", "<", "ITree", ">", "s1", ")", "{", "int", "[", "]", "[", "]", "lengths", "=", "new", "int", "[", "s0...
Returns the longest common subsequence between the two list of nodes. This version use type and label to ensure equality. @see ITree#hasSameTypeAndLabel(ITree) @return a list of size 2 int arrays that corresponds to match of index in sequence 1 to index in sequence 2.
[ "Returns", "the", "longest", "common", "subsequence", "between", "the", "two", "list", "of", "nodes", ".", "This", "version", "use", "type", "and", "label", "to", "ensure", "equality", "." ]
train
https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java#L111-L121
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java
Logger.entering
public void entering(String sourceClass, String sourceMethod, Object params[]) { """ Log a method entry, with an array of parameters. <p> This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY" (followed by a format {N} indicator for each entry in the parameter...
java
public void entering(String sourceClass, String sourceMethod, Object params[]) { if (Level.FINER.intValue() < levelValue) { return; } String msg = "ENTRY"; if (params == null ) { logp(Level.FINER, sourceClass, sourceMethod, msg); return; } ...
[ "public", "void", "entering", "(", "String", "sourceClass", ",", "String", "sourceMethod", ",", "Object", "params", "[", "]", ")", "{", "if", "(", "Level", ".", "FINER", ".", "intValue", "(", ")", "<", "levelValue", ")", "{", "return", ";", "}", "Strin...
Log a method entry, with an array of parameters. <p> This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY" (followed by a format {N} indicator for each entry in the parameter array), log level FINER, and the given sourceMethod, sourceClass, and parameters is logged. <...
[ "Log", "a", "method", "entry", "with", "an", "array", "of", "parameters", ".", "<p", ">", "This", "is", "a", "convenience", "method", "that", "can", "be", "used", "to", "log", "entry", "to", "a", "method", ".", "A", "LogRecord", "with", "message", "ENT...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java#L1066-L1079
sagiegurari/fax4j
src/main/java/org/fax4j/util/IOHelper.java
IOHelper.createWriter
public static Writer createWriter(OutputStream outputStream,String encoding) { """ This function creates and returns a new writer for the provided output stream. @param outputStream The output stream @param encoding The encoding used by the writer (null for default system encoding) @return The writer ...
java
public static Writer createWriter(OutputStream outputStream,String encoding) { //get encoding String updatedEncoding=IOHelper.getEncodingToUse(encoding); //create writer Writer writer=null; try { writer=new OutputStreamWriter(outputStream,updatedE...
[ "public", "static", "Writer", "createWriter", "(", "OutputStream", "outputStream", ",", "String", "encoding", ")", "{", "//get encoding", "String", "updatedEncoding", "=", "IOHelper", ".", "getEncodingToUse", "(", "encoding", ")", ";", "//create writer", "Writer", "...
This function creates and returns a new writer for the provided output stream. @param outputStream The output stream @param encoding The encoding used by the writer (null for default system encoding) @return The writer
[ "This", "function", "creates", "and", "returns", "a", "new", "writer", "for", "the", "provided", "output", "stream", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/IOHelper.java#L264-L281
xvik/generics-resolver
src/main/java/ru/vyarus/java/generics/resolver/util/walk/AssignabilityTypesVisitor.java
AssignabilityTypesVisitor.checkLowerBounds
private boolean checkLowerBounds(final Type one, final Type two) { """ Check lower bounded wildcard cases. Method is not called if upper bounds are not assignable. <p> When left is not lower bound - compatibility will be checked by type walker and when compatible always assignable. For example, String compatibl...
java
private boolean checkLowerBounds(final Type one, final Type two) { final boolean res; // ? super Object is impossible here due to types cleanup in tree walker if (notLowerBounded(one)) { // walker will check compatibility, and compatible type is always assignable to lower bounded wil...
[ "private", "boolean", "checkLowerBounds", "(", "final", "Type", "one", ",", "final", "Type", "two", ")", "{", "final", "boolean", "res", ";", "// ? super Object is impossible here due to types cleanup in tree walker", "if", "(", "notLowerBounded", "(", "one", ")", ")"...
Check lower bounded wildcard cases. Method is not called if upper bounds are not assignable. <p> When left is not lower bound - compatibility will be checked by type walker and when compatible always assignable. For example, String compatible (and assignable) with ? super String and Integer is not compatible with ? sup...
[ "Check", "lower", "bounded", "wildcard", "cases", ".", "Method", "is", "not", "called", "if", "upper", "bounds", "are", "not", "assignable", ".", "<p", ">", "When", "left", "is", "not", "lower", "bound", "-", "compatibility", "will", "be", "checked", "by",...
train
https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/walk/AssignabilityTypesVisitor.java#L75-L94
craterdog/java-general-utilities
src/main/java/craterdog/utils/ByteUtils.java
ByteUtils.bytesToLong
static public long bytesToLong(byte[] buffer, int index) { """ This function converts the bytes in a byte array at the specified index to its corresponding long value. @param buffer The byte array containing the long. @param index The index for the first byte in the byte array. @return The corresponding long...
java
static public long bytesToLong(byte[] buffer, int index) { int length = buffer.length - index; if (length > 8) length = 8; long l = 0; for (int i = 0; i < length; i++) { l |= ((buffer[index + length - i - 1] & 0xFFL) << (i * 8)); } return l; }
[ "static", "public", "long", "bytesToLong", "(", "byte", "[", "]", "buffer", ",", "int", "index", ")", "{", "int", "length", "=", "buffer", ".", "length", "-", "index", ";", "if", "(", "length", ">", "8", ")", "length", "=", "8", ";", "long", "l", ...
This function converts the bytes in a byte array at the specified index to its corresponding long value. @param buffer The byte array containing the long. @param index The index for the first byte in the byte array. @return The corresponding long value.
[ "This", "function", "converts", "the", "bytes", "in", "a", "byte", "array", "at", "the", "specified", "index", "to", "its", "corresponding", "long", "value", "." ]
train
https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L309-L317
paypal/SeLion
client/src/main/java/com/paypal/selion/configuration/ListenerInfo.java
ListenerInfo.getBooleanValFromVMArg
static boolean getBooleanValFromVMArg(String vmArgValue, boolean defaultStateWhenNotDefined) { """ Returns boolean value of the JVM argument when defined, else returns the {@code defaultStateWhenNotDefined}. @param vmArgValue The VM argument name. @param defaultStateWhenNotDefined A boolean to indicate defau...
java
static boolean getBooleanValFromVMArg(String vmArgValue, boolean defaultStateWhenNotDefined) { String sysProperty = System.getProperty(vmArgValue); boolean flag = defaultStateWhenNotDefined; if ((sysProperty != null) && (!sysProperty.isEmpty())) { flag = Boolean.parseBoolean(sysPrope...
[ "static", "boolean", "getBooleanValFromVMArg", "(", "String", "vmArgValue", ",", "boolean", "defaultStateWhenNotDefined", ")", "{", "String", "sysProperty", "=", "System", ".", "getProperty", "(", "vmArgValue", ")", ";", "boolean", "flag", "=", "defaultStateWhenNotDef...
Returns boolean value of the JVM argument when defined, else returns the {@code defaultStateWhenNotDefined}. @param vmArgValue The VM argument name. @param defaultStateWhenNotDefined A boolean to indicate default state of the listener.
[ "Returns", "boolean", "value", "of", "the", "JVM", "argument", "when", "defined", "else", "returns", "the", "{", "@code", "defaultStateWhenNotDefined", "}", "." ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/ListenerInfo.java#L95-L102
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java
EvaluationBinary.falseNegativeRate
public double falseNegativeRate(Integer classLabel, double edgeCase) { """ Returns the false negative rate for a given label @param classLabel the label @param edgeCase What to output in case of 0/0 @return fnr as a double """ double fnCount = falseNegatives(classLabel); double tpCount =...
java
public double falseNegativeRate(Integer classLabel, double edgeCase) { double fnCount = falseNegatives(classLabel); double tpCount = truePositives(classLabel); return EvaluationUtils.falseNegativeRate((long) fnCount, (long) tpCount, edgeCase); }
[ "public", "double", "falseNegativeRate", "(", "Integer", "classLabel", ",", "double", "edgeCase", ")", "{", "double", "fnCount", "=", "falseNegatives", "(", "classLabel", ")", ";", "double", "tpCount", "=", "truePositives", "(", "classLabel", ")", ";", "return",...
Returns the false negative rate for a given label @param classLabel the label @param edgeCase What to output in case of 0/0 @return fnr as a double
[ "Returns", "the", "false", "negative", "rate", "for", "a", "given", "label" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/EvaluationBinary.java#L495-L500
pac4j/pac4j
pac4j-saml/src/main/java/org/pac4j/saml/util/SAML2Utils.java
SAML2Utils.urisEqualAfterPortNormalization
public static boolean urisEqualAfterPortNormalization(final URI uri1, final URI uri2) { """ Compares two URIs for equality, ignoring default port numbers for selected protocols. By default, {@link URI#equals(Object)} doesn't take into account default port numbers, so http://server:80/resource is a different UR...
java
public static boolean urisEqualAfterPortNormalization(final URI uri1, final URI uri2) { if (uri1 == null && uri2 == null) { return true; } if (uri1 == null || uri2 == null) { return false; } try { URI normalizedUri1 = normalizePortNumb...
[ "public", "static", "boolean", "urisEqualAfterPortNormalization", "(", "final", "URI", "uri1", ",", "final", "URI", "uri2", ")", "{", "if", "(", "uri1", "==", "null", "&&", "uri2", "==", "null", ")", "{", "return", "true", ";", "}", "if", "(", "uri1", ...
Compares two URIs for equality, ignoring default port numbers for selected protocols. By default, {@link URI#equals(Object)} doesn't take into account default port numbers, so http://server:80/resource is a different URI than http://server/resource. And URLs should not be used for comparison, as written here: http://...
[ "Compares", "two", "URIs", "for", "equality", "ignoring", "default", "port", "numbers", "for", "selected", "protocols", "." ]
train
https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/util/SAML2Utils.java#L49-L66
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesInner.java
MediaServicesInner.regenerateKey
public RegenerateKeyOutputInner regenerateKey(String resourceGroupName, String mediaServiceName, KeyType keyType) { """ Regenerates a primary or secondary key for a Media Service. @param resourceGroupName Name of the resource group within the Azure subscription. @param mediaServiceName Name of the Media Servic...
java
public RegenerateKeyOutputInner regenerateKey(String resourceGroupName, String mediaServiceName, KeyType keyType) { return regenerateKeyWithServiceResponseAsync(resourceGroupName, mediaServiceName, keyType).toBlocking().single().body(); }
[ "public", "RegenerateKeyOutputInner", "regenerateKey", "(", "String", "resourceGroupName", ",", "String", "mediaServiceName", ",", "KeyType", "keyType", ")", "{", "return", "regenerateKeyWithServiceResponseAsync", "(", "resourceGroupName", ",", "mediaServiceName", ",", "key...
Regenerates a primary or secondary key for a Media Service. @param resourceGroupName Name of the resource group within the Azure subscription. @param mediaServiceName Name of the Media Service. @param keyType The keyType indicating which key you want to regenerate, Primary or Secondary. Possible values include: 'Prima...
[ "Regenerates", "a", "primary", "or", "secondary", "key", "for", "a", "Media", "Service", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2015_10_01/src/main/java/com/microsoft/azure/management/mediaservices/v2015_10_01/implementation/MediaServicesInner.java#L647-L649
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/index/btree/BTreeDir.java
BTreeDir.makeNewRoot
public void makeNewRoot(DirEntry e) { """ Creates a new root block for the B-tree. The new root will have two children: the old root, and the specified block. Since the root must always be in block 0 of the file, the contents of block 0 will get transferred to a new block (serving as the old root). @param e ...
java
public void makeNewRoot(DirEntry e) { // makes sure it is opening the root block if (currentPage.currentBlk().number() != 0) { currentPage.close(); currentPage = new BTreePage(new BlockId(currentPage.currentBlk().fileName(), 0), NUM_FLAGS, schema, tx); } SearchKey firstKey = getKey(current...
[ "public", "void", "makeNewRoot", "(", "DirEntry", "e", ")", "{", "// makes sure it is opening the root block\r", "if", "(", "currentPage", ".", "currentBlk", "(", ")", ".", "number", "(", ")", "!=", "0", ")", "{", "currentPage", ".", "close", "(", ")", ";", ...
Creates a new root block for the B-tree. The new root will have two children: the old root, and the specified block. Since the root must always be in block 0 of the file, the contents of block 0 will get transferred to a new block (serving as the old root). @param e the directory entry to be added as a child of the ne...
[ "Creates", "a", "new", "root", "block", "for", "the", "B", "-", "tree", ".", "The", "new", "root", "will", "have", "two", "children", ":", "the", "old", "root", "and", "the", "specified", "block", ".", "Since", "the", "root", "must", "always", "be", ...
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/index/btree/BTreeDir.java#L186-L202
stripe/stripe-android
stripe/src/main/java/com/stripe/android/model/SourceParams.java
SourceParams.setMetaData
@NonNull public SourceParams setMetaData(@NonNull Map<String, String> metaData) { """ Set custom metadata on the parameters. @param metaData @return {@code this}, for chaining purposes """ mMetaData = metaData; return this; }
java
@NonNull public SourceParams setMetaData(@NonNull Map<String, String> metaData) { mMetaData = metaData; return this; }
[ "@", "NonNull", "public", "SourceParams", "setMetaData", "(", "@", "NonNull", "Map", "<", "String", ",", "String", ">", "metaData", ")", "{", "mMetaData", "=", "metaData", ";", "return", "this", ";", "}" ]
Set custom metadata on the parameters. @param metaData @return {@code this}, for chaining purposes
[ "Set", "custom", "metadata", "on", "the", "parameters", "." ]
train
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/model/SourceParams.java#L805-L809
Netflix/conductor
grpc-server/src/main/java/com/netflix/conductor/grpc/server/service/GRPCHelper.java
GRPCHelper.optionalOr
String optionalOr(@Nonnull String str, String defaults) { """ Check if a given non-null String instance is "missing" according to ProtoBuf's missing field rules. If the String is missing, the given default value will be returned. Otherwise, the string itself will be returned. @param str the input String @par...
java
String optionalOr(@Nonnull String str, String defaults) { return str.isEmpty() ? defaults : str; }
[ "String", "optionalOr", "(", "@", "Nonnull", "String", "str", ",", "String", "defaults", ")", "{", "return", "str", ".", "isEmpty", "(", ")", "?", "defaults", ":", "str", ";", "}" ]
Check if a given non-null String instance is "missing" according to ProtoBuf's missing field rules. If the String is missing, the given default value will be returned. Otherwise, the string itself will be returned. @param str the input String @param defaults the default value for the string @return 'str' if it is not ...
[ "Check", "if", "a", "given", "non", "-", "null", "String", "instance", "is", "missing", "according", "to", "ProtoBuf", "s", "missing", "field", "rules", ".", "If", "the", "String", "is", "missing", "the", "given", "default", "value", "will", "be", "returne...
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/grpc-server/src/main/java/com/netflix/conductor/grpc/server/service/GRPCHelper.java#L123-L125
jenkinsci/gmaven
gmaven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java
MojoSupport.resolveArtifact
protected Artifact resolveArtifact(final Artifact artifact, final boolean transitive) throws MojoExecutionException { """ Resolves the Artifact from the remote repository if necessary. If no version is specified, it will be retrieved from the dependency list or from the DependencyManagement section of the pom. ...
java
protected Artifact resolveArtifact(final Artifact artifact, final boolean transitive) throws MojoExecutionException { assert artifact != null; try { if (transitive) { artifactResolver.resolveTransitively( Collections.singleton(artifact), ...
[ "protected", "Artifact", "resolveArtifact", "(", "final", "Artifact", "artifact", ",", "final", "boolean", "transitive", ")", "throws", "MojoExecutionException", "{", "assert", "artifact", "!=", "null", ";", "try", "{", "if", "(", "transitive", ")", "{", "artifa...
Resolves the Artifact from the remote repository if necessary. If no version is specified, it will be retrieved from the dependency list or from the DependencyManagement section of the pom. @param artifact The artifact to be resolved; must not be null @param transitive True to resolve the artifact transitively...
[ "Resolves", "the", "Artifact", "from", "the", "remote", "repository", "if", "necessary", ".", "If", "no", "version", "is", "specified", "it", "will", "be", "retrieved", "from", "the", "dependency", "list", "or", "from", "the", "DependencyManagement", "section", ...
train
https://github.com/jenkinsci/gmaven/blob/80d5f6657e15b3e05ffbb82128ed8bb280836e10/gmaven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java#L255-L282
baratine/baratine
web/src/main/java/com/caucho/v5/http/dispatch/InvocationManager.java
InvocationManager.buildInvocation
public I buildInvocation(Object protocolKey, I invocation) throws ConfigException { """ Builds the invocation, saving its value keyed by the protocol key. @param protocolKey protocol-specific key to save the invocation in @param invocation the invocation to build. """ Objects.requireNonNull(invocat...
java
public I buildInvocation(Object protocolKey, I invocation) throws ConfigException { Objects.requireNonNull(invocation); invocation = buildInvocation(invocation); // XXX: see if can remove this, and rely on the invocation cache existing LruCache<Object,I> invocationCache = _invocationCache; ...
[ "public", "I", "buildInvocation", "(", "Object", "protocolKey", ",", "I", "invocation", ")", "throws", "ConfigException", "{", "Objects", ".", "requireNonNull", "(", "invocation", ")", ";", "invocation", "=", "buildInvocation", "(", "invocation", ")", ";", "// X...
Builds the invocation, saving its value keyed by the protocol key. @param protocolKey protocol-specific key to save the invocation in @param invocation the invocation to build.
[ "Builds", "the", "invocation", "saving", "its", "value", "keyed", "by", "the", "protocol", "key", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/dispatch/InvocationManager.java#L157-L182
aoindustries/aocode-public
src/main/java/com/aoindustries/servlet/http/Includer.java
Includer.setLocation
public static void setLocation(HttpServletRequest request, HttpServletResponse response, String location) { """ Sets a Location header. When not in an included page, calls setHeader directly. When inside of an include will set request attribute so outermost include can call setHeader. """ if(request.getAtt...
java
public static void setLocation(HttpServletRequest request, HttpServletResponse response, String location) { if(request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null) { // Not included, setHeader directly response.setHeader("Location", location); } else { // Is included, set attribute so top leve...
[ "public", "static", "void", "setLocation", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "String", "location", ")", "{", "if", "(", "request", ".", "getAttribute", "(", "IS_INCLUDED_REQUEST_ATTRIBUTE_NAME", ")", "==", "null", ")"...
Sets a Location header. When not in an included page, calls setHeader directly. When inside of an include will set request attribute so outermost include can call setHeader.
[ "Sets", "a", "Location", "header", ".", "When", "not", "in", "an", "included", "page", "calls", "setHeader", "directly", ".", "When", "inside", "of", "an", "include", "will", "set", "request", "attribute", "so", "outermost", "include", "can", "call", "setHea...
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Includer.java#L127-L135
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/Scenario3DPortrayal.java
Scenario3DPortrayal.situateDevice
public void situateDevice(Device d, double x, double y, double z) { """ To place a device in the simulation @param d @param x @param y @param z """ devices.setObjectLocation(d, new Double3D(x, y, z)); }
java
public void situateDevice(Device d, double x, double y, double z) { devices.setObjectLocation(d, new Double3D(x, y, z)); }
[ "public", "void", "situateDevice", "(", "Device", "d", ",", "double", "x", ",", "double", "y", ",", "double", "z", ")", "{", "devices", ".", "setObjectLocation", "(", "d", ",", "new", "Double3D", "(", "x", ",", "y", ",", "z", ")", ")", ";", "}" ]
To place a device in the simulation @param d @param x @param y @param z
[ "To", "place", "a", "device", "in", "the", "simulation" ]
train
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/Scenario3DPortrayal.java#L181-L183
pippo-java/pippo
pippo-core/src/main/java/ro/pippo/core/PippoSettings.java
PippoSettings.getInteger
public int getInteger(String name, int defaultValue) { """ Returns the integer value for the specified name. If the name does not exist or the value for the name can not be interpreted as an integer, the defaultValue is returned. @param name @param defaultValue @return name value or defaultValue """ ...
java
public int getInteger(String name, int defaultValue) { try { String value = getString(name, null); if (!StringUtils.isNullOrEmpty(value)) { return Integer.parseInt(value.trim()); } } catch (NumberFormatException e) { log.warn("Failed to par...
[ "public", "int", "getInteger", "(", "String", "name", ",", "int", "defaultValue", ")", "{", "try", "{", "String", "value", "=", "getString", "(", "name", ",", "null", ")", ";", "if", "(", "!", "StringUtils", ".", "isNullOrEmpty", "(", "value", ")", ")"...
Returns the integer value for the specified name. If the name does not exist or the value for the name can not be interpreted as an integer, the defaultValue is returned. @param name @param defaultValue @return name value or defaultValue
[ "Returns", "the", "integer", "value", "for", "the", "specified", "name", ".", "If", "the", "name", "does", "not", "exist", "or", "the", "value", "for", "the", "name", "can", "not", "be", "interpreted", "as", "an", "integer", "the", "defaultValue", "is", ...
train
https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L495-L507
aws/aws-cloudtrail-processing-library
src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/EventReaderFactory.java
EventReaderFactory.createReader
public EventReader createReader() { """ Create an instance of an {@link EventReader}. @return the {@link EventReader}. """ return new EventReader(eventsProcessor, sourceFilter, eventFilter, progressReporter, exceptionHandler, sqsManager, s3Manager, config); }
java
public EventReader createReader() { return new EventReader(eventsProcessor, sourceFilter, eventFilter, progressReporter, exceptionHandler, sqsManager, s3Manager, config); }
[ "public", "EventReader", "createReader", "(", ")", "{", "return", "new", "EventReader", "(", "eventsProcessor", ",", "sourceFilter", ",", "eventFilter", ",", "progressReporter", ",", "exceptionHandler", ",", "sqsManager", ",", "s3Manager", ",", "config", ")", ";",...
Create an instance of an {@link EventReader}. @return the {@link EventReader}.
[ "Create", "an", "instance", "of", "an", "{", "@link", "EventReader", "}", "." ]
train
https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/factory/EventReaderFactory.java#L130-L132
alexa/alexa-skills-kit-sdk-for-java
ask-sdk-core/src/com/amazon/ask/attributes/AttributesManager.java
AttributesManager.setPersistentAttributes
public void setPersistentAttributes(Map<String, Object> persistentAttributes) { """ Sets persistent attributes. The attributes set using this method will replace any existing persistent attributes, but the changes will not be persisted back until {@link #savePersistentAttributes()} is called. Use this method whe...
java
public void setPersistentAttributes(Map<String, Object> persistentAttributes) { if (persistenceAdapter == null) { throw new IllegalStateException("Attempting to set persistence attributes without configured persistence adapter"); } this.persistentAttributes = persistentAttributes; ...
[ "public", "void", "setPersistentAttributes", "(", "Map", "<", "String", ",", "Object", ">", "persistentAttributes", ")", "{", "if", "(", "persistenceAdapter", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Attempting to set persistence attrib...
Sets persistent attributes. The attributes set using this method will replace any existing persistent attributes, but the changes will not be persisted back until {@link #savePersistentAttributes()} is called. Use this method when bulk replacing attributes is desired. An exception is thrown if this method is called whe...
[ "Sets", "persistent", "attributes", ".", "The", "attributes", "set", "using", "this", "method", "will", "replace", "any", "existing", "persistent", "attributes", "but", "the", "changes", "will", "not", "be", "persisted", "back", "until", "{", "@link", "#savePers...
train
https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/c49194da0693898c70f3f2c4a372f5a12da04e3e/ask-sdk-core/src/com/amazon/ask/attributes/AttributesManager.java#L149-L155
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelV1ServerState.java
PaymentChannelV1ServerState.provideRefundTransaction
public synchronized byte[] provideRefundTransaction(Transaction refundTx, byte[] clientMultiSigPubKey) throws VerificationException { """ Called when the client provides the refund transaction. The refund transaction must have one input from the multisig contract (that we don't have yet) and one output that the ...
java
public synchronized byte[] provideRefundTransaction(Transaction refundTx, byte[] clientMultiSigPubKey) throws VerificationException { checkNotNull(refundTx); checkNotNull(clientMultiSigPubKey); stateMachine.checkState(State.WAITING_FOR_REFUND_TRANSACTION); log.info("Provided with refund ...
[ "public", "synchronized", "byte", "[", "]", "provideRefundTransaction", "(", "Transaction", "refundTx", ",", "byte", "[", "]", "clientMultiSigPubKey", ")", "throws", "VerificationException", "{", "checkNotNull", "(", "refundTx", ")", ";", "checkNotNull", "(", "clien...
Called when the client provides the refund transaction. The refund transaction must have one input from the multisig contract (that we don't have yet) and one output that the client creates to themselves. This object will later be modified when we start getting paid. @param refundTx The refund transaction, this object...
[ "Called", "when", "the", "client", "provides", "the", "refund", "transaction", ".", "The", "refund", "transaction", "must", "have", "one", "input", "from", "the", "multisig", "contract", "(", "that", "we", "don", "t", "have", "yet", ")", "and", "one", "out...
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelV1ServerState.java#L124-L158
finmath/finmath-lib
src/main/java6/net/finmath/marketdata/model/curves/HazardCurve.java
HazardCurve.createHazardCurveFromSurvivalProbabilities
public static HazardCurve createHazardCurveFromSurvivalProbabilities( String name, double[] times, double[] givenSurvivalProbabilities, InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) { """ Create a hazard curve from given times...
java
public static HazardCurve createHazardCurveFromSurvivalProbabilities( String name, double[] times, double[] givenSurvivalProbabilities, InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) { boolean[] isParameter = new boolean[times.le...
[ "public", "static", "HazardCurve", "createHazardCurveFromSurvivalProbabilities", "(", "String", "name", ",", "double", "[", "]", "times", ",", "double", "[", "]", "givenSurvivalProbabilities", ",", "InterpolationMethod", "interpolationMethod", ",", "ExtrapolationMethod", ...
Create a hazard curve from given times and given survival probabilities using given interpolation and extrapolation methods. @param name The name of this hazard curve. @param times Array of times as doubles. @param givenSurvivalProbabilities Array of corresponding survival probabilities. @param interpolationMethod The...
[ "Create", "a", "hazard", "curve", "from", "given", "times", "and", "given", "survival", "probabilities", "using", "given", "interpolation", "and", "extrapolation", "methods", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/HazardCurve.java#L129-L142
lessthanoptimal/ejml
main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholderTran_ZDRM.java
QRDecompositionHouseholderTran_ZDRM.getQ
@Override public ZMatrixRMaj getQ(ZMatrixRMaj Q , boolean compact ) { """ Computes the Q matrix from the information stored in the QR matrix. This operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops. @param Q The orthogonal Q matrix. """ if( compact ) Q ...
java
@Override public ZMatrixRMaj getQ(ZMatrixRMaj Q , boolean compact ) { if( compact ) Q = UtilDecompositons_ZDRM.checkIdentity(Q,numRows,minLength); else Q = UtilDecompositons_ZDRM.checkIdentity(Q,numRows,numRows); // Unlike applyQ() this takes advantage of zeros in th...
[ "@", "Override", "public", "ZMatrixRMaj", "getQ", "(", "ZMatrixRMaj", "Q", ",", "boolean", "compact", ")", "{", "if", "(", "compact", ")", "Q", "=", "UtilDecompositons_ZDRM", ".", "checkIdentity", "(", "Q", ",", "numRows", ",", "minLength", ")", ";", "else...
Computes the Q matrix from the information stored in the QR matrix. This operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops. @param Q The orthogonal Q matrix.
[ "Computes", "the", "Q", "matrix", "from", "the", "information", "stored", "in", "the", "QR", "matrix", ".", "This", "operation", "requires", "about", "4", "(", "m<sup", ">", "2<", "/", "sup", ">", "n", "-", "mn<sup", ">", "2<", "/", "sup", ">", "+", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholderTran_ZDRM.java#L100-L124
gosu-lang/gosu-lang
gosu-core-api/src/main/java/gw/util/GosuStringUtil.java
GosuStringUtil.substringBetween
public static String substringBetween(String str, String tag) { """ <p>Gets the String that is nested in between two instances of the same String.</p> <p>A <code>null</code> input String returns <code>null</code>. A <code>null</code> tag returns <code>null</code>.</p> <pre> GosuStringUtil.substringBetween...
java
public static String substringBetween(String str, String tag) { return substringBetween(str, tag, tag); }
[ "public", "static", "String", "substringBetween", "(", "String", "str", ",", "String", "tag", ")", "{", "return", "substringBetween", "(", "str", ",", "tag", ",", "tag", ")", ";", "}" ]
<p>Gets the String that is nested in between two instances of the same String.</p> <p>A <code>null</code> input String returns <code>null</code>. A <code>null</code> tag returns <code>null</code>.</p> <pre> GosuStringUtil.substringBetween(null, *) = null GosuStringUtil.substringBetween("", "") ...
[ "<p", ">", "Gets", "the", "String", "that", "is", "nested", "in", "between", "two", "instances", "of", "the", "same", "String", ".", "<", "/", "p", ">" ]
train
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L1899-L1901
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/Utils.java
Utils.dumpClass
public static void dumpClass(String file, byte[] bytes) { """ Dump some bytes into the specified file. @param file full filename for where to dump the stuff (e.g. c:/temp/Foo.class) @param bytes the bytes to write to the file """ File f = new File(file); try { FileOutputStream fos = new FileOutputSt...
java
public static void dumpClass(String file, byte[] bytes) { File f = new File(file); try { FileOutputStream fos = new FileOutputStream(f); fos.write(bytes); fos.flush(); fos.close(); } catch (IOException ioe) { ioe.printStackTrace(); } }
[ "public", "static", "void", "dumpClass", "(", "String", "file", ",", "byte", "[", "]", "bytes", ")", "{", "File", "f", "=", "new", "File", "(", "file", ")", ";", "try", "{", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "f", ")", ";...
Dump some bytes into the specified file. @param file full filename for where to dump the stuff (e.g. c:/temp/Foo.class) @param bytes the bytes to write to the file
[ "Dump", "some", "bytes", "into", "the", "specified", "file", "." ]
train
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L1200-L1211
ben-manes/caffeine
caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java
BoundedLocalCache.afterRead
void afterRead(Node<K, V> node, long now, boolean recordHit) { """ Performs the post-processing work required after a read. @param node the entry in the page replacement policy @param now the current time, in nanoseconds @param recordHit if the hit count should be incremented """ if (recordHit) { ...
java
void afterRead(Node<K, V> node, long now, boolean recordHit) { if (recordHit) { statsCounter().recordHits(1); } boolean delayable = skipReadBuffer() || (readBuffer.offer(node) != Buffer.FULL); if (shouldDrainBuffers(delayable)) { scheduleDrainBuffers(); } refreshIfNeeded(node, now);...
[ "void", "afterRead", "(", "Node", "<", "K", ",", "V", ">", "node", ",", "long", "now", ",", "boolean", "recordHit", ")", "{", "if", "(", "recordHit", ")", "{", "statsCounter", "(", ")", ".", "recordHits", "(", "1", ")", ";", "}", "boolean", "delaya...
Performs the post-processing work required after a read. @param node the entry in the page replacement policy @param now the current time, in nanoseconds @param recordHit if the hit count should be incremented
[ "Performs", "the", "post", "-", "processing", "work", "required", "after", "a", "read", "." ]
train
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java#L1106-L1116
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldLayoutRenderer.java
WFieldLayoutRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { """ Paints the given WFieldLayout. @param component the WFieldLayout to paint. @param renderContext the RenderContext to paint to. """ WFieldLayout fieldLayout = (WFieldLayout) component; XmlStringBui...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WFieldLayout fieldLayout = (WFieldLayout) component; XmlStringBuilder xml = renderContext.getWriter(); int labelWidth = fieldLayout.getLabelWidth(); String title = fieldLayout.getTitle(); xml.appendTagOpen(...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WFieldLayout", "fieldLayout", "=", "(", "WFieldLayout", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WFieldLayout. @param component the WFieldLayout to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WFieldLayout", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldLayoutRenderer.java#L23-L51
Azure/azure-sdk-for-java
iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java
IotHubResourcesInner.listKeysAsync
public Observable<Page<SharedAccessSignatureAuthorizationRuleInner>> listKeysAsync(final String resourceGroupName, final String resourceName) { """ Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. Get the security metadata for...
java
public Observable<Page<SharedAccessSignatureAuthorizationRuleInner>> listKeysAsync(final String resourceGroupName, final String resourceName) { return listKeysWithServiceResponseAsync(resourceGroupName, resourceName) .map(new Func1<ServiceResponse<Page<SharedAccessSignatureAuthorizationRuleInner>>, ...
[ "public", "Observable", "<", "Page", "<", "SharedAccessSignatureAuthorizationRuleInner", ">", ">", "listKeysAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "resourceName", ")", "{", "return", "listKeysWithServiceResponseAsync", "(", "resourceG...
Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. @param resourceGroupName The name of the reso...
[ "Get", "the", "security", "metadata", "for", "an", "IoT", "hub", ".", "For", "more", "information", "see", ":", "https", ":", "//", "docs", ".", "microsoft", ".", "com", "/", "azure", "/", "iot", "-", "hub", "/", "iot", "-", "hub", "-", "devguide", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L2882-L2890
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_resource_hw.java
xen_health_resource_hw.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ xen_health_resource_hw_responses result = (xen_health_resource_hw_respo...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { xen_health_resource_hw_responses result = (xen_health_resource_hw_responses) service.get_payload_formatter().string_to_resource(xen_health_resource_hw_responses.class, response); if(result.errorcode != 0...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "xen_health_resource_hw_responses", "result", "=", "(", "xen_health_resource_hw_responses", ")", "service", ".",...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_resource_hw.java#L173-L190
lucee/Lucee
core/src/main/java/lucee/runtime/converter/WDDXConverter.java
WDDXConverter._deserializeQueryField
private void _deserializeQueryField(Query query, Element field) throws PageException, ConverterException { """ deserilize a single Field of a query WDDX Object @param query @param field @throws ConverterException @throws PageException """ String name = field.getAttribute("name"); NodeList list = field....
java
private void _deserializeQueryField(Query query, Element field) throws PageException, ConverterException { String name = field.getAttribute("name"); NodeList list = field.getChildNodes(); int len = list.getLength(); int count = 0; for (int i = 0; i < len; i++) { Node node = list.item(i); if (node instanc...
[ "private", "void", "_deserializeQueryField", "(", "Query", "query", ",", "Element", "field", ")", "throws", "PageException", ",", "ConverterException", "{", "String", "name", "=", "field", ".", "getAttribute", "(", "\"name\"", ")", ";", "NodeList", "list", "=", ...
deserilize a single Field of a query WDDX Object @param query @param field @throws ConverterException @throws PageException
[ "deserilize", "a", "single", "Field", "of", "a", "query", "WDDX", "Object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/WDDXConverter.java#L702-L714
jpelzer/pelzer-util
src/main/java/com/pelzer/util/StringMan.java
StringMan.detokenize
public static String detokenize(String[] values, String delimiter) { """ Converts a string array into a single string with values delimited by the specified delimiter. """ return concat(values, delimiter, 0, values.length - 1); }
java
public static String detokenize(String[] values, String delimiter) { return concat(values, delimiter, 0, values.length - 1); }
[ "public", "static", "String", "detokenize", "(", "String", "[", "]", "values", ",", "String", "delimiter", ")", "{", "return", "concat", "(", "values", ",", "delimiter", ",", "0", ",", "values", ".", "length", "-", "1", ")", ";", "}" ]
Converts a string array into a single string with values delimited by the specified delimiter.
[ "Converts", "a", "string", "array", "into", "a", "single", "string", "with", "values", "delimited", "by", "the", "specified", "delimiter", "." ]
train
https://github.com/jpelzer/pelzer-util/blob/ec14f2573fd977d1442dba5d1507a264f5ea9aa6/src/main/java/com/pelzer/util/StringMan.java#L466-L468
io7m/jaffirm
com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java
Preconditions.checkPreconditionI
public static int checkPreconditionI( final int value, final boolean condition, final IntFunction<String> describer) { """ An {@code int} specialized version of {@link #checkPrecondition(Object, boolean, Function)}. @param value The value @param condition The predicate @param describer The de...
java
public static int checkPreconditionI( final int value, final boolean condition, final IntFunction<String> describer) { return innerCheckI(value, condition, describer); }
[ "public", "static", "int", "checkPreconditionI", "(", "final", "int", "value", ",", "final", "boolean", "condition", ",", "final", "IntFunction", "<", "String", ">", "describer", ")", "{", "return", "innerCheckI", "(", "value", ",", "condition", ",", "describe...
An {@code int} specialized version of {@link #checkPrecondition(Object, boolean, Function)}. @param value The value @param condition The predicate @param describer The describer for the predicate @return value @throws PreconditionViolationException If the predicate is false
[ "An", "{", "@code", "int", "}", "specialized", "version", "of", "{", "@link", "#checkPrecondition", "(", "Object", "boolean", "Function", ")", "}", "." ]
train
https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java#L407-L413
andygibson/datafactory
src/main/java/org/fluttercode/datafactory/impl/DataFactory.java
DataFactory.getRandomWord
public String getRandomWord(final int minLength, final int maxLength) { """ Returns a valid word based on the length range passed in. The length will always be between the min and max length range inclusive. @param minLength minimum length of the word @param maxLength maximum length of the word @return a wor...
java
public String getRandomWord(final int minLength, final int maxLength) { validateMinMaxParams(minLength, maxLength); // special case if we need a single char if (maxLength == 1) { if (chance(50)) { return "a"; } return "I"; } // start from random pos and find ...
[ "public", "String", "getRandomWord", "(", "final", "int", "minLength", ",", "final", "int", "maxLength", ")", "{", "validateMinMaxParams", "(", "minLength", ",", "maxLength", ")", ";", "// special case if we need a single char\r", "if", "(", "maxLength", "==", "1", ...
Returns a valid word based on the length range passed in. The length will always be between the min and max length range inclusive. @param minLength minimum length of the word @param maxLength maximum length of the word @return a word of a length between min and max length
[ "Returns", "a", "valid", "word", "based", "on", "the", "length", "range", "passed", "in", ".", "The", "length", "will", "always", "be", "between", "the", "min", "and", "max", "length", "range", "inclusive", "." ]
train
https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L521-L545
resilience4j/resilience4j
resilience4j-metrics/src/main/java/io/github/resilience4j/metrics/BulkheadMetrics.java
BulkheadMetrics.ofBulkheadRegistry
public static BulkheadMetrics ofBulkheadRegistry(String prefix, BulkheadRegistry bulkheadRegistry) { """ Creates a new instance BulkheadMetrics {@link BulkheadMetrics} with specified metrics names prefix and a {@link BulkheadRegistry} as a source. @param prefix the prefix of metrics names @param bul...
java
public static BulkheadMetrics ofBulkheadRegistry(String prefix, BulkheadRegistry bulkheadRegistry) { return new BulkheadMetrics(prefix, bulkheadRegistry.getAllBulkheads()); }
[ "public", "static", "BulkheadMetrics", "ofBulkheadRegistry", "(", "String", "prefix", ",", "BulkheadRegistry", "bulkheadRegistry", ")", "{", "return", "new", "BulkheadMetrics", "(", "prefix", ",", "bulkheadRegistry", ".", "getAllBulkheads", "(", ")", ")", ";", "}" ]
Creates a new instance BulkheadMetrics {@link BulkheadMetrics} with specified metrics names prefix and a {@link BulkheadRegistry} as a source. @param prefix the prefix of metrics names @param bulkheadRegistry the registry of bulkheads
[ "Creates", "a", "new", "instance", "BulkheadMetrics", "{", "@link", "BulkheadMetrics", "}", "with", "specified", "metrics", "names", "prefix", "and", "a", "{", "@link", "BulkheadRegistry", "}", "as", "a", "source", "." ]
train
https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-metrics/src/main/java/io/github/resilience4j/metrics/BulkheadMetrics.java#L65-L67