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
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java
CassandraSchemaManager.onSetRepairChance
private void onSetRepairChance(CfDef cfDef, Properties cfProperties, StringBuilder builder) { """ On set repair chance. @param cfDef the cf def @param cfProperties the cf properties @param builder the builder """ String readRepairChance = cfProperties.getProperty(CassandraConstants.READ_REPAIR_...
java
private void onSetRepairChance(CfDef cfDef, Properties cfProperties, StringBuilder builder) { String readRepairChance = cfProperties.getProperty(CassandraConstants.READ_REPAIR_CHANCE); if (readRepairChance != null) { try { if (builder != null) ...
[ "private", "void", "onSetRepairChance", "(", "CfDef", "cfDef", ",", "Properties", "cfProperties", ",", "StringBuilder", "builder", ")", "{", "String", "readRepairChance", "=", "cfProperties", ".", "getProperty", "(", "CassandraConstants", ".", "READ_REPAIR_CHANCE", ")...
On set repair chance. @param cfDef the cf def @param cfProperties the cf properties @param builder the builder
[ "On", "set", "repair", "chance", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2402-L2424
apache/spark
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java
ExternalShuffleBlockResolver.getFile
@VisibleForTesting static File getFile(String[] localDirs, int subDirsPerLocalDir, String filename) { """ Hashes a filename into the corresponding local directory, in a manner consistent with Spark's DiskBlockManager.getFile(). """ int hash = JavaUtils.nonNegativeHash(filename); String localDir = lo...
java
@VisibleForTesting static File getFile(String[] localDirs, int subDirsPerLocalDir, String filename) { int hash = JavaUtils.nonNegativeHash(filename); String localDir = localDirs[hash % localDirs.length]; int subDirId = (hash / localDirs.length) % subDirsPerLocalDir; return new File(createNormalizedInt...
[ "@", "VisibleForTesting", "static", "File", "getFile", "(", "String", "[", "]", "localDirs", ",", "int", "subDirsPerLocalDir", ",", "String", "filename", ")", "{", "int", "hash", "=", "JavaUtils", ".", "nonNegativeHash", "(", "filename", ")", ";", "String", ...
Hashes a filename into the corresponding local directory, in a manner consistent with Spark's DiskBlockManager.getFile().
[ "Hashes", "a", "filename", "into", "the", "corresponding", "local", "directory", "in", "a", "manner", "consistent", "with", "Spark", "s", "DiskBlockManager", ".", "getFile", "()", "." ]
train
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java#L305-L312
davidmoten/grumpy
grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
Position.getLatitudeOnGreatCircle
public Double getLatitudeOnGreatCircle(Position position, double longitudeDegrees) { """ From http://williams.best.vwh.net/avform.htm (Latitude of point on GC). @param position @param longitudeDegrees @return """ double lonR = toRadians(longitudeDegrees); double lat1R = toRadians(lat); ...
java
public Double getLatitudeOnGreatCircle(Position position, double longitudeDegrees) { double lonR = toRadians(longitudeDegrees); double lat1R = toRadians(lat); double lon1R = toRadians(lon); double lat2R = toRadians(position.getLat()); double lon2R = toRadians(position.getLon()); ...
[ "public", "Double", "getLatitudeOnGreatCircle", "(", "Position", "position", ",", "double", "longitudeDegrees", ")", "{", "double", "lonR", "=", "toRadians", "(", "longitudeDegrees", ")", ";", "double", "lat1R", "=", "toRadians", "(", "lat", ")", ";", "double", ...
From http://williams.best.vwh.net/avform.htm (Latitude of point on GC). @param position @param longitudeDegrees @return
[ "From", "http", ":", "//", "williams", ".", "best", ".", "vwh", ".", "net", "/", "avform", ".", "htm", "(", "Latitude", "of", "point", "on", "GC", ")", "." ]
train
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L128-L147
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberFormat.java
NumberFormat.parseObject
@Override public final Object parseObject(String source, ParsePosition parsePosition) { """ Parses text from a string to produce a number. @param source the String to parse @param parsePosition the position at which to start the parse @return the parsed number, or null @...
java
@Override public final Object parseObject(String source, ParsePosition parsePosition) { return parse(source, parsePosition); }
[ "@", "Override", "public", "final", "Object", "parseObject", "(", "String", "source", ",", "ParsePosition", "parsePosition", ")", "{", "return", "parse", "(", "source", ",", "parsePosition", ")", ";", "}" ]
Parses text from a string to produce a number. @param source the String to parse @param parsePosition the position at which to start the parse @return the parsed number, or null @see java.text.NumberFormat#parseObject(String, ParsePosition)
[ "Parses", "text", "from", "a", "string", "to", "produce", "a", "number", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberFormat.java#L276-L280
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java
ULocale.acceptLanguage
public static ULocale acceptLanguage(String acceptLanguageList, boolean[] fallback) { """ <strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non...
java
public static ULocale acceptLanguage(String acceptLanguageList, boolean[] fallback) { return acceptLanguage(acceptLanguageList, ULocale.getAvailableLocales(), fallback); }
[ "public", "static", "ULocale", "acceptLanguage", "(", "String", "acceptLanguageList", ",", "boolean", "[", "]", "fallback", ")", "{", "return", "acceptLanguage", "(", "acceptLanguageList", ",", "ULocale", ".", "getAvailableLocales", "(", ")", ",", "fallback", ")",...
<strong>[icu]</strong> Based on a HTTP formatted list of acceptable locales, determine an available locale for the user. NullPointerException is thrown if acceptLanguageList or availableLocales is null. If fallback is non-null, it will contain true if a fallback locale (one not in the acceptLanguageList) was returned...
[ "<strong", ">", "[", "icu", "]", "<", "/", "strong", ">", "Based", "on", "a", "HTTP", "formatted", "list", "of", "acceptable", "locales", "determine", "an", "available", "locale", "for", "the", "user", ".", "NullPointerException", "is", "thrown", "if", "ac...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L2017-L2020
sockeqwe/AdapterDelegates
library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java
AdapterDelegatesManager.onCreateViewHolder
@NonNull public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { """ This method must be called in {@link RecyclerView.Adapter#onCreateViewHolder(ViewGroup, int)} @param parent the parent @param viewType the view type @return The new created ViewHolder @throws NullP...
java
@NonNull public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { AdapterDelegate<T> delegate = getDelegateForViewType(viewType); if (delegate == null) { throw new NullPointerException("No AdapterDelegate added for ViewType " + viewType); } ...
[ "@", "NonNull", "public", "RecyclerView", ".", "ViewHolder", "onCreateViewHolder", "(", "@", "NonNull", "ViewGroup", "parent", ",", "int", "viewType", ")", "{", "AdapterDelegate", "<", "T", ">", "delegate", "=", "getDelegateForViewType", "(", "viewType", ")", ";...
This method must be called in {@link RecyclerView.Adapter#onCreateViewHolder(ViewGroup, int)} @param parent the parent @param viewType the view type @return The new created ViewHolder @throws NullPointerException if no AdapterDelegate has been registered for ViewHolders viewType
[ "This", "method", "must", "be", "called", "in", "{", "@link", "RecyclerView", ".", "Adapter#onCreateViewHolder", "(", "ViewGroup", "int", ")", "}" ]
train
https://github.com/sockeqwe/AdapterDelegates/blob/d18dc609415e5d17a3354bddf4bae62440e017af/library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java#L245-L261
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/vod/VodClient.java
VodClient.generateMediaDeliveryInfo
public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo(String mediaId, String transcodingPresetName) { """ Generate media delivery info by media ID. <p> The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair. @param mediaId The unique ID for each media resource @return...
java
public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo(String mediaId, String transcodingPresetName) { GenerateMediaDeliveryInfoRequest request = new GenerateMediaDeliveryInfoRequest() .withMediaId(mediaId) .withTranscodingPresetName(transcodingPresetName); re...
[ "public", "GenerateMediaDeliveryInfoResponse", "generateMediaDeliveryInfo", "(", "String", "mediaId", ",", "String", "transcodingPresetName", ")", "{", "GenerateMediaDeliveryInfoRequest", "request", "=", "new", "GenerateMediaDeliveryInfoRequest", "(", ")", ".", "withMediaId", ...
Generate media delivery info by media ID. <p> The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair. @param mediaId The unique ID for each media resource @return media delivery info
[ "Generate", "media", "delivery", "info", "by", "media", "ID", ".", "<p", ">", "The", "caller", "<i", ">", "must<", "/", "i", ">", "authenticate", "with", "a", "valid", "BCE", "Access", "Key", "/", "Private", "Key", "pair", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L755-L760
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplates.java
URLTemplates.addTemplate
public void addTemplate( String templateName, URLTemplate template ) { """ Add a template from url-template-config by name. @param templateName the name of the template. @param template the template to add. """ if ( templateName == null || templateName.length() == 0 ) { throw ne...
java
public void addTemplate( String templateName, URLTemplate template ) { if ( templateName == null || templateName.length() == 0 ) { throw new IllegalArgumentException( "Template name cannot be null or empty." ); } if ( template == null ) { throw new Il...
[ "public", "void", "addTemplate", "(", "String", "templateName", ",", "URLTemplate", "template", ")", "{", "if", "(", "templateName", "==", "null", "||", "templateName", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", ...
Add a template from url-template-config by name. @param templateName the name of the template. @param template the template to add.
[ "Add", "a", "template", "from", "url", "-", "template", "-", "config", "by", "name", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplates.java#L41-L54
artikcloud/artikcloud-java
src/main/java/cloud/artik/api/DevicesStatusApi.java
DevicesStatusApi.getDeviceStatus
public DeviceStatus getDeviceStatus(String deviceId, Boolean includeSnapshot, Boolean includeSnapshotTimestamp) throws ApiException { """ Get Device Status Get Device Status @param deviceId Device ID. (required) @param includeSnapshot Include device snapshot into the response (optional) @param includeSnapshotT...
java
public DeviceStatus getDeviceStatus(String deviceId, Boolean includeSnapshot, Boolean includeSnapshotTimestamp) throws ApiException { ApiResponse<DeviceStatus> resp = getDeviceStatusWithHttpInfo(deviceId, includeSnapshot, includeSnapshotTimestamp); return resp.getData(); }
[ "public", "DeviceStatus", "getDeviceStatus", "(", "String", "deviceId", ",", "Boolean", "includeSnapshot", ",", "Boolean", "includeSnapshotTimestamp", ")", "throws", "ApiException", "{", "ApiResponse", "<", "DeviceStatus", ">", "resp", "=", "getDeviceStatusWithHttpInfo", ...
Get Device Status Get Device Status @param deviceId Device ID. (required) @param includeSnapshot Include device snapshot into the response (optional) @param includeSnapshotTimestamp Include device snapshot timestamp into the response (optional) @return DeviceStatus @throws ApiException If fail to call the API, e.g. ser...
[ "Get", "Device", "Status", "Get", "Device", "Status" ]
train
https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesStatusApi.java#L132-L135
m-m-m/util
xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java
XmlBeanMapper.saveXml
public void saveXml(T jaxbBean, String locationUrl) { """ This method saves the given {@code jaxbBean} as XML to the given {@code locationUrl}. <br> @param jaxbBean is the JAXB-bean to save as XML. @param locationUrl is the location URL for the {@link BrowsableResource resource} where to write the XML to. Typ...
java
public void saveXml(T jaxbBean, String locationUrl) { BrowsableResource resource = this.resourceFactory.createBrowsableResource(locationUrl); OutputStream outputStream = resource.openOutputStream(); try { saveXml(jaxbBean, outputStream); } finally { try { outputStream.close(); ...
[ "public", "void", "saveXml", "(", "T", "jaxbBean", ",", "String", "locationUrl", ")", "{", "BrowsableResource", "resource", "=", "this", ".", "resourceFactory", ".", "createBrowsableResource", "(", "locationUrl", ")", ";", "OutputStream", "outputStream", "=", "res...
This method saves the given {@code jaxbBean} as XML to the given {@code locationUrl}. <br> @param jaxbBean is the JAXB-bean to save as XML. @param locationUrl is the location URL for the {@link BrowsableResource resource} where to write the XML to. Typically a file-URL.
[ "This", "method", "saves", "the", "given", "{", "@code", "jaxbBean", "}", "as", "XML", "to", "the", "given", "{", "@code", "locationUrl", "}", ".", "<br", ">" ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java#L349-L362
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_voicemail_serviceName_PUT
public void billingAccount_voicemail_serviceName_PUT(String billingAccount, String serviceName, OvhVoicemail body) throws IOException { """ Alter this object properties REST: PUT /telephony/{billingAccount}/voicemail/{serviceName} @param body [required] New object properties @param billingAccount [required] T...
java
public void billingAccount_voicemail_serviceName_PUT(String billingAccount, String serviceName, OvhVoicemail body) throws IOException { String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "billingAccount_voicemail_serviceName_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhVoicemail", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/voicemail/{serviceName}\"", ";",...
Alter this object properties REST: PUT /telephony/{billingAccount}/voicemail/{serviceName} @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7767-L7771
avianey/facebook-api-android-maven
facebook/src/main/java/com/facebook/Request.java
Request.toHttpConnection
public static HttpURLConnection toHttpConnection(RequestBatch requests) { """ Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed explicitly by the caller. @param requests a RequestBatch to serialize @return an HttpURLConnection which is ready to execute...
java
public static HttpURLConnection toHttpConnection(RequestBatch requests) { URL url = null; try { if (requests.size() == 1) { // Single request case. Request request = requests.get(0); // In the non-batch case, the URL we use really is the same ...
[ "public", "static", "HttpURLConnection", "toHttpConnection", "(", "RequestBatch", "requests", ")", "{", "URL", "url", "=", "null", ";", "try", "{", "if", "(", "requests", ".", "size", "(", ")", "==", "1", ")", "{", "// Single request case.", "Request", "requ...
Serializes one or more requests but does not execute them. The resulting HttpURLConnection can be executed explicitly by the caller. @param requests a RequestBatch to serialize @return an HttpURLConnection which is ready to execute @throws FacebookException If any of the requests in the batch are badly constructed or...
[ "Serializes", "one", "or", "more", "requests", "but", "does", "not", "execute", "them", ".", "The", "resulting", "HttpURLConnection", "can", "be", "executed", "explicitly", "by", "the", "caller", "." ]
train
https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L1329-L1359
infinispan/infinispan
core/src/main/java/org/infinispan/affinity/KeyAffinityServiceFactory.java
KeyAffinityServiceFactory.newLocalKeyAffinityService
public static <K, V> KeyAffinityService<K> newLocalKeyAffinityService(Cache<K, V> cache, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize, boolean start) { """ Created an service that only generates keys for the local address. """ Address localAddress = cache.getAdvancedCache().getRpcManager(...
java
public static <K, V> KeyAffinityService<K> newLocalKeyAffinityService(Cache<K, V> cache, KeyGenerator<K> keyGenerator, Executor ex, int keyBufferSize, boolean start) { Address localAddress = cache.getAdvancedCache().getRpcManager().getTransport().getAddress(); Collection<Address> forAddresses = Collections....
[ "public", "static", "<", "K", ",", "V", ">", "KeyAffinityService", "<", "K", ">", "newLocalKeyAffinityService", "(", "Cache", "<", "K", ",", "V", ">", "cache", ",", "KeyGenerator", "<", "K", ">", "keyGenerator", ",", "Executor", "ex", ",", "int", "keyBuf...
Created an service that only generates keys for the local address.
[ "Created", "an", "service", "that", "only", "generates", "keys", "for", "the", "local", "address", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/affinity/KeyAffinityServiceFactory.java#L73-L77
qiniu/java-sdk
src/main/java/com/qiniu/cdn/CdnManager.java
CdnManager.createTimestampAntiLeechUrl
public static String createTimestampAntiLeechUrl( String host, String fileName, final StringMap queryStringMap, String encryptKey, long deadline) throws QiniuException { """ 构建七牛标准的基于时间戳的防盗链 参考文档:<a href="https://support.qiniu.com/question/195128">时间戳防盗链</a> @param host 自定义域名,...
java
public static String createTimestampAntiLeechUrl( String host, String fileName, final StringMap queryStringMap, String encryptKey, long deadline) throws QiniuException { URL urlObj = null; try { String urlToSign = null; if (queryStringMap != null && queryS...
[ "public", "static", "String", "createTimestampAntiLeechUrl", "(", "String", "host", ",", "String", "fileName", ",", "final", "StringMap", "queryStringMap", ",", "String", "encryptKey", ",", "long", "deadline", ")", "throws", "QiniuException", "{", "URL", "urlObj", ...
构建七牛标准的基于时间戳的防盗链 参考文档:<a href="https://support.qiniu.com/question/195128">时间戳防盗链</a> @param host 自定义域名,例如 http://img.abc.com @param fileName 待访问的原始文件名,必须是utf8编码,不需要进行urlencode @param queryStringMap 业务自身的查询参数,必须是utf8编码,不需要进行urlencode @param encryptKey 时间戳防盗链的签名密钥,从七牛后台获取 @param deadline 链接的有效期...
[ "构建七牛标准的基于时间戳的防盗链", "参考文档:<a", "href", "=", "https", ":", "//", "support", ".", "qiniu", ".", "com", "/", "question", "/", "195128", ">", "时间戳防盗链<", "/", "a", ">" ]
train
https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/cdn/CdnManager.java#L242-L267
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSHome.java
EJSHome.WASInternal_copyPrimaryKey
protected final Object WASInternal_copyPrimaryKey(Object obj) { """ This method is used to make a copy of the Primary Key object. For the APAR PK26539, the user is doing a EJBLocalObject.getPrimaryKey(). They are then modifying the resultant primary key (PK) and using the PK for further operations. When the u...
java
protected final Object WASInternal_copyPrimaryKey(Object obj) { // Make a "deep copy" of the primarykey object if the noPriaryKeyMutation // property is false. if (!noPrimaryKeyMutation && !statefulSessionHome) { //PK34120: start Object copy = null; //Get the...
[ "protected", "final", "Object", "WASInternal_copyPrimaryKey", "(", "Object", "obj", ")", "{", "// Make a \"deep copy\" of the primarykey object if the noPriaryKeyMutation", "// property is false.", "if", "(", "!", "noPrimaryKeyMutation", "&&", "!", "statefulSessionHome", ")", "...
This method is used to make a copy of the Primary Key object. For the APAR PK26539, the user is doing a EJBLocalObject.getPrimaryKey(). They are then modifying the resultant primary key (PK) and using the PK for further operations. When the user updates the PK, they are essentially editing the "live" PK that we used a...
[ "This", "method", "is", "used", "to", "make", "a", "copy", "of", "the", "Primary", "Key", "object", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSHome.java#L3575-L3603
apache/flink
flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java
MemorySegment.putLongBigEndian
public final void putLongBigEndian(int index, long value) { """ Writes the given long value (64bit, 8 bytes) to the given position in big endian byte order. This method's speed depends on the system's native byte order, and it is possibly slower than {@link #putLong(int, long)}. For most cases (such as transien...
java
public final void putLongBigEndian(int index, long value) { if (LITTLE_ENDIAN) { putLong(index, Long.reverseBytes(value)); } else { putLong(index, value); } }
[ "public", "final", "void", "putLongBigEndian", "(", "int", "index", ",", "long", "value", ")", "{", "if", "(", "LITTLE_ENDIAN", ")", "{", "putLong", "(", "index", ",", "Long", ".", "reverseBytes", "(", "value", ")", ")", ";", "}", "else", "{", "putLong...
Writes the given long value (64bit, 8 bytes) to the given position in big endian byte order. This method's speed depends on the system's native byte order, and it is possibly slower than {@link #putLong(int, long)}. For most cases (such as transient storage in memory or serialization for I/O and network), it suffices t...
[ "Writes", "the", "given", "long", "value", "(", "64bit", "8", "bytes", ")", "to", "the", "given", "position", "in", "big", "endian", "byte", "order", ".", "This", "method", "s", "speed", "depends", "on", "the", "system", "s", "native", "byte", "order", ...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L956-L962
samskivert/pythagoras
src/main/java/pythagoras/f/Quaternion.java
Quaternion.fromAnglesXY
public Quaternion fromAnglesXY (float x, float y) { """ Sets this quaternion to one that first rotates about x by the specified number of radians, then rotates about y by the specified number of radians. """ float hx = x * 0.5f, hy = y * 0.5f; float sx = FloatMath.sin(hx), cx = FloatMath.cos(h...
java
public Quaternion fromAnglesXY (float x, float y) { float hx = x * 0.5f, hy = y * 0.5f; float sx = FloatMath.sin(hx), cx = FloatMath.cos(hx); float sy = FloatMath.sin(hy), cy = FloatMath.cos(hy); return set(cy*sx, sy*cx, -sy*sx, cy*cx); }
[ "public", "Quaternion", "fromAnglesXY", "(", "float", "x", ",", "float", "y", ")", "{", "float", "hx", "=", "x", "*", "0.5f", ",", "hy", "=", "y", "*", "0.5f", ";", "float", "sx", "=", "FloatMath", ".", "sin", "(", "hx", ")", ",", "cx", "=", "F...
Sets this quaternion to one that first rotates about x by the specified number of radians, then rotates about y by the specified number of radians.
[ "Sets", "this", "quaternion", "to", "one", "that", "first", "rotates", "about", "x", "by", "the", "specified", "number", "of", "radians", "then", "rotates", "about", "y", "by", "the", "specified", "number", "of", "radians", "." ]
train
https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Quaternion.java#L195-L200
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/Utils.java
Utils.startsWith
public static boolean startsWith(String string, String prefix) { """ Indicate if the given string starts with the given prefix. This is a more compact way of writing string.regionMatches(true, 0, prefix, 0, prefix.length()). @param string String to be tested. @param prefix Prefix to compare against stri...
java
public static boolean startsWith(String string, String prefix) { return string.regionMatches(true, 0, prefix, 0, prefix.length()); }
[ "public", "static", "boolean", "startsWith", "(", "String", "string", ",", "String", "prefix", ")", "{", "return", "string", ".", "regionMatches", "(", "true", ",", "0", ",", "prefix", ",", "0", ",", "prefix", ".", "length", "(", ")", ")", ";", "}" ]
Indicate if the given string starts with the given prefix. This is a more compact way of writing string.regionMatches(true, 0, prefix, 0, prefix.length()). @param string String to be tested. @param prefix Prefix to compare against string. @return True if string starts with prefix, case-insensitive.
[ "Indicate", "if", "the", "given", "string", "starts", "with", "the", "given", "prefix", ".", "This", "is", "a", "more", "compact", "way", "of", "writing", "string", ".", "regionMatches", "(", "true", "0", "prefix", "0", "prefix", ".", "length", "()", ")"...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1757-L1759
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/FromElementsFunction.java
FromElementsFunction.checkCollection
public static <OUT> void checkCollection(Collection<OUT> elements, Class<OUT> viewedAs) { """ Verifies that all elements in the collection are non-null, and are of the given class, or a subclass thereof. @param elements The collection to check. @param viewedAs The class to which the elements must be assignabl...
java
public static <OUT> void checkCollection(Collection<OUT> elements, Class<OUT> viewedAs) { for (OUT elem : elements) { if (elem == null) { throw new IllegalArgumentException("The collection contains a null element"); } if (!viewedAs.isAssignableFrom(elem.getClass())) { throw new IllegalArgumentExcept...
[ "public", "static", "<", "OUT", ">", "void", "checkCollection", "(", "Collection", "<", "OUT", ">", "elements", ",", "Class", "<", "OUT", ">", "viewedAs", ")", "{", "for", "(", "OUT", "elem", ":", "elements", ")", "{", "if", "(", "elem", "==", "null"...
Verifies that all elements in the collection are non-null, and are of the given class, or a subclass thereof. @param elements The collection to check. @param viewedAs The class to which the elements must be assignable to. @param <OUT> The generic type of the collection to be checked.
[ "Verifies", "that", "all", "elements", "in", "the", "collection", "are", "non", "-", "null", "and", "are", "of", "the", "given", "class", "or", "a", "subclass", "thereof", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/FromElementsFunction.java#L220-L231
killbill/killbill
util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java
InternalCallContextFactory.createInternalCallContext
public InternalCallContext createInternalCallContext(final Long accountRecordId, final InternalCallContext context) { """ Used when we need to re-hydrate the callcontext with the account_record_id (when creating the account) """ final ImmutableAccountData immutableAccountData = getImmutableAccountData(...
java
public InternalCallContext createInternalCallContext(final Long accountRecordId, final InternalCallContext context) { final ImmutableAccountData immutableAccountData = getImmutableAccountData(accountRecordId, context.getTenantRecordId()); final DateTimeZone fixedOffsetTimeZone = immutableAccountData.get...
[ "public", "InternalCallContext", "createInternalCallContext", "(", "final", "Long", "accountRecordId", ",", "final", "InternalCallContext", "context", ")", "{", "final", "ImmutableAccountData", "immutableAccountData", "=", "getImmutableAccountData", "(", "accountRecordId", ",...
Used when we need to re-hydrate the callcontext with the account_record_id (when creating the account)
[ "Used", "when", "we", "need", "to", "re", "-", "hydrate", "the", "callcontext", "with", "the", "account_record_id", "(", "when", "creating", "the", "account", ")" ]
train
https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java#L257-L263
mcxiaoke/Android-Next
core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java
ReflectionUtils.findMethod
public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) { """ Attempt to find a {@link Method} on the supplied class with the supplied name and parameter types. Searches all superclasses up to {@code Object}. <p>Returns {@code null} if no {@link Method} can be found. @param clazz ...
java
public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) { AssertUtils.notNull(clazz, "Class must not be null"); AssertUtils.notNull(name, "Method name must not be null"); Class<?> searchType = clazz; while (searchType != null) { Method[] methods =...
[ "public", "static", "Method", "findMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Class", "<", "?", ">", "...", "paramTypes", ")", "{", "AssertUtils", ".", "notNull", "(", "clazz", ",", "\"Class must not be null\"", ")", ";", ...
Attempt to find a {@link Method} on the supplied class with the supplied name and parameter types. Searches all superclasses up to {@code Object}. <p>Returns {@code null} if no {@link Method} can be found. @param clazz the class to introspect @param name the name of the method @param paramTypes the paramete...
[ "Attempt", "to", "find", "a", "{", "@link", "Method", "}", "on", "the", "supplied", "class", "with", "the", "supplied", "name", "and", "parameter", "types", ".", "Searches", "all", "superclasses", "up", "to", "{", "@code", "Object", "}", ".", "<p", ">", ...
train
https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java#L182-L197
JakeWharton/ActionBarSherlock
actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java
SearchView.createVoiceAppSearchIntent
private Intent createVoiceAppSearchIntent(Intent baseIntent, SearchableInfo searchable) { """ Create and return an Intent that can launch the voice search activity, perform a specific voice transcription, and forward the results to the searchable activity. @param baseIntent The voice app search intent to start...
java
private Intent createVoiceAppSearchIntent(Intent baseIntent, SearchableInfo searchable) { ComponentName searchActivity = searchable.getSearchActivity(); // create the necessary intent to set up a search-and-forward operation // in the voice search system. We have to keep the bundle separate, ...
[ "private", "Intent", "createVoiceAppSearchIntent", "(", "Intent", "baseIntent", ",", "SearchableInfo", "searchable", ")", "{", "ComponentName", "searchActivity", "=", "searchable", ".", "getSearchActivity", "(", ")", ";", "// create the necessary intent to set up a search-and...
Create and return an Intent that can launch the voice search activity, perform a specific voice transcription, and forward the results to the searchable activity. @param baseIntent The voice app search intent to start from @return A completely-configured intent ready to send to the voice search activity
[ "Create", "and", "return", "an", "Intent", "that", "can", "launch", "the", "voice", "search", "activity", "perform", "a", "specific", "voice", "transcription", "and", "forward", "the", "results", "to", "the", "searchable", "activity", "." ]
train
https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1513-L1566
OpenLiberty/open-liberty
dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/application/Application.java
Application.evaluateExpressionGet
public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws ELException { """ <p> Get a value by evaluating an expression. </p> <p> Call <code>{@link #getExpressionFactory()}</code> then call <code>ExpressionFactory.createValueExpre...
java
public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws ELException { Application application = getMyfacesApplicationInstance(context); if (application != null) { return application.evaluateExpression...
[ "public", "<", "T", ">", "T", "evaluateExpressionGet", "(", "FacesContext", "context", ",", "String", "expression", ",", "Class", "<", "?", "extends", "T", ">", "expectedType", ")", "throws", "ELException", "{", "Application", "application", "=", "getMyfacesAppl...
<p> Get a value by evaluating an expression. </p> <p> Call <code>{@link #getExpressionFactory()}</code> then call <code>ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)</code> passing the argument <code>expression</code> and <code>expectedType</code>. Call <code>{@link Fac...
[ "<p", ">", "Get", "a", "value", "by", "evaluating", "an", "expression", ".", "<", "/", "p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/application/Application.java#L531-L540
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java
URLConnection.setRequestProperty
public void setRequestProperty(String key, String value) { """ Sets the general request property. If a property with the key already exists, overwrite its value with the new value. <p> NOTE: HTTP requires all request properties which can legally have multiple instances with the same key to use a comma-sepera...
java
public void setRequestProperty(String key, String value) { if (connected) throw new IllegalStateException("Already connected"); if (key == null) throw new NullPointerException ("key is null"); if (requests == null) requests = new MessageHeader(); req...
[ "public", "void", "setRequestProperty", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "connected", ")", "throw", "new", "IllegalStateException", "(", "\"Already connected\"", ")", ";", "if", "(", "key", "==", "null", ")", "throw", "new",...
Sets the general request property. If a property with the key already exists, overwrite its value with the new value. <p> NOTE: HTTP requires all request properties which can legally have multiple instances with the same key to use a comma-seperated list syntax which enables multiple properties to be appended into a s...
[ "Sets", "the", "general", "request", "property", ".", "If", "a", "property", "with", "the", "key", "already", "exists", "overwrite", "its", "value", "with", "the", "new", "value", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java#L1068-L1078
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/bos/BosClient.java
BosClient.appendObject
public AppendObjectResponse appendObject(String bucketName, String key, String value, ObjectMetadata metadata) { """ Uploads the specified string and object metadata to Bos under the specified bucket and key name. @param bucketName The name of an existing bucket, to which you have Write permission. @param key ...
java
public AppendObjectResponse appendObject(String bucketName, String key, String value, ObjectMetadata metadata) { try { return this.appendObject(bucketName, key, value.getBytes(DEFAULT_ENCODING), metadata); } catch (UnsupportedEncodingException e) { throw new BceClientException("F...
[ "public", "AppendObjectResponse", "appendObject", "(", "String", "bucketName", ",", "String", "key", ",", "String", "value", ",", "ObjectMetadata", "metadata", ")", "{", "try", "{", "return", "this", ".", "appendObject", "(", "bucketName", ",", "key", ",", "va...
Uploads the specified string and object metadata to Bos under the specified bucket and key name. @param bucketName The name of an existing bucket, to which you have Write permission. @param key The key under which to store the specified file. @param value The string containing the value to be uploaded to Bos. @param m...
[ "Uploads", "the", "specified", "string", "and", "object", "metadata", "to", "Bos", "under", "the", "specified", "bucket", "and", "key", "name", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L1717-L1723
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java
WikipediaTemplateInfo.getPagesContainingTemplateFragments
public Iterable<Page> getPagesContainingTemplateFragments(List<String> templateFragments) throws WikiApiException { """ Return an iterable containing all pages that contain a template the name of which starts with any of the given Strings. @param templateFragments the beginning of the templates that have to b...
java
public Iterable<Page> getPagesContainingTemplateFragments(List<String> templateFragments) throws WikiApiException{ return getFragmentFilteredPages(templateFragments, true); }
[ "public", "Iterable", "<", "Page", ">", "getPagesContainingTemplateFragments", "(", "List", "<", "String", ">", "templateFragments", ")", "throws", "WikiApiException", "{", "return", "getFragmentFilteredPages", "(", "templateFragments", ",", "true", ")", ";", "}" ]
Return an iterable containing all pages that contain a template the name of which starts with any of the given Strings. @param templateFragments the beginning of the templates that have to be matched @return An iterable with the page objects that contain templates beginning with any String in templateFragments @throws...
[ "Return", "an", "iterable", "containing", "all", "pages", "that", "contain", "a", "template", "the", "name", "of", "which", "starts", "with", "any", "of", "the", "given", "Strings", "." ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L407-L409
gosu-lang/gosu-lang
gosu-ant-tools/src/main/java/gosu/tools/ant/Gosuc.java
Gosuc.scanDir
protected void scanDir(File srcDir, File destDir, String[] files) { """ Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList @param srcDir The source directory @param destDir The destination directory @param files An array of filenames ...
java
protected void scanDir(File srcDir, File destDir, String[] files) { GlobPatternMapper m = new GlobPatternMapper(); SourceFileScanner sfs = new SourceFileScanner(this); List<File> newFiles; if(!isForce()) { log.warn("Relying on ant's SourceFileScanner, which only looks at timestamps. If broken ref...
[ "protected", "void", "scanDir", "(", "File", "srcDir", ",", "File", "destDir", ",", "String", "[", "]", "files", ")", "{", "GlobPatternMapper", "m", "=", "new", "GlobPatternMapper", "(", ")", ";", "SourceFileScanner", "sfs", "=", "new", "SourceFileScanner", ...
Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList @param srcDir The source directory @param destDir The destination directory @param files An array of filenames
[ "Scans", "the", "directory", "looking", "for", "source", "files", "to", "be", "compiled", ".", "The", "results", "are", "returned", "in", "the", "class", "variable", "compileList" ]
train
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-ant-tools/src/main/java/gosu/tools/ant/Gosuc.java#L211-L234
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java
XpathUtils.asLong
public static Long asLong(String expression, Node node, XPath xpath) throws XPathExpressionException { """ Same as {@link #asLong(String, Node)} but allows an xpath to be passed in explicitly for reuse. """ String longString = evaluateAsString(expression, node, xpath); return (isEm...
java
public static Long asLong(String expression, Node node, XPath xpath) throws XPathExpressionException { String longString = evaluateAsString(expression, node, xpath); return (isEmptyString(longString)) ? null : Long.parseLong(longString); }
[ "public", "static", "Long", "asLong", "(", "String", "expression", ",", "Node", "node", ",", "XPath", "xpath", ")", "throws", "XPathExpressionException", "{", "String", "longString", "=", "evaluateAsString", "(", "expression", ",", "node", ",", "xpath", ")", "...
Same as {@link #asLong(String, Node)} but allows an xpath to be passed in explicitly for reuse.
[ "Same", "as", "{" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L391-L395
pippo-java/pippo
pippo-core/src/main/java/ro/pippo/core/route/Route.java
Route.PATCH
public static Route PATCH(String uriPattern, RouteHandler routeHandler) { """ Create a {@code PATCH} route. @param uriPattern @param routeHandler @return """ return new Route(HttpConstants.Method.PATCH, uriPattern, routeHandler); }
java
public static Route PATCH(String uriPattern, RouteHandler routeHandler) { return new Route(HttpConstants.Method.PATCH, uriPattern, routeHandler); }
[ "public", "static", "Route", "PATCH", "(", "String", "uriPattern", ",", "RouteHandler", "routeHandler", ")", "{", "return", "new", "Route", "(", "HttpConstants", ".", "Method", ".", "PATCH", ",", "uriPattern", ",", "routeHandler", ")", ";", "}" ]
Create a {@code PATCH} route. @param uriPattern @param routeHandler @return
[ "Create", "a", "{", "@code", "PATCH", "}", "route", "." ]
train
https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/Route.java#L125-L127
graknlabs/grakn
server/src/server/exception/PropertyNotUniqueException.java
PropertyNotUniqueException.cannotCreateProperty
public static PropertyNotUniqueException cannotCreateProperty(Concept concept, Schema.VertexProperty property, Object value) { """ Thrown when trying to create a {@link SchemaConcept} using a unique property which is already taken. For example this happens when using an already taken {@link Label} """ ...
java
public static PropertyNotUniqueException cannotCreateProperty(Concept concept, Schema.VertexProperty property, Object value){ return create(UNIQUE_PROPERTY_TAKEN.getMessage(property.name(), value, concept)); }
[ "public", "static", "PropertyNotUniqueException", "cannotCreateProperty", "(", "Concept", "concept", ",", "Schema", ".", "VertexProperty", "property", ",", "Object", "value", ")", "{", "return", "create", "(", "UNIQUE_PROPERTY_TAKEN", ".", "getMessage", "(", "property...
Thrown when trying to create a {@link SchemaConcept} using a unique property which is already taken. For example this happens when using an already taken {@link Label}
[ "Thrown", "when", "trying", "to", "create", "a", "{" ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/PropertyNotUniqueException.java#L66-L68
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/DataDecoder.java
DataDecoder.decodeFloat
public static float decodeFloat(byte[] src, int srcOffset) throws CorruptEncodingException { """ Decodes a float from exactly 4 bytes. @param src source of encoded bytes @param srcOffset offset into source array @return float value """ int bits = decodeFloatBits(src, srcOffset); ...
java
public static float decodeFloat(byte[] src, int srcOffset) throws CorruptEncodingException { int bits = decodeFloatBits(src, srcOffset); bits ^= (bits < 0) ? 0x80000000 : 0xffffffff; return Float.intBitsToFloat(bits); }
[ "public", "static", "float", "decodeFloat", "(", "byte", "[", "]", "src", ",", "int", "srcOffset", ")", "throws", "CorruptEncodingException", "{", "int", "bits", "=", "decodeFloatBits", "(", "src", ",", "srcOffset", ")", ";", "bits", "^=", "(", "bits", "<"...
Decodes a float from exactly 4 bytes. @param src source of encoded bytes @param srcOffset offset into source array @return float value
[ "Decodes", "a", "float", "from", "exactly", "4", "bytes", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L293-L299
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java
ViterbiBuilder.createGlueNode
private ViterbiNode createGlueNode(int startIndex, ViterbiNode glueBase, String surface) { """ Create a glue node to be inserted based on ViterbiNode already in the lattice. The new node takes the same parameters as the node it is based on, but the word is truncated to match the hole in the lattice caused by the...
java
private ViterbiNode createGlueNode(int startIndex, ViterbiNode glueBase, String surface) { return new ViterbiNode(glueBase.getWordId(), surface, glueBase.getLeftId(), glueBase.getRightId(), glueBase.getWordCost(), startIndex, ViterbiNode.Type.INSERTED); }
[ "private", "ViterbiNode", "createGlueNode", "(", "int", "startIndex", ",", "ViterbiNode", "glueBase", ",", "String", "surface", ")", "{", "return", "new", "ViterbiNode", "(", "glueBase", ".", "getWordId", "(", ")", ",", "surface", ",", "glueBase", ".", "getLef...
Create a glue node to be inserted based on ViterbiNode already in the lattice. The new node takes the same parameters as the node it is based on, but the word is truncated to match the hole in the lattice caused by the new user entry @param startIndex @param glueBase @param surface @return new ViterbiNode to be insert...
[ "Create", "a", "glue", "node", "to", "be", "inserted", "based", "on", "ViterbiNode", "already", "in", "the", "lattice", ".", "The", "new", "node", "takes", "the", "same", "parameters", "as", "the", "node", "it", "is", "based", "on", "but", "the", "word",...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L334-L337
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageEditorRenderer.java
WImageEditorRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { """ Paints the given {@link WImageEditor}. @param component the WImageEditor to paint. @param renderContext the RenderContext to paint to. """ WImageEditor editorComponent = (WImageEditor) component; ...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WImageEditor editorComponent = (WImageEditor) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("wc-imageedit"); xml.appendAttribute("id", editorComponent.getId()); xml.appendOp...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WImageEditor", "editorComponent", "=", "(", "WImageEditor", ")", "component", ";", "XmlStringBuilder", "xml", "="...
Paints the given {@link WImageEditor}. @param component the WImageEditor to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "{", "@link", "WImageEditor", "}", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageEditorRenderer.java#L24-L50
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/EnumConverter.java
EnumConverter.generateInvalidErrorMessage
private String generateInvalidErrorMessage(Object[] enumValues, String testValue) { """ Generate error message to use in the {@link ConversionException}. @param enumValues possible values of the enum. @param testValue the value to convert. @return the generated error message. """ StringBuffer erro...
java
private String generateInvalidErrorMessage(Object[] enumValues, String testValue) { StringBuffer errorMessage = new StringBuffer("Unable to convert value [" + testValue + "]."); errorMessage.append(" Allowed values are (case insensitive) "); StringBuffer valueList = new StringBuffer(); ...
[ "private", "String", "generateInvalidErrorMessage", "(", "Object", "[", "]", "enumValues", ",", "String", "testValue", ")", "{", "StringBuffer", "errorMessage", "=", "new", "StringBuffer", "(", "\"Unable to convert value [\"", "+", "testValue", "+", "\"].\"", ")", "...
Generate error message to use in the {@link ConversionException}. @param enumValues possible values of the enum. @param testValue the value to convert. @return the generated error message.
[ "Generate", "error", "message", "to", "use", "in", "the", "{", "@link", "ConversionException", "}", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/EnumConverter.java#L67-L94
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Integer.java
Integer.getInteger
public static Integer getInteger(String nm, Integer val) { """ Returns the integer value of the system property with the specified name. The first argument is treated as the name of a system property. System properties are accessible through the {@link java.lang.System#getProperty(java.lang.String)} method. ...
java
public static Integer getInteger(String nm, Integer val) { String v = null; try { v = System.getProperty(nm); } catch (IllegalArgumentException | NullPointerException e) { } if (v != null) { try { return Integer.decode(v); } cat...
[ "public", "static", "Integer", "getInteger", "(", "String", "nm", ",", "Integer", "val", ")", "{", "String", "v", "=", "null", ";", "try", "{", "v", "=", "System", ".", "getProperty", "(", "nm", ")", ";", "}", "catch", "(", "IllegalArgumentException", ...
Returns the integer value of the system property with the specified name. The first argument is treated as the name of a system property. System properties are accessible through the {@link java.lang.System#getProperty(java.lang.String)} method. The string value of this property is then interpreted as an integer valu...
[ "Returns", "the", "integer", "value", "of", "the", "system", "property", "with", "the", "specified", "name", ".", "The", "first", "argument", "is", "treated", "as", "the", "name", "of", "a", "system", "property", ".", "System", "properties", "are", "accessib...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Integer.java#L898-L911
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.getAttribute
@Override public Object getAttribute(String name, Object value) { """ Return attribute by name and set if it doesn't exist yet. @param name Attribute name @param value Value to set if attribute doesn't exist @return Attribute value """ log.debug("getAttribute - name: {} value: {}", name, v...
java
@Override public Object getAttribute(String name, Object value) { log.debug("getAttribute - name: {} value: {}", name, value); Object result = null; if (name != null) { result = attributes.putIfAbsent(name, value); if (result == null) { // no pr...
[ "@", "Override", "public", "Object", "getAttribute", "(", "String", "name", ",", "Object", "value", ")", "{", "log", ".", "debug", "(", "\"getAttribute - name: {} value: {}\"", ",", "name", ",", "value", ")", ";", "Object", "result", "=", "null", ";", "if", ...
Return attribute by name and set if it doesn't exist yet. @param name Attribute name @param value Value to set if attribute doesn't exist @return Attribute value
[ "Return", "attribute", "by", "name", "and", "set", "if", "it", "doesn", "t", "exist", "yet", "." ]
train
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L408-L426
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
MariaDbDatabaseMetaData.getImportedKeysUsingInformationSchema
public ResultSet getImportedKeysUsingInformationSchema(String catalog, String table) throws SQLException { """ GetImportedKeysUsingInformationSchema. @param catalog catalog @param table table @return resultset @throws SQLException exception """ if (table == null) { throw new SQLExceptio...
java
public ResultSet getImportedKeysUsingInformationSchema(String catalog, String table) throws SQLException { if (table == null) { throw new SQLException("'table' parameter in getImportedKeys cannot be null"); } String sql = "SELECT KCU.REFERENCED_TABLE_SCHEMA PKTABLE_CAT, NULL PKTABLE_SCHE...
[ "public", "ResultSet", "getImportedKeysUsingInformationSchema", "(", "String", "catalog", ",", "String", "table", ")", "throws", "SQLException", "{", "if", "(", "table", "==", "null", ")", "{", "throw", "new", "SQLException", "(", "\"'table' parameter in getImportedKe...
GetImportedKeysUsingInformationSchema. @param catalog catalog @param table table @return resultset @throws SQLException exception
[ "GetImportedKeysUsingInformationSchema", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L893-L930
liyiorg/weixin-popular
src/main/java/weixin/popular/api/ComponentAPI.java
ComponentAPI.api_create_preauthcode
public static PreAuthCode api_create_preauthcode(String component_access_token, String component_appid) { """ 获取预授权码 @param component_access_token component_access_token @param component_appid 公众号第三方平台appid @return 预授权码 """ String postJsonData = String.format("{\"component_appid\":\"%1$s\"...
java
public static PreAuthCode api_create_preauthcode(String component_access_token, String component_appid) { String postJsonData = String.format("{\"component_appid\":\"%1$s\"}", component_appid); HttpUriRequest httpUriRequest = RequestBuilder.post() .setHeader(jsonHeade...
[ "public", "static", "PreAuthCode", "api_create_preauthcode", "(", "String", "component_access_token", ",", "String", "component_appid", ")", "{", "String", "postJsonData", "=", "String", ".", "format", "(", "\"{\\\"component_appid\\\":\\\"%1$s\\\"}\"", ",", "component_appid...
获取预授权码 @param component_access_token component_access_token @param component_appid 公众号第三方平台appid @return 预授权码
[ "获取预授权码" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ComponentAPI.java#L129-L139
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/PublisherUtils.java
PublisherUtils.splitExtractsByPredicate
public static SplitExtractsResult splitExtractsByPredicate( Multimap<Extract, WorkUnitState> extractToWorkUnitStateMap, Predicate<WorkUnitState> predicate) { """ Given a {@link Multimap} of {@link Extract}s to {@link WorkUnitState}s, filter out any {@link Extract}s where all of the corresponding {@link Work...
java
public static SplitExtractsResult splitExtractsByPredicate( Multimap<Extract, WorkUnitState> extractToWorkUnitStateMap, Predicate<WorkUnitState> predicate) { Multimap<Extract, WorkUnitState> retained = ArrayListMultimap.create(); Multimap<Extract, WorkUnitState> filtered = ArrayListMultimap.create(); ...
[ "public", "static", "SplitExtractsResult", "splitExtractsByPredicate", "(", "Multimap", "<", "Extract", ",", "WorkUnitState", ">", "extractToWorkUnitStateMap", ",", "Predicate", "<", "WorkUnitState", ">", "predicate", ")", "{", "Multimap", "<", "Extract", ",", "WorkUn...
Given a {@link Multimap} of {@link Extract}s to {@link WorkUnitState}s, filter out any {@link Extract}s where all of the corresponding {@link WorkUnitState}s do not meet the given {@link Predicate}. <ul> <li> The filtered {@link Extract}s will be available in {@link SplitExtractsResult#getFiltered()}</li> <li> The {@li...
[ "Given", "a", "{", "@link", "Multimap", "}", "of", "{", "@link", "Extract", "}", "s", "to", "{", "@link", "WorkUnitState", "}", "s", "filter", "out", "any", "{", "@link", "Extract", "}", "s", "where", "all", "of", "the", "corresponding", "{", "@link", ...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PublisherUtils.java#L80-L92
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/query/KvStateRegistry.java
KvStateRegistry.registerListener
public void registerListener(JobID jobId, KvStateRegistryListener listener) { """ Registers a listener with the registry. @param jobId identifying the job for which to register a {@link KvStateRegistryListener} @param listener The registry listener. @throws IllegalStateException If there is a registered liste...
java
public void registerListener(JobID jobId, KvStateRegistryListener listener) { final KvStateRegistryListener previousValue = listeners.putIfAbsent(jobId, listener); if (previousValue != null) { throw new IllegalStateException("Listener already registered under " + jobId + '.'); } }
[ "public", "void", "registerListener", "(", "JobID", "jobId", ",", "KvStateRegistryListener", "listener", ")", "{", "final", "KvStateRegistryListener", "previousValue", "=", "listeners", ".", "putIfAbsent", "(", "jobId", ",", "listener", ")", ";", "if", "(", "previ...
Registers a listener with the registry. @param jobId identifying the job for which to register a {@link KvStateRegistryListener} @param listener The registry listener. @throws IllegalStateException If there is a registered listener
[ "Registers", "a", "listener", "with", "the", "registry", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/query/KvStateRegistry.java#L56-L62
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.getFromFirstExcl
@Nullable public static String getFromFirstExcl (@Nullable final String sStr, @Nullable final String sSearch) { """ Get everything from the string from and excluding the passed string. @param sStr The source string. May be <code>null</code>. @param sSearch The string to search. May be <code>null</code>. @...
java
@Nullable public static String getFromFirstExcl (@Nullable final String sStr, @Nullable final String sSearch) { return _getFromFirst (sStr, sSearch, false); }
[ "@", "Nullable", "public", "static", "String", "getFromFirstExcl", "(", "@", "Nullable", "final", "String", "sStr", ",", "@", "Nullable", "final", "String", "sSearch", ")", "{", "return", "_getFromFirst", "(", "sStr", ",", "sSearch", ",", "false", ")", ";", ...
Get everything from the string from and excluding the passed string. @param sStr The source string. May be <code>null</code>. @param sSearch The string to search. May be <code>null</code>. @return <code>null</code> if the passed string does not contain the search string. If the search string is empty, the input string...
[ "Get", "everything", "from", "the", "string", "from", "and", "excluding", "the", "passed", "string", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4998-L5002
cdapio/tephra
tephra-core/src/main/java/co/cask/tephra/TransactionManager.java
TransactionManager.abortService
private void abortService(String message, Throwable error) { """ Immediately shuts down the service, without going through the normal close process. @param message A message describing the source of the failure. @param error Any exception that caused the failure. """ if (isRunning()) { LOG.error("A...
java
private void abortService(String message, Throwable error) { if (isRunning()) { LOG.error("Aborting transaction manager due to: " + message, error); notifyFailed(error); } }
[ "private", "void", "abortService", "(", "String", "message", ",", "Throwable", "error", ")", "{", "if", "(", "isRunning", "(", ")", ")", "{", "LOG", ".", "error", "(", "\"Aborting transaction manager due to: \"", "+", "message", ",", "error", ")", ";", "noti...
Immediately shuts down the service, without going through the normal close process. @param message A message describing the source of the failure. @param error Any exception that caused the failure.
[ "Immediately", "shuts", "down", "the", "service", "without", "going", "through", "the", "normal", "close", "process", "." ]
train
https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-core/src/main/java/co/cask/tephra/TransactionManager.java#L699-L704
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.deletePatternAnyEntityRoleAsync
public Observable<OperationStatus> deletePatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { """ Delete an entity role. @param appId The application ID. @param versionId The version ID. @param entityId The entity ID. @param roleId The entity role Id. @throws IllegalArgument...
java
public Observable<OperationStatus> deletePatternAnyEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) { return deletePatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override ...
[ "public", "Observable", "<", "OperationStatus", ">", "deletePatternAnyEntityRoleAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ",", "UUID", "roleId", ")", "{", "return", "deletePatternAnyEntityRoleWithServiceResponseAsync", "(", "appI...
Delete an entity role. @param appId The application ID. @param versionId The version ID. @param entityId The entity ID. @param roleId The entity role Id. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object
[ "Delete", "an", "entity", "role", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13091-L13098
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
ThreadContext.putAll
public static void putAll(final Map<String, String> m) { """ Puts all given context map entries into the current thread's context map. <p>If the current thread does not have a context map it is created as a side effect.</p> @param m The map. @since 2.7 """ if (contextMap instanceof ThreadContext...
java
public static void putAll(final Map<String, String> m) { if (contextMap instanceof ThreadContextMap2) { ((ThreadContextMap2) contextMap).putAll(m); } else if (contextMap instanceof DefaultThreadContextMap) { ((DefaultThreadContextMap) contextMap).putAll(m); } else { ...
[ "public", "static", "void", "putAll", "(", "final", "Map", "<", "String", ",", "String", ">", "m", ")", "{", "if", "(", "contextMap", "instanceof", "ThreadContextMap2", ")", "{", "(", "(", "ThreadContextMap2", ")", "contextMap", ")", ".", "putAll", "(", ...
Puts all given context map entries into the current thread's context map. <p>If the current thread does not have a context map it is created as a side effect.</p> @param m The map. @since 2.7
[ "Puts", "all", "given", "context", "map", "entries", "into", "the", "current", "thread", "s", "context", "map", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/ThreadContext.java#L248-L258
flow/caustic
api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java
MeshGenerator.generatePlane
public static VertexData generatePlane(Vector2f size) { """ Generates a plane on xy. The center is at the middle of the plane. @param size The size of the plane to generate, on x and y @return The vertex data """ final VertexData destination = new VertexData(); final VertexAttribute positio...
java
public static VertexData generatePlane(Vector2f size) { final VertexData destination = new VertexData(); final VertexAttribute positionsAttribute = new VertexAttribute("positions", DataType.FLOAT, 3); destination.addAttribute(0, positionsAttribute); final TFloatList positions = new TFloa...
[ "public", "static", "VertexData", "generatePlane", "(", "Vector2f", "size", ")", "{", "final", "VertexData", "destination", "=", "new", "VertexData", "(", ")", ";", "final", "VertexAttribute", "positionsAttribute", "=", "new", "VertexAttribute", "(", "\"positions\""...
Generates a plane on xy. The center is at the middle of the plane. @param size The size of the plane to generate, on x and y @return The vertex data
[ "Generates", "a", "plane", "on", "xy", ".", "The", "center", "is", "at", "the", "middle", "of", "the", "plane", "." ]
train
https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java#L593-L612
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/JobLauncherUtils.java
JobLauncherUtils.newMultiTaskId
public static String newMultiTaskId(String jobId, int sequence) { """ Create an ID for a new multi-task (corresponding to a {@link org.apache.gobblin.source.workunit.MultiWorkUnit}) for the job with the given job ID. @param jobId job ID @param sequence multi-task sequence number @return new multi-task ID ...
java
public static String newMultiTaskId(String jobId, int sequence) { return Id.MultiTask.create(Id.parse(jobId).get(Id.Parts.INSTANCE_NAME), sequence).toString(); }
[ "public", "static", "String", "newMultiTaskId", "(", "String", "jobId", ",", "int", "sequence", ")", "{", "return", "Id", ".", "MultiTask", ".", "create", "(", "Id", ".", "parse", "(", "jobId", ")", ".", "get", "(", "Id", ".", "Parts", ".", "INSTANCE_N...
Create an ID for a new multi-task (corresponding to a {@link org.apache.gobblin.source.workunit.MultiWorkUnit}) for the job with the given job ID. @param jobId job ID @param sequence multi-task sequence number @return new multi-task ID
[ "Create", "an", "ID", "for", "a", "new", "multi", "-", "task", "(", "corresponding", "to", "a", "{", "@link", "org", ".", "apache", ".", "gobblin", ".", "source", ".", "workunit", ".", "MultiWorkUnit", "}", ")", "for", "the", "job", "with", "the", "g...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JobLauncherUtils.java#L90-L92
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java
NetworkWatchersInner.getTopologyAsync
public Observable<TopologyInner> getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { """ Gets the current network topology by resource group. @param resourceGroupName The name of the resource group. @param networkWatcherName The name of the network watcher. @...
java
public Observable<TopologyInner> getTopologyAsync(String resourceGroupName, String networkWatcherName, TopologyParameters parameters) { return getTopologyWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceResponse<TopologyInner>, TopologyInner>() { @Over...
[ "public", "Observable", "<", "TopologyInner", ">", "getTopologyAsync", "(", "String", "resourceGroupName", ",", "String", "networkWatcherName", ",", "TopologyParameters", "parameters", ")", "{", "return", "getTopologyWithServiceResponseAsync", "(", "resourceGroupName", ",",...
Gets the current network topology by resource group. @param resourceGroupName The name of the resource group. @param networkWatcherName The name of the network watcher. @param parameters Parameters that define the representation of topology. @throws IllegalArgumentException thrown if parameters fail the validation @re...
[ "Gets", "the", "current", "network", "topology", "by", "resource", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L893-L900
phax/ph-commons
ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java
MicroWriter.writeToStream
@Nonnull public static ESuccess writeToStream (@Nonnull final IMicroNode aNode, @Nonnull @WillClose final OutputStream aOS) { """ Write a Micro Node to an output stream using the default settings. @param aNode The node to be serialized. May be any kind of node (incl. documents). May not be <code>null</code>...
java
@Nonnull public static ESuccess writeToStream (@Nonnull final IMicroNode aNode, @Nonnull @WillClose final OutputStream aOS) { return writeToStream (aNode, aOS, XMLWriterSettings.DEFAULT_XML_SETTINGS); }
[ "@", "Nonnull", "public", "static", "ESuccess", "writeToStream", "(", "@", "Nonnull", "final", "IMicroNode", "aNode", ",", "@", "Nonnull", "@", "WillClose", "final", "OutputStream", "aOS", ")", "{", "return", "writeToStream", "(", "aNode", ",", "aOS", ",", "...
Write a Micro Node to an output stream using the default settings. @param aNode The node to be serialized. May be any kind of node (incl. documents). May not be <code>null</code>. @param aOS The output stream to write to. May not be <code>null</code>. The output stream is closed anyway directly after the operation fin...
[ "Write", "a", "Micro", "Node", "to", "an", "output", "stream", "using", "the", "default", "settings", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L155-L159
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/api/AbstractRecordReader.java
AbstractRecordReader.unsubscribeFromEvent
@Override public void unsubscribeFromEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) { """ Removes the subscription for events of the given type for the listener object. @param eventListener The listener object to cancel the subscription for. @param eventType The type of the e...
java
@Override public void unsubscribeFromEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) { this.eventHandler.unsubscribeFromEvent(eventListener, eventType); }
[ "@", "Override", "public", "void", "unsubscribeFromEvent", "(", "EventListener", "eventListener", ",", "Class", "<", "?", "extends", "AbstractTaskEvent", ">", "eventType", ")", "{", "this", ".", "eventHandler", ".", "unsubscribeFromEvent", "(", "eventListener", ",",...
Removes the subscription for events of the given type for the listener object. @param eventListener The listener object to cancel the subscription for. @param eventType The type of the event to cancel the subscription for.
[ "Removes", "the", "subscription", "for", "events", "of", "the", "given", "type", "for", "the", "listener", "object", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/api/AbstractRecordReader.java#L54-L57
monitorjbl/json-view
spring-json-view/src/main/java/com/monitorjbl/json/JsonViewMessageConverter.java
JsonViewMessageConverter.registerCustomSerializer
public <T> void registerCustomSerializer(Class<T> class1, JsonSerializer<T> forType) { """ Registering custom serializer allows to the JSonView to deal with custom serializations for certains field types.<br> This way you could register for instance a JODA serialization as a DateTimeSerializer. <br> Thus, when ...
java
public <T> void registerCustomSerializer(Class<T> class1, JsonSerializer<T> forType) { this.serializer.registerCustomSerializer(class1, forType); }
[ "public", "<", "T", ">", "void", "registerCustomSerializer", "(", "Class", "<", "T", ">", "class1", ",", "JsonSerializer", "<", "T", ">", "forType", ")", "{", "this", ".", "serializer", ".", "registerCustomSerializer", "(", "class1", ",", "forType", ")", "...
Registering custom serializer allows to the JSonView to deal with custom serializations for certains field types.<br> This way you could register for instance a JODA serialization as a DateTimeSerializer. <br> Thus, when JSonView find a field of that type (DateTime), it will delegate the serialization to the serialize...
[ "Registering", "custom", "serializer", "allows", "to", "the", "JSonView", "to", "deal", "with", "custom", "serializations", "for", "certains", "field", "types", ".", "<br", ">", "This", "way", "you", "could", "register", "for", "instance", "a", "JODA", "serial...
train
https://github.com/monitorjbl/json-view/blob/c01505ac76e5416abe8af85c5816f60bd5d483ea/spring-json-view/src/main/java/com/monitorjbl/json/JsonViewMessageConverter.java#L47-L49
brianwhu/xillium
data/src/main/java/org/xillium/data/DataBinder.java
DataBinder.put
public <T extends DataObject> DataBinder put(T object, String... names) throws Exception { """ Fills the data binder with a subset of non-static, non-transient fields of an Object, excluding null values. @param names - the names of the fields in the subset """ Class<?> type = object.getClass(); ...
java
public <T extends DataObject> DataBinder put(T object, String... names) throws Exception { Class<?> type = object.getClass(); Object value; for (String name: names) { Field field = Beans.getKnownField(type, name); if (!Modifier.isStatic(field.getModifiers()) && !Modifier....
[ "public", "<", "T", "extends", "DataObject", ">", "DataBinder", "put", "(", "T", "object", ",", "String", "...", "names", ")", "throws", "Exception", "{", "Class", "<", "?", ">", "type", "=", "object", ".", "getClass", "(", ")", ";", "Object", "value",...
Fills the data binder with a subset of non-static, non-transient fields of an Object, excluding null values. @param names - the names of the fields in the subset
[ "Fills", "the", "data", "binder", "with", "a", "subset", "of", "non", "-", "static", "non", "-", "transient", "fields", "of", "an", "Object", "excluding", "null", "values", "." ]
train
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L191-L201
icode/ameba
src/main/java/ameba/feature/datasource/StatViewFeature.java
StatViewFeature.getJmxResult
private static String getJmxResult(MBeanServerConnection connetion, String url) throws Exception { """ 根据指定的url来获取jmx服务返回的内容. @param connetion jmx连接 @param url url内容 @return the jmx返回的内容 @throws Exception the exception """ ObjectName name = new ObjectName(DruidStatService.MBEAN_NAME); ...
java
private static String getJmxResult(MBeanServerConnection connetion, String url) throws Exception { ObjectName name = new ObjectName(DruidStatService.MBEAN_NAME); return (String) conn.invoke(name, "service", new String[]{url}, new String[]{String.class.getName()}); }
[ "private", "static", "String", "getJmxResult", "(", "MBeanServerConnection", "connetion", ",", "String", "url", ")", "throws", "Exception", "{", "ObjectName", "name", "=", "new", "ObjectName", "(", "DruidStatService", ".", "MBEAN_NAME", ")", ";", "return", "(", ...
根据指定的url来获取jmx服务返回的内容. @param connetion jmx连接 @param url url内容 @return the jmx返回的内容 @throws Exception the exception
[ "根据指定的url来获取jmx服务返回的内容", "." ]
train
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/feature/datasource/StatViewFeature.java#L178-L183
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabCloseButtonPainter.java
TabbedPaneTabCloseButtonPainter.drawOverlayGraphic
private void drawOverlayGraphic(Graphics2D g, int width, int height) { """ Draw the "close" graphic for a state where it overlays a border. @param g the Graphic context. @param width the width of the graphic. @param height the height of the graphic. """ Shape s = shapeGenerator.createTabClos...
java
private void drawOverlayGraphic(Graphics2D g, int width, int height) { Shape s = shapeGenerator.createTabCloseIcon(2, 2, width - 4, height - 4); g.setPaint(graphicBase); g.fill(s); s = shapeGenerator.createTabCloseIcon(2, 3, width - 4, height - 4); g.setPaint(createGraphicDropS...
[ "private", "void", "drawOverlayGraphic", "(", "Graphics2D", "g", ",", "int", "width", ",", "int", "height", ")", "{", "Shape", "s", "=", "shapeGenerator", ".", "createTabCloseIcon", "(", "2", ",", "2", ",", "width", "-", "4", ",", "height", "-", "4", "...
Draw the "close" graphic for a state where it overlays a border. @param g the Graphic context. @param width the width of the graphic. @param height the height of the graphic.
[ "Draw", "the", "close", "graphic", "for", "a", "state", "where", "it", "overlays", "a", "border", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabCloseButtonPainter.java#L154-L167
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_easyHunting_serviceName_PUT
public void billingAccount_easyHunting_serviceName_PUT(String billingAccount, String serviceName, OvhEasyHunting body) throws IOException { """ Alter this object properties REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName} @param body [required] New object properties @param billingAccount [requi...
java
public void billingAccount_easyHunting_serviceName_PUT(String billingAccount, String serviceName, OvhEasyHunting body) throws IOException { String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); ...
[ "public", "void", "billingAccount_easyHunting_serviceName_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhEasyHunting", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/easyHunting/{serviceName}\"", ...
Alter this object properties REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName} @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3450-L3454
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java
BundleUtil.getSourceBundlePath
public static IPath getSourceBundlePath(Bundle bundle, IPath bundleLocation) { """ Replies the source location for the given bundle. <p>The source location is usually the root folder where the source code of the bundle is located. <p>We can't use P2Utils and we can't use SimpleConfiguratorManipulator because...
java
public static IPath getSourceBundlePath(Bundle bundle, IPath bundleLocation) { IPath sourcesPath = null; // Not an essential functionality, make it robust try { final IPath srcFolderPath = getSourceRootProjectFolderPath(bundle); if (srcFolderPath == null) { //common case, jar file. final IPath bundl...
[ "public", "static", "IPath", "getSourceBundlePath", "(", "Bundle", "bundle", ",", "IPath", "bundleLocation", ")", "{", "IPath", "sourcesPath", "=", "null", ";", "// Not an essential functionality, make it robust", "try", "{", "final", "IPath", "srcFolderPath", "=", "g...
Replies the source location for the given bundle. <p>The source location is usually the root folder where the source code of the bundle is located. <p>We can't use P2Utils and we can't use SimpleConfiguratorManipulator because of API breakage between 3.5 and 4.2. So we do a bit EDV (Computer data processing) ;-) @pa...
[ "Replies", "the", "source", "location", "for", "the", "given", "bundle", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java#L120-L144
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java
KeyVaultClientCustomImpl.getPendingCertificateSigningRequest
public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName) { """ Gets the pending certificate signing request response. @param vaultBaseUrl The vault name, e.g. https://myvault.vault.azure.net @param certificateName The name of the certificate @return the String if succes...
java
public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName) { return getPendingCertificateSigningRequestWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking() .single().body(); }
[ "public", "String", "getPendingCertificateSigningRequest", "(", "String", "vaultBaseUrl", ",", "String", "certificateName", ")", "{", "return", "getPendingCertificateSigningRequestWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "certificateName", ")", ".", "toBlocking", ...
Gets the pending certificate signing request response. @param vaultBaseUrl The vault name, e.g. https://myvault.vault.azure.net @param certificateName The name of the certificate @return the String if successful.
[ "Gets", "the", "pending", "certificate", "signing", "request", "response", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L1800-L1803
Appendium/objectlabkit
fxcalc/src/main/java/net/objectlab/kit/fxcalc/CrossRateCalculator.java
CrossRateCalculator.calculateCross
public static FxRate calculateCross(final CurrencyPair targetPair, final FxRate fx1, final FxRate fx2, final int precision, final int precisionForInverseFxRate, final MajorCurrencyRanking ranking, final int bidRounding, final int askRounding, CurrencyProvider currencyProvider) { """ Calcula...
java
public static FxRate calculateCross(final CurrencyPair targetPair, final FxRate fx1, final FxRate fx2, final int precision, final int precisionForInverseFxRate, final MajorCurrencyRanking ranking, final int bidRounding, final int askRounding, CurrencyProvider currencyProvider) { final Op...
[ "public", "static", "FxRate", "calculateCross", "(", "final", "CurrencyPair", "targetPair", ",", "final", "FxRate", "fx1", ",", "final", "FxRate", "fx2", ",", "final", "int", "precision", ",", "final", "int", "precisionForInverseFxRate", ",", "final", "MajorCurren...
Calculate the cross rate, use this only if required. @param targetPair the currency pair we want Bid/Ask for @param fx1 one rate involving either targetPair.ccy1 or targetPair.ccy2 @param fx2 one rate involving either targetPair.ccy1 or targetPair.ccy2 @param precision required in case we need to divide rates @param ra...
[ "Calculate", "the", "cross", "rate", "use", "this", "only", "if", "required", "." ]
train
https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/fxcalc/src/main/java/net/objectlab/kit/fxcalc/CrossRateCalculator.java#L33-L68
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java
Aggregations.bigIntegerMin
public static <Key, Value> Aggregation<Key, BigInteger, BigInteger> bigIntegerMin() { """ Returns an aggregation to find the {@link java.math.BigInteger} minimum of all supplied values.<br/> This aggregation is similar to: <pre>SELECT MIN(value) FROM x</pre> @param <Key> the input key type @param <Value> t...
java
public static <Key, Value> Aggregation<Key, BigInteger, BigInteger> bigIntegerMin() { return new AggregationAdapter(new BigIntegerMinAggregation<Key, Value>()); }
[ "public", "static", "<", "Key", ",", "Value", ">", "Aggregation", "<", "Key", ",", "BigInteger", ",", "BigInteger", ">", "bigIntegerMin", "(", ")", "{", "return", "new", "AggregationAdapter", "(", "new", "BigIntegerMinAggregation", "<", "Key", ",", "Value", ...
Returns an aggregation to find the {@link java.math.BigInteger} minimum of all supplied values.<br/> This aggregation is similar to: <pre>SELECT MIN(value) FROM x</pre> @param <Key> the input key type @param <Value> the supplied value type @return the minimum value over all supplied values
[ "Returns", "an", "aggregation", "to", "find", "the", "{", "@link", "java", ".", "math", ".", "BigInteger", "}", "minimum", "of", "all", "supplied", "values", ".", "<br", "/", ">", "This", "aggregation", "is", "similar", "to", ":", "<pre", ">", "SELECT", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L325-L327
foundation-runtime/logging
logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java
TransactionLogger.writeToLog
private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) { """ Write the given pattern to given log in given logging level @param logger @param level @param pattern @param exception """ if (level == Level.ERROR) { logger.error(pattern, exception); } else...
java
private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) { if (level == Level.ERROR) { logger.error(pattern, exception); } else if (level == Level.INFO) { logger.info(pattern); } else if (level == Level.DEBUG) { logger.debug(pattern); } }
[ "private", "static", "void", "writeToLog", "(", "Logger", "logger", ",", "Level", "level", ",", "String", "pattern", ",", "Exception", "exception", ")", "{", "if", "(", "level", "==", "Level", ".", "ERROR", ")", "{", "logger", ".", "error", "(", "pattern...
Write the given pattern to given log in given logging level @param logger @param level @param pattern @param exception
[ "Write", "the", "given", "pattern", "to", "given", "log", "in", "given", "logging", "level" ]
train
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L431-L439
riversun/string-grabber
src/main/java/org/riversun/string_grabber/StringCropper.java
StringCropper.getLeftOf
public String getLeftOf(String srcStr, int charCount) { """ Returns the number of characters specified from left @param srcStr @param charCount @return """ String retValue = ""; if (isNotBlank(srcStr)) { int length = srcStr.length(); if (charCount < leng...
java
public String getLeftOf(String srcStr, int charCount) { String retValue = ""; if (isNotBlank(srcStr)) { int length = srcStr.length(); if (charCount < length) { retValue = srcStr.substring(0, charCount); } else { retValue ...
[ "public", "String", "getLeftOf", "(", "String", "srcStr", ",", "int", "charCount", ")", "{", "String", "retValue", "=", "\"\"", ";", "if", "(", "isNotBlank", "(", "srcStr", ")", ")", "{", "int", "length", "=", "srcStr", ".", "length", "(", ")", ";", ...
Returns the number of characters specified from left @param srcStr @param charCount @return
[ "Returns", "the", "number", "of", "characters", "specified", "from", "left" ]
train
https://github.com/riversun/string-grabber/blob/b5aadc21fe15f50d35392188dec6ab81dcf8d464/src/main/java/org/riversun/string_grabber/StringCropper.java#L442-L458
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
JavacParser.reportSyntaxError
protected void reportSyntaxError(int pos, String key, Object... args) { """ Report a syntax using the given the position parameter and arguments, unless one was already reported at the same position. """ JCDiagnostic.DiagnosticPosition diag = new JCDiagnostic.SimpleDiagnosticPosition(pos); rep...
java
protected void reportSyntaxError(int pos, String key, Object... args) { JCDiagnostic.DiagnosticPosition diag = new JCDiagnostic.SimpleDiagnosticPosition(pos); reportSyntaxError(diag, key, args); }
[ "protected", "void", "reportSyntaxError", "(", "int", "pos", ",", "String", "key", ",", "Object", "...", "args", ")", "{", "JCDiagnostic", ".", "DiagnosticPosition", "diag", "=", "new", "JCDiagnostic", ".", "SimpleDiagnosticPosition", "(", "pos", ")", ";", "re...
Report a syntax using the given the position parameter and arguments, unless one was already reported at the same position.
[ "Report", "a", "syntax", "using", "the", "given", "the", "position", "parameter", "and", "arguments", "unless", "one", "was", "already", "reported", "at", "the", "same", "position", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L460-L463
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/InjectionProcessorManager.java
InjectionProcessorManager.getAllDeclaredFields
private Field[] getAllDeclaredFields(Class<?> klass, Class<?> classHierarchy) { """ Return the declared fields for the specified class in the class hierarchy. @param klass the specified class to get declared fields @param classHierarchy the entire class hierarchy @return the declared fields, or null if an exc...
java
private Field[] getAllDeclaredFields(Class<?> klass, Class<?> classHierarchy) { try { return klass.getDeclaredFields(); } catch (Throwable ex) { // The most common 'problem' here is a NoClassDefFoundError because // a dependency class (super/field ...
[ "private", "Field", "[", "]", "getAllDeclaredFields", "(", "Class", "<", "?", ">", "klass", ",", "Class", "<", "?", ">", "classHierarchy", ")", "{", "try", "{", "return", "klass", ".", "getDeclaredFields", "(", ")", ";", "}", "catch", "(", "Throwable", ...
Return the declared fields for the specified class in the class hierarchy. @param klass the specified class to get declared fields @param classHierarchy the entire class hierarchy @return the declared fields, or null if an exception occurs
[ "Return", "the", "declared", "fields", "for", "the", "specified", "class", "in", "the", "class", "hierarchy", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/InjectionProcessorManager.java#L370-L419
Minecrell/TerminalConsoleAppender
src/main/java/net/minecrell/terminalconsole/TerminalConsoleAppender.java
TerminalConsoleAppender.createAppender
@PluginFactory public static TerminalConsoleAppender createAppender( @Required(message = "No name provided for TerminalConsoleAppender") @PluginAttribute("name") String name, @PluginElement("Filter") Filter filter, @PluginElement("Layout") @Nullable Layout<? extends Serializable>...
java
@PluginFactory public static TerminalConsoleAppender createAppender( @Required(message = "No name provided for TerminalConsoleAppender") @PluginAttribute("name") String name, @PluginElement("Filter") Filter filter, @PluginElement("Layout") @Nullable Layout<? extends Serializable>...
[ "@", "PluginFactory", "public", "static", "TerminalConsoleAppender", "createAppender", "(", "@", "Required", "(", "message", "=", "\"No name provided for TerminalConsoleAppender\"", ")", "@", "PluginAttribute", "(", "\"name\"", ")", "String", "name", ",", "@", "PluginEl...
Creates a new {@link TerminalConsoleAppender}. @param name The name of the appender @param filter The filter, can be {@code null} @param layout The layout, can be {@code null} @param ignoreExceptions If {@code true} exceptions encountered when appending events are logged, otherwise they are propagated to the caller @r...
[ "Creates", "a", "new", "{", "@link", "TerminalConsoleAppender", "}", "." ]
train
https://github.com/Minecrell/TerminalConsoleAppender/blob/a540454b397ee488993019fbcacc49b2d88f1752/src/main/java/net/minecrell/terminalconsole/TerminalConsoleAppender.java#L304-L316
greese/dasein-util
src/main/java/org/dasein/util/ConcurrentCache.java
ConcurrentCache.put
public V put(K key, V val) { """ Places the specified value into the cache. @param key the key for the item being placed into the cache @param val the item to be cached @return the resulting value stored in the cache """ //synchronized( this ) { //WeakReference<V> ref = new WeakReference...
java
public V put(K key, V val) { //synchronized( this ) { //WeakReference<V> ref = new WeakReference<V>(val); SoftReference<V> ref = new SoftReference<V>(val); cache.put(key, ref); return get(key); //} }
[ "public", "V", "put", "(", "K", "key", ",", "V", "val", ")", "{", "//synchronized( this ) {", "//WeakReference<V> ref = new WeakReference<V>(val);", "SoftReference", "<", "V", ">", "ref", "=", "new", "SoftReference", "<", "V", ">", "(", "val", ")", ";", "cache...
Places the specified value into the cache. @param key the key for the item being placed into the cache @param val the item to be cached @return the resulting value stored in the cache
[ "Places", "the", "specified", "value", "into", "the", "cache", "." ]
train
https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentCache.java#L259-L267
vdmeer/skb-java-base
src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java
SkbShellFactory.newCommand
public static SkbShellCommand newCommand(String command, SkbShellArgument[] arguments, SkbShellCommandCategory category, String description, String addedHelp) { """ Returns a new shell command, use the factory to create one. @param command the actual command @param arguments the command's arguments, can be null ...
java
public static SkbShellCommand newCommand(String command, SkbShellArgument[] arguments, SkbShellCommandCategory category, String description, String addedHelp){ return new AbstractShellCommand(command, arguments, category, description, addedHelp); }
[ "public", "static", "SkbShellCommand", "newCommand", "(", "String", "command", ",", "SkbShellArgument", "[", "]", "arguments", ",", "SkbShellCommandCategory", "category", ",", "String", "description", ",", "String", "addedHelp", ")", "{", "return", "new", "AbstractS...
Returns a new shell command, use the factory to create one. @param command the actual command @param arguments the command's arguments, can be null @param category the command's category, can be null @param description the command's description @param addedHelp additional help, can be null @return new shell command @th...
[ "Returns", "a", "new", "shell", "command", "use", "the", "factory", "to", "create", "one", "." ]
train
https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L110-L112
ksclarke/vertx-pairtree
src/main/java/info/freelibrary/pairtree/s3/S3ClientRequest.java
S3ClientRequest.b64SignHmacSha1
private static String b64SignHmacSha1(final String aAwsSecretKey, final String aCanonicalString) throws NoSuchAlgorithmException, InvalidKeyException { """ Returns a Base64 HmacSha1 signature. @param aAwsSecretKey An AWS secret key @param aCanonicalString A canonical string to encode @return A Bas...
java
private static String b64SignHmacSha1(final String aAwsSecretKey, final String aCanonicalString) throws NoSuchAlgorithmException, InvalidKeyException { final SecretKeySpec signingKey = new SecretKeySpec(aAwsSecretKey.getBytes(), HASH_CODE); final Mac mac = Mac.getInstance(HASH_CODE); ...
[ "private", "static", "String", "b64SignHmacSha1", "(", "final", "String", "aAwsSecretKey", ",", "final", "String", "aCanonicalString", ")", "throws", "NoSuchAlgorithmException", ",", "InvalidKeyException", "{", "final", "SecretKeySpec", "signingKey", "=", "new", "Secret...
Returns a Base64 HmacSha1 signature. @param aAwsSecretKey An AWS secret key @param aCanonicalString A canonical string to encode @return A Base64 HmacSha1 signature @throws NoSuchAlgorithmException If the system doesn't support the encoding algorithm @throws InvalidKeyException If the supplied AWS secret key is invali...
[ "Returns", "a", "Base64", "HmacSha1", "signature", "." ]
train
https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/s3/S3ClientRequest.java#L434-L442
redbox-mint/redbox
plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java
VitalTransformer.getTempFile
private File getTempFile(DigitalObject object, String pid) throws Exception { """ Stream the data out of storage to our temp directory. @param object Our digital object. @param pid The payload ID to retrieve. @return File The file creating in the temp directory @throws Exception on any errors ...
java
private File getTempFile(DigitalObject object, String pid) throws Exception { // Create file in temp space, use OID in path for uniqueness File directory = new File(tmpDir, object.getId()); File target = new File(directory, pid); if (!target.exists()) { target.get...
[ "private", "File", "getTempFile", "(", "DigitalObject", "object", ",", "String", "pid", ")", "throws", "Exception", "{", "// Create file in temp space, use OID in path for uniqueness", "File", "directory", "=", "new", "File", "(", "tmpDir", ",", "object", ".", "getId"...
Stream the data out of storage to our temp directory. @param object Our digital object. @param pid The payload ID to retrieve. @return File The file creating in the temp directory @throws Exception on any errors
[ "Stream", "the", "data", "out", "of", "storage", "to", "our", "temp", "directory", "." ]
train
https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1291-L1325
JoeKerouac/utils
src/main/java/com/joe/utils/img/IQRCode.java
IQRCode.createImg
public static BufferedImage createImg(String data, int width, int height) throws IOException { """ 将指定数据生成二维码图片的BufferedImage @param data 二维码数据 @param width 图片的宽 @param height 图片的高 @return 二维码图片对应的BufferedImage @throws IOException IO异常 """ logger.debug("生成二维码,要生成的图片的宽为{},高为{}", width, height)...
java
public static BufferedImage createImg(String data, int width, int height) throws IOException { logger.debug("生成二维码,要生成的图片的宽为{},高为{}", width, height); QRCode code = createQRCode(data, width, height); BufferedImage image = ImageIO.read(new ByteArrayInputStream(code.stream().toByteArray())); ...
[ "public", "static", "BufferedImage", "createImg", "(", "String", "data", ",", "int", "width", ",", "int", "height", ")", "throws", "IOException", "{", "logger", ".", "debug", "(", "\"生成二维码,要生成的图片的宽为{},高为{}\", width, height);", "", "", "", "", "", "", "QRCode",...
将指定数据生成二维码图片的BufferedImage @param data 二维码数据 @param width 图片的宽 @param height 图片的高 @return 二维码图片对应的BufferedImage @throws IOException IO异常
[ "将指定数据生成二维码图片的BufferedImage" ]
train
https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/img/IQRCode.java#L72-L78
moparisthebest/beehive
beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessorFactory.java
BaseAnnotationProcessorFactory.getProcessorFor
public final AnnotationProcessor getProcessorFor(Set annotationTypeDeclarations, AnnotationProcessorEnvironment env) { """ Get a Sun annotation processor for the given annotation type declarations. This just wraps the type declarations in our wrapper types, and returns an annotation processor that delegates to o...
java
public final AnnotationProcessor getProcessorFor(Set annotationTypeDeclarations, AnnotationProcessorEnvironment env) { CoreAnnotationProcessorEnv coreEnv = CoreAnnotationProcessorEnvImpl.get( env ); AnnotationTypeDeclaration[] atds = new AnnotationTypeDeclaration[ annotationTypeDeclarations.size() ...
[ "public", "final", "AnnotationProcessor", "getProcessorFor", "(", "Set", "annotationTypeDeclarations", ",", "AnnotationProcessorEnvironment", "env", ")", "{", "CoreAnnotationProcessorEnv", "coreEnv", "=", "CoreAnnotationProcessorEnvImpl", ".", "get", "(", "env", ")", ";", ...
Get a Sun annotation processor for the given annotation type declarations. This just wraps the type declarations in our wrapper types, and returns an annotation processor that delegates to our "core" (apt-independent) processor to do the real work.
[ "Get", "a", "Sun", "annotation", "processor", "for", "the", "given", "annotation", "type", "declarations", ".", "This", "just", "wraps", "the", "type", "declarations", "in", "our", "wrapper", "types", "and", "returns", "an", "annotation", "processor", "that", ...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/apt/BaseAnnotationProcessorFactory.java#L46-L62
ben-manes/caffeine
caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java
BoundedLocalCache.removeNoWriter
@Nullable V removeNoWriter(Object key) { """ Removes the mapping for a key without notifying the writer. @param key key whose mapping is to be removed @return the removed value or null if no mapping was found """ Node<K, V> node = data.remove(nodeFactory.newLookupKey(key)); if (node == null) { ...
java
@Nullable V removeNoWriter(Object key) { Node<K, V> node = data.remove(nodeFactory.newLookupKey(key)); if (node == null) { return null; } V oldValue; synchronized (node) { oldValue = node.getValue(); if (node.isAlive()) { node.retire(); } } RemovalCause caus...
[ "@", "Nullable", "V", "removeNoWriter", "(", "Object", "key", ")", "{", "Node", "<", "K", ",", "V", ">", "node", "=", "data", ".", "remove", "(", "nodeFactory", ".", "newLookupKey", "(", "key", ")", ")", ";", "if", "(", "node", "==", "null", ")", ...
Removes the mapping for a key without notifying the writer. @param key key whose mapping is to be removed @return the removed value or null if no mapping was found
[ "Removes", "the", "mapping", "for", "a", "key", "without", "notifying", "the", "writer", "." ]
train
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/BoundedLocalCache.java#L2048-L2078
alkacon/opencms-core
src/org/opencms/ui/apps/A_CmsAttributeAwareApp.java
A_CmsAttributeAwareApp.openSubView
@Override public void openSubView(String state, boolean updateState) { """ Opens the requested sub view.<p> @param state the state @param updateState <code>true</code> to update the state URL token """ if (updateState) { CmsAppWorkplaceUi.get().changeCurrentAppState(state); ...
java
@Override public void openSubView(String state, boolean updateState) { if (updateState) { CmsAppWorkplaceUi.get().changeCurrentAppState(state); } Component comp = getComponentForState(state); if (comp != null) { updateMainComponent(comp); } else { ...
[ "@", "Override", "public", "void", "openSubView", "(", "String", "state", ",", "boolean", "updateState", ")", "{", "if", "(", "updateState", ")", "{", "CmsAppWorkplaceUi", ".", "get", "(", ")", ".", "changeCurrentAppState", "(", "state", ")", ";", "}", "Co...
Opens the requested sub view.<p> @param state the state @param updateState <code>true</code> to update the state URL token
[ "Opens", "the", "requested", "sub", "view", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/A_CmsAttributeAwareApp.java#L65-L81
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java
VirtualNetworkGatewaysInner.beginGetAdvertisedRoutesAsync
public Observable<GatewayRouteListResultInner> beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { """ This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @param resourceGroupName The name of the resourc...
java
public Observable<GatewayRouteListResultInner> beginGetAdvertisedRoutesAsync(String resourceGroupName, String virtualNetworkGatewayName, String peer) { return beginGetAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).map(new Func1<ServiceResponse<GatewayRouteListResult...
[ "public", "Observable", "<", "GatewayRouteListResultInner", ">", "beginGetAdvertisedRoutesAsync", "(", "String", "resourceGroupName", ",", "String", "virtualNetworkGatewayName", ",", "String", "peer", ")", "{", "return", "beginGetAdvertisedRoutesWithServiceResponseAsync", "(", ...
This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @param resourceGroupName The name of the resource group. @param virtualNetworkGatewayName The name of the virtual network gateway. @param peer The IP address of the peer @throws IllegalArgumentException thrown i...
[ "This", "operation", "retrieves", "a", "list", "of", "routes", "the", "virtual", "network", "gateway", "is", "advertising", "to", "the", "specified", "peer", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2594-L2601
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol2/OutResponseHttp2.java
OutResponseHttp2.flush
@Override protected void flush(Buffer data, boolean isEnd) { """ Writes data to the output. If the headers have not been written, they should be written. """ if (isClosed()) { throw new IllegalStateException(); } _request.outProxy().write(_request, data, isEnd); /* boolean is...
java
@Override protected void flush(Buffer data, boolean isEnd) { if (isClosed()) { throw new IllegalStateException(); } _request.outProxy().write(_request, data, isEnd); /* boolean isHeader = ! isCommitted(); toCommitted(); MessageResponseHttp2 message; TempBuffer n...
[ "@", "Override", "protected", "void", "flush", "(", "Buffer", "data", ",", "boolean", "isEnd", ")", "{", "if", "(", "isClosed", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "_request", ".", "outProxy", "(", ")", ".",...
Writes data to the output. If the headers have not been written, they should be written.
[ "Writes", "data", "to", "the", "output", ".", "If", "the", "headers", "have", "not", "been", "written", "they", "should", "be", "written", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol2/OutResponseHttp2.java#L79-L112
ddf-project/DDF
core/src/main/java/io/ddf/DDFManager.java
DDFManager.get
public static DDFManager get(EngineType engineType) throws DDFException { """ Returns a new instance of {@link DDFManager} for the given engine type @param engineType @return @throws Exception """ if (engineType == null) { engineType = EngineType.fromString(ConfigConstant.ENGINE_NAME_DEFAULT.toS...
java
public static DDFManager get(EngineType engineType) throws DDFException { if (engineType == null) { engineType = EngineType.fromString(ConfigConstant.ENGINE_NAME_DEFAULT.toString()); } String className = Config.getValue(engineType.name(), ConfigConstant.FIELD_DDF_MANAGER); if (Strings.isNullOrEmp...
[ "public", "static", "DDFManager", "get", "(", "EngineType", "engineType", ")", "throws", "DDFException", "{", "if", "(", "engineType", "==", "null", ")", "{", "engineType", "=", "EngineType", ".", "fromString", "(", "ConfigConstant", ".", "ENGINE_NAME_DEFAULT", ...
Returns a new instance of {@link DDFManager} for the given engine type @param engineType @return @throws Exception
[ "Returns", "a", "new", "instance", "of", "{", "@link", "DDFManager", "}", "for", "the", "given", "engine", "type" ]
train
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/DDFManager.java#L230-L255
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.intConsumer
public static IntConsumer intConsumer(CheckedIntConsumer consumer, Consumer<Throwable> handler) { """ Wrap a {@link CheckedIntConsumer} in a {@link IntConsumer} with a custom handler for checked exceptions. <p> Example: <code><pre> Arrays.stream(new int[] { 1, 2 }).forEach(Unchecked.intConsumer( i -> { if (i...
java
public static IntConsumer intConsumer(CheckedIntConsumer consumer, Consumer<Throwable> handler) { return i -> { try { consumer.accept(i); } catch (Throwable e) { handler.accept(e); throw new IllegalStateException("Exception han...
[ "public", "static", "IntConsumer", "intConsumer", "(", "CheckedIntConsumer", "consumer", ",", "Consumer", "<", "Throwable", ">", "handler", ")", "{", "return", "i", "->", "{", "try", "{", "consumer", ".", "accept", "(", "i", ")", ";", "}", "catch", "(", ...
Wrap a {@link CheckedIntConsumer} in a {@link IntConsumer} with a custom handler for checked exceptions. <p> Example: <code><pre> Arrays.stream(new int[] { 1, 2 }).forEach(Unchecked.intConsumer( i -> { if (i &lt; 0) throw new Exception("Only positive numbers allowed"); }, e -> { throw new IllegalStateException(e); } ))...
[ "Wrap", "a", "{" ]
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L735-L746
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java
WebSocketService.setChannels
public void setChannels(String uri, Set<WebSocketChannel> channels) { """ Sets the URI resources for a given URL @param uri The URI resource for the connection @param channels The channels for the URI resource """ Objects.requireNonNull(uri, Required.URI.toString()); Objects.requireNonNull(...
java
public void setChannels(String uri, Set<WebSocketChannel> channels) { Objects.requireNonNull(uri, Required.URI.toString()); Objects.requireNonNull(channels, Required.URI_CONNECTIONS.toString()); this.cache.put(Default.WSS_CACHE_PREFIX.toString() + uri, channels); }
[ "public", "void", "setChannels", "(", "String", "uri", ",", "Set", "<", "WebSocketChannel", ">", "channels", ")", "{", "Objects", ".", "requireNonNull", "(", "uri", ",", "Required", ".", "URI", ".", "toString", "(", ")", ")", ";", "Objects", ".", "requir...
Sets the URI resources for a given URL @param uri The URI resource for the connection @param channels The channels for the URI resource
[ "Sets", "the", "URI", "resources", "for", "a", "given", "URL" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java#L60-L65
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/RowComparatorSorting.java
RowComparatorSorting.compare
@Override public int compare(Row row1, Row row2) { """ {@inheritDoc} @param row1 A {@link Row}. @param row2 A {@link Row}. @return A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second according to a Lucene {@link Sort}. """ C...
java
@Override public int compare(Row row1, Row row2) { Columns columns1 = rowMapper.columns(row1); Columns columns2 = rowMapper.columns(row2); return comparatorChain.compare(columns1, columns2); }
[ "@", "Override", "public", "int", "compare", "(", "Row", "row1", ",", "Row", "row2", ")", "{", "Columns", "columns1", "=", "rowMapper", ".", "columns", "(", "row1", ")", ";", "Columns", "columns2", "=", "rowMapper", ".", "columns", "(", "row2", ")", ";...
{@inheritDoc} @param row1 A {@link Row}. @param row2 A {@link Row}. @return A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second according to a Lucene {@link Sort}.
[ "{", "@inheritDoc", "}" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowComparatorSorting.java#L58-L63
likethecolor/Alchemy-API
src/main/java/com/likethecolor/alchemy/api/parser/json/TaxonomyParser.java
TaxonomyParser.isValidTaxonomy
private boolean isValidTaxonomy(final String label, final Double score) { """ Return true if at least one of the values is not null/empty. @param label the label text @param score the sentiment score @return true if at least one of the values is not null/empty """ return !StringUtils.isBlank(label) ...
java
private boolean isValidTaxonomy(final String label, final Double score) { return !StringUtils.isBlank(label) || score != null; }
[ "private", "boolean", "isValidTaxonomy", "(", "final", "String", "label", ",", "final", "Double", "score", ")", "{", "return", "!", "StringUtils", ".", "isBlank", "(", "label", ")", "||", "score", "!=", "null", ";", "}" ]
Return true if at least one of the values is not null/empty. @param label the label text @param score the sentiment score @return true if at least one of the values is not null/empty
[ "Return", "true", "if", "at", "least", "one", "of", "the", "values", "is", "not", "null", "/", "empty", "." ]
train
https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/TaxonomyParser.java#L45-L48
BlueBrain/bluima
modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/io/GISModelReader.java
GISModelReader.getParameters
protected Context[] getParameters (int[][] outcomePatterns) throws java.io.IOException { """ Reads the parameters from a file and populates an array of context objects. @param outcomePatterns The outcomes patterns for the model. The first index refers to which outcome pattern (a set of outcomes that occurs with...
java
protected Context[] getParameters (int[][] outcomePatterns) throws java.io.IOException { Context[] params = new Context[NUM_PREDS]; int pid=0; for (int i=0; i<outcomePatterns.length; i++) { //construct outcome pattern int[] outcomePattern = new int[outcomePatterns[i].length-1]; ...
[ "protected", "Context", "[", "]", "getParameters", "(", "int", "[", "]", "[", "]", "outcomePatterns", ")", "throws", "java", ".", "io", ".", "IOException", "{", "Context", "[", "]", "params", "=", "new", "Context", "[", "NUM_PREDS", "]", ";", "int", "p...
Reads the parameters from a file and populates an array of context objects. @param outcomePatterns The outcomes patterns for the model. The first index refers to which outcome pattern (a set of outcomes that occurs with a context) is being specified. The second index specifies the number of contexts which use this pa...
[ "Reads", "the", "parameters", "from", "a", "file", "and", "populates", "an", "array", "of", "context", "objects", "." ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/io/GISModelReader.java#L148-L168
pedrovgs/Nox
nox/src/main/java/com/github/pedrovgs/nox/NoxView.java
NoxView.createShape
private void createShape() { """ Initializes a Shape instance given the NoxView configuration provided programmatically or using XML styleable attributes. """ if (shape == null) { float firstItemMargin = noxConfig.getNoxItemMargin(); float firstItemSize = noxConfig.getNoxItemSize(); int ...
java
private void createShape() { if (shape == null) { float firstItemMargin = noxConfig.getNoxItemMargin(); float firstItemSize = noxConfig.getNoxItemSize(); int viewHeight = getMeasuredHeight(); int viewWidth = getMeasuredWidth(); int numberOfElements = noxItemCatalog.size(); ShapeC...
[ "private", "void", "createShape", "(", ")", "{", "if", "(", "shape", "==", "null", ")", "{", "float", "firstItemMargin", "=", "noxConfig", ".", "getNoxItemMargin", "(", ")", ";", "float", "firstItemSize", "=", "noxConfig", ".", "getNoxItemSize", "(", ")", ...
Initializes a Shape instance given the NoxView configuration provided programmatically or using XML styleable attributes.
[ "Initializes", "a", "Shape", "instance", "given", "the", "NoxView", "configuration", "provided", "programmatically", "or", "using", "XML", "styleable", "attributes", "." ]
train
https://github.com/pedrovgs/Nox/blob/b4dfe37895e1b7bf2084d60139931dd4fb12f3f4/nox/src/main/java/com/github/pedrovgs/nox/NoxView.java#L365-L379
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.trimStart
@Nullable @CheckReturnValue public static String trimStart (@Nullable final String sSrc, @Nullable final String sLead) { """ Trim the passed lead from the source value. If the source value does not start with the passed lead, nothing happens. @param sSrc The input source string @param sLead The string t...
java
@Nullable @CheckReturnValue public static String trimStart (@Nullable final String sSrc, @Nullable final String sLead) { return startsWith (sSrc, sLead) ? sSrc.substring (sLead.length (), sSrc.length ()) : sSrc; }
[ "@", "Nullable", "@", "CheckReturnValue", "public", "static", "String", "trimStart", "(", "@", "Nullable", "final", "String", "sSrc", ",", "@", "Nullable", "final", "String", "sLead", ")", "{", "return", "startsWith", "(", "sSrc", ",", "sLead", ")", "?", "...
Trim the passed lead from the source value. If the source value does not start with the passed lead, nothing happens. @param sSrc The input source string @param sLead The string to be trimmed of the beginning @return The trimmed string, or the original input string, if the lead was not found @see #trimEnd(String, Stri...
[ "Trim", "the", "passed", "lead", "from", "the", "source", "value", ".", "If", "the", "source", "value", "does", "not", "start", "with", "the", "passed", "lead", "nothing", "happens", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3284-L3289
lucee/Lucee
core/src/main/java/lucee/runtime/schedule/StorageUtil.java
StorageUtil.setString
public void setString(Element el, String key, String value) { """ sets a string value to a XML Element @param el Element to set value on it @param key key to set @param value value to set """ if (value != null) el.setAttribute(key, value); }
java
public void setString(Element el, String key, String value) { if (value != null) el.setAttribute(key, value); }
[ "public", "void", "setString", "(", "Element", "el", ",", "String", "key", ",", "String", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "el", ".", "setAttribute", "(", "key", ",", "value", ")", ";", "}" ]
sets a string value to a XML Element @param el Element to set value on it @param key key to set @param value value to set
[ "sets", "a", "string", "value", "to", "a", "XML", "Element" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L357-L359
googleapis/google-cloud-java
google-cloud-clients/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java
OsLoginServiceClient.updateSshPublicKey
public final SshPublicKey updateSshPublicKey(String name, SshPublicKey sshPublicKey) { """ Updates an SSH public key and returns the profile information. This method supports patch semantics. <p>Sample code: <pre><code> try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { Fing...
java
public final SshPublicKey updateSshPublicKey(String name, SshPublicKey sshPublicKey) { UpdateSshPublicKeyRequest request = UpdateSshPublicKeyRequest.newBuilder().setName(name).setSshPublicKey(sshPublicKey).build(); return updateSshPublicKey(request); }
[ "public", "final", "SshPublicKey", "updateSshPublicKey", "(", "String", "name", ",", "SshPublicKey", "sshPublicKey", ")", "{", "UpdateSshPublicKeyRequest", "request", "=", "UpdateSshPublicKeyRequest", ".", "newBuilder", "(", ")", ".", "setName", "(", "name", ")", "....
Updates an SSH public key and returns the profile information. This method supports patch semantics. <p>Sample code: <pre><code> try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); SshPublicKey sshPublicKey = SshPublic...
[ "Updates", "an", "SSH", "public", "key", "and", "returns", "the", "profile", "information", ".", "This", "method", "supports", "patch", "semantics", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java#L765-L770
Wikidata/Wikidata-Toolkit
wdtk-examples/src/main/java/org/wikidata/wdtk/examples/LifeExpectancyProcessor.java
LifeExpectancyProcessor.getYearIfAny
private int getYearIfAny(StatementDocument document, String propertyId) { """ Helper method that finds the first value of a time-valued property (if any), and extracts an integer year. It checks if the value has sufficient precision to extract an exact year. @param document the document to extract the data f...
java
private int getYearIfAny(StatementDocument document, String propertyId) { TimeValue date = document.findStatementTimeValue(propertyId); if (date != null && date.getPrecision() >= TimeValue.PREC_YEAR) { return (int) date.getYear(); } else { return Integer.MIN_VALUE; } }
[ "private", "int", "getYearIfAny", "(", "StatementDocument", "document", ",", "String", "propertyId", ")", "{", "TimeValue", "date", "=", "document", ".", "findStatementTimeValue", "(", "propertyId", ")", ";", "if", "(", "date", "!=", "null", "&&", "date", ".",...
Helper method that finds the first value of a time-valued property (if any), and extracts an integer year. It checks if the value has sufficient precision to extract an exact year. @param document the document to extract the data from @param propertyId the string id of the property to look for @return the year, or Int...
[ "Helper", "method", "that", "finds", "the", "first", "value", "of", "a", "time", "-", "valued", "property", "(", "if", "any", ")", "and", "extracts", "an", "integer", "year", ".", "It", "checks", "if", "the", "value", "has", "sufficient", "precision", "t...
train
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/LifeExpectancyProcessor.java#L155-L162
Azure/azure-sdk-for-java
network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java
ExpressRouteCircuitAuthorizationsInner.createOrUpdateAsync
public Observable<ExpressRouteCircuitAuthorizationInner> createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { """ Creates or updates an authorization in the specified express route circuit. @param resourceGro...
java
public Observable<ExpressRouteCircuitAuthorizationInner> createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, a...
[ "public", "Observable", "<", "ExpressRouteCircuitAuthorizationInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "circuitName", ",", "String", "authorizationName", ",", "ExpressRouteCircuitAuthorizationInner", "authorizationParameters", ")", ...
Creates or updates an authorization in the specified express route circuit. @param resourceGroupName The name of the resource group. @param circuitName The name of the express route circuit. @param authorizationName The name of the authorization. @param authorizationParameters Parameters supplied to the create or upda...
[ "Creates", "or", "updates", "an", "authorization", "in", "the", "specified", "express", "route", "circuit", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java#L391-L398
jenkinsci/jenkins
core/src/main/java/hudson/scm/SCM.java
SCM.buildEnvironment
public void buildEnvironment(@Nonnull Run<?,?> build, @Nonnull Map<String,String> env) { """ Adds environmental variables for the builds to the given map. <p> This can be used to propagate information from SCM to builds (for example, SVN revision number.) <p> This method is invoked whenever someone does {...
java
public void buildEnvironment(@Nonnull Run<?,?> build, @Nonnull Map<String,String> env) { if (build instanceof AbstractBuild) { buildEnvVars((AbstractBuild)build, env); } }
[ "public", "void", "buildEnvironment", "(", "@", "Nonnull", "Run", "<", "?", ",", "?", ">", "build", ",", "@", "Nonnull", "Map", "<", "String", ",", "String", ">", "env", ")", "{", "if", "(", "build", "instanceof", "AbstractBuild", ")", "{", "buildEnvVa...
Adds environmental variables for the builds to the given map. <p> This can be used to propagate information from SCM to builds (for example, SVN revision number.) <p> This method is invoked whenever someone does {@link AbstractBuild#getEnvironment(TaskListener)}, via {@link #buildEnvVars(AbstractBuild, Map)}, which c...
[ "Adds", "environmental", "variables", "for", "the", "builds", "to", "the", "given", "map", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L541-L545
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/SliceOps.java
SliceOps.calcSize
private static long calcSize(long size, long skip, long limit) { """ Calculates the sliced size given the current size, number of elements skip, and the number of elements to limit. @param size the current size @param skip the number of elements to skip, assumed to be >= 0 @param limit the number of elements...
java
private static long calcSize(long size, long skip, long limit) { return size >= 0 ? Math.max(-1, Math.min(size - skip, limit)) : -1; }
[ "private", "static", "long", "calcSize", "(", "long", "size", ",", "long", "skip", ",", "long", "limit", ")", "{", "return", "size", ">=", "0", "?", "Math", ".", "max", "(", "-", "1", ",", "Math", ".", "min", "(", "size", "-", "skip", ",", "limit...
Calculates the sliced size given the current size, number of elements skip, and the number of elements to limit. @param size the current size @param skip the number of elements to skip, assumed to be >= 0 @param limit the number of elements to limit, assumed to be >= 0, with a value of {@code Long.MAX_VALUE} if there ...
[ "Calculates", "the", "sliced", "size", "given", "the", "current", "size", "number", "of", "elements", "skip", "and", "the", "number", "of", "elements", "to", "limit", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/SliceOps.java#L52-L54
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java
ImageBandMath.stdDev
public static void stdDev(Planar<GrayU16> input, GrayU16 output, @Nullable GrayU16 avg, int startBand, int lastBand) { """ Computes the standard deviation for each pixel across all bands in the {@link Planar} image. @param input Planar image - not modified @param output Gray scale image containing averag...
java
public static void stdDev(Planar<GrayU16> input, GrayU16 output, @Nullable GrayU16 avg, int startBand, int lastBand) { checkInput(input, startBand, lastBand); output.reshape(input.width,input.height); if( avg == null ) { avg = new GrayU16(input.width,input.height); average(input,avg,startBand,lastBand); }...
[ "public", "static", "void", "stdDev", "(", "Planar", "<", "GrayU16", ">", "input", ",", "GrayU16", "output", ",", "@", "Nullable", "GrayU16", "avg", ",", "int", "startBand", ",", "int", "lastBand", ")", "{", "checkInput", "(", "input", ",", "startBand", ...
Computes the standard deviation for each pixel across all bands in the {@link Planar} image. @param input Planar image - not modified @param output Gray scale image containing average pixel values - modified @param avg Input Gray scale image containing average image. Can be null @param startBand First ban...
[ "Computes", "the", "standard", "deviation", "for", "each", "pixel", "across", "all", "bands", "in", "the", "{" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java#L540-L552
landawn/AbacusUtil
src/com/landawn/abacus/util/Multimap.java
Multimap.computeIfPresent
public <X extends Exception> V computeIfPresent(K key, Try.BiFunction<? super K, ? super V, ? extends V, X> remappingFunction) throws X { """ The implementation is equivalent to performing the following steps for this Multimap: <pre> final V oldValue = get(key); if (N.isNullOrEmpty(oldValue)) { return oldV...
java
public <X extends Exception> V computeIfPresent(K key, Try.BiFunction<? super K, ? super V, ? extends V, X> remappingFunction) throws X { N.checkArgNotNull(remappingFunction); final V oldValue = get(key); if (N.isNullOrEmpty(oldValue)) { return oldValue; } ...
[ "public", "<", "X", "extends", "Exception", ">", "V", "computeIfPresent", "(", "K", "key", ",", "Try", ".", "BiFunction", "<", "?", "super", "K", ",", "?", "super", "V", ",", "?", "extends", "V", ",", "X", ">", "remappingFunction", ")", "throws", "X"...
The implementation is equivalent to performing the following steps for this Multimap: <pre> final V oldValue = get(key); if (N.isNullOrEmpty(oldValue)) { return oldValue; } final V newValue = remappingFunction.apply(key, oldValue); if (N.notNullOrEmpty(newValue)) { valueMap.put(key, newValue); } else { valueMap.rem...
[ "The", "implementation", "is", "equivalent", "to", "performing", "the", "following", "steps", "for", "this", "Multimap", ":" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Multimap.java#L1135-L1153
Whiley/WhileyCompiler
src/main/java/wyc/io/WhileyFileParser.java
WhileyFileParser.parseLambdaInitialiser
private Expr parseLambdaInitialiser(EnclosingScope scope, boolean terminated) { """ Parse a lambda expression, which has the form: <pre> TermExpr::= ... | '&' [ '[' [ Lifetime (',' Lifetime )* ] ']' ] [ '<' [ Identifier (',' Identifier)* ] '>' ] '(' [Type Identifier (',' Type Identifier)*] '->' Expr ')' ...
java
private Expr parseLambdaInitialiser(EnclosingScope scope, boolean terminated) { int start = index; match(Ampersand); // First parse the captured lifetimes with the original scope Tuple<Identifier> captures = parseOptionalCapturedLifetimes(scope); // Now we create a new scope for this lambda expression. // I...
[ "private", "Expr", "parseLambdaInitialiser", "(", "EnclosingScope", "scope", ",", "boolean", "terminated", ")", "{", "int", "start", "=", "index", ";", "match", "(", "Ampersand", ")", ";", "// First parse the captured lifetimes with the original scope", "Tuple", "<", ...
Parse a lambda expression, which has the form: <pre> TermExpr::= ... | '&' [ '[' [ Lifetime (',' Lifetime )* ] ']' ] [ '<' [ Identifier (',' Identifier)* ] '>' ] '(' [Type Identifier (',' Type Identifier)*] '->' Expr ')' </pre> @param scope The enclosing scope for this statement, which determines the set of visibl...
[ "Parse", "a", "lambda", "expression", "which", "has", "the", "form", ":" ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L3171-L3189
VoltDB/voltdb
src/frontend/org/voltdb/planner/SubPlanAssembler.java
SubPlanAssembler.getScanAccessPlanForTable
private static AbstractScanPlanNode getScanAccessPlanForTable(StmtTableScan tableScan, AccessPath path) { """ Get a sequential scan access plan for a table. For multi-site plans/tables, scans at all partitions. @param table The table to scan. @param path The access path to access the data in the table (in...
java
private static AbstractScanPlanNode getScanAccessPlanForTable(StmtTableScan tableScan, AccessPath path) { // build the scan node SeqScanPlanNode scanNode = new SeqScanPlanNode(tableScan); // build the predicate scanNode.setPredicate(path.otherExprs); return scanNode; ...
[ "private", "static", "AbstractScanPlanNode", "getScanAccessPlanForTable", "(", "StmtTableScan", "tableScan", ",", "AccessPath", "path", ")", "{", "// build the scan node", "SeqScanPlanNode", "scanNode", "=", "new", "SeqScanPlanNode", "(", "tableScan", ")", ";", "// build ...
Get a sequential scan access plan for a table. For multi-site plans/tables, scans at all partitions. @param table The table to scan. @param path The access path to access the data in the table (index/scan/etc). @return A scan plan node
[ "Get", "a", "sequential", "scan", "access", "plan", "for", "a", "table", ".", "For", "multi", "-", "site", "plans", "/", "tables", "scans", "at", "all", "partitions", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/SubPlanAssembler.java#L2171-L2179
apache/incubator-druid
server/src/main/java/org/apache/druid/guice/SQLMetadataStorageDruidModule.java
SQLMetadataStorageDruidModule.createBindingChoices
public void createBindingChoices(Binder binder, String defaultValue) { """ This function only needs to be called by the default SQL metadata storage module Other modules should default to calling super.configure(...) alone @param defaultValue default property value """ String prop = PROPERTY; PolyB...
java
public void createBindingChoices(Binder binder, String defaultValue) { String prop = PROPERTY; PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageConnector.class), defaultValue); PolyBind.createChoiceWithDefault(binder, prop, Key.get(MetadataStorageProvider.class), defaultValue); Po...
[ "public", "void", "createBindingChoices", "(", "Binder", "binder", ",", "String", "defaultValue", ")", "{", "String", "prop", "=", "PROPERTY", ";", "PolyBind", ".", "createChoiceWithDefault", "(", "binder", ",", "prop", ",", "Key", ".", "get", "(", "MetadataSt...
This function only needs to be called by the default SQL metadata storage module Other modules should default to calling super.configure(...) alone @param defaultValue default property value
[ "This", "function", "only", "needs", "to", "be", "called", "by", "the", "default", "SQL", "metadata", "storage", "module", "Other", "modules", "should", "default", "to", "calling", "super", ".", "configure", "(", "...", ")", "alone" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/guice/SQLMetadataStorageDruidModule.java#L69-L88
lessthanoptimal/ejml
main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java
RandomMatrices_DSCC.symmetricPosDef
public static DMatrixSparseCSC symmetricPosDef( int width , int nz_total , Random rand ) { """ Creates a random symmetric positive definite matrix. @param width number of columns and rows @param nz_total Used to adjust number of non-zero values. Exact amount in final matrix will be more than this. @param rand r...
java
public static DMatrixSparseCSC symmetricPosDef( int width , int nz_total , Random rand ) { DMatrixSparseCSC A = rectangle(width,width,nz_total,rand); // to ensure it's SPD assign non-zero values to all the diagonal elements for (int i = 0; i < width; i++) { A.set(i,i,Math.max(0.5,ra...
[ "public", "static", "DMatrixSparseCSC", "symmetricPosDef", "(", "int", "width", ",", "int", "nz_total", ",", "Random", "rand", ")", "{", "DMatrixSparseCSC", "A", "=", "rectangle", "(", "width", ",", "width", ",", "nz_total", ",", "rand", ")", ";", "// to ens...
Creates a random symmetric positive definite matrix. @param width number of columns and rows @param nz_total Used to adjust number of non-zero values. Exact amount in final matrix will be more than this. @param rand random number generator @return Random matrix
[ "Creates", "a", "random", "symmetric", "positive", "definite", "matrix", "." ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L253-L266
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java
UpdateOperationWithCacheFileTask.renameFile
protected static void renameFile(@Nonnull final File from, @Nonnull final File to) { """ Renames the given file {@code from} to the new file {@code to}. @param from an existing file @param to a new file @throws net.sf.qualitycheck.exception.IllegalNullArgumentException if one of the given arguments is {@...
java
protected static void renameFile(@Nonnull final File from, @Nonnull final File to) { Check.notNull(from, "from"); Check.stateIsTrue(from.exists(), "Argument 'from' must not be an existing file."); Check.notNull(to, "to"); Check.stateIsTrue(from.renameTo(to), "Renaming file from '%s' to '%s' failed.", from.getAb...
[ "protected", "static", "void", "renameFile", "(", "@", "Nonnull", "final", "File", "from", ",", "@", "Nonnull", "final", "File", "to", ")", "{", "Check", ".", "notNull", "(", "from", ",", "\"from\"", ")", ";", "Check", ".", "stateIsTrue", "(", "from", ...
Renames the given file {@code from} to the new file {@code to}. @param from an existing file @param to a new file @throws net.sf.qualitycheck.exception.IllegalNullArgumentException if one of the given arguments is {@code null} @throws net.sf.qualitycheck.exception.IllegalStateOfArgumentException if the file can not b...
[ "Renames", "the", "given", "file", "{", "@code", "from", "}", "to", "the", "new", "file", "{", "@code", "to", "}", "." ]
train
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/UpdateOperationWithCacheFileTask.java#L184-L189
comapi/comapi-chat-sdk-android
COMAPI/chat/src/main/java/com/comapi/chat/PersistenceController.java
PersistenceController.upsertMessageStatuses
public Observable<Boolean> upsertMessageStatuses(String conversationId, String profileId, List<MessageStatusUpdate> msgStatusList) { """ Insert new message statuses obtained from message query. @param conversationId Unique conversation id. @param profileId Profile id from current session details. @param ...
java
public Observable<Boolean> upsertMessageStatuses(String conversationId, String profileId, List<MessageStatusUpdate> msgStatusList) { return asObservable(new Executor<Boolean>() { @Override void execute(ChatStore store, Emitter<Boolean> emitter) { store.beginTransaction(...
[ "public", "Observable", "<", "Boolean", ">", "upsertMessageStatuses", "(", "String", "conversationId", ",", "String", "profileId", ",", "List", "<", "MessageStatusUpdate", ">", "msgStatusList", ")", "{", "return", "asObservable", "(", "new", "Executor", "<", "Bool...
Insert new message statuses obtained from message query. @param conversationId Unique conversation id. @param profileId Profile id from current session details. @param msgStatusList New message statuses. @return Observable emitting result.
[ "Insert", "new", "message", "statuses", "obtained", "from", "message", "query", "." ]
train
https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/PersistenceController.java#L387-L417
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/TypeUtil.java
TypeUtil.defaultIfNotInteger
public static int defaultIfNotInteger(String _possibleInt, int _default) { """ Returns integer converted from string or default if string could not be converted to int. @param _possibleInt string to convert @param _default default to use if string cannot be converted @return int """ if (isInteger(_...
java
public static int defaultIfNotInteger(String _possibleInt, int _default) { if (isInteger(_possibleInt)) { return Integer.parseInt(_possibleInt); } return _default; }
[ "public", "static", "int", "defaultIfNotInteger", "(", "String", "_possibleInt", ",", "int", "_default", ")", "{", "if", "(", "isInteger", "(", "_possibleInt", ")", ")", "{", "return", "Integer", ".", "parseInt", "(", "_possibleInt", ")", ";", "}", "return",...
Returns integer converted from string or default if string could not be converted to int. @param _possibleInt string to convert @param _default default to use if string cannot be converted @return int
[ "Returns", "integer", "converted", "from", "string", "or", "default", "if", "string", "could", "not", "be", "converted", "to", "int", "." ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/TypeUtil.java#L367-L372
JodaOrg/joda-time
src/main/java/org/joda/time/MutableDateTime.java
MutableDateTime.setRounding
public void setRounding(DateTimeField field, int mode) { """ Sets the status of rounding to use the specified field and mode. A null field or mode of ROUND_NONE will disable rounding. Once set, the instant is then rounded using the new field and mode. <p> Enabling rounding will cause all subsequent calls to {@...
java
public void setRounding(DateTimeField field, int mode) { if (field != null && (mode < ROUND_NONE || mode > ROUND_HALF_EVEN)) { throw new IllegalArgumentException("Illegal rounding mode: " + mode); } iRoundingField = (mode == ROUND_NONE ? null : field); iRoundingMode = (field ...
[ "public", "void", "setRounding", "(", "DateTimeField", "field", ",", "int", "mode", ")", "{", "if", "(", "field", "!=", "null", "&&", "(", "mode", "<", "ROUND_NONE", "||", "mode", ">", "ROUND_HALF_EVEN", ")", ")", "{", "throw", "new", "IllegalArgumentExcep...
Sets the status of rounding to use the specified field and mode. A null field or mode of ROUND_NONE will disable rounding. Once set, the instant is then rounded using the new field and mode. <p> Enabling rounding will cause all subsequent calls to {@link #setMillis(long)} to be rounded. This can be used to control the ...
[ "Sets", "the", "status", "of", "rounding", "to", "use", "the", "specified", "field", "and", "mode", ".", "A", "null", "field", "or", "mode", "of", "ROUND_NONE", "will", "disable", "rounding", ".", "Once", "set", "the", "instant", "is", "then", "rounded", ...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L434-L441
ironjacamar/ironjacamar
deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java
AbstractResourceAdapterDeployer.registerMetadata
public Metadata registerMetadata(String name, Connector c, File archive) { """ Register a metadata instance with the repository @param name The name @param c The connector metadata @param archive The archive @return The metadata instance registered """ Metadata md = new MetadataImpl(name, c, archive)...
java
public Metadata registerMetadata(String name, Connector c, File archive) { Metadata md = new MetadataImpl(name, c, archive); metadataRepository.registerMetadata(md); return md; }
[ "public", "Metadata", "registerMetadata", "(", "String", "name", ",", "Connector", "c", ",", "File", "archive", ")", "{", "Metadata", "md", "=", "new", "MetadataImpl", "(", "name", ",", "c", ",", "archive", ")", ";", "metadataRepository", ".", "registerMetad...
Register a metadata instance with the repository @param name The name @param c The connector metadata @param archive The archive @return The metadata instance registered
[ "Register", "a", "metadata", "instance", "with", "the", "repository" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java#L297-L302
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java
AbstractCommand.createButton
public final AbstractButton createButton(ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer) { """ Create a button using the default buttonFactory. @see #createButton(String, ButtonFactory, CommandButtonConfigurer) """ return createButton(getDefaultFaceDescriptorId(), buttonFactory, but...
java
public final AbstractButton createButton(ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer) { return createButton(getDefaultFaceDescriptorId(), buttonFactory, buttonConfigurer); }
[ "public", "final", "AbstractButton", "createButton", "(", "ButtonFactory", "buttonFactory", ",", "CommandButtonConfigurer", "buttonConfigurer", ")", "{", "return", "createButton", "(", "getDefaultFaceDescriptorId", "(", ")", ",", "buttonFactory", ",", "buttonConfigurer", ...
Create a button using the default buttonFactory. @see #createButton(String, ButtonFactory, CommandButtonConfigurer)
[ "Create", "a", "button", "using", "the", "default", "buttonFactory", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L766-L768
micronaut-projects/micronaut-core
http/src/main/java/io/micronaut/http/hateoas/AbstractResource.java
AbstractResource.setLinks
@SuppressWarnings("unchecked") @Internal protected final void setLinks(Map<String, Object> links) { """ Allows de-serializing of links with Jackson. @param links The links """ for (Map.Entry<String, Object> entry : links.entrySet()) { String name = entry.getKey(); Obj...
java
@SuppressWarnings("unchecked") @Internal protected final void setLinks(Map<String, Object> links) { for (Map.Entry<String, Object> entry : links.entrySet()) { String name = entry.getKey(); Object value = entry.getValue(); if (value instanceof Map) { Ma...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Internal", "protected", "final", "void", "setLinks", "(", "Map", "<", "String", ",", "Object", ">", "links", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Object", ">", "entry", ...
Allows de-serializing of links with Jackson. @param links The links
[ "Allows", "de", "-", "serializing", "of", "links", "with", "Jackson", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http/src/main/java/io/micronaut/http/hateoas/AbstractResource.java#L139-L150