repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
188
func_name
stringlengths
7
127
whole_func_string
stringlengths
77
3.91k
language
stringclasses
1 value
func_code_string
stringlengths
77
3.91k
func_code_tokens
listlengths
20
745
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
477
split_name
stringclasses
1 value
func_code_url
stringlengths
111
288
sagiegurari/fax4j
src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java
WindowsJNIFaxClientSpi.winCancelFaxJob
private void winCancelFaxJob(String serverName,int faxJobID) { synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK) { //pre native call this.preNativeCall(); //invoke native WindowsJNIFaxClientSpi.cancelFaxJobNative(serverName,faxJobID); } }
java
private void winCancelFaxJob(String serverName,int faxJobID) { synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK) { //pre native call this.preNativeCall(); //invoke native WindowsJNIFaxClientSpi.cancelFaxJobNative(serverName,faxJobID); } }
[ "private", "void", "winCancelFaxJob", "(", "String", "serverName", ",", "int", "faxJobID", ")", "{", "synchronized", "(", "WindowsFaxClientSpiHelper", ".", "NATIVE_LOCK", ")", "{", "//pre native call", "this", ".", "preNativeCall", "(", ")", ";", "//invoke native", ...
This function will cancel an existing fax job. @param serverName The fax server name @param faxJobID The fax job ID
[ "This", "function", "will", "cancel", "an", "existing", "fax", "job", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java#L328-L338
Azure/azure-sdk-for-java
policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java
PolicyStatesInner.listQueryResultsForSubscriptionAsync
public Observable<PolicyStatesQueryResultsInner> listQueryResultsForSubscriptionAsync(PolicyStatesResource policyStatesResource, String subscriptionId, QueryOptions queryOptions) { return listQueryResultsForSubscriptionWithServiceResponseAsync(policyStatesResource, subscriptionId, queryOptions).map(new Func1<ServiceResponse<PolicyStatesQueryResultsInner>, PolicyStatesQueryResultsInner>() { @Override public PolicyStatesQueryResultsInner call(ServiceResponse<PolicyStatesQueryResultsInner> response) { return response.body(); } }); }
java
public Observable<PolicyStatesQueryResultsInner> listQueryResultsForSubscriptionAsync(PolicyStatesResource policyStatesResource, String subscriptionId, QueryOptions queryOptions) { return listQueryResultsForSubscriptionWithServiceResponseAsync(policyStatesResource, subscriptionId, queryOptions).map(new Func1<ServiceResponse<PolicyStatesQueryResultsInner>, PolicyStatesQueryResultsInner>() { @Override public PolicyStatesQueryResultsInner call(ServiceResponse<PolicyStatesQueryResultsInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "PolicyStatesQueryResultsInner", ">", "listQueryResultsForSubscriptionAsync", "(", "PolicyStatesResource", "policyStatesResource", ",", "String", "subscriptionId", ",", "QueryOptions", "queryOptions", ")", "{", "return", "listQueryResultsForSubscripti...
Queries policy states for the resources under the subscription. @param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest' @param subscriptionId Microsoft Azure subscription ID. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PolicyStatesQueryResultsInner object
[ "Queries", "policy", "states", "for", "the", "resources", "under", "the", "subscription", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L628-L635
signalapp/libsignal-service-java
java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java
SignalServiceAccountManager.requestSmsVerificationCode
public void requestSmsVerificationCode(boolean androidSmsRetrieverSupported, Optional<String> captchaToken) throws IOException { this.pushServiceSocket.requestSmsVerificationCode(androidSmsRetrieverSupported, captchaToken); }
java
public void requestSmsVerificationCode(boolean androidSmsRetrieverSupported, Optional<String> captchaToken) throws IOException { this.pushServiceSocket.requestSmsVerificationCode(androidSmsRetrieverSupported, captchaToken); }
[ "public", "void", "requestSmsVerificationCode", "(", "boolean", "androidSmsRetrieverSupported", ",", "Optional", "<", "String", ">", "captchaToken", ")", "throws", "IOException", "{", "this", ".", "pushServiceSocket", ".", "requestSmsVerificationCode", "(", "androidSmsRet...
Request an SMS verification code. On success, the server will send an SMS verification code to this Signal user. @throws IOException
[ "Request", "an", "SMS", "verification", "code", ".", "On", "success", "the", "server", "will", "send", "an", "SMS", "verification", "code", "to", "this", "Signal", "user", "." ]
train
https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L137-L139
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/GitLabApiForm.java
GitLabApiForm.withParam
public GitLabApiForm withParam(String name, AccessLevel level, boolean required) throws IllegalArgumentException { return (withParam(name, (level == null ? null : level.toValue()), required)); }
java
public GitLabApiForm withParam(String name, AccessLevel level, boolean required) throws IllegalArgumentException { return (withParam(name, (level == null ? null : level.toValue()), required)); }
[ "public", "GitLabApiForm", "withParam", "(", "String", "name", ",", "AccessLevel", "level", ",", "boolean", "required", ")", "throws", "IllegalArgumentException", "{", "return", "(", "withParam", "(", "name", ",", "(", "level", "==", "null", "?", "null", ":", ...
Fluent method for adding AccessLevel query and form parameters to a get() or post() call. @param name the name of the field/attribute to add @param level the value of the field/attribute to add @param required the field is required flag @return this GitLabAPiForm instance @throws IllegalArgumentException if a required parameter is null or empty
[ "Fluent", "method", "for", "adding", "AccessLevel", "query", "and", "form", "parameters", "to", "a", "get", "()", "or", "post", "()", "call", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiForm.java#L94-L96
phax/ph-commons
ph-security/src/main/java/com/helger/security/authentication/result/AuthIdentificationResult.java
AuthIdentificationResult.createFailure
@Nonnull public static AuthIdentificationResult createFailure (@Nonnull final ICredentialValidationResult aCredentialValidationFailure) { ValueEnforcer.notNull (aCredentialValidationFailure, "CredentialValidationFailure"); return new AuthIdentificationResult (null, aCredentialValidationFailure); }
java
@Nonnull public static AuthIdentificationResult createFailure (@Nonnull final ICredentialValidationResult aCredentialValidationFailure) { ValueEnforcer.notNull (aCredentialValidationFailure, "CredentialValidationFailure"); return new AuthIdentificationResult (null, aCredentialValidationFailure); }
[ "@", "Nonnull", "public", "static", "AuthIdentificationResult", "createFailure", "(", "@", "Nonnull", "final", "ICredentialValidationResult", "aCredentialValidationFailure", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aCredentialValidationFailure", ",", "\"CredentialVali...
Factory method for error in authentication. @param aCredentialValidationFailure The validation failure. May not be <code>null</code> in case of failure! @return Never <code>null</code>.
[ "Factory", "method", "for", "error", "in", "authentication", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/authentication/result/AuthIdentificationResult.java#L121-L126
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java
BeatGridFinder.getBeatGrid
BeatGrid getBeatGrid(int rekordboxId, SlotReference slot, Client client) throws IOException { Message response = client.simpleRequest(Message.KnownType.BEAT_GRID_REQ, null, client.buildRMST(Message.MenuIdentifier.DATA, slot.slot), new NumberField(rekordboxId)); if (response.knownType == Message.KnownType.BEAT_GRID) { return new BeatGrid(new DataReference(slot, rekordboxId), response); } logger.error("Unexpected response type when requesting beat grid: {}", response); return null; }
java
BeatGrid getBeatGrid(int rekordboxId, SlotReference slot, Client client) throws IOException { Message response = client.simpleRequest(Message.KnownType.BEAT_GRID_REQ, null, client.buildRMST(Message.MenuIdentifier.DATA, slot.slot), new NumberField(rekordboxId)); if (response.knownType == Message.KnownType.BEAT_GRID) { return new BeatGrid(new DataReference(slot, rekordboxId), response); } logger.error("Unexpected response type when requesting beat grid: {}", response); return null; }
[ "BeatGrid", "getBeatGrid", "(", "int", "rekordboxId", ",", "SlotReference", "slot", ",", "Client", "client", ")", "throws", "IOException", "{", "Message", "response", "=", "client", ".", "simpleRequest", "(", "Message", ".", "KnownType", ".", "BEAT_GRID_REQ", ",...
Requests the beat grid for a specific track ID, given a connection to a player that has already been set up. @param rekordboxId the track of interest @param slot identifies the media slot we are querying @param client the dbserver client that is communicating with the appropriate player @return the retrieved beat grid, or {@code null} if there was none available @throws IOException if there is a communication problem
[ "Requests", "the", "beat", "grid", "for", "a", "specific", "track", "ID", "given", "a", "connection", "to", "a", "player", "that", "has", "already", "been", "set", "up", "." ]
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L298-L307
TestFX/Monocle
src/main/java/com/sun/glass/ui/monocle/LinuxAbsoluteInputCapabilities.java
LinuxAbsoluteInputCapabilities.getCapabilities
static Map<Integer, LinuxAbsoluteInputCapabilities> getCapabilities( File devNode, BitSet axes) throws IOException { if (axes == null || axes.isEmpty()) { return null; } LinuxSystem system = LinuxSystem.getLinuxSystem(); LinuxSystem.InputAbsInfo info = new LinuxSystem.InputAbsInfo(); long fd = system.open(devNode.getPath(), LinuxSystem.O_RDONLY); if (fd == -1) { throw new IOException(system.getErrorMessage()); } Map<Integer, LinuxAbsoluteInputCapabilities> caps = new HashMap<Integer, LinuxAbsoluteInputCapabilities>(); for (int i = 0; (i = axes.nextSetBit(i)) != -1; i++) { caps.put(i, new LinuxAbsoluteInputCapabilities(system, info, fd, i)); } system.close(fd); return caps; }
java
static Map<Integer, LinuxAbsoluteInputCapabilities> getCapabilities( File devNode, BitSet axes) throws IOException { if (axes == null || axes.isEmpty()) { return null; } LinuxSystem system = LinuxSystem.getLinuxSystem(); LinuxSystem.InputAbsInfo info = new LinuxSystem.InputAbsInfo(); long fd = system.open(devNode.getPath(), LinuxSystem.O_RDONLY); if (fd == -1) { throw new IOException(system.getErrorMessage()); } Map<Integer, LinuxAbsoluteInputCapabilities> caps = new HashMap<Integer, LinuxAbsoluteInputCapabilities>(); for (int i = 0; (i = axes.nextSetBit(i)) != -1; i++) { caps.put(i, new LinuxAbsoluteInputCapabilities(system, info, fd, i)); } system.close(fd); return caps; }
[ "static", "Map", "<", "Integer", ",", "LinuxAbsoluteInputCapabilities", ">", "getCapabilities", "(", "File", "devNode", ",", "BitSet", "axes", ")", "throws", "IOException", "{", "if", "(", "axes", "==", "null", "||", "axes", ".", "isEmpty", "(", ")", ")", ...
Reads capabilities from a device node. @return A Map of capabilities for each supported axis, or null if no capabilities are available. @throws IOException if an error occured when reading capabilities
[ "Reads", "capabilities", "from", "a", "device", "node", "." ]
train
https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/LinuxAbsoluteInputCapabilities.java#L73-L91
iron-io/iron_mq_java
src/main/java/io/iron/ironmq/Queue.java
Queue.releaseMessage
public void releaseMessage(String id, String reservationId, Long delay) throws IOException { String url = "queues/" + name + "/messages/" + id + "/release"; String payload = gson.toJson(new MessageOptions(reservationId, delay)); IronReader reader = client.post(url, payload); reader.close(); }
java
public void releaseMessage(String id, String reservationId, Long delay) throws IOException { String url = "queues/" + name + "/messages/" + id + "/release"; String payload = gson.toJson(new MessageOptions(reservationId, delay)); IronReader reader = client.post(url, payload); reader.close(); }
[ "public", "void", "releaseMessage", "(", "String", "id", ",", "String", "reservationId", ",", "Long", "delay", ")", "throws", "IOException", "{", "String", "url", "=", "\"queues/\"", "+", "name", "+", "\"/messages/\"", "+", "id", "+", "\"/release\"", ";", "S...
Release reserved message after specified time. If there is no message with such id on the queue, an EmptyQueueException is thrown. @param id The ID of the message to release. @param delay The time after which the message will be released. @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. @throws java.io.IOException If there is an error accessing the IronMQ server.
[ "Release", "reserved", "message", "after", "specified", "time", ".", "If", "there", "is", "no", "message", "with", "such", "id", "on", "the", "queue", "an", "EmptyQueueException", "is", "thrown", "." ]
train
https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queue.java#L517-L522
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeUtil.java
TreeUtil.getClosestContextForId
public static UIContext getClosestContextForId(final WComponent root, final String id, final boolean visibleOnly) { FindComponentByIdVisitor visitor = new FindComponentByIdVisitor(id) { @Override public VisitorResult visit(final WComponent comp) { VisitorResult result = super.visit(comp); if (result == VisitorResult.CONTINUE) { // Save closest UIC as processing tree setResult(new ComponentWithContext(comp, UIContextHolder.getCurrent())); } return result; } }; doTraverse(root, visibleOnly, visitor); return visitor.getResult() == null ? null : visitor.getResult().getContext(); }
java
public static UIContext getClosestContextForId(final WComponent root, final String id, final boolean visibleOnly) { FindComponentByIdVisitor visitor = new FindComponentByIdVisitor(id) { @Override public VisitorResult visit(final WComponent comp) { VisitorResult result = super.visit(comp); if (result == VisitorResult.CONTINUE) { // Save closest UIC as processing tree setResult(new ComponentWithContext(comp, UIContextHolder.getCurrent())); } return result; } }; doTraverse(root, visibleOnly, visitor); return visitor.getResult() == null ? null : visitor.getResult().getContext(); }
[ "public", "static", "UIContext", "getClosestContextForId", "(", "final", "WComponent", "root", ",", "final", "String", "id", ",", "final", "boolean", "visibleOnly", ")", "{", "FindComponentByIdVisitor", "visitor", "=", "new", "FindComponentByIdVisitor", "(", "id", "...
Retrieves the closest context for the component with the given Id. @param root the root component to search from. @param id the id to search for. @param visibleOnly true if process visible only @return the closest context for the component with the given id, or null if not found.
[ "Retrieves", "the", "closest", "context", "for", "the", "component", "with", "the", "given", "Id", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/TreeUtil.java#L226-L244
henkexbg/gallery-api
src/main/java/com/github/henkexbg/gallery/controller/GalleryController.java
GalleryController.getPreviousPath
private String getPreviousPath(String contextPath, String path) { if (StringUtils.isBlank(path)) { return null; } int lastIndexOfSlash = path.lastIndexOf('/'); if (lastIndexOfSlash == -1) { return null; } return contextPath + DIR_LISTING_PREFIX + path.substring(0, lastIndexOfSlash); }
java
private String getPreviousPath(String contextPath, String path) { if (StringUtils.isBlank(path)) { return null; } int lastIndexOfSlash = path.lastIndexOf('/'); if (lastIndexOfSlash == -1) { return null; } return contextPath + DIR_LISTING_PREFIX + path.substring(0, lastIndexOfSlash); }
[ "private", "String", "getPreviousPath", "(", "String", "contextPath", ",", "String", "path", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "path", ")", ")", "{", "return", "null", ";", "}", "int", "lastIndexOfSlash", "=", "path", ".", "lastIndex...
Helper method that retrieves the URL to the previous path if available. Previous in this case always means one step up in the hierarchy. It is assumed that this is always a directory i.e. the URL will point to the {@value #DIR_LISTING_PREFIX} service. @param contextPath Webapp context path. @param path Webapp-specific path. @return The previous path, or null.
[ "Helper", "method", "that", "retrieves", "the", "URL", "to", "the", "previous", "path", "if", "available", ".", "Previous", "in", "this", "case", "always", "means", "one", "step", "up", "in", "the", "hierarchy", ".", "It", "is", "assumed", "that", "this", ...
train
https://github.com/henkexbg/gallery-api/blob/530e68c225b5e8fc3b608d670b34bd539a5b0a71/src/main/java/com/github/henkexbg/gallery/controller/GalleryController.java#L403-L412
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/utils/BtcFormat.java
BtcFormat.getInstance
public static BtcFormat getInstance(Style style, Locale locale, int fractionPlaces) { return new BtcAutoFormat(locale, style, fractionPlaces); }
java
public static BtcFormat getInstance(Style style, Locale locale, int fractionPlaces) { return new BtcAutoFormat(locale, style, fractionPlaces); }
[ "public", "static", "BtcFormat", "getInstance", "(", "Style", "style", ",", "Locale", "locale", ",", "int", "fractionPlaces", ")", "{", "return", "new", "BtcAutoFormat", "(", "locale", ",", "style", ",", "fractionPlaces", ")", ";", "}" ]
Return a new auto-formatter for the given locale with the given number of fraction places. The returned object will automatically-denominate each formatted value, and will indicate that denomination using either a currency code, such as {@code "mBTC"}, or symbol, such as {@code "฿"}, according to the given style argument. It will format each number according to the given locale. <p>The third parameter is the number of fractional decimal places to use for each formatted number, reduced as necessary when formatting to avoid giving a place to fractional satoshis.
[ "Return", "a", "new", "auto", "-", "formatter", "for", "the", "given", "locale", "with", "the", "given", "number", "of", "fraction", "places", ".", "The", "returned", "object", "will", "automatically", "-", "denominate", "each", "formatted", "value", "and", ...
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L920-L922
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java
SeaGlassTabbedPaneUI.paintCloseButton
protected Rectangle paintCloseButton(Graphics g, SynthContext tabContext, int tabIndex) { Rectangle tabRect = new Rectangle(rects[tabIndex]); Rectangle bounds = getCloseButtonBounds(tabIndex); int offset = bounds.width + textIconGap; boolean onLeft = isCloseButtonOnLeft(); if (onLeft) { tabRect.x += offset; tabRect.width -= offset; } else { tabRect.width -= offset; } SeaGlassContext subcontext = getContext(tabPane, SeaGlassRegion.TABBED_PANE_TAB_CLOSE_BUTTON, getCloseButtonState(tabPane, tabIndex, (tabContext.getComponentState() & MOUSE_OVER) != 0)); SeaGlassLookAndFeel.updateSubregion(subcontext, g, bounds); SeaGlassSynthPainterImpl painter = (SeaGlassSynthPainterImpl) subcontext.getPainter(); painter.paintSearchButtonForeground(subcontext, g, bounds.x, bounds.y, bounds.width, bounds.height); subcontext.dispose(); return tabRect; }
java
protected Rectangle paintCloseButton(Graphics g, SynthContext tabContext, int tabIndex) { Rectangle tabRect = new Rectangle(rects[tabIndex]); Rectangle bounds = getCloseButtonBounds(tabIndex); int offset = bounds.width + textIconGap; boolean onLeft = isCloseButtonOnLeft(); if (onLeft) { tabRect.x += offset; tabRect.width -= offset; } else { tabRect.width -= offset; } SeaGlassContext subcontext = getContext(tabPane, SeaGlassRegion.TABBED_PANE_TAB_CLOSE_BUTTON, getCloseButtonState(tabPane, tabIndex, (tabContext.getComponentState() & MOUSE_OVER) != 0)); SeaGlassLookAndFeel.updateSubregion(subcontext, g, bounds); SeaGlassSynthPainterImpl painter = (SeaGlassSynthPainterImpl) subcontext.getPainter(); painter.paintSearchButtonForeground(subcontext, g, bounds.x, bounds.y, bounds.width, bounds.height); subcontext.dispose(); return tabRect; }
[ "protected", "Rectangle", "paintCloseButton", "(", "Graphics", "g", ",", "SynthContext", "tabContext", ",", "int", "tabIndex", ")", "{", "Rectangle", "tabRect", "=", "new", "Rectangle", "(", "rects", "[", "tabIndex", "]", ")", ";", "Rectangle", "bounds", "=", ...
Paint the close button for a tab. @param g the Graphics context. @param tabContext the SynthContext for the tab itself. @param tabIndex the tab index to paint. @return the new tab bounds.
[ "Paint", "the", "close", "button", "for", "a", "tab", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java#L774-L800
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java
StylesContainer.writeStylesAutomaticStyles
public void writeStylesAutomaticStyles(final XMLUtil util, final Appendable appendable) throws IOException { final Iterable<ObjectStyle> styles = this.objectStylesContainer .getValues(Dest.STYLES_AUTOMATIC_STYLES); for (final ObjectStyle style : styles) assert style.isHidden() : style.toString(); this.write(styles, util, appendable); }
java
public void writeStylesAutomaticStyles(final XMLUtil util, final Appendable appendable) throws IOException { final Iterable<ObjectStyle> styles = this.objectStylesContainer .getValues(Dest.STYLES_AUTOMATIC_STYLES); for (final ObjectStyle style : styles) assert style.isHidden() : style.toString(); this.write(styles, util, appendable); }
[ "public", "void", "writeStylesAutomaticStyles", "(", "final", "XMLUtil", "util", ",", "final", "Appendable", "appendable", ")", "throws", "IOException", "{", "final", "Iterable", "<", "ObjectStyle", ">", "styles", "=", "this", ".", "objectStylesContainer", ".", "g...
Write styles to styles.xml/automatic-styles @param util an util @param appendable the destination @throws IOException if an I/O error occurs
[ "Write", "styles", "to", "styles", ".", "xml", "/", "automatic", "-", "styles" ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L427-L435
apache/incubator-druid
core/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuAcct.java
CpuAcct.parse
private static CpuAcctMetric parse(final List<String> lines) { // File has a header. We skip it // See src/test/resources/cpuacct.usage_all for an example final int ncpus = lines.size() - 1; final long[] usrTime = new long[ncpus]; final long[] sysTime = new long[ncpus]; for (int i = 1; i < lines.size(); i++) { final String[] splits = lines.get(i).split(CgroupUtil.SPACE_MATCH, 3); if (splits.length != 3) { throw new RE("Error parsing [%s]", lines.get(i)); } final int cpuNum = Integer.parseInt(splits[0]); usrTime[cpuNum] = Long.parseLong(splits[1]); sysTime[cpuNum] = Long.parseLong(splits[2]); } return new CpuAcctMetric(usrTime, sysTime); }
java
private static CpuAcctMetric parse(final List<String> lines) { // File has a header. We skip it // See src/test/resources/cpuacct.usage_all for an example final int ncpus = lines.size() - 1; final long[] usrTime = new long[ncpus]; final long[] sysTime = new long[ncpus]; for (int i = 1; i < lines.size(); i++) { final String[] splits = lines.get(i).split(CgroupUtil.SPACE_MATCH, 3); if (splits.length != 3) { throw new RE("Error parsing [%s]", lines.get(i)); } final int cpuNum = Integer.parseInt(splits[0]); usrTime[cpuNum] = Long.parseLong(splits[1]); sysTime[cpuNum] = Long.parseLong(splits[2]); } return new CpuAcctMetric(usrTime, sysTime); }
[ "private", "static", "CpuAcctMetric", "parse", "(", "final", "List", "<", "String", ">", "lines", ")", "{", "// File has a header. We skip it", "// See src/test/resources/cpuacct.usage_all for an example", "final", "int", "ncpus", "=", "lines", ".", "size", "(", ")", ...
Private because it requires a specific format and cant' take a generic list of strings
[ "Private", "because", "it", "requires", "a", "specific", "format", "and", "cant", "take", "a", "generic", "list", "of", "strings" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuAcct.java#L41-L58
joniles/mpxj
src/main/java/net/sf/mpxj/json/JsonStreamWriter.java
JsonStreamWriter.writeNameValuePair
public void writeNameValuePair(String name, double value) throws IOException { internalWriteNameValuePair(name, Double.toString(value)); }
java
public void writeNameValuePair(String name, double value) throws IOException { internalWriteNameValuePair(name, Double.toString(value)); }
[ "public", "void", "writeNameValuePair", "(", "String", "name", ",", "double", "value", ")", "throws", "IOException", "{", "internalWriteNameValuePair", "(", "name", ",", "Double", ".", "toString", "(", "value", ")", ")", ";", "}" ]
Write a double attribute. @param name attribute name @param value attribute value
[ "Write", "a", "double", "attribute", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L173-L176
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge_binding.java
netbridge_binding.get
public static netbridge_binding get(nitro_service service, String name) throws Exception{ netbridge_binding obj = new netbridge_binding(); obj.set_name(name); netbridge_binding response = (netbridge_binding) obj.get_resource(service); return response; }
java
public static netbridge_binding get(nitro_service service, String name) throws Exception{ netbridge_binding obj = new netbridge_binding(); obj.set_name(name); netbridge_binding response = (netbridge_binding) obj.get_resource(service); return response; }
[ "public", "static", "netbridge_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "netbridge_binding", "obj", "=", "new", "netbridge_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", ...
Use this API to fetch netbridge_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "netbridge_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge_binding.java#L136-L141
logic-ng/LogicNG
src/main/java/org/logicng/formulas/FormulaFactory.java
FormulaFactory.pbc
public PBConstraint pbc(final CType comparator, final int rhs, final Literal[] literals, final int[] coefficients) { return constructPBC(comparator, rhs, Arrays.copyOf(literals, literals.length), Arrays.copyOf(coefficients, coefficients.length)); }
java
public PBConstraint pbc(final CType comparator, final int rhs, final Literal[] literals, final int[] coefficients) { return constructPBC(comparator, rhs, Arrays.copyOf(literals, literals.length), Arrays.copyOf(coefficients, coefficients.length)); }
[ "public", "PBConstraint", "pbc", "(", "final", "CType", "comparator", ",", "final", "int", "rhs", ",", "final", "Literal", "[", "]", "literals", ",", "final", "int", "[", "]", "coefficients", ")", "{", "return", "constructPBC", "(", "comparator", ",", "rhs...
Creates a new pseudo-Boolean constraint. @param comparator the comparator of the constraint @param rhs the right-hand side of the constraint @param literals the literals of the constraint @param coefficients the coefficients of the constraint @return the pseudo-Boolean constraint @throws IllegalArgumentException if the number of literals and coefficients do not correspond
[ "Creates", "a", "new", "pseudo", "-", "Boolean", "constraint", "." ]
train
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L737-L739
h2oai/h2o-2
src/main/java/water/score/ScorecardModel.java
ScorecardModel.make
public static ScorecardModel make(final String name, final double initialScore, RuleTable[] rules) { // Get the list of features String[] colNames = new String[rules.length]; for( int i=0; i<rules.length; i++ ) colNames[i] = rules[i]._name; // javassist support for rewriting class files ClassPool _pool = ClassPool.getDefault(); try { // Make a javassist class in the java hierarchy String cname = uniqueClassName(name); CtClass scClass = _pool.makeClass(cname); CtClass baseClass = _pool.get("water.score.ScorecardModel"); // Full Name Lookup scClass.setSuperclass(baseClass); // Produce the scoring method(s) ScorecardModel scm = new ScorecardModel(name, colNames,initialScore, rules); scm.makeScoreHashMethod(scClass); scm.makeScoreAryMethod(scClass); // Produce a 1-arg constructor String cons = " public "+cname+"(water.score.ScorecardModel base) { super(base); }"; CtConstructor happyConst = CtNewConstructor.make(cons,scClass); scClass.addConstructor(happyConst); Class myClass = scClass.toClass(ScorecardModel.class.getClassLoader(), null); Constructor<ScorecardModel> co = myClass.getConstructor(ScorecardModel.class); ScorecardModel jitted_scm = co.newInstance(scm); return jitted_scm; } catch( Exception e ) { Log.err(Sys.SCORM,"Javassist failed",e); } return null; }
java
public static ScorecardModel make(final String name, final double initialScore, RuleTable[] rules) { // Get the list of features String[] colNames = new String[rules.length]; for( int i=0; i<rules.length; i++ ) colNames[i] = rules[i]._name; // javassist support for rewriting class files ClassPool _pool = ClassPool.getDefault(); try { // Make a javassist class in the java hierarchy String cname = uniqueClassName(name); CtClass scClass = _pool.makeClass(cname); CtClass baseClass = _pool.get("water.score.ScorecardModel"); // Full Name Lookup scClass.setSuperclass(baseClass); // Produce the scoring method(s) ScorecardModel scm = new ScorecardModel(name, colNames,initialScore, rules); scm.makeScoreHashMethod(scClass); scm.makeScoreAryMethod(scClass); // Produce a 1-arg constructor String cons = " public "+cname+"(water.score.ScorecardModel base) { super(base); }"; CtConstructor happyConst = CtNewConstructor.make(cons,scClass); scClass.addConstructor(happyConst); Class myClass = scClass.toClass(ScorecardModel.class.getClassLoader(), null); Constructor<ScorecardModel> co = myClass.getConstructor(ScorecardModel.class); ScorecardModel jitted_scm = co.newInstance(scm); return jitted_scm; } catch( Exception e ) { Log.err(Sys.SCORM,"Javassist failed",e); } return null; }
[ "public", "static", "ScorecardModel", "make", "(", "final", "String", "name", ",", "final", "double", "initialScore", ",", "RuleTable", "[", "]", "rules", ")", "{", "// Get the list of features", "String", "[", "]", "colNames", "=", "new", "String", "[", "rule...
Scorecard model builder: JIT a subclass with the fast version wired in to 'score(row)'
[ "Scorecard", "model", "builder", ":", "JIT", "a", "subclass", "with", "the", "fast", "version", "wired", "in", "to", "score", "(", "row", ")" ]
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/score/ScorecardModel.java#L259-L291
forge/furnace
container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java
Annotations.isAnnotationPresent
public static boolean isAnnotationPresent(final Method m, final Class<? extends Annotation> type) { boolean result = false; if (m.isAnnotationPresent(type)) { result = true; } else { for (Annotation a : m.getAnnotations()) { if (isAnnotationPresent(a, type)) { result = true; break; } } } if (!result) { result = isAnnotationPresent(m.getDeclaringClass(), type); } return result; }
java
public static boolean isAnnotationPresent(final Method m, final Class<? extends Annotation> type) { boolean result = false; if (m.isAnnotationPresent(type)) { result = true; } else { for (Annotation a : m.getAnnotations()) { if (isAnnotationPresent(a, type)) { result = true; break; } } } if (!result) { result = isAnnotationPresent(m.getDeclaringClass(), type); } return result; }
[ "public", "static", "boolean", "isAnnotationPresent", "(", "final", "Method", "m", ",", "final", "Class", "<", "?", "extends", "Annotation", ">", "type", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "m", ".", "isAnnotationPresent", "(", "ty...
Discover if a Method <b>m</b> has been annotated with <b>type</b>. @param m The method to inspect. @param type The targeted annotation class @return True if annotation is present either on the method itself, or on the declaring class of the method. Returns false if the annotation is not present.
[ "Discover", "if", "a", "Method", "<b", ">", "m<", "/", "b", ">", "has", "been", "annotated", "with", "<b", ">", "type<", "/", "b", ">", "." ]
train
https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java#L30-L54
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/privatejgoodies/forms/layout/FormSpec.java
FormSpec.parseOldBoundedSize
private Size parseOldBoundedSize(String token, boolean setMax) { int semicolonIndex = token.indexOf(';'); String sizeToken1 = token.substring(4, semicolonIndex); String sizeToken2 = token.substring(semicolonIndex + 1, token.length() - 1); Size size1 = parseAtomicSize(sizeToken1); Size size2 = parseAtomicSize(sizeToken2); // Check valid combinations and set min or max. if (isConstant(size1)) { if (size2 instanceof Sizes.ComponentSize) { return new BoundedSize(size2, setMax ? null : size1, setMax ? size1 : null); } throw new IllegalArgumentException( "Bounded sizes must not be both constants."); } if (isConstant(size2)) { return new BoundedSize(size1, setMax ? null : size2, setMax ? size2 : null); } throw new IllegalArgumentException( "Bounded sizes must not be both logical."); }
java
private Size parseOldBoundedSize(String token, boolean setMax) { int semicolonIndex = token.indexOf(';'); String sizeToken1 = token.substring(4, semicolonIndex); String sizeToken2 = token.substring(semicolonIndex + 1, token.length() - 1); Size size1 = parseAtomicSize(sizeToken1); Size size2 = parseAtomicSize(sizeToken2); // Check valid combinations and set min or max. if (isConstant(size1)) { if (size2 instanceof Sizes.ComponentSize) { return new BoundedSize(size2, setMax ? null : size1, setMax ? size1 : null); } throw new IllegalArgumentException( "Bounded sizes must not be both constants."); } if (isConstant(size2)) { return new BoundedSize(size1, setMax ? null : size2, setMax ? size2 : null); } throw new IllegalArgumentException( "Bounded sizes must not be both logical."); }
[ "private", "Size", "parseOldBoundedSize", "(", "String", "token", ",", "boolean", "setMax", ")", "{", "int", "semicolonIndex", "=", "token", ".", "indexOf", "(", "'", "'", ")", ";", "String", "sizeToken1", "=", "token", ".", "substring", "(", "4", ",", "...
Parses an encoded compound size and sets the size fields. The compound size has format: max(&lt;atomic size&gt;;&lt;atomic size2&gt;) | min(&lt;atomic size1&gt;;&lt;atomic size2&gt;) One of the two atomic sizes must be a logical size, the other must be a size constant. @param token a token for a bounded size, e.g. "max(50dlu; pref)" @param setMax if true we set a maximum size, otherwise a minimum size @return a Size that represents the parse result
[ "Parses", "an", "encoded", "compound", "size", "and", "sets", "the", "size", "fields", ".", "The", "compound", "size", "has", "format", ":", "max", "(", "&lt", ";", "atomic", "size&gt", ";;", "&lt", ";", "atomic", "size2&gt", ";", ")", "|", "min", "(",...
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormSpec.java#L333-L356
astrapi69/jaulp-wicket
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java
CaptchaPanel.newImage
protected Image newImage(final String id, final IModel<CaptchaModelBean> model) { return newImage(id, model.getObject().getCaptchaImageResource()); }
java
protected Image newImage(final String id, final IModel<CaptchaModelBean> model) { return newImage(id, model.getObject().getCaptchaImageResource()); }
[ "protected", "Image", "newImage", "(", "final", "String", "id", ",", "final", "IModel", "<", "CaptchaModelBean", ">", "model", ")", "{", "return", "newImage", "(", "id", ",", "model", ".", "getObject", "(", ")", ".", "getCaptchaImageResource", "(", ")", ")...
Factory method for creating a new {@link Image}. This method is invoked in the constructor from the derived classes and can be overridden so users can provide their own version of a Button. @param id the wicket id @param model the model. @return the new {@link Image}
[ "Factory", "method", "for", "creating", "a", "new", "{", "@link", "Image", "}", ".", "This", "method", "is", "invoked", "in", "the", "constructor", "from", "the", "derived", "classes", "and", "can", "be", "overridden", "so", "users", "can", "provide", "the...
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/captcha/draw/CaptchaPanel.java#L76-L79
lastaflute/lasta-di
src/main/java/org/lastaflute/di/util/LdiSrl.java
LdiSrl.indexOfFirstIgnoreCase
public static IndexOfInfo indexOfFirstIgnoreCase(final String str, final String... delimiters) { return doIndexOfFirst(true, str, delimiters); }
java
public static IndexOfInfo indexOfFirstIgnoreCase(final String str, final String... delimiters) { return doIndexOfFirst(true, str, delimiters); }
[ "public", "static", "IndexOfInfo", "indexOfFirstIgnoreCase", "(", "final", "String", "str", ",", "final", "String", "...", "delimiters", ")", "{", "return", "doIndexOfFirst", "(", "true", ",", "str", ",", "delimiters", ")", ";", "}" ]
Get the index of the first-found delimiter ignoring case. <pre> indexOfFirst("foo.bar/baz.qux", "A", "U") returns the index of "ar/baz..." </pre> @param str The target string. (NotNull) @param delimiters The array of delimiters. (NotNull) @return The information of index. (NullAllowed: if delimiter not found)
[ "Get", "the", "index", "of", "the", "first", "-", "found", "delimiter", "ignoring", "case", ".", "<pre", ">", "indexOfFirst", "(", "foo", ".", "bar", "/", "baz", ".", "qux", "A", "U", ")", "returns", "the", "index", "of", "ar", "/", "baz", "...", "...
train
https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L393-L395
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuGraphAddHostNode
public static int cuGraphAddHostNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies, CUDA_HOST_NODE_PARAMS nodeParams) { return checkResult(cuGraphAddHostNodeNative(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)); }
java
public static int cuGraphAddHostNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies, CUDA_HOST_NODE_PARAMS nodeParams) { return checkResult(cuGraphAddHostNodeNative(phGraphNode, hGraph, dependencies, numDependencies, nodeParams)); }
[ "public", "static", "int", "cuGraphAddHostNode", "(", "CUgraphNode", "phGraphNode", ",", "CUgraph", "hGraph", ",", "CUgraphNode", "dependencies", "[", "]", ",", "long", "numDependencies", ",", "CUDA_HOST_NODE_PARAMS", "nodeParams", ")", "{", "return", "checkResult", ...
Creates a host execution node and adds it to a graph.<br> <br> Creates a new CPU execution node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode.<br> <br> When the graph is launched, the node will invoke the specified CPU function. @param phGraphNode - Returns newly created node @param hGraph - Graph to which to add the node @param dependencies - Dependencies of the node @param numDependencies - Number of dependencies @param nodeParams - Parameters for the host node @return CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_VALUE @see JCudaDriver#cuLaunchHostFunc JCudaDriver#cuGraphHostNodeGetParams JCudaDriver#cuGraphHostNodeSetParams JCudaDriver#cuGraphCreate JCudaDriver#cuGraphDestroyNode JCudaDriver#cuGraphAddChildGraphNode JCudaDriver#cuGraphAddEmptyNode JCudaDriver#cuGraphAddKernelNode JCudaDriver#cuGraphAddMemcpyNode JCudaDriver#cuGraphAddMemsetNode
[ "Creates", "a", "host", "execution", "node", "and", "adds", "it", "to", "a", "graph", ".", "<br", ">", "<br", ">", "Creates", "a", "new", "CPU", "execution", "node", "and", "adds", "it", "to", "\\", "p", "hGraph", "with", "\\", "p", "numDependencies", ...
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12390-L12393
JOML-CI/JOML
src/org/joml/Intersectiond.java
Intersectiond.intersectRayAab
public static boolean intersectRayAab(Vector3dc origin, Vector3dc dir, Vector3dc min, Vector3dc max, Vector2d result) { return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result); }
java
public static boolean intersectRayAab(Vector3dc origin, Vector3dc dir, Vector3dc min, Vector3dc max, Vector2d result) { return intersectRayAab(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), result); }
[ "public", "static", "boolean", "intersectRayAab", "(", "Vector3dc", "origin", ",", "Vector3dc", "dir", ",", "Vector3dc", "min", ",", "Vector3dc", "max", ",", "Vector2d", "result", ")", "{", "return", "intersectRayAab", "(", "origin", ".", "x", "(", ")", ",",...
Test whether the ray with the given <code>origin</code> and direction <code>dir</code> intersects the axis-aligned box specified as its minimum corner <code>min</code> and maximum corner <code>max</code>, and return the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and far point of intersection.. <p> This method returns <code>true</code> for a ray whose origin lies inside the axis-aligned box. <p> If many boxes need to be tested against the same ray, then the {@link RayAabIntersection} class is likely more efficient. <p> Reference: <a href="https://dl.acm.org/citation.cfm?id=1198748">An Efficient and Robust Ray–Box Intersection</a> @see #intersectRayAab(double, double, double, double, double, double, double, double, double, double, double, double, Vector2d) @see RayAabIntersection @param origin the ray's origin @param dir the ray's direction @param min the minimum corner of the axis-aligned box @param max the maximum corner of the axis-aligned box @param result a vector which will hold the resulting values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> of the near and far point of intersection iff the ray intersects the axis-aligned box @return <code>true</code> if the given ray intersects the axis-aligned box; <code>false</code> otherwise
[ "Test", "whether", "the", "ray", "with", "the", "given", "<code", ">", "origin<", "/", "code", ">", "and", "direction", "<code", ">", "dir<", "/", "code", ">", "intersects", "the", "axis", "-", "aligned", "box", "specified", "as", "its", "minimum", "corn...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L2411-L2413
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java
AppServicePlansInner.listHybridConnectionsAsync
public Observable<Page<HybridConnectionInner>> listHybridConnectionsAsync(final String resourceGroupName, final String name) { return listHybridConnectionsWithServiceResponseAsync(resourceGroupName, name) .map(new Func1<ServiceResponse<Page<HybridConnectionInner>>, Page<HybridConnectionInner>>() { @Override public Page<HybridConnectionInner> call(ServiceResponse<Page<HybridConnectionInner>> response) { return response.body(); } }); }
java
public Observable<Page<HybridConnectionInner>> listHybridConnectionsAsync(final String resourceGroupName, final String name) { return listHybridConnectionsWithServiceResponseAsync(resourceGroupName, name) .map(new Func1<ServiceResponse<Page<HybridConnectionInner>>, Page<HybridConnectionInner>>() { @Override public Page<HybridConnectionInner> call(ServiceResponse<Page<HybridConnectionInner>> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Page", "<", "HybridConnectionInner", ">", ">", "listHybridConnectionsAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "name", ")", "{", "return", "listHybridConnectionsWithServiceResponseAsync", "(", "resourceGroup...
Retrieve all Hybrid Connections in use in an App Service plan. Retrieve all Hybrid Connections in use in an App Service plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;HybridConnectionInner&gt; object
[ "Retrieve", "all", "Hybrid", "Connections", "in", "use", "in", "an", "App", "Service", "plan", ".", "Retrieve", "all", "Hybrid", "Connections", "in", "use", "in", "an", "App", "Service", "plan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1720-L1728
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/RedisClient.java
RedisClient.connectPubSub
public <K, V> StatefulRedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec, RedisURI redisURI) { assertNotNull(redisURI); return getConnection(connectPubSubAsync(codec, redisURI, redisURI.getTimeout())); }
java
public <K, V> StatefulRedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec, RedisURI redisURI) { assertNotNull(redisURI); return getConnection(connectPubSubAsync(codec, redisURI, redisURI.getTimeout())); }
[ "public", "<", "K", ",", "V", ">", "StatefulRedisPubSubConnection", "<", "K", ",", "V", ">", "connectPubSub", "(", "RedisCodec", "<", "K", ",", "V", ">", "codec", ",", "RedisURI", "redisURI", ")", "{", "assertNotNull", "(", "redisURI", ")", ";", "return"...
Open a new pub/sub connection to the Redis server using the supplied {@link RedisURI} and use the supplied {@link RedisCodec codec} to encode/decode keys and values. @param codec Use this codec to encode/decode keys and values, must not be {@literal null} @param redisURI the Redis server to connect to, must not be {@literal null} @param <K> Key type @param <V> Value type @return A new connection
[ "Open", "a", "new", "pub", "/", "sub", "connection", "to", "the", "Redis", "server", "using", "the", "supplied", "{", "@link", "RedisURI", "}", "and", "use", "the", "supplied", "{", "@link", "RedisCodec", "codec", "}", "to", "encode", "/", "decode", "key...
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisClient.java#L396-L400
powermock/powermock
powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java
PowerMock.expectPrivate
public static synchronized <T> IExpectationSetters<T> expectPrivate(Class<?> clazz, Method method, Object... arguments) throws Exception { return doExpectPrivate(clazz, method, arguments); }
java
public static synchronized <T> IExpectationSetters<T> expectPrivate(Class<?> clazz, Method method, Object... arguments) throws Exception { return doExpectPrivate(clazz, method, arguments); }
[ "public", "static", "synchronized", "<", "T", ">", "IExpectationSetters", "<", "T", ">", "expectPrivate", "(", "Class", "<", "?", ">", "clazz", ",", "Method", "method", ",", "Object", "...", "arguments", ")", "throws", "Exception", "{", "return", "doExpectPr...
Used to specify expectations on private static methods. If possible use variant with only method name.
[ "Used", "to", "specify", "expectations", "on", "private", "static", "methods", ".", "If", "possible", "use", "variant", "with", "only", "method", "name", "." ]
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1140-L1143
ontop/ontop
client/protege/src/main/java/it/unibz/inf/ontop/protege/utils/JDBCConnectionManager.java
JDBCConnectionManager.getConnection
public Connection getConnection(String url, String username, String password) throws SQLException { boolean alive = isConnectionAlive(); if (!alive) { createConnection(url, username, password); } return connection; }
java
public Connection getConnection(String url, String username, String password) throws SQLException { boolean alive = isConnectionAlive(); if (!alive) { createConnection(url, username, password); } return connection; }
[ "public", "Connection", "getConnection", "(", "String", "url", ",", "String", "username", ",", "String", "password", ")", "throws", "SQLException", "{", "boolean", "alive", "=", "isConnectionAlive", "(", ")", ";", "if", "(", "!", "alive", ")", "{", "createCo...
Retrieves the connection object. If the connection doesnt exist or is dead, it will attempt to create a new connection.
[ "Retrieves", "the", "connection", "object", ".", "If", "the", "connection", "doesnt", "exist", "or", "is", "dead", "it", "will", "attempt", "to", "create", "a", "new", "connection", "." ]
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/utils/JDBCConnectionManager.java#L94-L100
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/async/AsyncContext31Impl.java
AsyncContext31Impl.startReadListener
public void startReadListener(ThreadContextManager tcm, SRTInputStream31 inputStream) throws Exception{ try { ReadListenerRunnable rlRunnable = new ReadListenerRunnable(tcm, inputStream, this); this.setReadListenerRunning(true); com.ibm.ws.webcontainer.osgi.WebContainer.getExecutorService().execute(rlRunnable); // The read listener will now be invoked on another thread. Call pre-join to // notify interested components that this will be happening. It's possible that // the read listener may run before the pre-join is complete, and callers need to // be able to cope with that. notifyITransferContextPreProcessWorkState(); } catch (Exception e) { this.setReadListenerRunning(false); throw e; } }
java
public void startReadListener(ThreadContextManager tcm, SRTInputStream31 inputStream) throws Exception{ try { ReadListenerRunnable rlRunnable = new ReadListenerRunnable(tcm, inputStream, this); this.setReadListenerRunning(true); com.ibm.ws.webcontainer.osgi.WebContainer.getExecutorService().execute(rlRunnable); // The read listener will now be invoked on another thread. Call pre-join to // notify interested components that this will be happening. It's possible that // the read listener may run before the pre-join is complete, and callers need to // be able to cope with that. notifyITransferContextPreProcessWorkState(); } catch (Exception e) { this.setReadListenerRunning(false); throw e; } }
[ "public", "void", "startReadListener", "(", "ThreadContextManager", "tcm", ",", "SRTInputStream31", "inputStream", ")", "throws", "Exception", "{", "try", "{", "ReadListenerRunnable", "rlRunnable", "=", "new", "ReadListenerRunnable", "(", "tcm", ",", "inputStream", ",...
A read listener has been set on the SRTInputStream and we will set it up to do its first read on another thread.
[ "A", "read", "listener", "has", "been", "set", "on", "the", "SRTInputStream", "and", "we", "will", "set", "it", "up", "to", "do", "its", "first", "read", "on", "another", "thread", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/async/AsyncContext31Impl.java#L193-L208
Netflix/spectator
spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketTimer.java
BucketTimer.get
public static BucketTimer get(Id id, BucketFunction f) { return get(Spectator.globalRegistry(), id, f); }
java
public static BucketTimer get(Id id, BucketFunction f) { return get(Spectator.globalRegistry(), id, f); }
[ "public", "static", "BucketTimer", "get", "(", "Id", "id", ",", "BucketFunction", "f", ")", "{", "return", "get", "(", "Spectator", ".", "globalRegistry", "(", ")", ",", "id", ",", "f", ")", ";", "}" ]
Creates a timer object that manages a set of timers based on the bucket function supplied. Calling record will be mapped to the record on the appropriate timer. @param id Identifier for the metric being registered. @param f Function to map values to buckets. @return Timer that manages sub-timers based on the bucket function.
[ "Creates", "a", "timer", "object", "that", "manages", "a", "set", "of", "timers", "based", "on", "the", "bucket", "function", "supplied", ".", "Calling", "record", "will", "be", "mapped", "to", "the", "record", "on", "the", "appropriate", "timer", "." ]
train
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketTimer.java#L46-L48
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/Tesseract1.java
Tesseract1.createDocumentsWithResults
@Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in length."); } init(); setTessVariables(); List<OCRResult> results = new ArrayList<OCRResult>(); try { for (int i = 0; i < filenames.length; i++) { File inputFile = new File(filenames[i]); File imageFile = null; try { // if PDF, convert to multi-page TIFF imageFile = ImageIOHelper.getImageFile(inputFile); TessResultRenderer renderer = createRenderers(outputbases[i], formats); int meanTextConfidence = createDocuments(imageFile.getPath(), renderer); List<Word> words = meanTextConfidence > 0 ? getRecognizedWords(pageIteratorLevel) : new ArrayList<Word>(); results.add(new OCRResult(meanTextConfidence, words)); TessDeleteResultRenderer(renderer); } catch (Exception e) { // skip the problematic image file logger.warn(e.getMessage(), e); } finally { // delete temporary TIFF image for PDF if (imageFile != null && imageFile.exists() && imageFile != inputFile && imageFile.getName().startsWith("multipage") && imageFile.getName().endsWith(ImageIOHelper.TIFF_EXT)) { imageFile.delete(); } } } } finally { dispose(); } return results; }
java
@Override public List<OCRResult> createDocumentsWithResults(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException { if (filenames.length != outputbases.length) { throw new RuntimeException("The two arrays must match in length."); } init(); setTessVariables(); List<OCRResult> results = new ArrayList<OCRResult>(); try { for (int i = 0; i < filenames.length; i++) { File inputFile = new File(filenames[i]); File imageFile = null; try { // if PDF, convert to multi-page TIFF imageFile = ImageIOHelper.getImageFile(inputFile); TessResultRenderer renderer = createRenderers(outputbases[i], formats); int meanTextConfidence = createDocuments(imageFile.getPath(), renderer); List<Word> words = meanTextConfidence > 0 ? getRecognizedWords(pageIteratorLevel) : new ArrayList<Word>(); results.add(new OCRResult(meanTextConfidence, words)); TessDeleteResultRenderer(renderer); } catch (Exception e) { // skip the problematic image file logger.warn(e.getMessage(), e); } finally { // delete temporary TIFF image for PDF if (imageFile != null && imageFile.exists() && imageFile != inputFile && imageFile.getName().startsWith("multipage") && imageFile.getName().endsWith(ImageIOHelper.TIFF_EXT)) { imageFile.delete(); } } } } finally { dispose(); } return results; }
[ "@", "Override", "public", "List", "<", "OCRResult", ">", "createDocumentsWithResults", "(", "String", "[", "]", "filenames", ",", "String", "[", "]", "outputbases", ",", "List", "<", "ITesseract", ".", "RenderedFormat", ">", "formats", ",", "int", "pageIterat...
Creates documents with OCR results for given renderers at specified page iterator level. @param filenames array of input files @param outputbases array of output filenames without extension @param formats types of renderer @return OCR results @throws TesseractException
[ "Creates", "documents", "with", "OCR", "results", "for", "given", "renderers", "at", "specified", "page", "iterator", "level", "." ]
train
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L747-L787
netheosgithub/pcs_api
java/src/main/java/net/netheos/pcsapi/request/CResponse.java
CResponse.asString
public String asString() { try { return EntityUtils.toString( entity, PcsUtils.UTF8.name() ); } catch ( IOException e ) { throw new CStorageException( "Can't get string from HTTP entity", e ); } }
java
public String asString() { try { return EntityUtils.toString( entity, PcsUtils.UTF8.name() ); } catch ( IOException e ) { throw new CStorageException( "Can't get string from HTTP entity", e ); } }
[ "public", "String", "asString", "(", ")", "{", "try", "{", "return", "EntityUtils", ".", "toString", "(", "entity", ",", "PcsUtils", ".", "UTF8", ".", "name", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "CStor...
Extracts string from input stream @return Get the response as a String
[ "Extracts", "string", "from", "input", "stream" ]
train
https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/request/CResponse.java#L112-L119
aspectran/aspectran
web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java
DefaultServletHttpRequestHandler.handle
public boolean handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (defaultServletName != null) { RequestDispatcher rd = servletContext.getNamedDispatcher(defaultServletName); if (rd == null) { throw new IllegalStateException("A RequestDispatcher could not be located for the default servlet '" + defaultServletName + "'"); } rd.forward(request, response); return true; } else { return false; } }
java
public boolean handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (defaultServletName != null) { RequestDispatcher rd = servletContext.getNamedDispatcher(defaultServletName); if (rd == null) { throw new IllegalStateException("A RequestDispatcher could not be located for the default servlet '" + defaultServletName + "'"); } rd.forward(request, response); return true; } else { return false; } }
[ "public", "boolean", "handle", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "if", "(", "defaultServletName", "!=", "null", ")", "{", "RequestDispatcher", "rd", "=", "servlet...
Process the actual dispatching. @param request current HTTP servlet request @param response current HTTP servlet response @return true, if successful @throws ServletException the servlet exception @throws IOException if an input or output error occurs while the servlet is handling the HTTP request
[ "Process", "the", "actual", "dispatching", "." ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java#L116-L129
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java
JUnit3FloatingPointComparisonWithoutDelta.unboxedTypeOrType
private Type unboxedTypeOrType(VisitorState state, Type type) { Types types = state.getTypes(); return types.unboxedTypeOrType(type); }
java
private Type unboxedTypeOrType(VisitorState state, Type type) { Types types = state.getTypes(); return types.unboxedTypeOrType(type); }
[ "private", "Type", "unboxedTypeOrType", "(", "VisitorState", "state", ",", "Type", "type", ")", "{", "Types", "types", "=", "state", ".", "getTypes", "(", ")", ";", "return", "types", ".", "unboxedTypeOrType", "(", "type", ")", ";", "}" ]
Gets the unboxed type, or the original type if it is not unboxable.
[ "Gets", "the", "unboxed", "type", "or", "the", "original", "type", "if", "it", "is", "not", "unboxable", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java#L141-L144
telly/groundy
library/src/main/java/com/telly/groundy/TaskResult.java
TaskResult.add
public TaskResult add(String key, Serializable value) { mBundle.putSerializable(key, value); return this; }
java
public TaskResult add(String key, Serializable value) { mBundle.putSerializable(key, value); return this; }
[ "public", "TaskResult", "add", "(", "String", "key", ",", "Serializable", "value", ")", "{", "mBundle", ".", "putSerializable", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a Serializable value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a Serializable object, or null
[ "Inserts", "a", "Serializable", "value", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L263-L266
jwtk/jjwt
api/src/main/java/io/jsonwebtoken/lang/Strings.java
Strings.pathEquals
public static boolean pathEquals(String path1, String path2) { return cleanPath(path1).equals(cleanPath(path2)); }
java
public static boolean pathEquals(String path1, String path2) { return cleanPath(path1).equals(cleanPath(path2)); }
[ "public", "static", "boolean", "pathEquals", "(", "String", "path1", ",", "String", "path2", ")", "{", "return", "cleanPath", "(", "path1", ")", ".", "equals", "(", "cleanPath", "(", "path2", ")", ")", ";", "}" ]
Compare two paths after normalization of them. @param path1 first path for comparison @param path2 second path for comparison @return whether the two paths are equivalent after normalization
[ "Compare", "two", "paths", "after", "normalization", "of", "them", "." ]
train
https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Strings.java#L659-L661
square/phrase
src/main/java/com/squareup/phrase/ListPhrase.java
ListPhrase.join
@NonNull public <T> CharSequence join(@NonNull Iterable<T> items, @Nullable Formatter<T> formatter) { checkNotNullOrEmpty(items); return joinIterableWithSize(items, getSize(items), formatter); }
java
@NonNull public <T> CharSequence join(@NonNull Iterable<T> items, @Nullable Formatter<T> formatter) { checkNotNullOrEmpty(items); return joinIterableWithSize(items, getSize(items), formatter); }
[ "@", "NonNull", "public", "<", "T", ">", "CharSequence", "join", "(", "@", "NonNull", "Iterable", "<", "T", ">", "items", ",", "@", "Nullable", "Formatter", "<", "T", ">", "formatter", ")", "{", "checkNotNullOrEmpty", "(", "items", ")", ";", "return", ...
A list of objects, converting them to {@code Strings} by passing them to {@link Formatter#format(Object)}. @throws IllegalArgumentException if any of the list elements are null or empty strings.
[ "A", "list", "of", "objects", "converting", "them", "to", "{", "@code", "Strings", "}", "by", "passing", "them", "to", "{", "@link", "Formatter#format", "(", "Object", ")", "}", "." ]
train
https://github.com/square/phrase/blob/d91f18e80790832db11b811c462f8e5cd492d97e/src/main/java/com/squareup/phrase/ListPhrase.java#L126-L130
boncey/Flickr4Java
src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java
GeoInterface.setPerms
public void setPerms(String photoId, GeoPermissions perms) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_SET_PERMS); parameters.put("photo_id", photoId); parameters.put("is_public", perms.isPublic() ? "1" : "0"); parameters.put("is_contact", perms.isContact() ? "1" : "0"); parameters.put("is_friend", perms.isFriend() ? "1" : "0"); parameters.put("is_family", perms.isFamily() ? "1" : "0"); // Note: This method requires an HTTP POST request. Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); // This method has no specific response - It returns an empty sucess response // if it completes without error. if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
java
public void setPerms(String photoId, GeoPermissions perms) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_SET_PERMS); parameters.put("photo_id", photoId); parameters.put("is_public", perms.isPublic() ? "1" : "0"); parameters.put("is_contact", perms.isContact() ? "1" : "0"); parameters.put("is_friend", perms.isFriend() ? "1" : "0"); parameters.put("is_family", perms.isFamily() ? "1" : "0"); // Note: This method requires an HTTP POST request. Response response = transport.post(transport.getPath(), parameters, apiKey, sharedSecret); // This method has no specific response - It returns an empty sucess response // if it completes without error. if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } }
[ "public", "void", "setPerms", "(", "String", "photoId", ",", "GeoPermissions", "perms", ")", "throws", "FlickrException", "{", "Map", "<", "String", ",", "Object", ">", "parameters", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", ...
Set the permission for who may view the geo data associated with a photo. This method requires authentication with 'write' permission. @param photoId The id of the photo to set permissions for. @param perms Permissions, who can see the geo data of this photo @throws FlickrException
[ "Set", "the", "permission", "for", "who", "may", "view", "the", "geo", "data", "associated", "with", "a", "photo", "." ]
train
https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/geo/GeoInterface.java#L194-L210
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicated_server_serviceName_backupStorage_duration_GET
public OvhOrder dedicated_server_serviceName_backupStorage_duration_GET(String serviceName, String duration, OvhBackupStorageCapacityEnum capacity) throws IOException { String qPath = "/order/dedicated/server/{serviceName}/backupStorage/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); query(sb, "capacity", capacity); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhOrder.class); }
java
public OvhOrder dedicated_server_serviceName_backupStorage_duration_GET(String serviceName, String duration, OvhBackupStorageCapacityEnum capacity) throws IOException { String qPath = "/order/dedicated/server/{serviceName}/backupStorage/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); query(sb, "capacity", capacity); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhOrder.class); }
[ "public", "OvhOrder", "dedicated_server_serviceName_backupStorage_duration_GET", "(", "String", "serviceName", ",", "String", "duration", ",", "OvhBackupStorageCapacityEnum", "capacity", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/dedicated/server/{serv...
Get prices and contracts information REST: GET /order/dedicated/server/{serviceName}/backupStorage/{duration} @param capacity [required] The capacity in gigabytes of your backup storage @param serviceName [required] The internal name of your dedicated server @param duration [required] Duration
[ "Get", "prices", "and", "contracts", "information" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2452-L2458
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newComparisonException
public static ComparisonException newComparisonException(String message, Object... args) { return newComparisonException(null, message, args); }
java
public static ComparisonException newComparisonException(String message, Object... args) { return newComparisonException(null, message, args); }
[ "public", "static", "ComparisonException", "newComparisonException", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "newComparisonException", "(", "null", ",", "message", ",", "args", ")", ";", "}" ]
Constructs and initializes a new {@link ComparisonException} with the given {@link String message} formatted with the given {@link Object[] arguments}. @param message {@link String} describing the {@link ComparisonException exception}. @param args {@link Object[] arguments} used to replace format placeholders in the {@link String message}. @return a new {@link ComparisonException} with the given {@link String message}. @see #newComparisonException(Throwable, String, Object...) @see org.cp.elements.lang.ComparisonException
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "ComparisonException", "}", "with", "the", "given", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Object", "[]", "arguments", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L299-L301
cose-wg/COSE-JAVA
src/main/java/COSE/Attribute.java
Attribute.addAttribute
public void addAttribute(CBORObject label, CBORObject value, int where) throws CoseException { removeAttribute(label); if ((label.getType() != CBORType.Number) && (label.getType() != CBORType.TextString)) { throw new CoseException("Labels must be integers or strings"); } switch (where) { case PROTECTED: if (rgbProtected != null) throw new CoseException("Cannot modify protected attribute if signature has been computed"); objProtected.Add(label, value); break; case UNPROTECTED: objUnprotected.Add(label, value); break; case DO_NOT_SEND: objDontSend.Add(label, value); break; default: throw new CoseException("Invalid attribute location given"); } }
java
public void addAttribute(CBORObject label, CBORObject value, int where) throws CoseException { removeAttribute(label); if ((label.getType() != CBORType.Number) && (label.getType() != CBORType.TextString)) { throw new CoseException("Labels must be integers or strings"); } switch (where) { case PROTECTED: if (rgbProtected != null) throw new CoseException("Cannot modify protected attribute if signature has been computed"); objProtected.Add(label, value); break; case UNPROTECTED: objUnprotected.Add(label, value); break; case DO_NOT_SEND: objDontSend.Add(label, value); break; default: throw new CoseException("Invalid attribute location given"); } }
[ "public", "void", "addAttribute", "(", "CBORObject", "label", ",", "CBORObject", "value", ",", "int", "where", ")", "throws", "CoseException", "{", "removeAttribute", "(", "label", ")", ";", "if", "(", "(", "label", ".", "getType", "(", ")", "!=", "CBORTyp...
Set an attribute in the COSE object. Setting an attribute in one map will remove it from all other maps as a side effect. @param label CBOR object which identifies the attribute in the map @param value CBOR object which contains the value of the attribute @param where Identifies which of the buckets to place the attribute in. ProtectedAttributes - attributes cryptographically protected UnprotectedAttributes - attributes not cryptographically protected DontSendAttributes - attributes used locally and not transmitted @exception CoseException COSE Package exception
[ "Set", "an", "attribute", "in", "the", "COSE", "object", ".", "Setting", "an", "attribute", "in", "one", "map", "will", "remove", "it", "from", "all", "other", "maps", "as", "a", "side", "effect", "." ]
train
https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Attribute.java#L112-L134
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberingSystem.java
NumberingSystem.getInstance
public static NumberingSystem getInstance(int radix_in, boolean isAlgorithmic_in, String desc_in ) { return getInstance(null,radix_in,isAlgorithmic_in,desc_in); }
java
public static NumberingSystem getInstance(int radix_in, boolean isAlgorithmic_in, String desc_in ) { return getInstance(null,radix_in,isAlgorithmic_in,desc_in); }
[ "public", "static", "NumberingSystem", "getInstance", "(", "int", "radix_in", ",", "boolean", "isAlgorithmic_in", ",", "String", "desc_in", ")", "{", "return", "getInstance", "(", "null", ",", "radix_in", ",", "isAlgorithmic_in", ",", "desc_in", ")", ";", "}" ]
Factory method for creating a numbering system. @param radix_in The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10. @param isAlgorithmic_in Specifies whether the numbering system is algorithmic (true) or numeric (false). @param desc_in String used to describe the characteristics of the numbering system. For numeric systems, this string contains the digits used by the numbering system, in order, starting from zero. For algorithmic numbering systems, the string contains the name of the RBNF ruleset in the locale's NumberingSystemRules section that will be used to format numbers using this numbering system.
[ "Factory", "method", "for", "creating", "a", "numbering", "system", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberingSystem.java#L63-L65
phax/ph-web
ph-web/src/main/java/com/helger/web/scope/mgr/WebScopeManager.java
WebScopeManager.internalGetSessionScope
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetSessionScope (final boolean bCreateIfNotExisting, final boolean bItsOkayToCreateANewSession) { // Try to to resolve the current request scope final IRequestWebScope aRequestScope = getRequestScopeOrNull (); return internalGetSessionScope (aRequestScope, bCreateIfNotExisting, bItsOkayToCreateANewSession); }
java
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetSessionScope (final boolean bCreateIfNotExisting, final boolean bItsOkayToCreateANewSession) { // Try to to resolve the current request scope final IRequestWebScope aRequestScope = getRequestScopeOrNull (); return internalGetSessionScope (aRequestScope, bCreateIfNotExisting, bItsOkayToCreateANewSession); }
[ "@", "Nullable", "@", "DevelopersNote", "(", "\"This is only for project-internal use!\"", ")", "public", "static", "ISessionWebScope", "internalGetSessionScope", "(", "final", "boolean", "bCreateIfNotExisting", ",", "final", "boolean", "bItsOkayToCreateANewSession", ")", "{"...
Get the session scope from the current request scope. @param bCreateIfNotExisting if <code>true</code> a new session scope (and a new HTTP session if required) is created if none is existing so far. @param bItsOkayToCreateANewSession if <code>true</code> no warning is emitted, if a new session scope must be created. This is e.g. used when renewing a session. @return <code>null</code> if no session scope is present, and none should be created.
[ "Get", "the", "session", "scope", "from", "the", "current", "request", "scope", "." ]
train
https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-web/src/main/java/com/helger/web/scope/mgr/WebScopeManager.java#L331-L339
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java
VersionsImpl.cloneAsync
public Observable<String> cloneAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) { return cloneWithServiceResponseAsync(appId, versionId, cloneOptionalParameter).map(new Func1<ServiceResponse<String>, String>() { @Override public String call(ServiceResponse<String> response) { return response.body(); } }); }
java
public Observable<String> cloneAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) { return cloneWithServiceResponseAsync(appId, versionId, cloneOptionalParameter).map(new Func1<ServiceResponse<String>, String>() { @Override public String call(ServiceResponse<String> response) { return response.body(); } }); }
[ "public", "Observable", "<", "String", ">", "cloneAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "CloneOptionalParameter", "cloneOptionalParameter", ")", "{", "return", "cloneWithServiceResponseAsync", "(", "appId", ",", "versionId", ",", "cloneOptiona...
Creates a new version using the current snapshot of the selected application version. @param appId The application ID. @param versionId The version ID. @param cloneOptionalParameter 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 String object
[ "Creates", "a", "new", "version", "using", "the", "current", "snapshot", "of", "the", "selected", "application", "version", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L144-L151
google/truth
core/src/main/java/com/google/common/truth/MapSubject.java
MapSubject.containsAtLeastEntriesIn
@CanIgnoreReturnValue public Ordered containsAtLeastEntriesIn(Map<?, ?> expectedMap) { if (expectedMap.isEmpty()) { return IN_ORDER; } boolean containsAnyOrder = containsEntriesInAnyOrder(expectedMap, "contains at least", /* allowUnexpected= */ true); if (containsAnyOrder) { return new MapInOrder(expectedMap, "contains at least these entries in order"); } else { return ALREADY_FAILED; } }
java
@CanIgnoreReturnValue public Ordered containsAtLeastEntriesIn(Map<?, ?> expectedMap) { if (expectedMap.isEmpty()) { return IN_ORDER; } boolean containsAnyOrder = containsEntriesInAnyOrder(expectedMap, "contains at least", /* allowUnexpected= */ true); if (containsAnyOrder) { return new MapInOrder(expectedMap, "contains at least these entries in order"); } else { return ALREADY_FAILED; } }
[ "@", "CanIgnoreReturnValue", "public", "Ordered", "containsAtLeastEntriesIn", "(", "Map", "<", "?", ",", "?", ">", "expectedMap", ")", "{", "if", "(", "expectedMap", ".", "isEmpty", "(", ")", ")", "{", "return", "IN_ORDER", ";", "}", "boolean", "containsAnyO...
Fails if the map does not contain at least the given set of entries in the given map.
[ "Fails", "if", "the", "map", "does", "not", "contain", "at", "least", "the", "given", "set", "of", "entries", "in", "the", "given", "map", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MapSubject.java#L251-L263
antlrjavaparser/antlr-java-parser
src/main/java/com/github/antlrjavaparser/ASTHelper.java
ASTHelper.addTypeDeclaration
public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { List<TypeDeclaration> types = cu.getTypes(); if (types == null) { types = new ArrayList<TypeDeclaration>(); cu.setTypes(types); } types.add(type); }
java
public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { List<TypeDeclaration> types = cu.getTypes(); if (types == null) { types = new ArrayList<TypeDeclaration>(); cu.setTypes(types); } types.add(type); }
[ "public", "static", "void", "addTypeDeclaration", "(", "CompilationUnit", "cu", ",", "TypeDeclaration", "type", ")", "{", "List", "<", "TypeDeclaration", ">", "types", "=", "cu", ".", "getTypes", "(", ")", ";", "if", "(", "types", "==", "null", ")", "{", ...
Adds the given type declaration to the compilation unit. The list of types will be initialized if it is <code>null</code>. @param cu compilation unit @param type type declaration
[ "Adds", "the", "given", "type", "declaration", "to", "the", "compilation", "unit", ".", "The", "list", "of", "types", "will", "be", "initialized", "if", "it", "is", "<code", ">", "null<", "/", "code", ">", "." ]
train
https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L202-L210
jcuda/jcudnn
JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java
JCudnn.cudnnGetConvolutionNdForwardOutputDim
public static int cudnnGetConvolutionNdForwardOutputDim( cudnnConvolutionDescriptor convDesc, cudnnTensorDescriptor inputTensorDesc, cudnnFilterDescriptor filterDesc, int nbDims, int[] tensorOuputDimA) { return checkResult(cudnnGetConvolutionNdForwardOutputDimNative(convDesc, inputTensorDesc, filterDesc, nbDims, tensorOuputDimA)); }
java
public static int cudnnGetConvolutionNdForwardOutputDim( cudnnConvolutionDescriptor convDesc, cudnnTensorDescriptor inputTensorDesc, cudnnFilterDescriptor filterDesc, int nbDims, int[] tensorOuputDimA) { return checkResult(cudnnGetConvolutionNdForwardOutputDimNative(convDesc, inputTensorDesc, filterDesc, nbDims, tensorOuputDimA)); }
[ "public", "static", "int", "cudnnGetConvolutionNdForwardOutputDim", "(", "cudnnConvolutionDescriptor", "convDesc", ",", "cudnnTensorDescriptor", "inputTensorDesc", ",", "cudnnFilterDescriptor", "filterDesc", ",", "int", "nbDims", ",", "int", "[", "]", "tensorOuputDimA", ")"...
Helper function to return the dimensions of the output tensor given a convolution descriptor
[ "Helper", "function", "to", "return", "the", "dimensions", "of", "the", "output", "tensor", "given", "a", "convolution", "descriptor" ]
train
https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L989-L997
kirgor/enklib
common/src/main/java/com/kirgor/enklib/common/ConfigUtils.java
ConfigUtils.loadFromXMLFile
public static <T> T loadFromXMLFile(Class<T> configClass, File file) throws Exception { Persister persister = new Persister(); return persister.read(configClass, file); }
java
public static <T> T loadFromXMLFile(Class<T> configClass, File file) throws Exception { Persister persister = new Persister(); return persister.read(configClass, file); }
[ "public", "static", "<", "T", ">", "T", "loadFromXMLFile", "(", "Class", "<", "T", ">", "configClass", ",", "File", "file", ")", "throws", "Exception", "{", "Persister", "persister", "=", "new", "Persister", "(", ")", ";", "return", "persister", ".", "re...
Loads config values from XML file, maps them to configuration class fields and returns the result instance. @param configClass Class, which fields will be mapped to config values. @param file Where to load the config from. @param <T> Generic type of configClass @return Instance of configClass with field values loaded from config file. @throws Exception
[ "Loads", "config", "values", "from", "XML", "file", "maps", "them", "to", "configuration", "class", "fields", "and", "returns", "the", "result", "instance", "." ]
train
https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/common/src/main/java/com/kirgor/enklib/common/ConfigUtils.java#L71-L74
JOML-CI/JOML
src/org/joml/Vector2f.java
Vector2f.fma
public Vector2f fma(Vector2fc a, Vector2fc b) { return fma(a, b, thisOrNew()); }
java
public Vector2f fma(Vector2fc a, Vector2fc b) { return fma(a, b, thisOrNew()); }
[ "public", "Vector2f", "fma", "(", "Vector2fc", "a", ",", "Vector2fc", "b", ")", "{", "return", "fma", "(", "a", ",", "b", ",", "thisOrNew", "(", ")", ")", ";", "}" ]
Add the component-wise multiplication of <code>a * b</code> to this vector. @param a the first multiplicand @param b the second multiplicand @return a vector holding the result
[ "Add", "the", "component", "-", "wise", "multiplication", "of", "<code", ">", "a", "*", "b<", "/", "code", ">", "to", "this", "vector", "." ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2f.java#L944-L946
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/ArrayMatrix.java
ArrayMatrix.checkIndices
private void checkIndices(int row, int col) { if (row < 0 || row >= rows) throw new ArrayIndexOutOfBoundsException("row: " + row); else if (col < 0 || col >= cols) throw new ArrayIndexOutOfBoundsException("column: " + col); }
java
private void checkIndices(int row, int col) { if (row < 0 || row >= rows) throw new ArrayIndexOutOfBoundsException("row: " + row); else if (col < 0 || col >= cols) throw new ArrayIndexOutOfBoundsException("column: " + col); }
[ "private", "void", "checkIndices", "(", "int", "row", ",", "int", "col", ")", "{", "if", "(", "row", "<", "0", "||", "row", ">=", "rows", ")", "throw", "new", "ArrayIndexOutOfBoundsException", "(", "\"row: \"", "+", "row", ")", ";", "else", "if", "(", ...
Check that the indices of a requested cell are within bounds. @param row The row of the cell to check. @param col The column of the cell to check. @throws ArrayIndexOutOfBoundsException if
[ "Check", "that", "the", "indices", "of", "a", "requested", "cell", "are", "within", "bounds", "." ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/ArrayMatrix.java#L139-L144
Impetus/Kundera
src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java
GraphEntityMapper.fromNeo4JObject
public Object fromNeo4JObject(Object source, Field field) { Class<?> targetClass = field.getType(); if (targetClass.isAssignableFrom(BigDecimal.class) || targetClass.isAssignableFrom(BigInteger.class)) { return PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), source.getClass(), source); } else if (targetClass.isAssignableFrom(Calendar.class) || targetClass.isAssignableFrom(GregorianCalendar.class)) { Date d = (Date) PropertyAccessorHelper.fromSourceToTargetClass(Date.class, source.getClass(), source); Calendar cal = Calendar.getInstance(); cal.setTime(d); return cal; } else if (targetClass.isAssignableFrom(Date.class)) { return PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), source.getClass(), source); } else { return source; } }
java
public Object fromNeo4JObject(Object source, Field field) { Class<?> targetClass = field.getType(); if (targetClass.isAssignableFrom(BigDecimal.class) || targetClass.isAssignableFrom(BigInteger.class)) { return PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), source.getClass(), source); } else if (targetClass.isAssignableFrom(Calendar.class) || targetClass.isAssignableFrom(GregorianCalendar.class)) { Date d = (Date) PropertyAccessorHelper.fromSourceToTargetClass(Date.class, source.getClass(), source); Calendar cal = Calendar.getInstance(); cal.setTime(d); return cal; } else if (targetClass.isAssignableFrom(Date.class)) { return PropertyAccessorHelper.fromSourceToTargetClass(field.getType(), source.getClass(), source); } else { return source; } }
[ "public", "Object", "fromNeo4JObject", "(", "Object", "source", ",", "Field", "field", ")", "{", "Class", "<", "?", ">", "targetClass", "=", "field", ".", "getType", "(", ")", ";", "if", "(", "targetClass", ".", "isAssignableFrom", "(", "BigDecimal", ".", ...
Converts a property stored in Neo4J (nodes or relationship) to corresponding entity field value
[ "Converts", "a", "property", "stored", "in", "Neo4J", "(", "nodes", "or", "relationship", ")", "to", "corresponding", "entity", "field", "value" ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java#L629-L653
andkulikov/Transitions-Everywhere
library(1.x)/src/main/java/com/transitionseverywhere/Transition.java
Transition.excludeChildren
@NonNull public Transition excludeChildren(@Nullable Class type, boolean exclude) { mTargetTypeChildExcludes = excludeObject(mTargetTypeChildExcludes, type, exclude); return this; }
java
@NonNull public Transition excludeChildren(@Nullable Class type, boolean exclude) { mTargetTypeChildExcludes = excludeObject(mTargetTypeChildExcludes, type, exclude); return this; }
[ "@", "NonNull", "public", "Transition", "excludeChildren", "(", "@", "Nullable", "Class", "type", ",", "boolean", "exclude", ")", "{", "mTargetTypeChildExcludes", "=", "excludeObject", "(", "mTargetTypeChildExcludes", ",", "type", ",", "exclude", ")", ";", "return...
Whether to add the given type to the list of types whose children should be excluded from this transition. The <code>exclude</code> parameter specifies whether the target type should be added to or removed from the excluded list. <p/> <p>Excluding targets is a general mechanism for allowing transitions to run on a view hierarchy while skipping target views that should not be part of the transition. For example, you may want to avoid animating children of a specific ListView or Spinner. Views can be excluded either by their id, or by their instance reference, or by the Class of that view (eg, {@link Spinner}).</p> @param type The type to ignore when running this transition. @param exclude Whether to add the target type to or remove it from the current list of excluded target types. @return This transition object. @see #excludeTarget(Class, boolean) @see #excludeChildren(int, boolean) @see #excludeChildren(View, boolean)
[ "Whether", "to", "add", "the", "given", "type", "to", "the", "list", "of", "types", "whose", "children", "should", "be", "excluded", "from", "this", "transition", ".", "The", "<code", ">", "exclude<", "/", "code", ">", "parameter", "specifies", "whether", ...
train
https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/Transition.java#L1320-L1324
jcuda/jcusparse
JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java
JCusparse.cusparseSdense2csr
public static int cusparseSdense2csr( cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer A, int lda, Pointer nnzPerRow, Pointer csrSortedValA, Pointer csrSortedRowPtrA, Pointer csrSortedColIndA) { return checkResult(cusparseSdense2csrNative(handle, m, n, descrA, A, lda, nnzPerRow, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA)); }
java
public static int cusparseSdense2csr( cusparseHandle handle, int m, int n, cusparseMatDescr descrA, Pointer A, int lda, Pointer nnzPerRow, Pointer csrSortedValA, Pointer csrSortedRowPtrA, Pointer csrSortedColIndA) { return checkResult(cusparseSdense2csrNative(handle, m, n, descrA, A, lda, nnzPerRow, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA)); }
[ "public", "static", "int", "cusparseSdense2csr", "(", "cusparseHandle", "handle", ",", "int", "m", ",", "int", "n", ",", "cusparseMatDescr", "descrA", ",", "Pointer", "A", ",", "int", "lda", ",", "Pointer", "nnzPerRow", ",", "Pointer", "csrSortedValA", ",", ...
Description: This routine converts a dense matrix to a sparse matrix in the CSR storage format, using the information computed by the nnz routine.
[ "Description", ":", "This", "routine", "converts", "a", "dense", "matrix", "to", "a", "sparse", "matrix", "in", "the", "CSR", "storage", "format", "using", "the", "information", "computed", "by", "the", "nnz", "routine", "." ]
train
https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L11174-L11187
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/FormatterFacade.java
FormatterFacade.formatResourceRegion
@Pure public String formatResourceRegion(XtextResource resource, int offset, int length) { assert resource != null; assert offset >= 0; assert length >= 0; try { final ITextRegionAccess regionAccess = this.regionAccessBuilder.get().forNodeModel(resource).create(); final FormatterRequest formatterRequest = new FormatterRequest(); formatterRequest.setAllowIdentityEdits(false); formatterRequest.setRegions(Collections.singleton(regionAccess.regionForOffset(offset, length))); formatterRequest.setTextRegionAccess(regionAccess); final List<ITextReplacement> replacements = this.formatter.format(formatterRequest); return regionAccess.getRewriter().renderToString(replacements); } catch (Exception exception) { throw Exceptions.sneakyThrow(exception); } }
java
@Pure public String formatResourceRegion(XtextResource resource, int offset, int length) { assert resource != null; assert offset >= 0; assert length >= 0; try { final ITextRegionAccess regionAccess = this.regionAccessBuilder.get().forNodeModel(resource).create(); final FormatterRequest formatterRequest = new FormatterRequest(); formatterRequest.setAllowIdentityEdits(false); formatterRequest.setRegions(Collections.singleton(regionAccess.regionForOffset(offset, length))); formatterRequest.setTextRegionAccess(regionAccess); final List<ITextReplacement> replacements = this.formatter.format(formatterRequest); return regionAccess.getRewriter().renderToString(replacements); } catch (Exception exception) { throw Exceptions.sneakyThrow(exception); } }
[ "@", "Pure", "public", "String", "formatResourceRegion", "(", "XtextResource", "resource", ",", "int", "offset", ",", "int", "length", ")", "{", "assert", "resource", "!=", "null", ";", "assert", "offset", ">=", "0", ";", "assert", "length", ">=", "0", ";"...
Format the code in the given region. <p>This function does not change the resource content. @param resource the resource to format. @param offset the offset of the text to format. @param length the length of the text. @return the result of the formatting.
[ "Format", "the", "code", "in", "the", "given", "region", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/FormatterFacade.java#L185-L201
detro/ghostdriver
binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriver.java
PhantomJSDriver.executePhantomJS
public Object executePhantomJS(String script, Object... args) { script = script.replaceAll("\"", "\\\""); Iterable<Object> convertedArgs = Iterables.transform( Lists.newArrayList(args), new WebElementToJsonConverter()); Map<String, ?> params = ImmutableMap.of( "script", script, "args", Lists.newArrayList(convertedArgs)); return execute(COMMAND_EXECUTE_PHANTOM_SCRIPT, params).getValue(); }
java
public Object executePhantomJS(String script, Object... args) { script = script.replaceAll("\"", "\\\""); Iterable<Object> convertedArgs = Iterables.transform( Lists.newArrayList(args), new WebElementToJsonConverter()); Map<String, ?> params = ImmutableMap.of( "script", script, "args", Lists.newArrayList(convertedArgs)); return execute(COMMAND_EXECUTE_PHANTOM_SCRIPT, params).getValue(); }
[ "public", "Object", "executePhantomJS", "(", "String", "script", ",", "Object", "...", "args", ")", "{", "script", "=", "script", ".", "replaceAll", "(", "\"\\\"\"", ",", "\"\\\\\\\"\"", ")", ";", "Iterable", "<", "Object", ">", "convertedArgs", "=", "Iterab...
Execute a PhantomJS fragment. Provides extra functionality not found in WebDriver but available in PhantomJS. <br> See the <a href="http://phantomjs.org/api/">PhantomJS API</a> for details on what is available. <br> The javascript this keyword points to the currently selected page that is available for use. If there is no page yet, one is created. <br> When overriding any callbacks be sure to wrap in a try/catch block, as failures may cause future WebDriver calls to fail. <br> Certain callbacks are used by GhostDriver (the PhantomJS WebDriver implementation) already. Overriding these may cause the script to fail. It's a good idea to check for existing callbacks before overriding. @param script The fragment of PhantomJS JavaScript to execute. @param args List of arguments to pass to the function that the script is wrapped in. These can accessed in the script as 'arguments[0]', 'arguments[1]', 'arguments[2]', etc @return The result of the evaluation.
[ "Execute", "a", "PhantomJS", "fragment", ".", "Provides", "extra", "functionality", "not", "found", "in", "WebDriver", "but", "available", "in", "PhantomJS", ".", "<br", ">", "See", "the", "<a", "href", "=", "http", ":", "//", "phantomjs", ".", "org", "/",...
train
https://github.com/detro/ghostdriver/blob/fe3063d52f47ec2781d43970452595c42f729ebf/binding/java/src/main/java/org/openqa/selenium/phantomjs/PhantomJSDriver.java#L164-L173
Tourenathan-G5organisation/SiliCompressor
silicompressor/src/main/java/com/iceteck/silicompressorr/SiliCompressor.java
SiliCompressor.compressVideo
public String compressVideo(String videoFilePath, String destinationDir, int outWidth, int outHeight, int bitrate) throws URISyntaxException { boolean isconverted = MediaController.getInstance().convertVideo(videoFilePath, new File(destinationDir), outWidth, outHeight, bitrate); if (isconverted) { Log.v(LOG_TAG, "Video Conversion Complete"); } else { Log.v(LOG_TAG, "Video conversion in progress"); } return MediaController.cachedFile.getPath(); }
java
public String compressVideo(String videoFilePath, String destinationDir, int outWidth, int outHeight, int bitrate) throws URISyntaxException { boolean isconverted = MediaController.getInstance().convertVideo(videoFilePath, new File(destinationDir), outWidth, outHeight, bitrate); if (isconverted) { Log.v(LOG_TAG, "Video Conversion Complete"); } else { Log.v(LOG_TAG, "Video conversion in progress"); } return MediaController.cachedFile.getPath(); }
[ "public", "String", "compressVideo", "(", "String", "videoFilePath", ",", "String", "destinationDir", ",", "int", "outWidth", ",", "int", "outHeight", ",", "int", "bitrate", ")", "throws", "URISyntaxException", "{", "boolean", "isconverted", "=", "MediaController", ...
Perform background video compression. Make sure the videofileUri and destinationUri are valid resources because this method does not account for missing directories hence your converted file could be in an unknown location @param videoFilePath source path for the video file @param destinationDir destination directory where converted file should be saved @param outWidth the target width of the compressed video or 0 to use default width @param outHeight the target height of the compressed video or 0 to use default height @param bitrate the target bitrate of the compressed video or 0 to user default bitrate @return The Path of the compressed video file
[ "Perform", "background", "video", "compression", ".", "Make", "sure", "the", "videofileUri", "and", "destinationUri", "are", "valid", "resources", "because", "this", "method", "does", "not", "account", "for", "missing", "directories", "hence", "your", "converted", ...
train
https://github.com/Tourenathan-G5organisation/SiliCompressor/blob/546f6cd7b2a7a783e1122df46c1e237f8938fe72/silicompressor/src/main/java/com/iceteck/silicompressorr/SiliCompressor.java#L332-L342
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ProxyReceiveListener.java
ProxyReceiveListener.processSchema
private void processSchema(CommsByteBuffer buffer, Conversation conversation) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "processSchema", new Object[] { buffer, conversation }); ClientConversationState convState = (ClientConversationState) conversation.getAttachment(); byte[] mfpDataAsBytes = buffer.getRemaining(); // Get hold of the CommsConnection associated with this conversation CommsConnection cc = convState.getCommsConnection(); // Get hold of MFP Singleton and pass it the schema try { // Get hold of product version final HandshakeProperties handshakeGroup = conversation.getHandshakeProperties(); final int productVersion = handshakeGroup.getMajorVersion(); // Get hold of MFP and inform it of the schema CompHandshake ch = (CompHandshake) CompHandshakeFactory.getInstance(); ch.compData(cc,productVersion,mfpDataAsBytes); } catch (Exception e1) { FFDCFilter.processException(e1, CLASS_NAME + ".processSchema", CommsConstants.PROXYRECEIVELISTENER_PROCESSSCHEMA_01, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "MFP unable to create CompHandshake Singleton", e1); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processSchema"); }
java
private void processSchema(CommsByteBuffer buffer, Conversation conversation) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "processSchema", new Object[] { buffer, conversation }); ClientConversationState convState = (ClientConversationState) conversation.getAttachment(); byte[] mfpDataAsBytes = buffer.getRemaining(); // Get hold of the CommsConnection associated with this conversation CommsConnection cc = convState.getCommsConnection(); // Get hold of MFP Singleton and pass it the schema try { // Get hold of product version final HandshakeProperties handshakeGroup = conversation.getHandshakeProperties(); final int productVersion = handshakeGroup.getMajorVersion(); // Get hold of MFP and inform it of the schema CompHandshake ch = (CompHandshake) CompHandshakeFactory.getInstance(); ch.compData(cc,productVersion,mfpDataAsBytes); } catch (Exception e1) { FFDCFilter.processException(e1, CLASS_NAME + ".processSchema", CommsConstants.PROXYRECEIVELISTENER_PROCESSSCHEMA_01, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "MFP unable to create CompHandshake Singleton", e1); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processSchema"); }
[ "private", "void", "processSchema", "(", "CommsByteBuffer", "buffer", ",", "Conversation", "conversation", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "("...
This method will process a schema received from our peer's MFP compoennt. At the moment this consists of contacting MFP here on the client and giving it the schema. Schemas are received when the ME is about to send us a message and realises that we don't have the necessary schema to decode it. A High priority message is then sent ahead of the data ensuring that by the time the message is received the schema will be understood. @param buffer @param conversation
[ "This", "method", "will", "process", "a", "schema", "received", "from", "our", "peer", "s", "MFP", "compoennt", ".", "At", "the", "moment", "this", "consists", "of", "contacting", "MFP", "here", "on", "the", "client", "and", "giving", "it", "the", "schema"...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ProxyReceiveListener.java#L600-L636
liuyukuai/commons
commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java
LocalDateUtil.untilDays
public static List<LocalDate> untilDays(String startDate, String endDate) { return untilDays(parse(startDate, DEFAULT_PATTERN), parse(endDate, DEFAULT_PATTERN)); }
java
public static List<LocalDate> untilDays(String startDate, String endDate) { return untilDays(parse(startDate, DEFAULT_PATTERN), parse(endDate, DEFAULT_PATTERN)); }
[ "public", "static", "List", "<", "LocalDate", ">", "untilDays", "(", "String", "startDate", ",", "String", "endDate", ")", "{", "return", "untilDays", "(", "parse", "(", "startDate", ",", "DEFAULT_PATTERN", ")", ",", "parse", "(", "endDate", ",", "DEFAULT_PA...
计算两个时间内的日期 @param startDate 开始时间 @param endDate 结束时间 @return 日期集合
[ "计算两个时间内的日期" ]
train
https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateUtil.java#L130-L132
arquillian/arquillian-core
core/impl-base/src/main/java/org/jboss/arquillian/core/impl/loadable/JavaSPIExtensionLoader.java
JavaSPIExtensionLoader.loadVetoed
public Map<Class<?>, Set<Class<?>>> loadVetoed(ClassLoader classLoader) { Validate.notNull(classLoader, "ClassLoader must be provided"); final Map<Class<?>, Set<Class<?>>> vetoed = new LinkedHashMap<Class<?>, Set<Class<?>>>(); try { final Enumeration<URL> exclusions = classLoader.getResources(EXCLUSIONS); while (exclusions.hasMoreElements()) { URL exclusion = exclusions.nextElement(); Properties vetoedElements = new Properties(); final InputStream inStream = exclusion.openStream(); try { vetoedElements.load(inStream); final Set<Map.Entry<Object, Object>> entries = vetoedElements.entrySet(); for (Map.Entry<Object, Object> entry : entries) { String service = (String) entry.getKey(); String serviceImpls = (String) entry.getValue(); addVetoedClasses(service, serviceImpls, classLoader, vetoed); } } finally { if (inStream != null) { inStream.close(); } } } } catch (IOException e) { throw new RuntimeException("Could not load exclusions from " + EXCLUSIONS, e); } return vetoed; }
java
public Map<Class<?>, Set<Class<?>>> loadVetoed(ClassLoader classLoader) { Validate.notNull(classLoader, "ClassLoader must be provided"); final Map<Class<?>, Set<Class<?>>> vetoed = new LinkedHashMap<Class<?>, Set<Class<?>>>(); try { final Enumeration<URL> exclusions = classLoader.getResources(EXCLUSIONS); while (exclusions.hasMoreElements()) { URL exclusion = exclusions.nextElement(); Properties vetoedElements = new Properties(); final InputStream inStream = exclusion.openStream(); try { vetoedElements.load(inStream); final Set<Map.Entry<Object, Object>> entries = vetoedElements.entrySet(); for (Map.Entry<Object, Object> entry : entries) { String service = (String) entry.getKey(); String serviceImpls = (String) entry.getValue(); addVetoedClasses(service, serviceImpls, classLoader, vetoed); } } finally { if (inStream != null) { inStream.close(); } } } } catch (IOException e) { throw new RuntimeException("Could not load exclusions from " + EXCLUSIONS, e); } return vetoed; }
[ "public", "Map", "<", "Class", "<", "?", ">", ",", "Set", "<", "Class", "<", "?", ">", ">", ">", "loadVetoed", "(", "ClassLoader", "classLoader", ")", "{", "Validate", ".", "notNull", "(", "classLoader", ",", "\"ClassLoader must be provided\"", ")", ";", ...
This method first finds all files that are in claspath placed at META-INF/exclusions Each of this file has a name that represents the service type that needs to veto. The content of this file is a list of real implementations that you want to veto. @return List of vetos
[ "This", "method", "first", "finds", "all", "files", "that", "are", "in", "claspath", "placed", "at", "META", "-", "INF", "/", "exclusions", "Each", "of", "this", "file", "has", "a", "name", "that", "represents", "the", "service", "type", "that", "needs", ...
train
https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/core/impl-base/src/main/java/org/jboss/arquillian/core/impl/loadable/JavaSPIExtensionLoader.java#L84-L120
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java
TmdbAccount.getRatedMovies
public ResultList<MovieBasic> getRatedMovies(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, accountId); parameters.add(Param.PAGE, page); parameters.add(Param.SORT_BY, sortBy); parameters.add(Param.LANGUAGE, language); URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).subMethod(MethodSub.RATED_MOVIES).buildUrl(parameters); WrapperGenericList<MovieBasic> wrapper = processWrapper(getTypeReference(MovieBasic.class), url, "rated movies"); return wrapper.getResultsList(); }
java
public ResultList<MovieBasic> getRatedMovies(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, accountId); parameters.add(Param.PAGE, page); parameters.add(Param.SORT_BY, sortBy); parameters.add(Param.LANGUAGE, language); URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).subMethod(MethodSub.RATED_MOVIES).buildUrl(parameters); WrapperGenericList<MovieBasic> wrapper = processWrapper(getTypeReference(MovieBasic.class), url, "rated movies"); return wrapper.getResultsList(); }
[ "public", "ResultList", "<", "MovieBasic", ">", "getRatedMovies", "(", "String", "sessionId", ",", "int", "accountId", ",", "Integer", "page", ",", "String", "sortBy", ",", "String", "language", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters...
Get the list of rated movies (and associated rating) for an account. @param sessionId @param accountId @param page @param sortBy @param language @return @throws MovieDbException
[ "Get", "the", "list", "of", "rated", "movies", "(", "and", "associated", "rating", ")", "for", "an", "account", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L179-L190
dkmfbk/knowledgestore
ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java
SelectQuery.replaceVariables
public SelectQuery replaceVariables(final BindingSet bindings) { if (bindings.size() == 0) { return this; } // TODO: check whether the visitor code (taken from BindingAssigner) is enough, especially // w.r.t. variables appearing in projection nodes (= SELECT clause). final TupleExpr newExpression = this.expression.clone(); newExpression.visit(new QueryModelVisitorBase<RuntimeException>() { @Override public void meet(final Var var) { if (!var.hasValue() && bindings.hasBinding(var.getName())) { final Value value = bindings.getValue(var.getName()); var.setValue(value); } } }); try { return from(newExpression, this.dataset); } catch (final ParseException ex) { throw new Error("Unexpected error - replacing variables made the query invalid (!)", ex); } }
java
public SelectQuery replaceVariables(final BindingSet bindings) { if (bindings.size() == 0) { return this; } // TODO: check whether the visitor code (taken from BindingAssigner) is enough, especially // w.r.t. variables appearing in projection nodes (= SELECT clause). final TupleExpr newExpression = this.expression.clone(); newExpression.visit(new QueryModelVisitorBase<RuntimeException>() { @Override public void meet(final Var var) { if (!var.hasValue() && bindings.hasBinding(var.getName())) { final Value value = bindings.getValue(var.getName()); var.setValue(value); } } }); try { return from(newExpression, this.dataset); } catch (final ParseException ex) { throw new Error("Unexpected error - replacing variables made the query invalid (!)", ex); } }
[ "public", "SelectQuery", "replaceVariables", "(", "final", "BindingSet", "bindings", ")", "{", "if", "(", "bindings", ".", "size", "(", ")", "==", "0", ")", "{", "return", "this", ";", "}", "// TODO: check whether the visitor code (taken from BindingAssigner) is enoug...
Replaces some variables of this queries with the constant values specified, returning the resulting <tt>SelectQuery</tt> object. @param bindings the bindings to apply @return the resulting <tt>SelectQuery</tt> object (possibly <tt>this</tt> if no change is required).
[ "Replaces", "some", "variables", "of", "this", "queries", "with", "the", "constant", "values", "specified", "returning", "the", "resulting", "<tt", ">", "SelectQuery<", "/", "tt", ">", "object", "." ]
train
https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java#L221-L248
alkacon/opencms-core
src/org/opencms/ui/shared/CmsContextMenuState.java
CmsContextMenuState.addChild
public ContextMenuItemState addChild(String itemCaption, String itemId) { ContextMenuItemState rootItem = new ContextMenuItemState(); rootItem.setCaption(itemCaption); rootItem.setId(itemId); m_rootItems.add(rootItem); return rootItem; }
java
public ContextMenuItemState addChild(String itemCaption, String itemId) { ContextMenuItemState rootItem = new ContextMenuItemState(); rootItem.setCaption(itemCaption); rootItem.setId(itemId); m_rootItems.add(rootItem); return rootItem; }
[ "public", "ContextMenuItemState", "addChild", "(", "String", "itemCaption", ",", "String", "itemId", ")", "{", "ContextMenuItemState", "rootItem", "=", "new", "ContextMenuItemState", "(", ")", ";", "rootItem", ".", "setCaption", "(", "itemCaption", ")", ";", "root...
Adds a child item.<p> @param itemCaption the caption @param itemId the id @return the item state
[ "Adds", "a", "child", "item", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/shared/CmsContextMenuState.java#L277-L286
maxschuster/Vaadin-SignatureField
vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/converter/StringToByteArrayConverter.java
StringToByteArrayConverter.matchMimeType
protected boolean matchMimeType(DataUrl dataUrl, MimeType mimeType) { MimeType dataUrlMimeType; try { dataUrlMimeType = MimeType.valueOfMimeType(dataUrl.getMimeType()); } catch (IllegalArgumentException e) { // The MIME-Type is not supported return false; } return mimeType.equals(dataUrlMimeType); }
java
protected boolean matchMimeType(DataUrl dataUrl, MimeType mimeType) { MimeType dataUrlMimeType; try { dataUrlMimeType = MimeType.valueOfMimeType(dataUrl.getMimeType()); } catch (IllegalArgumentException e) { // The MIME-Type is not supported return false; } return mimeType.equals(dataUrlMimeType); }
[ "protected", "boolean", "matchMimeType", "(", "DataUrl", "dataUrl", ",", "MimeType", "mimeType", ")", "{", "MimeType", "dataUrlMimeType", ";", "try", "{", "dataUrlMimeType", "=", "MimeType", ".", "valueOfMimeType", "(", "dataUrl", ".", "getMimeType", "(", ")", "...
Matches the MIME-Type of the given {@code DataUrl} with the given {@link MimeType}. @param dataUrl The {@link DataUrl} to match. @param mimeType The {@link MimeType} to match against. @return MIME-Type matches the {@link MimeType}.
[ "Matches", "the", "MIME", "-", "Type", "of", "the", "given", "{", "@code", "DataUrl", "}", "with", "the", "given", "{", "@link", "MimeType", "}", "." ]
train
https://github.com/maxschuster/Vaadin-SignatureField/blob/b6f6b7042ea9c46060af54bd92d21770abfcccee/vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/converter/StringToByteArrayConverter.java#L230-L239
UrielCh/ovh-java-sdk
ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java
ApiOvhIpLoadbalancing.serviceName_tcp_frontend_frontendId_GET
public OvhFrontendTcp serviceName_tcp_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}"; StringBuilder sb = path(qPath, serviceName, frontendId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhFrontendTcp.class); }
java
public OvhFrontendTcp serviceName_tcp_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}"; StringBuilder sb = path(qPath, serviceName, frontendId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhFrontendTcp.class); }
[ "public", "OvhFrontendTcp", "serviceName_tcp_frontend_frontendId_GET", "(", "String", "serviceName", ",", "Long", "frontendId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}\"", ";", "StringBuilder", "sb",...
Get this object properties REST: GET /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId} @param serviceName [required] The internal name of your IP load balancing @param frontendId [required] Id of your frontend
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1432-L1437
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java
TilesOverlay.setViewPort
protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) { setProjection(pProjection); getProjection().getMercatorViewPort(mViewPort); return true; }
java
protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) { setProjection(pProjection); getProjection().getMercatorViewPort(mViewPort); return true; }
[ "protected", "boolean", "setViewPort", "(", "final", "Canvas", "pCanvas", ",", "final", "Projection", "pProjection", ")", "{", "setProjection", "(", "pProjection", ")", ";", "getProjection", "(", ")", ".", "getMercatorViewPort", "(", "mViewPort", ")", ";", "retu...
Get the area we are drawing to @since 6.0.0 @return true if the tiles are to be drawn
[ "Get", "the", "area", "we", "are", "drawing", "to" ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java#L186-L190
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/retry/RetryPolicies.java
RetryPolicies.retryByRemoteException
public static final RetryPolicy retryByRemoteException( RetryPolicy defaultPolicy, Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap) { return new RemoteExceptionDependentRetry(defaultPolicy, exceptionToPolicyMap); }
java
public static final RetryPolicy retryByRemoteException( RetryPolicy defaultPolicy, Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap) { return new RemoteExceptionDependentRetry(defaultPolicy, exceptionToPolicyMap); }
[ "public", "static", "final", "RetryPolicy", "retryByRemoteException", "(", "RetryPolicy", "defaultPolicy", ",", "Map", "<", "Class", "<", "?", "extends", "Exception", ">", ",", "RetryPolicy", ">", "exceptionToPolicyMap", ")", "{", "return", "new", "RemoteExceptionDe...
<p> A retry policy for RemoteException Set a default policy with some explicit handlers for specific exceptions. </p>
[ "<p", ">", "A", "retry", "policy", "for", "RemoteException", "Set", "a", "default", "policy", "with", "some", "explicit", "handlers", "for", "specific", "exceptions", ".", "<", "/", "p", ">" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/retry/RetryPolicies.java#L119-L123
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java
JScreen.addScreenLabel
public JComponent addScreenLabel(Container parent, Converter fieldInfo) { JComponent label = new JLabel(fieldInfo.getFieldDesc()); this.setComponentConstraints(label); parent.add(label); fieldInfo.addComponent(label); return label; }
java
public JComponent addScreenLabel(Container parent, Converter fieldInfo) { JComponent label = new JLabel(fieldInfo.getFieldDesc()); this.setComponentConstraints(label); parent.add(label); fieldInfo.addComponent(label); return label; }
[ "public", "JComponent", "addScreenLabel", "(", "Container", "parent", ",", "Converter", "fieldInfo", ")", "{", "JComponent", "label", "=", "new", "JLabel", "(", "fieldInfo", ".", "getFieldDesc", "(", ")", ")", ";", "this", ".", "setComponentConstraints", "(", ...
Add this label to the first column of the grid. @param parent The container to add the control(s) to. @param fieldInfo The field to add a label to. @param gridbag The screen layout. @param c The constraint to use.
[ "Add", "this", "label", "to", "the", "first", "column", "of", "the", "grid", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java#L244-L251
kuali/ojb-1.0.4
src/xdoclet/java/src/xdoclet/modules/ojb/model/ClassDescriptorDef.java
ClassDescriptorDef.cloneReference
private ReferenceDescriptorDef cloneReference(ReferenceDescriptorDef refDef, String prefix) { ReferenceDescriptorDef copyRefDef = new ReferenceDescriptorDef(refDef, prefix); copyRefDef.setOwner(this); // we remove properties that are only relevant to the class the features are declared in copyRefDef.setProperty(PropertyHelper.OJB_PROPERTY_IGNORE, null); Properties mod = getModification(copyRefDef.getName()); if (mod != null) { if (!PropertyHelper.toBoolean(mod.getProperty(PropertyHelper.OJB_PROPERTY_IGNORE), false) && hasFeature(copyRefDef.getName())) { LogHelper.warn(true, ClassDescriptorDef.class, "process", "Class "+getName()+" has a feature that has the same name as its included reference "+ copyRefDef.getName()+" from class "+refDef.getOwner().getName()); } copyRefDef.applyModifications(mod); } return copyRefDef; }
java
private ReferenceDescriptorDef cloneReference(ReferenceDescriptorDef refDef, String prefix) { ReferenceDescriptorDef copyRefDef = new ReferenceDescriptorDef(refDef, prefix); copyRefDef.setOwner(this); // we remove properties that are only relevant to the class the features are declared in copyRefDef.setProperty(PropertyHelper.OJB_PROPERTY_IGNORE, null); Properties mod = getModification(copyRefDef.getName()); if (mod != null) { if (!PropertyHelper.toBoolean(mod.getProperty(PropertyHelper.OJB_PROPERTY_IGNORE), false) && hasFeature(copyRefDef.getName())) { LogHelper.warn(true, ClassDescriptorDef.class, "process", "Class "+getName()+" has a feature that has the same name as its included reference "+ copyRefDef.getName()+" from class "+refDef.getOwner().getName()); } copyRefDef.applyModifications(mod); } return copyRefDef; }
[ "private", "ReferenceDescriptorDef", "cloneReference", "(", "ReferenceDescriptorDef", "refDef", ",", "String", "prefix", ")", "{", "ReferenceDescriptorDef", "copyRefDef", "=", "new", "ReferenceDescriptorDef", "(", "refDef", ",", "prefix", ")", ";", "copyRefDef", ".", ...
Clones the given reference. @param refDef The reference descriptor @param prefix A prefix for the name @return The cloned reference
[ "Clones", "the", "given", "reference", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/ClassDescriptorDef.java#L479-L503
cdapio/tigon
tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java
DatumWriterGenerator.encodeInt
private void encodeInt(GeneratorAdapter mg, int intValue, int encoder) { mg.loadArg(encoder); mg.push(intValue); mg.invokeInterface(Type.getType(Encoder.class), getMethod(Encoder.class, "writeInt", int.class)); mg.pop(); }
java
private void encodeInt(GeneratorAdapter mg, int intValue, int encoder) { mg.loadArg(encoder); mg.push(intValue); mg.invokeInterface(Type.getType(Encoder.class), getMethod(Encoder.class, "writeInt", int.class)); mg.pop(); }
[ "private", "void", "encodeInt", "(", "GeneratorAdapter", "mg", ",", "int", "intValue", ",", "int", "encoder", ")", "{", "mg", ".", "loadArg", "(", "encoder", ")", ";", "mg", ".", "push", "(", "intValue", ")", ";", "mg", ".", "invokeInterface", "(", "Ty...
Generates method body for encoding an compile time int value. @param mg Method body generator @param intValue The integer constant value to encode @param encoder Method argument index of the encoder
[ "Generates", "method", "body", "for", "encoding", "an", "compile", "time", "int", "value", "." ]
train
https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L381-L386
b3log/latke
latke-core/src/main/java/org/json/JSONArray.java
JSONArray.optDouble
public double optDouble(int index, double defaultValue) { final Number val = this.optNumber(index, null); if (val == null) { return defaultValue; } final double doubleValue = val.doubleValue(); // if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) { // return defaultValue; // } return doubleValue; }
java
public double optDouble(int index, double defaultValue) { final Number val = this.optNumber(index, null); if (val == null) { return defaultValue; } final double doubleValue = val.doubleValue(); // if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) { // return defaultValue; // } return doubleValue; }
[ "public", "double", "optDouble", "(", "int", "index", ",", "double", "defaultValue", ")", "{", "final", "Number", "val", "=", "this", ".", "optNumber", "(", "index", ",", "null", ")", ";", "if", "(", "val", "==", "null", ")", "{", "return", "defaultVal...
Get the optional double value associated with an index. The defaultValue is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number. @param index subscript @param defaultValue The default value. @return The value.
[ "Get", "the", "optional", "double", "value", "associated", "with", "an", "index", ".", "The", "defaultValue", "is", "returned", "if", "there", "is", "no", "value", "for", "the", "index", "or", "if", "the", "value", "is", "not", "a", "number", "and", "can...
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONArray.java#L569-L579
52inc/android-52Kit
library-attributr/src/main/java/com/ftinc/kit/attributr/Attributr.java
Attributr.openLicenses
public static void openLicenses(Context ctx, @XmlRes int configResId){ openLicenses(ctx, configResId, ctx.getString(R.string.activity_license_label)); }
java
public static void openLicenses(Context ctx, @XmlRes int configResId){ openLicenses(ctx, configResId, ctx.getString(R.string.activity_license_label)); }
[ "public", "static", "void", "openLicenses", "(", "Context", "ctx", ",", "@", "XmlRes", "int", "configResId", ")", "{", "openLicenses", "(", "ctx", ",", "configResId", ",", "ctx", ".", "getString", "(", "R", ".", "string", ".", "activity_license_label", ")", ...
Open the third party licenses activity with the supplied configuration file @param ctx the context reference to launch the activity with @param configResId the XML configuration resource id
[ "Open", "the", "third", "party", "licenses", "activity", "with", "the", "supplied", "configuration", "file" ]
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-attributr/src/main/java/com/ftinc/kit/attributr/Attributr.java#L56-L58
lessthanoptimal/ejml
main/ejml-core/src/org/ejml/data/DMatrixSparseCSC.java
DMatrixSparseCSC.growMaxColumns
public void growMaxColumns( int desiredColumns , boolean preserveValue ) { if( col_idx.length < desiredColumns+1 ) { int[] c = new int[ desiredColumns+1 ]; if( preserveValue ) System.arraycopy(col_idx,0,c,0,col_idx.length); col_idx = c; } }
java
public void growMaxColumns( int desiredColumns , boolean preserveValue ) { if( col_idx.length < desiredColumns+1 ) { int[] c = new int[ desiredColumns+1 ]; if( preserveValue ) System.arraycopy(col_idx,0,c,0,col_idx.length); col_idx = c; } }
[ "public", "void", "growMaxColumns", "(", "int", "desiredColumns", ",", "boolean", "preserveValue", ")", "{", "if", "(", "col_idx", ".", "length", "<", "desiredColumns", "+", "1", ")", "{", "int", "[", "]", "c", "=", "new", "int", "[", "desiredColumns", "...
Increases the maximum number of columns in the matrix. @param desiredColumns Desired number of columns. @param preserveValue If the array needs to be expanded should it copy the previous values?
[ "Increases", "the", "maximum", "number", "of", "columns", "in", "the", "matrix", "." ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/data/DMatrixSparseCSC.java#L361-L368
jenkinsci/gmaven
gmaven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java
MojoSupport.getArtifact
protected Artifact getArtifact(final ArtifactItem item) throws MojoExecutionException { assert item != null; Artifact artifact = createArtifact(item); return resolveArtifact(artifact, false); }
java
protected Artifact getArtifact(final ArtifactItem item) throws MojoExecutionException { assert item != null; Artifact artifact = createArtifact(item); return resolveArtifact(artifact, false); }
[ "protected", "Artifact", "getArtifact", "(", "final", "ArtifactItem", "item", ")", "throws", "MojoExecutionException", "{", "assert", "item", "!=", "null", ";", "Artifact", "artifact", "=", "createArtifact", "(", "item", ")", ";", "return", "resolveArtifact", "(",...
Resolves the Artifact from the remote repository if necessary. If no version is specified, it will be retrieved from the dependency list or from the DependencyManagement section of the pom. @param item The item to create an artifact for; must not be null @return The artifact for the given item @throws MojoExecutionException Failed to create artifact
[ "Resolves", "the", "Artifact", "from", "the", "remote", "repository", "if", "necessary", ".", "If", "no", "version", "is", "specified", "it", "will", "be", "retrieved", "from", "the", "dependency", "list", "or", "from", "the", "DependencyManagement", "section", ...
train
https://github.com/jenkinsci/gmaven/blob/80d5f6657e15b3e05ffbb82128ed8bb280836e10/gmaven-plugin/src/main/java/org/codehaus/gmaven/plugin/MojoSupport.java#L237-L243
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple5.java
Tuple5.setFields
public void setFields(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4) { this.f0 = value0; this.f1 = value1; this.f2 = value2; this.f3 = value3; this.f4 = value4; }
java
public void setFields(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4) { this.f0 = value0; this.f1 = value1; this.f2 = value2; this.f3 = value3; this.f4 = value4; }
[ "public", "void", "setFields", "(", "T0", "value0", ",", "T1", "value1", ",", "T2", "value2", ",", "T3", "value3", ",", "T4", "value4", ")", "{", "this", ".", "f0", "=", "value0", ";", "this", ".", "f1", "=", "value1", ";", "this", ".", "f2", "="...
Sets new values to all fields of the tuple. @param value0 The value for field 0 @param value1 The value for field 1 @param value2 The value for field 2 @param value3 The value for field 3 @param value4 The value for field 4
[ "Sets", "new", "values", "to", "all", "fields", "of", "the", "tuple", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple5.java#L140-L146
biojava/biojava
biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java
AbstractSequence.addFeature
public void addFeature(int bioStart, int bioEnd, FeatureInterface<AbstractSequence<C>, C> feature) { SequenceLocation<AbstractSequence<C>, C> sequenceLocation = new SequenceLocation<AbstractSequence<C>, C>(bioStart, bioEnd, this); feature.setLocation(sequenceLocation); addFeature(feature); }
java
public void addFeature(int bioStart, int bioEnd, FeatureInterface<AbstractSequence<C>, C> feature) { SequenceLocation<AbstractSequence<C>, C> sequenceLocation = new SequenceLocation<AbstractSequence<C>, C>(bioStart, bioEnd, this); feature.setLocation(sequenceLocation); addFeature(feature); }
[ "public", "void", "addFeature", "(", "int", "bioStart", ",", "int", "bioEnd", ",", "FeatureInterface", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", "feature", ")", "{", "SequenceLocation", "<", "AbstractSequence", "<", "C", ">", ",", "C", ">", ...
Method to help set the proper details for a feature as it relates to a sequence where the feature needs to have a location on the sequence @param bioStart @param bioEnd @param feature
[ "Method", "to", "help", "set", "the", "proper", "details", "for", "a", "feature", "as", "it", "relates", "to", "a", "sequence", "where", "the", "feature", "needs", "to", "have", "a", "location", "on", "the", "sequence" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractSequence.java#L397-L402
ZieIony/Carbon
carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java
LayerDrawable.setLayerSize
public void setLayerSize(int index, int w, int h) { final ChildDrawable childDrawable = mLayerState.mChildren[index]; childDrawable.mWidth = w; childDrawable.mHeight = h; }
java
public void setLayerSize(int index, int w, int h) { final ChildDrawable childDrawable = mLayerState.mChildren[index]; childDrawable.mWidth = w; childDrawable.mHeight = h; }
[ "public", "void", "setLayerSize", "(", "int", "index", ",", "int", "w", ",", "int", "h", ")", "{", "final", "ChildDrawable", "childDrawable", "=", "mLayerState", ".", "mChildren", "[", "index", "]", ";", "childDrawable", ".", "mWidth", "=", "w", ";", "ch...
Sets an explicit size for the specified layer. <p/> <strong>Note:</strong> Setting an explicit layer size changes the default layer gravity behavior. See {@link #setLayerGravity(int, int)} for more information. @param index the index of the layer to adjust @param w width in pixels, or -1 to use the intrinsic width @param h height in pixels, or -1 to use the intrinsic height @attr ref android.R.styleable#LayerDrawableItem_width @attr ref android.R.styleable#LayerDrawableItem_height @see #getLayerWidth(int) @see #getLayerHeight(int)
[ "Sets", "an", "explicit", "size", "for", "the", "specified", "layer", ".", "<p", "/", ">", "<strong", ">", "Note", ":", "<", "/", "strong", ">", "Setting", "an", "explicit", "layer", "size", "changes", "the", "default", "layer", "gravity", "behavior", "....
train
https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java#L578-L582
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java
TimeZone.getTimeZone
private static TimeZone getTimeZone(String id, int type, boolean frozen) { TimeZone result; if (type == TIMEZONE_JDK) { result = JavaTimeZone.createTimeZone(id); if (result != null) { return frozen ? result.freeze() : result; } result = getFrozenICUTimeZone(id, false); } else { result = getFrozenICUTimeZone(id, true); } if (result == null) { LOGGER.fine("\"" +id + "\" is a bogus id so timezone is falling back to Etc/Unknown(GMT)."); result = UNKNOWN_ZONE; } return frozen ? result : result.cloneAsThawed(); }
java
private static TimeZone getTimeZone(String id, int type, boolean frozen) { TimeZone result; if (type == TIMEZONE_JDK) { result = JavaTimeZone.createTimeZone(id); if (result != null) { return frozen ? result.freeze() : result; } result = getFrozenICUTimeZone(id, false); } else { result = getFrozenICUTimeZone(id, true); } if (result == null) { LOGGER.fine("\"" +id + "\" is a bogus id so timezone is falling back to Etc/Unknown(GMT)."); result = UNKNOWN_ZONE; } return frozen ? result : result.cloneAsThawed(); }
[ "private", "static", "TimeZone", "getTimeZone", "(", "String", "id", ",", "int", "type", ",", "boolean", "frozen", ")", "{", "TimeZone", "result", ";", "if", "(", "type", "==", "TIMEZONE_JDK", ")", "{", "result", "=", "JavaTimeZone", ".", "createTimeZone", ...
Gets the <code>TimeZone</code> for the given ID and the timezone type. @param id time zone ID @param type time zone implementation type, TIMEZONE_JDK or TIMEZONE_ICU @param frozen specify if the returned object can be frozen @return the specified <code>TimeZone</code> or UNKNOWN_ZONE if the given ID cannot be understood.
[ "Gets", "the", "<code", ">", "TimeZone<", "/", "code", ">", "for", "the", "given", "ID", "and", "the", "timezone", "type", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java#L683-L699
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java
VimGenerator2.appendCluster
protected IStyleAppendable appendCluster(IStyleAppendable it, boolean addNewLine, String element0, String... elements) { it.append("syn cluster "); //$NON-NLS-1$ it.append(getLanguageSimpleName().toLowerCase()); it.append("Top add="); //$NON-NLS-1$ it.append(element0); for (final String element : elements) { it.append(","); //$NON-NLS-1$ it.append(element); } if (addNewLine) { it.newLine(); } return it; }
java
protected IStyleAppendable appendCluster(IStyleAppendable it, boolean addNewLine, String element0, String... elements) { it.append("syn cluster "); //$NON-NLS-1$ it.append(getLanguageSimpleName().toLowerCase()); it.append("Top add="); //$NON-NLS-1$ it.append(element0); for (final String element : elements) { it.append(","); //$NON-NLS-1$ it.append(element); } if (addNewLine) { it.newLine(); } return it; }
[ "protected", "IStyleAppendable", "appendCluster", "(", "IStyleAppendable", "it", ",", "boolean", "addNewLine", ",", "String", "element0", ",", "String", "...", "elements", ")", "{", "it", ".", "append", "(", "\"syn cluster \"", ")", ";", "//$NON-NLS-1$", "it", "...
Append elements to the Vim top cluster. @param it the receiver of the generated elements. @param addNewLine indicates if a new line must be appended. @param element0 the first element to add into the cluster. @param elements the other elements to add into the cluster. @return {@code it}.
[ "Append", "elements", "to", "the", "Vim", "top", "cluster", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L362-L375
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java
JacksonUtils.readJson
public static JsonNode readJson(Reader source, ClassLoader classLoader) { return SerializationUtils.readJson(source, classLoader); }
java
public static JsonNode readJson(Reader source, ClassLoader classLoader) { return SerializationUtils.readJson(source, classLoader); }
[ "public", "static", "JsonNode", "readJson", "(", "Reader", "source", ",", "ClassLoader", "classLoader", ")", "{", "return", "SerializationUtils", ".", "readJson", "(", "source", ",", "classLoader", ")", ";", "}" ]
Read a JSON string and parse to {@link JsonNode} instance, with a custom class loader. @param source @param classLoader @return
[ "Read", "a", "JSON", "string", "and", "parse", "to", "{", "@link", "JsonNode", "}", "instance", "with", "a", "custom", "class", "loader", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L180-L182
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/sjavac/Source.java
Source.hasMatch
static private boolean hasMatch(String path, List<String> patterns) { for (String p : patterns) { // Exact match if (p.equals(path)) { return true; } // Single dot the end matches this package and all its subpackages. if (p.endsWith(".*")) { // Remove the wildcard String patprefix = p.substring(0,p.length()-2); // Does the path start with the pattern prefix? if (path.startsWith(patprefix)) { // If the path has the same length as the pattern prefix, then it is a match. // If the path is longer, then make sure that // the next part of the path starts with a dot (.) to prevent // wildcard matching in the middle of a package name. if (path.length()==patprefix.length() || path.charAt(patprefix.length())=='.') { return true; } } } } return false; }
java
static private boolean hasMatch(String path, List<String> patterns) { for (String p : patterns) { // Exact match if (p.equals(path)) { return true; } // Single dot the end matches this package and all its subpackages. if (p.endsWith(".*")) { // Remove the wildcard String patprefix = p.substring(0,p.length()-2); // Does the path start with the pattern prefix? if (path.startsWith(patprefix)) { // If the path has the same length as the pattern prefix, then it is a match. // If the path is longer, then make sure that // the next part of the path starts with a dot (.) to prevent // wildcard matching in the middle of a package name. if (path.length()==patprefix.length() || path.charAt(patprefix.length())=='.') { return true; } } } } return false; }
[ "static", "private", "boolean", "hasMatch", "(", "String", "path", ",", "List", "<", "String", ">", "patterns", ")", "{", "for", "(", "String", "p", ":", "patterns", ")", "{", "// Exact match", "if", "(", "p", ".", "equals", "(", "path", ")", ")", "{...
Test if a path matches any of the patterns given. The pattern foo.bar matches only foo.bar The pattern foo.* matches foo.bar and foo.bar.zoo etc
[ "Test", "if", "a", "path", "matches", "any", "of", "the", "patterns", "given", ".", "The", "pattern", "foo", ".", "bar", "matches", "only", "foo", ".", "bar", "The", "pattern", "foo", ".", "*", "matches", "foo", ".", "bar", "and", "foo", ".", "bar", ...
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/Source.java#L224-L247
mygreen/excel-cellformatter
src/main/java/com/github/mygreen/cellformatter/lang/Utils.java
Utils.reverse
public static List<String> reverse(final String[] array) { ArgUtils.notNull(array, "array"); if(array.length == 0) { return new ArrayList<String>(); } final List<String> list = Arrays.asList(array); Collections.sort(list, new Comparator<String>() { @Override public int compare(final String str1, final String str2) { int len1 = str1.length(); int len2 = str2.length(); if(len1 != len2) { // 逆順 return Integer.compare(len1, len2) * -1; } else { // 逆順 return str1.compareTo(str2) * 1; } } }); return list; }
java
public static List<String> reverse(final String[] array) { ArgUtils.notNull(array, "array"); if(array.length == 0) { return new ArrayList<String>(); } final List<String> list = Arrays.asList(array); Collections.sort(list, new Comparator<String>() { @Override public int compare(final String str1, final String str2) { int len1 = str1.length(); int len2 = str2.length(); if(len1 != len2) { // 逆順 return Integer.compare(len1, len2) * -1; } else { // 逆順 return str1.compareTo(str2) * 1; } } }); return list; }
[ "public", "static", "List", "<", "String", ">", "reverse", "(", "final", "String", "[", "]", "array", ")", "{", "ArgUtils", ".", "notNull", "(", "array", ",", "\"array\"", ")", ";", "if", "(", "array", ".", "length", "==", "0", ")", "{", "return", ...
辞書の逆順で並び替える @param array 並び替える配列 @return @throws IllegalArgumentException array is null.
[ "辞書の逆順で並び替える" ]
train
https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/Utils.java#L45-L72
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableDocument.java
MutableDocument.setNumber
@NonNull @Override public MutableDocument setNumber(@NonNull String key, Number value) { return setValue(key, value); }
java
@NonNull @Override public MutableDocument setNumber(@NonNull String key, Number value) { return setValue(key, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableDocument", "setNumber", "(", "@", "NonNull", "String", "key", ",", "Number", "value", ")", "{", "return", "setValue", "(", "key", ",", "value", ")", ";", "}" ]
Set a Number value for the given key @param key the key. @param key the Number value. @return this MutableDocument instance
[ "Set", "a", "Number", "value", "for", "the", "given", "key" ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDocument.java#L171-L175
alkacon/opencms-core
src/org/opencms/acacia/shared/CmsSerialDateUtil.java
CmsSerialDateUtil.toIntWithDefault
public static int toIntWithDefault(String value, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(value); } catch (@SuppressWarnings("unused") Exception e) { // Do nothing, return default. } return result; }
java
public static int toIntWithDefault(String value, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(value); } catch (@SuppressWarnings("unused") Exception e) { // Do nothing, return default. } return result; }
[ "public", "static", "int", "toIntWithDefault", "(", "String", "value", ",", "int", "defaultValue", ")", "{", "int", "result", "=", "defaultValue", ";", "try", "{", "result", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "}", "catch", "(", "@",...
Parses int value and returns the provided default if the value can't be parsed. @param value the int to parse. @param defaultValue the default value. @return the parsed int, or the default value if parsing fails.
[ "Parses", "int", "value", "and", "returns", "the", "provided", "default", "if", "the", "value", "can", "t", "be", "parsed", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsSerialDateUtil.java#L48-L57
dynjs/dynjs
src/main/java/org/dynjs/runtime/linker/js/undefined/JavascriptStrictUndefinedLinker.java
JavascriptStrictUndefinedLinker.linkSetProperty
@Override public Link linkSetProperty(Invocation invocation, String propertyName) throws Exception { return new JSUndefinedPropertySetLink( invocation.builder() ); }
java
@Override public Link linkSetProperty(Invocation invocation, String propertyName) throws Exception { return new JSUndefinedPropertySetLink( invocation.builder() ); }
[ "@", "Override", "public", "Link", "linkSetProperty", "(", "Invocation", "invocation", ",", "String", "propertyName", ")", "throws", "Exception", "{", "return", "new", "JSUndefinedPropertySetLink", "(", "invocation", ".", "builder", "(", ")", ")", ";", "}" ]
/* @Override public Link linkGetProperty(Invocation invocation, String propertyName) throws Exception { return new JSObjectPropertyGetLink( invocation.builder() ); }
[ "/", "*" ]
train
https://github.com/dynjs/dynjs/blob/4bc6715eff8768f8cd92c6a167d621bbfc1e1a91/src/main/java/org/dynjs/runtime/linker/js/undefined/JavascriptStrictUndefinedLinker.java#L21-L24
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java
CoderResult.unmappableForLength
public static synchronized CoderResult unmappableForLength(int length) throws IllegalArgumentException { if (length > 0) { Integer key = Integer.valueOf(length); synchronized (_unmappableErrors) { CoderResult r = _unmappableErrors.get(key); if (r == null) { r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length); _unmappableErrors.put(key, r); } return r; } } throw new IllegalArgumentException("length <= 0: " + length); }
java
public static synchronized CoderResult unmappableForLength(int length) throws IllegalArgumentException { if (length > 0) { Integer key = Integer.valueOf(length); synchronized (_unmappableErrors) { CoderResult r = _unmappableErrors.get(key); if (r == null) { r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length); _unmappableErrors.put(key, r); } return r; } } throw new IllegalArgumentException("length <= 0: " + length); }
[ "public", "static", "synchronized", "CoderResult", "unmappableForLength", "(", "int", "length", ")", "throws", "IllegalArgumentException", "{", "if", "(", "length", ">", "0", ")", "{", "Integer", "key", "=", "Integer", ".", "valueOf", "(", "length", ")", ";", ...
Gets a <code>CoderResult</code> object indicating an unmappable character error. @param length the length of the input unit sequence denoting the unmappable character. @return a <code>CoderResult</code> object indicating an unmappable character error. @throws IllegalArgumentException if <code>length</code> is non-positive.
[ "Gets", "a", "<code", ">", "CoderResult<", "/", "code", ">", "object", "indicating", "an", "unmappable", "character", "error", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java#L140-L154
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.batchOf
public static Batch batchOf( final Collection<CachedNode> nodes, final float score, final String workspaceName ) { if (nodes == null) return emptyBatch(workspaceName, 1); return batchOf(nodes.iterator(), nodes.size(), score, workspaceName); }
java
public static Batch batchOf( final Collection<CachedNode> nodes, final float score, final String workspaceName ) { if (nodes == null) return emptyBatch(workspaceName, 1); return batchOf(nodes.iterator(), nodes.size(), score, workspaceName); }
[ "public", "static", "Batch", "batchOf", "(", "final", "Collection", "<", "CachedNode", ">", "nodes", ",", "final", "float", "score", ",", "final", "String", "workspaceName", ")", "{", "if", "(", "nodes", "==", "null", ")", "return", "emptyBatch", "(", "wor...
Create a batch of nodes around the supplied iterable container. Note that the supplied iterator is accessed lazily only when the batch is {@link Batch#nextRow() used}. @param nodes the collection of nodes to be returned; if null, an {@link #emptySequence empty instance} is returned @param score the score to return for all of the nodes @param workspaceName the name of the workspace in which all of the nodes exist @return the batch of nodes; never null
[ "Create", "a", "batch", "of", "nodes", "around", "the", "supplied", "iterable", "container", ".", "Note", "that", "the", "supplied", "iterator", "is", "accessed", "lazily", "only", "when", "the", "batch", "is", "{", "@link", "Batch#nextRow", "()", "used", "}...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1312-L1317
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java
ExtAtomContainerManipulator.makeDeepCopy
public static IAtomContainer makeDeepCopy(IAtomContainer container) { IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class); // Deep copy of the Atoms IAtom[] atoms = copyAtoms(container, newAtomContainer); // Deep copy of the bonds copyBonds(atoms, container, newAtomContainer); // Deep copy of the LonePairs for (int index = 0; index < container.getLonePairCount(); index++) { if (container.getAtom(index).getSymbol().equalsIgnoreCase("R") || container.getAtom(index).getSymbol().equalsIgnoreCase("A")) { newAtomContainer.addLonePair(container.getBuilder().newInstance(ILonePair.class, container.getAtom(index))); } else { newAtomContainer.addLonePair(index); } } for (int index = 0; index < container.getSingleElectronCount(); index++) { newAtomContainer.addSingleElectron(index); } newAtomContainer.addProperties(container.getProperties()); newAtomContainer.setFlags(container.getFlags()); newAtomContainer.setID(container.getID()); newAtomContainer.notifyChanged(); return newAtomContainer; }
java
public static IAtomContainer makeDeepCopy(IAtomContainer container) { IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class); // Deep copy of the Atoms IAtom[] atoms = copyAtoms(container, newAtomContainer); // Deep copy of the bonds copyBonds(atoms, container, newAtomContainer); // Deep copy of the LonePairs for (int index = 0; index < container.getLonePairCount(); index++) { if (container.getAtom(index).getSymbol().equalsIgnoreCase("R") || container.getAtom(index).getSymbol().equalsIgnoreCase("A")) { newAtomContainer.addLonePair(container.getBuilder().newInstance(ILonePair.class, container.getAtom(index))); } else { newAtomContainer.addLonePair(index); } } for (int index = 0; index < container.getSingleElectronCount(); index++) { newAtomContainer.addSingleElectron(index); } newAtomContainer.addProperties(container.getProperties()); newAtomContainer.setFlags(container.getFlags()); newAtomContainer.setID(container.getID()); newAtomContainer.notifyChanged(); return newAtomContainer; }
[ "public", "static", "IAtomContainer", "makeDeepCopy", "(", "IAtomContainer", "container", ")", "{", "IAtomContainer", "newAtomContainer", "=", "container", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IAtomContainer", ".", "class", ")", ";", "// Deep ...
Retrurns deep copy of the molecule @param container @return deep copy of the mol
[ "Retrurns", "deep", "copy", "of", "the", "molecule" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java#L89-L118
mabe02/lanterna
src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorColorConfiguration.java
TerminalEmulatorColorConfiguration.toAWTColor
public Color toAWTColor(TextColor color, boolean isForeground, boolean inBoldContext) { if(color instanceof TextColor.ANSI) { return colorPalette.get((TextColor.ANSI)color, isForeground, inBoldContext && useBrightColorsOnBold); } return color.toColor(); }
java
public Color toAWTColor(TextColor color, boolean isForeground, boolean inBoldContext) { if(color instanceof TextColor.ANSI) { return colorPalette.get((TextColor.ANSI)color, isForeground, inBoldContext && useBrightColorsOnBold); } return color.toColor(); }
[ "public", "Color", "toAWTColor", "(", "TextColor", "color", ",", "boolean", "isForeground", ",", "boolean", "inBoldContext", ")", "{", "if", "(", "color", "instanceof", "TextColor", ".", "ANSI", ")", "{", "return", "colorPalette", ".", "get", "(", "(", "Text...
Given a TextColor and a hint as to if the color is to be used as foreground or not and if we currently have bold text enabled or not, it returns the closest AWT color that matches this. @param color What text color to convert @param isForeground Is the color intended to be used as foreground color @param inBoldContext Is the color intended to be used for on a character this is bold @return The AWT color that represents this text color
[ "Given", "a", "TextColor", "and", "a", "hint", "as", "to", "if", "the", "color", "is", "to", "be", "used", "as", "foreground", "or", "not", "and", "if", "we", "currently", "have", "bold", "text", "enabled", "or", "not", "it", "returns", "the", "closest...
train
https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorColorConfiguration.java#L66-L71
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMapping.java
BundlePathMapping.setPathMappings
public void setPathMappings(List<String> pathMappings) { this.pathMappings.clear(); if (pathMappings != null) { for (String mapping : pathMappings) { this.pathMappings.add(new PathMapping(bundle, mapping)); } } }
java
public void setPathMappings(List<String> pathMappings) { this.pathMappings.clear(); if (pathMappings != null) { for (String mapping : pathMappings) { this.pathMappings.add(new PathMapping(bundle, mapping)); } } }
[ "public", "void", "setPathMappings", "(", "List", "<", "String", ">", "pathMappings", ")", "{", "this", ".", "pathMappings", ".", "clear", "(", ")", ";", "if", "(", "pathMappings", "!=", "null", ")", "{", "for", "(", "String", "mapping", ":", "pathMappin...
Sets the path mapping @param pathMappings the pathMappings to set
[ "Sets", "the", "path", "mapping" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMapping.java#L99-L108
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java
InsertAllRequest.newBuilder
public static Builder newBuilder(String datasetId, String tableId, Iterable<RowToInsert> rows) { return newBuilder(TableId.of(datasetId, tableId), rows); }
java
public static Builder newBuilder(String datasetId, String tableId, Iterable<RowToInsert> rows) { return newBuilder(TableId.of(datasetId, tableId), rows); }
[ "public", "static", "Builder", "newBuilder", "(", "String", "datasetId", ",", "String", "tableId", ",", "Iterable", "<", "RowToInsert", ">", "rows", ")", "{", "return", "newBuilder", "(", "TableId", ".", "of", "(", "datasetId", ",", "tableId", ")", ",", "r...
Returns a builder for an {@code InsertAllRequest} object given the destination table and the rows to insert.
[ "Returns", "a", "builder", "for", "an", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L364-L366
line/armeria
thrift/src/main/java/com/linecorp/armeria/common/thrift/AsyncMethodCallbacks.java
AsyncMethodCallbacks.invokeOnError
public static void invokeOnError(AsyncMethodCallback<?> callback, Throwable cause) { requireNonNull(callback, "callback"); requireNonNull(cause, "cause"); if (cause instanceof Exception) { callback.onError((Exception) cause); } else { callback.onError(new CompletionException(cause.toString(), cause)); } }
java
public static void invokeOnError(AsyncMethodCallback<?> callback, Throwable cause) { requireNonNull(callback, "callback"); requireNonNull(cause, "cause"); if (cause instanceof Exception) { callback.onError((Exception) cause); } else { callback.onError(new CompletionException(cause.toString(), cause)); } }
[ "public", "static", "void", "invokeOnError", "(", "AsyncMethodCallback", "<", "?", ">", "callback", ",", "Throwable", "cause", ")", "{", "requireNonNull", "(", "callback", ",", "\"callback\"", ")", ";", "requireNonNull", "(", "cause", ",", "\"cause\"", ")", ";...
Invokes {@link AsyncMethodCallback#onError(Exception)}. If the specified {@code cause} is not an {@link Exception}, it will be wrapped with a {@link CompletionException}.
[ "Invokes", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/thrift/src/main/java/com/linecorp/armeria/common/thrift/AsyncMethodCallbacks.java#L67-L75
jtrfp/javamod
src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java
ID3v2Tag.setCommentFrame
public void setCommentFrame(String description, String comment) { try { byte[] b = new byte[description.length() + comment.length() + 5]; int bytesCopied = 0; b[bytesCopied++] = 0; b[bytesCopied++] = 'e'; b[bytesCopied++] = 'n'; b[bytesCopied++] = 'g'; System.arraycopy(description.getBytes(ENC_TYPE), 0, b, bytesCopied, description.length()); bytesCopied += description.length(); b[bytesCopied++] = 0; System.arraycopy(comment.getBytes(ENC_TYPE), 0, b, bytesCopied, comment.length()); bytesCopied += comment.length(); updateFrameData(ID3v2Frames.COMMENTS, b); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } }
java
public void setCommentFrame(String description, String comment) { try { byte[] b = new byte[description.length() + comment.length() + 5]; int bytesCopied = 0; b[bytesCopied++] = 0; b[bytesCopied++] = 'e'; b[bytesCopied++] = 'n'; b[bytesCopied++] = 'g'; System.arraycopy(description.getBytes(ENC_TYPE), 0, b, bytesCopied, description.length()); bytesCopied += description.length(); b[bytesCopied++] = 0; System.arraycopy(comment.getBytes(ENC_TYPE), 0, b, bytesCopied, comment.length()); bytesCopied += comment.length(); updateFrameData(ID3v2Frames.COMMENTS, b); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } }
[ "public", "void", "setCommentFrame", "(", "String", "description", ",", "String", "comment", ")", "{", "try", "{", "byte", "[", "]", "b", "=", "new", "byte", "[", "description", ".", "length", "(", ")", "+", "comment", ".", "length", "(", ")", "+", "...
Set the data contained in the comments frame (COMM). @param description a description of the comment @param comment the comment
[ "Set", "the", "data", "contained", "in", "the", "comments", "frame", "(", "COMM", ")", "." ]
train
https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L395-L417
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java
JournalReader.readStreamArgument
private void readStreamArgument(XMLEventReader reader, ConsumerJournalEntry journalEntry, String name) throws XMLStreamException, JournalException { try { File tempFile = JournalHelper.createTempFile(); DecodingBase64OutputStream decoder = new DecodingBase64OutputStream(new FileOutputStream(tempFile)); while (true) { XMLEvent event = reader.nextEvent(); if (event.isCharacters()) { decoder.write(event.asCharacters().getData()); } else if (isEndTagEvent(event, QNAME_TAG_ARGUMENT)) { break; } else { throw getUnexpectedEventInArgumentException(name, ARGUMENT_TYPE_STREAM, journalEntry .getMethodName(), event); } } decoder.close(); journalEntry.addArgument(name, tempFile); } catch (IOException e) { throw new JournalException("failed to write stream argument to temp file", e); } }
java
private void readStreamArgument(XMLEventReader reader, ConsumerJournalEntry journalEntry, String name) throws XMLStreamException, JournalException { try { File tempFile = JournalHelper.createTempFile(); DecodingBase64OutputStream decoder = new DecodingBase64OutputStream(new FileOutputStream(tempFile)); while (true) { XMLEvent event = reader.nextEvent(); if (event.isCharacters()) { decoder.write(event.asCharacters().getData()); } else if (isEndTagEvent(event, QNAME_TAG_ARGUMENT)) { break; } else { throw getUnexpectedEventInArgumentException(name, ARGUMENT_TYPE_STREAM, journalEntry .getMethodName(), event); } } decoder.close(); journalEntry.addArgument(name, tempFile); } catch (IOException e) { throw new JournalException("failed to write stream argument to temp file", e); } }
[ "private", "void", "readStreamArgument", "(", "XMLEventReader", "reader", ",", "ConsumerJournalEntry", "journalEntry", ",", "String", "name", ")", "throws", "XMLStreamException", ",", "JournalException", "{", "try", "{", "File", "tempFile", "=", "JournalHelper", ".", ...
An InputStream argument appears as a Base64-encoded String. It must be decoded and written to a temp file, so it can be presented to the management method as an InputStream again.
[ "An", "InputStream", "argument", "appears", "as", "a", "Base64", "-", "encoded", "String", ".", "It", "must", "be", "decoded", "and", "written", "to", "a", "temp", "file", "so", "it", "can", "be", "presented", "to", "the", "management", "method", "as", "...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java#L405-L434
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dml/select/SelectParserFactory.java
SelectParserFactory.newInstance
public static AbstractSelectParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) { switch (dbType) { case H2: case MySQL: return new MySQLSelectParser(shardingRule, lexerEngine, shardingTableMetaData); case Oracle: return new OracleSelectParser(shardingRule, lexerEngine, shardingTableMetaData); case SQLServer: return new SQLServerSelectParser(shardingRule, lexerEngine, shardingTableMetaData); case PostgreSQL: return new PostgreSQLSelectParser(shardingRule, lexerEngine, shardingTableMetaData); default: throw new UnsupportedOperationException(String.format("Cannot support database [%s].", dbType)); } }
java
public static AbstractSelectParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) { switch (dbType) { case H2: case MySQL: return new MySQLSelectParser(shardingRule, lexerEngine, shardingTableMetaData); case Oracle: return new OracleSelectParser(shardingRule, lexerEngine, shardingTableMetaData); case SQLServer: return new SQLServerSelectParser(shardingRule, lexerEngine, shardingTableMetaData); case PostgreSQL: return new PostgreSQLSelectParser(shardingRule, lexerEngine, shardingTableMetaData); default: throw new UnsupportedOperationException(String.format("Cannot support database [%s].", dbType)); } }
[ "public", "static", "AbstractSelectParser", "newInstance", "(", "final", "DatabaseType", "dbType", ",", "final", "ShardingRule", "shardingRule", ",", "final", "LexerEngine", "lexerEngine", ",", "final", "ShardingTableMetaData", "shardingTableMetaData", ")", "{", "switch",...
Create select parser instance. @param dbType database type @param shardingRule databases and tables sharding rule @param lexerEngine lexical analysis engine. @param shardingTableMetaData sharding metadata. @return select parser instance
[ "Create", "select", "parser", "instance", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dml/select/SelectParserFactory.java#L48-L62
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java
LibraryCacheManager.unregisterInternal
private void unregisterInternal(final JobID id) { // Use spin lock here while (this.lockMap.putIfAbsent(id, LOCK_OBJECT) != null); if (decrementReferenceCounter(id) == 0) { this.libraryManagerEntries.remove(id); } this.lockMap.remove(id); }
java
private void unregisterInternal(final JobID id) { // Use spin lock here while (this.lockMap.putIfAbsent(id, LOCK_OBJECT) != null); if (decrementReferenceCounter(id) == 0) { this.libraryManagerEntries.remove(id); } this.lockMap.remove(id); }
[ "private", "void", "unregisterInternal", "(", "final", "JobID", "id", ")", "{", "// Use spin lock here", "while", "(", "this", ".", "lockMap", ".", "putIfAbsent", "(", "id", ",", "LOCK_OBJECT", ")", "!=", "null", ")", ";", "if", "(", "decrementReferenceCounter...
Unregisters a job ID and releases the resources associated with it. @param id the job ID to unregister
[ "Unregisters", "a", "job", "ID", "and", "releases", "the", "resources", "associated", "with", "it", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L357-L367
google/j2objc
jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java
BigDecimal.multiplyDivideAndRound
private static BigDecimal multiplyDivideAndRound(long dividend0, long dividend1, long divisor, int scale, int roundingMode, int preferredScale) { int qsign = Long.signum(dividend0)*Long.signum(dividend1)*Long.signum(divisor); dividend0 = Math.abs(dividend0); dividend1 = Math.abs(dividend1); divisor = Math.abs(divisor); // multiply dividend0 * dividend1 long d0_hi = dividend0 >>> 32; long d0_lo = dividend0 & LONG_MASK; long d1_hi = dividend1 >>> 32; long d1_lo = dividend1 & LONG_MASK; long product = d0_lo * d1_lo; long d0 = product & LONG_MASK; long d1 = product >>> 32; product = d0_hi * d1_lo + d1; d1 = product & LONG_MASK; long d2 = product >>> 32; product = d0_lo * d1_hi + d1; d1 = product & LONG_MASK; d2 += product >>> 32; long d3 = d2>>>32; d2 &= LONG_MASK; product = d0_hi*d1_hi + d2; d2 = product & LONG_MASK; d3 = ((product>>>32) + d3) & LONG_MASK; final long dividendHi = make64(d3,d2); final long dividendLo = make64(d1,d0); // divide return divideAndRound128(dividendHi, dividendLo, divisor, qsign, scale, roundingMode, preferredScale); }
java
private static BigDecimal multiplyDivideAndRound(long dividend0, long dividend1, long divisor, int scale, int roundingMode, int preferredScale) { int qsign = Long.signum(dividend0)*Long.signum(dividend1)*Long.signum(divisor); dividend0 = Math.abs(dividend0); dividend1 = Math.abs(dividend1); divisor = Math.abs(divisor); // multiply dividend0 * dividend1 long d0_hi = dividend0 >>> 32; long d0_lo = dividend0 & LONG_MASK; long d1_hi = dividend1 >>> 32; long d1_lo = dividend1 & LONG_MASK; long product = d0_lo * d1_lo; long d0 = product & LONG_MASK; long d1 = product >>> 32; product = d0_hi * d1_lo + d1; d1 = product & LONG_MASK; long d2 = product >>> 32; product = d0_lo * d1_hi + d1; d1 = product & LONG_MASK; d2 += product >>> 32; long d3 = d2>>>32; d2 &= LONG_MASK; product = d0_hi*d1_hi + d2; d2 = product & LONG_MASK; d3 = ((product>>>32) + d3) & LONG_MASK; final long dividendHi = make64(d3,d2); final long dividendLo = make64(d1,d0); // divide return divideAndRound128(dividendHi, dividendLo, divisor, qsign, scale, roundingMode, preferredScale); }
[ "private", "static", "BigDecimal", "multiplyDivideAndRound", "(", "long", "dividend0", ",", "long", "dividend1", ",", "long", "divisor", ",", "int", "scale", ",", "int", "roundingMode", ",", "int", "preferredScale", ")", "{", "int", "qsign", "=", "Long", ".", ...
/* performs divideAndRound for (dividend0*dividend1, divisor) returns null if quotient can't fit into long value;
[ "/", "*", "performs", "divideAndRound", "for", "(", "dividend0", "*", "dividend1", "divisor", ")", "returns", "null", "if", "quotient", "can", "t", "fit", "into", "long", "value", ";" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4763-L4792
CloudSlang/score
score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java
ExecutionRuntimeServices.setSubFlowsData
public void setSubFlowsData(Map<String, Long> runningPlansIds, Map<String, Long> beginStepsIds) { contextMap.put(RUNNING_PLANS_MAP, (Serializable) runningPlansIds); contextMap.put(BEGIN_STEPS_MAP, (Serializable) beginStepsIds); }
java
public void setSubFlowsData(Map<String, Long> runningPlansIds, Map<String, Long> beginStepsIds) { contextMap.put(RUNNING_PLANS_MAP, (Serializable) runningPlansIds); contextMap.put(BEGIN_STEPS_MAP, (Serializable) beginStepsIds); }
[ "public", "void", "setSubFlowsData", "(", "Map", "<", "String", ",", "Long", ">", "runningPlansIds", ",", "Map", "<", "String", ",", "Long", ">", "beginStepsIds", ")", "{", "contextMap", ".", "put", "(", "RUNNING_PLANS_MAP", ",", "(", "Serializable", ")", ...
put all the data relevant for sub flows: map of runningPlanIds and list of BeginStepIds @param runningPlansIds - map of flowUUID to runningPlanId @param beginStepsIds - map of flowUUID to beginStepId
[ "put", "all", "the", "data", "relevant", "for", "sub", "flows", ":", "map", "of", "runningPlanIds", "and", "list", "of", "BeginStepIds" ]
train
https://github.com/CloudSlang/score/blob/796134e917843f4d95a90f7740d69dc5257a1a0e/score-api/src/main/java/io/cloudslang/score/lang/ExecutionRuntimeServices.java#L115-L118
diffplug/durian
src/com/diffplug/common/base/TreeNode.java
TreeNode.copy
public static <T> TreeNode<T> copy(TreeDef<T> treeDef, T root) { return copy(treeDef, root, Function.identity()); }
java
public static <T> TreeNode<T> copy(TreeDef<T> treeDef, T root) { return copy(treeDef, root, Function.identity()); }
[ "public", "static", "<", "T", ">", "TreeNode", "<", "T", ">", "copy", "(", "TreeDef", "<", "T", ">", "treeDef", ",", "T", "root", ")", "{", "return", "copy", "(", "treeDef", ",", "root", ",", "Function", ".", "identity", "(", ")", ")", ";", "}" ]
Creates a hierarchy of TreeNodes that copies the structure and content of the given tree.
[ "Creates", "a", "hierarchy", "of", "TreeNodes", "that", "copies", "the", "structure", "and", "content", "of", "the", "given", "tree", "." ]
train
https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeNode.java#L137-L139
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.signAsync
public ServiceFuture<KeyOperationResult> signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) { return ServiceFuture.fromResponse(signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); }
java
public ServiceFuture<KeyOperationResult> signAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) { return ServiceFuture.fromResponse(signWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, algorithm, value), serviceCallback); }
[ "public", "ServiceFuture", "<", "KeyOperationResult", ">", "signAsync", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ",", "String", "keyVersion", ",", "JsonWebKeySignatureAlgorithm", "algorithm", ",", "byte", "[", "]", "value", ",", "final", "ServiceCall...
Creates a signature from a digest using the specified key. The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param keyName The name of the key. @param keyVersion The version of the key. @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' @param value the Base64Url value @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceFuture} object
[ "Creates", "a", "signature", "from", "a", "digest", "using", "the", "specified", "key", ".", "The", "SIGN", "operation", "is", "applicable", "to", "asymmetric", "and", "symmetric", "keys", "stored", "in", "Azure", "Key", "Vault", "since", "this", "operation", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L2387-L2389
brianwhu/xillium
data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java
ObjectMappedQuery.getResults
public List<T> getResults(Connection conn, DataObject object) throws Exception { return executeSelect(conn, object, new ResultSetMapper<ArrayListCollector<T>>(new ArrayListCollector<T>())); }
java
public List<T> getResults(Connection conn, DataObject object) throws Exception { return executeSelect(conn, object, new ResultSetMapper<ArrayListCollector<T>>(new ArrayListCollector<T>())); }
[ "public", "List", "<", "T", ">", "getResults", "(", "Connection", "conn", ",", "DataObject", "object", ")", "throws", "Exception", "{", "return", "executeSelect", "(", "conn", ",", "object", ",", "new", "ResultSetMapper", "<", "ArrayListCollector", "<", "T", ...
Executes the query and returns the results as a list of objects.
[ "Executes", "the", "query", "and", "returns", "the", "results", "as", "a", "list", "of", "objects", "." ]
train
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ObjectMappedQuery.java#L128-L130