repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
201
func_name
stringlengths
4
126
whole_func_string
stringlengths
75
3.57k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.57k
func_code_tokens
listlengths
21
599
func_documentation_string
stringlengths
61
1.95k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java
WebhooksInner.listByAutomationAccountAsync
public Observable<Page<WebhookInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName, final String filter) { return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName, filter) .map(new Func1<ServiceResponse<Page<WebhookInner>>, Page<WebhookInner>>() { @Override public Page<WebhookInner> call(ServiceResponse<Page<WebhookInner>> response) { return response.body(); } }); }
java
public Observable<Page<WebhookInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName, final String filter) { return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName, filter) .map(new Func1<ServiceResponse<Page<WebhookInner>>, Page<WebhookInner>>() { @Override public Page<WebhookInner> call(ServiceResponse<Page<WebhookInner>> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Page", "<", "WebhookInner", ">", ">", "listByAutomationAccountAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "automationAccountName", ",", "final", "String", "filter", ")", "{", "return", "listByAutomationAcc...
Retrieve a list of webhooks. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param filter The filter to apply on the operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;WebhookInner&gt; object
[ "Retrieve", "a", "list", "of", "webhooks", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java#L729-L737
dihedron/dihedron-commons
src/main/java/org/dihedron/core/reflection/Types.java
Types.isOfSuperClassOf
public static boolean isOfSuperClassOf(Object object, Class<?> clazz) { if(object == null || clazz == null) { return false; } return object.getClass().isAssignableFrom(clazz); }
java
public static boolean isOfSuperClassOf(Object object, Class<?> clazz) { if(object == null || clazz == null) { return false; } return object.getClass().isAssignableFrom(clazz); }
[ "public", "static", "boolean", "isOfSuperClassOf", "(", "Object", "object", ",", "Class", "<", "?", ">", "clazz", ")", "{", "if", "(", "object", "==", "null", "||", "clazz", "==", "null", ")", "{", "return", "false", ";", "}", "return", "object", ".", ...
Returns whether the given object is an instance of a superclass of the given class, that is if it can be cast to the given class. @param object the object being tested. @param clazz the class to check. @return whether the object under inspection can be cast to the given class.
[ "Returns", "whether", "the", "given", "object", "is", "an", "instance", "of", "a", "superclass", "of", "the", "given", "class", "that", "is", "if", "it", "can", "be", "cast", "to", "the", "given", "class", "." ]
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/reflection/Types.java#L244-L249
google/truth
core/src/main/java/com/google/common/truth/MultimapSubject.java
MultimapSubject.containsAtLeast
@CanIgnoreReturnValue public Ordered containsAtLeast(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) { return containsAtLeastEntriesIn(accumulateMultimap(k0, v0, rest)); }
java
@CanIgnoreReturnValue public Ordered containsAtLeast(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest) { return containsAtLeastEntriesIn(accumulateMultimap(k0, v0, rest)); }
[ "@", "CanIgnoreReturnValue", "public", "Ordered", "containsAtLeast", "(", "@", "NullableDecl", "Object", "k0", ",", "@", "NullableDecl", "Object", "v0", ",", "Object", "...", "rest", ")", "{", "return", "containsAtLeastEntriesIn", "(", "accumulateMultimap", "(", "...
Fails if the multimap does not contain at least the given key/value pairs. <p><b>Warning:</b> the use of varargs means that we cannot guarantee an equal number of key/value pairs at compile time. Please make sure you provide varargs in key/value pairs!
[ "Fails", "if", "the", "multimap", "does", "not", "contain", "at", "least", "the", "given", "key", "/", "value", "pairs", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MultimapSubject.java#L307-L310
cqframework/clinical_quality_language
Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseClinicalVisitor.java
ElmBaseClinicalVisitor.visitBinaryExpression
@Override public T visitBinaryExpression(BinaryExpression elm, C context) { if (elm instanceof CalculateAgeAt) return visitCalculateAgeAt((CalculateAgeAt)elm, context); else return super.visitBinaryExpression(elm, context); }
java
@Override public T visitBinaryExpression(BinaryExpression elm, C context) { if (elm instanceof CalculateAgeAt) return visitCalculateAgeAt((CalculateAgeAt)elm, context); else return super.visitBinaryExpression(elm, context); }
[ "@", "Override", "public", "T", "visitBinaryExpression", "(", "BinaryExpression", "elm", ",", "C", "context", ")", "{", "if", "(", "elm", "instanceof", "CalculateAgeAt", ")", "return", "visitCalculateAgeAt", "(", "(", "CalculateAgeAt", ")", "elm", ",", "context"...
Visit a BinaryExpression. This method will be called for every node in the tree that is a BinaryExpression. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result
[ "Visit", "a", "BinaryExpression", ".", "This", "method", "will", "be", "called", "for", "every", "node", "in", "the", "tree", "that", "is", "a", "BinaryExpression", "." ]
train
https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseClinicalVisitor.java#L57-L61
ngageoint/geopackage-android-map
geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/GeoPackageOverlayFactory.java
GeoPackageOverlayFactory.getBoundedOverlay
public static BoundedOverlay getBoundedOverlay(TileDao tileDao, float density) { BoundedOverlay overlay = null; if (tileDao.isGoogleTiles()) { overlay = new GoogleAPIGeoPackageOverlay(tileDao); } else { overlay = new GeoPackageOverlay(tileDao, density); } return overlay; }
java
public static BoundedOverlay getBoundedOverlay(TileDao tileDao, float density) { BoundedOverlay overlay = null; if (tileDao.isGoogleTiles()) { overlay = new GoogleAPIGeoPackageOverlay(tileDao); } else { overlay = new GeoPackageOverlay(tileDao, density); } return overlay; }
[ "public", "static", "BoundedOverlay", "getBoundedOverlay", "(", "TileDao", "tileDao", ",", "float", "density", ")", "{", "BoundedOverlay", "overlay", "=", "null", ";", "if", "(", "tileDao", ".", "isGoogleTiles", "(", ")", ")", "{", "overlay", "=", "new", "Go...
Get a Bounded Overlay Tile Provider for the Tile DAO with the display density @param tileDao tile dao @param density display density: {@link android.util.DisplayMetrics#density} @return bounded overlay @since 3.2.0
[ "Get", "a", "Bounded", "Overlay", "Tile", "Provider", "for", "the", "Tile", "DAO", "with", "the", "display", "density" ]
train
https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/GeoPackageOverlayFactory.java#L73-L84
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java
StackingComponentEventManager.notifyComponentEvent
private void notifyComponentEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.shouldStack) { synchronized (this) { this.events.push(new ComponentEventEntry(event, descriptor, componentManager)); } } else { sendEvent(event, descriptor, componentManager); } }
java
private void notifyComponentEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) { if (this.shouldStack) { synchronized (this) { this.events.push(new ComponentEventEntry(event, descriptor, componentManager)); } } else { sendEvent(event, descriptor, componentManager); } }
[ "private", "void", "notifyComponentEvent", "(", "Event", "event", ",", "ComponentDescriptor", "<", "?", ">", "descriptor", ",", "ComponentManager", "componentManager", ")", "{", "if", "(", "this", ".", "shouldStack", ")", "{", "synchronized", "(", "this", ")", ...
Send or stack the provided event dependening on the configuration. @param event the event send by the component manager @param descriptor the event related component descriptor. @param componentManager the event related component manager instance. @see #shouldStack(boolean)
[ "Send", "or", "stack", "the", "provided", "event", "dependening", "on", "the", "configuration", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java#L120-L130
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java
SDBaseOps.matchConditionCount
public SDVariable matchConditionCount(SDVariable in, Condition condition) { return matchConditionCount(null, in, condition); }
java
public SDVariable matchConditionCount(SDVariable in, Condition condition) { return matchConditionCount(null, in, condition); }
[ "public", "SDVariable", "matchConditionCount", "(", "SDVariable", "in", ",", "Condition", "condition", ")", "{", "return", "matchConditionCount", "(", "null", ",", "in", ",", "condition", ")", ";", "}" ]
Returns a count of the number of elements that satisfy the condition @param in Input @param condition Condition @return Number of elements that the condition is satisfied for
[ "Returns", "a", "count", "of", "the", "number", "of", "elements", "that", "satisfy", "the", "condition" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L997-L999
ontop/ontop
client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/IncrementalResultSetTableModel.java
IncrementalResultSetTableModel.getValueAt
@Override public Object getValueAt(int row, int column) { try { if(row + 2 >= numrows && !isAfterLast){ fetchMoreResults(); } } catch (Exception e) { e.printStackTrace(); } Vector<String> aux = results.get(row); return aux.get(column); }
java
@Override public Object getValueAt(int row, int column) { try { if(row + 2 >= numrows && !isAfterLast){ fetchMoreResults(); } } catch (Exception e) { e.printStackTrace(); } Vector<String> aux = results.get(row); return aux.get(column); }
[ "@", "Override", "public", "Object", "getValueAt", "(", "int", "row", ",", "int", "column", ")", "{", "try", "{", "if", "(", "row", "+", "2", ">=", "numrows", "&&", "!", "isAfterLast", ")", "{", "fetchMoreResults", "(", ")", ";", "}", "}", "catch", ...
This is the key method of TableModel: it returns the value at each cell of the table. We use strings in this case. If anything goes wrong, we return the exception as a string, so it will be displayed in the table. Note that SQL row and column numbers start at 1, but TableModel column numbers start at 0.
[ "This", "is", "the", "key", "method", "of", "TableModel", ":", "it", "returns", "the", "value", "at", "each", "cell", "of", "the", "table", ".", "We", "use", "strings", "in", "this", "case", ".", "If", "anything", "goes", "wrong", "we", "return", "the"...
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/IncrementalResultSetTableModel.java#L145-L158
jenkinsci/artifactory-plugin
src/main/java/org/jfrog/hudson/util/ExtractorUtils.java
ExtractorUtils.getVcsRevision
public static String getVcsRevision(Map<String, String> env) { String revision = env.get("SVN_REVISION"); if (StringUtils.isBlank(revision)) { revision = env.get(GIT_COMMIT); } if (StringUtils.isBlank(revision)) { revision = env.get("P4_CHANGELIST"); } return revision; }
java
public static String getVcsRevision(Map<String, String> env) { String revision = env.get("SVN_REVISION"); if (StringUtils.isBlank(revision)) { revision = env.get(GIT_COMMIT); } if (StringUtils.isBlank(revision)) { revision = env.get("P4_CHANGELIST"); } return revision; }
[ "public", "static", "String", "getVcsRevision", "(", "Map", "<", "String", ",", "String", ">", "env", ")", "{", "String", "revision", "=", "env", ".", "get", "(", "\"SVN_REVISION\"", ")", ";", "if", "(", "StringUtils", ".", "isBlank", "(", "revision", ")...
Get the VCS revision from the Jenkins build environment. The search will one of "SVN_REVISION", "GIT_COMMIT", "P4_CHANGELIST" in the environment. @param env Th Jenkins build environment. @return The vcs revision for supported VCS
[ "Get", "the", "VCS", "revision", "from", "the", "Jenkins", "build", "environment", ".", "The", "search", "will", "one", "of", "SVN_REVISION", "GIT_COMMIT", "P4_CHANGELIST", "in", "the", "environment", "." ]
train
https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L81-L90
openwms/org.openwms
org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java
AbstractWebController.buildNOKResponseWithKey
protected <T extends AbstractBase> ResponseEntity<Response<T>> buildNOKResponseWithKey(HttpStatus code, String msg, String msgKey, T... params) { return buildResponse(code, msg, msgKey, params); }
java
protected <T extends AbstractBase> ResponseEntity<Response<T>> buildNOKResponseWithKey(HttpStatus code, String msg, String msgKey, T... params) { return buildResponse(code, msg, msgKey, params); }
[ "protected", "<", "T", "extends", "AbstractBase", ">", "ResponseEntity", "<", "Response", "<", "T", ">", ">", "buildNOKResponseWithKey", "(", "HttpStatus", "code", ",", "String", "msg", ",", "String", "msgKey", ",", "T", "...", "params", ")", "{", "return", ...
Build a response object that signals a not-okay response with a given status {@code code}. @param <T> Some type extending the AbstractBase entity @param code The status code to set as response code @param msg The error message passed to the caller @param msgKey The error message key passed to the caller @param params A set of Serializable objects that are passed to the caller @return A ResponseEntity with status {@code code}
[ "Build", "a", "response", "object", "that", "signals", "a", "not", "-", "okay", "response", "with", "a", "given", "status", "{", "@code", "code", "}", "." ]
train
https://github.com/openwms/org.openwms/blob/b24a95c5d09a7ec3c723d7e107d1cb0039d06a7e/org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java#L187-L189
segmentio/analytics-android
analytics/src/main/java/com/segment/analytics/ValueMap.java
ValueMap.getChar
public char getChar(String key, char defaultValue) { Object value = get(key); if (value instanceof Character) { return (Character) value; } if (value != null && value instanceof String) { if (((String) value).length() == 1) { return ((String) value).charAt(0); } } return defaultValue; }
java
public char getChar(String key, char defaultValue) { Object value = get(key); if (value instanceof Character) { return (Character) value; } if (value != null && value instanceof String) { if (((String) value).length() == 1) { return ((String) value).charAt(0); } } return defaultValue; }
[ "public", "char", "getChar", "(", "String", "key", ",", "char", "defaultValue", ")", "{", "Object", "value", "=", "get", "(", "key", ")", ";", "if", "(", "value", "instanceof", "Character", ")", "{", "return", "(", "Character", ")", "value", ";", "}", ...
Returns the value mapped by {@code key} if it exists and is a char or can be coerced to a char. Returns {@code defaultValue} otherwise.
[ "Returns", "the", "value", "mapped", "by", "{" ]
train
https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L244-L255
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java
StyleUtil.setFontStyle
public static Font setFontStyle(Font font, short color, short fontSize, String fontName) { if(color > 0) { font.setColor(color); } if(fontSize > 0) { font.setFontHeightInPoints(fontSize); } if(StrUtil.isNotBlank(fontName)) { font.setFontName(fontName); } return font; }
java
public static Font setFontStyle(Font font, short color, short fontSize, String fontName) { if(color > 0) { font.setColor(color); } if(fontSize > 0) { font.setFontHeightInPoints(fontSize); } if(StrUtil.isNotBlank(fontName)) { font.setFontName(fontName); } return font; }
[ "public", "static", "Font", "setFontStyle", "(", "Font", "font", ",", "short", "color", ",", "short", "fontSize", ",", "String", "fontName", ")", "{", "if", "(", "color", ">", "0", ")", "{", "font", ".", "setColor", "(", "color", ")", ";", "}", "if",...
设置字体样式 @param font 字体{@link Font} @param color 字体颜色 @param fontSize 字体大小 @param fontName 字体名称,可以为null使用默认字体 @return {@link Font}
[ "设置字体样式" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L134-L145
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/PayloadTemplateMessageBuilder.java
PayloadTemplateMessageBuilder.buildMessagePayload
public Object buildMessagePayload(TestContext context, String messageType) { this.getMessageInterceptors().add(gzipMessageConstructionInterceptor); this.getMessageInterceptors().add(binaryMessageConstructionInterceptor); return getPayloadContent(context, messageType); }
java
public Object buildMessagePayload(TestContext context, String messageType) { this.getMessageInterceptors().add(gzipMessageConstructionInterceptor); this.getMessageInterceptors().add(binaryMessageConstructionInterceptor); return getPayloadContent(context, messageType); }
[ "public", "Object", "buildMessagePayload", "(", "TestContext", "context", ",", "String", "messageType", ")", "{", "this", ".", "getMessageInterceptors", "(", ")", ".", "add", "(", "gzipMessageConstructionInterceptor", ")", ";", "this", ".", "getMessageInterceptors", ...
Build the control message from payload file resource or String data.
[ "Build", "the", "control", "message", "from", "payload", "file", "resource", "or", "String", "data", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/builder/PayloadTemplateMessageBuilder.java#L55-L59
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.getAnnotationWithRole
public @CheckForNull <A extends BugAnnotation> A getAnnotationWithRole(Class<A> c, String role) { for(BugAnnotation a : annotationList) { if (c.isInstance(a) && Objects.equals(role, a.getDescription())) { return c.cast(a); } } return null; }
java
public @CheckForNull <A extends BugAnnotation> A getAnnotationWithRole(Class<A> c, String role) { for(BugAnnotation a : annotationList) { if (c.isInstance(a) && Objects.equals(role, a.getDescription())) { return c.cast(a); } } return null; }
[ "public", "@", "CheckForNull", "<", "A", "extends", "BugAnnotation", ">", "A", "getAnnotationWithRole", "(", "Class", "<", "A", ">", "c", ",", "String", "role", ")", "{", "for", "(", "BugAnnotation", "a", ":", "annotationList", ")", "{", "if", "(", "c", ...
Get the first bug annotation with the specified class and role; return null if no such annotation exists;
[ "Get", "the", "first", "bug", "annotation", "with", "the", "specified", "class", "and", "role", ";", "return", "null", "if", "no", "such", "annotation", "exists", ";" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L596-L603
openwms/org.openwms
org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java
AbstractWebController.getLocationForCreatedResource
protected String getLocationForCreatedResource(HttpServletRequest req, String objId) { StringBuffer url = req.getRequestURL(); UriTemplate template = new UriTemplate(url.append("/{objId}/").toString()); return template.expand(objId).toASCIIString(); }
java
protected String getLocationForCreatedResource(HttpServletRequest req, String objId) { StringBuffer url = req.getRequestURL(); UriTemplate template = new UriTemplate(url.append("/{objId}/").toString()); return template.expand(objId).toASCIIString(); }
[ "protected", "String", "getLocationForCreatedResource", "(", "HttpServletRequest", "req", ",", "String", "objId", ")", "{", "StringBuffer", "url", "=", "req", ".", "getRequestURL", "(", ")", ";", "UriTemplate", "template", "=", "new", "UriTemplate", "(", "url", ...
Append the ID of the object that was created to the original request URL and return it. @param req The HttpServletRequest object @param objId The ID to append @return The complete appended URL
[ "Append", "the", "ID", "of", "the", "object", "that", "was", "created", "to", "the", "original", "request", "URL", "and", "return", "it", "." ]
train
https://github.com/openwms/org.openwms/blob/b24a95c5d09a7ec3c723d7e107d1cb0039d06a7e/org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java#L211-L215
ehcache/ehcache3
impl/src/main/java/org/ehcache/impl/config/executor/PooledExecutionServiceConfiguration.java
PooledExecutionServiceConfiguration.addDefaultPool
public void addDefaultPool(String alias, int minSize, int maxSize) { if (alias == null) { throw new NullPointerException("Pool alias cannot be null"); } if (defaultAlias == null) { addPool(alias, minSize, maxSize); defaultAlias = alias; } else { throw new IllegalArgumentException("'" + defaultAlias + "' is already configured as the default pool"); } }
java
public void addDefaultPool(String alias, int minSize, int maxSize) { if (alias == null) { throw new NullPointerException("Pool alias cannot be null"); } if (defaultAlias == null) { addPool(alias, minSize, maxSize); defaultAlias = alias; } else { throw new IllegalArgumentException("'" + defaultAlias + "' is already configured as the default pool"); } }
[ "public", "void", "addDefaultPool", "(", "String", "alias", ",", "int", "minSize", ",", "int", "maxSize", ")", "{", "if", "(", "alias", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Pool alias cannot be null\"", ")", ";", "}", "if",...
Adds a new default pool with the provided minimum and maximum. <p> The default pool will be used by any service requiring threads but not specifying a pool alias. It is not mandatory to have a default pool. But without one <i>ALL</i> services have to specify a pool alias. @param alias the pool alias @param minSize the minimum size @param maxSize the maximum size @throws NullPointerException if alias is null @throws IllegalArgumentException if another default was configured already or if another pool with the same alias was configured already
[ "Adds", "a", "new", "default", "pool", "with", "the", "provided", "minimum", "and", "maximum", ".", "<p", ">", "The", "default", "pool", "will", "be", "used", "by", "any", "service", "requiring", "threads", "but", "not", "specifying", "a", "pool", "alias",...
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/config/executor/PooledExecutionServiceConfiguration.java#L60-L70
facebookarchive/hadoop-20
src/core/org/apache/hadoop/jmx/JMXJsonServlet.java
JMXJsonServlet.renderMBeans
private int renderMBeans(JsonGenerator jg, String[] mBeanNames) throws IOException, MalformedObjectNameException { jg.writeStartObject(); Set<ObjectName> nameQueries, queriedObjects; nameQueries = new HashSet<ObjectName>(); queriedObjects = new HashSet<ObjectName>(); // if no mbean names provided, add one null entry to query everything if (mBeanNames == null) { nameQueries.add(null); } else { for (String mBeanName : mBeanNames) { if (mBeanName != null) { nameQueries.add(new ObjectName(mBeanName)); } } } // perform name queries for (ObjectName nameQuery : nameQueries) { queriedObjects.addAll(mBeanServer.queryNames(nameQuery, null)); } // render each query result for (ObjectName objectName : queriedObjects) { renderMBean(jg, objectName); } jg.writeEndObject(); return HttpServletResponse.SC_OK; }
java
private int renderMBeans(JsonGenerator jg, String[] mBeanNames) throws IOException, MalformedObjectNameException { jg.writeStartObject(); Set<ObjectName> nameQueries, queriedObjects; nameQueries = new HashSet<ObjectName>(); queriedObjects = new HashSet<ObjectName>(); // if no mbean names provided, add one null entry to query everything if (mBeanNames == null) { nameQueries.add(null); } else { for (String mBeanName : mBeanNames) { if (mBeanName != null) { nameQueries.add(new ObjectName(mBeanName)); } } } // perform name queries for (ObjectName nameQuery : nameQueries) { queriedObjects.addAll(mBeanServer.queryNames(nameQuery, null)); } // render each query result for (ObjectName objectName : queriedObjects) { renderMBean(jg, objectName); } jg.writeEndObject(); return HttpServletResponse.SC_OK; }
[ "private", "int", "renderMBeans", "(", "JsonGenerator", "jg", ",", "String", "[", "]", "mBeanNames", ")", "throws", "IOException", ",", "MalformedObjectNameException", "{", "jg", ".", "writeStartObject", "(", ")", ";", "Set", "<", "ObjectName", ">", "nameQueries...
Renders MBean attributes to jg. The queries parameter allows selection of a subset of mbeans. @param jg JsonGenerator that will be written to @param mBeanNames Optional list of mbean names to render. If null, every mbean will be returned. @return int Returns the appropriate HTTP status code.
[ "Renders", "MBean", "attributes", "to", "jg", ".", "The", "queries", "parameter", "allows", "selection", "of", "a", "subset", "of", "mbeans", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/jmx/JMXJsonServlet.java#L195-L226
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java
CommonOps_DDF6.add
public static void add( DMatrix6 a , DMatrix6 b , DMatrix6 c ) { c.a1 = a.a1 + b.a1; c.a2 = a.a2 + b.a2; c.a3 = a.a3 + b.a3; c.a4 = a.a4 + b.a4; c.a5 = a.a5 + b.a5; c.a6 = a.a6 + b.a6; }
java
public static void add( DMatrix6 a , DMatrix6 b , DMatrix6 c ) { c.a1 = a.a1 + b.a1; c.a2 = a.a2 + b.a2; c.a3 = a.a3 + b.a3; c.a4 = a.a4 + b.a4; c.a5 = a.a5 + b.a5; c.a6 = a.a6 + b.a6; }
[ "public", "static", "void", "add", "(", "DMatrix6", "a", ",", "DMatrix6", "b", ",", "DMatrix6", "c", ")", "{", "c", ".", "a1", "=", "a", ".", "a1", "+", "b", ".", "a1", ";", "c", ".", "a2", "=", "a", ".", "a2", "+", "b", ".", "a2", ";", "...
<p>Performs the following operation:<br> <br> c = a + b <br> c<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br> </p> <p> Vector C can be the same instance as Vector A and/or B. </p> @param a A Vector. Not modified. @param b A Vector. Not modified. @param c A Vector where the results are stored. Modified.
[ "<p", ">", "Performs", "the", "following", "operation", ":", "<br", ">", "<br", ">", "c", "=", "a", "+", "b", "<br", ">", "c<sub", ">", "i<", "/", "sub", ">", "=", "a<sub", ">", "i<", "/", "sub", ">", "+", "b<sub", ">", "i<", "/", "sub", ">",...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java#L101-L108
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java
PerspectiveOps.pinholeToMatrix
public static DMatrix3x3 pinholeToMatrix(CameraPinhole param , DMatrix3x3 K ) { return ImplPerspectiveOps_F64.pinholeToMatrix(param, K); }
java
public static DMatrix3x3 pinholeToMatrix(CameraPinhole param , DMatrix3x3 K ) { return ImplPerspectiveOps_F64.pinholeToMatrix(param, K); }
[ "public", "static", "DMatrix3x3", "pinholeToMatrix", "(", "CameraPinhole", "param", ",", "DMatrix3x3", "K", ")", "{", "return", "ImplPerspectiveOps_F64", ".", "pinholeToMatrix", "(", "param", ",", "K", ")", ";", "}" ]
Given the intrinsic parameters create a calibration matrix @param param Intrinsic parameters structure that is to be converted into a matrix @param K Storage for calibration matrix, must be 3x3. If null then a new matrix is declared @return Calibration matrix 3x3
[ "Given", "the", "intrinsic", "parameters", "create", "a", "calibration", "matrix" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L283-L286
google/closure-templates
java/src/com/google/template/soy/shared/internal/AbstractGenerateSoyEscapingDirectiveCode.java
AbstractGenerateSoyEscapingDirectiveCode.escapeRegexpRangeOnto
private static void escapeRegexpRangeOnto(char start, char end, StringBuilder out) { if (!isPrintable(start)) { out.append(String.format(start >= 0x100 ? "\\u%04x" : "\\x%02x", (int) start)); } else { out.append(EscapingConventions.EscapeJsRegex.INSTANCE.escape(String.valueOf(start))); } if (start != end) { // If end - start is 1, then don't bother to put a dash. [a-b] is the same as [ab]. if (end - start > 1) { out.append('-'); } if (!isPrintable(end)) { out.append(String.format(end >= 0x100 ? "\\u%04x" : "\\x%02x", (int) end)); } else { out.append(EscapingConventions.EscapeJsRegex.INSTANCE.escape(String.valueOf(end))); } } }
java
private static void escapeRegexpRangeOnto(char start, char end, StringBuilder out) { if (!isPrintable(start)) { out.append(String.format(start >= 0x100 ? "\\u%04x" : "\\x%02x", (int) start)); } else { out.append(EscapingConventions.EscapeJsRegex.INSTANCE.escape(String.valueOf(start))); } if (start != end) { // If end - start is 1, then don't bother to put a dash. [a-b] is the same as [ab]. if (end - start > 1) { out.append('-'); } if (!isPrintable(end)) { out.append(String.format(end >= 0x100 ? "\\u%04x" : "\\x%02x", (int) end)); } else { out.append(EscapingConventions.EscapeJsRegex.INSTANCE.escape(String.valueOf(end))); } } }
[ "private", "static", "void", "escapeRegexpRangeOnto", "(", "char", "start", ",", "char", "end", ",", "StringBuilder", "out", ")", "{", "if", "(", "!", "isPrintable", "(", "start", ")", ")", "{", "out", ".", "append", "(", "String", ".", "format", "(", ...
Appends a RegExp character range set onto the given buffer. E.g. given the letters 'a' and 'z' as start and end, appends {@code a-z}. These are meant to be concatenated to create character sets like {@code /[a-zA-Z0-9]/}. This method will omit unnecessary ends or range separators.
[ "Appends", "a", "RegExp", "character", "range", "set", "onto", "the", "given", "buffer", ".", "E", ".", "g", ".", "given", "the", "letters", "a", "and", "z", "as", "start", "and", "end", "appends", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/internal/AbstractGenerateSoyEscapingDirectiveCode.java#L476-L493
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/filesystem/MetricsFileSystemInstrumentation.java
MetricsFileSystemInstrumentation.setPermission
public void setPermission (Path f, final FsPermission permission) throws IOException { try (Closeable context = new TimerContextWithLog(this.setPermissionTimer.time(), "setPermission", f, permission)) { super.setPermission(f, permission); } }
java
public void setPermission (Path f, final FsPermission permission) throws IOException { try (Closeable context = new TimerContextWithLog(this.setPermissionTimer.time(), "setPermission", f, permission)) { super.setPermission(f, permission); } }
[ "public", "void", "setPermission", "(", "Path", "f", ",", "final", "FsPermission", "permission", ")", "throws", "IOException", "{", "try", "(", "Closeable", "context", "=", "new", "TimerContextWithLog", "(", "this", ".", "setPermissionTimer", ".", "time", "(", ...
Add timer metrics to {@link DistributedFileSystem#setPermission(Path, FsPermission)}
[ "Add", "timer", "metrics", "to", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/filesystem/MetricsFileSystemInstrumentation.java#L307-L311
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/wallet/RedeemData.java
RedeemData.of
public static RedeemData of(ECKey key, Script redeemScript) { checkArgument(ScriptPattern.isP2PKH(redeemScript) || ScriptPattern.isP2WPKH(redeemScript) || ScriptPattern.isP2PK(redeemScript)); return key != null ? new RedeemData(Collections.singletonList(key), redeemScript) : null; }
java
public static RedeemData of(ECKey key, Script redeemScript) { checkArgument(ScriptPattern.isP2PKH(redeemScript) || ScriptPattern.isP2WPKH(redeemScript) || ScriptPattern.isP2PK(redeemScript)); return key != null ? new RedeemData(Collections.singletonList(key), redeemScript) : null; }
[ "public", "static", "RedeemData", "of", "(", "ECKey", "key", ",", "Script", "redeemScript", ")", "{", "checkArgument", "(", "ScriptPattern", ".", "isP2PKH", "(", "redeemScript", ")", "||", "ScriptPattern", ".", "isP2WPKH", "(", "redeemScript", ")", "||", "Scri...
Creates RedeemData for P2PKH, P2WPKH or P2PK input. Provided key is a single private key needed to spend such inputs.
[ "Creates", "RedeemData", "for", "P2PKH", "P2WPKH", "or", "P2PK", "input", ".", "Provided", "key", "is", "a", "single", "private", "key", "needed", "to", "spend", "such", "inputs", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/RedeemData.java#L59-L63
sirensolutions/siren-join
src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java
FieldDataTermsQuery.newBytes
public static FieldDataTermsQuery newBytes(final byte[] encodedTerms, final IndexFieldData fieldData, final long cacheKey) { return new BytesFieldDataTermsQuery(encodedTerms, fieldData, cacheKey); }
java
public static FieldDataTermsQuery newBytes(final byte[] encodedTerms, final IndexFieldData fieldData, final long cacheKey) { return new BytesFieldDataTermsQuery(encodedTerms, fieldData, cacheKey); }
[ "public", "static", "FieldDataTermsQuery", "newBytes", "(", "final", "byte", "[", "]", "encodedTerms", ",", "final", "IndexFieldData", "fieldData", ",", "final", "long", "cacheKey", ")", "{", "return", "new", "BytesFieldDataTermsQuery", "(", "encodedTerms", ",", "...
Get a {@link FieldDataTermsQuery} that filters on non-numeric terms found in a hppc {@link LongHashSet} of {@link BytesRef}. @param encodedTerms An encoded set of terms. @param fieldData The fielddata for the field. @param cacheKey A unique key to use for caching this query. @return the query.
[ "Get", "a", "{", "@link", "FieldDataTermsQuery", "}", "that", "filters", "on", "non", "-", "numeric", "terms", "found", "in", "a", "hppc", "{", "@link", "LongHashSet", "}", "of", "{", "@link", "BytesRef", "}", "." ]
train
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java#L94-L96
authlete/authlete-java-common
src/main/java/com/authlete/common/util/TypedProperties.java
TypedProperties.setBoolean
public void setBoolean(Enum<?> key, boolean value) { if (key == null) { return; } setBoolean(key.name(), value); }
java
public void setBoolean(Enum<?> key, boolean value) { if (key == null) { return; } setBoolean(key.name(), value); }
[ "public", "void", "setBoolean", "(", "Enum", "<", "?", ">", "key", ",", "boolean", "value", ")", "{", "if", "(", "key", "==", "null", ")", "{", "return", ";", "}", "setBoolean", "(", "key", ".", "name", "(", ")", ",", "value", ")", ";", "}" ]
Equivalent to {@link #setBoolean(String, boolean) setBoolean}{@code (key.name(), value)}. If {@code key} is null, nothing is done.
[ "Equivalent", "to", "{" ]
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L597-L605
Appendium/flatpack
flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java
ParserUtils.getDelimiterOffset
public static int getDelimiterOffset(final String line, final int start, final char delimiter) { int idx = line.indexOf(delimiter, start); if (idx >= 0) { idx -= start - 1; } return idx; }
java
public static int getDelimiterOffset(final String line, final int start, final char delimiter) { int idx = line.indexOf(delimiter, start); if (idx >= 0) { idx -= start - 1; } return idx; }
[ "public", "static", "int", "getDelimiterOffset", "(", "final", "String", "line", ",", "final", "int", "start", ",", "final", "char", "delimiter", ")", "{", "int", "idx", "=", "line", ".", "indexOf", "(", "delimiter", ",", "start", ")", ";", "if", "(", ...
reads from the specified point in the line and returns how many chars to the specified delimiter @param line @param start @param delimiter @return int
[ "reads", "from", "the", "specified", "point", "in", "the", "line", "and", "returns", "how", "many", "chars", "to", "the", "specified", "delimiter" ]
train
https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L301-L307
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java
HystrixScriptModuleExecutor.executeModules
public List<V> executeModules(List<String> moduleIds, ScriptModuleExecutable<V> executable, ScriptModuleLoader moduleLoader) { Objects.requireNonNull(moduleIds, "moduleIds"); Objects.requireNonNull(executable, "executable"); Objects.requireNonNull(moduleLoader, "moduleLoader"); List<ScriptModule> modules = new ArrayList<ScriptModule>(moduleIds.size()); for (String moduleId : moduleIds) { ScriptModule module = moduleLoader.getScriptModule(ModuleId.create(moduleId)); if (module != null) { modules.add(module); } } return executeModules(modules, executable); }
java
public List<V> executeModules(List<String> moduleIds, ScriptModuleExecutable<V> executable, ScriptModuleLoader moduleLoader) { Objects.requireNonNull(moduleIds, "moduleIds"); Objects.requireNonNull(executable, "executable"); Objects.requireNonNull(moduleLoader, "moduleLoader"); List<ScriptModule> modules = new ArrayList<ScriptModule>(moduleIds.size()); for (String moduleId : moduleIds) { ScriptModule module = moduleLoader.getScriptModule(ModuleId.create(moduleId)); if (module != null) { modules.add(module); } } return executeModules(modules, executable); }
[ "public", "List", "<", "V", ">", "executeModules", "(", "List", "<", "String", ">", "moduleIds", ",", "ScriptModuleExecutable", "<", "V", ">", "executable", ",", "ScriptModuleLoader", "moduleLoader", ")", "{", "Objects", ".", "requireNonNull", "(", "moduleIds", ...
Execute a collection of ScriptModules identified by moduleId. @param moduleIds moduleIds for modules to execute @param executable execution logic to be performed for each module. @param moduleLoader loader which manages the modules. @return list of the outputs from the executable.
[ "Execute", "a", "collection", "of", "ScriptModules", "identified", "by", "moduleId", "." ]
train
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java#L82-L95
OpenLiberty/open-liberty
dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java
_ValueReferenceResolver.getValue
@Override public Object getValue(final ELContext context, final Object base, final Object property) { lastObject = new _ValueReferenceWrapper(base, property); return resolver.getValue(context, base, property); }
java
@Override public Object getValue(final ELContext context, final Object base, final Object property) { lastObject = new _ValueReferenceWrapper(base, property); return resolver.getValue(context, base, property); }
[ "@", "Override", "public", "Object", "getValue", "(", "final", "ELContext", "context", ",", "final", "Object", "base", ",", "final", "Object", "property", ")", "{", "lastObject", "=", "new", "_ValueReferenceWrapper", "(", "base", ",", "property", ")", ";", "...
This method is the only one that matters. It keeps track of the objects in the EL expression. It creates a new ValueReferenceWrapper and assigns it to lastObject. @param context The ELContext. @param base The base object, may be null. @param property The property, may be null. @return The resolved value
[ "This", "method", "is", "the", "only", "one", "that", "matters", ".", "It", "keeps", "track", "of", "the", "objects", "in", "the", "EL", "expression", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java#L619-L624
apiman/apiman
gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java
ESRegistry.getApiId
protected String getApiId(String orgId, String apiId, String version) { return ESUtils.escape(orgId + ":" + apiId + ":" + version); //$NON-NLS-1$ //$NON-NLS-2$ }
java
protected String getApiId(String orgId, String apiId, String version) { return ESUtils.escape(orgId + ":" + apiId + ":" + version); //$NON-NLS-1$ //$NON-NLS-2$ }
[ "protected", "String", "getApiId", "(", "String", "orgId", ",", "String", "apiId", ",", "String", "version", ")", "{", "return", "ESUtils", ".", "escape", "(", "orgId", "+", "\":\"", "+", "apiId", "+", "\":\"", "+", "version", ")", ";", "//$NON-NLS-1$ //$N...
Generates a valid document ID for a api, used to index the api in ES. @param orgId @param apiId @param version @return a api id
[ "Generates", "a", "valid", "document", "ID", "for", "a", "api", "used", "to", "index", "the", "api", "in", "ES", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L628-L630
apache/groovy
subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
NioGroovyMethods.newWriter
public static BufferedWriter newWriter(Path self, String charset, boolean append, boolean writeBom) throws IOException { boolean shouldWriteBom = writeBom && !self.toFile().exists(); if (append) { BufferedWriter writer = Files.newBufferedWriter(self, Charset.forName(charset), CREATE, APPEND); if (shouldWriteBom) { IOGroovyMethods.writeUTF16BomIfRequired(writer, charset); } return writer; } else { OutputStream out = Files.newOutputStream(self); if (shouldWriteBom) { IOGroovyMethods.writeUTF16BomIfRequired(out, charset); } return new BufferedWriter(new OutputStreamWriter(out, Charset.forName(charset))); } }
java
public static BufferedWriter newWriter(Path self, String charset, boolean append, boolean writeBom) throws IOException { boolean shouldWriteBom = writeBom && !self.toFile().exists(); if (append) { BufferedWriter writer = Files.newBufferedWriter(self, Charset.forName(charset), CREATE, APPEND); if (shouldWriteBom) { IOGroovyMethods.writeUTF16BomIfRequired(writer, charset); } return writer; } else { OutputStream out = Files.newOutputStream(self); if (shouldWriteBom) { IOGroovyMethods.writeUTF16BomIfRequired(out, charset); } return new BufferedWriter(new OutputStreamWriter(out, Charset.forName(charset))); } }
[ "public", "static", "BufferedWriter", "newWriter", "(", "Path", "self", ",", "String", "charset", ",", "boolean", "append", ",", "boolean", "writeBom", ")", "throws", "IOException", "{", "boolean", "shouldWriteBom", "=", "writeBom", "&&", "!", "self", ".", "to...
Helper method to create a buffered writer for a file. If the given charset is "UTF-16BE" or "UTF-16LE" (or an equivalent alias), the requisite byte order mark is written to the stream before the writer is returned. @param self a Path @param charset the name of the encoding used to write in this file @param append true if in append mode @param writeBom whether to write a BOM @return a BufferedWriter @throws java.io.IOException if an IOException occurs. @since 2.5.0
[ "Helper", "method", "to", "create", "a", "buffered", "writer", "for", "a", "file", ".", "If", "the", "given", "charset", "is", "UTF", "-", "16BE", "or", "UTF", "-", "16LE", "(", "or", "an", "equivalent", "alias", ")", "the", "requisite", "byte", "order...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1591-L1606
line/armeria
core/src/main/java/com/linecorp/armeria/common/util/AbstractOptions.java
AbstractOptions.getOrElse0
protected final <O extends AbstractOption<V>, V> V getOrElse0(O option, V defaultValue) { return get0(option).orElse(defaultValue); }
java
protected final <O extends AbstractOption<V>, V> V getOrElse0(O option, V defaultValue) { return get0(option).orElse(defaultValue); }
[ "protected", "final", "<", "O", "extends", "AbstractOption", "<", "V", ">", ",", "V", ">", "V", "getOrElse0", "(", "O", "option", ",", "V", "defaultValue", ")", "{", "return", "get0", "(", "option", ")", ".", "orElse", "(", "defaultValue", ")", ";", ...
Returns the value of the specified {@code option}. @param <O> the type of the option @param <V> the type of the value @return the value of the specified {@code option}. {@code defaultValue} if there's no such option.
[ "Returns", "the", "value", "of", "the", "specified", "{", "@code", "option", "}", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/AbstractOptions.java#L153-L155
shrinkwrap/shrinkwrap
impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java
MemoryMapArchiveBase.removeNodeRecursively
private Node removeNodeRecursively(final NodeImpl node, final ArchivePath path) { final NodeImpl parentNode = content.get(path.getParent()); if (parentNode != null) { parentNode.removeChild(node); } // Remove from nested archives if present nestedArchives.remove(path); // Recursively delete children if present if (node.getChildren() != null) { final Set<Node> children = node.getChildren(); // can't remove from collection inside of the iteration final Set<Node> childrenCopy = new HashSet<Node>(children); for (Node child : childrenCopy) { node.removeChild(child); content.remove(child.getPath()); } } return content.remove(path); }
java
private Node removeNodeRecursively(final NodeImpl node, final ArchivePath path) { final NodeImpl parentNode = content.get(path.getParent()); if (parentNode != null) { parentNode.removeChild(node); } // Remove from nested archives if present nestedArchives.remove(path); // Recursively delete children if present if (node.getChildren() != null) { final Set<Node> children = node.getChildren(); // can't remove from collection inside of the iteration final Set<Node> childrenCopy = new HashSet<Node>(children); for (Node child : childrenCopy) { node.removeChild(child); content.remove(child.getPath()); } } return content.remove(path); }
[ "private", "Node", "removeNodeRecursively", "(", "final", "NodeImpl", "node", ",", "final", "ArchivePath", "path", ")", "{", "final", "NodeImpl", "parentNode", "=", "content", ".", "get", "(", "path", ".", "getParent", "(", ")", ")", ";", "if", "(", "paren...
Removes the specified node and its associated children from the contents of this archive. @param node the node to remove recursively @param path the path denoting the specified node @return the removed node itself
[ "Removes", "the", "specified", "node", "and", "its", "associated", "children", "from", "the", "contents", "of", "this", "archive", "." ]
train
https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java#L303-L324
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbwlm_lbvserver_binding.java
lbwlm_lbvserver_binding.count_filtered
public static long count_filtered(nitro_service service, String wlmname, String filter) throws Exception{ lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding(); obj.set_wlmname(wlmname); options option = new options(); option.set_count(true); option.set_filter(filter); lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option); if (response != null) { return response[0].__count; } return 0; }
java
public static long count_filtered(nitro_service service, String wlmname, String filter) throws Exception{ lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding(); obj.set_wlmname(wlmname); options option = new options(); option.set_count(true); option.set_filter(filter); lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option); if (response != null) { return response[0].__count; } return 0; }
[ "public", "static", "long", "count_filtered", "(", "nitro_service", "service", ",", "String", "wlmname", ",", "String", "filter", ")", "throws", "Exception", "{", "lbwlm_lbvserver_binding", "obj", "=", "new", "lbwlm_lbvserver_binding", "(", ")", ";", "obj", ".", ...
Use this API to count the filtered set of lbwlm_lbvserver_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "Use", "this", "API", "to", "count", "the", "filtered", "set", "of", "lbwlm_lbvserver_binding", "resources", ".", "filter", "string", "should", "be", "in", "JSON", "format", ".", "eg", ":", "port", ":", "80", "servicetype", ":", "HTTP", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbwlm_lbvserver_binding.java#L206-L217
MTDdk/jawn
jawn-core/src/main/java/net/javapla/jawn/core/templates/TemplateEngineOrchestratorImpl.java
TemplateEngineOrchestratorImpl.mapEngine
private void mapEngine(Map<String, Provider<? extends TemplateEngine>> map, Provider<? extends TemplateEngine> engine) { for (String type : engine.get().getContentType()) { map.put(type, engine); } }
java
private void mapEngine(Map<String, Provider<? extends TemplateEngine>> map, Provider<? extends TemplateEngine> engine) { for (String type : engine.get().getContentType()) { map.put(type, engine); } }
[ "private", "void", "mapEngine", "(", "Map", "<", "String", ",", "Provider", "<", "?", "extends", "TemplateEngine", ">", ">", "map", ",", "Provider", "<", "?", "extends", "TemplateEngine", ">", "engine", ")", "{", "for", "(", "String", "type", ":", "engin...
Map the engine to all the content types it supports. If any kind of overlap exists, a race condition occurs @param map @param engine
[ "Map", "the", "engine", "to", "all", "the", "content", "types", "it", "supports", ".", "If", "any", "kind", "of", "overlap", "exists", "a", "race", "condition", "occurs" ]
train
https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/templates/TemplateEngineOrchestratorImpl.java#L101-L105
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cache/ConcurrentFullUniqueIndex.java
ConcurrentFullUniqueIndex.forAllInParallel
public void forAllInParallel(final ParallelProcedure procedure) { MithraCpuBoundThreadPool pool = MithraCpuBoundThreadPool.getInstance(); final Object[] set = this.table; ThreadChunkSize threadChunkSize = new ThreadChunkSize(pool.getThreads(), set.length - 2, 1); final ArrayBasedQueue queue =new ArrayBasedQueue(set.length - 2, threadChunkSize.getChunkSize()); int threads = threadChunkSize.getThreads(); procedure.setThreads(threads, this.size() /threads); CpuBoundTask[] tasks = new CpuBoundTask[threads]; for(int i=0;i<threads;i++) { final int thread = i; tasks[i] = new CpuBoundTask() { @Override public void execute() { ArrayBasedQueue.Segment segment = queue.borrow(null); while(segment != null) { for (int i = segment.getStart(); i < segment.getEnd(); i++) { Object e = arrayAt(set, i); if (e != null) { procedure.execute(e, thread); } } segment = queue.borrow(segment); } } }; } new FixedCountTaskFactory(tasks).startAndWorkUntilFinished(); }
java
public void forAllInParallel(final ParallelProcedure procedure) { MithraCpuBoundThreadPool pool = MithraCpuBoundThreadPool.getInstance(); final Object[] set = this.table; ThreadChunkSize threadChunkSize = new ThreadChunkSize(pool.getThreads(), set.length - 2, 1); final ArrayBasedQueue queue =new ArrayBasedQueue(set.length - 2, threadChunkSize.getChunkSize()); int threads = threadChunkSize.getThreads(); procedure.setThreads(threads, this.size() /threads); CpuBoundTask[] tasks = new CpuBoundTask[threads]; for(int i=0;i<threads;i++) { final int thread = i; tasks[i] = new CpuBoundTask() { @Override public void execute() { ArrayBasedQueue.Segment segment = queue.borrow(null); while(segment != null) { for (int i = segment.getStart(); i < segment.getEnd(); i++) { Object e = arrayAt(set, i); if (e != null) { procedure.execute(e, thread); } } segment = queue.borrow(segment); } } }; } new FixedCountTaskFactory(tasks).startAndWorkUntilFinished(); }
[ "public", "void", "forAllInParallel", "(", "final", "ParallelProcedure", "procedure", ")", "{", "MithraCpuBoundThreadPool", "pool", "=", "MithraCpuBoundThreadPool", ".", "getInstance", "(", ")", ";", "final", "Object", "[", "]", "set", "=", "this", ".", "table", ...
does not allow concurrent iteration with additions to the index
[ "does", "not", "allow", "concurrent", "iteration", "with", "additions", "to", "the", "index" ]
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cache/ConcurrentFullUniqueIndex.java#L839-L873
kohsuke/jcifs
src/jcifs/http/NtlmSsp.java
NtlmSsp.doAuthentication
public NtlmPasswordAuthentication doAuthentication( HttpServletRequest req, HttpServletResponse resp, byte[] challenge) throws IOException, ServletException { return authenticate(req, resp, challenge); }
java
public NtlmPasswordAuthentication doAuthentication( HttpServletRequest req, HttpServletResponse resp, byte[] challenge) throws IOException, ServletException { return authenticate(req, resp, challenge); }
[ "public", "NtlmPasswordAuthentication", "doAuthentication", "(", "HttpServletRequest", "req", ",", "HttpServletResponse", "resp", ",", "byte", "[", "]", "challenge", ")", "throws", "IOException", ",", "ServletException", "{", "return", "authenticate", "(", "req", ",",...
Calls the static {@link #authenticate(HttpServletRequest, HttpServletResponse, byte[])} method to perform NTLM authentication for the specified servlet request. @param req The request being serviced. @param resp The response. @param challenge The domain controller challenge. @throws IOException If an IO error occurs. @throws ServletException If an error occurs.
[ "Calls", "the", "static", "{", "@link", "#authenticate", "(", "HttpServletRequest", "HttpServletResponse", "byte", "[]", ")", "}", "method", "to", "perform", "NTLM", "authentication", "for", "the", "specified", "servlet", "request", "." ]
train
https://github.com/kohsuke/jcifs/blob/7751f4e4826c35614d237a70c2582553f95b58de/src/jcifs/http/NtlmSsp.java#L66-L70
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/multipos/AsymmMultiPos.java
AsymmMultiPos.asymms
public E asymms(Integer leftPos, Integer rightPos) { return asymm(leftPos, rightPos).result(); }
java
public E asymms(Integer leftPos, Integer rightPos) { return asymm(leftPos, rightPos).result(); }
[ "public", "E", "asymms", "(", "Integer", "leftPos", ",", "Integer", "rightPos", ")", "{", "return", "asymm", "(", "leftPos", ",", "rightPos", ")", ".", "result", "(", ")", ";", "}" ]
The result with the given left position and right position which left and right tag is asymmetric will be involved in the operation @param leftPos @param rightPos @return
[ "The", "result", "with", "the", "given", "left", "position", "and", "right", "position", "which", "left", "and", "right", "tag", "is", "asymmetric", "will", "be", "involved", "in", "the", "operation" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/multipos/AsymmMultiPos.java#L29-L31
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java
MLEDependencyGrammar.expandDependency
protected void expandDependency(IntDependency dependency, double count) { //if (Test.prunePunc && pruneTW(dependency.arg)) // return; if (dependency.head == null || dependency.arg == null) { return; } if (dependency.arg.word != STOP_WORD_INT) { expandArg(dependency, valenceBin(dependency.distance), count); } expandStop(dependency, distanceBin(dependency.distance), count, true); }
java
protected void expandDependency(IntDependency dependency, double count) { //if (Test.prunePunc && pruneTW(dependency.arg)) // return; if (dependency.head == null || dependency.arg == null) { return; } if (dependency.arg.word != STOP_WORD_INT) { expandArg(dependency, valenceBin(dependency.distance), count); } expandStop(dependency, distanceBin(dependency.distance), count, true); }
[ "protected", "void", "expandDependency", "(", "IntDependency", "dependency", ",", "double", "count", ")", "{", "//if (Test.prunePunc && pruneTW(dependency.arg))\r", "// return;\r", "if", "(", "dependency", ".", "head", "==", "null", "||", "dependency", ".", "arg", "=...
The dependency arg is still in the full tag space. @param dependency An opbserved dependency @param count The weight of the dependency
[ "The", "dependency", "arg", "is", "still", "in", "the", "full", "tag", "space", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java#L394-L405
Impetus/Kundera
src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/index/Neo4JIndexManager.java
Neo4JIndexManager.addNodeIndex
private void addNodeIndex(EntityMetadata entityMetadata, Node node, Index<Node> nodeIndex, MetamodelImpl metaModel) { // MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( // entityMetadata.getPersistenceUnit()); // ID attribute has to be indexed necessarily String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName(); nodeIndex.add(node, idColumnName, node.getProperty(idColumnName)); // Index all other fields, for whom indexing is enabled for (Attribute attribute : metaModel.entity(entityMetadata.getEntityClazz()).getSingularAttributes()) { Field field = (Field) attribute.getJavaMember(); if (!attribute.isCollection() && !attribute.isAssociation() && entityMetadata.getIndexProperties().keySet().contains(field.getName())) { String columnName = ((AbstractAttribute) attribute).getJPAColumnName(); nodeIndex.add(node, columnName, node.getProperty(columnName)); } } }
java
private void addNodeIndex(EntityMetadata entityMetadata, Node node, Index<Node> nodeIndex, MetamodelImpl metaModel) { // MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( // entityMetadata.getPersistenceUnit()); // ID attribute has to be indexed necessarily String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName(); nodeIndex.add(node, idColumnName, node.getProperty(idColumnName)); // Index all other fields, for whom indexing is enabled for (Attribute attribute : metaModel.entity(entityMetadata.getEntityClazz()).getSingularAttributes()) { Field field = (Field) attribute.getJavaMember(); if (!attribute.isCollection() && !attribute.isAssociation() && entityMetadata.getIndexProperties().keySet().contains(field.getName())) { String columnName = ((AbstractAttribute) attribute).getJPAColumnName(); nodeIndex.add(node, columnName, node.getProperty(columnName)); } } }
[ "private", "void", "addNodeIndex", "(", "EntityMetadata", "entityMetadata", ",", "Node", "node", ",", "Index", "<", "Node", ">", "nodeIndex", ",", "MetamodelImpl", "metaModel", ")", "{", "// MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetada...
Adds Node Index for all singular attributes (including ID) of a given entity @param entityMetadata @param node @param metaModel @param nodeIndex
[ "Adds", "Node", "Index", "for", "all", "singular", "attributes", "(", "including", "ID", ")", "of", "a", "given", "entity" ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/index/Neo4JIndexManager.java#L244-L264
jenkinsci/jenkins
core/src/main/java/hudson/model/ViewDescriptor.java
ViewDescriptor.checkDisplayName
@SuppressWarnings("unused") // expose utility check method to subclasses protected FormValidation checkDisplayName(@Nonnull View view, @CheckForNull String value) { if (StringUtils.isBlank(value)) { // no custom name, no need to check return FormValidation.ok(); } for (View v: view.owner.getViews()) { if (v.getViewName().equals(view.getViewName())) { continue; } if (StringUtils.equals(v.getDisplayName(), value)) { return FormValidation.warning(Messages.View_DisplayNameNotUniqueWarning(value)); } } return FormValidation.ok(); }
java
@SuppressWarnings("unused") // expose utility check method to subclasses protected FormValidation checkDisplayName(@Nonnull View view, @CheckForNull String value) { if (StringUtils.isBlank(value)) { // no custom name, no need to check return FormValidation.ok(); } for (View v: view.owner.getViews()) { if (v.getViewName().equals(view.getViewName())) { continue; } if (StringUtils.equals(v.getDisplayName(), value)) { return FormValidation.warning(Messages.View_DisplayNameNotUniqueWarning(value)); } } return FormValidation.ok(); }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// expose utility check method to subclasses", "protected", "FormValidation", "checkDisplayName", "(", "@", "Nonnull", "View", "view", ",", "@", "CheckForNull", "String", "value", ")", "{", "if", "(", "StringUtils", "....
Validation of the display name field. @param view the view to check the new display name of. @param value the proposed new display name. @return the validation result. @since 2.37
[ "Validation", "of", "the", "display", "name", "field", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ViewDescriptor.java#L140-L155
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_instance_GET
public ArrayList<OvhInstance> project_serviceName_instance_GET(String serviceName, String region) throws IOException { String qPath = "/cloud/project/{serviceName}/instance"; StringBuilder sb = path(qPath, serviceName); query(sb, "region", region); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t21); }
java
public ArrayList<OvhInstance> project_serviceName_instance_GET(String serviceName, String region) throws IOException { String qPath = "/cloud/project/{serviceName}/instance"; StringBuilder sb = path(qPath, serviceName); query(sb, "region", region); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t21); }
[ "public", "ArrayList", "<", "OvhInstance", ">", "project_serviceName_instance_GET", "(", "String", "serviceName", ",", "String", "region", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/instance\"", ";", "StringBuilder", "sb", ...
Get instances REST: GET /cloud/project/{serviceName}/instance @param region [required] Instance region @param serviceName [required] Project id
[ "Get", "instances" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1766-L1772
atomix/atomix
protocols/raft/src/main/java/io/atomix/protocols/raft/storage/snapshot/SnapshotStore.java
SnapshotStore.newTemporarySnapshot
public Snapshot newTemporarySnapshot(long index, WallClockTimestamp timestamp) { SnapshotDescriptor descriptor = SnapshotDescriptor.builder() .withIndex(index) .withTimestamp(timestamp.unixTimestamp()) .build(); return newSnapshot(descriptor, StorageLevel.MEMORY); }
java
public Snapshot newTemporarySnapshot(long index, WallClockTimestamp timestamp) { SnapshotDescriptor descriptor = SnapshotDescriptor.builder() .withIndex(index) .withTimestamp(timestamp.unixTimestamp()) .build(); return newSnapshot(descriptor, StorageLevel.MEMORY); }
[ "public", "Snapshot", "newTemporarySnapshot", "(", "long", "index", ",", "WallClockTimestamp", "timestamp", ")", "{", "SnapshotDescriptor", "descriptor", "=", "SnapshotDescriptor", ".", "builder", "(", ")", ".", "withIndex", "(", "index", ")", ".", "withTimestamp", ...
Creates a temporary in-memory snapshot. @param index The snapshot index. @param timestamp The snapshot timestamp. @return The snapshot.
[ "Creates", "a", "temporary", "in", "-", "memory", "snapshot", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/storage/snapshot/SnapshotStore.java#L156-L162
Azure/azure-sdk-for-java
applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesInner.java
ComponentFeatureCapabilitiesInner.getAsync
public Observable<ApplicationInsightsComponentFeatureCapabilitiesInner> getAsync(String resourceGroupName, String resourceName) { return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentFeatureCapabilitiesInner>, ApplicationInsightsComponentFeatureCapabilitiesInner>() { @Override public ApplicationInsightsComponentFeatureCapabilitiesInner call(ServiceResponse<ApplicationInsightsComponentFeatureCapabilitiesInner> response) { return response.body(); } }); }
java
public Observable<ApplicationInsightsComponentFeatureCapabilitiesInner> getAsync(String resourceGroupName, String resourceName) { return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentFeatureCapabilitiesInner>, ApplicationInsightsComponentFeatureCapabilitiesInner>() { @Override public ApplicationInsightsComponentFeatureCapabilitiesInner call(ServiceResponse<ApplicationInsightsComponentFeatureCapabilitiesInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "ApplicationInsightsComponentFeatureCapabilitiesInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "resourceName", ")", "....
Returns feature capabilites of the application insights component. @param resourceGroupName The name of the resource group. @param resourceName The name of the Application Insights component resource. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ApplicationInsightsComponentFeatureCapabilitiesInner object
[ "Returns", "feature", "capabilites", "of", "the", "application", "insights", "component", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentFeatureCapabilitiesInner.java#L95-L102
sarl/sarl
contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java
PyExpressionGenerator._generate
protected XExpression _generate(XReturnExpression returnStatement, IAppendable it, IExtraLanguageGeneratorContext context) { it.append("return "); //$NON-NLS-1$ generate(returnStatement.getExpression(), it, context); return returnStatement; }
java
protected XExpression _generate(XReturnExpression returnStatement, IAppendable it, IExtraLanguageGeneratorContext context) { it.append("return "); //$NON-NLS-1$ generate(returnStatement.getExpression(), it, context); return returnStatement; }
[ "protected", "XExpression", "_generate", "(", "XReturnExpression", "returnStatement", ",", "IAppendable", "it", ",", "IExtraLanguageGeneratorContext", "context", ")", "{", "it", ".", "append", "(", "\"return \"", ")", ";", "//$NON-NLS-1$", "generate", "(", "returnStat...
Generate the given object. @param returnStatement the return statement. @param it the target for the generated content. @param context the context. @return the statement.
[ "Generate", "the", "given", "object", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L812-L816
michaelliao/jsonstream
src/main/java/com/itranswarp/jsonstream/JsonBuilder.java
JsonBuilder.createWriter
public JsonWriter createWriter(OutputStream output) { Writer writer = null; try { writer = new OutputStreamWriter(output, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return new JsonWriter(writer, typeAdapters); }
java
public JsonWriter createWriter(OutputStream output) { Writer writer = null; try { writer = new OutputStreamWriter(output, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return new JsonWriter(writer, typeAdapters); }
[ "public", "JsonWriter", "createWriter", "(", "OutputStream", "output", ")", "{", "Writer", "writer", "=", "null", ";", "try", "{", "writer", "=", "new", "OutputStreamWriter", "(", "output", ",", "\"UTF-8\"", ")", ";", "}", "catch", "(", "UnsupportedEncodingExc...
Create a JsonWriter that write JSON to specified OutputStream. @param output The OutputStream object. @return JsonWriter object.
[ "Create", "a", "JsonWriter", "that", "write", "JSON", "to", "specified", "OutputStream", "." ]
train
https://github.com/michaelliao/jsonstream/blob/50adcff2e1293e655462eef5fc5f1b59277de514/src/main/java/com/itranswarp/jsonstream/JsonBuilder.java#L136-L145
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java
RegisterUtils.getAStoreReg
public static int getAStoreReg(final DismantleBytecode dbc, final int seen) { if (seen == Const.ASTORE) { return dbc.getRegisterOperand(); } if (OpcodeUtils.isAStore(seen)) { return seen - Const.ASTORE_0; } return -1; }
java
public static int getAStoreReg(final DismantleBytecode dbc, final int seen) { if (seen == Const.ASTORE) { return dbc.getRegisterOperand(); } if (OpcodeUtils.isAStore(seen)) { return seen - Const.ASTORE_0; } return -1; }
[ "public", "static", "int", "getAStoreReg", "(", "final", "DismantleBytecode", "dbc", ",", "final", "int", "seen", ")", "{", "if", "(", "seen", "==", "Const", ".", "ASTORE", ")", "{", "return", "dbc", ".", "getRegisterOperand", "(", ")", ";", "}", "if", ...
returns the register used to store a reference @param dbc the dismantle byte code parsing the class @param seen the opcode of the store @return the register stored into
[ "returns", "the", "register", "used", "to", "store", "a", "reference" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java#L49-L58
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/XmlReader.java
XmlReader.readDouble
public double readDouble(double defaultValue, String attribute) { return Double.parseDouble(getValue(String.valueOf(defaultValue), attribute)); }
java
public double readDouble(double defaultValue, String attribute) { return Double.parseDouble(getValue(String.valueOf(defaultValue), attribute)); }
[ "public", "double", "readDouble", "(", "double", "defaultValue", ",", "String", "attribute", ")", "{", "return", "Double", ".", "parseDouble", "(", "getValue", "(", "String", ".", "valueOf", "(", "defaultValue", ")", ",", "attribute", ")", ")", ";", "}" ]
Read a double. @param defaultValue The value returned if attribute not found. @param attribute The double name (must not be <code>null</code>). @return The double value. @throws LionEngineException If invalid argument.
[ "Read", "a", "double", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/XmlReader.java#L285-L288
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/BufferedWriter.java
BufferedWriter.writeOut
protected void writeOut(String str, int offset, int len) throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { // 306998.15 Tr.debug(tc, "writeOut(String) --> " + len); } try { out.write(str, offset, len); out.flush(); // 277717 SVT:Mixed information shown on the Admin Console // WAS.webcontainer } catch (IOException ioe) { // No FFDC -- promote debug to event //com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(ioe, "com.ibm.ws.webcontainer.srt.BufferedWriter.writeOut", "416", this); count = 0; // begin pq54943 if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { // 306998.15 Tr.event(tc, "IOException occurred in writeOut(String) method, observer alerting close.", ioe); } // IOException occurred possibly due to SocketError from early browser // closure...alert observer to close writer obs.alertClose(); // end pq54943 // let the observer know that an exception has occurred... obs.alertException(); throw ioe; } }
java
protected void writeOut(String str, int offset, int len) throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { // 306998.15 Tr.debug(tc, "writeOut(String) --> " + len); } try { out.write(str, offset, len); out.flush(); // 277717 SVT:Mixed information shown on the Admin Console // WAS.webcontainer } catch (IOException ioe) { // No FFDC -- promote debug to event //com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(ioe, "com.ibm.ws.webcontainer.srt.BufferedWriter.writeOut", "416", this); count = 0; // begin pq54943 if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { // 306998.15 Tr.event(tc, "IOException occurred in writeOut(String) method, observer alerting close.", ioe); } // IOException occurred possibly due to SocketError from early browser // closure...alert observer to close writer obs.alertClose(); // end pq54943 // let the observer know that an exception has occurred... obs.alertException(); throw ioe; } }
[ "protected", "void", "writeOut", "(", "String", "str", ",", "int", "offset", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "...
/* Writes to the underlying stream Any changes to this method should also be made to the writeOut(char[], int, int) method
[ "/", "*", "Writes", "to", "the", "underlying", "stream" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/BufferedWriter.java#L646-L679
wisdom-framework/wisdom
core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java
JacksonSingleton.toJsonP
public String toJsonP(final String callback, final Object data) { synchronized (lock) { try { return callback + "(" + stringify((JsonNode) mapper.valueToTree(data)) + ");"; } catch (Exception e) { throw new RuntimeException(e); } } }
java
public String toJsonP(final String callback, final Object data) { synchronized (lock) { try { return callback + "(" + stringify((JsonNode) mapper.valueToTree(data)) + ");"; } catch (Exception e) { throw new RuntimeException(e); } } }
[ "public", "String", "toJsonP", "(", "final", "String", "callback", ",", "final", "Object", "data", ")", "{", "synchronized", "(", "lock", ")", "{", "try", "{", "return", "callback", "+", "\"(\"", "+", "stringify", "(", "(", "JsonNode", ")", "mapper", "."...
Gets the JSONP response for the given callback and value. @param callback the callback name @param data the data to transform to json @return the String built as follows: "callback(json(data))"
[ "Gets", "the", "JSONP", "response", "for", "the", "given", "callback", "and", "value", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L154-L162
bozaro/git-lfs-java
gitlfs-pointer/src/main/java/ru/bozaro/gitlfs/pointer/Pointer.java
Pointer.parsePointer
@Nullable public static Map<String, String> parsePointer(@NotNull byte[] blob) { return parsePointer(blob, 0, blob.length); }
java
@Nullable public static Map<String, String> parsePointer(@NotNull byte[] blob) { return parsePointer(blob, 0, blob.length); }
[ "@", "Nullable", "public", "static", "Map", "<", "String", ",", "String", ">", "parsePointer", "(", "@", "NotNull", "byte", "[", "]", "blob", ")", "{", "return", "parsePointer", "(", "blob", ",", "0", ",", "blob", ".", "length", ")", ";", "}" ]
Read pointer data. @param blob Blob data. @return Return pointer info or null if blob is not a pointer data.
[ "Read", "pointer", "data", "." ]
train
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-pointer/src/main/java/ru/bozaro/gitlfs/pointer/Pointer.java#L111-L114
alibaba/jstorm
jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormUtils.java
JStormUtils.getSupervisorPortNum
public static int getSupervisorPortNum(Map conf, int sysCpuNum, Long physicalMemSize) { double cpuWeight = ConfigExtension.getSupervisorSlotsPortCpuWeight(conf); int cpuPortNum = (int) (sysCpuNum / cpuWeight); if (cpuPortNum < 1) { LOG.info("Invalid supervisor.slots.port.cpu.weight setting :" + cpuWeight + ", cpu cores:" + sysCpuNum); cpuPortNum = 1; } Double memWeight = ConfigExtension.getSupervisorSlotsPortMemWeight(conf); int memPortNum = Integer.MAX_VALUE; if (physicalMemSize == null) { LOG.info("Failed to get memory size"); } else { LOG.debug("Get system memory size: " + physicalMemSize); long workerMemSize = ConfigExtension.getMemSizePerWorker(conf); memPortNum = (int) (physicalMemSize / (workerMemSize * memWeight)); if (memPortNum < 1) { LOG.info("System memory is too small for Jstorm"); memPortNum = 1; // minimal port number set to 1 if memory is not enough } } return Math.min(cpuPortNum, memPortNum); }
java
public static int getSupervisorPortNum(Map conf, int sysCpuNum, Long physicalMemSize) { double cpuWeight = ConfigExtension.getSupervisorSlotsPortCpuWeight(conf); int cpuPortNum = (int) (sysCpuNum / cpuWeight); if (cpuPortNum < 1) { LOG.info("Invalid supervisor.slots.port.cpu.weight setting :" + cpuWeight + ", cpu cores:" + sysCpuNum); cpuPortNum = 1; } Double memWeight = ConfigExtension.getSupervisorSlotsPortMemWeight(conf); int memPortNum = Integer.MAX_VALUE; if (physicalMemSize == null) { LOG.info("Failed to get memory size"); } else { LOG.debug("Get system memory size: " + physicalMemSize); long workerMemSize = ConfigExtension.getMemSizePerWorker(conf); memPortNum = (int) (physicalMemSize / (workerMemSize * memWeight)); if (memPortNum < 1) { LOG.info("System memory is too small for Jstorm"); memPortNum = 1; // minimal port number set to 1 if memory is not enough } } return Math.min(cpuPortNum, memPortNum); }
[ "public", "static", "int", "getSupervisorPortNum", "(", "Map", "conf", ",", "int", "sysCpuNum", ",", "Long", "physicalMemSize", ")", "{", "double", "cpuWeight", "=", "ConfigExtension", ".", "getSupervisorSlotsPortCpuWeight", "(", "conf", ")", ";", "int", "cpuPortN...
calculate port number from cpu number and physical memory size
[ "calculate", "port", "number", "from", "cpu", "number", "and", "physical", "memory", "size" ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormUtils.java#L1394-L1424
tvesalainen/util
vfs/src/main/java/org/vesalainen/vfs/Env.java
Env.getDefaultSymbolicLinkFileAttributes
public static final FileAttribute<?>[] getDefaultSymbolicLinkFileAttributes(Map<String, ?> env) { FileAttribute<?>[] attrs = (FileAttribute<?>[]) env.get(DEFAULT_SYMBOLIC_LINK_FILE_ATTRIBUTES); if (attrs == null) { attrs = new FileAttribute<?>[]{ PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwxrwx")), new FileAttributeImpl(OWNER, new UnixUser("root", 0)), new FileAttributeImpl(GROUP, new UnixGroup("root", 0)), }; } return attrs; }
java
public static final FileAttribute<?>[] getDefaultSymbolicLinkFileAttributes(Map<String, ?> env) { FileAttribute<?>[] attrs = (FileAttribute<?>[]) env.get(DEFAULT_SYMBOLIC_LINK_FILE_ATTRIBUTES); if (attrs == null) { attrs = new FileAttribute<?>[]{ PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwxrwx")), new FileAttributeImpl(OWNER, new UnixUser("root", 0)), new FileAttributeImpl(GROUP, new UnixGroup("root", 0)), }; } return attrs; }
[ "public", "static", "final", "FileAttribute", "<", "?", ">", "[", "]", "getDefaultSymbolicLinkFileAttributes", "(", "Map", "<", "String", ",", "?", ">", "env", ")", "{", "FileAttribute", "<", "?", ">", "[", "]", "attrs", "=", "(", "FileAttribute", "<", "...
Return default attributes for new symbolic link. Either from env or default values. @param env @return
[ "Return", "default", "attributes", "for", "new", "symbolic", "link", ".", "Either", "from", "env", "or", "default", "values", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/vfs/src/main/java/org/vesalainen/vfs/Env.java#L158-L170
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java
CmsListItemWidget.setLockIcon
public void setLockIcon(LockIcon icon, String iconTitle) { if (m_lockIcon == null) { m_lockIcon = new HTML(); m_lockIcon.addClickHandler(m_iconSuperClickHandler); m_contentPanel.add(m_lockIcon); } switch (icon) { case CLOSED: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockClosed()); break; case OPEN: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockOpen()); break; case SHARED_CLOSED: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockSharedClosed()); break; case SHARED_OPEN: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockSharedOpen()); break; case NONE: default: m_lockIcon.setStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon()); } m_lockIcon.setTitle(concatIconTitles(m_iconTitle, iconTitle)); m_lockIcon.getElement().getStyle().setCursor(Style.Cursor.POINTER); }
java
public void setLockIcon(LockIcon icon, String iconTitle) { if (m_lockIcon == null) { m_lockIcon = new HTML(); m_lockIcon.addClickHandler(m_iconSuperClickHandler); m_contentPanel.add(m_lockIcon); } switch (icon) { case CLOSED: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockClosed()); break; case OPEN: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockOpen()); break; case SHARED_CLOSED: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockSharedClosed()); break; case SHARED_OPEN: m_lockIcon.setStyleName( I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon() + " " + I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockSharedOpen()); break; case NONE: default: m_lockIcon.setStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().lockIcon()); } m_lockIcon.setTitle(concatIconTitles(m_iconTitle, iconTitle)); m_lockIcon.getElement().getStyle().setCursor(Style.Cursor.POINTER); }
[ "public", "void", "setLockIcon", "(", "LockIcon", "icon", ",", "String", "iconTitle", ")", "{", "if", "(", "m_lockIcon", "==", "null", ")", "{", "m_lockIcon", "=", "new", "HTML", "(", ")", ";", "m_lockIcon", ".", "addClickHandler", "(", "m_iconSuperClickHand...
Sets the lock icon.<p> @param icon the icon to use @param iconTitle the icon title
[ "Sets", "the", "lock", "icon", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java#L789-L828
loldevs/riotapi
rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/SummonerTeamService.java
SummonerTeamService.invitePlayer
public Team invitePlayer(long summonerId, TeamId teamId) { return client.sendRpcAndWait(SERVICE, "invitePlayer", summonerId, teamId); }
java
public Team invitePlayer(long summonerId, TeamId teamId) { return client.sendRpcAndWait(SERVICE, "invitePlayer", summonerId, teamId); }
[ "public", "Team", "invitePlayer", "(", "long", "summonerId", ",", "TeamId", "teamId", ")", "{", "return", "client", ".", "sendRpcAndWait", "(", "SERVICE", ",", "\"invitePlayer\"", ",", "summonerId", ",", "teamId", ")", ";", "}" ]
Invite a player to the target team @param summonerId The id of the player @param teamId The id of the team @return The new team state
[ "Invite", "a", "player", "to", "the", "target", "team" ]
train
https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/SummonerTeamService.java#L105-L107
Azure/azure-sdk-for-java
hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java
ConfigurationsInner.beginUpdate
public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map<String, String> parameters) { beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); }
java
public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map<String, String> parameters) { beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); }
[ "public", "void", "beginUpdate", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "String", "configurationName", ",", "Map", "<", "String", ",", "String", ">", "parameters", ")", "{", "beginUpdateWithServiceResponseAsync", "(", "resourceGroupName...
Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. @param resourceGroupName The name of the resource group. @param clusterName The name of the cluster. @param configurationName The name of the cluster configuration. @param parameters The cluster configurations. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
[ "Configures", "the", "HTTP", "settings", "on", "the", "specified", "cluster", ".", "This", "API", "is", "deprecated", "please", "use", "UpdateGatewaySettings", "in", "cluster", "endpoint", "instead", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java#L256-L258
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java
CPDefinitionLocalizationPersistenceImpl.findAll
@Override public List<CPDefinitionLocalization> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CPDefinitionLocalization> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionLocalization", ">", "findAll", "(", ")", "{", "return", "findAll", "(", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the cp definition localizations. @return the cp definition localizations
[ "Returns", "all", "the", "cp", "definition", "localizations", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java#L1420-L1423
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.compareToIgnoreCaseCarefulEquals
public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) { int diff=S1.compareToIgnoreCase(S2); if(diff==0) diff=S1.compareTo(S2); return diff; }
java
public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) { int diff=S1.compareToIgnoreCase(S2); if(diff==0) diff=S1.compareTo(S2); return diff; }
[ "public", "static", "int", "compareToIgnoreCaseCarefulEquals", "(", "String", "S1", ",", "String", "S2", ")", "{", "int", "diff", "=", "S1", ".", "compareToIgnoreCase", "(", "S2", ")", ";", "if", "(", "diff", "==", "0", ")", "diff", "=", "S1", ".", "co...
Compares two strings in a case insensitive manner. However, if they are considered equals in the case-insensitive manner, the case sensitive comparison is done.
[ "Compares", "two", "strings", "in", "a", "case", "insensitive", "manner", ".", "However", "if", "they", "are", "considered", "equals", "in", "the", "case", "-", "insensitive", "manner", "the", "case", "sensitive", "comparison", "is", "done", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1345-L1349
wisdom-framework/wisdom
core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java
ContextFromVertx.parameterAsInteger
@Override public Integer parameterAsInteger(String name, Integer defaultValue) { return request.parameterAsInteger(name, defaultValue); }
java
@Override public Integer parameterAsInteger(String name, Integer defaultValue) { return request.parameterAsInteger(name, defaultValue); }
[ "@", "Override", "public", "Integer", "parameterAsInteger", "(", "String", "name", ",", "Integer", "defaultValue", ")", "{", "return", "request", ".", "parameterAsInteger", "(", "name", ",", "defaultValue", ")", ";", "}" ]
Like {@link #parameter(String, String)}, but converts the parameter to Integer if found. <p> The parameter is decoded by default. @param name The name of the parameter @param defaultValue A default value if parameter not found. @return The value of the parameter of the defaultValue if not found.
[ "Like", "{", "@link", "#parameter", "(", "String", "String", ")", "}", "but", "converts", "the", "parameter", "to", "Integer", "if", "found", ".", "<p", ">", "The", "parameter", "is", "decoded", "by", "default", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/ContextFromVertx.java#L294-L297
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java
FieldDescriptorConstraints.checkLocking
private void checkLocking(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException { if (CHECKLEVEL_NONE.equals(checkLevel)) { return; } String jdbcType = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE); if (!"TIMESTAMP".equals(jdbcType) && !"INTEGER".equals(jdbcType)) { if (fieldDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_LOCKING, false)) { throw new ConstraintException("The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" has locking set to true though it is not of TIMESTAMP or INTEGER type"); } if (fieldDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_UPDATE_LOCK, false)) { throw new ConstraintException("The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" has update-lock set to true though it is not of TIMESTAMP or INTEGER type"); } } }
java
private void checkLocking(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException { if (CHECKLEVEL_NONE.equals(checkLevel)) { return; } String jdbcType = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE); if (!"TIMESTAMP".equals(jdbcType) && !"INTEGER".equals(jdbcType)) { if (fieldDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_LOCKING, false)) { throw new ConstraintException("The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" has locking set to true though it is not of TIMESTAMP or INTEGER type"); } if (fieldDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_UPDATE_LOCK, false)) { throw new ConstraintException("The field "+fieldDef.getName()+" in class "+fieldDef.getOwner().getName()+" has update-lock set to true though it is not of TIMESTAMP or INTEGER type"); } } }
[ "private", "void", "checkLocking", "(", "FieldDescriptorDef", "fieldDef", ",", "String", "checkLevel", ")", "throws", "ConstraintException", "{", "if", "(", "CHECKLEVEL_NONE", ".", "equals", "(", "checkLevel", ")", ")", "{", "return", ";", "}", "String", "jdbcTy...
Checks that locking and update-lock are only used for fields of TIMESTAMP or INTEGER type. @param fieldDef The field descriptor @param checkLevel The current check level (this constraint is checked in basic and strict) @exception ConstraintException If the constraint has been violated
[ "Checks", "that", "locking", "and", "update", "-", "lock", "are", "only", "used", "for", "fields", "of", "TIMESTAMP", "or", "INTEGER", "type", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java#L310-L330
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_ovhPabx_serviceName_tts_id_PUT
public void billingAccount_ovhPabx_serviceName_tts_id_PUT(String billingAccount, String serviceName, Long id, OvhOvhPabxTts body) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/tts/{id}"; StringBuilder sb = path(qPath, billingAccount, serviceName, id); exec(qPath, "PUT", sb.toString(), body); }
java
public void billingAccount_ovhPabx_serviceName_tts_id_PUT(String billingAccount, String serviceName, Long id, OvhOvhPabxTts body) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/tts/{id}"; StringBuilder sb = path(qPath, billingAccount, serviceName, id); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "billingAccount_ovhPabx_serviceName_tts_id_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "Long", "id", ",", "OvhOvhPabxTts", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/ovh...
Alter this object properties REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/tts/{id} @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required] @param id [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#L7637-L7641
mapsforge/mapsforge
mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java
ReadBuffer.readUTF8EncodedString
public String readUTF8EncodedString(int stringLength) { if (stringLength > 0 && this.bufferPosition + stringLength <= this.bufferData.length) { this.bufferPosition += stringLength; try { return new String(this.bufferData, this.bufferPosition - stringLength, stringLength, CHARSET_UTF8); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } } LOGGER.warning("invalid string length: " + stringLength); return null; }
java
public String readUTF8EncodedString(int stringLength) { if (stringLength > 0 && this.bufferPosition + stringLength <= this.bufferData.length) { this.bufferPosition += stringLength; try { return new String(this.bufferData, this.bufferPosition - stringLength, stringLength, CHARSET_UTF8); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } } LOGGER.warning("invalid string length: " + stringLength); return null; }
[ "public", "String", "readUTF8EncodedString", "(", "int", "stringLength", ")", "{", "if", "(", "stringLength", ">", "0", "&&", "this", ".", "bufferPosition", "+", "stringLength", "<=", "this", ".", "bufferData", ".", "length", ")", "{", "this", ".", "bufferPo...
Decodes the given amount of bytes from the read buffer to a string. @param stringLength the length of the string in bytes. @return the UTF-8 decoded string (may be null).
[ "Decodes", "the", "given", "amount", "of", "bytes", "from", "the", "read", "buffer", "to", "a", "string", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java#L272-L283
Azure/azure-sdk-for-java
datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java
AccountsInner.updateAsync
public Observable<DataLakeStoreAccountInner> updateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<DataLakeStoreAccountInner>, DataLakeStoreAccountInner>() { @Override public DataLakeStoreAccountInner call(ServiceResponse<DataLakeStoreAccountInner> response) { return response.body(); } }); }
java
public Observable<DataLakeStoreAccountInner> updateAsync(String resourceGroupName, String name, DataLakeStoreAccountInner parameters) { return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<DataLakeStoreAccountInner>, DataLakeStoreAccountInner>() { @Override public DataLakeStoreAccountInner call(ServiceResponse<DataLakeStoreAccountInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "DataLakeStoreAccountInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "DataLakeStoreAccountInner", "parameters", ")", "{", "return", "updateWithServiceResponseAsync", "(", "resourceGroupName", ",", "n...
Updates the specified Data Lake Store account information. @param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account. @param name The name of the Data Lake Store account to update. @param parameters Parameters supplied to update the Data Lake Store account. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "Updates", "the", "specified", "Data", "Lake", "Store", "account", "information", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L759-L766
Azure/azure-sdk-for-java
policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java
PolicyStatesInner.summarizeForManagementGroupAsync
public Observable<SummarizeResultsInner> summarizeForManagementGroupAsync(String managementGroupName, QueryOptions queryOptions) { return summarizeForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions).map(new Func1<ServiceResponse<SummarizeResultsInner>, SummarizeResultsInner>() { @Override public SummarizeResultsInner call(ServiceResponse<SummarizeResultsInner> response) { return response.body(); } }); }
java
public Observable<SummarizeResultsInner> summarizeForManagementGroupAsync(String managementGroupName, QueryOptions queryOptions) { return summarizeForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions).map(new Func1<ServiceResponse<SummarizeResultsInner>, SummarizeResultsInner>() { @Override public SummarizeResultsInner call(ServiceResponse<SummarizeResultsInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "SummarizeResultsInner", ">", "summarizeForManagementGroupAsync", "(", "String", "managementGroupName", ",", "QueryOptions", "queryOptions", ")", "{", "return", "summarizeForManagementGroupWithServiceResponseAsync", "(", "managementGroupName", ",", ...
Summarizes policy states for the resources under the management group. @param managementGroupName Management group name. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the SummarizeResultsInner object
[ "Summarizes", "policy", "states", "for", "the", "resources", "under", "the", "management", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L442-L449
SonarSource/sonarqube
server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java
DatabaseUtils.executeLargeUpdates
public static <INPUT extends Comparable<INPUT>> void executeLargeUpdates(Collection<INPUT> inputs, Consumer<List<INPUT>> consumer) { executeLargeUpdates(inputs, consumer, i -> i); }
java
public static <INPUT extends Comparable<INPUT>> void executeLargeUpdates(Collection<INPUT> inputs, Consumer<List<INPUT>> consumer) { executeLargeUpdates(inputs, consumer, i -> i); }
[ "public", "static", "<", "INPUT", "extends", "Comparable", "<", "INPUT", ">", ">", "void", "executeLargeUpdates", "(", "Collection", "<", "INPUT", ">", "inputs", ",", "Consumer", "<", "List", "<", "INPUT", ">", ">", "consumer", ")", "{", "executeLargeUpdates...
Partition by 1000 elements a list of input and execute a consumer on each part. The goal is to prevent issue with ORACLE when there's more than 1000 elements in a 'in ('X', 'Y', ...)' and with MsSQL when there's more than 2000 parameters in a query
[ "Partition", "by", "1000", "elements", "a", "list", "of", "input", "and", "execute", "a", "consumer", "on", "each", "part", "." ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseUtils.java#L148-L150
xiancloud/xian
xian-core/src/main/java/info/xiancloud/core/thread_pool/SingleThreadExecutorGroup.java
SingleThreadExecutorGroup.execute
public void execute(int key, Runnable runnable) { if (StringUtil.isEmpty(key)) { throw new IllegalArgumentException("入参key不允许为空!"); } int mod = Math.abs(key % map.size()); LOG.debug("_sequential 选取第" + mod + "根线程执行任务,threadKey=" + key); ThreadPoolExecutor executor = map.get(mod); executor.execute(ThreadPoolManager.wrapRunnable(runnable, MsgIdHolder.get())); }
java
public void execute(int key, Runnable runnable) { if (StringUtil.isEmpty(key)) { throw new IllegalArgumentException("入参key不允许为空!"); } int mod = Math.abs(key % map.size()); LOG.debug("_sequential 选取第" + mod + "根线程执行任务,threadKey=" + key); ThreadPoolExecutor executor = map.get(mod); executor.execute(ThreadPoolManager.wrapRunnable(runnable, MsgIdHolder.get())); }
[ "public", "void", "execute", "(", "int", "key", ",", "Runnable", "runnable", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "key", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"入参key不允许为空!\");", "", "", "}", "int", "mod", "=...
sticky executor @param key sticky key @param runnable the task
[ "sticky", "executor" ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/thread_pool/SingleThreadExecutorGroup.java#L55-L63
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java
BeanUtil.toBean
public static <T> T toBean(Class<T> beanClass, ValueProvider<String> valueProvider, CopyOptions copyOptions) { return fillBean(ReflectUtil.newInstance(beanClass), valueProvider, copyOptions); }
java
public static <T> T toBean(Class<T> beanClass, ValueProvider<String> valueProvider, CopyOptions copyOptions) { return fillBean(ReflectUtil.newInstance(beanClass), valueProvider, copyOptions); }
[ "public", "static", "<", "T", ">", "T", "toBean", "(", "Class", "<", "T", ">", "beanClass", ",", "ValueProvider", "<", "String", ">", "valueProvider", ",", "CopyOptions", "copyOptions", ")", "{", "return", "fillBean", "(", "ReflectUtil", ".", "newInstance", ...
ServletRequest 参数转Bean @param <T> Bean类型 @param beanClass Bean Class @param valueProvider 值提供者 @param copyOptions 拷贝选项,见 {@link CopyOptions} @return Bean
[ "ServletRequest", "参数转Bean" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L457-L459
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
MultiBackgroundInitializer.addInitializer
public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { throw new IllegalStateException( "addInitializer() must not be called after start()!"); } childInitializers.put(name, init); } }
java
public void addInitializer(final String name, final BackgroundInitializer<?> init) { Validate.isTrue(name != null, "Name of child initializer must not be null!"); Validate.isTrue(init != null, "Child initializer must not be null!"); synchronized (this) { if (isStarted()) { throw new IllegalStateException( "addInitializer() must not be called after start()!"); } childInitializers.put(name, init); } }
[ "public", "void", "addInitializer", "(", "final", "String", "name", ",", "final", "BackgroundInitializer", "<", "?", ">", "init", ")", "{", "Validate", ".", "isTrue", "(", "name", "!=", "null", ",", "\"Name of child initializer must not be null!\"", ")", ";", "V...
Adds a new {@code BackgroundInitializer} to this object. When this {@code MultiBackgroundInitializer} is started, the given initializer will be processed. This method must not be called after {@link #start()} has been invoked. @param name the name of the initializer (must not be <b>null</b>) @param init the {@code BackgroundInitializer} to add (must not be <b>null</b>) @throws IllegalArgumentException if a required parameter is missing @throws IllegalStateException if {@code start()} has already been called
[ "Adds", "a", "new", "{", "@code", "BackgroundInitializer", "}", "to", "this", "object", ".", "When", "this", "{", "@code", "MultiBackgroundInitializer", "}", "is", "started", "the", "given", "initializer", "will", "be", "processed", ".", "This", "method", "mus...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java#L138-L149
michael-rapp/AndroidMaterialDialog
example/src/main/java/de/mrapp/android/dialog/example/MainActivity.java
MainActivity.createScrollListener
private RecyclerView.OnScrollListener createScrollListener() { return new RecyclerView.OnScrollListener() { /** * True, if the view is currently scrolling up, false otherwise. */ private boolean scrollingUp; @Override public void onScrollStateChanged(final RecyclerView recyclerView, final int newState) { } @Override public void onScrolled(final RecyclerView recyclerView, final int dx, final int dy) { boolean isScrollingUp = dy < 0; if (scrollingUp != isScrollingUp) { scrollingUp = isScrollingUp; if (scrollingUp) { floatingActionButton.show(); } else { floatingActionButton.hide(); } } } }; }
java
private RecyclerView.OnScrollListener createScrollListener() { return new RecyclerView.OnScrollListener() { /** * True, if the view is currently scrolling up, false otherwise. */ private boolean scrollingUp; @Override public void onScrollStateChanged(final RecyclerView recyclerView, final int newState) { } @Override public void onScrolled(final RecyclerView recyclerView, final int dx, final int dy) { boolean isScrollingUp = dy < 0; if (scrollingUp != isScrollingUp) { scrollingUp = isScrollingUp; if (scrollingUp) { floatingActionButton.show(); } else { floatingActionButton.hide(); } } } }; }
[ "private", "RecyclerView", ".", "OnScrollListener", "createScrollListener", "(", ")", "{", "return", "new", "RecyclerView", ".", "OnScrollListener", "(", ")", "{", "/**\n * True, if the view is currently scrolling up, false otherwise.\n */", "private", "bo...
Creates and returns a listener, which allows to hide or show the activity's floating action button, when the preferences, which are shown by the activity's fragment, are scrolled. @return The listener, which has been created, as an instance of the type {@link RecyclerView.OnScrollListener}
[ "Creates", "and", "returns", "a", "listener", "which", "allows", "to", "hide", "or", "show", "the", "activity", "s", "floating", "action", "button", "when", "the", "preferences", "which", "are", "shown", "by", "the", "activity", "s", "fragment", "are", "scro...
train
https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/example/src/main/java/de/mrapp/android/dialog/example/MainActivity.java#L93-L122
apache/groovy
src/main/groovy/groovy/ui/GroovyMain.java
GroovyMain.processArgs
@Deprecated static void processArgs(String[] args, final PrintStream out) { processArgs(args, out, out); }
java
@Deprecated static void processArgs(String[] args, final PrintStream out) { processArgs(args, out, out); }
[ "@", "Deprecated", "static", "void", "processArgs", "(", "String", "[", "]", "args", ",", "final", "PrintStream", "out", ")", "{", "processArgs", "(", "args", ",", "out", ",", "out", ")", ";", "}" ]
package-level visibility for testing purposes (just usage/errors at this stage)
[ "package", "-", "level", "visibility", "for", "testing", "purposes", "(", "just", "usage", "/", "errors", "at", "this", "stage", ")" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/ui/GroovyMain.java#L120-L123
powermock/powermock
powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java
PowerMock.expectNiceNew
public static synchronized <T> IExpectationSetters<T> expectNiceNew(Class<T> type, Object... arguments) throws Exception { return doExpectNew(type, new NiceMockStrategy(), null, arguments); }
java
public static synchronized <T> IExpectationSetters<T> expectNiceNew(Class<T> type, Object... arguments) throws Exception { return doExpectNew(type, new NiceMockStrategy(), null, arguments); }
[ "public", "static", "synchronized", "<", "T", ">", "IExpectationSetters", "<", "T", ">", "expectNiceNew", "(", "Class", "<", "T", ">", "type", ",", "Object", "...", "arguments", ")", "throws", "Exception", "{", "return", "doExpectNew", "(", "type", ",", "n...
Allows specifying expectations on new invocations. For example you might want to throw an exception or return a mock. <p/> This method allows any number of calls to a new constructor without throwing an exception. <p/> Note that you must replay the class when using this method since this behavior is part of the class mock.
[ "Allows", "specifying", "expectations", "on", "new", "invocations", ".", "For", "example", "you", "might", "want", "to", "throw", "an", "exception", "or", "return", "a", "mock", ".", "<p", "/", ">", "This", "method", "allows", "any", "number", "of", "calls...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1730-L1733
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java
SARLEclipsePlugin.createMultiStatus
@SuppressWarnings("static-method") public IStatus createMultiStatus(Iterable<? extends IStatus> status) { final IStatus max = findMax(status); final MultiStatus multiStatus; if (max == null) { multiStatus = new MultiStatus(PLUGIN_ID, 0, null, null); } else { multiStatus = new MultiStatus(PLUGIN_ID, 0, max.getMessage(), max.getException()); } for (final IStatus s : status) { multiStatus.add(s); } return multiStatus; }
java
@SuppressWarnings("static-method") public IStatus createMultiStatus(Iterable<? extends IStatus> status) { final IStatus max = findMax(status); final MultiStatus multiStatus; if (max == null) { multiStatus = new MultiStatus(PLUGIN_ID, 0, null, null); } else { multiStatus = new MultiStatus(PLUGIN_ID, 0, max.getMessage(), max.getException()); } for (final IStatus s : status) { multiStatus.add(s); } return multiStatus; }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "public", "IStatus", "createMultiStatus", "(", "Iterable", "<", "?", "extends", "IStatus", ">", "status", ")", "{", "final", "IStatus", "max", "=", "findMax", "(", "status", ")", ";", "final", "MultiStatu...
Create a multistatus. @param status the status to put in the same status instance. @return the status.
[ "Create", "a", "multistatus", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L256-L269
prestodb/presto
presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordCursor.java
AccumuloRecordCursor.checkFieldType
private void checkFieldType(int field, Type... expected) { Type actual = getType(field); for (Type type : expected) { if (actual.equals(type)) { return; } } throw new IllegalArgumentException(format("Expected field %s to be a type of %s but is %s", field, StringUtils.join(expected, ","), actual)); }
java
private void checkFieldType(int field, Type... expected) { Type actual = getType(field); for (Type type : expected) { if (actual.equals(type)) { return; } } throw new IllegalArgumentException(format("Expected field %s to be a type of %s but is %s", field, StringUtils.join(expected, ","), actual)); }
[ "private", "void", "checkFieldType", "(", "int", "field", ",", "Type", "...", "expected", ")", "{", "Type", "actual", "=", "getType", "(", "field", ")", ";", "for", "(", "Type", "type", ":", "expected", ")", "{", "if", "(", "actual", ".", "equals", "...
Checks that the given field is one of the provided types. @param field Ordinal of the field @param expected An array of expected types @throws IllegalArgumentException If the given field does not match one of the types
[ "Checks", "that", "the", "given", "field", "is", "one", "of", "the", "provided", "types", "." ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordCursor.java#L298-L308
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.order_orderId_refund_GET
public OvhRefund order_orderId_refund_GET(Long orderId) throws IOException { String qPath = "/me/order/{orderId}/refund"; StringBuilder sb = path(qPath, orderId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhRefund.class); }
java
public OvhRefund order_orderId_refund_GET(Long orderId) throws IOException { String qPath = "/me/order/{orderId}/refund"; StringBuilder sb = path(qPath, orderId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhRefund.class); }
[ "public", "OvhRefund", "order_orderId_refund_GET", "(", "Long", "orderId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/order/{orderId}/refund\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "orderId", ")", ";", "String", "resp...
Get this object properties REST: GET /me/order/{orderId}/refund @param orderId [required]
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1828-L1833
ravendb/ravendb-jvm-client
src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java
DocumentSubscriptions.getSubscriptionWorkerForRevisions
public <T> SubscriptionWorker<Revision<T>> getSubscriptionWorkerForRevisions(Class<T> clazz, SubscriptionWorkerOptions options) { return getSubscriptionWorkerForRevisions(clazz, options, null); }
java
public <T> SubscriptionWorker<Revision<T>> getSubscriptionWorkerForRevisions(Class<T> clazz, SubscriptionWorkerOptions options) { return getSubscriptionWorkerForRevisions(clazz, options, null); }
[ "public", "<", "T", ">", "SubscriptionWorker", "<", "Revision", "<", "T", ">", ">", "getSubscriptionWorkerForRevisions", "(", "Class", "<", "T", ">", "clazz", ",", "SubscriptionWorkerOptions", "options", ")", "{", "return", "getSubscriptionWorkerForRevisions", "(", ...
It opens a subscription and starts pulling documents since a last processed document for that subscription. The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client needs to acknowledge that batch has been processed. The acknowledgment is sent after all documents are processed by subscription's handlers. There can be only a single client that is connected to a subscription. @param clazz Entity class @param options Subscription options @param <T> Entity class @return Subscription object that allows to add/remove subscription handlers.
[ "It", "opens", "a", "subscription", "and", "starts", "pulling", "documents", "since", "a", "last", "processed", "document", "for", "that", "subscription", ".", "The", "connection", "options", "determine", "client", "and", "server", "cooperation", "rules", "like", ...
train
https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L281-L283
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/types/SampleCount.java
SampleCount.valueOf
public static SampleCount valueOf(final String countAndRate) { if (countAndRate == null) return null; final String[] parts = countAndRate.split("@"); if (parts.length == 2) { final long samples = Long.parseLong(parts[0]); final Timebase timebase = Timebase.getInstance(parts[1]); return new SampleCount(samples, timebase); } else { throw new IllegalArgumentException("Invalid Vidispine sample count: " + countAndRate + " expected a single @ separating sample count and rate."); } }
java
public static SampleCount valueOf(final String countAndRate) { if (countAndRate == null) return null; final String[] parts = countAndRate.split("@"); if (parts.length == 2) { final long samples = Long.parseLong(parts[0]); final Timebase timebase = Timebase.getInstance(parts[1]); return new SampleCount(samples, timebase); } else { throw new IllegalArgumentException("Invalid Vidispine sample count: " + countAndRate + " expected a single @ separating sample count and rate."); } }
[ "public", "static", "SampleCount", "valueOf", "(", "final", "String", "countAndRate", ")", "{", "if", "(", "countAndRate", "==", "null", ")", "return", "null", ";", "final", "String", "[", "]", "parts", "=", "countAndRate", ".", "split", "(", "\"@\"", ")",...
Parse a sample count & timebase as <code>samples@[str_timebase|nom[:denom]]</code> N.B. This does NOT consider the case where only a sample count is specified: it MUST include a timebase @param countAndRate A sample count and a time base. The syntax is {number of samples}@{textual representation of time base} 124222@44100, 400@30000:1001, 400@NTSC @return
[ "Parse", "a", "sample", "count", "&", "timebase", "as", "<code", ">", "samples@", "[", "str_timebase|nom", "[", ":", "denom", "]]", "<", "/", "code", ">", "N", ".", "B", ".", "This", "does", "NOT", "consider", "the", "case", "where", "only", "a", "sa...
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/SampleCount.java#L202-L222
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Section.java
Section.renderTagId
private final String renderTagId(InternalStringBuilder buffer) throws JspException { assert(_name != null); // @todo: this is busted. It should be writing out inline. String realName = rewriteName(_name); String idScript = mapLegacyTagId(_name, realName); // some tags will output the id attribute themselves so they don't write this out renderAttribute(buffer, "id", realName); return idScript; }
java
private final String renderTagId(InternalStringBuilder buffer) throws JspException { assert(_name != null); // @todo: this is busted. It should be writing out inline. String realName = rewriteName(_name); String idScript = mapLegacyTagId(_name, realName); // some tags will output the id attribute themselves so they don't write this out renderAttribute(buffer, "id", realName); return idScript; }
[ "private", "final", "String", "renderTagId", "(", "InternalStringBuilder", "buffer", ")", "throws", "JspException", "{", "assert", "(", "_name", "!=", "null", ")", ";", "// @todo: this is busted. It should be writing out inline.", "String", "realName", "=", "rewriteName"...
This method will handle creating the tagId attribute. The tagId attribute indentifies the tag in the generated HTML. There is a lookup table created in JavaScript mapping the <coe>tagId</code> to the actual name. The tagId is also run through the naming service so it can be scoped. Some tags will write that <code>tagid</code> out as the <code>id</code> attribute of the HTML tag being generated. @param buffer @return String
[ "This", "method", "will", "handle", "creating", "the", "tagId", "attribute", ".", "The", "tagId", "attribute", "indentifies", "the", "tag", "in", "the", "generated", "HTML", ".", "There", "is", "a", "lookup", "table", "created", "in", "JavaScript", "mapping", ...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/template/Section.java#L333-L344
Erudika/para
para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java
AWSDynamoUtils.createSharedTable
public static boolean createSharedTable(long readCapacity, long writeCapacity) { if (StringUtils.isBlank(SHARED_TABLE) || StringUtils.containsWhitespace(SHARED_TABLE) || existsTable(SHARED_TABLE)) { return false; } try { GlobalSecondaryIndex secIndex = new GlobalSecondaryIndex(). withIndexName(getSharedIndexName()). withProvisionedThroughput(new ProvisionedThroughput(). withReadCapacityUnits(1L). withWriteCapacityUnits(1L)). withProjection(new Projection().withProjectionType(ProjectionType.ALL)). withKeySchema(new KeySchemaElement().withAttributeName(Config._APPID).withKeyType(KeyType.HASH), new KeySchemaElement().withAttributeName(Config._ID).withKeyType(KeyType.RANGE)); getClient().createTable(new CreateTableRequest().withTableName(getTableNameForAppid(SHARED_TABLE)). withKeySchema(new KeySchemaElement(Config._KEY, KeyType.HASH)). withSSESpecification(new SSESpecification().withEnabled(ENCRYPTION_AT_REST_ENABLED)). withAttributeDefinitions(new AttributeDefinition(Config._KEY, ScalarAttributeType.S), new AttributeDefinition(Config._APPID, ScalarAttributeType.S), new AttributeDefinition(Config._ID, ScalarAttributeType.S)). withGlobalSecondaryIndexes(secIndex). withProvisionedThroughput(new ProvisionedThroughput(readCapacity, writeCapacity))); } catch (Exception e) { logger.error(null, e); return false; } return true; }
java
public static boolean createSharedTable(long readCapacity, long writeCapacity) { if (StringUtils.isBlank(SHARED_TABLE) || StringUtils.containsWhitespace(SHARED_TABLE) || existsTable(SHARED_TABLE)) { return false; } try { GlobalSecondaryIndex secIndex = new GlobalSecondaryIndex(). withIndexName(getSharedIndexName()). withProvisionedThroughput(new ProvisionedThroughput(). withReadCapacityUnits(1L). withWriteCapacityUnits(1L)). withProjection(new Projection().withProjectionType(ProjectionType.ALL)). withKeySchema(new KeySchemaElement().withAttributeName(Config._APPID).withKeyType(KeyType.HASH), new KeySchemaElement().withAttributeName(Config._ID).withKeyType(KeyType.RANGE)); getClient().createTable(new CreateTableRequest().withTableName(getTableNameForAppid(SHARED_TABLE)). withKeySchema(new KeySchemaElement(Config._KEY, KeyType.HASH)). withSSESpecification(new SSESpecification().withEnabled(ENCRYPTION_AT_REST_ENABLED)). withAttributeDefinitions(new AttributeDefinition(Config._KEY, ScalarAttributeType.S), new AttributeDefinition(Config._APPID, ScalarAttributeType.S), new AttributeDefinition(Config._ID, ScalarAttributeType.S)). withGlobalSecondaryIndexes(secIndex). withProvisionedThroughput(new ProvisionedThroughput(readCapacity, writeCapacity))); } catch (Exception e) { logger.error(null, e); return false; } return true; }
[ "public", "static", "boolean", "createSharedTable", "(", "long", "readCapacity", ",", "long", "writeCapacity", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "SHARED_TABLE", ")", "||", "StringUtils", ".", "containsWhitespace", "(", "SHARED_TABLE", ")", ...
Creates a table in AWS DynamoDB which will be shared between apps. @param readCapacity read capacity @param writeCapacity write capacity @return true if created
[ "Creates", "a", "table", "in", "AWS", "DynamoDB", "which", "will", "be", "shared", "between", "apps", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java#L254-L282
wuman/orientdb-android
commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java
OMVRBTree.putAll
@Override public void putAll(final Map<? extends K, ? extends V> map) { int mapSize = map.size(); if (size() == 0 && mapSize != 0 && map instanceof SortedMap) { Comparator<?> c = ((SortedMap<? extends K, ? extends V>) map).comparator(); if (c == comparator || (c != null && c.equals(comparator))) { ++modCount; try { buildFromSorted(mapSize, map.entrySet().iterator(), null, null); } catch (java.io.IOException cannotHappen) { } catch (ClassNotFoundException cannotHappen) { } return; } } super.putAll(map); }
java
@Override public void putAll(final Map<? extends K, ? extends V> map) { int mapSize = map.size(); if (size() == 0 && mapSize != 0 && map instanceof SortedMap) { Comparator<?> c = ((SortedMap<? extends K, ? extends V>) map).comparator(); if (c == comparator || (c != null && c.equals(comparator))) { ++modCount; try { buildFromSorted(mapSize, map.entrySet().iterator(), null, null); } catch (java.io.IOException cannotHappen) { } catch (ClassNotFoundException cannotHappen) { } return; } } super.putAll(map); }
[ "@", "Override", "public", "void", "putAll", "(", "final", "Map", "<", "?", "extends", "K", ",", "?", "extends", "V", ">", "map", ")", "{", "int", "mapSize", "=", "map", ".", "size", "(", ")", ";", "if", "(", "size", "(", ")", "==", "0", "&&", ...
Copies all of the mappings from the specified map to this map. These mappings replace any mappings that this map had for any of the keys currently in the specified map. @param map mappings to be stored in this map @throws ClassCastException if the class of a key or value in the specified map prevents it from being stored in this map @throws NullPointerException if the specified map is null or the specified map contains a null key and this map does not permit null keys
[ "Copies", "all", "of", "the", "mappings", "from", "the", "specified", "map", "to", "this", "map", ".", "These", "mappings", "replace", "any", "mappings", "that", "this", "map", "had", "for", "any", "of", "the", "keys", "currently", "in", "the", "specified"...
train
https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L316-L332
agaricusb/SpecialSourceMP
src/main/java/net/md_5/specialsource/mavenplugin/InstallRemappedFileMojo.java
InstallRemappedFileMojo.installChecksum
private void installChecksum( File originalFile, File installedFile, Digester digester, String ext ) throws MojoExecutionException { String checksum; getLog().debug( "Calculating " + digester.getAlgorithm() + " checksum for " + originalFile ); try { checksum = digester.calc( originalFile ); } catch ( DigesterException e ) { throw new MojoExecutionException( "Failed to calculate " + digester.getAlgorithm() + " checksum for " + originalFile, e ); } File checksumFile = new File( installedFile.getAbsolutePath() + ext ); getLog().debug( "Installing checksum to " + checksumFile ); try { checksumFile.getParentFile().mkdirs(); FileUtils.fileWrite( checksumFile.getAbsolutePath(), "UTF-8", checksum ); } catch ( IOException e ) { throw new MojoExecutionException( "Failed to install checksum to " + checksumFile, e ); } }
java
private void installChecksum( File originalFile, File installedFile, Digester digester, String ext ) throws MojoExecutionException { String checksum; getLog().debug( "Calculating " + digester.getAlgorithm() + " checksum for " + originalFile ); try { checksum = digester.calc( originalFile ); } catch ( DigesterException e ) { throw new MojoExecutionException( "Failed to calculate " + digester.getAlgorithm() + " checksum for " + originalFile, e ); } File checksumFile = new File( installedFile.getAbsolutePath() + ext ); getLog().debug( "Installing checksum to " + checksumFile ); try { checksumFile.getParentFile().mkdirs(); FileUtils.fileWrite( checksumFile.getAbsolutePath(), "UTF-8", checksum ); } catch ( IOException e ) { throw new MojoExecutionException( "Failed to install checksum to " + checksumFile, e ); } }
[ "private", "void", "installChecksum", "(", "File", "originalFile", ",", "File", "installedFile", ",", "Digester", "digester", ",", "String", "ext", ")", "throws", "MojoExecutionException", "{", "String", "checksum", ";", "getLog", "(", ")", ".", "debug", "(", ...
Installs a checksum for the specified file. @param originalFile The path to the file from which the checksum is generated, must not be <code>null</code>. @param installedFile The base path from which the path to the checksum files is derived by appending the given file extension, must not be <code>null</code>. @param digester The checksum algorithm to use, must not be <code>null</code>. @param ext The file extension (including the leading dot) to use for the checksum file, must not be <code>null</code>. @throws MojoExecutionException If the checksum could not be installed.
[ "Installs", "a", "checksum", "for", "the", "specified", "file", "." ]
train
https://github.com/agaricusb/SpecialSourceMP/blob/350daa04831fb93a51a57a30009c572ade0a88bf/src/main/java/net/md_5/specialsource/mavenplugin/InstallRemappedFileMojo.java#L578-L604
vanilladb/vanillacore
src/main/java/org/vanilladb/core/query/algebra/materialize/TempRecordPage.java
TempRecordPage.findSmallestFrom
private int findSmallestFrom(int startId, List<String> sortFlds, List<Integer> sortDirs) { int minId = startId; moveToId(startId); while (super.next()) { int id = currentId(); if (minId < 0 || compareRecords(minId, id, sortFlds, sortDirs) > 0) minId = id; moveToId(id); } return minId; }
java
private int findSmallestFrom(int startId, List<String> sortFlds, List<Integer> sortDirs) { int minId = startId; moveToId(startId); while (super.next()) { int id = currentId(); if (minId < 0 || compareRecords(minId, id, sortFlds, sortDirs) > 0) minId = id; moveToId(id); } return minId; }
[ "private", "int", "findSmallestFrom", "(", "int", "startId", ",", "List", "<", "String", ">", "sortFlds", ",", "List", "<", "Integer", ">", "sortDirs", ")", "{", "int", "minId", "=", "startId", ";", "moveToId", "(", "startId", ")", ";", "while", "(", "...
Scan id larger than startId to find smallest record (included startId) @param startId @param sortFlds @param sortDirs @return the id of smallest record
[ "Scan", "id", "larger", "than", "startId", "to", "find", "smallest", "record", "(", "included", "startId", ")" ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/materialize/TempRecordPage.java#L113-L123
JakeWharton/NineOldAndroids
library/src/com/nineoldandroids/animation/PropertyValuesHolder.java
PropertyValuesHolder.getMethodName
static String getMethodName(String prefix, String propertyName) { if (propertyName == null || propertyName.length() == 0) { // shouldn't get here return prefix; } char firstLetter = Character.toUpperCase(propertyName.charAt(0)); String theRest = propertyName.substring(1); return prefix + firstLetter + theRest; }
java
static String getMethodName(String prefix, String propertyName) { if (propertyName == null || propertyName.length() == 0) { // shouldn't get here return prefix; } char firstLetter = Character.toUpperCase(propertyName.charAt(0)); String theRest = propertyName.substring(1); return prefix + firstLetter + theRest; }
[ "static", "String", "getMethodName", "(", "String", "prefix", ",", "String", "propertyName", ")", "{", "if", "(", "propertyName", "==", "null", "||", "propertyName", ".", "length", "(", ")", "==", "0", ")", "{", "// shouldn't get here", "return", "prefix", "...
Utility method to derive a setter/getter method name from a property name, where the prefix is typically "set" or "get" and the first letter of the property name is capitalized. @param prefix The precursor to the method name, before the property name begins, typically "set" or "get". @param propertyName The name of the property that represents the bulk of the method name after the prefix. The first letter of this word will be capitalized in the resulting method name. @return String the property name converted to a method name according to the conventions specified above.
[ "Utility", "method", "to", "derive", "a", "setter", "/", "getter", "method", "name", "from", "a", "property", "name", "where", "the", "prefix", "is", "typically", "set", "or", "get", "and", "the", "first", "letter", "of", "the", "property", "name", "is", ...
train
https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/PropertyValuesHolder.java#L743-L751
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java
ExtendedPropertyUrl.updateExtendedPropertiesUrl
public static MozuUrl updateExtendedPropertiesUrl(String orderId, String updateMode, Boolean upsert, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/extendedproperties?updatemode={updateMode}&version={version}&upsert={upsert}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("updateMode", updateMode); formatter.formatUrl("upsert", upsert); formatter.formatUrl("version", version); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl updateExtendedPropertiesUrl(String orderId, String updateMode, Boolean upsert, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/extendedproperties?updatemode={updateMode}&version={version}&upsert={upsert}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("updateMode", updateMode); formatter.formatUrl("upsert", upsert); formatter.formatUrl("version", version); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
[ "public", "static", "MozuUrl", "updateExtendedPropertiesUrl", "(", "String", "orderId", ",", "String", "updateMode", ",", "Boolean", "upsert", ",", "String", "version", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/orders/{or...
Get Resource Url for UpdateExtendedProperties @param orderId Unique identifier of the order. @param updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order changes before committing the changes to the original order. Valid values are "ApplyToOriginal," "ApplyToDraft," or "ApplyAndCommit." @param upsert Inserts and updates the extended property. @param version Determines whether or not to check versioning of items for concurrency purposes. @return String Resource Url
[ "Get", "Resource", "Url", "for", "UpdateExtendedProperties", "@param", "orderId", "Unique", "identifier", "of", "the", "order", ".", "@param", "updateMode", "Specifies", "whether", "to", "update", "the", "original", "order", "update", "the", "order", "in", "draft"...
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java#L78-L86
hsiafan/apk-parser
src/main/java/net/dongliu/apk/parser/parser/DexParser.java
DexParser.readStrings
private StringPool readStrings(long[] offsets) { // read strings. // buffer some apk, the strings' offsets may not well ordered. we sort it first StringPoolEntry[] entries = new StringPoolEntry[offsets.length]; for (int i = 0; i < offsets.length; i++) { entries[i] = new StringPoolEntry(i, offsets[i]); } String lastStr = null; long lastOffset = -1; StringPool stringpool = new StringPool(offsets.length); for (StringPoolEntry entry : entries) { if (entry.getOffset() == lastOffset) { stringpool.set(entry.getIdx(), lastStr); continue; } Buffers.position(buffer, entry.getOffset()); lastOffset = entry.getOffset(); String str = readString(); lastStr = str; stringpool.set(entry.getIdx(), str); } return stringpool; }
java
private StringPool readStrings(long[] offsets) { // read strings. // buffer some apk, the strings' offsets may not well ordered. we sort it first StringPoolEntry[] entries = new StringPoolEntry[offsets.length]; for (int i = 0; i < offsets.length; i++) { entries[i] = new StringPoolEntry(i, offsets[i]); } String lastStr = null; long lastOffset = -1; StringPool stringpool = new StringPool(offsets.length); for (StringPoolEntry entry : entries) { if (entry.getOffset() == lastOffset) { stringpool.set(entry.getIdx(), lastStr); continue; } Buffers.position(buffer, entry.getOffset()); lastOffset = entry.getOffset(); String str = readString(); lastStr = str; stringpool.set(entry.getIdx(), str); } return stringpool; }
[ "private", "StringPool", "readStrings", "(", "long", "[", "]", "offsets", ")", "{", "// read strings.", "// buffer some apk, the strings' offsets may not well ordered. we sort it first", "StringPoolEntry", "[", "]", "entries", "=", "new", "StringPoolEntry", "[", "offsets", ...
read string pool for dex file. dex file string pool diff a bit with binary xml file or resource table. @param offsets @return @throws IOException
[ "read", "string", "pool", "for", "dex", "file", ".", "dex", "file", "string", "pool", "diff", "a", "bit", "with", "binary", "xml", "file", "or", "resource", "table", "." ]
train
https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/parser/DexParser.java#L129-L153
jparsec/jparsec
jparsec/src/main/java/org/jparsec/pattern/Patterns.java
Patterns.repeat
public static Pattern repeat(int n, CharPredicate predicate) { Checks.checkNonNegative(n, "n < 0"); return new RepeatCharPredicatePattern(n, predicate); }
java
public static Pattern repeat(int n, CharPredicate predicate) { Checks.checkNonNegative(n, "n < 0"); return new RepeatCharPredicatePattern(n, predicate); }
[ "public", "static", "Pattern", "repeat", "(", "int", "n", ",", "CharPredicate", "predicate", ")", "{", "Checks", ".", "checkNonNegative", "(", "n", ",", "\"n < 0\"", ")", ";", "return", "new", "RepeatCharPredicatePattern", "(", "n", ",", "predicate", ")", ";...
Returns a {@link Pattern} object that matches if the input has at least {@code n} characters and the first {@code n} characters all satisfy {@code predicate}.
[ "Returns", "a", "{" ]
train
https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L349-L352
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java
CPOptionPersistenceImpl.removeByC_ERC
@Override public CPOption removeByC_ERC(long companyId, String externalReferenceCode) throws NoSuchCPOptionException { CPOption cpOption = findByC_ERC(companyId, externalReferenceCode); return remove(cpOption); }
java
@Override public CPOption removeByC_ERC(long companyId, String externalReferenceCode) throws NoSuchCPOptionException { CPOption cpOption = findByC_ERC(companyId, externalReferenceCode); return remove(cpOption); }
[ "@", "Override", "public", "CPOption", "removeByC_ERC", "(", "long", "companyId", ",", "String", "externalReferenceCode", ")", "throws", "NoSuchCPOptionException", "{", "CPOption", "cpOption", "=", "findByC_ERC", "(", "companyId", ",", "externalReferenceCode", ")", ";...
Removes the cp option where companyId = &#63; and externalReferenceCode = &#63; from the database. @param companyId the company ID @param externalReferenceCode the external reference code @return the cp option that was removed
[ "Removes", "the", "cp", "option", "where", "companyId", "=", "&#63", ";", "and", "externalReferenceCode", "=", "&#63", ";", "from", "the", "database", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L2397-L2403
gitblit/fathom
fathom-x509/src/main/java/fathom/x509/X509Utils.java
X509Utils.prepareX509Infrastructure
public static void prepareX509Infrastructure(X509Metadata metadata, File serverKeyStore, File serverTrustStore) { prepareX509Infrastructure(metadata, serverKeyStore, serverTrustStore, message -> { }); }
java
public static void prepareX509Infrastructure(X509Metadata metadata, File serverKeyStore, File serverTrustStore) { prepareX509Infrastructure(metadata, serverKeyStore, serverTrustStore, message -> { }); }
[ "public", "static", "void", "prepareX509Infrastructure", "(", "X509Metadata", "metadata", ",", "File", "serverKeyStore", ",", "File", "serverTrustStore", ")", "{", "prepareX509Infrastructure", "(", "metadata", ",", "serverKeyStore", ",", "serverTrustStore", ",", "messag...
Prepare all the certificates and stores necessary for a Fathom server. @param metadata @param serverKeyStore @param serverTrustStore
[ "Prepare", "all", "the", "certificates", "and", "stores", "necessary", "for", "a", "Fathom", "server", "." ]
train
https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L247-L250
apache/incubator-gobblin
gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AsyncHttpJoinConverter.java
AsyncHttpJoinConverter.convertRecordAsync
@Override public final CompletableFuture<DO> convertRecordAsync(SO outputSchema, DI inputRecord, WorkUnitState workUnitState) throws DataConversionException { // Convert DI to HttpOperation HttpOperation operation = generateHttpOperation(inputRecord, workUnitState); BufferedRecord<GenericRecord> bufferedRecord = new BufferedRecord<>(operation, WriteCallback.EMPTY); // Convert HttpOperation to RQ Queue<BufferedRecord<GenericRecord>> buffer = new LinkedBlockingDeque<>(); buffer.add(bufferedRecord); AsyncRequest<GenericRecord, RQ> request = this.requestBuilder.buildRequest(buffer); RQ rawRequest = request.getRawRequest(); // Execute query and get response AsyncHttpJoinConverterContext context = new AsyncHttpJoinConverterContext(this, outputSchema, inputRecord, request); try { httpClient.sendAsyncRequest(rawRequest, context.getCallback()); } catch (IOException e) { throw new DataConversionException(e); } return context.future; }
java
@Override public final CompletableFuture<DO> convertRecordAsync(SO outputSchema, DI inputRecord, WorkUnitState workUnitState) throws DataConversionException { // Convert DI to HttpOperation HttpOperation operation = generateHttpOperation(inputRecord, workUnitState); BufferedRecord<GenericRecord> bufferedRecord = new BufferedRecord<>(operation, WriteCallback.EMPTY); // Convert HttpOperation to RQ Queue<BufferedRecord<GenericRecord>> buffer = new LinkedBlockingDeque<>(); buffer.add(bufferedRecord); AsyncRequest<GenericRecord, RQ> request = this.requestBuilder.buildRequest(buffer); RQ rawRequest = request.getRawRequest(); // Execute query and get response AsyncHttpJoinConverterContext context = new AsyncHttpJoinConverterContext(this, outputSchema, inputRecord, request); try { httpClient.sendAsyncRequest(rawRequest, context.getCallback()); } catch (IOException e) { throw new DataConversionException(e); } return context.future; }
[ "@", "Override", "public", "final", "CompletableFuture", "<", "DO", ">", "convertRecordAsync", "(", "SO", "outputSchema", ",", "DI", "inputRecord", ",", "WorkUnitState", "workUnitState", ")", "throws", "DataConversionException", "{", "// Convert DI to HttpOperation", "H...
Convert an input record to a future object where an output record will be filled in sometime later Sequence: Convert input (DI) to an http request Send http request asynchronously, and registers an http callback Create an {@link CompletableFuture} object. When the callback is invoked, this future object is filled in by an output record which is converted from http response. Return the future object.
[ "Convert", "an", "input", "record", "to", "a", "future", "object", "where", "an", "output", "record", "will", "be", "filled", "in", "sometime", "later", "Sequence", ":", "Convert", "input", "(", "DI", ")", "to", "an", "http", "request", "Send", "http", "...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AsyncHttpJoinConverter.java#L169-L193
unbescape/unbescape
src/main/java/org/unbescape/css/CssEscape.java
CssEscape.escapeCssStringMinimal
public static void escapeCssStringMinimal(final Reader reader, final Writer writer) throws IOException { escapeCssString(reader, writer, CssStringEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA, CssStringEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET); }
java
public static void escapeCssStringMinimal(final Reader reader, final Writer writer) throws IOException { escapeCssString(reader, writer, CssStringEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA, CssStringEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET); }
[ "public", "static", "void", "escapeCssStringMinimal", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "escapeCssString", "(", "reader", ",", "writer", ",", "CssStringEscapeType", ".", "BACKSLASH_ESCAPES_DEFAULT_TO...
<p> Perform a CSS String level 1 (only basic set) <strong>escape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> <em>Level 1</em> means this method will only escape the CSS String basic escape set: </p> <ul> <li>The <em>Backslash Escapes</em>: <tt>&#92;&quot;</tt> (<tt>U+0022</tt>) and <tt>&#92;&#39;</tt> (<tt>U+0027</tt>). </li> <li> Two ranges of non-displayable, control characters: <tt>U+0000</tt> to <tt>U+001F</tt> and <tt>U+007F</tt> to <tt>U+009F</tt>. </li> </ul> <p> This escape will be performed by using Backslash escapes whenever possible. For escaped characters that do not have an associated Backslash, default to <tt>&#92;FF </tt> Hexadecimal Escapes. </p> <p> This method calls {@link #escapeCssString(Reader, Writer, CssStringEscapeType, CssStringEscapeLevel)} with the following preconfigured values: </p> <ul> <li><tt>type</tt>: {@link CssStringEscapeType#BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA}</li> <li><tt>level</tt>: {@link CssStringEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}</li> </ul> <p> This method is <strong>thread-safe</strong>. </p> @param reader the <tt>Reader</tt> reading the text to be escaped. @param writer the <tt>java.io.Writer</tt> to which the escaped result will be written. Nothing will be written at all to this writer if input is <tt>null</tt>. @throws IOException if an input/output exception occurs @since 1.1.2
[ "<p", ">", "Perform", "a", "CSS", "String", "level", "1", "(", "only", "basic", "set", ")", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt",...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L505-L510
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/event/DefaultEntryEventFilteringStrategy.java
DefaultEntryEventFilteringStrategy.processQueryEventFilter
private boolean processQueryEventFilter(EventFilter filter, EntryEventType eventType, Data dataKey, Object oldValue, Object dataValue, String mapNameOrNull) { Object testValue; if (eventType == REMOVED || eventType == EVICTED || eventType == EXPIRED) { testValue = oldValue; } else { testValue = dataValue; } return evaluateQueryEventFilter(filter, dataKey, testValue, mapNameOrNull); }
java
private boolean processQueryEventFilter(EventFilter filter, EntryEventType eventType, Data dataKey, Object oldValue, Object dataValue, String mapNameOrNull) { Object testValue; if (eventType == REMOVED || eventType == EVICTED || eventType == EXPIRED) { testValue = oldValue; } else { testValue = dataValue; } return evaluateQueryEventFilter(filter, dataKey, testValue, mapNameOrNull); }
[ "private", "boolean", "processQueryEventFilter", "(", "EventFilter", "filter", ",", "EntryEventType", "eventType", ",", "Data", "dataKey", ",", "Object", "oldValue", ",", "Object", "dataValue", ",", "String", "mapNameOrNull", ")", "{", "Object", "testValue", ";", ...
Evaluate if the filter matches the map event. In case of a remove, evict or expire event the old value will be used for evaluation, otherwise we use the new value. The filter must be of {@link QueryEventFilter} type. @param filter a {@link QueryEventFilter} filter @param eventType the event type @param dataKey the entry key @param oldValue the entry value before the event @param dataValue the entry value after the event @param mapNameOrNull the map name. May be null if this is not a map event (e.g. cache event) @return {@code true} if the entry matches the query event filter
[ "Evaluate", "if", "the", "filter", "matches", "the", "map", "event", ".", "In", "case", "of", "a", "remove", "evict", "or", "expire", "event", "the", "old", "value", "will", "be", "used", "for", "evaluation", "otherwise", "we", "use", "the", "new", "valu...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/event/DefaultEntryEventFilteringStrategy.java#L117-L127
bmwcarit/joynr
java/messaging/bounceproxy-controller-service/src/main/java/io/joynr/messaging/info/PerformanceMeasures.java
PerformanceMeasures.addMeasures
public void addMeasures(Map<String, Integer> valueMap) { for (Entry<String, Integer> values : valueMap.entrySet()) { try { addMeasure(values.getKey(), values.getValue().intValue()); } catch (NumberFormatException e) { // TODO for now, we ignore malformed performance // measures } } }
java
public void addMeasures(Map<String, Integer> valueMap) { for (Entry<String, Integer> values : valueMap.entrySet()) { try { addMeasure(values.getKey(), values.getValue().intValue()); } catch (NumberFormatException e) { // TODO for now, we ignore malformed performance // measures } } }
[ "public", "void", "addMeasures", "(", "Map", "<", "String", ",", "Integer", ">", "valueMap", ")", "{", "for", "(", "Entry", "<", "String", ",", "Integer", ">", "values", ":", "valueMap", ".", "entrySet", "(", ")", ")", "{", "try", "{", "addMeasure", ...
Adds measures from a map with keys and integer values. If a key can't be mapped to a known {@link Key}, the value is ignored without any warning. @param valueMap the measures to be added as a Map of string-integer key-value pairs
[ "Adds", "measures", "from", "a", "map", "with", "keys", "and", "integer", "values", ".", "If", "a", "key", "can", "t", "be", "mapped", "to", "a", "known", "{", "@link", "Key", "}", "the", "value", "is", "ignored", "without", "any", "warning", "." ]
train
https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy-controller-service/src/main/java/io/joynr/messaging/info/PerformanceMeasures.java#L91-L103
Azure/azure-sdk-for-java
resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java
ResourcesInner.moveResourcesAsync
public Observable<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
java
public Observable<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Void", ">", "moveResourcesAsync", "(", "String", "sourceResourceGroupName", ",", "ResourcesMoveInfo", "parameters", ")", "{", "return", "moveResourcesWithServiceResponseAsync", "(", "sourceResourceGroupName", ",", "parameters", ")", ".", "map...
Moves resources from one resource group to another resource group. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and delete operations are blocked on the groups until the move completes. @param sourceResourceGroupName The name of the resource group containing the resources to move. @param parameters Parameters for moving resources. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "Moves", "resources", "from", "one", "resource", "group", "to", "another", "resource", "group", ".", "The", "resources", "to", "move", "must", "be", "in", "the", "same", "source", "resource", "group", ".", "The", "target", "resource", "group", "may", "be", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L445-L452
lessthanoptimal/BoofCV
examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java
ExampleFundamentalMatrix.simpleFundamental
public static DMatrixRMaj simpleFundamental( List<AssociatedPair> matches ) { // Use the 8-point algorithm since it will work with an arbitrary number of points Estimate1ofEpipolar estimateF = FactoryMultiView.fundamental_1(EnumFundamental.LINEAR_8, 0); DMatrixRMaj F = new DMatrixRMaj(3,3); if( !estimateF.process(matches,F) ) throw new IllegalArgumentException("Failed"); // while not done here, this initial linear estimate can be refined using non-linear optimization // as was done above. return F; }
java
public static DMatrixRMaj simpleFundamental( List<AssociatedPair> matches ) { // Use the 8-point algorithm since it will work with an arbitrary number of points Estimate1ofEpipolar estimateF = FactoryMultiView.fundamental_1(EnumFundamental.LINEAR_8, 0); DMatrixRMaj F = new DMatrixRMaj(3,3); if( !estimateF.process(matches,F) ) throw new IllegalArgumentException("Failed"); // while not done here, this initial linear estimate can be refined using non-linear optimization // as was done above. return F; }
[ "public", "static", "DMatrixRMaj", "simpleFundamental", "(", "List", "<", "AssociatedPair", ">", "matches", ")", "{", "// Use the 8-point algorithm since it will work with an arbitrary number of points", "Estimate1ofEpipolar", "estimateF", "=", "FactoryMultiView", ".", "fundament...
If the set of associated features are known to be correct, then the fundamental matrix can be computed directly with a lot less code. The down side is that this technique is very sensitive to noise.
[ "If", "the", "set", "of", "associated", "features", "are", "known", "to", "be", "correct", "then", "the", "fundamental", "matrix", "can", "be", "computed", "directly", "with", "a", "lot", "less", "code", ".", "The", "down", "side", "is", "that", "this", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java#L114-L125
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.updateCertificateIssuer
public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).toBlocking().single().body(); }
java
public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) { return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, organizationDetails, attributes).toBlocking().single().body(); }
[ "public", "IssuerBundle", "updateCertificateIssuer", "(", "String", "vaultBaseUrl", ",", "String", "issuerName", ",", "String", "provider", ",", "IssuerCredentials", "credentials", ",", "OrganizationDetails", "organizationDetails", ",", "IssuerAttributes", "attributes", ")"...
Updates the specified certificate issuer. The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param issuerName The name of the issuer. @param provider The issuer provider. @param credentials The credentials to be used for the issuer. @param organizationDetails Details of the organization as provided to the issuer. @param attributes Attributes of the issuer object. @throws IllegalArgumentException thrown if parameters fail the validation @throws KeyVaultErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the IssuerBundle object if successful.
[ "Updates", "the", "specified", "certificate", "issuer", ".", "The", "UpdateCertificateIssuer", "operation", "performs", "an", "update", "on", "the", "specified", "certificate", "issuer", "entity", ".", "This", "operation", "requires", "the", "certificates", "/", "se...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6204-L6206
ulisesbocchio/spring-boot-security-saml
spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/configurer/builder/KeyManagerConfigurer.java
KeyManagerConfigurer.keyPassword
public KeyManagerConfigurer keyPassword(String key, String password) { if (keyPasswords == null) { keyPasswords = new HashMap<>(); } keyPasswords.put(key, password); return this; }
java
public KeyManagerConfigurer keyPassword(String key, String password) { if (keyPasswords == null) { keyPasswords = new HashMap<>(); } keyPasswords.put(key, password); return this; }
[ "public", "KeyManagerConfigurer", "keyPassword", "(", "String", "key", ",", "String", "password", ")", "{", "if", "(", "keyPasswords", "==", "null", ")", "{", "keyPasswords", "=", "new", "HashMap", "<>", "(", ")", ";", "}", "keyPasswords", ".", "put", "(",...
Alternative to {@link #keyPasswords} when only 1 (one) key is present in the {@link KeyStore}. <p> Alternatively use property: <pre> saml.sso.key-manager.key-passwords </pre> </p> @param key the key name. @param password the key password. @return this configurer for further customization
[ "Alternative", "to", "{", "@link", "#keyPasswords", "}", "when", "only", "1", "(", "one", ")", "key", "is", "present", "in", "the", "{", "@link", "KeyStore", "}", ".", "<p", ">", "Alternatively", "use", "property", ":", "<pre", ">", "saml", ".", "sso",...
train
https://github.com/ulisesbocchio/spring-boot-security-saml/blob/63596fe9b4b5504053392b9ee9a925b9a77644d4/spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/configurer/builder/KeyManagerConfigurer.java#L231-L237
GoogleCloudPlatform/app-maven-plugin
src/main/java/com/google/cloud/tools/maven/cloudsdk/CloudSdkChecker.java
CloudSdkChecker.checkCloudSdk
public void checkCloudSdk(CloudSdk cloudSdk, String version) throws CloudSdkVersionFileException, CloudSdkNotFoundException, CloudSdkOutOfDateException { if (!version.equals(cloudSdk.getVersion().toString())) { throw new RuntimeException( "Specified Cloud SDK version (" + version + ") does not match installed version (" + cloudSdk.getVersion() + ")."); } cloudSdk.validateCloudSdk(); }
java
public void checkCloudSdk(CloudSdk cloudSdk, String version) throws CloudSdkVersionFileException, CloudSdkNotFoundException, CloudSdkOutOfDateException { if (!version.equals(cloudSdk.getVersion().toString())) { throw new RuntimeException( "Specified Cloud SDK version (" + version + ") does not match installed version (" + cloudSdk.getVersion() + ")."); } cloudSdk.validateCloudSdk(); }
[ "public", "void", "checkCloudSdk", "(", "CloudSdk", "cloudSdk", ",", "String", "version", ")", "throws", "CloudSdkVersionFileException", ",", "CloudSdkNotFoundException", ",", "CloudSdkOutOfDateException", "{", "if", "(", "!", "version", ".", "equals", "(", "cloudSdk"...
Validates the cloud SDK installation @param cloudSdk CloudSdk with a configured sdk home directory
[ "Validates", "the", "cloud", "SDK", "installation" ]
train
https://github.com/GoogleCloudPlatform/app-maven-plugin/blob/1f31bb8e963ce189e9ed6b88923a1853533485ff/src/main/java/com/google/cloud/tools/maven/cloudsdk/CloudSdkChecker.java#L32-L44
jayantk/jklol
src/com/jayantkrish/jklol/ccg/chart/CcgLeftToRightChart.java
CcgLeftToRightChart.offerEntry
private final void offerEntry(ChartEntry entry, double probability, int spanStart, int spanEnd) { int nextEntryIndex = chartSizes[spanStart][spanEnd]; if (nextEntryIndex == chart[spanStart][spanEnd].length) { // Resize the arrays to fit the new entry. ChartEntry[] spanChart = chart[spanStart][spanEnd]; double[] spanProbs = probabilities[spanStart][spanEnd]; chart[spanStart][spanEnd] = Arrays.copyOf(spanChart, spanChart.length * 2); probabilities[spanStart][spanEnd] = Arrays.copyOf(spanProbs, spanChart.length * 2); } chart[spanStart][spanEnd][nextEntryIndex] = entry; probabilities[spanStart][spanEnd][nextEntryIndex] = probability; chartSizes[spanStart][spanEnd]++; totalChartSize++; }
java
private final void offerEntry(ChartEntry entry, double probability, int spanStart, int spanEnd) { int nextEntryIndex = chartSizes[spanStart][spanEnd]; if (nextEntryIndex == chart[spanStart][spanEnd].length) { // Resize the arrays to fit the new entry. ChartEntry[] spanChart = chart[spanStart][spanEnd]; double[] spanProbs = probabilities[spanStart][spanEnd]; chart[spanStart][spanEnd] = Arrays.copyOf(spanChart, spanChart.length * 2); probabilities[spanStart][spanEnd] = Arrays.copyOf(spanProbs, spanChart.length * 2); } chart[spanStart][spanEnd][nextEntryIndex] = entry; probabilities[spanStart][spanEnd][nextEntryIndex] = probability; chartSizes[spanStart][spanEnd]++; totalChartSize++; }
[ "private", "final", "void", "offerEntry", "(", "ChartEntry", "entry", ",", "double", "probability", ",", "int", "spanStart", ",", "int", "spanEnd", ")", "{", "int", "nextEntryIndex", "=", "chartSizes", "[", "spanStart", "]", "[", "spanEnd", "]", ";", "if", ...
Adds a chart entry to the heap for {@code spanStart} to {@code spanEnd}. This operation preserves existing chart entry indexes and automatically resizes any arrays to fit the new entry.
[ "Adds", "a", "chart", "entry", "to", "the", "heap", "for", "{" ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/chart/CcgLeftToRightChart.java#L201-L215
jenkinsci/jenkins
core/src/main/java/hudson/util/FormValidation.java
FormValidation.validateBase64
public static FormValidation validateBase64(String value, boolean allowWhitespace, boolean allowEmpty, String errorMessage) { try { String v = value; if(!allowWhitespace) { if(v.indexOf(' ')>=0 || v.indexOf('\n')>=0) return error(errorMessage); } v=v.trim(); if(!allowEmpty && v.length()==0) return error(errorMessage); Base64.getDecoder().decode(v.getBytes(StandardCharsets.UTF_8)); return ok(); } catch (IllegalArgumentException e) { return error(errorMessage); } }
java
public static FormValidation validateBase64(String value, boolean allowWhitespace, boolean allowEmpty, String errorMessage) { try { String v = value; if(!allowWhitespace) { if(v.indexOf(' ')>=0 || v.indexOf('\n')>=0) return error(errorMessage); } v=v.trim(); if(!allowEmpty && v.length()==0) return error(errorMessage); Base64.getDecoder().decode(v.getBytes(StandardCharsets.UTF_8)); return ok(); } catch (IllegalArgumentException e) { return error(errorMessage); } }
[ "public", "static", "FormValidation", "validateBase64", "(", "String", "value", ",", "boolean", "allowWhitespace", ",", "boolean", "allowEmpty", ",", "String", "errorMessage", ")", "{", "try", "{", "String", "v", "=", "value", ";", "if", "(", "!", "allowWhites...
Makes sure that the given string is a base64 encoded text. @param allowWhitespace if you allow whitespace (CR,LF,etc) in base64 encoding @param allowEmpty Is empty string allowed? @param errorMessage Error message. @since 1.305
[ "Makes", "sure", "that", "the", "given", "string", "is", "a", "base64", "encoded", "text", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L455-L471
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
FSDataset.getValidateBlockFile
File getValidateBlockFile(int namespaceId, Block b, boolean checkSize) throws IOException { //Should we check for metadata file too? DatanodeBlockInfo blockInfo = this.getDatanodeBlockInfo(namespaceId, b); File f = null; if (blockInfo != null) { if (checkSize) { blockInfo.verifyFinalizedSize(); } f = blockInfo.getBlockDataFile().getFile(); assert f != null; if(f.exists()) { return f; } // if file is not null, but doesn't exist - possibly disk failed datanode.checkDiskError(); } if (InterDatanodeProtocol.LOG.isDebugEnabled()) { InterDatanodeProtocol.LOG.debug("b=" + b + ", f=" + ((f == null) ? "null" : f)); } return null; }
java
File getValidateBlockFile(int namespaceId, Block b, boolean checkSize) throws IOException { //Should we check for metadata file too? DatanodeBlockInfo blockInfo = this.getDatanodeBlockInfo(namespaceId, b); File f = null; if (blockInfo != null) { if (checkSize) { blockInfo.verifyFinalizedSize(); } f = blockInfo.getBlockDataFile().getFile(); assert f != null; if(f.exists()) { return f; } // if file is not null, but doesn't exist - possibly disk failed datanode.checkDiskError(); } if (InterDatanodeProtocol.LOG.isDebugEnabled()) { InterDatanodeProtocol.LOG.debug("b=" + b + ", f=" + ((f == null) ? "null" : f)); } return null; }
[ "File", "getValidateBlockFile", "(", "int", "namespaceId", ",", "Block", "b", ",", "boolean", "checkSize", ")", "throws", "IOException", "{", "//Should we check for metadata file too?", "DatanodeBlockInfo", "blockInfo", "=", "this", ".", "getDatanodeBlockInfo", "(", "na...
Find the file corresponding to the block and return it if it exists.
[ "Find", "the", "file", "corresponding", "to", "the", "block", "and", "return", "it", "if", "it", "exists", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java#L2543-L2568
b3log/latke
latke-core/src/main/java/org/b3log/latke/plugin/PluginManager.java
PluginManager.registerEventListeners
private void registerEventListeners(final Properties props, final URLClassLoader classLoader, final AbstractPlugin plugin) throws Exception { final String eventListenerClasses = props.getProperty(Plugin.PLUGIN_EVENT_LISTENER_CLASSES); final String[] eventListenerClassArray = eventListenerClasses.split(","); for (final String eventListenerClassName : eventListenerClassArray) { if (StringUtils.isBlank(eventListenerClassName)) { LOGGER.log(Level.INFO, "No event listener to load for plugin[name={0}]", plugin.getName()); return; } LOGGER.log(Level.DEBUG, "Loading event listener[className={0}]", eventListenerClassName); final Class<?> eventListenerClass = classLoader.loadClass(eventListenerClassName); final AbstractEventListener<?> eventListener = (AbstractEventListener) eventListenerClass.newInstance(); plugin.addEventListener(eventListener); LOGGER.log(Level.DEBUG, "Registered event listener[class={0}, eventType={1}] for plugin[name={2}]", eventListener.getClass(), eventListener.getEventType(), plugin.getName()); } }
java
private void registerEventListeners(final Properties props, final URLClassLoader classLoader, final AbstractPlugin plugin) throws Exception { final String eventListenerClasses = props.getProperty(Plugin.PLUGIN_EVENT_LISTENER_CLASSES); final String[] eventListenerClassArray = eventListenerClasses.split(","); for (final String eventListenerClassName : eventListenerClassArray) { if (StringUtils.isBlank(eventListenerClassName)) { LOGGER.log(Level.INFO, "No event listener to load for plugin[name={0}]", plugin.getName()); return; } LOGGER.log(Level.DEBUG, "Loading event listener[className={0}]", eventListenerClassName); final Class<?> eventListenerClass = classLoader.loadClass(eventListenerClassName); final AbstractEventListener<?> eventListener = (AbstractEventListener) eventListenerClass.newInstance(); plugin.addEventListener(eventListener); LOGGER.log(Level.DEBUG, "Registered event listener[class={0}, eventType={1}] for plugin[name={2}]", eventListener.getClass(), eventListener.getEventType(), plugin.getName()); } }
[ "private", "void", "registerEventListeners", "(", "final", "Properties", "props", ",", "final", "URLClassLoader", "classLoader", ",", "final", "AbstractPlugin", "plugin", ")", "throws", "Exception", "{", "final", "String", "eventListenerClasses", "=", "props", ".", ...
Registers event listeners with the specified plugin properties, class loader and plugin. @param props the specified plugin properties @param classLoader the specified class loader @param plugin the specified plugin @throws Exception exception
[ "Registers", "event", "listeners", "with", "the", "specified", "plugin", "properties", "class", "loader", "and", "plugin", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/plugin/PluginManager.java#L292-L313
googleapis/google-cloud-java
google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java
BlobInfo.newBuilder
public static Builder newBuilder(BucketInfo bucketInfo, String name, Long generation) { return newBuilder(bucketInfo.getName(), name, generation); }
java
public static Builder newBuilder(BucketInfo bucketInfo, String name, Long generation) { return newBuilder(bucketInfo.getName(), name, generation); }
[ "public", "static", "Builder", "newBuilder", "(", "BucketInfo", "bucketInfo", ",", "String", "name", ",", "Long", "generation", ")", "{", "return", "newBuilder", "(", "bucketInfo", ".", "getName", "(", ")", ",", "name", ",", "generation", ")", ";", "}" ]
Returns a {@code BlobInfo} builder where blob identity is set using the provided values.
[ "Returns", "a", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java#L1014-L1016
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/access/AccessControlList.java
AccessControlList.addPermissions
public void addPermissions(String identity, String[] perm) throws RepositoryException { for (String p : perm) { accessList.add(new AccessControlEntry(identity, p)); } }
java
public void addPermissions(String identity, String[] perm) throws RepositoryException { for (String p : perm) { accessList.add(new AccessControlEntry(identity, p)); } }
[ "public", "void", "addPermissions", "(", "String", "identity", ",", "String", "[", "]", "perm", ")", "throws", "RepositoryException", "{", "for", "(", "String", "p", ":", "perm", ")", "{", "accessList", ".", "add", "(", "new", "AccessControlEntry", "(", "i...
Adds a set of permission types to a given identity @param identity the member identity @param perm an array of permission types to add
[ "Adds", "a", "set", "of", "permission", "types", "to", "a", "given", "identity" ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/access/AccessControlList.java#L131-L137