repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
kkopacz/agiso-core
bundles/agiso-core-beans/src/main/java/org/agiso/core/beans/util/BeanUtils.java
BeanUtils.getBean
public static Object getBean(String name, long waitTime) { """ Pobiera z kontekstu aplikacji obiekt o wskazanej nazwie w razie potrzeby wstrzymując bieżący wątek w oczekiwaniu na inicjalizację fabryki obiektów (poprzez wywołanie metody {@link #setBeanFactory(IBeanFactory)}). @param name Nazwa jednoznacznie id...
java
public static Object getBean(String name, long waitTime) { checkBeanFactory(waitTime, name); return beanFactory.getBean(name); }
[ "public", "static", "Object", "getBean", "(", "String", "name", ",", "long", "waitTime", ")", "{", "checkBeanFactory", "(", "waitTime", ",", "name", ")", ";", "return", "beanFactory", ".", "getBean", "(", "name", ")", ";", "}" ]
Pobiera z kontekstu aplikacji obiekt o wskazanej nazwie w razie potrzeby wstrzymując bieżący wątek w oczekiwaniu na inicjalizację fabryki obiektów (poprzez wywołanie metody {@link #setBeanFactory(IBeanFactory)}). @param name Nazwa jednoznacznie identyfikująca obiekt. @param waitTime Maksymalny czas oczekiwania na inic...
[ "Pobiera", "z", "kontekstu", "aplikacji", "obiekt", "o", "wskazanej", "nazwie", "w", "razie", "potrzeby", "wstrzymując", "bieżący", "wątek", "w", "oczekiwaniu", "na", "inicjalizację", "fabryki", "obiektów", "(", "poprzez", "wywołanie", "metody", "{", "@link", "#se...
train
https://github.com/kkopacz/agiso-core/blob/b994ec0146be1fe3f10829d69cd719bdbdebe1c5/bundles/agiso-core-beans/src/main/java/org/agiso/core/beans/util/BeanUtils.java#L85-L89
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java
GenericEncodingStrategy.pushRawSupport
protected void pushRawSupport(CodeAssembler a, LocalVariable instanceVar) throws SupportException { """ Generates code to push RawSupport instance to the stack. RawSupport is available only in Storable instances. If instanceVar is an Object[], a SupportException is thrown. @param instanceVar Storabl...
java
protected void pushRawSupport(CodeAssembler a, LocalVariable instanceVar) throws SupportException { boolean isObjectArrayInstanceVar = instanceVar != null && instanceVar.getType() == TypeDesc.forClass(Object[].class); if (isObjectArrayInstanceVar) { throw new ...
[ "protected", "void", "pushRawSupport", "(", "CodeAssembler", "a", ",", "LocalVariable", "instanceVar", ")", "throws", "SupportException", "{", "boolean", "isObjectArrayInstanceVar", "=", "instanceVar", "!=", "null", "&&", "instanceVar", ".", "getType", "(", ")", "==...
Generates code to push RawSupport instance to the stack. RawSupport is available only in Storable instances. If instanceVar is an Object[], a SupportException is thrown. @param instanceVar Storable instance or array of property values. Null is storable instance of "this".
[ "Generates", "code", "to", "push", "RawSupport", "instance", "to", "the", "stack", ".", "RawSupport", "is", "available", "only", "in", "Storable", "instances", ".", "If", "instanceVar", "is", "an", "Object", "[]", "a", "SupportException", "is", "thrown", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java#L1770-L1788
eclipse/xtext-core
org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java
IdeContentProposalCreator.createProposal
public ContentAssistEntry createProposal(final String proposal, final ContentAssistContext context) { """ Returns an entry with the given proposal and the prefix from the context, or null if the proposal is not valid. """ return this.createProposal(proposal, context.getPrefix(), context, ContentAssistEntry...
java
public ContentAssistEntry createProposal(final String proposal, final ContentAssistContext context) { return this.createProposal(proposal, context.getPrefix(), context, ContentAssistEntry.KIND_UNKNOWN, null); }
[ "public", "ContentAssistEntry", "createProposal", "(", "final", "String", "proposal", ",", "final", "ContentAssistContext", "context", ")", "{", "return", "this", ".", "createProposal", "(", "proposal", ",", "context", ".", "getPrefix", "(", ")", ",", "context", ...
Returns an entry with the given proposal and the prefix from the context, or null if the proposal is not valid.
[ "Returns", "an", "entry", "with", "the", "given", "proposal", "and", "the", "prefix", "from", "the", "context", "or", "null", "if", "the", "proposal", "is", "not", "valid", "." ]
train
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java#L36-L38
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentDescriptorFactory.java
ComponentDescriptorFactory.createComponentDescriptors
@Deprecated public List<ComponentDescriptor> createComponentDescriptors(Class<?> componentClass, Class<?> componentRoleClass) { """ Create component descriptors for the passed component implementation class and component role class. There can be more than one descriptor if the component class has spec...
java
@Deprecated public List<ComponentDescriptor> createComponentDescriptors(Class<?> componentClass, Class<?> componentRoleClass) { return createComponentDescriptors(componentClass, (Type) componentRoleClass); }
[ "@", "Deprecated", "public", "List", "<", "ComponentDescriptor", ">", "createComponentDescriptors", "(", "Class", "<", "?", ">", "componentClass", ",", "Class", "<", "?", ">", "componentRoleClass", ")", "{", "return", "createComponentDescriptors", "(", "componentCla...
Create component descriptors for the passed component implementation class and component role class. There can be more than one descriptor if the component class has specified several hints. @param componentClass the component implementation class @param componentRoleClass the component role class @return the componen...
[ "Create", "component", "descriptors", "for", "the", "passed", "component", "implementation", "class", "and", "component", "role", "class", ".", "There", "can", "be", "more", "than", "one", "descriptor", "if", "the", "component", "class", "has", "specified", "sev...
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentDescriptorFactory.java#L63-L68
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
DocTreeScanner.visitUnknownBlockTag
@Override public R visitUnknownBlockTag(UnknownBlockTagTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ return scan(node.getContent(), p); }
java
@Override public R visitUnknownBlockTag(UnknownBlockTagTree node, P p) { return scan(node.getContent(), p); }
[ "@", "Override", "public", "R", "visitUnknownBlockTag", "(", "UnknownBlockTagTree", "node", ",", "P", "p", ")", "{", "return", "scan", "(", "node", ".", "getContent", "(", ")", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L473-L476
m-m-m/util
cli/src/main/java/net/sf/mmm/util/cli/base/CliState.java
CliState.requireMode
protected CliModeObject requireMode(String id, Object annotationContainer) { """ This method is like {@link #getMode(String)} but also {@link net.sf.mmm.util.cli.api.CliStyle#modeUndefined() handles} the case that a {@link net.sf.mmm.util.cli.api.CliMode} may be undefined. @param id is the {@link net.sf.mmm.ut...
java
protected CliModeObject requireMode(String id, Object annotationContainer) { CliModeObject modeObject = getMode(id); if (modeObject == null) { CliStyleHandling handling = getCliStyle().modeUndefined(); if (handling != CliStyleHandling.OK) { handling.handle(LOG, new CliModeUndefinedException...
[ "protected", "CliModeObject", "requireMode", "(", "String", "id", ",", "Object", "annotationContainer", ")", "{", "CliModeObject", "modeObject", "=", "getMode", "(", "id", ")", ";", "if", "(", "modeObject", "==", "null", ")", "{", "CliStyleHandling", "handling",...
This method is like {@link #getMode(String)} but also {@link net.sf.mmm.util.cli.api.CliStyle#modeUndefined() handles} the case that a {@link net.sf.mmm.util.cli.api.CliMode} may be undefined. @param id is the {@link net.sf.mmm.util.cli.api.CliMode#id() ID} of the requested {@link net.sf.mmm.util.cli.api.CliMode}. @pa...
[ "This", "method", "is", "like", "{", "@link", "#getMode", "(", "String", ")", "}", "but", "also", "{", "@link", "net", ".", "sf", ".", "mmm", ".", "util", ".", "cli", ".", "api", ".", "CliStyle#modeUndefined", "()", "handles", "}", "the", "case", "th...
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/CliState.java#L307-L320
facebook/fresco
drawee/src/main/java/com/facebook/drawee/drawable/DrawableUtils.java
DrawableUtils.copyProperties
public static void copyProperties(@Nullable Drawable to, @Nullable Drawable from) { """ Copies various properties from one drawable to the other. @param to drawable to copy properties to @param from drawable to copy properties from """ if (from == null || to == null || to == from) { return; }...
java
public static void copyProperties(@Nullable Drawable to, @Nullable Drawable from) { if (from == null || to == null || to == from) { return; } to.setBounds(from.getBounds()); to.setChangingConfigurations(from.getChangingConfigurations()); to.setLevel(from.getLevel()); to.setVisible(from.is...
[ "public", "static", "void", "copyProperties", "(", "@", "Nullable", "Drawable", "to", ",", "@", "Nullable", "Drawable", "from", ")", "{", "if", "(", "from", "==", "null", "||", "to", "==", "null", "||", "to", "==", "from", ")", "{", "return", ";", "}...
Copies various properties from one drawable to the other. @param to drawable to copy properties to @param from drawable to copy properties from
[ "Copies", "various", "properties", "from", "one", "drawable", "to", "the", "other", "." ]
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/drawable/DrawableUtils.java#L39-L49
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
SameDiff.associateArrayWithVariable
public void associateArrayWithVariable(INDArray arr, @NonNull String variable) { """ Associate the array with the given variable. @param arr the array to get the variable for @param variable the name of the variable to associate the array with """ Preconditions.checkState(variables.containsKey(var...
java
public void associateArrayWithVariable(INDArray arr, @NonNull String variable) { Preconditions.checkState(variables.containsKey(variable), "Cannot associate array with variable \"%s\": " + "variable \"%s\" does not exist in this SameDiff instance", variable, variable); associateArrayWithVariable...
[ "public", "void", "associateArrayWithVariable", "(", "INDArray", "arr", ",", "@", "NonNull", "String", "variable", ")", "{", "Preconditions", ".", "checkState", "(", "variables", ".", "containsKey", "(", "variable", ")", ",", "\"Cannot associate array with variable \\...
Associate the array with the given variable. @param arr the array to get the variable for @param variable the name of the variable to associate the array with
[ "Associate", "the", "array", "with", "the", "given", "variable", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L779-L783
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java
PacketCapturesInner.getAsync
public Observable<PacketCaptureResultInner> getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { """ Gets a packet capture session by name. @param resourceGroupName The name of the resource group. @param networkWatcherName The name of the network watcher. @param packetCapt...
java
public Observable<PacketCaptureResultInner> getAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) { return getWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1<ServiceResponse<PacketCaptureResultInner>, PacketCaptureResultInner>() ...
[ "public", "Observable", "<", "PacketCaptureResultInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "networkWatcherName", ",", "String", "packetCaptureName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "networ...
Gets a packet capture session by name. @param resourceGroupName The name of the resource group. @param networkWatcherName The name of the network watcher. @param packetCaptureName The name of the packet capture session. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to...
[ "Gets", "a", "packet", "capture", "session", "by", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java#L325-L332
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.replaceEntry
public static boolean replaceEntry(File zip, ZipEntrySource entry, File destZip) { """ Copies an existing ZIP file and replaces a given entry in it. @param zip an existing ZIP file (only read). @param entry new ZIP entry. @param destZip new ZIP file created. @return <code>true</code> if the entry was repl...
java
public static boolean replaceEntry(File zip, ZipEntrySource entry, File destZip) { return replaceEntries(zip, new ZipEntrySource[] { entry }, destZip); }
[ "public", "static", "boolean", "replaceEntry", "(", "File", "zip", ",", "ZipEntrySource", "entry", ",", "File", "destZip", ")", "{", "return", "replaceEntries", "(", "zip", ",", "new", "ZipEntrySource", "[", "]", "{", "entry", "}", ",", "destZip", ")", ";"...
Copies an existing ZIP file and replaces a given entry in it. @param zip an existing ZIP file (only read). @param entry new ZIP entry. @param destZip new ZIP file created. @return <code>true</code> if the entry was replaced.
[ "Copies", "an", "existing", "ZIP", "file", "and", "replaces", "a", "given", "entry", "in", "it", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2594-L2596
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
HtmlDocletWriter.addTagsInfo
protected void addTagsInfo(Element e, Content htmltree) { """ Adds the tags information. @param e the Element for which the tags will be generated @param htmltree the documentation tree to which the tags will be added """ if (configuration.nocomment) { return; } Content ...
java
protected void addTagsInfo(Element e, Content htmltree) { if (configuration.nocomment) { return; } Content dl = new HtmlTree(HtmlTag.DL); if (utils.isExecutableElement(e) && !utils.isConstructor(e)) { addMethodInfo((ExecutableElement)e, dl); } Cont...
[ "protected", "void", "addTagsInfo", "(", "Element", "e", ",", "Content", "htmltree", ")", "{", "if", "(", "configuration", ".", "nocomment", ")", "{", "return", ";", "}", "Content", "dl", "=", "new", "HtmlTree", "(", "HtmlTag", ".", "DL", ")", ";", "if...
Adds the tags information. @param e the Element for which the tags will be generated @param htmltree the documentation tree to which the tags will be added
[ "Adds", "the", "tags", "information", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L310-L324
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/Hud.java
Hud.checkActionsInCommon
private static void checkActionsInCommon(Actioner actioner, Collection<ActionRef> actions) { """ Get all actions in common. @param actioner The current selectable. @param actions The collected actions in common. """ if (actions.isEmpty()) { actions.addAll(actioner.getActions(...
java
private static void checkActionsInCommon(Actioner actioner, Collection<ActionRef> actions) { if (actions.isEmpty()) { actions.addAll(actioner.getActions()); } else { actions.retainAll(actioner.getActions()); } }
[ "private", "static", "void", "checkActionsInCommon", "(", "Actioner", "actioner", ",", "Collection", "<", "ActionRef", ">", "actions", ")", "{", "if", "(", "actions", ".", "isEmpty", "(", ")", ")", "{", "actions", ".", "addAll", "(", "actioner", ".", "getA...
Get all actions in common. @param actioner The current selectable. @param actions The collected actions in common.
[ "Get", "all", "actions", "in", "common", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/Hud.java#L87-L97
apache/groovy
src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java
ClassNodeUtils.getStaticProperty
public static PropertyNode getStaticProperty(ClassNode cNode, String propName) { """ Detect whether a static property with the given name is within the class or a super class. @param cNode the ClassNode of interest @param propName the property name @return the static property if found or else null """ ...
java
public static PropertyNode getStaticProperty(ClassNode cNode, String propName) { ClassNode classNode = cNode; while (classNode != null) { for (PropertyNode pn : classNode.getProperties()) { if (pn.getName().equals(propName) && pn.isStatic()) return pn; } ...
[ "public", "static", "PropertyNode", "getStaticProperty", "(", "ClassNode", "cNode", ",", "String", "propName", ")", "{", "ClassNode", "classNode", "=", "cNode", ";", "while", "(", "classNode", "!=", "null", ")", "{", "for", "(", "PropertyNode", "pn", ":", "c...
Detect whether a static property with the given name is within the class or a super class. @param cNode the ClassNode of interest @param propName the property name @return the static property if found or else null
[ "Detect", "whether", "a", "static", "property", "with", "the", "given", "name", "is", "within", "the", "class", "or", "a", "super", "class", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java#L319-L328
rzwitserloot/lombok
src/core/lombok/javac/handlers/JavacHandlerUtil.java
JavacHandlerUtil.chainDotsString
public static JCExpression chainDotsString(JavacNode node, String elems) { """ In javac, dotted access of any kind, from {@code java.lang.String} to {@code var.methodName} is represented by a fold-left of {@code Select} nodes with the leftmost string represented by a {@code Ident} node. This method generates suc...
java
public static JCExpression chainDotsString(JavacNode node, String elems) { return chainDots(node, null, null, elems.split("\\.")); }
[ "public", "static", "JCExpression", "chainDotsString", "(", "JavacNode", "node", ",", "String", "elems", ")", "{", "return", "chainDots", "(", "node", ",", "null", ",", "null", ",", "elems", ".", "split", "(", "\"\\\\.\"", ")", ")", ";", "}" ]
In javac, dotted access of any kind, from {@code java.lang.String} to {@code var.methodName} is represented by a fold-left of {@code Select} nodes with the leftmost string represented by a {@code Ident} node. This method generates such an expression. For example, maker.Select(maker.Select(maker.Ident(NAME[java]), NAME...
[ "In", "javac", "dotted", "access", "of", "any", "kind", "from", "{", "@code", "java", ".", "lang", ".", "String", "}", "to", "{", "@code", "var", ".", "methodName", "}", "is", "represented", "by", "a", "fold", "-", "left", "of", "{", "@code", "Select...
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L1385-L1387
czyzby/gdx-lml
kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Tooltips.java
Tooltips.setDefaultTooltipManager
public static void setDefaultTooltipManager(final TooltipManager tooltipManager) { """ Since main tooltip manager instance cannot be changed globally with a regular setter, this method modifies it using reflection. @param tooltipManager will be returned on {@link TooltipManager#getInstance()} calls. @throws G...
java
public static void setDefaultTooltipManager(final TooltipManager tooltipManager) { try { TooltipManager.getInstance(); Reflection.setFieldValue(ClassReflection.getDeclaredField(TooltipManager.class, "instance"), null, tooltipManager); } catch (final Reflection...
[ "public", "static", "void", "setDefaultTooltipManager", "(", "final", "TooltipManager", "tooltipManager", ")", "{", "try", "{", "TooltipManager", ".", "getInstance", "(", ")", ";", "Reflection", ".", "setFieldValue", "(", "ClassReflection", ".", "getDeclaredField", ...
Since main tooltip manager instance cannot be changed globally with a regular setter, this method modifies it using reflection. @param tooltipManager will be returned on {@link TooltipManager#getInstance()} calls. @throws GdxRuntimeException if unable to change manager.
[ "Since", "main", "tooltip", "manager", "instance", "cannot", "be", "changed", "globally", "with", "a", "regular", "setter", "this", "method", "modifies", "it", "using", "reflection", "." ]
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Tooltips.java#L22-L30
wisdom-framework/wisdom
core/content-manager/src/main/java/org/wisdom/content/bodyparsers/BodyParserJson.java
BodyParserJson.invoke
@Override public <T> T invoke(byte[] bytes, Class<T> classOfT) { """ Builds an instance of {@literal T} from the request payload. @param bytes the payload. @param classOfT The class we expect @param <T> the type of the object @return the build object, {@literal null} if the object cannot be built...
java
@Override public <T> T invoke(byte[] bytes, Class<T> classOfT) { T t = null; try { t = json.mapper().readValue(bytes, classOfT); } catch (IOException e) { LOGGER.error(ERROR, e); } return t; }
[ "@", "Override", "public", "<", "T", ">", "T", "invoke", "(", "byte", "[", "]", "bytes", ",", "Class", "<", "T", ">", "classOfT", ")", "{", "T", "t", "=", "null", ";", "try", "{", "t", "=", "json", ".", "mapper", "(", ")", ".", "readValue", "...
Builds an instance of {@literal T} from the request payload. @param bytes the payload. @param classOfT The class we expect @param <T> the type of the object @return the build object, {@literal null} if the object cannot be built.
[ "Builds", "an", "instance", "of", "{", "@literal", "T", "}", "from", "the", "request", "payload", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/bodyparsers/BodyParserJson.java#L102-L112
facebookarchive/hive-dwrf
hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java
Slice.compareTo
@SuppressWarnings("ObjectEquality") @Override public int compareTo(Slice that) { """ Compares the content of the specified buffer to the content of this buffer. This comparison is performed byte by byte using an unsigned comparison. """ if (this == that) { return 0; } ...
java
@SuppressWarnings("ObjectEquality") @Override public int compareTo(Slice that) { if (this == that) { return 0; } return compareTo(0, size, that, 0, that.size); }
[ "@", "SuppressWarnings", "(", "\"ObjectEquality\"", ")", "@", "Override", "public", "int", "compareTo", "(", "Slice", "that", ")", "{", "if", "(", "this", "==", "that", ")", "{", "return", "0", ";", "}", "return", "compareTo", "(", "0", ",", "size", ",...
Compares the content of the specified buffer to the content of this buffer. This comparison is performed byte by byte using an unsigned comparison.
[ "Compares", "the", "content", "of", "the", "specified", "buffer", "to", "the", "content", "of", "this", "buffer", ".", "This", "comparison", "is", "performed", "byte", "by", "byte", "using", "an", "unsigned", "comparison", "." ]
train
https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L586-L594
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WListRenderer.java
WListRenderer.paintRows
protected void paintRows(final WList list, final WebXmlRenderContext renderContext) { """ Paints the rows. @param list the WList to paint the rows for. @param renderContext the RenderContext to paint to. """ List<?> beanList = list.getBeanList(); WComponent row = list.getRepeatedComponent(); XmlStrin...
java
protected void paintRows(final WList list, final WebXmlRenderContext renderContext) { List<?> beanList = list.getBeanList(); WComponent row = list.getRepeatedComponent(); XmlStringBuilder xml = renderContext.getWriter(); for (int i = 0; i < beanList.size(); i++) { Object rowData = beanList.get(i); // Ea...
[ "protected", "void", "paintRows", "(", "final", "WList", "list", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "List", "<", "?", ">", "beanList", "=", "list", ".", "getBeanList", "(", ")", ";", "WComponent", "row", "=", "list", ".", "getR...
Paints the rows. @param list the WList to paint the rows for. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "rows", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WListRenderer.java#L100-L122
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java
RuleBasedNumberFormat.extractSpecial
private String extractSpecial(StringBuilder description, String specialName) { """ This extracts the special information from the rule sets before the main parsing starts. Extra whitespace must have already been removed from the description. If found, the special information is removed from the description an...
java
private String extractSpecial(StringBuilder description, String specialName) { String result = null; int lp = description.indexOf(specialName); if (lp != -1) { // we've got to make sure we're not in the middle of a rule // (where specialName would actually get treated as ...
[ "private", "String", "extractSpecial", "(", "StringBuilder", "description", ",", "String", "specialName", ")", "{", "String", "result", "=", "null", ";", "int", "lp", "=", "description", ".", "indexOf", "(", "specialName", ")", ";", "if", "(", "lp", "!=", ...
This extracts the special information from the rule sets before the main parsing starts. Extra whitespace must have already been removed from the description. If found, the special information is removed from the description and returned, otherwise the description is unchanged and null is returned. Note: the trailin...
[ "This", "extracts", "the", "special", "information", "from", "the", "rule", "sets", "before", "the", "main", "parsing", "starts", ".", "Extra", "whitespace", "must", "have", "already", "been", "removed", "from", "the", "description", ".", "If", "found", "the",...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java#L1626-L1656
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/BinaryLogRecordSerializerVersion2Impl.java
BinaryLogRecordSerializerVersion2Impl.writeString
private static void writeString(String str, DataOutput writer) throws IOException { """ /* Serialize string. Need to take care of <code>null</code> value since {@link DataOutput#writeUTF(String)} does not handle it. """ if (str == null) { writer.writeByte(0); } else { int blocks = str.length() >> 1...
java
private static void writeString(String str, DataOutput writer) throws IOException { if (str == null) { writer.writeByte(0); } else { int blocks = str.length() >> 15; // Use smallest number of bytes possible for number of blocks. if (blocks > 0x3FFFFF) { // Need 4 bytes writer.writeByte(0xc0 | (b...
[ "private", "static", "void", "writeString", "(", "String", "str", ",", "DataOutput", "writer", ")", "throws", "IOException", "{", "if", "(", "str", "==", "null", ")", "{", "writer", ".", "writeByte", "(", "0", ")", ";", "}", "else", "{", "int", "blocks...
/* Serialize string. Need to take care of <code>null</code> value since {@link DataOutput#writeUTF(String)} does not handle it.
[ "/", "*", "Serialize", "string", ".", "Need", "to", "take", "care", "of", "<code", ">", "null<", "/", "code", ">", "value", "since", "{" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/BinaryLogRecordSerializerVersion2Impl.java#L670-L699
osglworks/java-tool
src/main/java/org/osgl/Lang.java
F3.lift
public F3<P1, P2, P3, Option<R>> lift() { """ Turns this partial function into a plain function returning an Option result. @return a function that takes an argument x to Some(this.apply(x)) if this can be applied, and to None otherwise. """ final F3<P1, P2, P3, R> me = this; return ...
java
public F3<P1, P2, P3, Option<R>> lift() { final F3<P1, P2, P3, R> me = this; return new F3<P1, P2, P3, Option<R>>() { @Override public Option<R> apply(P1 p1, P2 p2, P3 p3) { try { return some(me.apply(p1, p2, p3)); ...
[ "public", "F3", "<", "P1", ",", "P2", ",", "P3", ",", "Option", "<", "R", ">", ">", "lift", "(", ")", "{", "final", "F3", "<", "P1", ",", "P2", ",", "P3", ",", "R", ">", "me", "=", "this", ";", "return", "new", "F3", "<", "P1", ",", "P2",...
Turns this partial function into a plain function returning an Option result. @return a function that takes an argument x to Some(this.apply(x)) if this can be applied, and to None otherwise.
[ "Turns", "this", "partial", "function", "into", "a", "plain", "function", "returning", "an", "Option", "result", "." ]
train
https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1327-L1339
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java
ComputationGraph.evaluateROC
public <T extends ROC> T evaluateROC(DataSetIterator iterator, int rocThresholdSteps) { """ Evaluate the network (must be a binary classifier) on the specified data, using the {@link ROC} class @param iterator Data to evaluate on @param rocThresholdSteps Number of threshold steps to use with {@link RO...
java
public <T extends ROC> T evaluateROC(DataSetIterator iterator, int rocThresholdSteps) { Layer outputLayer = getOutputLayer(0); if(getConfiguration().isValidateOutputLayerConfig()){ OutputLayerUtil.validateOutputLayerForClassifierEvaluation(outputLayer.conf().getLayer(), ROC.class); }...
[ "public", "<", "T", "extends", "ROC", ">", "T", "evaluateROC", "(", "DataSetIterator", "iterator", ",", "int", "rocThresholdSteps", ")", "{", "Layer", "outputLayer", "=", "getOutputLayer", "(", "0", ")", ";", "if", "(", "getConfiguration", "(", ")", ".", "...
Evaluate the network (must be a binary classifier) on the specified data, using the {@link ROC} class @param iterator Data to evaluate on @param rocThresholdSteps Number of threshold steps to use with {@link ROC} @return ROC evaluation on the given dataset
[ "Evaluate", "the", "network", "(", "must", "be", "a", "binary", "classifier", ")", "on", "the", "specified", "data", "using", "the", "{", "@link", "ROC", "}", "class" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L3933-L3939
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/inject/writer/BeanDefinitionWriter.java
BeanDefinitionWriter.visitBeanDefinitionConstructor
@Override public void visitBeanDefinitionConstructor(AnnotationMetadata annotationMetadata, boolean requiresReflection) { """ Visits a no-args constructor used to create the bean definition. """ if (constructorVisitor == null) { // first bu...
java
@Override public void visitBeanDefinitionConstructor(AnnotationMetadata annotationMetadata, boolean requiresReflection) { if (constructorVisitor == null) { // first build the constructor visitBeanDefinitionConstructorInternal(annotationM...
[ "@", "Override", "public", "void", "visitBeanDefinitionConstructor", "(", "AnnotationMetadata", "annotationMetadata", ",", "boolean", "requiresReflection", ")", "{", "if", "(", "constructorVisitor", "==", "null", ")", "{", "// first build the constructor", "visitBeanDefinit...
Visits a no-args constructor used to create the bean definition.
[ "Visits", "a", "no", "-", "args", "constructor", "used", "to", "create", "the", "bean", "definition", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/BeanDefinitionWriter.java#L438-L451
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java
FormLayout.getLayoutInfo
public LayoutInfo getLayoutInfo(Container parent) { """ Computes and returns the horizontal and vertical grid origins. Performs the same layout process as {@code #layoutContainer} but does not layout the components.<p> This method has been added only to make it easier to debug the form layout. <strong>You must...
java
public LayoutInfo getLayoutInfo(Container parent) { synchronized (parent.getTreeLock()) { initializeColAndRowComponentLists(); Dimension size = parent.getSize(); Insets insets = parent.getInsets(); int totalWidth = size.width - insets.left - insets.right; ...
[ "public", "LayoutInfo", "getLayoutInfo", "(", "Container", "parent", ")", "{", "synchronized", "(", "parent", ".", "getTreeLock", "(", ")", ")", "{", "initializeColAndRowComponentLists", "(", ")", ";", "Dimension", "size", "=", "parent", ".", "getSize", "(", "...
Computes and returns the horizontal and vertical grid origins. Performs the same layout process as {@code #layoutContainer} but does not layout the components.<p> This method has been added only to make it easier to debug the form layout. <strong>You must not call this method directly; It may be removed in a future re...
[ "Computes", "and", "returns", "the", "horizontal", "and", "vertical", "grid", "origins", ".", "Performs", "the", "same", "layout", "process", "as", "{", "@code", "#layoutContainer", "}", "but", "does", "not", "layout", "the", "components", ".", "<p", ">" ]
train
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java#L1851-L1878
spring-projects/spring-android
spring-android-rest-template/src/main/java/org/springframework/http/client/support/HttpAccessor.java
HttpAccessor.createRequest
protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException { """ Create a new {@link ClientHttpRequest} via this template's {@link ClientHttpRequestFactory}. @param url the URL to connect to @param method the HTTP method to exectute (GET, POST, etc.) @return the created request @t...
java
protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException { ClientHttpRequest request = getRequestFactory().createRequest(url, method); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Created " + method.name() + " request for \"" + url + "\""); } return request; }
[ "protected", "ClientHttpRequest", "createRequest", "(", "URI", "url", ",", "HttpMethod", "method", ")", "throws", "IOException", "{", "ClientHttpRequest", "request", "=", "getRequestFactory", "(", ")", ".", "createRequest", "(", "url", ",", "method", ")", ";", "...
Create a new {@link ClientHttpRequest} via this template's {@link ClientHttpRequestFactory}. @param url the URL to connect to @param method the HTTP method to exectute (GET, POST, etc.) @return the created request @throws IOException in case of I/O errors
[ "Create", "a", "new", "{" ]
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/client/support/HttpAccessor.java#L106-L112
buschmais/jqa-rdbms-plugin
src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/ConnectionPropertyFileScannerPlugin.java
ConnectionPropertyFileScannerPlugin.loadDriver
private void loadDriver(String driver) throws IOException { """ Load a class, e.g. the JDBC driver. @param driver The class name. """ if (driver != null) { try { Class.forName(driver); } catch (ClassNotFoundException e) { throw new IOException...
java
private void loadDriver(String driver) throws IOException { if (driver != null) { try { Class.forName(driver); } catch (ClassNotFoundException e) { throw new IOException(driver + " cannot be loaded, skipping scan of schema.", e); } } ...
[ "private", "void", "loadDriver", "(", "String", "driver", ")", "throws", "IOException", "{", "if", "(", "driver", "!=", "null", ")", "{", "try", "{", "Class", ".", "forName", "(", "driver", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")",...
Load a class, e.g. the JDBC driver. @param driver The class name.
[ "Load", "a", "class", "e", ".", "g", ".", "the", "JDBC", "driver", "." ]
train
https://github.com/buschmais/jqa-rdbms-plugin/blob/96c3919907deee00175cf5ab005867d76e01ba62/src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/ConnectionPropertyFileScannerPlugin.java#L108-L116
OrienteerBAP/wicket-orientdb
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java
OSchemaHelper.oIndex
public OSchemaHelper oIndex(String name, INDEX_TYPE type) { """ Create {@link OIndex} if required on a current property @param name name of an index @param type type of an {@link OIndex} @return this helper """ checkOProperty(); return oIndex(name, type, lastProperty.getName()); }
java
public OSchemaHelper oIndex(String name, INDEX_TYPE type) { checkOProperty(); return oIndex(name, type, lastProperty.getName()); }
[ "public", "OSchemaHelper", "oIndex", "(", "String", "name", ",", "INDEX_TYPE", "type", ")", "{", "checkOProperty", "(", ")", ";", "return", "oIndex", "(", "name", ",", "type", ",", "lastProperty", ".", "getName", "(", ")", ")", ";", "}" ]
Create {@link OIndex} if required on a current property @param name name of an index @param type type of an {@link OIndex} @return this helper
[ "Create", "{" ]
train
https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java#L277-L281
groovy/groovy-core
src/main/org/codehaus/groovy/tools/FileSystemCompiler.java
FileSystemCompiler.commandLineCompile
public static void commandLineCompile(String[] args, boolean lookupUnnamedFiles) throws Exception { """ Same as main(args) except that exceptions are thrown out instead of causing the VM to exit and the lookup for .groovy files can be controlled """ Options options = createCompilationOptions(); ...
java
public static void commandLineCompile(String[] args, boolean lookupUnnamedFiles) throws Exception { Options options = createCompilationOptions(); CommandLineParser cliParser = new GroovyInternalPosixParser(); CommandLine cli; cli = cliParser.parse(options, args); if (cli.hasOp...
[ "public", "static", "void", "commandLineCompile", "(", "String", "[", "]", "args", ",", "boolean", "lookupUnnamedFiles", ")", "throws", "Exception", "{", "Options", "options", "=", "createCompilationOptions", "(", ")", ";", "CommandLineParser", "cliParser", "=", "...
Same as main(args) except that exceptions are thrown out instead of causing the VM to exit and the lookup for .groovy files can be controlled
[ "Same", "as", "main", "(", "args", ")", "except", "that", "exceptions", "are", "thrown", "out", "instead", "of", "causing", "the", "VM", "to", "exit", "and", "the", "lookup", "for", ".", "groovy", "files", "can", "be", "controlled" ]
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/tools/FileSystemCompiler.java#L116-L152
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.handleGetDateFormat
protected DateFormat handleGetDateFormat(String pattern, ULocale locale) { """ Creates a <code>DateFormat</code> appropriate to this calendar. This is a framework method for subclasses to override. This method is responsible for creating the calendar-specific DateFormat and DateFormatSymbols objects as needed....
java
protected DateFormat handleGetDateFormat(String pattern, ULocale locale) { return handleGetDateFormat(pattern, null, locale); }
[ "protected", "DateFormat", "handleGetDateFormat", "(", "String", "pattern", ",", "ULocale", "locale", ")", "{", "return", "handleGetDateFormat", "(", "pattern", ",", "null", ",", "locale", ")", ";", "}" ]
Creates a <code>DateFormat</code> appropriate to this calendar. This is a framework method for subclasses to override. This method is responsible for creating the calendar-specific DateFormat and DateFormatSymbols objects as needed. @param pattern the pattern, specific to the <code>DateFormat</code> subclass @param lo...
[ "Creates", "a", "<code", ">", "DateFormat<", "/", "code", ">", "appropriate", "to", "this", "calendar", ".", "This", "is", "a", "framework", "method", "for", "subclasses", "to", "override", ".", "This", "method", "is", "responsible", "for", "creating", "the"...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L3390-L3392
knowm/XChange
xchange-koinim/src/main/java/org/knowm/xchange/koinim/KoinimAdapters.java
KoinimAdapters.adaptTicker
public static Ticker adaptTicker(KoinimTicker koinimTicker, CurrencyPair currencyPair) { """ Adapts a KoinimTicker to a Ticker Object @param koinimTicker The exchange specific ticker @param currencyPair @return The ticker """ if (!currencyPair.equals(new CurrencyPair(BTC, TRY))) { throw new Not...
java
public static Ticker adaptTicker(KoinimTicker koinimTicker, CurrencyPair currencyPair) { if (!currencyPair.equals(new CurrencyPair(BTC, TRY))) { throw new NotAvailableFromExchangeException(); } if (koinimTicker != null) { return new Ticker.Builder() .currencyPair(new CurrencyPair(BTC...
[ "public", "static", "Ticker", "adaptTicker", "(", "KoinimTicker", "koinimTicker", ",", "CurrencyPair", "currencyPair", ")", "{", "if", "(", "!", "currencyPair", ".", "equals", "(", "new", "CurrencyPair", "(", "BTC", ",", "TRY", ")", ")", ")", "{", "throw", ...
Adapts a KoinimTicker to a Ticker Object @param koinimTicker The exchange specific ticker @param currencyPair @return The ticker
[ "Adapts", "a", "KoinimTicker", "to", "a", "Ticker", "Object" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-koinim/src/main/java/org/knowm/xchange/koinim/KoinimAdapters.java#L24-L43
lucee/Lucee
core/src/main/java/lucee/transformer/library/function/FunctionLibEntityResolver.java
FunctionLibEntityResolver.resolveEntity
@Override public InputSource resolveEntity(String publicId, String systemId) { """ Laedt die DTD vom lokalen System. @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) """ for (int i = 0; i < Constants.DTDS_FLD.length; i++) { if (publicId.equals(Constants.DTDS_FLD[i]...
java
@Override public InputSource resolveEntity(String publicId, String systemId) { for (int i = 0; i < Constants.DTDS_FLD.length; i++) { if (publicId.equals(Constants.DTDS_FLD[i])) { return new InputSource(getClass().getResourceAsStream(DTD_1_0)); } } return null; }
[ "@", "Override", "public", "InputSource", "resolveEntity", "(", "String", "publicId", ",", "String", "systemId", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "Constants", ".", "DTDS_FLD", ".", "length", ";", "i", "++", ")", "{", "if", "...
Laedt die DTD vom lokalen System. @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
[ "Laedt", "die", "DTD", "vom", "lokalen", "System", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibEntityResolver.java#L43-L51
javagl/ND
nd-distance/src/main/java/de/javagl/nd/distance/tuples/i/MathUtils.java
MathUtils.wrappedDistance
static int wrappedDistance(int i0, int i1, int size) { """ Computes the distance (absolute difference) between the given values when they are interpreted as points on a circle with the given size (that is, circumference). <br> <br> E.g. <br> <pre><code> wrappedDistance(0, 9, 10) = 1 wrappedDistance(0, 10, ...
java
static int wrappedDistance(int i0, int i1, int size) { int w0 = wrap(i0, size); int w1 = wrap(i1, size); int d = Math.abs(w1-w0); return Math.min(d, size-d); }
[ "static", "int", "wrappedDistance", "(", "int", "i0", ",", "int", "i1", ",", "int", "size", ")", "{", "int", "w0", "=", "wrap", "(", "i0", ",", "size", ")", ";", "int", "w1", "=", "wrap", "(", "i1", ",", "size", ")", ";", "int", "d", "=", "Ma...
Computes the distance (absolute difference) between the given values when they are interpreted as points on a circle with the given size (that is, circumference). <br> <br> E.g. <br> <pre><code> wrappedDistance(0, 9, 10) = 1 wrappedDistance(0, 10, 10) = 0 wrappedDistance(0, 11, 10) = 1 wrappedDistance(1, -4, 10) = 5 <...
[ "Computes", "the", "distance", "(", "absolute", "difference", ")", "between", "the", "given", "values", "when", "they", "are", "interpreted", "as", "points", "on", "a", "circle", "with", "the", "given", "size", "(", "that", "is", "circumference", ")", ".", ...
train
https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/i/MathUtils.java#L71-L77
sksamuel/scrimage
scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java
Gradient.setKnotPosition
public void setKnotPosition(int n, int x) { """ Set a knot position. @param n the knot index @param x the knot position @see #setKnotPosition """ xKnots[n] = ImageMath.clamp(x, 0, 255); sortKnots(); rebuildGradient(); }
java
public void setKnotPosition(int n, int x) { xKnots[n] = ImageMath.clamp(x, 0, 255); sortKnots(); rebuildGradient(); }
[ "public", "void", "setKnotPosition", "(", "int", "n", ",", "int", "x", ")", "{", "xKnots", "[", "n", "]", "=", "ImageMath", ".", "clamp", "(", "x", ",", "0", ",", "255", ")", ";", "sortKnots", "(", ")", ";", "rebuildGradient", "(", ")", ";", "}" ...
Set a knot position. @param n the knot index @param x the knot position @see #setKnotPosition
[ "Set", "a", "knot", "position", "." ]
train
https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java#L344-L348
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java
ExtensionFactory.getExtensionRepositoryDescriptor
public ExtensionRepositoryDescriptor getExtensionRepositoryDescriptor(String id, String type, URI uri) { """ Store and return a weak reference equals to the passed {@link ExtensionRepositoryDescriptor} elements. @param id the unique identifier @param type the repository type (maven, xwiki, etc.) @param uri th...
java
public ExtensionRepositoryDescriptor getExtensionRepositoryDescriptor(String id, String type, URI uri) { return getExtensionRepositoryDescriptor(new DefaultExtensionRepositoryDescriptor(id, type, uri)); }
[ "public", "ExtensionRepositoryDescriptor", "getExtensionRepositoryDescriptor", "(", "String", "id", ",", "String", "type", ",", "URI", "uri", ")", "{", "return", "getExtensionRepositoryDescriptor", "(", "new", "DefaultExtensionRepositoryDescriptor", "(", "id", ",", "type"...
Store and return a weak reference equals to the passed {@link ExtensionRepositoryDescriptor} elements. @param id the unique identifier @param type the repository type (maven, xwiki, etc.) @param uri the repository address @return unique instance of {@link ExtensionRepositoryDescriptor} equals to the passed one
[ "Store", "and", "return", "a", "weak", "reference", "equals", "to", "the", "passed", "{", "@link", "ExtensionRepositoryDescriptor", "}", "elements", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java#L134-L137
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CurrencyLocalizationUrl.java
CurrencyLocalizationUrl.updateCurrencyLocalizationUrl
public static MozuUrl updateCurrencyLocalizationUrl(String currencyCode, String responseFields) { """ Get Resource Url for UpdateCurrencyLocalization @param currencyCode The three character ISO currency code, such as USD for US Dollars. @param responseFields Filtering syntax appended to an API call to increase...
java
public static MozuUrl updateCurrencyLocalizationUrl(String currencyCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}?responseFields={responseFields}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("responseField...
[ "public", "static", "MozuUrl", "updateCurrencyLocalizationUrl", "(", "String", "currencyCode", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/catalog/admin/currency/{currencyCode}?responseFields={responseF...
Get Resource Url for UpdateCurrencyLocalization @param currencyCode The three character ISO currency code, such as USD for US Dollars. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve...
[ "Get", "Resource", "Url", "for", "UpdateCurrencyLocalization" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CurrencyLocalizationUrl.java#L114-L120
undertow-io/undertow
parser-generator/src/main/java/io/undertow/annotationprocessor/AbstractParserGenerator.java
AbstractParserGenerator.stateNotFound
private static void stateNotFound(final CodeAttribute c, final TableSwitchBuilder builder) { """ Throws an exception when an invalid state is hit in a tableswitch """ c.branchEnd(builder.getDefaultBranchEnd().get()); c.newInstruction(RuntimeException.class); c.dup(); c.ldc("Inva...
java
private static void stateNotFound(final CodeAttribute c, final TableSwitchBuilder builder) { c.branchEnd(builder.getDefaultBranchEnd().get()); c.newInstruction(RuntimeException.class); c.dup(); c.ldc("Invalid character"); c.invokespecial(RuntimeException.class.getName(), "<init>"...
[ "private", "static", "void", "stateNotFound", "(", "final", "CodeAttribute", "c", ",", "final", "TableSwitchBuilder", "builder", ")", "{", "c", ".", "branchEnd", "(", "builder", ".", "getDefaultBranchEnd", "(", ")", ".", "get", "(", ")", ")", ";", "c", "."...
Throws an exception when an invalid state is hit in a tableswitch
[ "Throws", "an", "exception", "when", "an", "invalid", "state", "is", "hit", "in", "a", "tableswitch" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/parser-generator/src/main/java/io/undertow/annotationprocessor/AbstractParserGenerator.java#L709-L716
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/Marshaller.java
Marshaller.applyAutoTimestamp
private void applyAutoTimestamp(PropertyMetadata propertyMetadata, long millis) { """ Applies the given time, <code>millis</code>, to the property represented by the given metadata. @param propertyMetadata the property metadata of the field @param millis the time in milliseconds """ Object timestamp ...
java
private void applyAutoTimestamp(PropertyMetadata propertyMetadata, long millis) { Object timestamp = null; Class<?> fieldType = propertyMetadata.getDeclaredType(); if (Date.class.equals(fieldType)) { timestamp = new Date(millis); } else if (Calendar.class.equals(fieldType)) { Calendar calend...
[ "private", "void", "applyAutoTimestamp", "(", "PropertyMetadata", "propertyMetadata", ",", "long", "millis", ")", "{", "Object", "timestamp", "=", "null", ";", "Class", "<", "?", ">", "fieldType", "=", "propertyMetadata", ".", "getDeclaredType", "(", ")", ";", ...
Applies the given time, <code>millis</code>, to the property represented by the given metadata. @param propertyMetadata the property metadata of the field @param millis the time in milliseconds
[ "Applies", "the", "given", "time", "<code", ">", "millis<", "/", "code", ">", "to", "the", "property", "represented", "by", "the", "given", "metadata", "." ]
train
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L605-L623
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/BaseMojo.java
BaseMojo.init
protected void init(String classifier, String moduleBase) throws MojoExecutionException { """ Subclasses must call this method early in their execute method. @param classifier The output jar classifier. @param moduleBase The base path for generated resources. @throws MojoExecutionException Unspecified excepti...
java
protected void init(String classifier, String moduleBase) throws MojoExecutionException { this.classifier = classifier; this.moduleBase = moduleBase; stagingDirectory = new File(buildDirectory, classifier + "-staging"); configTemplate = new ConfigTemplate(classifier + "-spring.xml"); ...
[ "protected", "void", "init", "(", "String", "classifier", ",", "String", "moduleBase", ")", "throws", "MojoExecutionException", "{", "this", ".", "classifier", "=", "classifier", ";", "this", ".", "moduleBase", "=", "moduleBase", ";", "stagingDirectory", "=", "n...
Subclasses must call this method early in their execute method. @param classifier The output jar classifier. @param moduleBase The base path for generated resources. @throws MojoExecutionException Unspecified exception.
[ "Subclasses", "must", "call", "this", "method", "early", "in", "their", "execute", "method", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/BaseMojo.java#L138-L145
operasoftware/operaprestodriver
src/com/opera/core/systems/runner/launcher/OperaLauncherProtocol.java
OperaLauncherProtocol.recv
private void recv(byte[] buffer, int length) throws IOException { """ Receive and block until *all* length bytes are placed in buffer. @param buffer Target buffer to fill @param length Desired length @throws IOException if socket read error or protocol parse error """ int bytes = 0; while (bytes ...
java
private void recv(byte[] buffer, int length) throws IOException { int bytes = 0; while (bytes < length) { int res = socket.getInputStream().read(buffer, bytes, length - bytes); if (res > 0) { bytes += res; } else { return; } } }
[ "private", "void", "recv", "(", "byte", "[", "]", "buffer", ",", "int", "length", ")", "throws", "IOException", "{", "int", "bytes", "=", "0", ";", "while", "(", "bytes", "<", "length", ")", "{", "int", "res", "=", "socket", ".", "getInputStream", "(...
Receive and block until *all* length bytes are placed in buffer. @param buffer Target buffer to fill @param length Desired length @throws IOException if socket read error or protocol parse error
[ "Receive", "and", "block", "until", "*", "all", "*", "length", "bytes", "are", "placed", "in", "buffer", "." ]
train
https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/runner/launcher/OperaLauncherProtocol.java#L177-L188
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
StreamExecutionEnvironment.socketTextStream
@Deprecated public DataStreamSource<String> socketTextStream(String hostname, int port, char delimiter, long maxRetry) { """ Creates a new data stream that contains the strings received infinitely from a socket. Received strings are decoded by the system's default character set. On the termination of the socket ...
java
@Deprecated public DataStreamSource<String> socketTextStream(String hostname, int port, char delimiter, long maxRetry) { return socketTextStream(hostname, port, String.valueOf(delimiter), maxRetry); }
[ "@", "Deprecated", "public", "DataStreamSource", "<", "String", ">", "socketTextStream", "(", "String", "hostname", ",", "int", "port", ",", "char", "delimiter", ",", "long", "maxRetry", ")", "{", "return", "socketTextStream", "(", "hostname", ",", "port", ","...
Creates a new data stream that contains the strings received infinitely from a socket. Received strings are decoded by the system's default character set. On the termination of the socket server connection retries can be initiated. <p>Let us note that the socket itself does not report on abort and as a consequence ret...
[ "Creates", "a", "new", "data", "stream", "that", "contains", "the", "strings", "received", "infinitely", "from", "a", "socket", ".", "Received", "strings", "are", "decoded", "by", "the", "system", "s", "default", "character", "set", ".", "On", "the", "termin...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1187-L1190
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/InfinispanJBossASClient.java
InfinispanJBossASClient.createNewCacheContainerRequest
public ModelNode createNewCacheContainerRequest(String name, String defaultCacheName) { """ Returns a ModelNode that can be used to create a cache container configuration for subsequent cache configuration. Callers are free to tweak the request that is returned, if they so choose, before asking the client to exe...
java
public ModelNode createNewCacheContainerRequest(String name, String defaultCacheName) { String dmrTemplate = "" // + "{" // + "\"default-cache-name\" => \"%s\" ," // + "\"jndi-name\" => \"%s\" " // + "}"; String jndiName = "java:jboss/infi...
[ "public", "ModelNode", "createNewCacheContainerRequest", "(", "String", "name", ",", "String", "defaultCacheName", ")", "{", "String", "dmrTemplate", "=", "\"\"", "//", "+", "\"{\"", "//", "+", "\"\\\"default-cache-name\\\" => \\\"%s\\\" ,\"", "//", "+", "\"\\\"jndi-nam...
Returns a ModelNode that can be used to create a cache container configuration for subsequent cache configuration. Callers are free to tweak the request that is returned, if they so choose, before asking the client to execute the request. <p> The JNDI name will be java:jboss/infinispan/&lt;cacheContainerName&gt; </p> ...
[ "Returns", "a", "ModelNode", "that", "can", "be", "used", "to", "create", "a", "cache", "container", "configuration", "for", "subsequent", "cache", "configuration", ".", "Callers", "are", "free", "to", "tweak", "the", "request", "that", "is", "returned", "if",...
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/InfinispanJBossASClient.java#L83-L99
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlLinkedList.java
HsqlLinkedList.set
public Object set(int index, Object element) { """ Replaces the current element at <code>index/code> with <code>element</code>. @return The current element at <code>index</code>. """ Node setMe = getInternal(index); Object oldData = setMe.data; setMe.data = element; ret...
java
public Object set(int index, Object element) { Node setMe = getInternal(index); Object oldData = setMe.data; setMe.data = element; return oldData; }
[ "public", "Object", "set", "(", "int", "index", ",", "Object", "element", ")", "{", "Node", "setMe", "=", "getInternal", "(", "index", ")", ";", "Object", "oldData", "=", "setMe", ".", "data", ";", "setMe", ".", "data", "=", "element", ";", "return", ...
Replaces the current element at <code>index/code> with <code>element</code>. @return The current element at <code>index</code>.
[ "Replaces", "the", "current", "element", "at", "<code", ">", "index", "/", "code", ">", "with", "<code", ">", "element<", "/", "code", ">", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/HsqlLinkedList.java#L199-L207
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java
MsgPackOutput.writeExtensionString
void writeExtensionString(int extensionType, String str) throws IOException { """ Writes an extension string using EXT_8. @param extensionType the type @param str the string to write as the data @throws IOException if an error occurs """ byte[] bytes = str.getBytes(UTF_8); if (bytes.leng...
java
void writeExtensionString(int extensionType, String str) throws IOException { byte[] bytes = str.getBytes(UTF_8); if (bytes.length > 256) { throw new IllegalArgumentException("String too long"); } output.write(EXT_8); output.write(bytes.length); output.write(e...
[ "void", "writeExtensionString", "(", "int", "extensionType", ",", "String", "str", ")", "throws", "IOException", "{", "byte", "[", "]", "bytes", "=", "str", ".", "getBytes", "(", "UTF_8", ")", ";", "if", "(", "bytes", ".", "length", ">", "256", ")", "{...
Writes an extension string using EXT_8. @param extensionType the type @param str the string to write as the data @throws IOException if an error occurs
[ "Writes", "an", "extension", "string", "using", "EXT_8", "." ]
train
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L292-L301
lightblueseas/email-tails
src/main/java/de/alpharogroup/email/utils/EmailExtensions.java
EmailExtensions.newAddress
public static Address newAddress(final String address, String personal, final String charset) throws AddressException, UnsupportedEncodingException { """ Creates an Address from the given the address and personal name. @param address The address in RFC822 format. @param personal The personal name. @param ...
java
public static Address newAddress(final String address, String personal, final String charset) throws AddressException, UnsupportedEncodingException { if (personal.isNullOrEmpty()) { personal = address; } final InternetAddress internetAdress = new InternetAddress(address); if (charset.isNullOrEmpty()) ...
[ "public", "static", "Address", "newAddress", "(", "final", "String", "address", ",", "String", "personal", ",", "final", "String", "charset", ")", "throws", "AddressException", ",", "UnsupportedEncodingException", "{", "if", "(", "personal", ".", "isNullOrEmpty", ...
Creates an Address from the given the address and personal name. @param address The address in RFC822 format. @param personal The personal name. @param charset MIME charset to be used to encode the name as per RFC 2047. @return The created InternetAddress-object from the given address and personal name. @throws Addr...
[ "Creates", "an", "Address", "from", "the", "given", "the", "address", "and", "personal", "name", "." ]
train
https://github.com/lightblueseas/email-tails/blob/7be6fee3548e61e697cc8e64e90603cb1f505be2/src/main/java/de/alpharogroup/email/utils/EmailExtensions.java#L219-L236
mongodb/stitch-android-sdk
core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/ChangeEvents.java
ChangeEvents.changeEventForLocalInsert
static ChangeEvent<BsonDocument> changeEventForLocalInsert( final MongoNamespace namespace, final BsonDocument document, final boolean writePending ) { """ Generates a change event for a local insert of the given document in the given namespace. @param namespace the namespace where the docum...
java
static ChangeEvent<BsonDocument> changeEventForLocalInsert( final MongoNamespace namespace, final BsonDocument document, final boolean writePending ) { final BsonValue docId = BsonUtils.getDocumentId(document); return new ChangeEvent<>( new BsonDocument(), OperationType.INSER...
[ "static", "ChangeEvent", "<", "BsonDocument", ">", "changeEventForLocalInsert", "(", "final", "MongoNamespace", "namespace", ",", "final", "BsonDocument", "document", ",", "final", "boolean", "writePending", ")", "{", "final", "BsonValue", "docId", "=", "BsonUtils", ...
Generates a change event for a local insert of the given document in the given namespace. @param namespace the namespace where the document was inserted. @param document the document that was inserted. @return a change event for a local insert of the given document in the given namespace.
[ "Generates", "a", "change", "event", "for", "a", "local", "insert", "of", "the", "given", "document", "in", "the", "given", "namespace", "." ]
train
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/ChangeEvents.java#L40-L54
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/jaxp/XPathFactoryImpl.java
XPathFactoryImpl.setFeature
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { """ <p>Set a feature for this <code>XPathFactory</code> and <code>XPath</code>s created by this factory.</p> <p> Feature names are fully qualified {@link java.net.URI}s. Implementations may define their own featu...
java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, ...
[ "public", "void", "setFeature", "(", "String", "name", ",", "boolean", "value", ")", "throws", "XPathFactoryConfigurationException", "{", "// feature name cannot be null", "if", "(", "name", "==", "null", ")", "{", "String", "fmsg", "=", "XSLMessages", ".", "creat...
<p>Set a feature for this <code>XPathFactory</code> and <code>XPath</code>s created by this factory.</p> <p> Feature names are fully qualified {@link java.net.URI}s. Implementations may define their own features. An {@link XPathFactoryConfigurationException} is thrown if this <code>XPathFactory</code> or the <code>XPa...
[ "<p", ">", "Set", "a", "feature", "for", "this", "<code", ">", "XPathFactory<", "/", "code", ">", "and", "<code", ">", "XPath<", "/", "code", ">", "s", "created", "by", "this", "factory", ".", "<", "/", "p", ">" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/jaxp/XPathFactoryImpl.java#L136-L161
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CachedSessionProperties.java
CachedSessionProperties.areTheyTheSame
private boolean areTheyTheSame(Object obj1, Object obj2) { """ Method which compares 2 objects and determines if they are the same. Objects are the same if they are both null, or if they have equal values. <p> Note this method should only be used for comparing String objects, Reliability objects and SIDestina...
java
private boolean areTheyTheSame(Object obj1, Object obj2) { // If they are both null, then they are equal if (obj1 == null && obj2 == null) return true; // If only one is null then they are not equal if (obj1 == null || obj2 == null) return false; // At th...
[ "private", "boolean", "areTheyTheSame", "(", "Object", "obj1", ",", "Object", "obj2", ")", "{", "// If they are both null, then they are equal", "if", "(", "obj1", "==", "null", "&&", "obj2", "==", "null", ")", "return", "true", ";", "// If only one is null then the...
Method which compares 2 objects and determines if they are the same. Objects are the same if they are both null, or if they have equal values. <p> Note this method should only be used for comparing String objects, Reliability objects and SIDestinationAddress objects (and shouldn't be used for comparing a String to a Re...
[ "Method", "which", "compares", "2", "objects", "and", "determines", "if", "they", "are", "the", "same", ".", "Objects", "are", "the", "same", "if", "they", "are", "both", "null", "or", "if", "they", "have", "equal", "values", ".", "<p", ">", "Note", "t...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CachedSessionProperties.java#L107-L136
Azure/azure-sdk-for-java
hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java
ExtensionsInner.enableMonitoring
public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { """ Enables the Operations Management Suite (OMS) on the HDInsight cluster. @param resourceGroupName The name of the resource group. @param clusterName The name of the cluster. @param parameters T...
java
public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); }
[ "public", "void", "enableMonitoring", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "ClusterMonitoringRequest", "parameters", ")", "{", "enableMonitoringWithServiceResponseAsync", "(", "resourceGroupName", ",", "clusterName", ",", "parameters", ")",...
Enables the Operations Management Suite (OMS) on the HDInsight cluster. @param resourceGroupName The name of the resource group. @param clusterName The name of the cluster. @param parameters The Operations Management Suite (OMS) workspace parameters. @throws IllegalArgumentException thrown if parameters fail the valid...
[ "Enables", "the", "Operations", "Management", "Suite", "(", "OMS", ")", "on", "the", "HDInsight", "cluster", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java#L111-L113
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java
CommercePriceListPersistenceImpl.findAll
@Override public List<CommercePriceList> findAll(int start, int end) { """ Returns a range of all the commerce price lists. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result ...
java
@Override public List<CommercePriceList> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommercePriceList", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce price lists. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "price", "lists", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java#L5958-L5961
jbundle/jbundle
base/db/xml/src/main/java/org/jbundle/base/db/xml/XDatabase.java
XDatabase.makeNewPTable
public PTable makeNewPTable(FieldList record, Object key) { """ Create a raw data table for this table. @param table The table to create a raw data table for. @param key The lookup key that will be passed (on initialization) to the new raw data table. @return The new raw data table. """ XTable xTabl...
java
public PTable makeNewPTable(FieldList record, Object key) { XTable xTable = new XTable(this, record, key); // New empty table return xTable; }
[ "public", "PTable", "makeNewPTable", "(", "FieldList", "record", ",", "Object", "key", ")", "{", "XTable", "xTable", "=", "new", "XTable", "(", "this", ",", "record", ",", "key", ")", ";", "// New empty table", "return", "xTable", ";", "}" ]
Create a raw data table for this table. @param table The table to create a raw data table for. @param key The lookup key that will be passed (on initialization) to the new raw data table. @return The new raw data table.
[ "Create", "a", "raw", "data", "table", "for", "this", "table", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/xml/src/main/java/org/jbundle/base/db/xml/XDatabase.java#L56-L60
Azure/azure-sdk-for-java
compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetExtensionsInner.java
VirtualMachineScaleSetExtensionsInner.listAsync
public Observable<Page<VirtualMachineScaleSetExtensionInner>> listAsync(final String resourceGroupName, final String vmScaleSetName) { """ Gets a list of all extensions in a VM scale set. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set containing the ...
java
public Observable<Page<VirtualMachineScaleSetExtensionInner>> listAsync(final String resourceGroupName, final String vmScaleSetName) { return listWithServiceResponseAsync(resourceGroupName, vmScaleSetName) .map(new Func1<ServiceResponse<Page<VirtualMachineScaleSetExtensionInner>>, Page<VirtualMachin...
[ "public", "Observable", "<", "Page", "<", "VirtualMachineScaleSetExtensionInner", ">", ">", "listAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "vmScaleSetName", ")", "{", "return", "listWithServiceResponseAsync", "(", "resourceGroupName", ...
Gets a list of all extensions in a VM scale set. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set containing the extension. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;VirtualMachineScale...
[ "Gets", "a", "list", "of", "all", "extensions", "in", "a", "VM", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetExtensionsInner.java#L684-L692
weld/core
impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
BeanDeployer.addClass
public BeanDeployer addClass(String className, AnnotatedTypeLoader loader) { """ Loads a given class, creates a {@link SlimAnnotatedTypeContext} for it and stores it in {@link BeanDeployerEnvironment}. """ addIfNotNull(loader.loadAnnotatedType(className, getManager().getId())); return this; ...
java
public BeanDeployer addClass(String className, AnnotatedTypeLoader loader) { addIfNotNull(loader.loadAnnotatedType(className, getManager().getId())); return this; }
[ "public", "BeanDeployer", "addClass", "(", "String", "className", ",", "AnnotatedTypeLoader", "loader", ")", "{", "addIfNotNull", "(", "loader", ".", "loadAnnotatedType", "(", "className", ",", "getManager", "(", ")", ".", "getId", "(", ")", ")", ")", ";", "...
Loads a given class, creates a {@link SlimAnnotatedTypeContext} for it and stores it in {@link BeanDeployerEnvironment}.
[ "Loads", "a", "given", "class", "creates", "a", "{" ]
train
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java#L86-L89
google/error-prone
check_api/src/main/java/com/google/errorprone/util/FindIdentifiers.java
FindIdentifiers.findIdent
public static Symbol findIdent(String name, VisitorState state) { """ Finds a variable declaration with the given name that is in scope at the current location. """ return findIdent(name, state, KindSelector.VAR); }
java
public static Symbol findIdent(String name, VisitorState state) { return findIdent(name, state, KindSelector.VAR); }
[ "public", "static", "Symbol", "findIdent", "(", "String", "name", ",", "VisitorState", "state", ")", "{", "return", "findIdent", "(", "name", ",", "state", ",", "KindSelector", ".", "VAR", ")", ";", "}" ]
Finds a variable declaration with the given name that is in scope at the current location.
[ "Finds", "a", "variable", "declaration", "with", "the", "given", "name", "that", "is", "in", "scope", "at", "the", "current", "location", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/FindIdentifiers.java#L80-L82
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java
StructuredQueryBuilder.containerConstraint
public StructuredQueryDefinition containerConstraint(String constraintName, StructuredQueryDefinition query) { """ Matches a query within the substructure of the container specified by the constraint. @param constraintName the constraint definition @param query the query definition @return the Structu...
java
public StructuredQueryDefinition containerConstraint(String constraintName, StructuredQueryDefinition query) { checkQuery(query); return new ContainerConstraintQuery(constraintName, query); }
[ "public", "StructuredQueryDefinition", "containerConstraint", "(", "String", "constraintName", ",", "StructuredQueryDefinition", "query", ")", "{", "checkQuery", "(", "query", ")", ";", "return", "new", "ContainerConstraintQuery", "(", "constraintName", ",", "query", ")...
Matches a query within the substructure of the container specified by the constraint. @param constraintName the constraint definition @param query the query definition @return the StructuredQueryDefinition for the element constraint query
[ "Matches", "a", "query", "within", "the", "substructure", "of", "the", "container", "specified", "by", "the", "constraint", "." ]
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L997-L1000
alkacon/opencms-core
src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java
CmsMessageBundleEditorOptions.initLowerLeftComponent
private void initLowerLeftComponent() { """ Initializes the lower left component {@link #m_lowerLeftComponent} with the correctly placed "Add key"-label. """ HorizontalLayout placeHolderLowerLeft = new HorizontalLayout(); placeHolderLowerLeft.setWidth("100%"); Label newKeyLabel = new L...
java
private void initLowerLeftComponent() { HorizontalLayout placeHolderLowerLeft = new HorizontalLayout(); placeHolderLowerLeft.setWidth("100%"); Label newKeyLabel = new Label(m_messages.key(Messages.GUI_CAPTION_ADD_KEY_0)); newKeyLabel.setWidthUndefined(); HorizontalLayout lowerLe...
[ "private", "void", "initLowerLeftComponent", "(", ")", "{", "HorizontalLayout", "placeHolderLowerLeft", "=", "new", "HorizontalLayout", "(", ")", ";", "placeHolderLowerLeft", ".", "setWidth", "(", "\"100%\"", ")", ";", "Label", "newKeyLabel", "=", "new", "Label", ...
Initializes the lower left component {@link #m_lowerLeftComponent} with the correctly placed "Add key"-label.
[ "Initializes", "the", "lower", "left", "component", "{" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java#L395-L406
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
DocTreeScanner.visitSince
@Override public R visitSince(SinceTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ return scan(node.getBody(), p); }
java
@Override public R visitSince(SinceTree node, P p) { return scan(node.getBody(), p); }
[ "@", "Override", "public", "R", "visitSince", "(", "SinceTree", "node", ",", "P", "p", ")", "{", "return", "scan", "(", "node", ".", "getBody", "(", ")", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L423-L426
BioPAX/Paxtools
paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java
QueryExecuter.runCommonStreamWithPOIMultiSet
public static Set<BioPAXElement> runCommonStreamWithPOIMultiSet( Set<Set<BioPAXElement>> sourceSets, Model model, Direction direction, int limit, Filter... filters) { """ First finds the common stream, then completes it with the paths between seed and common stream. @param sourceSets Seed to the query ...
java
public static Set<BioPAXElement> runCommonStreamWithPOIMultiSet( Set<Set<BioPAXElement>> sourceSets, Model model, Direction direction, int limit, Filter... filters) { Graph graph; if (model.getLevel() == BioPAXLevel.L3) { graph = new GraphL3(model, filters); } else return Collections.emptySet()...
[ "public", "static", "Set", "<", "BioPAXElement", ">", "runCommonStreamWithPOIMultiSet", "(", "Set", "<", "Set", "<", "BioPAXElement", ">", ">", "sourceSets", ",", "Model", "model", ",", "Direction", "direction", ",", "int", "limit", ",", "Filter", "...", "filt...
First finds the common stream, then completes it with the paths between seed and common stream. @param sourceSets Seed to the query @param model BioPAX model @param direction UPSTREAM or DOWNSTREAM @param limit Length limit for the search @param filters for filtering graph elements @return BioPAX elements in the result
[ "First", "finds", "the", "common", "stream", "then", "completes", "it", "with", "the", "paths", "between", "seed", "and", "common", "stream", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L363-L383
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java
JsMessageFactoryImpl.createInboundJsMessage
public JsMessage createInboundJsMessage(byte rawMessage[], int offset, int length) throws MessageDecodeFailedException { """ Create a JsMessage to represent an inbound message. (To be called by the Communications component.) @param rawMessage The inbound byte array con...
java
public JsMessage createInboundJsMessage(byte rawMessage[], int offset, int length) throws MessageDecodeFailedException { return createInboundJsMessage(rawMessage, offset, length, null); }
[ "public", "JsMessage", "createInboundJsMessage", "(", "byte", "rawMessage", "[", "]", ",", "int", "offset", ",", "int", "length", ")", "throws", "MessageDecodeFailedException", "{", "return", "createInboundJsMessage", "(", "rawMessage", ",", "offset", ",", "length",...
Create a JsMessage to represent an inbound message. (To be called by the Communications component.) @param rawMessage The inbound byte array containging a complete message @param offset The offset in the byte array at which the message begins @param length The length of the message within the byte array @r...
[ "Create", "a", "JsMessage", "to", "represent", "an", "inbound", "message", ".", "(", "To", "be", "called", "by", "the", "Communications", "component", ".", ")" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java#L78-L81
librato/librato-java
src/main/java/com/librato/metrics/client/Authorization.java
Authorization.buildAuthHeader
public static String buildAuthHeader(String username, String token) { """ Builds a new HTTP Authorization header for Librato API requests @param username the Librato username @param token the Librato token @return the Authorization header value """ if (username == null || "".equals(username)) {...
java
public static String buildAuthHeader(String username, String token) { if (username == null || "".equals(username)) { throw new IllegalArgumentException("Username must be specified"); } if (token == null || "".equals(token)) { throw new IllegalArgumentException("Token must...
[ "public", "static", "String", "buildAuthHeader", "(", "String", "username", ",", "String", "token", ")", "{", "if", "(", "username", "==", "null", "||", "\"\"", ".", "equals", "(", "username", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ...
Builds a new HTTP Authorization header for Librato API requests @param username the Librato username @param token the Librato token @return the Authorization header value
[ "Builds", "a", "new", "HTTP", "Authorization", "header", "for", "Librato", "API", "requests" ]
train
https://github.com/librato/librato-java/blob/bff7e776d4af5e978181db47f65e171ab67c1c77/src/main/java/com/librato/metrics/client/Authorization.java#L18-L26
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.rfcDateTime
@SuppressWarnings("unused") public static String rfcDateTime(final Date val, final TimeZone tz) { """ Turn Date into "yyyy-MM-ddTHH:mm:ss" for a given timezone @param val date @param tz TimeZone @return String "yyyy-MM-ddTHH:mm:ss" """ synchronized (rfcDateTimeTZFormat) { rfcDateTimeTZFormat.s...
java
@SuppressWarnings("unused") public static String rfcDateTime(final Date val, final TimeZone tz) { synchronized (rfcDateTimeTZFormat) { rfcDateTimeTZFormat.setTimeZone(tz); return rfcDateTimeTZFormat.format(val); } }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "static", "String", "rfcDateTime", "(", "final", "Date", "val", ",", "final", "TimeZone", "tz", ")", "{", "synchronized", "(", "rfcDateTimeTZFormat", ")", "{", "rfcDateTimeTZFormat", ".", "setTimeZone", ...
Turn Date into "yyyy-MM-ddTHH:mm:ss" for a given timezone @param val date @param tz TimeZone @return String "yyyy-MM-ddTHH:mm:ss"
[ "Turn", "Date", "into", "yyyy", "-", "MM", "-", "ddTHH", ":", "mm", ":", "ss", "for", "a", "given", "timezone" ]
train
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L225-L231
googleapis/google-cloud-java
google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java
FirestoreAdminClient.createIndex
public final Operation createIndex(ParentName parent, Index index) { """ Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.f...
java
public final Operation createIndex(ParentName parent, Index index) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setIndex(index) .build(); return createIndex(request); }
[ "public", "final", "Operation", "createIndex", "(", "ParentName", "parent", ",", "Index", "index", ")", "{", "CreateIndexRequest", "request", "=", "CreateIndexRequest", ".", "newBuilder", "(", ")", ".", "setParent", "(", "parent", "==", "null", "?", "null", ":...
Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. <p>Sample code: <pre><code> try (Fir...
[ "Creates", "a", "composite", "index", ".", "This", "returns", "a", "[", "google", ".", "longrunning", ".", "Operation", "]", "[", "google", ".", "longrunning", ".", "Operation", "]", "which", "may", "be", "used", "to", "track", "the", "status", "of", "th...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java#L199-L207
alkacon/opencms-core
src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java
CmsDefaultLinkSubstitutionHandler.getTargetSiteRoot
private String getTargetSiteRoot(CmsObject cms, String path, String basePath) { """ Returns the target site for the given path.<p> @param cms the cms context @param path the path @param basePath the base path @return the target site """ if (OpenCms.getSiteManager().startsWithShared(path) || pa...
java
private String getTargetSiteRoot(CmsObject cms, String path, String basePath) { if (OpenCms.getSiteManager().startsWithShared(path) || path.startsWith(CmsWorkplace.VFS_PATH_SYSTEM)) { return null; } String targetSiteRoot = OpenCms.getSiteManager().getSiteRoot(path); if ((tar...
[ "private", "String", "getTargetSiteRoot", "(", "CmsObject", "cms", ",", "String", "path", ",", "String", "basePath", ")", "{", "if", "(", "OpenCms", ".", "getSiteManager", "(", ")", ".", "startsWithShared", "(", "path", ")", "||", "path", ".", "startsWith", ...
Returns the target site for the given path.<p> @param cms the cms context @param path the path @param basePath the base path @return the target site
[ "Returns", "the", "target", "site", "for", "the", "given", "path", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsDefaultLinkSubstitutionHandler.java#L790-L803
kejunxia/AndroidMvc
library/poke/src/main/java/com/shipdream/lib/poke/util/ReflectUtils.java
ReflectUtils.getFieldValue
public static Object getFieldValue(Object obj, Field field) { """ Gets value of the field of the given object. @param obj The object @param field The field """ Object value = null; boolean accessible = field.isAccessible(); //hack accessibility if (!accessible) { f...
java
public static Object getFieldValue(Object obj, Field field) { Object value = null; boolean accessible = field.isAccessible(); //hack accessibility if (!accessible) { field.setAccessible(true); } try { value = field.get(obj); } catch (Illega...
[ "public", "static", "Object", "getFieldValue", "(", "Object", "obj", ",", "Field", "field", ")", "{", "Object", "value", "=", "null", ";", "boolean", "accessible", "=", "field", ".", "isAccessible", "(", ")", ";", "//hack accessibility", "if", "(", "!", "a...
Gets value of the field of the given object. @param obj The object @param field The field
[ "Gets", "value", "of", "the", "field", "of", "the", "given", "object", "." ]
train
https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/util/ReflectUtils.java#L112-L128
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java
ColumnNameHelper.maxComponents
public static List<ByteBuffer> maxComponents(List<ByteBuffer> maxSeen, Composite candidate, CellNameType comparator) { """ finds the max cell name component(s) Note that this method *can modify maxSeen*. @param maxSeen the max columns seen so far @param candidate the candidate column(s) @param comparator t...
java
public static List<ByteBuffer> maxComponents(List<ByteBuffer> maxSeen, Composite candidate, CellNameType comparator) { // For a cell name, no reason to look more than the clustering prefix // (and comparing the collection element would actually crash) int size = Math.min(candidate.size(), co...
[ "public", "static", "List", "<", "ByteBuffer", ">", "maxComponents", "(", "List", "<", "ByteBuffer", ">", "maxSeen", ",", "Composite", "candidate", ",", "CellNameType", "comparator", ")", "{", "// For a cell name, no reason to look more than the clustering prefix", "// (a...
finds the max cell name component(s) Note that this method *can modify maxSeen*. @param maxSeen the max columns seen so far @param candidate the candidate column(s) @param comparator the comparator to use @return a list with the max column(s)
[ "finds", "the", "max", "cell", "name", "component", "(", "s", ")" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java#L63-L79
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java
TargetInstanceClient.insertTargetInstance
@BetaApi public final Operation insertTargetInstance(String zone, TargetInstance targetInstanceResource) { """ Creates a TargetInstance resource in the specified project and zone using the data included in the request. <p>Sample code: <pre><code> try (TargetInstanceClient targetInstanceClient = TargetIns...
java
@BetaApi public final Operation insertTargetInstance(String zone, TargetInstance targetInstanceResource) { InsertTargetInstanceHttpRequest request = InsertTargetInstanceHttpRequest.newBuilder() .setZone(zone) .setTargetInstanceResource(targetInstanceResource) .build();...
[ "@", "BetaApi", "public", "final", "Operation", "insertTargetInstance", "(", "String", "zone", ",", "TargetInstance", "targetInstanceResource", ")", "{", "InsertTargetInstanceHttpRequest", "request", "=", "InsertTargetInstanceHttpRequest", ".", "newBuilder", "(", ")", "."...
Creates a TargetInstance resource in the specified project and zone using the data included in the request. <p>Sample code: <pre><code> try (TargetInstanceClient targetInstanceClient = TargetInstanceClient.create()) { ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]"); TargetInstance targetInstanceResou...
[ "Creates", "a", "TargetInstance", "resource", "in", "the", "specified", "project", "and", "zone", "using", "the", "data", "included", "in", "the", "request", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetInstanceClient.java#L551-L560
alkacon/opencms-core
src/org/opencms/main/CmsSessionManager.java
CmsSessionManager.killSession
public void killSession(CmsObject cms, CmsUser user) throws CmsException { """ Kills all sessions for the given user.<p> @param cms the current CMS context @param user the user for whom the sessions should be killed @throws CmsException if something goes wrong """ OpenCms.getRoleManager().check...
java
public void killSession(CmsObject cms, CmsUser user) throws CmsException { OpenCms.getRoleManager().checkRole(cms, CmsRole.ACCOUNT_MANAGER); List<CmsSessionInfo> infos = getSessionInfos(user.getId()); for (CmsSessionInfo info : infos) { m_sessionStorageProvider.remove(info.getSessio...
[ "public", "void", "killSession", "(", "CmsObject", "cms", ",", "CmsUser", "user", ")", "throws", "CmsException", "{", "OpenCms", ".", "getRoleManager", "(", ")", ".", "checkRole", "(", "cms", ",", "CmsRole", ".", "ACCOUNT_MANAGER", ")", ";", "List", "<", "...
Kills all sessions for the given user.<p> @param cms the current CMS context @param user the user for whom the sessions should be killed @throws CmsException if something goes wrong
[ "Kills", "all", "sessions", "for", "the", "given", "user", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSessionManager.java#L305-L312
sdaschner/jaxrs-analyzer
src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/ProjectAnalyzer.java
ProjectAnalyzer.addDirectoryClasses
private void addDirectoryClasses(final Path location, final Path subPath) { """ Adds all classes in the given directory location to the set of known classes. @param location The location of the current directory @param subPath The sub-path which is relevant for the package names or {@code null} if currently i...
java
private void addDirectoryClasses(final Path location, final Path subPath) { for (final File file : location.toFile().listFiles()) { if (file.isDirectory()) addDirectoryClasses(location.resolve(file.getName()), subPath.resolve(file.getName())); else if (file.isFile() && fi...
[ "private", "void", "addDirectoryClasses", "(", "final", "Path", "location", ",", "final", "Path", "subPath", ")", "{", "for", "(", "final", "File", "file", ":", "location", ".", "toFile", "(", ")", ".", "listFiles", "(", ")", ")", "{", "if", "(", "file...
Adds all classes in the given directory location to the set of known classes. @param location The location of the current directory @param subPath The sub-path which is relevant for the package names or {@code null} if currently in the root directory
[ "Adds", "all", "classes", "in", "the", "given", "directory", "location", "to", "the", "set", "of", "known", "classes", "." ]
train
https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/ProjectAnalyzer.java#L189-L198
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/events/Event.java
Event.addAttribute
public Event addAttribute(String key, Object value) { """ Add an attribute to the event @param key key of attribute @param String value of attribute @return this object, to allow event attribute chains """ eventAttributes.put(key, (value == null ? "null" : value)); return this; }
java
public Event addAttribute(String key, Object value) { eventAttributes.put(key, (value == null ? "null" : value)); return this; }
[ "public", "Event", "addAttribute", "(", "String", "key", ",", "Object", "value", ")", "{", "eventAttributes", ".", "put", "(", "key", ",", "(", "value", "==", "null", "?", "\"null\"", ":", "value", ")", ")", ";", "return", "this", ";", "}" ]
Add an attribute to the event @param key key of attribute @param String value of attribute @return this object, to allow event attribute chains
[ "Add", "an", "attribute", "to", "the", "event" ]
train
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/events/Event.java#L111-L114
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java
ComputeNodeOperations.addComputeNodeUser
public void addComputeNodeUser(String poolId, String nodeId, ComputeNodeUser user) throws BatchErrorException, IOException { """ Adds a user account to the specified compute node. @param poolId The ID of the pool that contains the compute node. @param nodeId The ID of the compute node where the user account wi...
java
public void addComputeNodeUser(String poolId, String nodeId, ComputeNodeUser user) throws BatchErrorException, IOException { addComputeNodeUser(poolId, nodeId, user, null); }
[ "public", "void", "addComputeNodeUser", "(", "String", "poolId", ",", "String", "nodeId", ",", "ComputeNodeUser", "user", ")", "throws", "BatchErrorException", ",", "IOException", "{", "addComputeNodeUser", "(", "poolId", ",", "nodeId", ",", "user", ",", "null", ...
Adds a user account to the specified compute node. @param poolId The ID of the pool that contains the compute node. @param nodeId The ID of the compute node where the user account will be created. @param user The user account to be created. @throws BatchErrorException Exception thrown when an error response is receive...
[ "Adds", "a", "user", "account", "to", "the", "specified", "compute", "node", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L82-L84
OpenLiberty/open-liberty
dev/com.ibm.ws.javaee.ddmetadata/src/com/ibm/ws/javaee/ddmetadata/generator/ModelInterfaceImplClassGenerator.java
ModelInterfaceImplClassGenerator.writeHandleXMINillableAttribute
private void writeHandleXMINillableAttribute(PrintWriter out, String indent, ModelAttribute attribute, String object) { """ Handle a nillable XMI attribute as an element with an xsi:nil="true". """ ModelMethod method = attribute.method; String fieldName = method.field.name; String typeN...
java
private void writeHandleXMINillableAttribute(PrintWriter out, String indent, ModelAttribute attribute, String object) { ModelMethod method = attribute.method; String fieldName = method.field.name; String typeName = method.getType().getJavaImplTypeName(); out.append(indent).append(" ...
[ "private", "void", "writeHandleXMINillableAttribute", "(", "PrintWriter", "out", ",", "String", "indent", ",", "ModelAttribute", "attribute", ",", "String", "object", ")", "{", "ModelMethod", "method", "=", "attribute", ".", "method", ";", "String", "fieldName", "...
Handle a nillable XMI attribute as an element with an xsi:nil="true".
[ "Handle", "a", "nillable", "XMI", "attribute", "as", "an", "element", "with", "an", "xsi", ":", "nil", "=", "true", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.javaee.ddmetadata/src/com/ibm/ws/javaee/ddmetadata/generator/ModelInterfaceImplClassGenerator.java#L736-L746
jamesagnew/hapi-fhir
hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/BaseResourceMessage.java
BaseResourceMessage.setAttribute
public void setAttribute(String theKey, String theValue) { """ Sets an attribute stored in this message. <p> Attributes are just a spot for user data of any kind to be added to the message for passing along the subscription processing pipeline (typically by interceptors). Values will be carried from the beginn...
java
public void setAttribute(String theKey, String theValue) { Validate.notBlank(theKey); Validate.notNull(theValue); if (myAttributes == null) { myAttributes = new HashMap<>(); } myAttributes.put(theKey, theValue); }
[ "public", "void", "setAttribute", "(", "String", "theKey", ",", "String", "theValue", ")", "{", "Validate", ".", "notBlank", "(", "theKey", ")", ";", "Validate", ".", "notNull", "(", "theValue", ")", ";", "if", "(", "myAttributes", "==", "null", ")", "{"...
Sets an attribute stored in this message. <p> Attributes are just a spot for user data of any kind to be added to the message for passing along the subscription processing pipeline (typically by interceptors). Values will be carried from the beginning to the end. </p> <p> Note that messages are designed to be passed in...
[ "Sets", "an", "attribute", "stored", "in", "this", "message", ".", "<p", ">", "Attributes", "are", "just", "a", "spot", "for", "user", "data", "of", "any", "kind", "to", "be", "added", "to", "the", "message", "for", "passing", "along", "the", "subscripti...
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/subscriber/BaseResourceMessage.java#L77-L84
nostra13/Android-Universal-Image-Loader
library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java
ImageLoader.displayImage
public void displayImage(String uri, ImageView imageView, DisplayImageOptions options) { """ Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call @param uri Image ...
java
public void displayImage(String uri, ImageView imageView, DisplayImageOptions options) { displayImage(uri, new ImageViewAware(imageView), options, null, null); }
[ "public", "void", "displayImage", "(", "String", "uri", ",", "ImageView", "imageView", ",", "DisplayImageOptions", "options", ")", "{", "displayImage", "(", "uri", ",", "new", "ImageViewAware", "(", "imageView", ")", ",", "options", ",", "null", ",", "null", ...
Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") @param imageView {@link ImageV...
[ "Adds", "display", "image", "task", "to", "execution", "pool", ".", "Image", "will", "be", "set", "to", "ImageView", "when", "it", "s", "turn", ".", "<br", "/", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "{", "@link", "#init", "(", "ImageLoad...
train
https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L347-L349
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/br/br_snmpmanager.java
br_snmpmanager.addmanager
public static br_snmpmanager addmanager(nitro_service client, br_snmpmanager resource) throws Exception { """ <pre> Use this operation to add snmp manager to Repeater Instances. </pre> """ return ((br_snmpmanager[]) resource.perform_operation(client, "addmanager"))[0]; }
java
public static br_snmpmanager addmanager(nitro_service client, br_snmpmanager resource) throws Exception { return ((br_snmpmanager[]) resource.perform_operation(client, "addmanager"))[0]; }
[ "public", "static", "br_snmpmanager", "addmanager", "(", "nitro_service", "client", ",", "br_snmpmanager", "resource", ")", "throws", "Exception", "{", "return", "(", "(", "br_snmpmanager", "[", "]", ")", "resource", ".", "perform_operation", "(", "client", ",", ...
<pre> Use this operation to add snmp manager to Repeater Instances. </pre>
[ "<pre", ">", "Use", "this", "operation", "to", "add", "snmp", "manager", "to", "Repeater", "Instances", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_snmpmanager.java#L147-L150
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/disktree/DiskTreeReader.java
DiskTreeReader.readIndex
public STRtree readIndex() throws Exception { """ Reads the {@link STRtree} object from the file. @return the quadtree, holding envelops and geometry positions in the file. @throws Exception """ File file = new File(path); raf = new RandomAccessFile(file, "r"); raf.seek(6L); ...
java
public STRtree readIndex() throws Exception { File file = new File(path); raf = new RandomAccessFile(file, "r"); raf.seek(6L); checkVersions(); long position = INDEX_ADDRESS_POSITION; raf.seek(position); long indexAddress = raf.readLong(); position = IN...
[ "public", "STRtree", "readIndex", "(", ")", "throws", "Exception", "{", "File", "file", "=", "new", "File", "(", "path", ")", ";", "raf", "=", "new", "RandomAccessFile", "(", "file", ",", "\"r\"", ")", ";", "raf", ".", "seek", "(", "6L", ")", ";", ...
Reads the {@link STRtree} object from the file. @return the quadtree, holding envelops and geometry positions in the file. @throws Exception
[ "Reads", "the", "{", "@link", "STRtree", "}", "object", "from", "the", "file", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/disktree/DiskTreeReader.java#L59-L84
vakinge/jeesuite-libs
jeesuite-common/src/main/java/com/jeesuite/common/util/DateUtils.java
DateUtils.formatDate
public static Date formatDate(Date orig, String... patterns) { """ 格式化日期为指定格式<br> generate by: vakin jiang at 2012-3-7 @param orig @param patterns @return """ String pattern = TIMESTAMP_PATTERN; if (patterns != null && patterns.length > 0 && StringUtils.isNotBlank(patterns...
java
public static Date formatDate(Date orig, String... patterns) { String pattern = TIMESTAMP_PATTERN; if (patterns != null && patterns.length > 0 && StringUtils.isNotBlank(patterns[0])) { pattern = patterns[0]; } return parseDate(DateFormatUtils.format(orig, patt...
[ "public", "static", "Date", "formatDate", "(", "Date", "orig", ",", "String", "...", "patterns", ")", "{", "String", "pattern", "=", "TIMESTAMP_PATTERN", ";", "if", "(", "patterns", "!=", "null", "&&", "patterns", ".", "length", ">", "0", "&&", "StringUtil...
格式化日期为指定格式<br> generate by: vakin jiang at 2012-3-7 @param orig @param patterns @return
[ "格式化日期为指定格式<br", ">", "generate", "by", ":", "vakin", "jiang", "at", "2012", "-", "3", "-", "7" ]
train
https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/util/DateUtils.java#L196-L203
spring-projects/spring-data-solr
src/main/java/org/springframework/data/solr/core/query/Criteria.java
Criteria.fuzzy
public Criteria fuzzy(String s, float levenshteinDistance) { """ Crates new {@link Predicate} with trailing {@code ~} followed by levensteinDistance @param s @param levenshteinDistance @return """ if (!Float.isNaN(levenshteinDistance) && (levenshteinDistance < 0 || levenshteinDistance > 1)) { throw n...
java
public Criteria fuzzy(String s, float levenshteinDistance) { if (!Float.isNaN(levenshteinDistance) && (levenshteinDistance < 0 || levenshteinDistance > 1)) { throw new InvalidDataAccessApiUsageException("Levenshtein Distance has to be within its bounds (0.0 - 1.0)."); } predicates.add(new Predicate(OperationKe...
[ "public", "Criteria", "fuzzy", "(", "String", "s", ",", "float", "levenshteinDistance", ")", "{", "if", "(", "!", "Float", ".", "isNaN", "(", "levenshteinDistance", ")", "&&", "(", "levenshteinDistance", "<", "0", "||", "levenshteinDistance", ">", "1", ")", ...
Crates new {@link Predicate} with trailing {@code ~} followed by levensteinDistance @param s @param levenshteinDistance @return
[ "Crates", "new", "{", "@link", "Predicate", "}", "with", "trailing", "{", "@code", "~", "}", "followed", "by", "levensteinDistance" ]
train
https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L341-L347
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.searchRecipes
public void searchRecipes(boolean isInput, int id, Callback<List<Integer>> callback) throws NullPointerException { """ For more info on Recipes search API go <a href="https://wiki.guildwars2.com/wiki/API:2/recipes/search">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link...
java
public void searchRecipes(boolean isInput, int id, Callback<List<Integer>> callback) throws NullPointerException { if (isInput) gw2API.searchInputRecipes(Integer.toString(id)).enqueue(callback); else gw2API.searchOutputRecipes(Integer.toString(id)).enqueue(callback); }
[ "public", "void", "searchRecipes", "(", "boolean", "isInput", ",", "int", "id", ",", "Callback", "<", "List", "<", "Integer", ">", ">", "callback", ")", "throws", "NullPointerException", "{", "if", "(", "isInput", ")", "gw2API", ".", "searchInputRecipes", "(...
For more info on Recipes search API go <a href="https://wiki.guildwars2.com/wiki/API:2/recipes/search">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param callback callback that is going to be used for ...
[ "For", "more", "info", "on", "Recipes", "search", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "recipes", "/", "search", ">", "here<", "/", "a", ">", "<br", "/"...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2321-L2324
google/closure-templates
java/src/com/google/template/soy/parsepasses/contextautoesc/SoyAutoescapeException.java
SoyAutoescapeException.createWithNode
static SoyAutoescapeException createWithNode(String message, SoyNode node) { """ Creates a SoyAutoescapeException, with meta info filled in based on the given Soy node. @param message The error message. @param node The node from which to derive the exception meta info. @return The new SoyAutoescapeException o...
java
static SoyAutoescapeException createWithNode(String message, SoyNode node) { return new SoyAutoescapeException(message, /*cause=*/ null, node); }
[ "static", "SoyAutoescapeException", "createWithNode", "(", "String", "message", ",", "SoyNode", "node", ")", "{", "return", "new", "SoyAutoescapeException", "(", "message", ",", "/*cause=*/", "null", ",", "node", ")", ";", "}" ]
Creates a SoyAutoescapeException, with meta info filled in based on the given Soy node. @param message The error message. @param node The node from which to derive the exception meta info. @return The new SoyAutoescapeException object.
[ "Creates", "a", "SoyAutoescapeException", "with", "meta", "info", "filled", "in", "based", "on", "the", "given", "Soy", "node", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/SoyAutoescapeException.java#L36-L38
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java
ClipAndReduce.massage
public void massage( T input , T output ) { """ Clipps and scales the input iamge as neccisary @param input Input image. Typically larger than output @param output Output image """ if( clip ) { T inputAdjusted = clipInput(input, output); // configure a simple change in scale for both axises tran...
java
public void massage( T input , T output ) { if( clip ) { T inputAdjusted = clipInput(input, output); // configure a simple change in scale for both axises transform.a11 = input.width / (float) output.width; transform.a22 = input.height / (float) output.height; // this change is automatically reflected...
[ "public", "void", "massage", "(", "T", "input", ",", "T", "output", ")", "{", "if", "(", "clip", ")", "{", "T", "inputAdjusted", "=", "clipInput", "(", "input", ",", "output", ")", ";", "// configure a simple change in scale for both axises", "transform", ".",...
Clipps and scales the input iamge as neccisary @param input Input image. Typically larger than output @param output Output image
[ "Clipps", "and", "scales", "the", "input", "iamge", "as", "neccisary" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/deepboof/ClipAndReduce.java#L71-L89
BBN-E/bue-common-open
common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java
FileUtils.loadStringToFileMap
public static Map<String, File> loadStringToFileMap(final CharSource source) throws IOException { """ Reads a {@link Map} from a {@link CharSource}, where each line is a key, a tab character ("\t"), and a value. Blank lines and lines beginning with "#" are ignored. """ return loadMap(source, Functions.<St...
java
public static Map<String, File> loadStringToFileMap(final CharSource source) throws IOException { return loadMap(source, Functions.<String>identity(), FileFunction.INSTANCE, IsCommentLine.INSTANCE); }
[ "public", "static", "Map", "<", "String", ",", "File", ">", "loadStringToFileMap", "(", "final", "CharSource", "source", ")", "throws", "IOException", "{", "return", "loadMap", "(", "source", ",", "Functions", ".", "<", "String", ">", "identity", "(", ")", ...
Reads a {@link Map} from a {@link CharSource}, where each line is a key, a tab character ("\t"), and a value. Blank lines and lines beginning with "#" are ignored.
[ "Reads", "a", "{" ]
train
https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L283-L286
aws/aws-sdk-java
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/WeeklyAutoScalingSchedule.java
WeeklyAutoScalingSchedule.withSunday
public WeeklyAutoScalingSchedule withSunday(java.util.Map<String, String> sunday) { """ <p> The schedule for Sunday. </p> @param sunday The schedule for Sunday. @return Returns a reference to this object so that method calls can be chained together. """ setSunday(sunday); return this; ...
java
public WeeklyAutoScalingSchedule withSunday(java.util.Map<String, String> sunday) { setSunday(sunday); return this; }
[ "public", "WeeklyAutoScalingSchedule", "withSunday", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "sunday", ")", "{", "setSunday", "(", "sunday", ")", ";", "return", "this", ";", "}" ]
<p> The schedule for Sunday. </p> @param sunday The schedule for Sunday. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "schedule", "for", "Sunday", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/WeeklyAutoScalingSchedule.java#L521-L524
MGunlogson/CuckooFilter4J
src/main/java/com/github/mgunlogson/cuckoofilter4j/Utils.java
Utils.getBitsPerItemForFpRate
static int getBitsPerItemForFpRate(double fpProb,double loadFactor) { """ Calculates how many bits are needed to reach a given false positive rate. @param fpProb the false positive probability. @return the length of the tag needed (in bits) to reach the false positive rate. """ /* * equation from ...
java
static int getBitsPerItemForFpRate(double fpProb,double loadFactor) { /* * equation from Cuckoo Filter: Practically Better Than Bloom Bin Fan, * David G. Andersen, Michael Kaminsky , Michael D. Mitzenmacher */ return DoubleMath.roundToInt(DoubleMath.log2((1 / fpProb) + 3) / loadFactor, RoundingMode.UP...
[ "static", "int", "getBitsPerItemForFpRate", "(", "double", "fpProb", ",", "double", "loadFactor", ")", "{", "/*\r\n\t\t * equation from Cuckoo Filter: Practically Better Than Bloom Bin Fan,\r\n\t\t * David G. Andersen, Michael Kaminsky , Michael D. Mitzenmacher\r\n\t\t */", "return", "Doub...
Calculates how many bits are needed to reach a given false positive rate. @param fpProb the false positive probability. @return the length of the tag needed (in bits) to reach the false positive rate.
[ "Calculates", "how", "many", "bits", "are", "needed", "to", "reach", "a", "given", "false", "positive", "rate", "." ]
train
https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/Utils.java#L148-L154
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/DeltaCollectionValuedMap.java
DeltaCollectionValuedMap.addAll
@Override public void addAll(Map<K, V> m) { """ Adds all of the mappings in m to this CollectionValuedMap. If m is a CollectionValuedMap, it will behave strangely. Use the constructor instead. """ for (Map.Entry<K, V> e : m.entrySet()) { add(e.getKey(), e.getValue()); } }
java
@Override public void addAll(Map<K, V> m) { for (Map.Entry<K, V> e : m.entrySet()) { add(e.getKey(), e.getValue()); } }
[ "@", "Override", "public", "void", "addAll", "(", "Map", "<", "K", ",", "V", ">", "m", ")", "{", "for", "(", "Map", ".", "Entry", "<", "K", ",", "V", ">", "e", ":", "m", ".", "entrySet", "(", ")", ")", "{", "add", "(", "e", ".", "getKey", ...
Adds all of the mappings in m to this CollectionValuedMap. If m is a CollectionValuedMap, it will behave strangely. Use the constructor instead.
[ "Adds", "all", "of", "the", "mappings", "in", "m", "to", "this", "CollectionValuedMap", ".", "If", "m", "is", "a", "CollectionValuedMap", "it", "will", "behave", "strangely", ".", "Use", "the", "constructor", "instead", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/DeltaCollectionValuedMap.java#L126-L131
vlingo/vlingo-actors
src/main/java/io/vlingo/actors/Actor.java
Actor.childActorFor
protected Protocols childActorFor(final Class<?>[] protocols, final Definition definition) { """ Answers the {@code Protocols} for the child {@code Actor} to be created by this parent {@code Actor}. @param protocols the {@code Class<T>[]} protocols of the child {@code Actor} @param definition the {@code Definit...
java
protected Protocols childActorFor(final Class<?>[] protocols, final Definition definition) { if (definition.supervisor() != null) { return lifeCycle.environment.stage.actorFor(protocols, definition, this, definition.supervisor(), logger()); } else { if (this instanceof Supervisor) { return l...
[ "protected", "Protocols", "childActorFor", "(", "final", "Class", "<", "?", ">", "[", "]", "protocols", ",", "final", "Definition", "definition", ")", "{", "if", "(", "definition", ".", "supervisor", "(", ")", "!=", "null", ")", "{", "return", "lifeCycle",...
Answers the {@code Protocols} for the child {@code Actor} to be created by this parent {@code Actor}. @param protocols the {@code Class<T>[]} protocols of the child {@code Actor} @param definition the {@code Definition} of the child {@code Actor} to be created by this parent {@code Actor} @return Protocols
[ "Answers", "the", "{" ]
train
https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Actor.java#L181-L191
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/io/StreamUtils.java
StreamUtils.copy
public static long copy(ReadableByteChannel inputChannel, WritableByteChannel outputChannel) throws IOException { """ Copies a {@link ReadableByteChannel} to a {@link WritableByteChannel}. <p> <b>Note:</b> The {@link ReadableByteChannel} and {@link WritableByteChannel}s are NOT closed by the method </p> @ret...
java
public static long copy(ReadableByteChannel inputChannel, WritableByteChannel outputChannel) throws IOException { return new StreamCopier(inputChannel, outputChannel).copy(); }
[ "public", "static", "long", "copy", "(", "ReadableByteChannel", "inputChannel", ",", "WritableByteChannel", "outputChannel", ")", "throws", "IOException", "{", "return", "new", "StreamCopier", "(", "inputChannel", ",", "outputChannel", ")", ".", "copy", "(", ")", ...
Copies a {@link ReadableByteChannel} to a {@link WritableByteChannel}. <p> <b>Note:</b> The {@link ReadableByteChannel} and {@link WritableByteChannel}s are NOT closed by the method </p> @return Total bytes copied
[ "Copies", "a", "{", "@link", "ReadableByteChannel", "}", "to", "a", "{", "@link", "WritableByteChannel", "}", ".", "<p", ">", "<b", ">", "Note", ":", "<", "/", "b", ">", "The", "{", "@link", "ReadableByteChannel", "}", "and", "{", "@link", "WritableByteC...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/io/StreamUtils.java#L87-L89
apache/incubator-heron
heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java
SchedulerStateManagerAdaptor.getMetricsCacheLocation
public TopologyMaster.MetricsCacheLocation getMetricsCacheLocation(String topologyName) { """ Get the metricscache location for the given topology @return MetricsCacheLocation """ return awaitResult(delegate.getMetricsCacheLocation(null, topologyName)); }
java
public TopologyMaster.MetricsCacheLocation getMetricsCacheLocation(String topologyName) { return awaitResult(delegate.getMetricsCacheLocation(null, topologyName)); }
[ "public", "TopologyMaster", ".", "MetricsCacheLocation", "getMetricsCacheLocation", "(", "String", "topologyName", ")", "{", "return", "awaitResult", "(", "delegate", ".", "getMetricsCacheLocation", "(", "null", ",", "topologyName", ")", ")", ";", "}" ]
Get the metricscache location for the given topology @return MetricsCacheLocation
[ "Get", "the", "metricscache", "location", "for", "the", "given", "topology" ]
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java#L265-L267
DDTH/ddth-dao
ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java
GenericBoJdbcDao.createOrUpdate
protected DaoResult createOrUpdate(Connection conn, T bo) { """ Create a new BO or update an existing one. @param conn @param bo @return @since 0.8.1 """ if (bo == null) { return null; } DaoResult result = create(conn, bo); DaoOperationStatus status = result.ge...
java
protected DaoResult createOrUpdate(Connection conn, T bo) { if (bo == null) { return null; } DaoResult result = create(conn, bo); DaoOperationStatus status = result.getStatus(); if (status == DaoOperationStatus.DUPLICATED_VALUE || status == DaoOperatio...
[ "protected", "DaoResult", "createOrUpdate", "(", "Connection", "conn", ",", "T", "bo", ")", "{", "if", "(", "bo", "==", "null", ")", "{", "return", "null", ";", "}", "DaoResult", "result", "=", "create", "(", "conn", ",", "bo", ")", ";", "DaoOperationS...
Create a new BO or update an existing one. @param conn @param bo @return @since 0.8.1
[ "Create", "a", "new", "BO", "or", "update", "an", "existing", "one", "." ]
train
https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java#L692-L703
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java
ImageIOGreyScale.getImageWritersBySuffix
public static Iterator<ImageWriter> getImageWritersBySuffix(String fileSuffix) { """ Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that claim to be able to encode files with the given suffix. @param fileSuffix a <code>String</code> containing a file suffix (<i>...
java
public static Iterator<ImageWriter> getImageWritersBySuffix(String fileSuffix) { if (fileSuffix == null) { throw new IllegalArgumentException("fileSuffix == null!"); } Iterator iter; // Ensure category is present try { iter = theRegistry.getServiceProviders(ImageWriterSpi.class, new ContainsFilte...
[ "public", "static", "Iterator", "<", "ImageWriter", ">", "getImageWritersBySuffix", "(", "String", "fileSuffix", ")", "{", "if", "(", "fileSuffix", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"fileSuffix == null!\"", ")", ";", "}", ...
Returns an <code>Iterator</code> containing all currently registered <code>ImageWriter</code>s that claim to be able to encode files with the given suffix. @param fileSuffix a <code>String</code> containing a file suffix (<i>e.g.</i>, "jpg" or "tiff"). @return an <code>Iterator</code> containing <code>ImageWriter</co...
[ "Returns", "an", "<code", ">", "Iterator<", "/", "code", ">", "containing", "all", "currently", "registered", "<code", ">", "ImageWriter<", "/", "code", ">", "s", "that", "claim", "to", "be", "able", "to", "encode", "files", "with", "the", "given", "suffix...
train
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java#L809-L821
synchronoss/cpo-api
cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java
CassandraCpoAdapter.deleteObjects
@Override public <T> long deleteObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException { """ Removes the Objects contained in the collection from the datasource. The assumption is that the object e...
java
@Override public <T> long deleteObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException { return processUpdateGroup(coll, CpoAdapter.DELETE_GROUP, name, wheres, orderBy, nativeExpressions); }
[ "@", "Override", "public", "<", "T", ">", "long", "deleteObjects", "(", "String", "name", ",", "Collection", "<", "T", ">", "coll", ",", "Collection", "<", "CpoWhere", ">", "wheres", ",", "Collection", "<", "CpoOrderBy", ">", "orderBy", ",", "Collection", ...
Removes the Objects contained in the collection from the datasource. The assumption is that the object exists in the datasource. This method stores the objects contained in the collection in the datasource. The objects in the collection will be treated as one transaction, assuming the datasource supports transactions. ...
[ "Removes", "the", "Objects", "contained", "in", "the", "collection", "from", "the", "datasource", ".", "The", "assumption", "is", "that", "the", "object", "exists", "in", "the", "datasource", ".", "This", "method", "stores", "the", "objects", "contained", "in"...
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L679-L682
windup/windup
utils/src/main/java/org/jboss/windup/util/PathUtil.java
PathUtil.getRootFolderForSource
public static Path getRootFolderForSource(Path sourceFilePath, String packageName) { """ Returns the root path for this source file, based upon the package name. For example, if path is "/project/src/main/java/org/example/Foo.java" and the package is "org.example", then this should return "/project/src/main/ja...
java
public static Path getRootFolderForSource(Path sourceFilePath, String packageName) { if (packageName == null || packageName.trim().isEmpty()) { return sourceFilePath.getParent(); } String[] packageNameComponents = packageName.split("\\."); Path currentPath = sourc...
[ "public", "static", "Path", "getRootFolderForSource", "(", "Path", "sourceFilePath", ",", "String", "packageName", ")", "{", "if", "(", "packageName", "==", "null", "||", "packageName", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "...
Returns the root path for this source file, based upon the package name. For example, if path is "/project/src/main/java/org/example/Foo.java" and the package is "org.example", then this should return "/project/src/main/java". Returns null if the folder structure does not match the package name.
[ "Returns", "the", "root", "path", "for", "this", "source", "file", "based", "upon", "the", "package", "name", "." ]
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/PathUtil.java#L213-L231
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/util/pathfinding/navmesh/Space.java
Space.pickLowestCost
public boolean pickLowestCost(Space target, NavPath path) { """ Pick the lowest cost route from this space to another on the path @param target The target space we're looking for @param path The path to add the steps to @return True if the path was found """ if (target == this) { return true; } i...
java
public boolean pickLowestCost(Space target, NavPath path) { if (target == this) { return true; } if (links.size() == 0) { return false; } Link bestLink = null; for (int i=0;i<getLinkCount();i++) { Link link = getLink(i); if ((bestLink == null) || (link.getTarget().getCost() < bestLink.getTarge...
[ "public", "boolean", "pickLowestCost", "(", "Space", "target", ",", "NavPath", "path", ")", "{", "if", "(", "target", "==", "this", ")", "{", "return", "true", ";", "}", "if", "(", "links", ".", "size", "(", ")", "==", "0", ")", "{", "return", "fal...
Pick the lowest cost route from this space to another on the path @param target The target space we're looking for @param path The path to add the steps to @return True if the path was found
[ "Pick", "the", "lowest", "cost", "route", "from", "this", "space", "to", "another", "on", "the", "path" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/pathfinding/navmesh/Space.java#L291-L309
ironjacamar/ironjacamar
web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java
HtmlAdaptorServlet.displayMBeans
private void displayMBeans(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { """ Display all MBeans @param request The HTTP request @param response The HTTP response @exception ServletException Thrown if an error occurs @exception IOException Thrown if an I...
java
private void displayMBeans(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Iterator mbeans; try { mbeans = getDomainData(); } catch (Exception e) { throw new ServletException("Failed to get MBeans", e); ...
[ "private", "void", "displayMBeans", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "Iterator", "mbeans", ";", "try", "{", "mbeans", "=", "getDomainData", "(", ")", ";", "}",...
Display all MBeans @param request The HTTP request @param response The HTTP response @exception ServletException Thrown if an error occurs @exception IOException Thrown if an I/O error occurs
[ "Display", "all", "MBeans" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L148-L165
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/VoiceApi.java
VoiceApi.deleteUserDataPair
public ApiSuccessResponse deleteUserDataPair(String id, KeyData keyData) throws ApiException { """ Remove a key/value pair from user data Delete data with the specified key from the call&#39;s user data. @param id The connection ID of the call. (required) @param keyData (required) @return ApiSuccessResponse ...
java
public ApiSuccessResponse deleteUserDataPair(String id, KeyData keyData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = deleteUserDataPairWithHttpInfo(id, keyData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "deleteUserDataPair", "(", "String", "id", ",", "KeyData", "keyData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "deleteUserDataPairWithHttpInfo", "(", "id", ",", "keyData", ")", ";...
Remove a key/value pair from user data Delete data with the specified key from the call&#39;s user data. @param id The connection ID of the call. (required) @param keyData (required) @return ApiSuccessResponse @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Remove", "a", "key", "/", "value", "pair", "from", "user", "data", "Delete", "data", "with", "the", "specified", "key", "from", "the", "call&#39", ";", "s", "user", "data", "." ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L1343-L1346
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java
CLIQUESubspace.dfs
public void dfs(CLIQUEUnit unit, ModifiableDBIDs cluster, CLIQUESubspace model) { """ Depth-first search algorithm to find connected dense units in this subspace that build a cluster. It starts with a unit, assigns it to a cluster and finds all units it is connected to. @param unit the unit @param cluster th...
java
public void dfs(CLIQUEUnit unit, ModifiableDBIDs cluster, CLIQUESubspace model) { cluster.addDBIDs(unit.getIds()); unit.markAsAssigned(); model.addDenseUnit(unit); final long[] dims = getDimensions(); for(int dim = BitsUtil.nextSetBit(dims, 0); dim >= 0; dim = BitsUtil.nextSetBit(dims, dim + 1)) { ...
[ "public", "void", "dfs", "(", "CLIQUEUnit", "unit", ",", "ModifiableDBIDs", "cluster", ",", "CLIQUESubspace", "model", ")", "{", "cluster", ".", "addDBIDs", "(", "unit", ".", "getIds", "(", ")", ")", ";", "unit", ".", "markAsAssigned", "(", ")", ";", "mo...
Depth-first search algorithm to find connected dense units in this subspace that build a cluster. It starts with a unit, assigns it to a cluster and finds all units it is connected to. @param unit the unit @param cluster the IDs of the feature vectors of the current cluster @param model the model of the cluster
[ "Depth", "-", "first", "search", "algorithm", "to", "find", "connected", "dense", "units", "in", "this", "subspace", "that", "build", "a", "cluster", ".", "It", "starts", "with", "a", "unit", "assigns", "it", "to", "a", "cluster", "and", "finds", "all", ...
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java#L120-L137
fcrepo4/fcrepo4
fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java
JcrRdfTools.createValue
public Value createValue(final Node node, final RDFNode data, final String propertyName) throws RepositoryException { """ Create a JCR value from an RDFNode for a given JCR property @param node the JCR node we want a property for @param data an RDF Node (...
java
public Value createValue(final Node node, final RDFNode data, final String propertyName) throws RepositoryException { final ValueFactory valueFactory = node.getSession().getValueFactory(); return createValue(valueFactory, data, getPropertyType(no...
[ "public", "Value", "createValue", "(", "final", "Node", "node", ",", "final", "RDFNode", "data", ",", "final", "String", "propertyName", ")", "throws", "RepositoryException", "{", "final", "ValueFactory", "valueFactory", "=", "node", ".", "getSession", "(", ")",...
Create a JCR value from an RDFNode for a given JCR property @param node the JCR node we want a property for @param data an RDF Node (possibly with a DataType) @param propertyName name of the property to populate (used to use the right type for the value) @return the JCR value from an RDFNode for a given JCR property @t...
[ "Create", "a", "JCR", "value", "from", "an", "RDFNode", "for", "a", "given", "JCR", "property" ]
train
https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java#L174-L179
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/api/common/Plan.java
Plan.registerCachedFile
public void registerCachedFile(String filePath, String name) throws IOException { """ register cache files in program level @param filePath The files must be stored in a place that can be accessed from all workers (most commonly HDFS) @param name user defined name of that file @throws java.io.IOException ""...
java
public void registerCachedFile(String filePath, String name) throws IOException { if (!this.cacheFile.containsKey(name)) { try { URI u = new URI(filePath); if (!u.getPath().startsWith("/")) { u = new URI(new File(filePath).getAbsolutePath()); } FileSystem fs = FileSystem.get(u); if (fs.exi...
[ "public", "void", "registerCachedFile", "(", "String", "filePath", ",", "String", "name", ")", "throws", "IOException", "{", "if", "(", "!", "this", ".", "cacheFile", ".", "containsKey", "(", "name", ")", ")", "{", "try", "{", "URI", "u", "=", "new", "...
register cache files in program level @param filePath The files must be stored in a place that can be accessed from all workers (most commonly HDFS) @param name user defined name of that file @throws java.io.IOException
[ "register", "cache", "files", "in", "program", "level" ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/Plan.java#L308-L327
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendBinary
public static <T> void sendBinary(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context, long timeoutmillis) { """ Sends a complete binary message, invoking the callback when complete @param data The data to send @param wsChannel The web socket channel @para...
java
public static <T> void sendBinary(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context, long timeoutmillis) { sendInternal(mergeBuffers(data), WebSocketFrameType.BINARY, wsChannel, callback, context, timeoutmillis); }
[ "public", "static", "<", "T", ">", "void", "sendBinary", "(", "final", "ByteBuffer", "[", "]", "data", ",", "final", "WebSocketChannel", "wsChannel", ",", "final", "WebSocketCallback", "<", "T", ">", "callback", ",", "T", "context", ",", "long", "timeoutmill...
Sends a complete binary message, invoking the callback when complete @param data The data to send @param wsChannel The web socket channel @param callback The callback to invoke on completion @param context The context object that will be passed to the callback on completion @param timeoutmillis the timeout in millisec...
[ "Sends", "a", "complete", "binary", "message", "invoking", "the", "callback", "when", "complete" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L674-L676
super-csv/super-csv
super-csv/src/main/java/org/supercsv/cellprocessor/ParseDateTimeAbstract.java
ParseDateTimeAbstract.execute
public Object execute(final Object value, final CsvContext context) { """ {@inheritDoc} @throws SuperCsvCellProcessorException if value is null, isn't a String, or can't be parsed to a Date """ validateInputNotNull(value, context); if( !(value instanceof String) ) { throw new SuperCsvCellProcesso...
java
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if( !(value instanceof String) ) { throw new SuperCsvCellProcessorException(String.class, value, context, this); } try { if( locale == null ) { formatter = new SimpleDateFormat(dateFormat)...
[ "public", "Object", "execute", "(", "final", "Object", "value", ",", "final", "CsvContext", "context", ")", "{", "validateInputNotNull", "(", "value", ",", "context", ")", ";", "if", "(", "!", "(", "value", "instanceof", "String", ")", ")", "{", "throw", ...
{@inheritDoc} @throws SuperCsvCellProcessorException if value is null, isn't a String, or can't be parsed to a Date
[ "{", "@inheritDoc", "}" ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseDateTimeAbstract.java#L210-L231
google/cloud-reporting
src/main/java/com/google/cloud/metrics/MetricsUtils.java
MetricsUtils.buildCombinedType
static String buildCombinedType(String eventType, Optional<String> objectType) { """ Combines event and object type into a single type string. @param eventType type or category of the reporting event. @param objectType optional type of the object this event applies to. @return Combined type string. """ ...
java
static String buildCombinedType(String eventType, Optional<String> objectType) { return Joiner.on("/").skipNulls().join(eventType, objectType.orNull()); }
[ "static", "String", "buildCombinedType", "(", "String", "eventType", ",", "Optional", "<", "String", ">", "objectType", ")", "{", "return", "Joiner", ".", "on", "(", "\"/\"", ")", ".", "skipNulls", "(", ")", ".", "join", "(", "eventType", ",", "objectType"...
Combines event and object type into a single type string. @param eventType type or category of the reporting event. @param objectType optional type of the object this event applies to. @return Combined type string.
[ "Combines", "event", "and", "object", "type", "into", "a", "single", "type", "string", "." ]
train
https://github.com/google/cloud-reporting/blob/af2a8ff6077a9763f7f2d405dd55c82efaead0ac/src/main/java/com/google/cloud/metrics/MetricsUtils.java#L128-L130
MTDdk/jawn
jawn-core/src/main/java/net/javapla/jawn/core/util/StreamUtil.java
StreamUtil.saveTo
public static void saveTo(String path, InputStream in) throws IOException { """ Saves content read from input stream into a file. @param path path to file. @param in input stream to read content from. @throws IOException IO error @throws IllegalArgumentException if stream is null or path is null """ ...
java
public static void saveTo(String path, InputStream in) throws IOException { if (in == null) throw new IllegalArgumentException("input stream cannot be null"); if (path == null) throw new IllegalArgumentException("path cannot be null"); try (OutputStream out = new Buffere...
[ "public", "static", "void", "saveTo", "(", "String", "path", ",", "InputStream", "in", ")", "throws", "IOException", "{", "if", "(", "in", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"input stream cannot be null\"", ")", ";", "if", "(...
Saves content read from input stream into a file. @param path path to file. @param in input stream to read content from. @throws IOException IO error @throws IllegalArgumentException if stream is null or path is null
[ "Saves", "content", "read", "from", "input", "stream", "into", "a", "file", "." ]
train
https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/util/StreamUtil.java#L82-L97