repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
194
func_name
stringlengths
6
111
whole_func_string
stringlengths
80
3.8k
language
stringclasses
1 value
func_code_string
stringlengths
80
3.8k
func_code_tokens
listlengths
20
697
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
434
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
linkedin/dexmaker
dexmaker/src/main/java/com/android/dx/Code.java
Code.addCatchClause
public void addCatchClause(TypeId<? extends Throwable> toCatch, Label catchClause) { if (catchTypes.contains(toCatch)) { throw new IllegalArgumentException("Already caught: " + toCatch); } adopt(catchClause); catchTypes.add(toCatch); catches = toTypeList(catchTypes); catchLabels.add(catchClause); }
java
public void addCatchClause(TypeId<? extends Throwable> toCatch, Label catchClause) { if (catchTypes.contains(toCatch)) { throw new IllegalArgumentException("Already caught: " + toCatch); } adopt(catchClause); catchTypes.add(toCatch); catches = toTypeList(catchTypes); catchLabels.add(catchClause); }
[ "public", "void", "addCatchClause", "(", "TypeId", "<", "?", "extends", "Throwable", ">", "toCatch", ",", "Label", "catchClause", ")", "{", "if", "(", "catchTypes", ".", "contains", "(", "toCatch", ")", ")", "{", "throw", "new", "IllegalArgumentException", "...
Registers {@code catchClause} as a branch target for all instructions in this frame that throw a class assignable to {@code toCatch}. This includes methods invoked from this frame. Deregister the clause using {@link #removeCatchClause removeCatchClause()}. It is an error to register a catch clause without also {@link #mark marking it} in the same {@code Code} instance.
[ "Registers", "{" ]
train
https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L363-L371
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/util/url/AggressiveUrlCanonicalizer.java
AggressiveUrlCanonicalizer.doStripRegexMatch
protected boolean doStripRegexMatch(StringBuilder url, Matcher matcher) { if(matcher != null && matcher.matches()) { url.delete(matcher.start(1), matcher.end(1)); return true; } return false; }
java
protected boolean doStripRegexMatch(StringBuilder url, Matcher matcher) { if(matcher != null && matcher.matches()) { url.delete(matcher.start(1), matcher.end(1)); return true; } return false; }
[ "protected", "boolean", "doStripRegexMatch", "(", "StringBuilder", "url", ",", "Matcher", "matcher", ")", "{", "if", "(", "matcher", "!=", "null", "&&", "matcher", ".", "matches", "(", ")", ")", "{", "url", ".", "delete", "(", "matcher", ".", "start", "(...
Run a regex against a StringBuilder, removing group 1 if it matches. Assumes the regex has a form that wants to strip elements of the passed string. Assumes that if a match, group 1 should be removed @param url Url to search in. @param matcher Matcher whose form yields a group to remove @return true if the StringBuilder was modified
[ "Run", "a", "regex", "against", "a", "StringBuilder", "removing", "group", "1", "if", "it", "matches", "." ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/url/AggressiveUrlCanonicalizer.java#L199-L205
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
Node.getSubscriptionOptions
public SubscribeForm getSubscriptionOptions(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getSubscriptionOptions(jid, null); }
java
public SubscribeForm getSubscriptionOptions(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getSubscriptionOptions(jid, null); }
[ "public", "SubscribeForm", "getSubscriptionOptions", "(", "String", "jid", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "return", "getSubscriptionOptions", "(", "jid", ",", "null", ")", ...
Returns a SubscribeForm for subscriptions, from which you can create an answer form to be submitted via the {@link #sendConfigurationForm(Form)}. @param jid @return A subscription options form @throws XMPPErrorException @throws NoResponseException @throws NotConnectedException @throws InterruptedException
[ "Returns", "a", "SubscribeForm", "for", "subscriptions", "from", "which", "you", "can", "create", "an", "answer", "form", "to", "be", "submitted", "via", "the", "{", "@link", "#sendConfigurationForm", "(", "Form", ")", "}", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L466-L468
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java
CudaAffinityManager.replicateToDevice
@Override public DataBuffer replicateToDevice(Integer deviceId, DataBuffer buffer) { if (buffer == null) return null; int currentDeviceId = AtomicAllocator.getInstance().getDeviceId(); if (currentDeviceId != deviceId) { Nd4j.getMemoryManager().releaseCurrentContext(); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(deviceId); Nd4j.getAffinityManager().attachThreadToDevice(Thread.currentThread().getId(), deviceId); } DataBuffer dstBuffer = Nd4j.createBuffer(buffer.dataType(), buffer.length(), false); AtomicAllocator.getInstance().memcpy(dstBuffer, buffer); if (currentDeviceId != deviceId) { Nd4j.getMemoryManager().releaseCurrentContext(); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(currentDeviceId); Nd4j.getAffinityManager().attachThreadToDevice(Thread.currentThread().getId(), currentDeviceId); } return dstBuffer; }
java
@Override public DataBuffer replicateToDevice(Integer deviceId, DataBuffer buffer) { if (buffer == null) return null; int currentDeviceId = AtomicAllocator.getInstance().getDeviceId(); if (currentDeviceId != deviceId) { Nd4j.getMemoryManager().releaseCurrentContext(); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(deviceId); Nd4j.getAffinityManager().attachThreadToDevice(Thread.currentThread().getId(), deviceId); } DataBuffer dstBuffer = Nd4j.createBuffer(buffer.dataType(), buffer.length(), false); AtomicAllocator.getInstance().memcpy(dstBuffer, buffer); if (currentDeviceId != deviceId) { Nd4j.getMemoryManager().releaseCurrentContext(); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(currentDeviceId); Nd4j.getAffinityManager().attachThreadToDevice(Thread.currentThread().getId(), currentDeviceId); } return dstBuffer; }
[ "@", "Override", "public", "DataBuffer", "replicateToDevice", "(", "Integer", "deviceId", ",", "DataBuffer", "buffer", ")", "{", "if", "(", "buffer", "==", "null", ")", "return", "null", ";", "int", "currentDeviceId", "=", "AtomicAllocator", ".", "getInstance", ...
This method replicates given DataBuffer, and places it to target device. @param deviceId target deviceId @param buffer @return
[ "This", "method", "replicates", "given", "DataBuffer", "and", "places", "it", "to", "target", "device", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java#L309-L331
box/box-java-sdk
src/main/java/com/box/sdk/BoxGroup.java
BoxGroup.getAllGroups
public static Iterable<BoxGroup.Info> getAllGroups(final BoxAPIConnection api, String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxGroup.Info>() { public Iterator<BoxGroup.Info> iterator() { URL url = GROUPS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString()); return new BoxGroupIterator(api, url); } }; }
java
public static Iterable<BoxGroup.Info> getAllGroups(final BoxAPIConnection api, String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxGroup.Info>() { public Iterator<BoxGroup.Info> iterator() { URL url = GROUPS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString()); return new BoxGroupIterator(api, url); } }; }
[ "public", "static", "Iterable", "<", "BoxGroup", ".", "Info", ">", "getAllGroups", "(", "final", "BoxAPIConnection", "api", ",", "String", "...", "fields", ")", "{", "final", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if...
Gets an iterable of all the groups in the enterprise. @param api the API connection to be used when retrieving the groups. @param fields the fields to retrieve. @return an iterable containing info about all the groups.
[ "Gets", "an", "iterable", "of", "all", "the", "groups", "in", "the", "enterprise", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L130-L141
gosu-lang/gosu-lang
gosu-core-api/src/main/java/gw/util/GosuObjectUtil.java
GosuObjectUtil.defaultIfNull
public static Object defaultIfNull(Object object, Object defaultValue) { return object != null ? object : defaultValue; }
java
public static Object defaultIfNull(Object object, Object defaultValue) { return object != null ? object : defaultValue; }
[ "public", "static", "Object", "defaultIfNull", "(", "Object", "object", ",", "Object", "defaultValue", ")", "{", "return", "object", "!=", "null", "?", "object", ":", "defaultValue", ";", "}" ]
<p>Returns a default value if the object passed is <code>null</code>.</p> <p/> <pre> ObjectUtils.defaultIfNull(null, null) = null ObjectUtils.defaultIfNull(null, "") = "" ObjectUtils.defaultIfNull(null, "zz") = "zz" ObjectUtils.defaultIfNull("abc", *) = "abc" ObjectUtils.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE </pre> @param object the <code>Object</code> to test, may be <code>null</code> @param defaultValue the default value to return, may be <code>null</code> @return <code>object</code> if it is not <code>null</code>, defaultValue otherwise
[ "<p", ">", "Returns", "a", "default", "value", "if", "the", "object", "passed", "is", "<code", ">", "null<", "/", "code", ">", ".", "<", "/", "p", ">", "<p", "/", ">", "<pre", ">", "ObjectUtils", ".", "defaultIfNull", "(", "null", "null", ")", "=",...
train
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuObjectUtil.java#L62-L64
wdullaer/SwipeActionAdapter
library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionTouchListener.java
SwipeActionTouchListener.makeScrollListener
public AbsListView.OnScrollListener makeScrollListener() { return new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView absListView, int scrollState) { setEnabled(scrollState != AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL); } @Override public void onScroll(AbsListView absListView, int i, int i1, int i2) { } }; }
java
public AbsListView.OnScrollListener makeScrollListener() { return new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView absListView, int scrollState) { setEnabled(scrollState != AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL); } @Override public void onScroll(AbsListView absListView, int i, int i1, int i2) { } }; }
[ "public", "AbsListView", ".", "OnScrollListener", "makeScrollListener", "(", ")", "{", "return", "new", "AbsListView", ".", "OnScrollListener", "(", ")", "{", "@", "Override", "public", "void", "onScrollStateChanged", "(", "AbsListView", "absListView", ",", "int", ...
Returns an {@link AbsListView.OnScrollListener} to be added to the {@link ListView} using {@link ListView#setOnScrollListener(AbsListView.OnScrollListener)}. If a scroll listener is already assigned, the caller should still pass scroll changes through to this listener. This will ensure that this {@link SwipeActionTouchListener} is paused during list view scrolling. @see SwipeActionTouchListener
[ "Returns", "an", "{", "@link", "AbsListView", ".", "OnScrollListener", "}", "to", "be", "added", "to", "the", "{", "@link", "ListView", "}", "using", "{", "@link", "ListView#setOnScrollListener", "(", "AbsListView", ".", "OnScrollListener", ")", "}", ".", "If"...
train
https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeActionTouchListener.java#L198-L209
rollbar/rollbar-java
rollbar-android/src/main/java/com/rollbar/android/Rollbar.java
Rollbar.log
public void log(String message, Level level) { log(null, null, message, level); }
java
public void log(String message, Level level) { log(null, null, message, level); }
[ "public", "void", "log", "(", "String", "message", ",", "Level", "level", ")", "{", "log", "(", "null", ",", "null", ",", "message", ",", "level", ")", ";", "}" ]
Record a message at the level specified. @param message the message. @param level the level.
[ "Record", "a", "message", "at", "the", "level", "specified", "." ]
train
https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L765-L767
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java
VirtualNetworkGatewaysInner.listConnectionsWithServiceResponseAsync
public Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>> listConnectionsWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { return listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName) .concatMap(new Func1<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>, Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>>>() { @Override public Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>> call(ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); } }); }
java
public Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>> listConnectionsWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkGatewayName) { return listConnectionsSinglePageAsync(resourceGroupName, virtualNetworkGatewayName) .concatMap(new Func1<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>, Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>>>() { @Override public Observable<ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>>> call(ServiceResponse<Page<VirtualNetworkGatewayConnectionListEntityInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listConnectionsNextWithServiceResponseAsync(nextPageLink)); } }); }
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "VirtualNetworkGatewayConnectionListEntityInner", ">", ">", ">", "listConnectionsWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "virtualNetworkGatewayName", ")",...
Gets all the connections in a virtual network gateway. @param resourceGroupName The name of the resource group. @param virtualNetworkGatewayName The name of the virtual network gateway. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;VirtualNetworkGatewayConnectionListEntityInner&gt; object
[ "Gets", "all", "the", "connections", "in", "a", "virtual", "network", "gateway", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1095-L1107
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTabRenderer.java
WTabRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WTab tab = (WTab) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:tab"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("class", component.getHtmlClass()); xml.appendOptionalAttribute("track", component.isTracking(), "true"); xml.appendOptionalAttribute("open", tab.isOpen(), "true"); xml.appendOptionalAttribute("disabled", tab.isDisabled(), "true"); xml.appendOptionalAttribute("hidden", tab.isHidden(), "true"); xml.appendOptionalAttribute("toolTip", tab.getToolTip()); switch (tab.getMode()) { case CLIENT: xml.appendAttribute("mode", "client"); break; case LAZY: xml.appendAttribute("mode", "lazy"); break; case EAGER: xml.appendAttribute("mode", "eager"); break; case DYNAMIC: xml.appendAttribute("mode", "dynamic"); break; case SERVER: xml.appendAttribute("mode", "server"); break; default: throw new SystemException("Unknown tab mode: " + tab.getMode()); } if (tab.getAccessKey() != 0) { xml.appendAttribute("accessKey", String.valueOf(Character. toUpperCase(tab.getAccessKey()))); } xml.appendClose(); // Paint label tab.getTabLabel().paint(renderContext); // Paint content WComponent content = tab.getContent(); xml.appendTagOpen("ui:tabcontent"); xml.appendAttribute("id", tab.getId() + "-content"); xml.appendClose(); // Render content if not EAGER Mode or is EAGER and is the current AJAX trigger if (content != null && (TabMode.EAGER != tab.getMode() || AjaxHelper.isCurrentAjaxTrigger( tab))) { // Visibility of content set in prepare paint content.paint(renderContext); } xml.appendEndTag("ui:tabcontent"); xml.appendEndTag("ui:tab"); }
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WTab tab = (WTab) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:tab"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("class", component.getHtmlClass()); xml.appendOptionalAttribute("track", component.isTracking(), "true"); xml.appendOptionalAttribute("open", tab.isOpen(), "true"); xml.appendOptionalAttribute("disabled", tab.isDisabled(), "true"); xml.appendOptionalAttribute("hidden", tab.isHidden(), "true"); xml.appendOptionalAttribute("toolTip", tab.getToolTip()); switch (tab.getMode()) { case CLIENT: xml.appendAttribute("mode", "client"); break; case LAZY: xml.appendAttribute("mode", "lazy"); break; case EAGER: xml.appendAttribute("mode", "eager"); break; case DYNAMIC: xml.appendAttribute("mode", "dynamic"); break; case SERVER: xml.appendAttribute("mode", "server"); break; default: throw new SystemException("Unknown tab mode: " + tab.getMode()); } if (tab.getAccessKey() != 0) { xml.appendAttribute("accessKey", String.valueOf(Character. toUpperCase(tab.getAccessKey()))); } xml.appendClose(); // Paint label tab.getTabLabel().paint(renderContext); // Paint content WComponent content = tab.getContent(); xml.appendTagOpen("ui:tabcontent"); xml.appendAttribute("id", tab.getId() + "-content"); xml.appendClose(); // Render content if not EAGER Mode or is EAGER and is the current AJAX trigger if (content != null && (TabMode.EAGER != tab.getMode() || AjaxHelper.isCurrentAjaxTrigger( tab))) { // Visibility of content set in prepare paint content.paint(renderContext); } xml.appendEndTag("ui:tabcontent"); xml.appendEndTag("ui:tab"); }
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WTab", "tab", "=", "(", "WTab", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContext", ".", ...
Paints the given WTab. @param component the WTab to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WTab", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTabRenderer.java#L26-L87
RallyTools/RallyRestToolkitForJava
src/main/java/com/rallydev/rest/client/BasicAuthClient.java
BasicAuthClient.doRequest
@Override protected String doRequest(HttpRequestBase request) throws IOException { if(!request.getMethod().equals(HttpGet.METHOD_NAME) && !this.getWsapiVersion().matches("^1[.]\\d+")) { try { attachSecurityInfo(request); } catch (URISyntaxException e) { throw new IOException("Unable to build URI with security token", e); } } return super.doRequest(request); }
java
@Override protected String doRequest(HttpRequestBase request) throws IOException { if(!request.getMethod().equals(HttpGet.METHOD_NAME) && !this.getWsapiVersion().matches("^1[.]\\d+")) { try { attachSecurityInfo(request); } catch (URISyntaxException e) { throw new IOException("Unable to build URI with security token", e); } } return super.doRequest(request); }
[ "@", "Override", "protected", "String", "doRequest", "(", "HttpRequestBase", "request", ")", "throws", "IOException", "{", "if", "(", "!", "request", ".", "getMethod", "(", ")", ".", "equals", "(", "HttpGet", ".", "METHOD_NAME", ")", "&&", "!", "this", "."...
Execute a request against the WSAPI @param request the request to be executed @return the JSON encoded string response @throws java.io.IOException if a non-200 response code is returned or if some other problem occurs while executing the request
[ "Execute", "a", "request", "against", "the", "WSAPI" ]
train
https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/BasicAuthClient.java#L46-L57
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/websphere/ssl/JSSEHelper.java
JSSEHelper.registerSSLConfigChangeListener
public void registerSSLConfigChangeListener(String sslAliasName, Map<String, Object> connectionInfo, SSLConfigChangeListener listener) throws SSLException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerSSLConfigChangeListener", new Object[] { sslAliasName, connectionInfo, listener }); getProperties(sslAliasName, connectionInfo, listener); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "registerSSLConfigChangeListener"); }
java
public void registerSSLConfigChangeListener(String sslAliasName, Map<String, Object> connectionInfo, SSLConfigChangeListener listener) throws SSLException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerSSLConfigChangeListener", new Object[] { sslAliasName, connectionInfo, listener }); getProperties(sslAliasName, connectionInfo, listener); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "registerSSLConfigChangeListener"); }
[ "public", "void", "registerSSLConfigChangeListener", "(", "String", "sslAliasName", ",", "Map", "<", "String", ",", "Object", ">", "connectionInfo", ",", "SSLConfigChangeListener", "listener", ")", "throws", "SSLException", "{", "if", "(", "TraceComponent", ".", "is...
<p> This method registers an SSLConfigChangeListener for the specific SSL configuration chosen based upon the parameters passed in using the precedence logic described in the JavaDoc for the getSSLContext API. The SSLConfigChangeListener must be deregistered by deregisterSSLConfigChangeListener when it is no longer needed. </p> @param sslAliasName @param connectionInfo @param listener @throws com.ibm.websphere.ssl.SSLException @ibm-api
[ "<p", ">", "This", "method", "registers", "an", "SSLConfigChangeListener", "for", "the", "specific", "SSL", "configuration", "chosen", "based", "upon", "the", "parameters", "passed", "in", "using", "the", "precedence", "logic", "described", "in", "the", "JavaDoc",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/websphere/ssl/JSSEHelper.java#L1169-L1175
apache/groovy
src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java
ClassNodeResolver.resolveName
public LookupResult resolveName(String name, CompilationUnit compilationUnit) { ClassNode res = getFromClassCache(name); if (res==NO_CLASS) return null; if (res!=null) return new LookupResult(null,res); LookupResult lr = findClassNode(name, compilationUnit); if (lr != null) { if (lr.isClassNode()) cacheClass(name, lr.getClassNode()); return lr; } else { cacheClass(name, NO_CLASS); return null; } }
java
public LookupResult resolveName(String name, CompilationUnit compilationUnit) { ClassNode res = getFromClassCache(name); if (res==NO_CLASS) return null; if (res!=null) return new LookupResult(null,res); LookupResult lr = findClassNode(name, compilationUnit); if (lr != null) { if (lr.isClassNode()) cacheClass(name, lr.getClassNode()); return lr; } else { cacheClass(name, NO_CLASS); return null; } }
[ "public", "LookupResult", "resolveName", "(", "String", "name", ",", "CompilationUnit", "compilationUnit", ")", "{", "ClassNode", "res", "=", "getFromClassCache", "(", "name", ")", ";", "if", "(", "res", "==", "NO_CLASS", ")", "return", "null", ";", "if", "(...
Resolves the name of a class to a SourceUnit or ClassNode. If no class or source is found this method returns null. A lookup is done by first asking the cache if there is an entry for the class already available to then call {@link #findClassNode(String, CompilationUnit)}. The result of that method call will be cached if a ClassNode is found. If a SourceUnit is found, this method will not be asked later on again for that class, because ResolveVisitor will first ask the CompilationUnit for classes in the compilation queue and it will find the class for that SourceUnit there then. method return a ClassNode instead of a SourceUnit, the res @param name - the name of the class @param compilationUnit - the current CompilationUnit @return the LookupResult
[ "Resolves", "the", "name", "of", "a", "class", "to", "a", "SourceUnit", "or", "ClassNode", ".", "If", "no", "class", "or", "source", "is", "found", "this", "method", "returns", "null", ".", "A", "lookup", "is", "done", "by", "first", "asking", "the", "...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L121-L133
jblas-project/jblas
src/main/java/org/jblas/ComplexFloat.java
ComplexFloat.addi
public ComplexFloat addi(ComplexFloat c, ComplexFloat result) { if (this == result) { r += c.r; i += c.i; } else { result.r = r + c.r; result.i = i + c.i; } return result; }
java
public ComplexFloat addi(ComplexFloat c, ComplexFloat result) { if (this == result) { r += c.r; i += c.i; } else { result.r = r + c.r; result.i = i + c.i; } return result; }
[ "public", "ComplexFloat", "addi", "(", "ComplexFloat", "c", ",", "ComplexFloat", "result", ")", "{", "if", "(", "this", "==", "result", ")", "{", "r", "+=", "c", ".", "r", ";", "i", "+=", "c", ".", "i", ";", "}", "else", "{", "result", ".", "r", ...
Add two complex numbers in-place @param c other complex number @param result complex number where result is stored @return same as result
[ "Add", "two", "complex", "numbers", "in", "-", "place" ]
train
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/ComplexFloat.java#L101-L110
iipc/openwayback-access-control
access-control/src/main/java/org/archive/accesscontrol/AccessControlClient.java
AccessControlClient.getPolicy
public String getPolicy(String url, Date captureDate, Date retrievalDate, Collection<String> groups) throws RobotsUnavailableException, RuleOracleUnavailableException { return getPolicy(url, getRule(url, captureDate, retrievalDate, groups)); }
java
public String getPolicy(String url, Date captureDate, Date retrievalDate, Collection<String> groups) throws RobotsUnavailableException, RuleOracleUnavailableException { return getPolicy(url, getRule(url, captureDate, retrievalDate, groups)); }
[ "public", "String", "getPolicy", "(", "String", "url", ",", "Date", "captureDate", ",", "Date", "retrievalDate", ",", "Collection", "<", "String", ">", "groups", ")", "throws", "RobotsUnavailableException", ",", "RuleOracleUnavailableException", "{", "return", "getP...
Return the best-matching policy for the requested document. @param url URL of the requested document. @param captureDate Date the document was archived. @param retrievalDate Date of retrieval (usually now). @param groups Group names of the user accessing the document. @return Access-control policy that should be enforced. eg "robots", "block" or "allow". @throws RobotsUnavailableException @throws RuleOracleUnavailableException
[ "Return", "the", "best", "-", "matching", "policy", "for", "the", "requested", "document", "." ]
train
https://github.com/iipc/openwayback-access-control/blob/4a0f70f200fd8d7b6e313624b7628656d834bf31/access-control/src/main/java/org/archive/accesscontrol/AccessControlClient.java#L111-L115
inaiat/jqplot4java
src/main/java/br/com/digilabs/jqplot/chart/BubbleChart.java
BubbleChart.addValue
public void addValue(Integer x, Integer y, Integer radius, String label) { bubbleData.addValue(new BubbleItem(x, y, radius, label)); }
java
public void addValue(Integer x, Integer y, Integer radius, String label) { bubbleData.addValue(new BubbleItem(x, y, radius, label)); }
[ "public", "void", "addValue", "(", "Integer", "x", ",", "Integer", "y", ",", "Integer", "radius", ",", "String", "label", ")", "{", "bubbleData", ".", "addValue", "(", "new", "BubbleItem", "(", "x", ",", "y", ",", "radius", ",", "label", ")", ")", ";...
Add a value @param x x @param y y @param radius radius @param label label
[ "Add", "a", "value" ]
train
https://github.com/inaiat/jqplot4java/blob/35bcd17749442e88695df0438c8330a65a3977cc/src/main/java/br/com/digilabs/jqplot/chart/BubbleChart.java#L95-L97
rzwitserloot/lombok
src/core/lombok/javac/handlers/JavacHandlerUtil.java
JavacHandlerUtil.deleteAnnotationIfNeccessary
public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType) { deleteAnnotationIfNeccessary0(annotation, annotationType.getName()); }
java
public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType) { deleteAnnotationIfNeccessary0(annotation, annotationType.getName()); }
[ "public", "static", "void", "deleteAnnotationIfNeccessary", "(", "JavacNode", "annotation", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ")", "{", "deleteAnnotationIfNeccessary0", "(", "annotation", ",", "annotationType", ".", "getName", "("...
Removes the annotation from javac's AST (it remains in lombok's AST), then removes any import statement that imports this exact annotation (not star imports). Only does this if the DeleteLombokAnnotations class is in the context.
[ "Removes", "the", "annotation", "from", "javac", "s", "AST", "(", "it", "remains", "in", "lombok", "s", "AST", ")", "then", "removes", "any", "import", "statement", "that", "imports", "this", "exact", "annotation", "(", "not", "star", "imports", ")", ".", ...
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L465-L467
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/version_matrix_file.java
version_matrix_file.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { version_matrix_file_responses result = (version_matrix_file_responses) service.get_payload_formatter().string_to_resource(version_matrix_file_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.version_matrix_file_response_array); } version_matrix_file[] result_version_matrix_file = new version_matrix_file[result.version_matrix_file_response_array.length]; for(int i = 0; i < result.version_matrix_file_response_array.length; i++) { result_version_matrix_file[i] = result.version_matrix_file_response_array[i].version_matrix_file[0]; } return result_version_matrix_file; }
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { version_matrix_file_responses result = (version_matrix_file_responses) service.get_payload_formatter().string_to_resource(version_matrix_file_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) service.clear_session(); throw new nitro_exception(result.message, result.errorcode, (base_response [])result.version_matrix_file_response_array); } version_matrix_file[] result_version_matrix_file = new version_matrix_file[result.version_matrix_file_response_array.length]; for(int i = 0; i < result.version_matrix_file_response_array.length; i++) { result_version_matrix_file[i] = result.version_matrix_file_response_array[i].version_matrix_file[0]; } return result_version_matrix_file; }
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "version_matrix_file_responses", "result", "=", "(", "version_matrix_file_responses", ")", "service", ".", "ge...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/version_matrix_file.java#L277-L294
landawn/AbacusUtil
src/com/landawn/abacus/util/IOUtil.java
IOUtil.estimateLineCount
private static long estimateLineCount(final File file, final int byReadingLineNum) throws UncheckedIOException { final Holder<ZipFile> outputZipFile = new Holder<>(); InputStream is = null; BufferedReader br = null; try { is = openFile(outputZipFile, file); br = Objectory.createBufferedReader(is); int cnt = 0; String line = null; long bytes = 0; while (cnt < byReadingLineNum && (line = br.readLine()) != null) { bytes += line.getBytes().length; cnt++; } return cnt == 0 ? 0 : (file.length() / (bytes / cnt == 0 ? 1 : bytes / cnt)); } catch (IOException e) { throw new UncheckedIOException(e); } finally { closeQuietly(is); closeQuietly(outputZipFile.value()); Objectory.recycle(br); } }
java
private static long estimateLineCount(final File file, final int byReadingLineNum) throws UncheckedIOException { final Holder<ZipFile> outputZipFile = new Holder<>(); InputStream is = null; BufferedReader br = null; try { is = openFile(outputZipFile, file); br = Objectory.createBufferedReader(is); int cnt = 0; String line = null; long bytes = 0; while (cnt < byReadingLineNum && (line = br.readLine()) != null) { bytes += line.getBytes().length; cnt++; } return cnt == 0 ? 0 : (file.length() / (bytes / cnt == 0 ? 1 : bytes / cnt)); } catch (IOException e) { throw new UncheckedIOException(e); } finally { closeQuietly(is); closeQuietly(outputZipFile.value()); Objectory.recycle(br); } }
[ "private", "static", "long", "estimateLineCount", "(", "final", "File", "file", ",", "final", "int", "byReadingLineNum", ")", "throws", "UncheckedIOException", "{", "final", "Holder", "<", "ZipFile", ">", "outputZipFile", "=", "new", "Holder", "<>", "(", ")", ...
Estimate the total line count of the file by reading the specified line count ahead. @param file @param byReadingLineNum @return
[ "Estimate", "the", "total", "line", "count", "of", "the", "file", "by", "reading", "the", "specified", "line", "count", "ahead", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/IOUtil.java#L3468-L3496
gallandarakhneorg/afc
core/maths/mathgeom/tobeincluded/src/d3/continuous/Quaternion.java
Quaternion.getAxisAngle
@SuppressWarnings("synthetic-access") @Pure public final AxisAngle getAxisAngle() { double mag = this.x*this.x + this.y*this.y + this.z*this.z; if ( mag > EPS ) { mag = Math.sqrt(mag); double invMag = 1f/mag; return new AxisAngle( this.x*invMag, this.y*invMag, this.z*invMag, (2.*Math.atan2(mag, this.w))); } return new AxisAngle(0, 0, 1, 0); }
java
@SuppressWarnings("synthetic-access") @Pure public final AxisAngle getAxisAngle() { double mag = this.x*this.x + this.y*this.y + this.z*this.z; if ( mag > EPS ) { mag = Math.sqrt(mag); double invMag = 1f/mag; return new AxisAngle( this.x*invMag, this.y*invMag, this.z*invMag, (2.*Math.atan2(mag, this.w))); } return new AxisAngle(0, 0, 1, 0); }
[ "@", "SuppressWarnings", "(", "\"synthetic-access\"", ")", "@", "Pure", "public", "final", "AxisAngle", "getAxisAngle", "(", ")", "{", "double", "mag", "=", "this", ".", "x", "*", "this", ".", "x", "+", "this", ".", "y", "*", "this", ".", "y", "+", "...
Replies the rotation axis represented by this quaternion. @return the rotation axis @see #setAxisAngle(Vector3D, double) @see #setAxisAngle(double, double, double, double) @see #getAngle()
[ "Replies", "the", "rotation", "axis", "represented", "by", "this", "quaternion", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Quaternion.java#L713-L729
elki-project/elki
elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java
DBIDUtil.randomSample
public static DBIDVar randomSample(DBIDs ids, RandomFactory random) { return randomSample(ids, random.getSingleThreadedRandom()); }
java
public static DBIDVar randomSample(DBIDs ids, RandomFactory random) { return randomSample(ids, random.getSingleThreadedRandom()); }
[ "public", "static", "DBIDVar", "randomSample", "(", "DBIDs", "ids", ",", "RandomFactory", "random", ")", "{", "return", "randomSample", "(", "ids", ",", "random", ".", "getSingleThreadedRandom", "(", ")", ")", ";", "}" ]
Draw a single random sample. @param ids IDs to draw from @param random Random value @return Random ID
[ "Draw", "a", "single", "random", "sample", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L725-L727
threerings/nenya
core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java
SubtitleChatOverlay.displayMessage
protected void displayMessage (ChatMessage message, Graphics2D gfx) { // get the non-history message type... int type = getType(message, false); if (type != ChatLogic.IGNORECHAT) { // display it now displayMessage(message, type, gfx); } }
java
protected void displayMessage (ChatMessage message, Graphics2D gfx) { // get the non-history message type... int type = getType(message, false); if (type != ChatLogic.IGNORECHAT) { // display it now displayMessage(message, type, gfx); } }
[ "protected", "void", "displayMessage", "(", "ChatMessage", "message", ",", "Graphics2D", "gfx", ")", "{", "// get the non-history message type...", "int", "type", "=", "getType", "(", "message", ",", "false", ")", ";", "if", "(", "type", "!=", "ChatLogic", ".", ...
Display the specified message now, unless we are to ignore it.
[ "Display", "the", "specified", "message", "now", "unless", "we", "are", "to", "ignore", "it", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/SubtitleChatOverlay.java#L559-L567
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java
IdentityPatchRunner.prepareTasks
static void prepareTasks(final IdentityPatchContext.PatchEntry entry, final IdentityPatchContext context, final List<PreparedTask> tasks, final List<ContentItem> conflicts) throws PatchingException { for (final PatchingTasks.ContentTaskDefinition definition : entry.getTaskDefinitions()) { final PatchingTask task = createTask(definition, context, entry); if(!task.isRelevant(entry)) { continue; } try { // backup and validate content if (!task.prepare(entry) || definition.hasConflicts()) { // Unless it a content item was manually ignored (or excluded) final ContentItem item = task.getContentItem(); if (!context.isIgnored(item)) { conflicts.add(item); } } tasks.add(new PreparedTask(task, entry)); } catch (IOException e) { throw new PatchingException(e); } } }
java
static void prepareTasks(final IdentityPatchContext.PatchEntry entry, final IdentityPatchContext context, final List<PreparedTask> tasks, final List<ContentItem> conflicts) throws PatchingException { for (final PatchingTasks.ContentTaskDefinition definition : entry.getTaskDefinitions()) { final PatchingTask task = createTask(definition, context, entry); if(!task.isRelevant(entry)) { continue; } try { // backup and validate content if (!task.prepare(entry) || definition.hasConflicts()) { // Unless it a content item was manually ignored (or excluded) final ContentItem item = task.getContentItem(); if (!context.isIgnored(item)) { conflicts.add(item); } } tasks.add(new PreparedTask(task, entry)); } catch (IOException e) { throw new PatchingException(e); } } }
[ "static", "void", "prepareTasks", "(", "final", "IdentityPatchContext", ".", "PatchEntry", "entry", ",", "final", "IdentityPatchContext", "context", ",", "final", "List", "<", "PreparedTask", ">", "tasks", ",", "final", "List", "<", "ContentItem", ">", "conflicts"...
Prepare all tasks. @param entry the patch entry @param context the patch context @param tasks a list for prepared tasks @param conflicts a list for conflicting content items @throws PatchingException
[ "Prepare", "all", "tasks", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L669-L689
joniles/mpxj
src/main/java/net/sf/mpxj/RecurringData.java
RecurringData.setWeeklyDaysFromBitmap
public void setWeeklyDaysFromBitmap(Integer days, int[] masks) { if (days != null) { int value = days.intValue(); for (Day day : Day.values()) { setWeeklyDay(day, ((value & masks[day.getValue()]) != 0)); } } }
java
public void setWeeklyDaysFromBitmap(Integer days, int[] masks) { if (days != null) { int value = days.intValue(); for (Day day : Day.values()) { setWeeklyDay(day, ((value & masks[day.getValue()]) != 0)); } } }
[ "public", "void", "setWeeklyDaysFromBitmap", "(", "Integer", "days", ",", "int", "[", "]", "masks", ")", "{", "if", "(", "days", "!=", "null", ")", "{", "int", "value", "=", "days", ".", "intValue", "(", ")", ";", "for", "(", "Day", "day", ":", "Da...
Converts from a bitmap to individual day flags for a weekly recurrence, using the array of masks. @param days bitmap @param masks array of mask values
[ "Converts", "from", "a", "bitmap", "to", "individual", "day", "flags", "for", "a", "weekly", "recurrence", "using", "the", "array", "of", "masks", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L199-L209
NoraUi/NoraUi
src/main/java/com/github/noraui/utils/Utilities.java
Utilities.setProperty
public static String setProperty(String value, String defValue) { if (value != null && !"".equals(value)) { return value; } return defValue; }
java
public static String setProperty(String value, String defValue) { if (value != null && !"".equals(value)) { return value; } return defValue; }
[ "public", "static", "String", "setProperty", "(", "String", "value", ",", "String", "defValue", ")", "{", "if", "(", "value", "!=", "null", "&&", "!", "\"\"", ".", "equals", "(", "value", ")", ")", "{", "return", "value", ";", "}", "return", "defValue"...
Set value to a variable (null is forbiden, so set default value). @param value is value setted if value is not null. @param defValue is value setted if value is null. @return a {link java.lang.String} with the value not null.
[ "Set", "value", "to", "a", "variable", "(", "null", "is", "forbiden", "so", "set", "default", "value", ")", "." ]
train
https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Utilities.java#L206-L211
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournal.java
UfsJournal.gainPrimacy
public synchronized void gainPrimacy() throws IOException { Preconditions.checkState(mWriter == null, "writer must be null in secondary mode"); Preconditions.checkState(mTailerThread != null, "tailer thread must not be null in secondary mode"); mTailerThread.awaitTermination(true); long nextSequenceNumber = mTailerThread.getNextSequenceNumber(); mTailerThread = null; nextSequenceNumber = catchUp(nextSequenceNumber); mWriter = new UfsJournalLogWriter(this, nextSequenceNumber); mAsyncWriter = new AsyncJournalWriter(mWriter); mState = State.PRIMARY; }
java
public synchronized void gainPrimacy() throws IOException { Preconditions.checkState(mWriter == null, "writer must be null in secondary mode"); Preconditions.checkState(mTailerThread != null, "tailer thread must not be null in secondary mode"); mTailerThread.awaitTermination(true); long nextSequenceNumber = mTailerThread.getNextSequenceNumber(); mTailerThread = null; nextSequenceNumber = catchUp(nextSequenceNumber); mWriter = new UfsJournalLogWriter(this, nextSequenceNumber); mAsyncWriter = new AsyncJournalWriter(mWriter); mState = State.PRIMARY; }
[ "public", "synchronized", "void", "gainPrimacy", "(", ")", "throws", "IOException", "{", "Preconditions", ".", "checkState", "(", "mWriter", "==", "null", ",", "\"writer must be null in secondary mode\"", ")", ";", "Preconditions", ".", "checkState", "(", "mTailerThre...
Transitions the journal from secondary to primary mode. The journal will apply the latest journal entries to the state machine, then begin to allow writes.
[ "Transitions", "the", "journal", "from", "secondary", "to", "primary", "mode", ".", "The", "journal", "will", "apply", "the", "latest", "journal", "entries", "to", "the", "state", "machine", "then", "begin", "to", "allow", "writes", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournal.java#L203-L214
mongodb/stitch-android-sdk
core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java
CoreRemoteMongoCollectionImpl.updateMany
public RemoteUpdateResult updateMany(final Bson filter, final Bson update) { return updateMany(filter, update, new RemoteUpdateOptions()); }
java
public RemoteUpdateResult updateMany(final Bson filter, final Bson update) { return updateMany(filter, update, new RemoteUpdateOptions()); }
[ "public", "RemoteUpdateResult", "updateMany", "(", "final", "Bson", "filter", ",", "final", "Bson", "update", ")", "{", "return", "updateMany", "(", "filter", ",", "update", ",", "new", "RemoteUpdateOptions", "(", ")", ")", ";", "}" ]
Update all documents in the collection according to the specified arguments. @param filter a document describing the query filter, which may not be null. @param update a document describing the update, which may not be null. The update to apply must include only update operators. @return the result of the update many operation
[ "Update", "all", "documents", "in", "the", "collection", "according", "to", "the", "specified", "arguments", "." ]
train
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/internal/CoreRemoteMongoCollectionImpl.java#L425-L427
janvanbesien/java-ipv6
src/main/java/com/googlecode/ipv6/IPv6Network.java
IPv6Network.fromString
public static IPv6Network fromString(String string) { if (string.indexOf('/') == -1) { throw new IllegalArgumentException("Expected format is network-address/prefix-length"); } final String networkAddressString = parseNetworkAddress(string); int prefixLength = parsePrefixLength(string); final IPv6Address networkAddress = IPv6Address.fromString(networkAddressString); return fromAddressAndMask(networkAddress, new IPv6NetworkMask(prefixLength)); }
java
public static IPv6Network fromString(String string) { if (string.indexOf('/') == -1) { throw new IllegalArgumentException("Expected format is network-address/prefix-length"); } final String networkAddressString = parseNetworkAddress(string); int prefixLength = parsePrefixLength(string); final IPv6Address networkAddress = IPv6Address.fromString(networkAddressString); return fromAddressAndMask(networkAddress, new IPv6NetworkMask(prefixLength)); }
[ "public", "static", "IPv6Network", "fromString", "(", "String", "string", ")", "{", "if", "(", "string", ".", "indexOf", "(", "'", "'", ")", "==", "-", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Expected format is network-address/prefix-l...
Create an IPv6 network from its String representation. For example "1234:5678:abcd:0:0:0:0:0/64" or "2001::ff/128". @param string string representation @return ipv6 network
[ "Create", "an", "IPv6", "network", "from", "its", "String", "representation", ".", "For", "example", "1234", ":", "5678", ":", "abcd", ":", "0", ":", "0", ":", "0", ":", "0", ":", "0", "/", "64", "or", "2001", "::", "ff", "/", "128", "." ]
train
https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6Network.java#L88-L101
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoFactoryBuilder.java
BindDaoFactoryBuilder.buildDaoFactoryInterface
public String buildDaoFactoryInterface(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception { String schemaName = generateDaoFactoryName(schema); PackageElement pkg = elementUtils.getPackageOf(schema.getElement()); String packageName = pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString(); AnnotationProcessorUtilis.infoOnGeneratedClasses(BindDataSource.class, packageName, schemaName); classBuilder = buildDaoFactoryInterfaceInternal(elementUtils, filer, schema); TypeSpec typeSpec = classBuilder.build(); JavaWriterHelper.writeJava2File(filer, packageName, typeSpec); return schemaName; }
java
public String buildDaoFactoryInterface(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception { String schemaName = generateDaoFactoryName(schema); PackageElement pkg = elementUtils.getPackageOf(schema.getElement()); String packageName = pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString(); AnnotationProcessorUtilis.infoOnGeneratedClasses(BindDataSource.class, packageName, schemaName); classBuilder = buildDaoFactoryInterfaceInternal(elementUtils, filer, schema); TypeSpec typeSpec = classBuilder.build(); JavaWriterHelper.writeJava2File(filer, packageName, typeSpec); return schemaName; }
[ "public", "String", "buildDaoFactoryInterface", "(", "Elements", "elementUtils", ",", "Filer", "filer", ",", "SQLiteDatabaseSchema", "schema", ")", "throws", "Exception", "{", "String", "schemaName", "=", "generateDaoFactoryName", "(", "schema", ")", ";", "PackageElem...
Build dao factory interface. @param elementUtils the element utils @param filer the filer @param schema the schema @return schema typeName @throws Exception the exception
[ "Build", "dao", "factory", "interface", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoFactoryBuilder.java#L95-L107
graphhopper/map-matching
matching-core/src/main/java/com/graphhopper/matching/util/HmmProbabilities.java
HmmProbabilities.transitionLogProbability
public double transitionLogProbability(double routeLength, double linearDistance) { // Transition metric taken from Newson & Krumm. Double transitionMetric = Math.abs(linearDistance - routeLength); return Distributions.logExponentialDistribution(beta, transitionMetric); }
java
public double transitionLogProbability(double routeLength, double linearDistance) { // Transition metric taken from Newson & Krumm. Double transitionMetric = Math.abs(linearDistance - routeLength); return Distributions.logExponentialDistribution(beta, transitionMetric); }
[ "public", "double", "transitionLogProbability", "(", "double", "routeLength", ",", "double", "linearDistance", ")", "{", "// Transition metric taken from Newson & Krumm.", "Double", "transitionMetric", "=", "Math", ".", "abs", "(", "linearDistance", "-", "routeLength", ")...
Returns the logarithmic transition probability density for the given transition parameters. @param routeLength Length of the shortest route [m] between two consecutive map matching candidates. @param linearDistance Linear distance [m] between two consecutive GPS measurements.
[ "Returns", "the", "logarithmic", "transition", "probability", "density", "for", "the", "given", "transition", "parameters", "." ]
train
https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/matching-core/src/main/java/com/graphhopper/matching/util/HmmProbabilities.java#L59-L64
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.payment_thod_paymentMethodId_PUT
public net.minidev.ovh.api.billing.OvhPaymentMethod payment_thod_paymentMethodId_PUT(Long paymentMethodId, Long billingContactId, Boolean _default, String description) throws IOException { String qPath = "/me/payment/method/{paymentMethodId}"; StringBuilder sb = path(qPath, paymentMethodId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "billingContactId", billingContactId); addBody(o, "default", _default); addBody(o, "description", description); String resp = exec(qPath, "PUT", sb.toString(), o); return convertTo(resp, net.minidev.ovh.api.billing.OvhPaymentMethod.class); }
java
public net.minidev.ovh.api.billing.OvhPaymentMethod payment_thod_paymentMethodId_PUT(Long paymentMethodId, Long billingContactId, Boolean _default, String description) throws IOException { String qPath = "/me/payment/method/{paymentMethodId}"; StringBuilder sb = path(qPath, paymentMethodId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "billingContactId", billingContactId); addBody(o, "default", _default); addBody(o, "description", description); String resp = exec(qPath, "PUT", sb.toString(), o); return convertTo(resp, net.minidev.ovh.api.billing.OvhPaymentMethod.class); }
[ "public", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "billing", ".", "OvhPaymentMethod", "payment_thod_paymentMethodId_PUT", "(", "Long", "paymentMethodId", ",", "Long", "billingContactId", ",", "Boolean", "_default", ",", "String", "description", ")", "t...
Edit payment method REST: PUT /me/payment/method/{paymentMethodId} @param paymentMethodId [required] Payment method ID @param _default [required] Set this method like default @param description [required] Customer personalized description @param billingContactId [required] Change your billing contact API beta
[ "Edit", "payment", "method" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1075-L1084
tvesalainen/util
util/src/main/java/org/vesalainen/lang/Primitives.java
Primitives.toDigits
public static final IntStream toDigits(long v, int length, int radix) { Spliterator.OfInt spliterator = Spliterators.spliterator(new PRimIt(v, length, radix), Long.MAX_VALUE, 0); return StreamSupport.intStream(spliterator, false); }
java
public static final IntStream toDigits(long v, int length, int radix) { Spliterator.OfInt spliterator = Spliterators.spliterator(new PRimIt(v, length, radix), Long.MAX_VALUE, 0); return StreamSupport.intStream(spliterator, false); }
[ "public", "static", "final", "IntStream", "toDigits", "(", "long", "v", ",", "int", "length", ",", "int", "radix", ")", "{", "Spliterator", ".", "OfInt", "spliterator", "=", "Spliterators", ".", "spliterator", "(", "new", "PRimIt", "(", "v", ",", "length",...
Returns IntStream where each item is a digit. I.e zero leading digits. @param v @param length @param radix @return
[ "Returns", "IntStream", "where", "each", "item", "is", "a", "digit", ".", "I", ".", "e", "zero", "leading", "digits", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L79-L83
petergeneric/stdlib
guice/common/src/main/java/com/peterphi/std/guice/restclient/jaxb/webquery/WQConstraint.java
WQConstraint.decode
public static WQConstraint decode(final String field, final String rawValue) { final WQFunctionType function; final String value; if (StringUtils.equalsIgnoreCase(rawValue, WQFunctionType.IS_NULL.getPrefix())) return new WQConstraint(field, WQFunctionType.IS_NULL, null); else if (StringUtils.equalsIgnoreCase(rawValue, WQFunctionType.NOT_NULL.getPrefix())) return new WQConstraint(field, WQFunctionType.NOT_NULL, null); else if (rawValue.startsWith("_f_")) { function = WQFunctionType.getByPrefix(rawValue); if (function.hasParam()) { // Strip the function name from the value value = rawValue.substring(function.getPrefix().length()); if (function.hasBinaryParam()) { final String[] splitValues = StringUtils.split(value, "..", 2); final String left = splitValues[0]; final String right = splitValues[1]; return new WQConstraint(field, function, left, right); } } else { value = null; } } else { function = WQFunctionType.EQ; value = rawValue; } return new WQConstraint(field, function, value); }
java
public static WQConstraint decode(final String field, final String rawValue) { final WQFunctionType function; final String value; if (StringUtils.equalsIgnoreCase(rawValue, WQFunctionType.IS_NULL.getPrefix())) return new WQConstraint(field, WQFunctionType.IS_NULL, null); else if (StringUtils.equalsIgnoreCase(rawValue, WQFunctionType.NOT_NULL.getPrefix())) return new WQConstraint(field, WQFunctionType.NOT_NULL, null); else if (rawValue.startsWith("_f_")) { function = WQFunctionType.getByPrefix(rawValue); if (function.hasParam()) { // Strip the function name from the value value = rawValue.substring(function.getPrefix().length()); if (function.hasBinaryParam()) { final String[] splitValues = StringUtils.split(value, "..", 2); final String left = splitValues[0]; final String right = splitValues[1]; return new WQConstraint(field, function, left, right); } } else { value = null; } } else { function = WQFunctionType.EQ; value = rawValue; } return new WQConstraint(field, function, value); }
[ "public", "static", "WQConstraint", "decode", "(", "final", "String", "field", ",", "final", "String", "rawValue", ")", "{", "final", "WQFunctionType", "function", ";", "final", "String", "value", ";", "if", "(", "StringUtils", ".", "equalsIgnoreCase", "(", "r...
Produce a WebQueryConstraint from a Query String format parameter @param field @param rawValue @return
[ "Produce", "a", "WebQueryConstraint", "from", "a", "Query", "String", "format", "parameter" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/restclient/jaxb/webquery/WQConstraint.java#L238-L278
grpc/grpc-java
core/src/main/java/io/grpc/internal/ProxyDetectorImpl.java
ProxyDetectorImpl.overrideProxy
private static InetSocketAddress overrideProxy(String proxyHostPort) { if (proxyHostPort == null) { return null; } String[] parts = proxyHostPort.split(":", 2); int port = 80; if (parts.length > 1) { port = Integer.parseInt(parts[1]); } log.warning( "Detected GRPC_PROXY_EXP and will honor it, but this feature will " + "be removed in a future release. Use the JVM flags " + "\"-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\" to set the https proxy for " + "this JVM."); return new InetSocketAddress(parts[0], port); }
java
private static InetSocketAddress overrideProxy(String proxyHostPort) { if (proxyHostPort == null) { return null; } String[] parts = proxyHostPort.split(":", 2); int port = 80; if (parts.length > 1) { port = Integer.parseInt(parts[1]); } log.warning( "Detected GRPC_PROXY_EXP and will honor it, but this feature will " + "be removed in a future release. Use the JVM flags " + "\"-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\" to set the https proxy for " + "this JVM."); return new InetSocketAddress(parts[0], port); }
[ "private", "static", "InetSocketAddress", "overrideProxy", "(", "String", "proxyHostPort", ")", "{", "if", "(", "proxyHostPort", "==", "null", ")", "{", "return", "null", ";", "}", "String", "[", "]", "parts", "=", "proxyHostPort", ".", "split", "(", "\":\""...
GRPC_PROXY_EXP is deprecated but let's maintain compatibility for now.
[ "GRPC_PROXY_EXP", "is", "deprecated", "but", "let", "s", "maintain", "compatibility", "for", "now", "." ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/ProxyDetectorImpl.java#L284-L300
wildfly-swarm-archive/ARCHIVE-wildfly-swarm
plugin/src/main/java/org/wildfly/swarm/plugin/Util.java
Util.filteredSystemProperties
public static Properties filteredSystemProperties(final Properties existing, final boolean withMaven) { final Properties properties = new Properties(); System.getProperties().stringPropertyNames().forEach(key -> { if (key.startsWith("jboss.") || key.startsWith("swarm.") || key.startsWith("wildfly.") || (withMaven && key.startsWith("maven.")) || existing.containsKey(key)) { properties.put(key, System.getProperty(key)); } }); return properties; }
java
public static Properties filteredSystemProperties(final Properties existing, final boolean withMaven) { final Properties properties = new Properties(); System.getProperties().stringPropertyNames().forEach(key -> { if (key.startsWith("jboss.") || key.startsWith("swarm.") || key.startsWith("wildfly.") || (withMaven && key.startsWith("maven.")) || existing.containsKey(key)) { properties.put(key, System.getProperty(key)); } }); return properties; }
[ "public", "static", "Properties", "filteredSystemProperties", "(", "final", "Properties", "existing", ",", "final", "boolean", "withMaven", ")", "{", "final", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "System", ".", "getProperties", "(",...
Copies any jboss.*, swarm.*, or wildfly.* (and optionally maven.*) sysprops from System, along with anything that shadows a specified property. @return only the filtered properties, existing is unchanged
[ "Copies", "any", "jboss", ".", "*", "swarm", ".", "*", "or", "wildfly", ".", "*", "(", "and", "optionally", "maven", ".", "*", ")", "sysprops", "from", "System", "along", "with", "anything", "that", "shadows", "a", "specified", "property", "." ]
train
https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/plugin/src/main/java/org/wildfly/swarm/plugin/Util.java#L51-L65
stevespringett/Alpine
alpine/src/main/java/alpine/persistence/AlpineQueryManager.java
AlpineQueryManager.createConfigProperty
public ConfigProperty createConfigProperty(final String groupName, final String propertyName, final String propertyValue, final ConfigProperty.PropertyType propertyType, final String description) { pm.currentTransaction().begin(); final ConfigProperty configProperty = new ConfigProperty(); configProperty.setGroupName(groupName); configProperty.setPropertyName(propertyName); configProperty.setPropertyValue(propertyValue); configProperty.setPropertyType(propertyType); configProperty.setDescription(description); pm.makePersistent(configProperty); pm.currentTransaction().commit(); return getObjectById(ConfigProperty.class, configProperty.getId()); }
java
public ConfigProperty createConfigProperty(final String groupName, final String propertyName, final String propertyValue, final ConfigProperty.PropertyType propertyType, final String description) { pm.currentTransaction().begin(); final ConfigProperty configProperty = new ConfigProperty(); configProperty.setGroupName(groupName); configProperty.setPropertyName(propertyName); configProperty.setPropertyValue(propertyValue); configProperty.setPropertyType(propertyType); configProperty.setDescription(description); pm.makePersistent(configProperty); pm.currentTransaction().commit(); return getObjectById(ConfigProperty.class, configProperty.getId()); }
[ "public", "ConfigProperty", "createConfigProperty", "(", "final", "String", "groupName", ",", "final", "String", "propertyName", ",", "final", "String", "propertyValue", ",", "final", "ConfigProperty", ".", "PropertyType", "propertyType", ",", "final", "String", "desc...
Creates a ConfigProperty object. @param groupName the group name of the property @param propertyName the name of the property @param propertyValue the value of the property @param propertyType the type of property @param description a description of the property @return a ConfigProperty object @since 1.3.0
[ "Creates", "a", "ConfigProperty", "object", "." ]
train
https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L754-L767
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPInstanceLocalServiceBaseImpl.java
CPInstanceLocalServiceBaseImpl.getCPInstanceByUuidAndGroupId
@Override public CPInstance getCPInstanceByUuidAndGroupId(String uuid, long groupId) throws PortalException { return cpInstancePersistence.findByUUID_G(uuid, groupId); }
java
@Override public CPInstance getCPInstanceByUuidAndGroupId(String uuid, long groupId) throws PortalException { return cpInstancePersistence.findByUUID_G(uuid, groupId); }
[ "@", "Override", "public", "CPInstance", "getCPInstanceByUuidAndGroupId", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "PortalException", "{", "return", "cpInstancePersistence", ".", "findByUUID_G", "(", "uuid", ",", "groupId", ")", ";", "}" ]
Returns the cp instance matching the UUID and group. @param uuid the cp instance's UUID @param groupId the primary key of the group @return the matching cp instance @throws PortalException if a matching cp instance could not be found
[ "Returns", "the", "cp", "instance", "matching", "the", "UUID", "and", "group", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPInstanceLocalServiceBaseImpl.java#L488-L492
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java
FileBasedAtomHandler.putEntry
@Override public void putEntry(final AtomRequest areq, final Entry entry) throws AtomException { LOG.debug("putEntry"); final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/"); final String handle = pathInfo[0]; final String collection = pathInfo[1]; final String fileName = pathInfo[2]; final FileBasedCollection col = service.findCollectionByHandle(handle, collection); try { col.updateEntry(entry, fileName); } catch (final Exception fe) { throw new AtomException(fe); } }
java
@Override public void putEntry(final AtomRequest areq, final Entry entry) throws AtomException { LOG.debug("putEntry"); final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/"); final String handle = pathInfo[0]; final String collection = pathInfo[1]; final String fileName = pathInfo[2]; final FileBasedCollection col = service.findCollectionByHandle(handle, collection); try { col.updateEntry(entry, fileName); } catch (final Exception fe) { throw new AtomException(fe); } }
[ "@", "Override", "public", "void", "putEntry", "(", "final", "AtomRequest", "areq", ",", "final", "Entry", "entry", ")", "throws", "AtomException", "{", "LOG", ".", "debug", "(", "\"putEntry\"", ")", ";", "final", "String", "[", "]", "pathInfo", "=", "Stri...
Update entry specified by pathInfo and posted entry. @param entry @param areq Details of HTTP request @throws com.rometools.rome.propono.atom.server.AtomException
[ "Update", "entry", "specified", "by", "pathInfo", "and", "posted", "entry", "." ]
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L227-L241
virgo47/javasimon
core/src/main/java/org/javasimon/callback/FilterRule.java
FilterRule.checkCondition
public synchronized boolean checkCondition(Simon simon, Object... params) throws ScriptException { if (condition == null) { return true; } if (simon instanceof Stopwatch) { return checkStopwtach((Stopwatch) simon, params); } if (simon instanceof Counter) { return checkCounter((Counter) simon, params); } return true; }
java
public synchronized boolean checkCondition(Simon simon, Object... params) throws ScriptException { if (condition == null) { return true; } if (simon instanceof Stopwatch) { return checkStopwtach((Stopwatch) simon, params); } if (simon instanceof Counter) { return checkCounter((Counter) simon, params); } return true; }
[ "public", "synchronized", "boolean", "checkCondition", "(", "Simon", "simon", ",", "Object", "...", "params", ")", "throws", "ScriptException", "{", "if", "(", "condition", "==", "null", ")", "{", "return", "true", ";", "}", "if", "(", "simon", "instanceof",...
Checks the Simon and optional parameters against the condition specified for a rule. @param simon related Simon @param params optional parameters, e.g. value that is added to a Counter @return true if no condition is specified or the condition is satisfied, otherwise false @throws javax.script.ScriptException possible exception raised by the expression evaluation
[ "Checks", "the", "Simon", "and", "optional", "parameters", "against", "the", "condition", "specified", "for", "a", "rule", "." ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/FilterRule.java#L174-L185
santhosh-tekuri/jlibs
core/src/main/java/jlibs/core/util/CollectionUtil.java
CollectionUtil.readProperties
public static Properties readProperties(InputStream is, Properties props) throws IOException{ if(props==null) props = new Properties(); try{ props.load(is); }finally{ is.close(); } return props; }
java
public static Properties readProperties(InputStream is, Properties props) throws IOException{ if(props==null) props = new Properties(); try{ props.load(is); }finally{ is.close(); } return props; }
[ "public", "static", "Properties", "readProperties", "(", "InputStream", "is", ",", "Properties", "props", ")", "throws", "IOException", "{", "if", "(", "props", "==", "null", ")", "props", "=", "new", "Properties", "(", ")", ";", "try", "{", "props", ".", ...
Reads Properties from given inputStream and returns it. NOTE: the given stream is closed by this method
[ "Reads", "Properties", "from", "given", "inputStream", "and", "returns", "it", ".", "NOTE", ":", "the", "given", "stream", "is", "closed", "by", "this", "method" ]
train
https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L34-L43
geomajas/geomajas-project-client-gwt2
common-gwt/command/src/main/java/org/geomajas/gwt/server/mvc/GeomajasController.java
GeomajasController.handleRequest
@RequestMapping("/geomajasService") public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { doPost(request, response); return null; }
java
@RequestMapping("/geomajasService") public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { doPost(request, response); return null; }
[ "@", "RequestMapping", "(", "\"/geomajasService\"", ")", "public", "ModelAndView", "handleRequest", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "Exception", "{", "doPost", "(", "request", ",", "response", ")", ";", "r...
Implements Spring Controller interface method. <p/> Call {@link RemoteServiceServlet#doPost(HttpServletRequest, HttpServletResponse)} method and return null. @param request current HTTP request @param response current HTTP response @return a ModelAndView to render, or null if handled directly @throws Exception in case of errors
[ "Implements", "Spring", "Controller", "interface", "method", ".", "<p", "/", ">", "Call", "{", "@link", "RemoteServiceServlet#doPost", "(", "HttpServletRequest", "HttpServletResponse", ")", "}", "method", "and", "return", "null", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/server/mvc/GeomajasController.java#L67-L71
BigBadaboom/androidsvg
androidsvg/src/main/java/com/caverock/androidsvg/SVG.java
SVG.renderToPicture
@SuppressWarnings({"WeakerAccess", "unused"}) public Picture renderToPicture(RenderOptions renderOptions) { Box viewBox = (renderOptions != null && renderOptions.hasViewBox()) ? renderOptions.viewBox : rootElement.viewBox; // If a viewPort was supplied in the renderOptions, then use its maxX and maxY as the Picture size if (renderOptions != null && renderOptions.hasViewPort()) { float w = renderOptions.viewPort.maxX(); float h = renderOptions.viewPort.maxY(); return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else if (rootElement.width != null && rootElement.width.unit != Unit.percent && rootElement.height != null && rootElement.height.unit != Unit.percent) { float w = rootElement.width.floatValue(this.renderDPI); float h = rootElement.height.floatValue(this.renderDPI); return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else if (rootElement.width != null && viewBox != null) { // Width and viewBox supplied, but no height // Determine the Picture size and initial viewport. See SVG spec section 7.12. float w = rootElement.width.floatValue(this.renderDPI); float h = w * viewBox.height / viewBox.width; return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else if (rootElement.height != null && viewBox != null) { // Height and viewBox supplied, but no width float h = rootElement.height.floatValue(this.renderDPI); float w = h * viewBox.width / viewBox.height; return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else { return renderToPicture(DEFAULT_PICTURE_WIDTH, DEFAULT_PICTURE_HEIGHT, renderOptions); } }
java
@SuppressWarnings({"WeakerAccess", "unused"}) public Picture renderToPicture(RenderOptions renderOptions) { Box viewBox = (renderOptions != null && renderOptions.hasViewBox()) ? renderOptions.viewBox : rootElement.viewBox; // If a viewPort was supplied in the renderOptions, then use its maxX and maxY as the Picture size if (renderOptions != null && renderOptions.hasViewPort()) { float w = renderOptions.viewPort.maxX(); float h = renderOptions.viewPort.maxY(); return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else if (rootElement.width != null && rootElement.width.unit != Unit.percent && rootElement.height != null && rootElement.height.unit != Unit.percent) { float w = rootElement.width.floatValue(this.renderDPI); float h = rootElement.height.floatValue(this.renderDPI); return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else if (rootElement.width != null && viewBox != null) { // Width and viewBox supplied, but no height // Determine the Picture size and initial viewport. See SVG spec section 7.12. float w = rootElement.width.floatValue(this.renderDPI); float h = w * viewBox.height / viewBox.width; return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else if (rootElement.height != null && viewBox != null) { // Height and viewBox supplied, but no width float h = rootElement.height.floatValue(this.renderDPI); float w = h * viewBox.width / viewBox.height; return renderToPicture( (int) Math.ceil(w), (int) Math.ceil(h), renderOptions ); } else { return renderToPicture(DEFAULT_PICTURE_WIDTH, DEFAULT_PICTURE_HEIGHT, renderOptions); } }
[ "@", "SuppressWarnings", "(", "{", "\"WeakerAccess\"", ",", "\"unused\"", "}", ")", "public", "Picture", "renderToPicture", "(", "RenderOptions", "renderOptions", ")", "{", "Box", "viewBox", "=", "(", "renderOptions", "!=", "null", "&&", "renderOptions", ".", "h...
Renders this SVG document to a {@link Picture}. @param renderOptions options that describe how to render this SVG on the Canvas. @return a Picture object suitable for later rendering using {@link Canvas#drawPicture(Picture)} @since 1.3
[ "Renders", "this", "SVG", "document", "to", "a", "{", "@link", "Picture", "}", "." ]
train
https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVG.java#L376-L415
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java
ShapeGenerator.createTabCloseIcon
public Shape createTabCloseIcon(int x, int y, int w, int h) { final double xMid = x + w / 2.0; final double yMid = y + h / 2.0; path.reset(); final double xOffsetL = w / 2.0; final double xOffsetS = w / 2.0 - 1; final double yOffsetL = h / 2.0; final double yOffsetS = h / 2.0 - 1; final double offsetC = 1; path.moveTo(xMid, yMid - offsetC); path.lineTo(xMid + xOffsetS, yMid - yOffsetL); path.lineTo(yMid + xOffsetL, yMid - yOffsetS); path.lineTo(xMid + offsetC, yMid); path.lineTo(xMid + xOffsetL, yMid + yOffsetS); path.lineTo(xMid + xOffsetS, yMid + yOffsetL); path.lineTo(xMid, yMid + offsetC); path.lineTo(xMid - xOffsetS, yMid + yOffsetL); path.lineTo(xMid - xOffsetL, yMid + yOffsetS); path.lineTo(xMid - offsetC, yMid); path.lineTo(xMid - xOffsetL, yMid - yOffsetS); path.lineTo(xMid - xOffsetS, yMid - yOffsetL); path.closePath(); return path; }
java
public Shape createTabCloseIcon(int x, int y, int w, int h) { final double xMid = x + w / 2.0; final double yMid = y + h / 2.0; path.reset(); final double xOffsetL = w / 2.0; final double xOffsetS = w / 2.0 - 1; final double yOffsetL = h / 2.0; final double yOffsetS = h / 2.0 - 1; final double offsetC = 1; path.moveTo(xMid, yMid - offsetC); path.lineTo(xMid + xOffsetS, yMid - yOffsetL); path.lineTo(yMid + xOffsetL, yMid - yOffsetS); path.lineTo(xMid + offsetC, yMid); path.lineTo(xMid + xOffsetL, yMid + yOffsetS); path.lineTo(xMid + xOffsetS, yMid + yOffsetL); path.lineTo(xMid, yMid + offsetC); path.lineTo(xMid - xOffsetS, yMid + yOffsetL); path.lineTo(xMid - xOffsetL, yMid + yOffsetS); path.lineTo(xMid - offsetC, yMid); path.lineTo(xMid - xOffsetL, yMid - yOffsetS); path.lineTo(xMid - xOffsetS, yMid - yOffsetL); path.closePath(); return path; }
[ "public", "Shape", "createTabCloseIcon", "(", "int", "x", ",", "int", "y", ",", "int", "w", ",", "int", "h", ")", "{", "final", "double", "xMid", "=", "x", "+", "w", "/", "2.0", ";", "final", "double", "yMid", "=", "y", "+", "h", "/", "2.0", ";...
Return a path for a "cancel" icon. This is a circle with a punched out "x" in it. @param x the X coordinate of the upper-left corner of the icon @param y the Y coordinate of the upper-left corner of the icon @param w the width of the icon @param h the height of the icon @return a path representing the shape.
[ "Return", "a", "path", "for", "a", "cancel", "icon", ".", "This", "is", "a", "circle", "with", "a", "punched", "out", "x", "in", "it", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L605-L632
codescape/bitvunit
bitvunit-core/src/main/java/de/codescape/bitvunit/BitvUnit.java
BitvUnit.assertAccessibility
public static void assertAccessibility(URL url, Testable testable) { assertThat(url, is(compliantTo(testable))); }
java
public static void assertAccessibility(URL url, Testable testable) { assertThat(url, is(compliantTo(testable))); }
[ "public", "static", "void", "assertAccessibility", "(", "URL", "url", ",", "Testable", "testable", ")", "{", "assertThat", "(", "url", ",", "is", "(", "compliantTo", "(", "testable", ")", ")", ")", ";", "}" ]
JUnit Assertion to verify a {@link URL} instance for accessibility. @param url {@link java.net.URL} instance @param testable rule(s) to apply
[ "JUnit", "Assertion", "to", "verify", "a", "{", "@link", "URL", "}", "instance", "for", "accessibility", "." ]
train
https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/BitvUnit.java#L88-L90
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java
ExpressRoutePortsInner.updateTags
public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName) { return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().last().body(); }
java
public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName) { return updateTagsWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().last().body(); }
[ "public", "ExpressRoutePortInner", "updateTags", "(", "String", "resourceGroupName", ",", "String", "expressRoutePortName", ")", "{", "return", "updateTagsWithServiceResponseAsync", "(", "resourceGroupName", ",", "expressRoutePortName", ")", ".", "toBlocking", "(", ")", "...
Update ExpressRoutePort tags. @param resourceGroupName The name of the resource group. @param expressRoutePortName The name of the ExpressRoutePort resource. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the ExpressRoutePortInner object if successful.
[ "Update", "ExpressRoutePort", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L529-L531
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java
AbstractWriteHandler.writeDataMessage
public void writeDataMessage(WriteRequest request, DataBuffer buffer) { if (buffer == null) { write(request); return; } Preconditions.checkState(!request.hasCommand(), "write request command should not come with data buffer"); Preconditions.checkState(buffer.readableBytes() > 0, "invalid data size from write request message"); if (!tryAcquireSemaphore()) { return; } mSerializingExecutor.execute(() -> { try { writeData(buffer); } finally { mSemaphore.release(); } }); }
java
public void writeDataMessage(WriteRequest request, DataBuffer buffer) { if (buffer == null) { write(request); return; } Preconditions.checkState(!request.hasCommand(), "write request command should not come with data buffer"); Preconditions.checkState(buffer.readableBytes() > 0, "invalid data size from write request message"); if (!tryAcquireSemaphore()) { return; } mSerializingExecutor.execute(() -> { try { writeData(buffer); } finally { mSemaphore.release(); } }); }
[ "public", "void", "writeDataMessage", "(", "WriteRequest", "request", ",", "DataBuffer", "buffer", ")", "{", "if", "(", "buffer", "==", "null", ")", "{", "write", "(", "request", ")", ";", "return", ";", "}", "Preconditions", ".", "checkState", "(", "!", ...
Handles write request with data message. @param request the request from the client @param buffer the data associated with the request
[ "Handles", "write", "request", "with", "data", "message", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/AbstractWriteHandler.java#L149-L168
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/filemgr/FileManagerImpl.java
FileManagerImpl.split_block
private long split_block(long block_addr, int request_size, int rem) throws IOException { allocated_words += request_size; allocated_blocks++; free_words -= request_size; ml_hits++; ml_splits++; seek_and_count(block_addr + request_size); writeInt(rem); seek_and_count(block_addr); writeInt(- request_size); return(block_addr + HDR_SIZE); }
java
private long split_block(long block_addr, int request_size, int rem) throws IOException { allocated_words += request_size; allocated_blocks++; free_words -= request_size; ml_hits++; ml_splits++; seek_and_count(block_addr + request_size); writeInt(rem); seek_and_count(block_addr); writeInt(- request_size); return(block_addr + HDR_SIZE); }
[ "private", "long", "split_block", "(", "long", "block_addr", ",", "int", "request_size", ",", "int", "rem", ")", "throws", "IOException", "{", "allocated_words", "+=", "request_size", ";", "allocated_blocks", "++", ";", "free_words", "-=", "request_size", ";", "...
/* Split a block on disk and return the appropriate address. We assume that this is only called to split a block on the misc list.
[ "/", "*", "Split", "a", "block", "on", "disk", "and", "return", "the", "appropriate", "address", ".", "We", "assume", "that", "this", "is", "only", "called", "to", "split", "a", "block", "on", "the", "misc", "list", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/filemgr/FileManagerImpl.java#L946-L959
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagLink.java
CmsJspTagLink.linkTagAction
public static String linkTagAction(String target, ServletRequest req) { return linkTagAction(target, req, null); }
java
public static String linkTagAction(String target, ServletRequest req) { return linkTagAction(target, req, null); }
[ "public", "static", "String", "linkTagAction", "(", "String", "target", ",", "ServletRequest", "req", ")", "{", "return", "linkTagAction", "(", "target", ",", "req", ",", "null", ")", ";", "}" ]
Returns a link to a file in the OpenCms VFS that has been adjusted according to the web application path and the OpenCms static export rules.<p> The current OpenCms user context URI will be used as source of the link.</p> Since OpenCms version 7.0.2, you can also use this method in case you are not sure if the link is internal or external, as {@link CmsLinkManager#substituteLinkForUnknownTarget(org.opencms.file.CmsObject, String)} is used to calculate the link target.<p> Relative links are converted to absolute links, using the current element URI as base.<p> @param target the link that should be calculated, can be relative or absolute @param req the current request @return the target link adjusted according to the web application path and the OpenCms static export rules @see org.opencms.staticexport.CmsLinkManager#substituteLinkForUnknownTarget(org.opencms.file.CmsObject, String)
[ "Returns", "a", "link", "to", "a", "file", "in", "the", "OpenCms", "VFS", "that", "has", "been", "adjusted", "according", "to", "the", "web", "application", "path", "and", "the", "OpenCms", "static", "export", "rules", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagLink.java#L93-L96
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java
ContextManager.createDirContext
private TimedDirContext createDirContext(Hashtable<String, Object> env) throws NamingException { return createDirContext(env, roundToSeconds(System.currentTimeMillis())); }
java
private TimedDirContext createDirContext(Hashtable<String, Object> env) throws NamingException { return createDirContext(env, roundToSeconds(System.currentTimeMillis())); }
[ "private", "TimedDirContext", "createDirContext", "(", "Hashtable", "<", "String", ",", "Object", ">", "env", ")", "throws", "NamingException", "{", "return", "createDirContext", "(", "env", ",", "roundToSeconds", "(", "System", ".", "currentTimeMillis", "(", ")",...
Create a directory context. @param env The JNDI environment to create the context with. @return The {@link TimedDirContext}. @throws NamingException If there was an issue binding to the LDAP server.
[ "Create", "a", "directory", "context", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java#L379-L381
osglworks/java-mvc
src/main/java/org/osgl/mvc/result/UnavailableForLegalReasons.java
UnavailableForLegalReasons.of
public static UnavailableForLegalReasons of(int errorCode) { if (_localizedErrorMsg()) { return of(errorCode, defaultMessage(UNAVAILABLE_FOR_LEGAL_REASONS)); } else { touchPayload().errorCode(errorCode); return _INSTANCE; } }
java
public static UnavailableForLegalReasons of(int errorCode) { if (_localizedErrorMsg()) { return of(errorCode, defaultMessage(UNAVAILABLE_FOR_LEGAL_REASONS)); } else { touchPayload().errorCode(errorCode); return _INSTANCE; } }
[ "public", "static", "UnavailableForLegalReasons", "of", "(", "int", "errorCode", ")", "{", "if", "(", "_localizedErrorMsg", "(", ")", ")", "{", "return", "of", "(", "errorCode", ",", "defaultMessage", "(", "UNAVAILABLE_FOR_LEGAL_REASONS", ")", ")", ";", "}", "...
Returns a static UnavailableForLegalReasons instance and set the {@link #payload} thread local with error code and default message. When calling the instance on {@link #getMessage()} method, it will return whatever stored in the {@link #payload} thread local @param errorCode the app defined error code @return a static UnavailableForLegalReasons instance as described above
[ "Returns", "a", "static", "UnavailableForLegalReasons", "instance", "and", "set", "the", "{", "@link", "#payload", "}", "thread", "local", "with", "error", "code", "and", "default", "message", "." ]
train
https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/UnavailableForLegalReasons.java#L160-L167
G2G3Digital/substeps-framework
core/src/main/java/com/technophobia/substeps/model/PatternMap.java
PatternMap.put
public void put(final String pattern, final V value) throws IllegalStateException { if (pattern != null) { if (keys.containsKey(pattern)) { throw new IllegalStateException(""); } keys.put(pattern, value); final Pattern p = Pattern.compile(pattern); patternMap.put(p, value); } else { nullValue = value; } }
java
public void put(final String pattern, final V value) throws IllegalStateException { if (pattern != null) { if (keys.containsKey(pattern)) { throw new IllegalStateException(""); } keys.put(pattern, value); final Pattern p = Pattern.compile(pattern); patternMap.put(p, value); } else { nullValue = value; } }
[ "public", "void", "put", "(", "final", "String", "pattern", ",", "final", "V", "value", ")", "throws", "IllegalStateException", "{", "if", "(", "pattern", "!=", "null", ")", "{", "if", "(", "keys", ".", "containsKey", "(", "pattern", ")", ")", "{", "th...
Adds a new pattern to the map. <p> Users of this class <em>must</em> check if the pattern has already been added by using {@link containsPattern} to avoid IllegalStateException in the event that the pattern has already been added to the map. @param pattern the pattern @param value the value @throws IllegalStateException - if the map already contains the specified patter.
[ "Adds", "a", "new", "pattern", "to", "the", "map", ".", "<p", ">", "Users", "of", "this", "class", "<em", ">", "must<", "/", "em", ">", "check", "if", "the", "pattern", "has", "already", "been", "added", "by", "using", "{", "@link", "containsPattern", ...
train
https://github.com/G2G3Digital/substeps-framework/blob/c1ec6487e1673a7dae54b5e7b62a96f602cd280a/core/src/main/java/com/technophobia/substeps/model/PatternMap.java#L56-L70
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java
SyntheticStorableReferenceBuilder.isConsistent
@Deprecated public boolean isConsistent(Storable indexEntry, S master) throws FetchException { return getReferenceAccess().isConsistent(indexEntry, master); }
java
@Deprecated public boolean isConsistent(Storable indexEntry, S master) throws FetchException { return getReferenceAccess().isConsistent(indexEntry, master); }
[ "@", "Deprecated", "public", "boolean", "isConsistent", "(", "Storable", "indexEntry", ",", "S", "master", ")", "throws", "FetchException", "{", "return", "getReferenceAccess", "(", ")", ".", "isConsistent", "(", "indexEntry", ",", "master", ")", ";", "}" ]
Returns true if the properties of the given index entry match those contained in the master, excluding any version property. This will always return true after a call to copyFromMaster. @param indexEntry index entry whose properties will be tested @param master source of property values @deprecated call getReferenceAccess
[ "Returns", "true", "if", "the", "properties", "of", "the", "given", "index", "entry", "match", "those", "contained", "in", "the", "master", "excluding", "any", "version", "property", ".", "This", "will", "always", "return", "true", "after", "a", "call", "to"...
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceBuilder.java#L382-L385
Sefford/fraggle
fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java
FraggleManager.processAnimations
protected void processAnimations(FragmentAnimation animation, FragmentTransaction ft) { if (animation != null) { if (animation.isCompletedAnimation()) { ft.setCustomAnimations(animation.getEnterAnim(), animation.getExitAnim(), animation.getPushInAnim(), animation.getPopOutAnim()); } else { ft.setCustomAnimations(animation.getEnterAnim(), animation.getExitAnim()); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) for (LollipopAnim sharedElement : animation.getSharedViews()) { ft.addSharedElement(sharedElement.view, sharedElement.name); } } }
java
protected void processAnimations(FragmentAnimation animation, FragmentTransaction ft) { if (animation != null) { if (animation.isCompletedAnimation()) { ft.setCustomAnimations(animation.getEnterAnim(), animation.getExitAnim(), animation.getPushInAnim(), animation.getPopOutAnim()); } else { ft.setCustomAnimations(animation.getEnterAnim(), animation.getExitAnim()); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) for (LollipopAnim sharedElement : animation.getSharedViews()) { ft.addSharedElement(sharedElement.view, sharedElement.name); } } }
[ "protected", "void", "processAnimations", "(", "FragmentAnimation", "animation", ",", "FragmentTransaction", "ft", ")", "{", "if", "(", "animation", "!=", "null", ")", "{", "if", "(", "animation", ".", "isCompletedAnimation", "(", ")", ")", "{", "ft", ".", "...
Processes the custom animations element, adding them as required @param animation Animation object to process @param ft Fragment transaction to add to the transition
[ "Processes", "the", "custom", "animations", "element", "adding", "them", "as", "required" ]
train
https://github.com/Sefford/fraggle/blob/d1b65a99ecc3c3faeef8f288ca6225bbf475c3a3/fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java#L229-L242
alkacon/opencms-core
src/org/opencms/loader/CmsResourceManager.java
CmsResourceManager.readTemplateWithName
private NamedTemplate readTemplateWithName(CmsObject cms, String path) { try { CmsResource resource = cms.readResource(path, CmsResourceFilter.IGNORE_EXPIRATION); String name = getTemplateName(cms, resource); return new NamedTemplate(resource, name); } catch (Exception e) { return null; } }
java
private NamedTemplate readTemplateWithName(CmsObject cms, String path) { try { CmsResource resource = cms.readResource(path, CmsResourceFilter.IGNORE_EXPIRATION); String name = getTemplateName(cms, resource); return new NamedTemplate(resource, name); } catch (Exception e) { return null; } }
[ "private", "NamedTemplate", "readTemplateWithName", "(", "CmsObject", "cms", ",", "String", "path", ")", "{", "try", "{", "CmsResource", "resource", "=", "cms", ".", "readResource", "(", "path", ",", "CmsResourceFilter", ".", "IGNORE_EXPIRATION", ")", ";", "Stri...
Reads a template resource together with its name.<p> @param cms the current CMS context @param path the template path @return the template together with its name, or null if the template couldn't be read
[ "Reads", "a", "template", "resource", "together", "with", "its", "name", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L1550-L1559
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.removeEntry
public static void removeEntry(File zip, String path, File destZip) { removeEntries(zip, new String[] { path }, destZip); }
java
public static void removeEntry(File zip, String path, File destZip) { removeEntries(zip, new String[] { path }, destZip); }
[ "public", "static", "void", "removeEntry", "(", "File", "zip", ",", "String", "path", ",", "File", "destZip", ")", "{", "removeEntries", "(", "zip", ",", "new", "String", "[", "]", "{", "path", "}", ",", "destZip", ")", ";", "}" ]
Copies an existing ZIP file and removes entry with a given path. @param zip an existing ZIP file (only read) @param path path of the entry to remove @param destZip new ZIP file created. @since 1.7
[ "Copies", "an", "existing", "ZIP", "file", "and", "removes", "entry", "with", "a", "given", "path", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2270-L2272
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/lss/LssClient.java
LssClient.deleteStream
public void deleteStream(String domain, String app, String stream) { DeleteStreamRequest request = new DeleteStreamRequest() .withDomain(domain) .withApp(app) .withStream(stream); deleteStream(request); }
java
public void deleteStream(String domain, String app, String stream) { DeleteStreamRequest request = new DeleteStreamRequest() .withDomain(domain) .withApp(app) .withStream(stream); deleteStream(request); }
[ "public", "void", "deleteStream", "(", "String", "domain", ",", "String", "app", ",", "String", "stream", ")", "{", "DeleteStreamRequest", "request", "=", "new", "DeleteStreamRequest", "(", ")", ".", "withDomain", "(", "domain", ")", ".", "withApp", "(", "ap...
Delete stream in live stream service @param domain The requested domain which the specific stream belongs to @param app The requested app which the specific stream belongs to @param stream The requested stream to delete
[ "Delete", "stream", "in", "live", "stream", "service" ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1588-L1594
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.setImageOrPlaceholder
private void setImageOrPlaceholder(ImageView iv, ImageHolder imageHolder) { //cancel previous started image loading processes DrawerImageLoader.getInstance().cancelImage(iv); //set the placeholder iv.setImageDrawable(DrawerImageLoader.getInstance().getImageLoader().placeholder(iv.getContext(), DrawerImageLoader.Tags.PROFILE.name())); //set the real image (probably also the uri) ImageHolder.applyTo(imageHolder, iv, DrawerImageLoader.Tags.PROFILE.name()); }
java
private void setImageOrPlaceholder(ImageView iv, ImageHolder imageHolder) { //cancel previous started image loading processes DrawerImageLoader.getInstance().cancelImage(iv); //set the placeholder iv.setImageDrawable(DrawerImageLoader.getInstance().getImageLoader().placeholder(iv.getContext(), DrawerImageLoader.Tags.PROFILE.name())); //set the real image (probably also the uri) ImageHolder.applyTo(imageHolder, iv, DrawerImageLoader.Tags.PROFILE.name()); }
[ "private", "void", "setImageOrPlaceholder", "(", "ImageView", "iv", ",", "ImageHolder", "imageHolder", ")", "{", "//cancel previous started image loading processes", "DrawerImageLoader", ".", "getInstance", "(", ")", ".", "cancelImage", "(", "iv", ")", ";", "//set the p...
small helper method to set an profile image or a placeholder @param iv @param imageHolder
[ "small", "helper", "method", "to", "set", "an", "profile", "image", "or", "a", "placeholder" ]
train
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1182-L1189
mojgh/JKeyLockManager
src/main/java/de/jkeylockmanager/manager/implementation/lockstripe/CountingLock.java
CountingLock.tryLock
void tryLock() { try { if (!delegate.tryLock(lockTimeout, lockTimeoutUnit)) { throw new KeyLockManagerTimeoutException(lockTimeout, lockTimeoutUnit); } } catch (final InterruptedException e) { throw new KeyLockManagerInterruptedException(); } }
java
void tryLock() { try { if (!delegate.tryLock(lockTimeout, lockTimeoutUnit)) { throw new KeyLockManagerTimeoutException(lockTimeout, lockTimeoutUnit); } } catch (final InterruptedException e) { throw new KeyLockManagerInterruptedException(); } }
[ "void", "tryLock", "(", ")", "{", "try", "{", "if", "(", "!", "delegate", ".", "tryLock", "(", "lockTimeout", ",", "lockTimeoutUnit", ")", ")", "{", "throw", "new", "KeyLockManagerTimeoutException", "(", "lockTimeout", ",", "lockTimeoutUnit", ")", ";", "}", ...
Decorates {@link ReentrantLock#tryLock(long, TimeUnit)}. @throws KeyLockManagerInterruptedException if the current thread becomes interrupted while waiting for the lock @throws KeyLockManagerTimeoutException if the instance wide waiting time is exceeded
[ "Decorates", "{", "@link", "ReentrantLock#tryLock", "(", "long", "TimeUnit", ")", "}", "." ]
train
https://github.com/mojgh/JKeyLockManager/blob/7b69d27f3cde0224a599d6a43ea9d4f1d016d5f1/src/main/java/de/jkeylockmanager/manager/implementation/lockstripe/CountingLock.java#L106-L114
alkacon/opencms-core
src/org/opencms/cmis/CmsCmisResourceHelper.java
CmsCmisResourceHelper.getAllowableActions
public synchronized AllowableActions getAllowableActions(CmsCmisCallContext context, String objectId) { try { CmsObject cms = m_repository.getCmsObject(context); CmsUUID structureId = new CmsUUID(objectId); CmsResource file = cms.readResource(structureId); return collectAllowableActions(cms, file); } catch (CmsException e) { handleCmsException(e); return null; } }
java
public synchronized AllowableActions getAllowableActions(CmsCmisCallContext context, String objectId) { try { CmsObject cms = m_repository.getCmsObject(context); CmsUUID structureId = new CmsUUID(objectId); CmsResource file = cms.readResource(structureId); return collectAllowableActions(cms, file); } catch (CmsException e) { handleCmsException(e); return null; } }
[ "public", "synchronized", "AllowableActions", "getAllowableActions", "(", "CmsCmisCallContext", "context", ",", "String", "objectId", ")", "{", "try", "{", "CmsObject", "cms", "=", "m_repository", ".", "getCmsObject", "(", "context", ")", ";", "CmsUUID", "structureI...
Gets the allowable actions for an object.<p> @param context the call context @param objectId the object id @return the allowable actions
[ "Gets", "the", "allowable", "actions", "for", "an", "object", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisResourceHelper.java#L169-L180
finmath/finmath-lib
src/main/java/net/finmath/marketdata/model/curves/ForwardCurveInterpolation.java
ForwardCurveInterpolation.createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity, InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards) { return createForwardCurveFromForwards(name, referenceDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), paymentOffsetCode, paymentBusinessdayCalendar, paymentDateRollConvention, interpolationMethod, extrapolationMethod, interpolationEntity, interpolationEntityForward, discountCurveName, model, times, givenForwards); }
java
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity, InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards) { return createForwardCurveFromForwards(name, referenceDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), paymentOffsetCode, paymentBusinessdayCalendar, paymentDateRollConvention, interpolationMethod, extrapolationMethod, interpolationEntity, interpolationEntityForward, discountCurveName, model, times, givenForwards); }
[ "public", "static", "ForwardCurveInterpolation", "createForwardCurveFromForwards", "(", "String", "name", ",", "Date", "referenceDate", ",", "String", "paymentOffsetCode", ",", "BusinessdayCalendar", "paymentBusinessdayCalendar", ",", "BusinessdayCalendar", ".", "DateRollConven...
Create a forward curve from given times and given forwards. @param name The name of this curve. @param referenceDate The reference date for this code, i.e., the date which defines t=0. @param paymentOffsetCode The maturity of the index modeled by this curve. @param paymentBusinessdayCalendar The business day calendar used for adjusting the payment date. @param paymentDateRollConvention The date roll convention used for adjusting the payment date. @param interpolationMethod The interpolation method used for the curve. @param extrapolationMethod The extrapolation method used for the curve. @param interpolationEntity The entity interpolated/extrapolated. @param interpolationEntityForward Interpolation entity used for forward rate interpolation. @param discountCurveName The name of a discount curve associated with this index (associated with it's funding or collateralization), if any. @param model The model to be used to fetch the discount curve, if needed. @param times A vector of given time points. @param givenForwards A vector of given forwards (corresponding to the given time points). @return A new ForwardCurve object.
[ "Create", "a", "forward", "curve", "from", "given", "times", "and", "given", "forwards", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/curves/ForwardCurveInterpolation.java#L167-L173
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java
SftpClient.getInputStream
public InputStream getInputStream(String remotefile, long position) throws SftpStatusException, SshException { String remotePath = resolveRemotePath(remotefile); sftp.getAttributes(remotePath); return new SftpFileInputStream(sftp.openFile(remotePath, SftpSubsystemChannel.OPEN_READ), position); }
java
public InputStream getInputStream(String remotefile, long position) throws SftpStatusException, SshException { String remotePath = resolveRemotePath(remotefile); sftp.getAttributes(remotePath); return new SftpFileInputStream(sftp.openFile(remotePath, SftpSubsystemChannel.OPEN_READ), position); }
[ "public", "InputStream", "getInputStream", "(", "String", "remotefile", ",", "long", "position", ")", "throws", "SftpStatusException", ",", "SshException", "{", "String", "remotePath", "=", "resolveRemotePath", "(", "remotefile", ")", ";", "sftp", ".", "getAttribute...
Create an InputStream for reading a remote file. @param remotefile @param position @return InputStream @throws SftpStatusException @throws SshException
[ "Create", "an", "InputStream", "for", "reading", "a", "remote", "file", "." ]
train
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L1519-L1527
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Query.java
Query.setHighlightingTags
public Query setHighlightingTags(String preTag, String postTag) { this.highlightPreTag = preTag; this.highlightPostTag = postTag; return this; }
java
public Query setHighlightingTags(String preTag, String postTag) { this.highlightPreTag = preTag; this.highlightPostTag = postTag; return this; }
[ "public", "Query", "setHighlightingTags", "(", "String", "preTag", ",", "String", "postTag", ")", "{", "this", ".", "highlightPreTag", "=", "preTag", ";", "this", ".", "highlightPostTag", "=", "postTag", ";", "return", "this", ";", "}" ]
/* Specify the string that is inserted before/after the highlighted parts in the query result (default to "<em>" / "</em>").
[ "/", "*", "Specify", "the", "string", "that", "is", "inserted", "before", "/", "after", "the", "highlighted", "parts", "in", "the", "query", "result", "(", "default", "to", "<em", ">", "/", "<", "/", "em", ">", ")", "." ]
train
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Query.java#L327-L331
JOML-CI/JOML
src/org/joml/Matrix4x3d.java
Matrix4x3d.translateLocal
public Matrix4x3d translateLocal(Vector3fc offset, Matrix4x3d dest) { return translateLocal(offset.x(), offset.y(), offset.z(), dest); }
java
public Matrix4x3d translateLocal(Vector3fc offset, Matrix4x3d dest) { return translateLocal(offset.x(), offset.y(), offset.z(), dest); }
[ "public", "Matrix4x3d", "translateLocal", "(", "Vector3fc", "offset", ",", "Matrix4x3d", "dest", ")", "{", "return", "translateLocal", "(", "offset", ".", "x", "(", ")", ",", "offset", ".", "y", "(", ")", ",", "offset", ".", "z", "(", ")", ",", "dest",...
Pre-multiply a translation to this matrix by translating by the given number of units in x, y and z and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>T * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>T * M * v</code>, the translation will be applied last! <p> In order to set the matrix to a translation transformation without pre-multiplying it, use {@link #translation(Vector3fc)}. @see #translation(Vector3fc) @param offset the number of units in x, y and z by which to translate @param dest will hold the result @return dest
[ "Pre", "-", "multiply", "a", "translation", "to", "this", "matrix", "by", "translating", "by", "the", "given", "number", "of", "units", "in", "x", "y", "and", "z", "and", "store", "the", "result", "in", "<code", ">", "dest<", "/", "code", ">", ".", "...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L4011-L4013
lessthanoptimal/ejml
main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java
TriangularSolver_DSCC.solveU
public static void solveU(DMatrixSparseCSC U , double []x ) { final int N = U.numCols; int idx1 = U.col_idx[N]; for (int col = N-1; col >= 0; col--) { int idx0 = U.col_idx[col]; double x_j = x[col] /= U.nz_values[idx1-1]; for (int i = idx0; i < idx1 - 1; i++) { int row = U.nz_rows[i]; x[row] -= U.nz_values[i] * x_j; } idx1 = idx0; } }
java
public static void solveU(DMatrixSparseCSC U , double []x ) { final int N = U.numCols; int idx1 = U.col_idx[N]; for (int col = N-1; col >= 0; col--) { int idx0 = U.col_idx[col]; double x_j = x[col] /= U.nz_values[idx1-1]; for (int i = idx0; i < idx1 - 1; i++) { int row = U.nz_rows[i]; x[row] -= U.nz_values[i] * x_j; } idx1 = idx0; } }
[ "public", "static", "void", "solveU", "(", "DMatrixSparseCSC", "U", ",", "double", "[", "]", "x", ")", "{", "final", "int", "N", "=", "U", ".", "numCols", ";", "int", "idx1", "=", "U", ".", "col_idx", "[", "N", "]", ";", "for", "(", "int", "col",...
Solves for an upper triangular matrix against a dense vector. U*x = b @param U Upper triangular matrix. Diagonal elements are assumed to be non-zero @param x (Input) Solution matrix 'b'. (Output) matrix 'x'
[ "Solves", "for", "an", "upper", "triangular", "matrix", "against", "a", "dense", "vector", ".", "U", "*", "x", "=", "b" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java#L86-L102
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.matchUrlInputAsync
public Observable<MatchResponse> matchUrlInputAsync(String contentType, BodyModelModel imageUrl, MatchUrlInputOptionalParameter matchUrlInputOptionalParameter) { return matchUrlInputWithServiceResponseAsync(contentType, imageUrl, matchUrlInputOptionalParameter).map(new Func1<ServiceResponse<MatchResponse>, MatchResponse>() { @Override public MatchResponse call(ServiceResponse<MatchResponse> response) { return response.body(); } }); }
java
public Observable<MatchResponse> matchUrlInputAsync(String contentType, BodyModelModel imageUrl, MatchUrlInputOptionalParameter matchUrlInputOptionalParameter) { return matchUrlInputWithServiceResponseAsync(contentType, imageUrl, matchUrlInputOptionalParameter).map(new Func1<ServiceResponse<MatchResponse>, MatchResponse>() { @Override public MatchResponse call(ServiceResponse<MatchResponse> response) { return response.body(); } }); }
[ "public", "Observable", "<", "MatchResponse", ">", "matchUrlInputAsync", "(", "String", "contentType", ",", "BodyModelModel", "imageUrl", ",", "MatchUrlInputOptionalParameter", "matchUrlInputOptionalParameter", ")", "{", "return", "matchUrlInputWithServiceResponseAsync", "(", ...
Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using &lt;a href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe"&gt;this&lt;/a&gt; API. Returns ID and tags of matching image.&lt;br/&gt; &lt;br/&gt; Note: Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response. @param contentType The content type. @param imageUrl The image url. @param matchUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the MatchResponse object
[ "Fuzzily", "match", "an", "image", "against", "one", "of", "your", "custom", "Image", "Lists", ".", "You", "can", "create", "and", "manage", "your", "custom", "image", "lists", "using", "&lt", ";", "a", "href", "=", "/", "docs", "/", "services", "/", "...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1786-L1793
rometools/rome-propono
src/main/java/com/rometools/propono/blogclient/BlogConnectionFactory.java
BlogConnectionFactory.getBlogConnection
public static BlogConnection getBlogConnection(final String type, final String url, final String username, final String password) throws BlogClientException { BlogConnection blogConnection = null; if (type == null || type.equals("metaweblog")) { blogConnection = createBlogConnection(METAWEBLOG_IMPL_CLASS, url, username, password); } else if (type.equals("atom")) { blogConnection = createBlogConnection(ATOMPROTOCOL_IMPL_CLASS, url, username, password); } else { throw new BlogClientException("Type must be 'atom' or 'metaweblog'"); } return blogConnection; }
java
public static BlogConnection getBlogConnection(final String type, final String url, final String username, final String password) throws BlogClientException { BlogConnection blogConnection = null; if (type == null || type.equals("metaweblog")) { blogConnection = createBlogConnection(METAWEBLOG_IMPL_CLASS, url, username, password); } else if (type.equals("atom")) { blogConnection = createBlogConnection(ATOMPROTOCOL_IMPL_CLASS, url, username, password); } else { throw new BlogClientException("Type must be 'atom' or 'metaweblog'"); } return blogConnection; }
[ "public", "static", "BlogConnection", "getBlogConnection", "(", "final", "String", "type", ",", "final", "String", "url", ",", "final", "String", "username", ",", "final", "String", "password", ")", "throws", "BlogClientException", "{", "BlogConnection", "blogConnec...
Create a connection to a blog server. @param type Connection type, must be "atom" or "metaweblog" @param url End-point URL to connect to @param username Username for login to blog server @param password Password for login to blog server
[ "Create", "a", "connection", "to", "a", "blog", "server", "." ]
train
https://github.com/rometools/rome-propono/blob/721de8d5a47998f92969d1ee3db80bdaa3f26fb2/src/main/java/com/rometools/propono/blogclient/BlogConnectionFactory.java#L42-L53
spotbugs/spotbugs
spotbugs/src/gui/main/edu/umd/cs/findbugs/sourceViewer/NavigableTextPane.java
NavigableTextPane.scrollLineToVisible
public void scrollLineToVisible(int line, int margin) { int maxMargin = (parentHeight() - 20) / 2; if (margin > maxMargin) { margin = Math.max(0, maxMargin); } scrollLineToVisibleImpl(line, margin); }
java
public void scrollLineToVisible(int line, int margin) { int maxMargin = (parentHeight() - 20) / 2; if (margin > maxMargin) { margin = Math.max(0, maxMargin); } scrollLineToVisibleImpl(line, margin); }
[ "public", "void", "scrollLineToVisible", "(", "int", "line", ",", "int", "margin", ")", "{", "int", "maxMargin", "=", "(", "parentHeight", "(", ")", "-", "20", ")", "/", "2", ";", "if", "(", "margin", ">", "maxMargin", ")", "{", "margin", "=", "Math"...
scroll the specified line into view, with a margin of 'margin' pixels above and below
[ "scroll", "the", "specified", "line", "into", "view", "with", "a", "margin", "of", "margin", "pixels", "above", "and", "below" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/sourceViewer/NavigableTextPane.java#L111-L117
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/sort/FixedLengthRecordSorter.java
FixedLengthRecordSorter.writeToOutput
@Override public void writeToOutput(final ChannelWriterOutputView output, final int start, int num) throws IOException { final TypeComparator<T> comparator = this.comparator; final TypeSerializer<T> serializer = this.serializer; T record = this.recordInstance; final SingleSegmentInputView inView = this.inView; final int recordsPerSegment = this.recordsPerSegment; int currentMemSeg = start / recordsPerSegment; int offset = (start % recordsPerSegment) * this.recordSize; while (num > 0) { final MemorySegment currentIndexSegment = this.sortBuffer.get(currentMemSeg++); inView.set(currentIndexSegment, offset); // check whether we have a full or partially full segment if (num >= recordsPerSegment && offset == 0) { // full segment for (int numInMemSeg = 0; numInMemSeg < recordsPerSegment; numInMemSeg++) { record = comparator.readWithKeyDenormalization(record, inView); serializer.serialize(record, output); } num -= recordsPerSegment; } else { // partially filled segment for (; num > 0; num--) { record = comparator.readWithKeyDenormalization(record, inView); serializer.serialize(record, output); } } } }
java
@Override public void writeToOutput(final ChannelWriterOutputView output, final int start, int num) throws IOException { final TypeComparator<T> comparator = this.comparator; final TypeSerializer<T> serializer = this.serializer; T record = this.recordInstance; final SingleSegmentInputView inView = this.inView; final int recordsPerSegment = this.recordsPerSegment; int currentMemSeg = start / recordsPerSegment; int offset = (start % recordsPerSegment) * this.recordSize; while (num > 0) { final MemorySegment currentIndexSegment = this.sortBuffer.get(currentMemSeg++); inView.set(currentIndexSegment, offset); // check whether we have a full or partially full segment if (num >= recordsPerSegment && offset == 0) { // full segment for (int numInMemSeg = 0; numInMemSeg < recordsPerSegment; numInMemSeg++) { record = comparator.readWithKeyDenormalization(record, inView); serializer.serialize(record, output); } num -= recordsPerSegment; } else { // partially filled segment for (; num > 0; num--) { record = comparator.readWithKeyDenormalization(record, inView); serializer.serialize(record, output); } } } }
[ "@", "Override", "public", "void", "writeToOutput", "(", "final", "ChannelWriterOutputView", "output", ",", "final", "int", "start", ",", "int", "num", ")", "throws", "IOException", "{", "final", "TypeComparator", "<", "T", ">", "comparator", "=", "this", ".",...
Writes a subset of the records in this buffer in their logical order to the given output. @param output The output view to write the records to. @param start The logical start position of the subset. @param len The number of elements to write. @throws IOException Thrown, if an I/O exception occurred writing to the output view.
[ "Writes", "a", "subset", "of", "the", "records", "in", "this", "buffer", "in", "their", "logical", "order", "to", "the", "given", "output", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/sort/FixedLengthRecordSorter.java#L410-L442
tumblr/jumblr
src/main/java/com/tumblr/jumblr/JumblrClient.java
JumblrClient.postReblog
public Post postReblog(String blogName, Long postId, String reblogKey) { return this.postReblog(blogName, postId, reblogKey, null); }
java
public Post postReblog(String blogName, Long postId, String reblogKey) { return this.postReblog(blogName, postId, reblogKey, null); }
[ "public", "Post", "postReblog", "(", "String", "blogName", ",", "Long", "postId", ",", "String", "reblogKey", ")", "{", "return", "this", ".", "postReblog", "(", "blogName", ",", "postId", ",", "reblogKey", ",", "null", ")", ";", "}" ]
Reblog a given post @param blogName the name of the blog to post to @param postId the id of the post @param reblogKey the reblog_key of the post @return The created reblog Post or null
[ "Reblog", "a", "given", "post" ]
train
https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L360-L362
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java
ResourceBundlesHandlerImpl.joinAndPostProcessBundle
private void joinAndPostProcessBundle(CompositeResourceBundle composite, BundleProcessingStatus status) { JoinableResourceBundleContent store; stopProcessIfNeeded(); List<Map<String, String>> allVariants = VariantUtils.getAllVariants(composite.getVariants()); // Add the default bundle variant (the non variant one) allVariants.add(null); // Process all variants for (Map<String, String> variants : allVariants) { status.setBundleVariants(variants); store = new JoinableResourceBundleContent(); for (JoinableResourceBundle childbundle : composite.getChildBundles()) { if (!childbundle.getInclusionPattern().isIncludeOnlyOnDebug()) { JoinableResourceBundleContent childContent = joinAndPostprocessBundle(childbundle, variants, status); // Do unitary postprocessing. status.setProcessingType(BundleProcessingStatus.FILE_PROCESSING_TYPE); StringBuffer content = executeUnitaryPostProcessing(composite, status, childContent.getContent(), this.unitaryCompositePostProcessor); childContent.setContent(content); store.append(childContent); } } // Post process composite bundle as needed store = postProcessJoinedCompositeBundle(composite, store.getContent(), status); String variantKey = VariantUtils.getVariantKey(variants); String name = VariantUtils.getVariantBundleName(composite.getId(), variantKey, false); storeBundle(name, store); initBundleDataHashcode(composite, store, variantKey); } }
java
private void joinAndPostProcessBundle(CompositeResourceBundle composite, BundleProcessingStatus status) { JoinableResourceBundleContent store; stopProcessIfNeeded(); List<Map<String, String>> allVariants = VariantUtils.getAllVariants(composite.getVariants()); // Add the default bundle variant (the non variant one) allVariants.add(null); // Process all variants for (Map<String, String> variants : allVariants) { status.setBundleVariants(variants); store = new JoinableResourceBundleContent(); for (JoinableResourceBundle childbundle : composite.getChildBundles()) { if (!childbundle.getInclusionPattern().isIncludeOnlyOnDebug()) { JoinableResourceBundleContent childContent = joinAndPostprocessBundle(childbundle, variants, status); // Do unitary postprocessing. status.setProcessingType(BundleProcessingStatus.FILE_PROCESSING_TYPE); StringBuffer content = executeUnitaryPostProcessing(composite, status, childContent.getContent(), this.unitaryCompositePostProcessor); childContent.setContent(content); store.append(childContent); } } // Post process composite bundle as needed store = postProcessJoinedCompositeBundle(composite, store.getContent(), status); String variantKey = VariantUtils.getVariantKey(variants); String name = VariantUtils.getVariantBundleName(composite.getId(), variantKey, false); storeBundle(name, store); initBundleDataHashcode(composite, store, variantKey); } }
[ "private", "void", "joinAndPostProcessBundle", "(", "CompositeResourceBundle", "composite", ",", "BundleProcessingStatus", "status", ")", "{", "JoinableResourceBundleContent", "store", ";", "stopProcessIfNeeded", "(", ")", ";", "List", "<", "Map", "<", "String", ",", ...
Joins and post process the variant composite bundle @param composite the composite bundle @param status the status @param compositeBundleVariants the variants
[ "Joins", "and", "post", "process", "the", "variant", "composite", "bundle" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L1087-L1120
google/closure-compiler
src/com/google/javascript/jscomp/TypeValidator.java
TypeValidator.expectStringOrSymbol
void expectStringOrSymbol(Node n, JSType type, String msg) { if (!type.matchesStringContext() && !type.matchesSymbolContext()) { mismatch(n, msg, type, STRING_SYMBOL); } }
java
void expectStringOrSymbol(Node n, JSType type, String msg) { if (!type.matchesStringContext() && !type.matchesSymbolContext()) { mismatch(n, msg, type, STRING_SYMBOL); } }
[ "void", "expectStringOrSymbol", "(", "Node", "n", ",", "JSType", "type", ",", "String", "msg", ")", "{", "if", "(", "!", "type", ".", "matchesStringContext", "(", ")", "&&", "!", "type", ".", "matchesSymbolContext", "(", ")", ")", "{", "mismatch", "(", ...
Expect the type to be a string or symbol, or a type convertible to a string. If the expectation is not met, issue a warning at the provided node's source code position.
[ "Expect", "the", "type", "to", "be", "a", "string", "or", "symbol", "or", "a", "type", "convertible", "to", "a", "string", ".", "If", "the", "expectation", "is", "not", "met", "issue", "a", "warning", "at", "the", "provided", "node", "s", "source", "co...
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L423-L427
google/closure-compiler
src/com/google/javascript/jscomp/AstFactory.java
AstFactory.createYield
Node createYield(JSType jsType, Node value) { Node result = IR.yield(value); if (isAddingTypes()) { result.setJSType(checkNotNull(jsType)); } return result; }
java
Node createYield(JSType jsType, Node value) { Node result = IR.yield(value); if (isAddingTypes()) { result.setJSType(checkNotNull(jsType)); } return result; }
[ "Node", "createYield", "(", "JSType", "jsType", ",", "Node", "value", ")", "{", "Node", "result", "=", "IR", ".", "yield", "(", "value", ")", ";", "if", "(", "isAddingTypes", "(", ")", ")", "{", "result", ".", "setJSType", "(", "checkNotNull", "(", "...
Returns a new {@code yield} expression. @param jsType Type we expect to get back after the yield @param value value to yield
[ "Returns", "a", "new", "{", "@code", "yield", "}", "expression", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AstFactory.java#L186-L192
jamesagnew/hapi-fhir
hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/IniFile.java
IniFile.getDoubleProperty
public Double getDoubleProperty(String pstrSection, String pstrProp) { Double dblRet = null; String strVal = null; INIProperty objProp = null; INISection objSec = null; objSec = (INISection) this.mhmapSections.get(pstrSection); if (objSec != null) { objProp = objSec.getProperty(pstrProp); try { if (objProp != null) { strVal = objProp.getPropValue(); if (strVal != null) dblRet = new Double(strVal); } } catch (NumberFormatException NFExIgnore) { } finally { if (objProp != null) objProp = null; } objSec = null; } return dblRet; }
java
public Double getDoubleProperty(String pstrSection, String pstrProp) { Double dblRet = null; String strVal = null; INIProperty objProp = null; INISection objSec = null; objSec = (INISection) this.mhmapSections.get(pstrSection); if (objSec != null) { objProp = objSec.getProperty(pstrProp); try { if (objProp != null) { strVal = objProp.getPropValue(); if (strVal != null) dblRet = new Double(strVal); } } catch (NumberFormatException NFExIgnore) { } finally { if (objProp != null) objProp = null; } objSec = null; } return dblRet; }
[ "public", "Double", "getDoubleProperty", "(", "String", "pstrSection", ",", "String", "pstrProp", ")", "{", "Double", "dblRet", "=", "null", ";", "String", "strVal", "=", "null", ";", "INIProperty", "objProp", "=", "null", ";", "INISection", "objSec", "=", "...
Returns the specified double property from the specified section. @param pstrSection the INI section name. @param pstrProp the property to be retrieved. @return the double property value.
[ "Returns", "the", "specified", "double", "property", "from", "the", "specified", "section", "." ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-utilities/src/main/java/org/hl7/fhir/utilities/IniFile.java#L254-L283
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java
MCMPHandler.processCommand
void processCommand(final HttpServerExchange exchange, final RequestData requestData, final MCMPAction action) throws IOException { if (exchange.getRequestPath().equals("*") || exchange.getRequestPath().endsWith("/*")) { processNodeCommand(exchange, requestData, action); } else { processAppCommand(exchange, requestData, action); } }
java
void processCommand(final HttpServerExchange exchange, final RequestData requestData, final MCMPAction action) throws IOException { if (exchange.getRequestPath().equals("*") || exchange.getRequestPath().endsWith("/*")) { processNodeCommand(exchange, requestData, action); } else { processAppCommand(exchange, requestData, action); } }
[ "void", "processCommand", "(", "final", "HttpServerExchange", "exchange", ",", "final", "RequestData", "requestData", ",", "final", "MCMPAction", "action", ")", "throws", "IOException", "{", "if", "(", "exchange", ".", "getRequestPath", "(", ")", ".", "equals", ...
Process a mod_cluster mgmt command. @param exchange the http server exchange @param requestData the request data @param action the mgmt action @throws IOException
[ "Process", "a", "mod_cluster", "mgmt", "command", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java#L325-L331
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java
ExtendedPropertyUrl.addExtendedPropertiesUrl
public static MozuUrl addExtendedPropertiesUrl(String orderId, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/extendedproperties?updatemode={updateMode}&version={version}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("updateMode", updateMode); formatter.formatUrl("version", version); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl addExtendedPropertiesUrl(String orderId, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/extendedproperties?updatemode={updateMode}&version={version}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("updateMode", updateMode); formatter.formatUrl("version", version); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
[ "public", "static", "MozuUrl", "addExtendedPropertiesUrl", "(", "String", "orderId", ",", "String", "updateMode", ",", "String", "version", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/orders/{orderId}/extendedproperties?updatemod...
Get Resource Url for AddExtendedProperties @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 version Determines whether or not to check versioning of items for concurrency purposes. @return String Resource Url
[ "Get", "Resource", "Url", "for", "AddExtendedProperties" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java#L37-L44
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.rotateAroundLocal
public Matrix4f rotateAroundLocal(Quaternionfc quat, float ox, float oy, float oz) { return rotateAroundLocal(quat, ox, oy, oz, thisOrNew()); }
java
public Matrix4f rotateAroundLocal(Quaternionfc quat, float ox, float oy, float oz) { return rotateAroundLocal(quat, ox, oy, oz, thisOrNew()); }
[ "public", "Matrix4f", "rotateAroundLocal", "(", "Quaternionfc", "quat", ",", "float", "ox", ",", "float", "oy", ",", "float", "oz", ")", "{", "return", "rotateAroundLocal", "(", "quat", ",", "ox", ",", "oy", ",", "oz", ",", "thisOrNew", "(", ")", ")", ...
Pre-multiply the rotation transformation of the given {@link Quaternionfc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise. <p> If <code>M</code> is <code>this</code> matrix and <code>Q</code> the rotation matrix obtained from the given quaternion, then the new matrix will be <code>Q * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>Q * M * v</code>, the quaternion rotation will be applied last! <p> This method is equivalent to calling: <code>translateLocal(-ox, -oy, -oz).rotateLocal(quat).translateLocal(ox, oy, oz)</code> <p> Reference: <a href="http://en.wikipedia.org/wiki/Rotation_matrix#Quaternion">http://en.wikipedia.org</a> @param quat the {@link Quaternionfc} @param ox the x coordinate of the rotation origin @param oy the y coordinate of the rotation origin @param oz the z coordinate of the rotation origin @return a matrix holding the result
[ "Pre", "-", "multiply", "the", "rotation", "transformation", "of", "the", "given", "{", "@link", "Quaternionfc", "}", "to", "this", "matrix", "while", "using", "<code", ">", "(", "ox", "oy", "oz", ")", "<", "/", "code", ">", "as", "the", "rotation", "o...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L11563-L11565
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.mapping
public static void mapping(String mappedFieldName, String mappedClassName, String targetFieldName, String targetClassName){ throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException4,mappedFieldName,mappedClassName, targetFieldName,targetClassName)); }
java
public static void mapping(String mappedFieldName, String mappedClassName, String targetFieldName, String targetClassName){ throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException4,mappedFieldName,mappedClassName, targetFieldName,targetClassName)); }
[ "public", "static", "void", "mapping", "(", "String", "mappedFieldName", ",", "String", "mappedClassName", ",", "String", "targetFieldName", ",", "String", "targetClassName", ")", "{", "throw", "new", "MappingErrorException", "(", "MSG", ".", "INSTANCE", ".", "mes...
Thrown when the target field doesn't exist. @param mappedFieldName name of the mapped field @param mappedClassName name of the mapped field's class @param targetFieldName name of the target field @param targetClassName name of the target field's class
[ "Thrown", "when", "the", "target", "field", "doesn", "t", "exist", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L482-L484
podio/podio-java
src/main/java/com/podio/tag/TagAPI.java
TagAPI.getTagsOnOrg
public List<TagCount> getTagsOnOrg(int orgId, int limit, String text) { MultivaluedMap<String, String> params=new MultivaluedMapImpl(); params.add("limit", new Integer(limit).toString()); if ((text != null) && (!text.isEmpty())) { params.add("text", text); } return getTagsOnOrg(orgId, params); }
java
public List<TagCount> getTagsOnOrg(int orgId, int limit, String text) { MultivaluedMap<String, String> params=new MultivaluedMapImpl(); params.add("limit", new Integer(limit).toString()); if ((text != null) && (!text.isEmpty())) { params.add("text", text); } return getTagsOnOrg(orgId, params); }
[ "public", "List", "<", "TagCount", ">", "getTagsOnOrg", "(", "int", "orgId", ",", "int", "limit", ",", "String", "text", ")", "{", "MultivaluedMap", "<", "String", ",", "String", ">", "params", "=", "new", "MultivaluedMapImpl", "(", ")", ";", "params", "...
Returns the tags on the given org. This includes both items and statuses on all spaces in the organization that the user is part of. The tags are first limited ordered by their frequency of use, and then returned sorted alphabetically. @param orgId The id of the org to return tags from @param limit limit on number of tags returned (max 250) @param text text of tag to search for @return The list of tags with their count
[ "Returns", "the", "tags", "on", "the", "given", "org", ".", "This", "includes", "both", "items", "and", "statuses", "on", "all", "spaces", "in", "the", "organization", "that", "the", "user", "is", "part", "of", ".", "The", "tags", "are", "first", "limite...
train
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L199-L206
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java
GeometryCoordinateDimension.convert
public static MultiPolygon convert(MultiPolygon multiPolygon,int dimension) { int nb = multiPolygon.getNumGeometries(); final Polygon[] pl = new Polygon[nb]; for (int i = 0; i < nb; i++) { pl[i] = GeometryCoordinateDimension.convert((Polygon) multiPolygon.getGeometryN(i),dimension); } return gf.createMultiPolygon(pl); }
java
public static MultiPolygon convert(MultiPolygon multiPolygon,int dimension) { int nb = multiPolygon.getNumGeometries(); final Polygon[] pl = new Polygon[nb]; for (int i = 0; i < nb; i++) { pl[i] = GeometryCoordinateDimension.convert((Polygon) multiPolygon.getGeometryN(i),dimension); } return gf.createMultiPolygon(pl); }
[ "public", "static", "MultiPolygon", "convert", "(", "MultiPolygon", "multiPolygon", ",", "int", "dimension", ")", "{", "int", "nb", "=", "multiPolygon", ".", "getNumGeometries", "(", ")", ";", "final", "Polygon", "[", "]", "pl", "=", "new", "Polygon", "[", ...
Force the dimension of the MultiPolygon and update correctly the coordinate dimension @param multiPolygon @param dimension @return
[ "Force", "the", "dimension", "of", "the", "MultiPolygon", "and", "update", "correctly", "the", "coordinate", "dimension" ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L94-L101
aaberg/sql2o
core/src/main/java/org/sql2o/Sql2o.java
Sql2o.createQuery
@Deprecated public Query createQuery(String query, boolean returnGeneratedKeys) { return new Connection(this, true).createQuery(query, returnGeneratedKeys); }
java
@Deprecated public Query createQuery(String query, boolean returnGeneratedKeys) { return new Connection(this, true).createQuery(query, returnGeneratedKeys); }
[ "@", "Deprecated", "public", "Query", "createQuery", "(", "String", "query", ",", "boolean", "returnGeneratedKeys", ")", "{", "return", "new", "Connection", "(", "this", ",", "true", ")", ".", "createQuery", "(", "query", ",", "returnGeneratedKeys", ")", ";", ...
Creates a {@link Query} @param query the sql query string @param returnGeneratedKeys boolean value indicating if the database should return any generated keys. @return the {@link Query} instance @deprecated create queries with {@link org.sql2o.Connection} class instead, using try-with-resource blocks <code> try (Connection con = sql2o.open()) { return sql2o.createQuery(query, name, returnGeneratedKeys).executeAndFetch(Pojo.class); } </code>
[ "Creates", "a", "{", "@link", "Query", "}", "@param", "query", "the", "sql", "query", "string", "@param", "returnGeneratedKeys", "boolean", "value", "indicating", "if", "the", "database", "should", "return", "any", "generated", "keys", ".", "@return", "the", "...
train
https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Sql2o.java#L167-L170
zandero/rest.vertx
src/main/java/com/zandero/rest/data/ArgumentProvider.java
ArgumentProvider.removeMatrixFromPath
private static String removeMatrixFromPath(String path, RouteDefinition definition) { // simple removal ... we don't care what matrix attributes were given if (definition.hasMatrixParams()) { int index = path.indexOf(";"); if (index > 0) { return path.substring(0, index); } } return path; }
java
private static String removeMatrixFromPath(String path, RouteDefinition definition) { // simple removal ... we don't care what matrix attributes were given if (definition.hasMatrixParams()) { int index = path.indexOf(";"); if (index > 0) { return path.substring(0, index); } } return path; }
[ "private", "static", "String", "removeMatrixFromPath", "(", "String", "path", ",", "RouteDefinition", "definition", ")", "{", "// simple removal ... we don't care what matrix attributes were given", "if", "(", "definition", ".", "hasMatrixParams", "(", ")", ")", "{", "int...
Removes matrix params from path @param path to clean up @param definition to check if matrix params are present @return cleaned up path
[ "Removes", "matrix", "params", "from", "path" ]
train
https://github.com/zandero/rest.vertx/blob/ba458720cf59e076953eab9dac7227eeaf9e58ce/src/main/java/com/zandero/rest/data/ArgumentProvider.java#L268-L279
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/scheduler/SecondsBasedEntryTaskScheduler.java
SecondsBasedEntryTaskScheduler.cleanUpScheduledFuturesIfEmpty
private void cleanUpScheduledFuturesIfEmpty(Integer second, Map<Object, ScheduledEntry<K, V>> entries) { if (entries.isEmpty()) { scheduledEntries.remove(second); ScheduledFuture removedFeature = scheduledTaskMap.remove(second); if (removedFeature != null) { removedFeature.cancel(false); } } }
java
private void cleanUpScheduledFuturesIfEmpty(Integer second, Map<Object, ScheduledEntry<K, V>> entries) { if (entries.isEmpty()) { scheduledEntries.remove(second); ScheduledFuture removedFeature = scheduledTaskMap.remove(second); if (removedFeature != null) { removedFeature.cancel(false); } } }
[ "private", "void", "cleanUpScheduledFuturesIfEmpty", "(", "Integer", "second", ",", "Map", "<", "Object", ",", "ScheduledEntry", "<", "K", ",", "V", ">", ">", "entries", ")", "{", "if", "(", "entries", ".", "isEmpty", "(", ")", ")", "{", "scheduledEntries"...
Cancels the scheduled future and removes the entries map for the given second If no entries are left <p/> Cleans up parent container (second -> entries map) if it doesn't hold anymore items this second. <p/> Cancels associated scheduler (second -> scheduler map ) if there are no more items to remove for this second. @param second second at which this entry was scheduled to be evicted @param entries entries which were already scheduled to be evicted for this second
[ "Cancels", "the", "scheduled", "future", "and", "removes", "the", "entries", "map", "for", "the", "given", "second", "If", "no", "entries", "are", "left", "<p", "/", ">", "Cleans", "up", "parent", "container", "(", "second", "-", ">", "entries", "map", "...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/scheduler/SecondsBasedEntryTaskScheduler.java#L348-L357
landawn/AbacusUtil
src/com/landawn/abacus/dataSource/PoolableConnection.java
PoolableConnection.prepareStatement
@Override public PoolablePreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return prepareStatement(sql, -1, resultSetType, resultSetConcurrency, -1); }
java
@Override public PoolablePreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return prepareStatement(sql, -1, resultSetType, resultSetConcurrency, -1); }
[ "@", "Override", "public", "PoolablePreparedStatement", "prepareStatement", "(", "String", "sql", ",", "int", "resultSetType", ",", "int", "resultSetConcurrency", ")", "throws", "SQLException", "{", "return", "prepareStatement", "(", "sql", ",", "-", "1", ",", "re...
Method prepareStatement. @param sql @param resultSetType @param resultSetConcurrency @return PreparedStatement @throws SQLException @see java.sql.Connection#prepareStatement(String, int, int)
[ "Method", "prepareStatement", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L551-L554
pac4j/pac4j
pac4j-core/src/main/java/org/pac4j/core/engine/decision/DefaultProfileStorageDecision.java
DefaultProfileStorageDecision.mustLoadProfilesFromSession
@Override public boolean mustLoadProfilesFromSession(final C context, final List<Client> currentClients) { return isEmpty(currentClients) || currentClients.get(0) instanceof IndirectClient || currentClients.get(0) instanceof AnonymousClient; }
java
@Override public boolean mustLoadProfilesFromSession(final C context, final List<Client> currentClients) { return isEmpty(currentClients) || currentClients.get(0) instanceof IndirectClient || currentClients.get(0) instanceof AnonymousClient; }
[ "@", "Override", "public", "boolean", "mustLoadProfilesFromSession", "(", "final", "C", "context", ",", "final", "List", "<", "Client", ">", "currentClients", ")", "{", "return", "isEmpty", "(", "currentClients", ")", "||", "currentClients", ".", "get", "(", "...
Load the profiles from the web session if no clients are defined or if the first client is an indirect one or if the first client is the anonymous one. @param context the web context @param currentClients the current clients @return whether the profiles must be loaded from the web session
[ "Load", "the", "profiles", "from", "the", "web", "session", "if", "no", "clients", "are", "defined", "or", "if", "the", "first", "client", "is", "an", "indirect", "one", "or", "if", "the", "first", "client", "is", "the", "anonymous", "one", "." ]
train
https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/engine/decision/DefaultProfileStorageDecision.java#L30-L34
haifengl/smile
data/src/main/java/smile/data/parser/ArffParser.java
ArffParser.getLastToken
private void getLastToken(StreamTokenizer tokenizer, boolean endOfFileOk) throws IOException, ParseException { if ((tokenizer.nextToken() != StreamTokenizer.TT_EOL) && ((tokenizer.ttype != StreamTokenizer.TT_EOF) || !endOfFileOk)) { throw new ParseException("end of line expected", tokenizer.lineno()); } }
java
private void getLastToken(StreamTokenizer tokenizer, boolean endOfFileOk) throws IOException, ParseException { if ((tokenizer.nextToken() != StreamTokenizer.TT_EOL) && ((tokenizer.ttype != StreamTokenizer.TT_EOF) || !endOfFileOk)) { throw new ParseException("end of line expected", tokenizer.lineno()); } }
[ "private", "void", "getLastToken", "(", "StreamTokenizer", "tokenizer", ",", "boolean", "endOfFileOk", ")", "throws", "IOException", ",", "ParseException", "{", "if", "(", "(", "tokenizer", ".", "nextToken", "(", ")", "!=", "StreamTokenizer", ".", "TT_EOL", ")",...
Gets token and checks if it's end of line. @param endOfFileOk true if EOF is OK @throws IllegalStateException if it doesn't find an end of line
[ "Gets", "token", "and", "checks", "if", "it", "s", "end", "of", "line", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/data/src/main/java/smile/data/parser/ArffParser.java#L153-L157
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/cs/cspolicylabel_binding.java
cspolicylabel_binding.get
public static cspolicylabel_binding get(nitro_service service, String labelname) throws Exception{ cspolicylabel_binding obj = new cspolicylabel_binding(); obj.set_labelname(labelname); cspolicylabel_binding response = (cspolicylabel_binding) obj.get_resource(service); return response; }
java
public static cspolicylabel_binding get(nitro_service service, String labelname) throws Exception{ cspolicylabel_binding obj = new cspolicylabel_binding(); obj.set_labelname(labelname); cspolicylabel_binding response = (cspolicylabel_binding) obj.get_resource(service); return response; }
[ "public", "static", "cspolicylabel_binding", "get", "(", "nitro_service", "service", ",", "String", "labelname", ")", "throws", "Exception", "{", "cspolicylabel_binding", "obj", "=", "new", "cspolicylabel_binding", "(", ")", ";", "obj", ".", "set_labelname", "(", ...
Use this API to fetch cspolicylabel_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "cspolicylabel_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cs/cspolicylabel_binding.java#L103-L108
ben-manes/caffeine
jcache/src/main/java/com/github/benmanes/caffeine/jcache/copy/AbstractCopier.java
AbstractCopier.roundtrip
protected <T> T roundtrip(T object, ClassLoader classLoader) { A data = serialize(object); @SuppressWarnings("unchecked") T copy = (T) deserialize(data, classLoader); return copy; }
java
protected <T> T roundtrip(T object, ClassLoader classLoader) { A data = serialize(object); @SuppressWarnings("unchecked") T copy = (T) deserialize(data, classLoader); return copy; }
[ "protected", "<", "T", ">", "T", "roundtrip", "(", "T", "object", ",", "ClassLoader", "classLoader", ")", "{", "A", "data", "=", "serialize", "(", "object", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "copy", "=", "(", "T", ")", ...
Performs the serialization and deserialization, returning the copied object. @param object the object to serialize @param classLoader the classloader to create the instance with @param <T> the type of object being copied @return the deserialized object
[ "Performs", "the", "serialization", "and", "deserialization", "returning", "the", "copied", "object", "." ]
train
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/copy/AbstractCopier.java#L159-L164
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java
AnycastOutputHandler.streamIsFlushed
public final void streamIsFlushed(AOStream stream) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "streamIsFlushed", stream); // we schedule an asynchronous removal of the persistent data synchronized (streamTable) { String key = SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid()); StreamInfo sinfo = streamTable.get(key); if ((sinfo != null) && sinfo.streamId.equals(stream.streamId)) { RemovePersistentStream update = null; synchronized (sinfo) { // synchronized since reading sinfo.item update = new RemovePersistentStream(key, sinfo.streamId, sinfo.itemStream, sinfo.item); } doEnqueueWork(update); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "streamIsFlushed"); }
java
public final void streamIsFlushed(AOStream stream) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "streamIsFlushed", stream); // we schedule an asynchronous removal of the persistent data synchronized (streamTable) { String key = SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid()); StreamInfo sinfo = streamTable.get(key); if ((sinfo != null) && sinfo.streamId.equals(stream.streamId)) { RemovePersistentStream update = null; synchronized (sinfo) { // synchronized since reading sinfo.item update = new RemovePersistentStream(key, sinfo.streamId, sinfo.itemStream, sinfo.item); } doEnqueueWork(update); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "streamIsFlushed"); }
[ "public", "final", "void", "streamIsFlushed", "(", "AOStream", "stream", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"streamIsFlushed\...
Callback from a stream, that it has been flushed @param stream
[ "Callback", "from", "a", "stream", "that", "it", "has", "been", "flushed" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java#L1963-L1986
betfair/cougar
cougar-codegen-plugin/src/main/java/com/betfair/cougar/codegen/IdlToDSMojo.java
IdlToDSMojo.prepWsdlXsl
private void prepWsdlXsl() throws MojoExecutionException { try { wsdlXsl = new File(getBaseDir(), wsdlXslFile); initOutputDir(wsdlXsl.getParentFile()); writeWsdlStylesheet(wsdlXsl); } catch (Exception e) { throw new MojoExecutionException("Failed to write local copy of WSDL stylesheet: " + e, e); } }
java
private void prepWsdlXsl() throws MojoExecutionException { try { wsdlXsl = new File(getBaseDir(), wsdlXslFile); initOutputDir(wsdlXsl.getParentFile()); writeWsdlStylesheet(wsdlXsl); } catch (Exception e) { throw new MojoExecutionException("Failed to write local copy of WSDL stylesheet: " + e, e); } }
[ "private", "void", "prepWsdlXsl", "(", ")", "throws", "MojoExecutionException", "{", "try", "{", "wsdlXsl", "=", "new", "File", "(", "getBaseDir", "(", ")", ",", "wsdlXslFile", ")", ";", "initOutputDir", "(", "wsdlXsl", ".", "getParentFile", "(", ")", ")", ...
Read a wsdl.xsl (stylesheet) from a resource, and write it to a working directory. @return the on-disk wsdl.xsl file
[ "Read", "a", "wsdl", ".", "xsl", "(", "stylesheet", ")", "from", "a", "resource", "and", "write", "it", "to", "a", "working", "directory", "." ]
train
https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-codegen-plugin/src/main/java/com/betfair/cougar/codegen/IdlToDSMojo.java#L318-L326
atomix/atomix
storage/src/main/java/io/atomix/storage/statistics/StorageStatistics.java
StorageStatistics.getFreeMemory
public long getFreeMemory() { try { return (long) mBeanServer.getAttribute(new ObjectName("java.lang", "type", "OperatingSystem"), "FreePhysicalMemorySize"); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("An exception occurred during memory check", e); } } return -1; }
java
public long getFreeMemory() { try { return (long) mBeanServer.getAttribute(new ObjectName("java.lang", "type", "OperatingSystem"), "FreePhysicalMemorySize"); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("An exception occurred during memory check", e); } } return -1; }
[ "public", "long", "getFreeMemory", "(", ")", "{", "try", "{", "return", "(", "long", ")", "mBeanServer", ".", "getAttribute", "(", "new", "ObjectName", "(", "\"java.lang\"", ",", "\"type\"", ",", "\"OperatingSystem\"", ")", ",", "\"FreePhysicalMemorySize\"", ")"...
Returns the amount of free memory remaining. @return the amount of free memory remaining if successful, -1 return indicates failure.
[ "Returns", "the", "amount", "of", "free", "memory", "remaining", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/storage/src/main/java/io/atomix/storage/statistics/StorageStatistics.java#L73-L82
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java
InstanceId.of
public static InstanceId of(ZoneId zoneId, String instance) { return new InstanceId(zoneId.getProject(), zoneId.getZone(), instance); }
java
public static InstanceId of(ZoneId zoneId, String instance) { return new InstanceId(zoneId.getProject(), zoneId.getZone(), instance); }
[ "public", "static", "InstanceId", "of", "(", "ZoneId", "zoneId", ",", "String", "instance", ")", "{", "return", "new", "InstanceId", "(", "zoneId", ".", "getProject", "(", ")", ",", "zoneId", ".", "getZone", "(", ")", ",", "instance", ")", ";", "}" ]
Returns an instance identity given the zone identity and the instance name. The instance name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. @see <a href="https://www.ietf.org/rfc/rfc1035.txt">RFC1035</a>
[ "Returns", "an", "instance", "identity", "given", "the", "zone", "identity", "and", "the", "instance", "name", ".", "The", "instance", "name", "must", "be", "1", "-", "63", "characters", "long", "and", "comply", "with", "RFC1035", ".", "Specifically", "the",...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/InstanceId.java#L127-L129
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java
ListManagementImagesImpl.addImageWithServiceResponseAsync
public Observable<ServiceResponse<Image>> addImageWithServiceResponseAsync(String listId, AddImageOptionalParameter addImageOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null."); } if (listId == null) { throw new IllegalArgumentException("Parameter listId is required and cannot be null."); } final Integer tag = addImageOptionalParameter != null ? addImageOptionalParameter.tag() : null; final String label = addImageOptionalParameter != null ? addImageOptionalParameter.label() : null; return addImageWithServiceResponseAsync(listId, tag, label); }
java
public Observable<ServiceResponse<Image>> addImageWithServiceResponseAsync(String listId, AddImageOptionalParameter addImageOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null."); } if (listId == null) { throw new IllegalArgumentException("Parameter listId is required and cannot be null."); } final Integer tag = addImageOptionalParameter != null ? addImageOptionalParameter.tag() : null; final String label = addImageOptionalParameter != null ? addImageOptionalParameter.label() : null; return addImageWithServiceResponseAsync(listId, tag, label); }
[ "public", "Observable", "<", "ServiceResponse", "<", "Image", ">", ">", "addImageWithServiceResponseAsync", "(", "String", "listId", ",", "AddImageOptionalParameter", "addImageOptionalParameter", ")", "{", "if", "(", "this", ".", "client", ".", "baseUrl", "(", ")", ...
Add an image to the list with list Id equal to list Id passed. @param listId List Id of the image list. @param addImageOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the Image object
[ "Add", "an", "image", "to", "the", "list", "with", "list", "Id", "equal", "to", "list", "Id", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L147-L158
h2oai/h2o-3
h2o-extensions/xgboost/src/main/java/ml/dmlc/xgboost4j/java/XGBoostSetupTask.java
XGBoostSetupTask.findFrameNodes
public static FrameNodes findFrameNodes(Frame fr) { // Count on how many nodes the data resides boolean[] nodesHoldingFrame = new boolean[H2O.CLOUD.size()]; Vec vec = fr.anyVec(); for(int chunkNr = 0; chunkNr < vec.nChunks(); chunkNr++) { int home = vec.chunkKey(chunkNr).home_node().index(); if (! nodesHoldingFrame[home]) nodesHoldingFrame[home] = true; } return new FrameNodes(fr, nodesHoldingFrame); }
java
public static FrameNodes findFrameNodes(Frame fr) { // Count on how many nodes the data resides boolean[] nodesHoldingFrame = new boolean[H2O.CLOUD.size()]; Vec vec = fr.anyVec(); for(int chunkNr = 0; chunkNr < vec.nChunks(); chunkNr++) { int home = vec.chunkKey(chunkNr).home_node().index(); if (! nodesHoldingFrame[home]) nodesHoldingFrame[home] = true; } return new FrameNodes(fr, nodesHoldingFrame); }
[ "public", "static", "FrameNodes", "findFrameNodes", "(", "Frame", "fr", ")", "{", "// Count on how many nodes the data resides", "boolean", "[", "]", "nodesHoldingFrame", "=", "new", "boolean", "[", "H2O", ".", "CLOUD", ".", "size", "(", ")", "]", ";", "Vec", ...
Finds what nodes actually do carry some of data of a given Frame @param fr frame to find nodes for @return FrameNodes
[ "Finds", "what", "nodes", "actually", "do", "carry", "some", "of", "data", "of", "a", "given", "Frame" ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-extensions/xgboost/src/main/java/ml/dmlc/xgboost4j/java/XGBoostSetupTask.java#L82-L92
aws/aws-sdk-java
aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/InputTemplate.java
InputTemplate.withCaptionSelectors
public InputTemplate withCaptionSelectors(java.util.Map<String, CaptionSelector> captionSelectors) { setCaptionSelectors(captionSelectors); return this; }
java
public InputTemplate withCaptionSelectors(java.util.Map<String, CaptionSelector> captionSelectors) { setCaptionSelectors(captionSelectors); return this; }
[ "public", "InputTemplate", "withCaptionSelectors", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "CaptionSelector", ">", "captionSelectors", ")", "{", "setCaptionSelectors", "(", "captionSelectors", ")", ";", "return", "this", ";", "}" ]
Use Captions selectors (CaptionSelectors) to specify the captions data from the input that you will use in your outputs. You can use mutiple captions selectors per input. @param captionSelectors Use Captions selectors (CaptionSelectors) to specify the captions data from the input that you will use in your outputs. You can use mutiple captions selectors per input. @return Returns a reference to this object so that method calls can be chained together.
[ "Use", "Captions", "selectors", "(", "CaptionSelectors", ")", "to", "specify", "the", "captions", "data", "from", "the", "input", "that", "you", "will", "use", "in", "your", "outputs", ".", "You", "can", "use", "mutiple", "captions", "selectors", "per", "inp...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/InputTemplate.java#L259-L262
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ShortExtensions.java
ShortExtensions.operator_tripleEquals
@Pure @Inline(value="($1 == $2)", constantExpression=true) public static boolean operator_tripleEquals(short a, long b) { return a == b; }
java
@Pure @Inline(value="($1 == $2)", constantExpression=true) public static boolean operator_tripleEquals(short a, long b) { return a == b; }
[ "@", "Pure", "@", "Inline", "(", "value", "=", "\"($1 == $2)\"", ",", "constantExpression", "=", "true", ")", "public", "static", "boolean", "operator_tripleEquals", "(", "short", "a", ",", "long", "b", ")", "{", "return", "a", "==", "b", ";", "}" ]
The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code> operator. @param a a short. @param b a long. @return <code>a == b</code> @since 2.4
[ "The", "<code", ">", "identity", "equals<", "/", "code", ">", "operator", ".", "This", "is", "the", "equivalent", "to", "Java", "s", "<code", ">", "==", "<", "/", "code", ">", "operator", "." ]
train
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ShortExtensions.java#L654-L658
Azure/azure-sdk-for-java
redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java
RedisInner.updateAsync
public Observable<RedisResourceInner> updateAsync(String resourceGroupName, String name, RedisUpdateParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<RedisResourceInner>, RedisResourceInner>() { @Override public RedisResourceInner call(ServiceResponse<RedisResourceInner> response) { return response.body(); } }); }
java
public Observable<RedisResourceInner> updateAsync(String resourceGroupName, String name, RedisUpdateParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<RedisResourceInner>, RedisResourceInner>() { @Override public RedisResourceInner call(ServiceResponse<RedisResourceInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "RedisResourceInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "RedisUpdateParameters", "parameters", ")", "{", "return", "updateWithServiceResponseAsync", "(", "resourceGroupName", ",", "name", ","...
Update an existing Redis cache. @param resourceGroupName The name of the resource group. @param name The name of the Redis cache. @param parameters Parameters supplied to the Update Redis operation. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the RedisResourceInner object
[ "Update", "an", "existing", "Redis", "cache", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L534-L541
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.license_office_new_GET
public ArrayList<String> license_office_new_GET(String giftCode, Long officeBusinessQuantity, Long officeProPlusQuantity) throws IOException { String qPath = "/order/license/office/new"; StringBuilder sb = path(qPath); query(sb, "giftCode", giftCode); query(sb, "officeBusinessQuantity", officeBusinessQuantity); query(sb, "officeProPlusQuantity", officeProPlusQuantity); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t1); }
java
public ArrayList<String> license_office_new_GET(String giftCode, Long officeBusinessQuantity, Long officeProPlusQuantity) throws IOException { String qPath = "/order/license/office/new"; StringBuilder sb = path(qPath); query(sb, "giftCode", giftCode); query(sb, "officeBusinessQuantity", officeBusinessQuantity); query(sb, "officeProPlusQuantity", officeProPlusQuantity); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t1); }
[ "public", "ArrayList", "<", "String", ">", "license_office_new_GET", "(", "String", "giftCode", ",", "Long", "officeBusinessQuantity", ",", "Long", "officeProPlusQuantity", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/license/office/new\"", ";", ...
Get allowed durations for 'new' option REST: GET /order/license/office/new @param officeProPlusQuantity [required] Number of prepaid office pro plus license @param officeBusinessQuantity [required] Number of prepaid office business license @param giftCode [required] Gift code for office license
[ "Get", "allowed", "durations", "for", "new", "option" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1688-L1696
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java
Error.classNotMapped
public static void classNotMapped(Object sourceClass, Class<?> configuredClass){ String sourceName = sourceClass instanceof Class?((Class<?>)sourceClass).getSimpleName():sourceClass.getClass().getSimpleName(); throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException2,sourceName, configuredClass.getSimpleName())); }
java
public static void classNotMapped(Object sourceClass, Class<?> configuredClass){ String sourceName = sourceClass instanceof Class?((Class<?>)sourceClass).getSimpleName():sourceClass.getClass().getSimpleName(); throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException2,sourceName, configuredClass.getSimpleName())); }
[ "public", "static", "void", "classNotMapped", "(", "Object", "sourceClass", ",", "Class", "<", "?", ">", "configuredClass", ")", "{", "String", "sourceName", "=", "sourceClass", "instanceof", "Class", "?", "(", "(", "Class", "<", "?", ">", ")", "sourceClass"...
Thrown if the sourceClass isn't mapped in configuredClass. @param sourceClass class absent @param configuredClass class that not contains sourceClass
[ "Thrown", "if", "the", "sourceClass", "isn", "t", "mapped", "in", "configuredClass", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L573-L576
meertensinstituut/mtas
src/main/java/mtas/parser/cql/util/MtasCQLParserSentenceCondition.java
MtasCQLParserSentenceCondition.createQuery
private MtasSpanQuery createQuery( List<MtasCQLParserSentenceCondition> sentenceSequence) throws ParseException { if (sentenceSequence.size() == 1) { if (maximumOccurence > 1) { return new MtasSpanRecurrenceQuery(sentenceSequence.get(0).getQuery(), minimumOccurence, maximumOccurence, ignore, maximumIgnoreLength); } else { return sentenceSequence.get(0).getQuery(); } } else { List<MtasSpanSequenceItem> clauses = new ArrayList<MtasSpanSequenceItem>(); for (MtasCQLParserSentenceCondition sentence : sentenceSequence) { clauses.add( new MtasSpanSequenceItem(sentence.getQuery(), sentence.optional)); } if (maximumOccurence > 1) { return new MtasSpanRecurrenceQuery( new MtasSpanSequenceQuery(clauses, ignore, maximumIgnoreLength), minimumOccurence, maximumOccurence, ignore, maximumIgnoreLength); } else { return new MtasSpanSequenceQuery(clauses, ignore, maximumIgnoreLength); } } }
java
private MtasSpanQuery createQuery( List<MtasCQLParserSentenceCondition> sentenceSequence) throws ParseException { if (sentenceSequence.size() == 1) { if (maximumOccurence > 1) { return new MtasSpanRecurrenceQuery(sentenceSequence.get(0).getQuery(), minimumOccurence, maximumOccurence, ignore, maximumIgnoreLength); } else { return sentenceSequence.get(0).getQuery(); } } else { List<MtasSpanSequenceItem> clauses = new ArrayList<MtasSpanSequenceItem>(); for (MtasCQLParserSentenceCondition sentence : sentenceSequence) { clauses.add( new MtasSpanSequenceItem(sentence.getQuery(), sentence.optional)); } if (maximumOccurence > 1) { return new MtasSpanRecurrenceQuery( new MtasSpanSequenceQuery(clauses, ignore, maximumIgnoreLength), minimumOccurence, maximumOccurence, ignore, maximumIgnoreLength); } else { return new MtasSpanSequenceQuery(clauses, ignore, maximumIgnoreLength); } } }
[ "private", "MtasSpanQuery", "createQuery", "(", "List", "<", "MtasCQLParserSentenceCondition", ">", "sentenceSequence", ")", "throws", "ParseException", "{", "if", "(", "sentenceSequence", ".", "size", "(", ")", "==", "1", ")", "{", "if", "(", "maximumOccurence", ...
Creates the query. @param sentenceSequence the sentence sequence @return the mtas span query @throws ParseException the parse exception
[ "Creates", "the", "query", "." ]
train
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/parser/cql/util/MtasCQLParserSentenceCondition.java#L552-L576
peholmst/vaadin4spring
extensions/core/src/main/java/org/vaadin/spring/util/ClassUtils.java
ClassUtils.visitClassHierarchy
public static void visitClassHierarchy(ClassVisitor visitor, Class<?> subClass) { Class<?> visitedClass = subClass; while (visitedClass.getSuperclass() != null) { visitor.visit(visitedClass); visitedClass = visitedClass.getSuperclass(); } }
java
public static void visitClassHierarchy(ClassVisitor visitor, Class<?> subClass) { Class<?> visitedClass = subClass; while (visitedClass.getSuperclass() != null) { visitor.visit(visitedClass); visitedClass = visitedClass.getSuperclass(); } }
[ "public", "static", "void", "visitClassHierarchy", "(", "ClassVisitor", "visitor", ",", "Class", "<", "?", ">", "subClass", ")", "{", "Class", "<", "?", ">", "visitedClass", "=", "subClass", ";", "while", "(", "visitedClass", ".", "getSuperclass", "(", ")", ...
Visits the entire class hierarchy from {@code subClass} to {@code Object}. @param visitor the visitor to use, must not be {@code null}. @param subClass the class whose hierarchy is to be visited, must not be {@code null}.
[ "Visits", "the", "entire", "class", "hierarchy", "from", "{", "@code", "subClass", "}", "to", "{", "@code", "Object", "}", "." ]
train
https://github.com/peholmst/vaadin4spring/blob/ea896012f15d6abea6e6391def9a0001113a1f7a/extensions/core/src/main/java/org/vaadin/spring/util/ClassUtils.java#L41-L47