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
Crab2died/Excel4J
src/main/java/com/github/crab2died/ExcelUtils.java
ExcelUtils.readExcel2List
public List<List<String>> readExcel2List(InputStream is, int offsetLine, int limitLine, int sheetIndex) throws Excel4JException, IOException, InvalidFormatException { """ 读取Excel表格数据,返回{@code List[List[String]]}类型的数据集合 @param is 待读取Excel的数据流 @param offsetLine Excel表头行(默认是0) @param limitLin...
java
public List<List<String>> readExcel2List(InputStream is, int offsetLine, int limitLine, int sheetIndex) throws Excel4JException, IOException, InvalidFormatException { try (Workbook workbook = WorkbookFactory.create(is)) { return readExcel2ObjectsHandler(workbook, offsetLine, limitLine, ...
[ "public", "List", "<", "List", "<", "String", ">", ">", "readExcel2List", "(", "InputStream", "is", ",", "int", "offsetLine", ",", "int", "limitLine", ",", "int", "sheetIndex", ")", "throws", "Excel4JException", ",", "IOException", ",", "InvalidFormatException",...
读取Excel表格数据,返回{@code List[List[String]]}类型的数据集合 @param is 待读取Excel的数据流 @param offsetLine Excel表头行(默认是0) @param limitLine 最大读取行数(默认表尾) @param sheetIndex Sheet索引(默认0) @return 返回{@code List<List<String>>}类型的数据集合 @throws Excel4JException 异常 @throws IOException 异常 @throws InvalidFormatException 异常...
[ "读取Excel表格数据", "返回", "{", "@code", "List", "[", "List", "[", "String", "]]", "}", "类型的数据集合" ]
train
https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L339-L345
alipay/sofa-rpc
extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperRegistry.java
ZookeeperRegistry.subscribeConfig
protected void subscribeConfig(final AbstractInterfaceConfig config, ConfigListener listener) { """ 订阅接口级配置 @param config provider/consumer config @param listener config listener """ try { if (configObserver == null) { // 初始化 configObserver = new ZookeeperConfigObserve...
java
protected void subscribeConfig(final AbstractInterfaceConfig config, ConfigListener listener) { try { if (configObserver == null) { // 初始化 configObserver = new ZookeeperConfigObserver(); } configObserver.addConfigListener(config, listener); final S...
[ "protected", "void", "subscribeConfig", "(", "final", "AbstractInterfaceConfig", "config", ",", "ConfigListener", "listener", ")", "{", "try", "{", "if", "(", "configObserver", "==", "null", ")", "{", "// 初始化", "configObserver", "=", "new", "ZookeeperConfigObserver"...
订阅接口级配置 @param config provider/consumer config @param listener config listener
[ "订阅接口级配置" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-zk/src/main/java/com/alipay/sofa/rpc/registry/zk/ZookeeperRegistry.java#L409-L445
cdapio/tigon
tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java
DatumWriterGenerator.encodeUnion
private void encodeUnion(GeneratorAdapter mg, TypeToken<?> outputType, Schema schema, int value, int encoder, int schemaLocal, int seenRefs) { """ Generates method body for encoding union schema. Union schema is used for representing object references that could be {@code null}. @param...
java
private void encodeUnion(GeneratorAdapter mg, TypeToken<?> outputType, Schema schema, int value, int encoder, int schemaLocal, int seenRefs) { Label nullLabel = mg.newLabel(); Label endLabel = mg.newLabel(); mg.loadArg(value); mg.ifNull(nullLabel); // Not null, write out ...
[ "private", "void", "encodeUnion", "(", "GeneratorAdapter", "mg", ",", "TypeToken", "<", "?", ">", "outputType", ",", "Schema", "schema", ",", "int", "value", ",", "int", "encoder", ",", "int", "schemaLocal", ",", "int", "seenRefs", ")", "{", "Label", "null...
Generates method body for encoding union schema. Union schema is used for representing object references that could be {@code null}. @param mg @param outputType @param schema @param value @param encoder @param schemaLocal @param seenRefs
[ "Generates", "method", "body", "for", "encoding", "union", "schema", ".", "Union", "schema", "is", "used", "for", "representing", "object", "references", "that", "could", "be", "{" ]
train
https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/internal/io/DatumWriterGenerator.java#L805-L831
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/Server.java
Server.addWebApplication
public WebApplicationContext addWebApplication(String contextPathSpec, String webApp) throws IOException { """ Add Web Application. @param contextPathSpec The context path spec. Which must be of the form / or /path/* @param webApp The Web application di...
java
public WebApplicationContext addWebApplication(String contextPathSpec, String webApp) throws IOException { return addWebApplication(null,contextPathSpec,webApp); }
[ "public", "WebApplicationContext", "addWebApplication", "(", "String", "contextPathSpec", ",", "String", "webApp", ")", "throws", "IOException", "{", "return", "addWebApplication", "(", "null", ",", "contextPathSpec", ",", "webApp", ")", ";", "}" ]
Add Web Application. @param contextPathSpec The context path spec. Which must be of the form / or /path/* @param webApp The Web application directory or WAR file. @return The WebApplicationContext @exception IOException
[ "Add", "Web", "Application", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/Server.java#L237-L242
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ScanResult.java
ScanResult.withItems
public ScanResult withItems(java.util.Map<String, AttributeValue>... items) { """ <p> An array of item attributes that match the scan criteria. Each element in this array consists of an attribute name and the value for that attribute. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (...
java
public ScanResult withItems(java.util.Map<String, AttributeValue>... items) { if (this.items == null) { setItems(new java.util.ArrayList<java.util.Map<String, AttributeValue>>(items.length)); } for (java.util.Map<String, AttributeValue> ele : items) { this.items.add(ele);...
[ "public", "ScanResult", "withItems", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "AttributeValue", ">", "...", "items", ")", "{", "if", "(", "this", ".", "items", "==", "null", ")", "{", "setItems", "(", "new", "java", ".", "util", ".",...
<p> An array of item attributes that match the scan criteria. Each element in this array consists of an attribute name and the value for that attribute. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setItems(java.util.Collection)} or {@link #withItems(java.util.Collecti...
[ "<p", ">", "An", "array", "of", "item", "attributes", "that", "match", "the", "scan", "criteria", ".", "Each", "element", "in", "this", "array", "consists", "of", "an", "attribute", "name", "and", "the", "value", "for", "that", "attribute", ".", "<", "/"...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ScanResult.java#L142-L150
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java
AbstractConnectionManager.getConnection
public Connection getConnection() { """ gets a connection from the pool. initializePool() must've been called before calling this method. If all connections are in use, this method will block, unless maxWait has been set. @return a connection. """ Connection connection; try { ...
java
public Connection getConnection() { Connection connection; try { if (getLogger().isDebugEnabled()) { getLogger().debug("before: active : " + connectionPool.getNumActive() + " idle: " + connectionPool.getNumIdle()); } ...
[ "public", "Connection", "getConnection", "(", ")", "{", "Connection", "connection", ";", "try", "{", "if", "(", "getLogger", "(", ")", ".", "isDebugEnabled", "(", ")", ")", "{", "getLogger", "(", ")", ".", "debug", "(", "\"before: active : \"", "+", "conne...
gets a connection from the pool. initializePool() must've been called before calling this method. If all connections are in use, this method will block, unless maxWait has been set. @return a connection.
[ "gets", "a", "connection", "from", "the", "pool", ".", "initializePool", "()", "must", "ve", "been", "called", "before", "calling", "this", "method", ".", "If", "all", "connections", "are", "in", "use", "this", "method", "will", "block", "unless", "maxWait",...
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java#L212-L238
mapfish/mapfish-print
core/src/main/java/org/mapfish/print/output/Values.java
Values.getObject
public <V> V getObject(final String key, final Class<V> type) { """ Get a value as a string. @param key the key for looking up the value. @param type the type of the object @param <V> the type """ final Object obj = this.values.get(key); return type.cast(obj); }
java
public <V> V getObject(final String key, final Class<V> type) { final Object obj = this.values.get(key); return type.cast(obj); }
[ "public", "<", "V", ">", "V", "getObject", "(", "final", "String", "key", ",", "final", "Class", "<", "V", ">", "type", ")", "{", "final", "Object", "obj", "=", "this", ".", "values", ".", "get", "(", "key", ")", ";", "return", "type", ".", "cast...
Get a value as a string. @param key the key for looking up the value. @param type the type of the object @param <V> the type
[ "Get", "a", "value", "as", "a", "string", "." ]
train
https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/output/Values.java#L333-L336
facebookarchive/hadoop-20
src/core/org/apache/hadoop/net/SocketOutputStream.java
SocketOutputStream.transferToFully
public void transferToFully(FileChannel fileCh, long position, int count) throws IOException { """ Transfers data from FileChannel using {@link FileChannel#transferTo(long, long, WritableByteChannel)}. Similar to readFully(), this waits till requested amount of data is transfere...
java
public void transferToFully(FileChannel fileCh, long position, int count) throws IOException { while (count > 0) { /* * Ideally we should wait after transferTo returns 0. But because of * a bug in JRE on Linux (http://bugs.sun.com/view_bug.do?bug_id=5103988),...
[ "public", "void", "transferToFully", "(", "FileChannel", "fileCh", ",", "long", "position", ",", "int", "count", ")", "throws", "IOException", "{", "while", "(", "count", ">", "0", ")", "{", "/* \n * Ideally we should wait after transferTo returns 0. But because o...
Transfers data from FileChannel using {@link FileChannel#transferTo(long, long, WritableByteChannel)}. Similar to readFully(), this waits till requested amount of data is transfered. @param fileCh FileChannel to transfer data from. @param position position within the channel where the transfer begins @param count num...
[ "Transfers", "data", "from", "FileChannel", "using", "{", "@link", "FileChannel#transferTo", "(", "long", "long", "WritableByteChannel", ")", "}", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/SocketOutputStream.java#L184-L218
westnordost/osmapi
src/main/java/de/westnordost/osmapi/map/data/ModificationAwareList.java
ModificationAwareList.add
@Override public void add(int location, T object) { """ /* Everything below this comment: implementation of the list interface """ list.add(location, object); onModification(); }
java
@Override public void add(int location, T object) { list.add(location, object); onModification(); }
[ "@", "Override", "public", "void", "add", "(", "int", "location", ",", "T", "object", ")", "{", "list", ".", "add", "(", "location", ",", "object", ")", ";", "onModification", "(", ")", ";", "}" ]
/* Everything below this comment: implementation of the list interface
[ "/", "*", "Everything", "below", "this", "comment", ":", "implementation", "of", "the", "list", "interface" ]
train
https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/data/ModificationAwareList.java#L37-L42
Netflix/netflix-graph
src/main/java/com/netflix/nfgraph/build/NFBuildGraph.java
NFBuildGraph.getPropertySpec
public NFPropertySpec getPropertySpec(String nodeType, String propertyName) { """ Returns the {@link NFPropertySpec} associated with the supplied node type and property name. """ NFNodeSpec nodeSpec = graphSpec.getNodeSpec(nodeType); NFPropertySpec propertySpec = nodeSpec.getPropertySpec(proper...
java
public NFPropertySpec getPropertySpec(String nodeType, String propertyName) { NFNodeSpec nodeSpec = graphSpec.getNodeSpec(nodeType); NFPropertySpec propertySpec = nodeSpec.getPropertySpec(propertyName); return propertySpec; }
[ "public", "NFPropertySpec", "getPropertySpec", "(", "String", "nodeType", ",", "String", "propertyName", ")", "{", "NFNodeSpec", "nodeSpec", "=", "graphSpec", ".", "getNodeSpec", "(", "nodeType", ")", ";", "NFPropertySpec", "propertySpec", "=", "nodeSpec", ".", "g...
Returns the {@link NFPropertySpec} associated with the supplied node type and property name.
[ "Returns", "the", "{" ]
train
https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/build/NFBuildGraph.java#L142-L146
arquillian/arquillian-cube
kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java
KuberntesServiceUrlResourceProvider.getPath
private static String getPath(Service service, Annotation... qualifiers) { """ Find the path to use . Uses java annotations first and if not found, uses kubernetes annotations on the service object. @param service The target service. @param qualifiers The set of qualifiers. @return Returns the resolved p...
java
private static String getPath(Service service, Annotation... qualifiers) { for (Annotation q : qualifiers) { if (q instanceof Scheme) { return ((Scheme) q).value(); } } if (service.getMetadata() != null && service.getMetadata().getAnnotations() != null) {...
[ "private", "static", "String", "getPath", "(", "Service", "service", ",", "Annotation", "...", "qualifiers", ")", "{", "for", "(", "Annotation", "q", ":", "qualifiers", ")", "{", "if", "(", "q", "instanceof", "Scheme", ")", "{", "return", "(", "(", "Sche...
Find the path to use . Uses java annotations first and if not found, uses kubernetes annotations on the service object. @param service The target service. @param qualifiers The set of qualifiers. @return Returns the resolved path of '/' as a fallback.
[ "Find", "the", "path", "to", "use", ".", "Uses", "java", "annotations", "first", "and", "if", "not", "found", "uses", "kubernetes", "annotations", "on", "the", "service", "object", "." ]
train
https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L212-L226
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StorageReadManager.java
StorageReadManager.executeStorageRead
private void executeStorageRead(Request request) { """ Executes the Storage Read for the given request. @param request The request. """ try { byte[] buffer = new byte[request.length]; getHandle() .thenComposeAsync(handle -> this.storage.read(handle, reques...
java
private void executeStorageRead(Request request) { try { byte[] buffer = new byte[request.length]; getHandle() .thenComposeAsync(handle -> this.storage.read(handle, request.offset, buffer, 0, buffer.length, request.getTimeout()), this.executor) .th...
[ "private", "void", "executeStorageRead", "(", "Request", "request", ")", "{", "try", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "request", ".", "length", "]", ";", "getHandle", "(", ")", ".", "thenComposeAsync", "(", "handle", "->", "this"...
Executes the Storage Read for the given request. @param request The request.
[ "Executes", "the", "Storage", "Read", "for", "the", "given", "request", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StorageReadManager.java#L132-L154
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java
DomHelper.moveElement
public boolean moveElement(String name, Object sourceParent, Object targetParent) { """ Move an element from on group to another. The elements name will remain the same. @param name The name of the element within the sourceParent group. @param sourceParent The original parent group of the element. @param ta...
java
public boolean moveElement(String name, Object sourceParent, Object targetParent) { Element sourceGroup = null; Element targetGroup = null; Element element = null; if (sourceParent != null) { sourceGroup = getGroup(sourceParent); element = getElement(sourceParent, name); } if (targetParent != null) { ...
[ "public", "boolean", "moveElement", "(", "String", "name", ",", "Object", "sourceParent", ",", "Object", "targetParent", ")", "{", "Element", "sourceGroup", "=", "null", ";", "Element", "targetGroup", "=", "null", ";", "Element", "element", "=", "null", ";", ...
Move an element from on group to another. The elements name will remain the same. @param name The name of the element within the sourceParent group. @param sourceParent The original parent group of the element. @param targetParent The target parent group for the element. @return true when move was successful
[ "Move", "an", "element", "from", "on", "group", "to", "another", ".", "The", "elements", "name", "will", "remain", "the", "same", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L284-L308
prestodb/presto
presto-spi/src/main/java/com/facebook/presto/spi/HostAddress.java
HostAddress.fromParts
public static HostAddress fromParts(String host, int port) { """ Build a HostAddress instance from separate host and port values. <p> <p>Note: Non-bracketed IPv6 literals are allowed. @param host the host string to parse. Must not contain a port number. @param port a port number from [0..65535] @return if ...
java
public static HostAddress fromParts(String host, int port) { if (!isValidPort(port)) { throw new IllegalArgumentException("Port is invalid: " + port); } HostAddress parsedHost = fromString(host); if (parsedHost.hasPort()) { throw new IllegalArgumentException("...
[ "public", "static", "HostAddress", "fromParts", "(", "String", "host", ",", "int", "port", ")", "{", "if", "(", "!", "isValidPort", "(", "port", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Port is invalid: \"", "+", "port", ")", ";", ...
Build a HostAddress instance from separate host and port values. <p> <p>Note: Non-bracketed IPv6 literals are allowed. @param host the host string to parse. Must not contain a port number. @param port a port number from [0..65535] @return if parsing was successful, a populated HostAddress object. @throws IllegalArgum...
[ "Build", "a", "HostAddress", "instance", "from", "separate", "host", "and", "port", "values", ".", "<p", ">", "<p", ">", "Note", ":", "Non", "-", "bracketed", "IPv6", "literals", "are", "allowed", "." ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/HostAddress.java#L136-L146
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemRenderer.java
WMenuItemRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { """ Paints the given WMenuItem. @param component the WMenuItem to paint. @param renderContext the RenderContext to paint to. """ WMenuItem item = (WMenuItem) component; XmlStringBuilder xml = renderCo...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WMenuItem item = (WMenuItem) component; XmlStringBuilder xml = renderContext.getWriter(); xml.appendTagOpen("ui:menuitem"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("class",...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WMenuItem", "item", "=", "(", "WMenuItem", ")", "component", ";", "XmlStringBuilder", "xml", "=", "renderContex...
Paints the given WMenuItem. @param component the WMenuItem to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WMenuItem", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuItemRenderer.java#L50-L84
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnection.java
SibRaConnection.createConsumerSession
@Override public ConsumerSession createConsumerSession( final SIDestinationAddress destAddr, final DestinationType destType, final SelectionCriteria criteria, final Reli...
java
@Override public ConsumerSession createConsumerSession( final SIDestinationAddress destAddr, final DestinationType destType, final SelectionCriteria criteria, final Reli...
[ "@", "Override", "public", "ConsumerSession", "createConsumerSession", "(", "final", "SIDestinationAddress", "destAddr", ",", "final", "DestinationType", "destType", ",", "final", "SelectionCriteria", "criteria", ",", "final", "Reliability", "reliability", ",", "final", ...
Creates a consumer session. Checks that the connection is valid and then delegates. Wraps the <code>ConsumerSession</code> returned from the delegate in a <code>SibRaConsumerSession</code>. @param destAddr the address of the destination @param destType the destination type @param criteria the selection criteria @param...
[ "Creates", "a", "consumer", "session", ".", "Checks", "that", "the", "connection", "is", "valid", "and", "then", "delegates", ".", "Wraps", "the", "<code", ">", "ConsumerSession<", "/", "code", ">", "returned", "from", "the", "delegate", "in", "a", "<code", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnection.java#L679-L703
unbescape/unbescape
src/main/java/org/unbescape/javascript/JavaScriptEscape.java
JavaScriptEscape.unescapeJavaScript
public static void unescapeJavaScript(final char[] text, final int offset, final int len, final Writer writer) throws IOException { """ <p> Perform a JavaScript <strong>unescape</strong> operation on a <tt>char[]</tt> input. </p> <p> No additional configuration argumen...
java
public static void unescapeJavaScript(final char[] text, final int offset, final int len, final Writer writer) throws IOException{ if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } final int tex...
[ "public", "static", "void", "unescapeJavaScript", "(", "final", "char", "[", "]", "text", ",", "final", "int", "offset", ",", "final", "int", "len", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", "...
<p> Perform a JavaScript <strong>unescape</strong> operation on a <tt>char[]</tt> input. </p> <p> No additional configuration arguments are required. Unescape operations will always perform <em>complete</em> JavaScript unescape of SECs, x-based, u-based and octal escapes. </p> <p> This method is <strong>thread-safe</st...
[ "<p", ">", "Perform", "a", "JavaScript", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "char", "[]", "<", "/", "tt", ">", "input", ".", "<", "/", "p", ">", "<p", ">", "No", "additional", "configuration", "argume...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/javascript/JavaScriptEscape.java#L1065-L1086
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.getFieldQuiet
public MethodHandle getFieldQuiet(MethodHandles.Lookup lookup, String name) { """ Apply the chain of transforms and bind them to an object field retrieval specified using the end signature plus the given class and name. The field must match the end signature's return value and the end signature must take the ta...
java
public MethodHandle getFieldQuiet(MethodHandles.Lookup lookup, String name) { try { return getField(lookup, name); } catch (IllegalAccessException | NoSuchFieldException e) { throw new InvalidTransformException(e); } }
[ "public", "MethodHandle", "getFieldQuiet", "(", "MethodHandles", ".", "Lookup", "lookup", ",", "String", "name", ")", "{", "try", "{", "return", "getField", "(", "lookup", ",", "name", ")", ";", "}", "catch", "(", "IllegalAccessException", "|", "NoSuchFieldExc...
Apply the chain of transforms and bind them to an object field retrieval specified using the end signature plus the given class and name. The field must match the end signature's return value and the end signature must take the target class or a subclass as its only argument. If the final handle's type does not exactl...
[ "Apply", "the", "chain", "of", "transforms", "and", "bind", "them", "to", "an", "object", "field", "retrieval", "specified", "using", "the", "end", "signature", "plus", "the", "given", "class", "and", "name", ".", "The", "field", "must", "match", "the", "e...
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1407-L1413
google/error-prone-javac
src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/Scan.java
Scan.addInterfaces
void addInterfaces(Deque<String> intfs, ClassFile cf) throws ConstantPoolException { """ Adds all interfaces from this class to the deque of interfaces. @param intfs the deque of interfaces @param cf the ClassFile of this class @throws ConstantPoolException if a constant pool entry cannot be found...
java
void addInterfaces(Deque<String> intfs, ClassFile cf) throws ConstantPoolException { int count = cf.interfaces.length; for (int i = 0; i < count; i++) { intfs.addLast(cf.getInterfaceName(i)); } }
[ "void", "addInterfaces", "(", "Deque", "<", "String", ">", "intfs", ",", "ClassFile", "cf", ")", "throws", "ConstantPoolException", "{", "int", "count", "=", "cf", ".", "interfaces", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", ...
Adds all interfaces from this class to the deque of interfaces. @param intfs the deque of interfaces @param cf the ClassFile of this class @throws ConstantPoolException if a constant pool entry cannot be found
[ "Adds", "all", "interfaces", "from", "this", "class", "to", "the", "deque", "of", "interfaces", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/Scan.java#L294-L300
apache/incubator-shardingsphere
sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/spring/boot/util/DataSourceUtil.java
DataSourceUtil.getDataSource
public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties) throws ReflectiveOperationException { """ Get data source. @param dataSourceClassName data source class name @param dataSourceProperties data source properties @return data source instance ...
java
public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties) throws ReflectiveOperationException { DataSource result = (DataSource) Class.forName(dataSourceClassName).newInstance(); for (Entry<String, Object> entry : dataSourceProperties.entryS...
[ "public", "static", "DataSource", "getDataSource", "(", "final", "String", "dataSourceClassName", ",", "final", "Map", "<", "String", ",", "Object", ">", "dataSourceProperties", ")", "throws", "ReflectiveOperationException", "{", "DataSource", "result", "=", "(", "D...
Get data source. @param dataSourceClassName data source class name @param dataSourceProperties data source properties @return data source instance @throws ReflectiveOperationException reflective operation exception
[ "Get", "data", "source", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/spring/boot/util/DataSourceUtil.java#L55-L61
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/MediaservicesInner.java
MediaservicesInner.createOrUpdateAsync
public Observable<MediaServiceInner> createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { """ Create or update a Media Services account. Creates or updates a Media Services account. @param resourceGroupName The name of the resource group within the Azure subscriptio...
java
public Observable<MediaServiceInner> createOrUpdateAsync(String resourceGroupName, String accountName, MediaServiceInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1<ServiceResponse<MediaServiceInner>, MediaServiceInner>() { @O...
[ "public", "Observable", "<", "MediaServiceInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "MediaServiceInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",...
Create or update a Media Services account. Creates or updates a Media Services account. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param parameters The request parameters @throws IllegalArgumentException thrown if paramete...
[ "Create", "or", "update", "a", "Media", "Services", "account", ".", "Creates", "or", "updates", "a", "Media", "Services", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/MediaservicesInner.java#L362-L369
JOML-CI/JOML
src/org/joml/Quaterniond.java
Quaterniond.fromAxisAngleDeg
public Quaterniond fromAxisAngleDeg(double axisX, double axisY, double axisZ, double angle) { """ Set this quaternion to be a representation of the supplied axis and angle (in degrees). @param axisX the x component of the rotation axis @param axisY the y component of the rotation axis @param axisZ the z c...
java
public Quaterniond fromAxisAngleDeg(double axisX, double axisY, double axisZ, double angle) { return fromAxisAngleRad(axisX, axisY, axisZ, Math.toRadians(angle)); }
[ "public", "Quaterniond", "fromAxisAngleDeg", "(", "double", "axisX", ",", "double", "axisY", ",", "double", "axisZ", ",", "double", "angle", ")", "{", "return", "fromAxisAngleRad", "(", "axisX", ",", "axisY", ",", "axisZ", ",", "Math", ".", "toRadians", "(",...
Set this quaternion to be a representation of the supplied axis and angle (in degrees). @param axisX the x component of the rotation axis @param axisY the y component of the rotation axis @param axisZ the z component of the rotation axis @param angle the angle in radians @return this
[ "Set", "this", "quaternion", "to", "be", "a", "representation", "of", "the", "supplied", "axis", "and", "angle", "(", "in", "degrees", ")", "." ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L704-L706
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/Server.java
Server.addWebApplications
public WebApplicationContext[] addWebApplications(String host, String webapps, String defaults, boolean extract) throws IOException { """ Add Web...
java
public WebApplicationContext[] addWebApplications(String host, String webapps, String defaults, boolean extract) throws IOException { retu...
[ "public", "WebApplicationContext", "[", "]", "addWebApplications", "(", "String", "host", ",", "String", "webapps", ",", "String", "defaults", ",", "boolean", "extract", ")", "throws", "IOException", "{", "return", "addWebApplications", "(", "host", ",", "webapps"...
Add Web Applications. Add auto webapplications to the server. The name of the webapp directory or war is used as the context name. If the webapp matches the rootWebApp it is added as the "/" context. @param host Virtual host name or null @param webapps Directory file name or URL to look for auto webapplication. @param...
[ "Add", "Web", "Applications", ".", "Add", "auto", "webapplications", "to", "the", "server", ".", "The", "name", "of", "the", "webapp", "directory", "or", "war", "is", "used", "as", "the", "context", "name", ".", "If", "the", "webapp", "matches", "the", "...
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/Server.java#L331-L338
apache/reef
lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/avro/ProtocolSerializer.java
ProtocolSerializer.write
public byte[] write(final SpecificRecord message, final long sequence) { """ Marshall the input message to a byte array. @param message The message to be marshaled into a byte array. @param sequence The unique sequence number of the message. """ final String classId = getClassId(message.getClass()); ...
java
public byte[] write(final SpecificRecord message, final long sequence) { final String classId = getClassId(message.getClass()); try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { LOG.log(Level.FINEST, "Serializing message: {0}", classId); final IMessageSerializer seria...
[ "public", "byte", "[", "]", "write", "(", "final", "SpecificRecord", "message", ",", "final", "long", "sequence", ")", "{", "final", "String", "classId", "=", "getClassId", "(", "message", ".", "getClass", "(", ")", ")", ";", "try", "(", "final", "ByteAr...
Marshall the input message to a byte array. @param message The message to be marshaled into a byte array. @param sequence The unique sequence number of the message.
[ "Marshall", "the", "input", "message", "to", "a", "byte", "array", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/avro/ProtocolSerializer.java#L111-L128
logic-ng/LogicNG
src/main/java/org/logicng/backbones/MiniSatBackbone.java
MiniSatBackbone.isUnit
private boolean isUnit(final int lit, final MSClause clause) { """ Tests the given literal whether it is unit in the given clause. @param lit literal to test @param clause clause containing the literal @return {@code true} if the literal is unit, {@code false} otherwise """ for (int i = 0; i < cl...
java
private boolean isUnit(final int lit, final MSClause clause) { for (int i = 0; i < clause.size(); ++i) { final int clauseLit = clause.get(i); if (lit != clauseLit && this.model.get(var(clauseLit)) != sign(clauseLit)) { return false; } } return ...
[ "private", "boolean", "isUnit", "(", "final", "int", "lit", ",", "final", "MSClause", "clause", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "clause", ".", "size", "(", ")", ";", "++", "i", ")", "{", "final", "int", "clauseLit", "="...
Tests the given literal whether it is unit in the given clause. @param lit literal to test @param clause clause containing the literal @return {@code true} if the literal is unit, {@code false} otherwise
[ "Tests", "the", "given", "literal", "whether", "it", "is", "unit", "in", "the", "given", "clause", "." ]
train
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/MiniSatBackbone.java#L281-L289
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/av/MicrophoneEncoder.java
MicrophoneEncoder.getJitterFreePTS
private long getJitterFreePTS(long bufferPts, long bufferSamplesNum) { """ Ensures that each audio pts differs by a constant amount from the previous one. @param bufferPts presentation timestamp in us @param bufferSamplesNum the number of samples of the buffer's frame @return """ long correctedPts =...
java
private long getJitterFreePTS(long bufferPts, long bufferSamplesNum) { long correctedPts = 0; long bufferDuration = (1000000 * bufferSamplesNum) / (mEncoderCore.mSampleRate); bufferPts -= bufferDuration; // accounts for the delay of acquiring the audio buffer if (totalSamplesNum == 0) { ...
[ "private", "long", "getJitterFreePTS", "(", "long", "bufferPts", ",", "long", "bufferSamplesNum", ")", "{", "long", "correctedPts", "=", "0", ";", "long", "bufferDuration", "=", "(", "1000000", "*", "bufferSamplesNum", ")", "/", "(", "mEncoderCore", ".", "mSam...
Ensures that each audio pts differs by a constant amount from the previous one. @param bufferPts presentation timestamp in us @param bufferSamplesNum the number of samples of the buffer's frame @return
[ "Ensures", "that", "each", "audio", "pts", "differs", "by", "a", "constant", "amount", "from", "the", "previous", "one", "." ]
train
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/MicrophoneEncoder.java#L207-L225
alkacon/opencms-core
src/org/opencms/gwt/CmsIconUtil.java
CmsIconUtil.getResourceIconClasses
private static String getResourceIconClasses(String resourceTypeName, String fileName, boolean small) { """ Returns the CSS classes of the resource icon for the given resource type and filename.<p> Use this the resource type and filename is known.<p> @param resourceTypeName the resource type name @param fil...
java
private static String getResourceIconClasses(String resourceTypeName, String fileName, boolean small) { StringBuffer sb = new StringBuffer(CmsGwtConstants.TYPE_ICON_CLASS); sb.append(" ").append(getResourceTypeIconClass(resourceTypeName, small)).append(" ").append( getFileTypeIconClass(reso...
[ "private", "static", "String", "getResourceIconClasses", "(", "String", "resourceTypeName", ",", "String", "fileName", ",", "boolean", "small", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "CmsGwtConstants", ".", "TYPE_ICON_CLASS", ")", ";", "s...
Returns the CSS classes of the resource icon for the given resource type and filename.<p> Use this the resource type and filename is known.<p> @param resourceTypeName the resource type name @param fileName the filename @param small if true, get the icon classes for the small icon, else for the biggest one available ...
[ "Returns", "the", "CSS", "classes", "of", "the", "resource", "icon", "for", "the", "given", "resource", "type", "and", "filename", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsIconUtil.java#L494-L500
livetribe/livetribe-slp
core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java
DirectoryAgentInfo.getUnicastPort
public int getUnicastPort(boolean tcp, int defaultPort) { """ Returns the unicast port this DirectoryAgent is listening on, if this information is available in the Attributes via the dedicated tags. <br /> If the unicast port information is not available in the Attributes, returns the given port. @param tcp ...
java
public int getUnicastPort(boolean tcp, int defaultPort) { if (tcp && attributes.containsTag(TCP_PORT_TAG)) return (Integer)attributes.valueFor(TCP_PORT_TAG).getValue(); return defaultPort; }
[ "public", "int", "getUnicastPort", "(", "boolean", "tcp", ",", "int", "defaultPort", ")", "{", "if", "(", "tcp", "&&", "attributes", ".", "containsTag", "(", "TCP_PORT_TAG", ")", ")", "return", "(", "Integer", ")", "attributes", ".", "valueFor", "(", "TCP_...
Returns the unicast port this DirectoryAgent is listening on, if this information is available in the Attributes via the dedicated tags. <br /> If the unicast port information is not available in the Attributes, returns the given port. @param tcp whether the unicast port to return must be a TCP port or not @pa...
[ "Returns", "the", "unicast", "port", "this", "DirectoryAgent", "is", "listening", "on", "if", "this", "information", "is", "available", "in", "the", "Attributes", "via", "the", "dedicated", "tags", ".", "<br", "/", ">", "If", "the", "unicast", "port", "infor...
train
https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java#L214-L218
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java
AbstractRegionPainter.createVerticalGradient
protected Paint createVerticalGradient(Shape s, TwoColors colors) { """ Creates a simple vertical gradient using the shape for bounds and the colors for top and bottom colors. @param s the shape to use for bounds. @param colors the colors to use for the gradient. @return the gradient. """ ...
java
protected Paint createVerticalGradient(Shape s, TwoColors colors) { Rectangle2D bounds = s.getBounds2D(); float xCenter = (float) bounds.getCenterX(); float yMin = (float) bounds.getMinY(); float yMax = (float) bounds.getMaxY(); return createGradient(xCe...
[ "protected", "Paint", "createVerticalGradient", "(", "Shape", "s", ",", "TwoColors", "colors", ")", "{", "Rectangle2D", "bounds", "=", "s", ".", "getBounds2D", "(", ")", ";", "float", "xCenter", "=", "(", "float", ")", "bounds", ".", "getCenterX", "(", ")"...
Creates a simple vertical gradient using the shape for bounds and the colors for top and bottom colors. @param s the shape to use for bounds. @param colors the colors to use for the gradient. @return the gradient.
[ "Creates", "a", "simple", "vertical", "gradient", "using", "the", "shape", "for", "bounds", "and", "the", "colors", "for", "top", "and", "bottom", "colors", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java#L376-L383
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java
Exec.utilityAs
public static Execed utilityAs(String as, String... command) throws IOException { """ Runs a command in "utility" mode: redirecting stderr to stdout and optionally executing as a different user (eg root) @param as @param command @return @throws IOException """ return utilityAs(as, Arrays.asList(com...
java
public static Execed utilityAs(String as, String... command) throws IOException { return utilityAs(as, Arrays.asList(command)); }
[ "public", "static", "Execed", "utilityAs", "(", "String", "as", ",", "String", "...", "command", ")", "throws", "IOException", "{", "return", "utilityAs", "(", "as", ",", "Arrays", ".", "asList", "(", "command", ")", ")", ";", "}" ]
Runs a command in "utility" mode: redirecting stderr to stdout and optionally executing as a different user (eg root) @param as @param command @return @throws IOException
[ "Runs", "a", "command", "in", "utility", "mode", ":", "redirecting", "stderr", "to", "stdout", "and", "optionally", "executing", "as", "a", "different", "user", "(", "eg", "root", ")" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java#L352-L355
aws/aws-sdk-java
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java
Utils.getFileNamePrefix
public static String getFileNamePrefix(ServiceModel serviceModel, CustomizationConfig customizationConfig) { """ * @param serviceModel Service model to get prefix for. * @return Prefix to use when writing model files (service and intermediate). """ if (customizationConfig.isUseUidAsFilePrefix() && ser...
java
public static String getFileNamePrefix(ServiceModel serviceModel, CustomizationConfig customizationConfig) { if (customizationConfig.isUseUidAsFilePrefix() && serviceModel.getMetadata().getUid() != null) { return serviceModel.getMetadata().getUid(); } return String.format("%s-%s", s...
[ "public", "static", "String", "getFileNamePrefix", "(", "ServiceModel", "serviceModel", ",", "CustomizationConfig", "customizationConfig", ")", "{", "if", "(", "customizationConfig", ".", "isUseUidAsFilePrefix", "(", ")", "&&", "serviceModel", ".", "getMetadata", "(", ...
* @param serviceModel Service model to get prefix for. * @return Prefix to use when writing model files (service and intermediate).
[ "*" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L113-L119
lucee/Lucee
core/src/main/java/lucee/commons/io/res/type/cache/CacheResourceProvider.java
CacheResourceProvider.createCore
CacheResourceCore createCore(String path, String name, int type) throws IOException { """ create a new core @param path @param type @return created core @throws IOException """ CacheResourceCore value = new CacheResourceCore(type, path, name); getCache().put(toKey(path, name), value, null, null); retu...
java
CacheResourceCore createCore(String path, String name, int type) throws IOException { CacheResourceCore value = new CacheResourceCore(type, path, name); getCache().put(toKey(path, name), value, null, null); return value; }
[ "CacheResourceCore", "createCore", "(", "String", "path", ",", "String", "name", ",", "int", "type", ")", "throws", "IOException", "{", "CacheResourceCore", "value", "=", "new", "CacheResourceCore", "(", "type", ",", "path", ",", "name", ")", ";", "getCache", ...
create a new core @param path @param type @return created core @throws IOException
[ "create", "a", "new", "core" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/type/cache/CacheResourceProvider.java#L153-L157
undertow-io/undertow
core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java
HttpContinue.sendContinueResponse
public static void sendContinueResponse(final HttpServerExchange exchange, final IoCallback callback) { """ Sends a continuation using async IO, and calls back when it is complete. @param exchange The exchange @param callback The completion callback """ if (!exchange.isResponseChannelAvailable()) {...
java
public static void sendContinueResponse(final HttpServerExchange exchange, final IoCallback callback) { if (!exchange.isResponseChannelAvailable()) { callback.onException(exchange, null, UndertowMessages.MESSAGES.cannotSendContinueResponse()); return; } internalSendContin...
[ "public", "static", "void", "sendContinueResponse", "(", "final", "HttpServerExchange", "exchange", ",", "final", "IoCallback", "callback", ")", "{", "if", "(", "!", "exchange", ".", "isResponseChannelAvailable", "(", ")", ")", "{", "callback", ".", "onException",...
Sends a continuation using async IO, and calls back when it is complete. @param exchange The exchange @param callback The completion callback
[ "Sends", "a", "continuation", "using", "async", "IO", "and", "calls", "back", "when", "it", "is", "complete", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java#L101-L107
strator-dev/greenpepper
greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/AbstractJarMojo.java
AbstractJarMojo.getJarFile
protected static File getJarFile( File basedir, String finalName, String classifier ) { """ <p>getJarFile.</p> @param basedir a {@link java.io.File} object. @param finalName a {@link java.lang.String} object. @param classifier a {@link java.lang.String} object. @return a {@link java.io.File} object. """ ...
java
protected static File getJarFile( File basedir, String finalName, String classifier ) { if ( classifier == null ) { classifier = ""; } else if ( classifier.trim().length() > 0 && !classifier.startsWith( "-" ) ) { classifier = "-" + classifier; ...
[ "protected", "static", "File", "getJarFile", "(", "File", "basedir", ",", "String", "finalName", ",", "String", "classifier", ")", "{", "if", "(", "classifier", "==", "null", ")", "{", "classifier", "=", "\"\"", ";", "}", "else", "if", "(", "classifier", ...
<p>getJarFile.</p> @param basedir a {@link java.io.File} object. @param finalName a {@link java.lang.String} object. @param classifier a {@link java.lang.String} object. @return a {@link java.io.File} object.
[ "<p", ">", "getJarFile", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/AbstractJarMojo.java#L138-L150
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.getMinStartPosition
public int getMinStartPosition(int docId, int position) throws IOException { """ Gets the min start position. @param docId the doc id @param position the position @return the min start position @throws IOException Signals that an I/O exception has occurred. """ if (ignoreSpans != null && docId == cur...
java
public int getMinStartPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } else { computeFullStartPo...
[ "public", "int", "getMinStartPosition", "(", "int", "docId", ",", "int", "position", ")", "throws", "IOException", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "docId", "==", "currentDocId", ")", "{", "if", "(", "position", "<", "minimumPosition", ")",...
Gets the min start position. @param docId the doc id @param position the position @return the min start position @throws IOException Signals that an I/O exception has occurred.
[ "Gets", "the", "min", "start", "position", "." ]
train
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L118-L134
fcrepo3/fcrepo
fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/finder/policy/GenericPolicyFinderModule.java
GenericPolicyFinderModule.findPolicy
@Override public PolicyFinderResult findPolicy(EvaluationCtx context) { """ Finds a policy based on a request's context. If more than one policy matches, then this either returns an error or a new policy wrapping the multiple policies (depending on which constructor was used to construct this instance). ...
java
@Override public PolicyFinderResult findPolicy(EvaluationCtx context) { try { AbstractPolicy policy = m_policyManager.getPolicy(context); if (policy == null) { return new PolicyFinderResult(); } return new PolicyFinderResult(policy); ...
[ "@", "Override", "public", "PolicyFinderResult", "findPolicy", "(", "EvaluationCtx", "context", ")", "{", "try", "{", "AbstractPolicy", "policy", "=", "m_policyManager", ".", "getPolicy", "(", "context", ")", ";", "if", "(", "policy", "==", "null", ")", "{", ...
Finds a policy based on a request's context. If more than one policy matches, then this either returns an error or a new policy wrapping the multiple policies (depending on which constructor was used to construct this instance). @param context the representation of the request data @return the result of trying to find...
[ "Finds", "a", "policy", "based", "on", "a", "request", "s", "context", ".", "If", "more", "than", "one", "policy", "matches", "then", "this", "either", "returns", "an", "error", "or", "a", "new", "policy", "wrapping", "the", "multiple", "policies", "(", ...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/finder/policy/GenericPolicyFinderModule.java#L94-L115
ansell/restlet-utils
src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java
FixedRedirectCookieAuthenticator.challenge
@Override public void challenge(final Response response, final boolean stale) { """ This method should be overridden to return a login form representation. """ this.log.debug("Calling super.challenge"); super.challenge(response, stale); }
java
@Override public void challenge(final Response response, final boolean stale) { this.log.debug("Calling super.challenge"); super.challenge(response, stale); }
[ "@", "Override", "public", "void", "challenge", "(", "final", "Response", "response", ",", "final", "boolean", "stale", ")", "{", "this", ".", "log", ".", "debug", "(", "\"Calling super.challenge\"", ")", ";", "super", ".", "challenge", "(", "response", ",",...
This method should be overridden to return a login form representation.
[ "This", "method", "should", "be", "overridden", "to", "return", "a", "login", "form", "representation", "." ]
train
https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java#L364-L369
javajazz/jazz
src/main/lombok/de/scravy/jazz/Jazz.java
Jazz.animate
public static Window animate(final String title, final int width, final int height, final Animation animation) { """ Displays an {@link Animation} in a single window. You can open multiple windows using this method. @since 1.0.0 @param title The title of the displayed window. @param width The...
java
public static Window animate(final String title, final int width, final int height, final Animation animation) { return play(title, width, height, animation); }
[ "public", "static", "Window", "animate", "(", "final", "String", "title", ",", "final", "int", "width", ",", "final", "int", "height", ",", "final", "Animation", "animation", ")", "{", "return", "play", "(", "title", ",", "width", ",", "height", ",", "an...
Displays an {@link Animation} in a single window. You can open multiple windows using this method. @since 1.0.0 @param title The title of the displayed window. @param width The width of the displayed window. @param height The height of the displayed window. @param animation The animation to be shown in the displayed ...
[ "Displays", "an", "{", "@link", "Animation", "}", "in", "a", "single", "window", "." ]
train
https://github.com/javajazz/jazz/blob/f4a1a601700442b8ec6a947f5772a96dbf5dc44b/src/main/lombok/de/scravy/jazz/Jazz.java#L253-L257
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java
IconProviderBuilder.withSide
public IconProviderBuilder withSide(EnumFacing side, Icon icon) { """ Sets the {@link Icon} to use for specific side. @param side the side @param icon the icon @return the icon provider builder """ setType(Type.SIDES); sidesIcons.put(Objects.requireNonNull(side), icon); return this; }
java
public IconProviderBuilder withSide(EnumFacing side, Icon icon) { setType(Type.SIDES); sidesIcons.put(Objects.requireNonNull(side), icon); return this; }
[ "public", "IconProviderBuilder", "withSide", "(", "EnumFacing", "side", ",", "Icon", "icon", ")", "{", "setType", "(", "Type", ".", "SIDES", ")", ";", "sidesIcons", ".", "put", "(", "Objects", ".", "requireNonNull", "(", "side", ")", ",", "icon", ")", ";...
Sets the {@link Icon} to use for specific side. @param side the side @param icon the icon @return the icon provider builder
[ "Sets", "the", "{", "@link", "Icon", "}", "to", "use", "for", "specific", "side", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java#L135-L140
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java
CmsForm.defaultHandleValueChange
protected void defaultHandleValueChange(I_CmsFormField field, String newValue, boolean inhibitValidation) { """ Default handler for value change events of form fields.<p> @param field the form field for which the event has been fired @param inhibitValidation prevents validation of the edited field @param ne...
java
protected void defaultHandleValueChange(I_CmsFormField field, String newValue, boolean inhibitValidation) { m_editedFields.add(field.getId()); I_CmsStringModel model = field.getModel(); if (model != null) { model.setValue(newValue, true); } field.setValidationStatus...
[ "protected", "void", "defaultHandleValueChange", "(", "I_CmsFormField", "field", ",", "String", "newValue", ",", "boolean", "inhibitValidation", ")", "{", "m_editedFields", ".", "add", "(", "field", ".", "getId", "(", ")", ")", ";", "I_CmsStringModel", "model", ...
Default handler for value change events of form fields.<p> @param field the form field for which the event has been fired @param inhibitValidation prevents validation of the edited field @param newValue the new value
[ "Default", "handler", "for", "value", "change", "events", "of", "form", "fields", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L461-L480
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/audit_log.java
audit_log.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ audit_log_responses result = (audit_log_responses) service.get_payload_...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { audit_log_responses result = (audit_log_responses) service.get_payload_formatter().string_to_resource(audit_log_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESS...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "audit_log_responses", "result", "=", "(", "audit_log_responses", ")", "service", ".", "get_payload_formatter"...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/audit_log.java#L317-L334
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java
DataFrameJoiner.inner
public Table inner(Table table2, boolean outer, boolean allowDuplicateColumnNames, String... col2Names) { """ Joins the joiner to the table2, using the given columns for the second table and returns the resulting table @param table2 The table to join with @param outer True if this join is actually an ou...
java
public Table inner(Table table2, boolean outer, boolean allowDuplicateColumnNames, String... col2Names) { Table joinedTable; joinedTable = joinInternal(table, table2, outer, allowDuplicateColumnNames, col2Names); return joinedTable; }
[ "public", "Table", "inner", "(", "Table", "table2", ",", "boolean", "outer", ",", "boolean", "allowDuplicateColumnNames", ",", "String", "...", "col2Names", ")", "{", "Table", "joinedTable", ";", "joinedTable", "=", "joinInternal", "(", "table", ",", "table2", ...
Joins the joiner to the table2, using the given columns for the second table and returns the resulting table @param table2 The table to join with @param outer True if this join is actually an outer join, left or right or full, otherwise false. @param allowDuplicateColumnNames if {@code false} the join will fail...
[ "Joins", "the", "joiner", "to", "the", "table2", "using", "the", "given", "columns", "for", "the", "second", "table", "and", "returns", "the", "resulting", "table" ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L158-L162
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java
DTMDocumentImpl.getAttributeNode
public int getAttributeNode(int nodeHandle, String namespaceURI, String name) { """ Retrieves an attribute node by by qualified name and namespace URI. @param nodeHandle int Handle of the node upon which to look up this attribute. @param namespaceURI The namespace URI of the attribute to retrieve, or null. @...
java
public int getAttributeNode(int nodeHandle, String namespaceURI, String name) { int nsIndex = m_nsNames.stringToIndex(namespaceURI), nameIndex = m_localNames.stringToIndex(name); nodeHandle &= NODEHANDLE_MASK; ...
[ "public", "int", "getAttributeNode", "(", "int", "nodeHandle", ",", "String", "namespaceURI", ",", "String", "name", ")", "{", "int", "nsIndex", "=", "m_nsNames", ".", "stringToIndex", "(", "namespaceURI", ")", ",", "nameIndex", "=", "m_localNames", ".", "stri...
Retrieves an attribute node by by qualified name and namespace URI. @param nodeHandle int Handle of the node upon which to look up this attribute. @param namespaceURI The namespace URI of the attribute to retrieve, or null. @param name The local name of the attribute to retrieve. @return The attribute node handle with...
[ "Retrieves", "an", "attribute", "node", "by", "by", "qualified", "name", "and", "namespace", "URI", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java#L1086-L1104
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/CircuitsConfig.java
CircuitsConfig.exports
public static void exports(Media media, Collection<Media> levels, Media sheetsConfig, Media groupsConfig) { """ Export all circuits to an XML file. @param media The export output (must not be <code>null</code>). @param levels The level rips used (must not be <code>null</code>). @param sheetsConfig The sheets ...
java
public static void exports(Media media, Collection<Media> levels, Media sheetsConfig, Media groupsConfig) { Check.notNull(media); Check.notNull(levels); Check.notNull(sheetsConfig); Check.notNull(groupsConfig); final CircuitsExtractor extractor = new CircuitsExtractor...
[ "public", "static", "void", "exports", "(", "Media", "media", ",", "Collection", "<", "Media", ">", "levels", ",", "Media", "sheetsConfig", ",", "Media", "groupsConfig", ")", "{", "Check", ".", "notNull", "(", "media", ")", ";", "Check", ".", "notNull", ...
Export all circuits to an XML file. @param media The export output (must not be <code>null</code>). @param levels The level rips used (must not be <code>null</code>). @param sheetsConfig The sheets media (must not be <code>null</code>). @param groupsConfig The groups media (must not be <code>null</code>). @throws Lion...
[ "Export", "all", "circuits", "to", "an", "XML", "file", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/CircuitsConfig.java#L100-L110
bazaarvoice/emodb
uac-api/src/main/java/com/bazaarvoice/emodb/uac/api/UserAccessControlRequest.java
UserAccessControlRequest.setCustomRequestParameter
public void setCustomRequestParameter(String param, String... values) { """ Sets custom request parameters. Custom parameters may include new features not yet officially supported or additional parameters to existing calls not intended for widespread use. As such this method is not typically used by most clien...
java
public void setCustomRequestParameter(String param, String... values) { _customRequestParameters.putAll(param, Arrays.asList(values)); }
[ "public", "void", "setCustomRequestParameter", "(", "String", "param", ",", "String", "...", "values", ")", "{", "_customRequestParameters", ".", "putAll", "(", "param", ",", "Arrays", ".", "asList", "(", "values", ")", ")", ";", "}" ]
Sets custom request parameters. Custom parameters may include new features not yet officially supported or additional parameters to existing calls not intended for widespread use. As such this method is not typically used by most clients. Furthermore, adding additional parameters may cause the request to fail.
[ "Sets", "custom", "request", "parameters", ".", "Custom", "parameters", "may", "include", "new", "features", "not", "yet", "officially", "supported", "or", "additional", "parameters", "to", "existing", "calls", "not", "intended", "for", "widespread", "use", ".", ...
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/uac-api/src/main/java/com/bazaarvoice/emodb/uac/api/UserAccessControlRequest.java#L21-L23
eclipse/xtext-core
org.eclipse.xtext/src/org/eclipse/xtext/validation/NamesAreUniqueValidationHelper.java
NamesAreUniqueValidationHelper.getDuplicateNameErrorMessage
public String getDuplicateNameErrorMessage(IEObjectDescription description, EClass clusterType, EStructuralFeature feature) { """ Build the error message for duplicated names. The default implementation will provider error messages of this form: <ul> <li>Duplicate Entity 'Sample'</li> <li>Duplicate Property 'S...
java
public String getDuplicateNameErrorMessage(IEObjectDescription description, EClass clusterType, EStructuralFeature feature) { EObject object = description.getEObjectOrProxy(); String shortName = String.valueOf(feature != null ? object.eGet(feature) : "<unnamed>"); StringBuilder result = new StringBuilder(64); r...
[ "public", "String", "getDuplicateNameErrorMessage", "(", "IEObjectDescription", "description", ",", "EClass", "clusterType", ",", "EStructuralFeature", "feature", ")", "{", "EObject", "object", "=", "description", ".", "getEObjectOrProxy", "(", ")", ";", "String", "sh...
Build the error message for duplicated names. The default implementation will provider error messages of this form: <ul> <li>Duplicate Entity 'Sample'</li> <li>Duplicate Property 'Sample' in Entity 'EntityName'</li> </ul> If the container information will be helpful to locate the error or to understand the error it wil...
[ "Build", "the", "error", "message", "for", "duplicated", "names", ".", "The", "default", "implementation", "will", "provider", "error", "messages", "of", "this", "form", ":", "<ul", ">", "<li", ">", "Duplicate", "Entity", "Sample", "<", "/", "li", ">", "<l...
train
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/validation/NamesAreUniqueValidationHelper.java#L142-L171
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/Util.java
Util.unsignedBinarySearch
public static int unsignedBinarySearch(final short[] array, final int begin, final int end, final short k) { """ Look for value k in array in the range [begin,end). If the value is found, return its index. If not, return -(i+1) where i is the index where the value would be inserted. The array is assumed to...
java
public static int unsignedBinarySearch(final short[] array, final int begin, final int end, final short k) { if (USE_HYBRID_BINSEARCH) { return hybridUnsignedBinarySearch(array, begin, end, k); } else { return branchyUnsignedBinarySearch(array, begin, end, k); } }
[ "public", "static", "int", "unsignedBinarySearch", "(", "final", "short", "[", "]", "array", ",", "final", "int", "begin", ",", "final", "int", "end", ",", "final", "short", "k", ")", "{", "if", "(", "USE_HYBRID_BINSEARCH", ")", "{", "return", "hybridUnsig...
Look for value k in array in the range [begin,end). If the value is found, return its index. If not, return -(i+1) where i is the index where the value would be inserted. The array is assumed to contain sorted values where shorts are interpreted as unsigned integers. @param array array where we search @param begin fir...
[ "Look", "for", "value", "k", "in", "array", "in", "the", "range", "[", "begin", "end", ")", ".", "If", "the", "value", "is", "found", "return", "its", "index", ".", "If", "not", "return", "-", "(", "i", "+", "1", ")", "where", "i", "is", "the", ...
train
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Util.java#L586-L593
loldevs/riotapi
rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsGameInvitationService.java
LcdsGameInvitationService.createGroupFinderLobby
public LobbyStatus createGroupFinderLobby(long queueId, String uuid) { """ Create a groupfinder lobby @param queueId The target queue @param uuid The uuid for this lobby @return The lobby status """ return client.sendRpcAndWait(SERVICE, "createGroupFinderLobby", queueId, uuid); }
java
public LobbyStatus createGroupFinderLobby(long queueId, String uuid) { return client.sendRpcAndWait(SERVICE, "createGroupFinderLobby", queueId, uuid); }
[ "public", "LobbyStatus", "createGroupFinderLobby", "(", "long", "queueId", ",", "String", "uuid", ")", "{", "return", "client", ".", "sendRpcAndWait", "(", "SERVICE", ",", "\"createGroupFinderLobby\"", ",", "queueId", ",", "uuid", ")", ";", "}" ]
Create a groupfinder lobby @param queueId The target queue @param uuid The uuid for this lobby @return The lobby status
[ "Create", "a", "groupfinder", "lobby" ]
train
https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsGameInvitationService.java#L40-L42
googleapis/google-http-java-client
google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java
XmlNamespaceDictionary.toStringOf
public String toStringOf(String elementName, Object element) { """ Shows a debug string representation of an element data object of key/value pairs. @param element element data object ({@link GenericXml}, {@link Map}, or any object with public fields) @param elementName optional XML element local name prefixe...
java
public String toStringOf(String elementName, Object element) { try { StringWriter writer = new StringWriter(); XmlSerializer serializer = Xml.createSerializer(); serializer.setOutput(writer); serialize(serializer, elementName, element, false); return writer.toString(); } catch (IOE...
[ "public", "String", "toStringOf", "(", "String", "elementName", ",", "Object", "element", ")", "{", "try", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "XmlSerializer", "serializer", "=", "Xml", ".", "createSerializer", "(", ")", ...
Shows a debug string representation of an element data object of key/value pairs. @param element element data object ({@link GenericXml}, {@link Map}, or any object with public fields) @param elementName optional XML element local name prefixed by its namespace alias -- for example {@code "atom:entry"} -- or {@code nu...
[ "Shows", "a", "debug", "string", "representation", "of", "an", "element", "data", "object", "of", "key", "/", "value", "pairs", "." ]
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java#L163-L173
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java
AbstractJSSEProvider.getTrustManagerFactoryInstance
public TrustManagerFactory getTrustManagerFactoryInstance(String trustMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException { """ Get the trust manager factory instance using the provided information. @see com.ibm.websphere.ssl.JSSEProvider#getTrustManagerFactoryInstance() @param t...
java
public TrustManagerFactory getTrustManagerFactoryInstance(String trustMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException { String mgr = trustMgr; String provider = ctxtProvider; if (mgr.indexOf('|') != -1) { String[] trustManagerArray = mgr.split("\\|"...
[ "public", "TrustManagerFactory", "getTrustManagerFactoryInstance", "(", "String", "trustMgr", ",", "String", "ctxtProvider", ")", "throws", "NoSuchAlgorithmException", ",", "NoSuchProviderException", "{", "String", "mgr", "=", "trustMgr", ";", "String", "provider", "=", ...
Get the trust manager factory instance using the provided information. @see com.ibm.websphere.ssl.JSSEProvider#getTrustManagerFactoryInstance() @param trustMgr @param ctxtProvider @return TrustManagerFactory @throws NoSuchAlgorithmException @throws NoSuchProviderException
[ "Get", "the", "trust", "manager", "factory", "instance", "using", "the", "provided", "information", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L682-L697
rhuss/jolokia
agent/core/src/main/java/org/jolokia/backend/Config.java
Config.limitOrNull
private HistoryLimit limitOrNull(int pMaxEntries, long pMaxDuration) { """ The limit or null if the entry should be disabled in the history store """ return pMaxEntries != 0 || pMaxDuration != 0 ? new HistoryLimit(pMaxEntries, pMaxDuration) : null; }
java
private HistoryLimit limitOrNull(int pMaxEntries, long pMaxDuration) { return pMaxEntries != 0 || pMaxDuration != 0 ? new HistoryLimit(pMaxEntries, pMaxDuration) : null; }
[ "private", "HistoryLimit", "limitOrNull", "(", "int", "pMaxEntries", ",", "long", "pMaxDuration", ")", "{", "return", "pMaxEntries", "!=", "0", "||", "pMaxDuration", "!=", "0", "?", "new", "HistoryLimit", "(", "pMaxEntries", ",", "pMaxDuration", ")", ":", "nul...
The limit or null if the entry should be disabled in the history store
[ "The", "limit", "or", "null", "if", "the", "entry", "should", "be", "disabled", "in", "the", "history", "store" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/Config.java#L128-L130
casmi/casmi
src/main/java/casmi/graphics/color/HSBColor.java
HSBColor.getComplementaryColor
public HSBColor getComplementaryColor() { """ Returns a Color object that shows a complementary color. @return a complementary Color object. """ double[] rgb = HSBColor.getRGB(hue, saturation, brightness); double[] hsb = HSBColor.getHSB(1.0 - rgb[0], 1.0 - rgb[1], 1.0 - rgb[2]); retu...
java
public HSBColor getComplementaryColor() { double[] rgb = HSBColor.getRGB(hue, saturation, brightness); double[] hsb = HSBColor.getHSB(1.0 - rgb[0], 1.0 - rgb[1], 1.0 - rgb[2]); return new HSBColor(hsb[0], hsb[1], hsb[2]); }
[ "public", "HSBColor", "getComplementaryColor", "(", ")", "{", "double", "[", "]", "rgb", "=", "HSBColor", ".", "getRGB", "(", "hue", ",", "saturation", ",", "brightness", ")", ";", "double", "[", "]", "hsb", "=", "HSBColor", ".", "getHSB", "(", "1.0", ...
Returns a Color object that shows a complementary color. @return a complementary Color object.
[ "Returns", "a", "Color", "object", "that", "shows", "a", "complementary", "color", "." ]
train
https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/color/HSBColor.java#L287-L291
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getFullPathName
static String getFullPathName(INode inode) throws IOException { """ Return the full path name of the specified inode @param inode @return its full path name @throws IOException if the inode is invalid """ INode[] inodes = getINodeArray(inode); return getFullPathName(inodes, inodes.length-1); }
java
static String getFullPathName(INode inode) throws IOException { INode[] inodes = getINodeArray(inode); return getFullPathName(inodes, inodes.length-1); }
[ "static", "String", "getFullPathName", "(", "INode", "inode", ")", "throws", "IOException", "{", "INode", "[", "]", "inodes", "=", "getINodeArray", "(", "inode", ")", ";", "return", "getFullPathName", "(", "inodes", ",", "inodes", ".", "length", "-", "1", ...
Return the full path name of the specified inode @param inode @return its full path name @throws IOException if the inode is invalid
[ "Return", "the", "full", "path", "name", "of", "the", "specified", "inode" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2271-L2274
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/rewrite/PropertyRewritePolicy.java
PropertyRewritePolicy.setProperties
public void setProperties(String props) { """ Set a string representing the property name/value pairs. Form: propname1=propvalue1,propname2=propvalue2 @param props """ Map hashTable = new HashMap(); StringTokenizer pairs = new StringTokenizer(props, ","); while (pairs.hasMoreToken...
java
public void setProperties(String props) { Map hashTable = new HashMap(); StringTokenizer pairs = new StringTokenizer(props, ","); while (pairs.hasMoreTokens()) { StringTokenizer entry = new StringTokenizer(pairs.nextToken(), "="); hashTable.put(entry.nextElement().toStrin...
[ "public", "void", "setProperties", "(", "String", "props", ")", "{", "Map", "hashTable", "=", "new", "HashMap", "(", ")", ";", "StringTokenizer", "pairs", "=", "new", "StringTokenizer", "(", "props", ",", "\",\"", ")", ";", "while", "(", "pairs", ".", "h...
Set a string representing the property name/value pairs. Form: propname1=propvalue1,propname2=propvalue2 @param props
[ "Set", "a", "string", "representing", "the", "property", "name", "/", "value", "pairs", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/rewrite/PropertyRewritePolicy.java#L45-L55
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java
DatastoreShardStrategy.getScatterSplitPoints
private List<Range> getScatterSplitPoints(String namespace, String kind, final int numSegments) { """ Uses the scatter property to distribute ranges to segments. A random scatter property is added to 1 out of every 512 entities see: https://github.com/GoogleCloudPlatform/appengine-mapreduce/wiki/ScatterPropert...
java
private List<Range> getScatterSplitPoints(String namespace, String kind, final int numSegments) { Query query = createQuery(namespace, kind).addSort(SCATTER_RESERVED_PROPERTY).setKeysOnly(); List<Key> splitPoints = sortKeys(runQuery(query, numSegments - 1)); List<Range> result = new ArrayList<>(splitPoints....
[ "private", "List", "<", "Range", ">", "getScatterSplitPoints", "(", "String", "namespace", ",", "String", "kind", ",", "final", "int", "numSegments", ")", "{", "Query", "query", "=", "createQuery", "(", "namespace", ",", "kind", ")", ".", "addSort", "(", "...
Uses the scatter property to distribute ranges to segments. A random scatter property is added to 1 out of every 512 entities see: https://github.com/GoogleCloudPlatform/appengine-mapreduce/wiki/ScatterPropertyImplementation Retrieving the entities with the highest scatter values provides a random sample of entities....
[ "Uses", "the", "scatter", "property", "to", "distribute", "ranges", "to", "segments", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java#L258-L270
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.splitByWholeSeparatorPreserveAllTokens
public static String[] splitByWholeSeparatorPreserveAllTokens(final String str, final String separator) { """ <p>Splits the provided text into an array, separator string specified. </p> <p>The separator is not included in the returned String array. Adjacent separators are treated as separators for empty tokens...
java
public static String[] splitByWholeSeparatorPreserveAllTokens(final String str, final String separator) { return splitByWholeSeparatorWorker(str, separator, -1, true); }
[ "public", "static", "String", "[", "]", "splitByWholeSeparatorPreserveAllTokens", "(", "final", "String", "str", ",", "final", "String", "separator", ")", "{", "return", "splitByWholeSeparatorWorker", "(", "str", ",", "separator", ",", "-", "1", ",", "true", ")"...
<p>Splits the provided text into an array, separator string specified. </p> <p>The separator is not included in the returned String array. Adjacent separators are treated as separators for empty tokens. For more control over the split use the StrTokenizer class.</p> <p>A {@code null} input String returns {@code null}...
[ "<p", ">", "Splits", "the", "provided", "text", "into", "an", "array", "separator", "string", "specified", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L3326-L3328
VoltDB/voltdb
third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java
HelpFormatter.printHelp
public void printHelp(String cmdLineSyntax, String header, Options options, String footer, boolean autoUsage) { """ Print the help for <code>options</code> with the specified command line syntax. This method prints help information to System.out. @param cmdLineSyntax the syntax for this application @param h...
java
public void printHelp(String cmdLineSyntax, String header, Options options, String footer, boolean autoUsage) { printHelp(getWidth(), cmdLineSyntax, header, options, footer, autoUsage); }
[ "public", "void", "printHelp", "(", "String", "cmdLineSyntax", ",", "String", "header", ",", "Options", "options", ",", "String", "footer", ",", "boolean", "autoUsage", ")", "{", "printHelp", "(", "getWidth", "(", ")", ",", "cmdLineSyntax", ",", "header", ",...
Print the help for <code>options</code> with the specified command line syntax. This method prints help information to System.out. @param cmdLineSyntax the syntax for this application @param header the banner to display at the beginning of the help @param options the Options instance @param footer the banner to displ...
[ "Print", "the", "help", "for", "<code", ">", "options<", "/", "code", ">", "with", "the", "specified", "command", "line", "syntax", ".", "This", "method", "prints", "help", "information", "to", "System", ".", "out", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L453-L456
BioPAX/Paxtools
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3/TemplateReactionWrapper.java
TemplateReactionWrapper.addToUpstream
protected void addToUpstream(BioPAXElement ele, org.biopax.paxtools.query.model.Graph graph) { """ Binds the given element to the upstream. @param ele Element to bind @param graph Owner graph """ AbstractNode node = (AbstractNode) graph.getGraphObject(ele); if (node == null) return; Edge edge = ne...
java
protected void addToUpstream(BioPAXElement ele, org.biopax.paxtools.query.model.Graph graph) { AbstractNode node = (AbstractNode) graph.getGraphObject(ele); if (node == null) return; Edge edge = new EdgeL3(node, this, graph); if (isTranscription()) { if (node instanceof ControlWrapper) { ...
[ "protected", "void", "addToUpstream", "(", "BioPAXElement", "ele", ",", "org", ".", "biopax", ".", "paxtools", ".", "query", ".", "model", ".", "Graph", "graph", ")", "{", "AbstractNode", "node", "=", "(", "AbstractNode", ")", "graph", ".", "getGraphObject",...
Binds the given element to the upstream. @param ele Element to bind @param graph Owner graph
[ "Binds", "the", "given", "element", "to", "the", "upstream", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3/TemplateReactionWrapper.java#L94-L111
milaboratory/milib
src/main/java/com/milaboratory/core/io/util/FileIndexBuilder.java
FileIndexBuilder.createAndDestroy
public FileIndex createAndDestroy() { """ Creates {@code FileIndex} assembled by this builder. @return {@code FileIndex} assembled by this builder """ checkIfDestroyed(); destroyed = true; return new FileIndex(step, metadata, index, startingRecordNumber, lastAccessibleRecordNumber())...
java
public FileIndex createAndDestroy() { checkIfDestroyed(); destroyed = true; return new FileIndex(step, metadata, index, startingRecordNumber, lastAccessibleRecordNumber()); }
[ "public", "FileIndex", "createAndDestroy", "(", ")", "{", "checkIfDestroyed", "(", ")", ";", "destroyed", "=", "true", ";", "return", "new", "FileIndex", "(", "step", ",", "metadata", ",", "index", ",", "startingRecordNumber", ",", "lastAccessibleRecordNumber", ...
Creates {@code FileIndex} assembled by this builder. @return {@code FileIndex} assembled by this builder
[ "Creates", "{", "@code", "FileIndex", "}", "assembled", "by", "this", "builder", "." ]
train
https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/io/util/FileIndexBuilder.java#L148-L152
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.removeMessageListener
public void removeMessageListener(DigitalChannel channel, MessageListener<? extends Message> messageListener) { """ Remove a messageListener from the Firmata object which will stop the listener from responding to message received events over the SerialPort. @param channel DigitalChannel to remove the listener ...
java
public void removeMessageListener(DigitalChannel channel, MessageListener<? extends Message> messageListener) { removeListener(channel.getIdentifier(), messageListener.getMessageType(), messageListener); }
[ "public", "void", "removeMessageListener", "(", "DigitalChannel", "channel", ",", "MessageListener", "<", "?", "extends", "Message", ">", "messageListener", ")", "{", "removeListener", "(", "channel", ".", "getIdentifier", "(", ")", ",", "messageListener", ".", "g...
Remove a messageListener from the Firmata object which will stop the listener from responding to message received events over the SerialPort. @param channel DigitalChannel to remove the listener from. @param messageListener MessageListener to be removed.
[ "Remove", "a", "messageListener", "from", "the", "Firmata", "object", "which", "will", "stop", "the", "listener", "from", "responding", "to", "message", "received", "events", "over", "the", "SerialPort", "." ]
train
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L259-L261
gallandarakhneorg/afc
maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java
AbstractArakhneMojo.assertNotNull
protected final void assertNotNull(String message, Object obj) { """ Throw an exception when the given object is null. @param message is the message to put in the exception. @param obj the object to test. """ if (getLog().isDebugEnabled()) { getLog().debug( "\t(" //$NON-NLS-1$ + getLogType(...
java
protected final void assertNotNull(String message, Object obj) { if (getLog().isDebugEnabled()) { getLog().debug( "\t(" //$NON-NLS-1$ + getLogType(obj) + ") " //$NON-NLS-1$ + message + " = " //$NON-NLS-1$ + obj); } if (obj == null) { throw new AssertionError("assertNotNull: " +...
[ "protected", "final", "void", "assertNotNull", "(", "String", "message", ",", "Object", "obj", ")", "{", "if", "(", "getLog", "(", ")", ".", "isDebugEnabled", "(", ")", ")", "{", "getLog", "(", ")", ".", "debug", "(", "\"\\t(\"", "//$NON-NLS-1$", "+", ...
Throw an exception when the given object is null. @param message is the message to put in the exception. @param obj the object to test.
[ "Throw", "an", "exception", "when", "the", "given", "object", "is", "null", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L1081-L1094
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.setWarningSeverity
public void setWarningSeverity(String warningId, Severity severity) { """ Change the severity level of a warning. @param warningId the identifier of the warning. If {@code null} or empty, this function does nothing. @param severity the new severity. If {@code null} this function does nothing. @since 0.5 "...
java
public void setWarningSeverity(String warningId, Severity severity) { if (!Strings.isEmpty(warningId) && severity != null) { this.issueSeverityProvider.setSeverity(warningId, severity); } }
[ "public", "void", "setWarningSeverity", "(", "String", "warningId", ",", "Severity", "severity", ")", "{", "if", "(", "!", "Strings", ".", "isEmpty", "(", "warningId", ")", "&&", "severity", "!=", "null", ")", "{", "this", ".", "issueSeverityProvider", ".", ...
Change the severity level of a warning. @param warningId the identifier of the warning. If {@code null} or empty, this function does nothing. @param severity the new severity. If {@code null} this function does nothing. @since 0.5
[ "Change", "the", "severity", "level", "of", "a", "warning", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L2264-L2268
jbossws/jbossws-common
src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
ReflectionUtils.assertOnlyOneMethod
public static void assertOnlyOneMethod(final Collection<Method> methods, Class<? extends Annotation> annotation) { """ Asserts only one method is annotated with annotation. @param method collection of methods to validate @param annotation annotation to propagate in exception message """ if (methods.s...
java
public static void assertOnlyOneMethod(final Collection<Method> methods, Class<? extends Annotation> annotation) { if (methods.size() > 1) { throw annotation == null ? MESSAGES.onlyOneMethodCanExist() : MESSAGES.onlyOneMethodCanExist2(annotation); } }
[ "public", "static", "void", "assertOnlyOneMethod", "(", "final", "Collection", "<", "Method", ">", "methods", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotation", ")", "{", "if", "(", "methods", ".", "size", "(", ")", ">", "1", ")", "{", ...
Asserts only one method is annotated with annotation. @param method collection of methods to validate @param annotation annotation to propagate in exception message
[ "Asserts", "only", "one", "method", "is", "annotated", "with", "annotation", "." ]
train
https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L330-L336
wcm-io-caravan/caravan-hal
docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java
GenerateHalDocsJsonMojo.getAnnotation
private <T extends Annotation> T getAnnotation(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> annotationType) { """ Get annotation for field. @param javaClazz QDox class @param javaField QDox field @param compileClassLoader Classloader for compile dependencies @param annotat...
java
private <T extends Annotation> T getAnnotation(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> annotationType) { try { Class<?> clazz = compileClassLoader.loadClass(javaClazz.getFullyQualifiedName()); Field field = clazz.getField(javaField.getName()); return fiel...
[ "private", "<", "T", "extends", "Annotation", ">", "T", "getAnnotation", "(", "JavaClass", "javaClazz", ",", "JavaField", "javaField", ",", "ClassLoader", "compileClassLoader", ",", "Class", "<", "T", ">", "annotationType", ")", "{", "try", "{", "Class", "<", ...
Get annotation for field. @param javaClazz QDox class @param javaField QDox field @param compileClassLoader Classloader for compile dependencies @param annotationType Annotation type @return Annotation of null if not present
[ "Get", "annotation", "for", "field", "." ]
train
https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L349-L358
square/javapoet
src/main/java/com/squareup/javapoet/ClassName.java
ClassName.get
public static ClassName get(String packageName, String simpleName, String... simpleNames) { """ Returns a class name created from the given parts. For example, calling this with package name {@code "java.util"} and simple names {@code "Map"}, {@code "Entry"} yields {@link Map.Entry}. """ ClassName classNa...
java
public static ClassName get(String packageName, String simpleName, String... simpleNames) { ClassName className = new ClassName(packageName, null, simpleName); for (String name : simpleNames) { className = className.nestedClass(name); } return className; }
[ "public", "static", "ClassName", "get", "(", "String", "packageName", ",", "String", "simpleName", ",", "String", "...", "simpleNames", ")", "{", "ClassName", "className", "=", "new", "ClassName", "(", "packageName", ",", "null", ",", "simpleName", ")", ";", ...
Returns a class name created from the given parts. For example, calling this with package name {@code "java.util"} and simple names {@code "Map"}, {@code "Entry"} yields {@link Map.Entry}.
[ "Returns", "a", "class", "name", "created", "from", "the", "given", "parts", ".", "For", "example", "calling", "this", "with", "package", "name", "{" ]
train
https://github.com/square/javapoet/blob/0f93da9a3d9a1da8d29fc993409fcf83d40452bc/src/main/java/com/squareup/javapoet/ClassName.java#L214-L220
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/journal/entry/JournalEntry.java
JournalEntry.addArgument
public void addArgument(String key, InputStream stream) throws JournalException { """ If handed an InputStream as an argument, copy it to a temp file and store that File in the arguments map instead. If the InputStream is null, store null in the arguments map. """ checkOpen(); if ...
java
public void addArgument(String key, InputStream stream) throws JournalException { checkOpen(); if (stream == null) { arguments.put(key, null); } else { try { File tempFile = JournalHelper.copyToTempFile(stream); arguments.put(ke...
[ "public", "void", "addArgument", "(", "String", "key", ",", "InputStream", "stream", ")", "throws", "JournalException", "{", "checkOpen", "(", ")", ";", "if", "(", "stream", "==", "null", ")", "{", "arguments", ".", "put", "(", "key", ",", "null", ")", ...
If handed an InputStream as an argument, copy it to a temp file and store that File in the arguments map instead. If the InputStream is null, store null in the arguments map.
[ "If", "handed", "an", "InputStream", "as", "an", "argument", "copy", "it", "to", "a", "temp", "file", "and", "store", "that", "File", "in", "the", "arguments", "map", "instead", ".", "If", "the", "InputStream", "is", "null", "store", "null", "in", "the",...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/entry/JournalEntry.java#L93-L106
Baidu-AIP/java-sdk
src/main/java/com/baidu/aip/easydl/AipEasyDL.java
AipEasyDL.sendImageRequest
public JSONObject sendImageRequest(String url, byte[] image, HashMap<String, Object> options) { """ easyDL通用请求方法 @param url 服务的url @param image 图片二进制数据 @param options 可选参数 @return Json返回 """ AipRequest request = new AipRequest(); preOperation(request); String content = Base64Util.en...
java
public JSONObject sendImageRequest(String url, byte[] image, HashMap<String, Object> options) { AipRequest request = new AipRequest(); preOperation(request); String content = Base64Util.encode(image); request.addBody("image", content); if (options != null) { request.a...
[ "public", "JSONObject", "sendImageRequest", "(", "String", "url", ",", "byte", "[", "]", "image", ",", "HashMap", "<", "String", ",", "Object", ">", "options", ")", "{", "AipRequest", "request", "=", "new", "AipRequest", "(", ")", ";", "preOperation", "(",...
easyDL通用请求方法 @param url 服务的url @param image 图片二进制数据 @param options 可选参数 @return Json返回
[ "easyDL通用请求方法" ]
train
https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/easydl/AipEasyDL.java#L48-L63
bekkopen/NoCommons
src/main/java/no/bekk/bekkopen/date/NorwegianDateUtil.java
NorwegianDateUtil.checkDate
private static boolean checkDate(Calendar cal, int date, int month) { """ Check if the given date represents the given date and month. @param cal The Calendar object representing date to check. @param date The date. @param month The month. @return true if they match, false otherwise. """ return cal....
java
private static boolean checkDate(Calendar cal, int date, int month) { return cal.get(Calendar.DATE) == date && cal.get(Calendar.MONTH) == month; }
[ "private", "static", "boolean", "checkDate", "(", "Calendar", "cal", ",", "int", "date", ",", "int", "month", ")", "{", "return", "cal", ".", "get", "(", "Calendar", ".", "DATE", ")", "==", "date", "&&", "cal", ".", "get", "(", "Calendar", ".", "MONT...
Check if the given date represents the given date and month. @param cal The Calendar object representing date to check. @param date The date. @param month The month. @return true if they match, false otherwise.
[ "Check", "if", "the", "given", "date", "represents", "the", "given", "date", "and", "month", "." ]
train
https://github.com/bekkopen/NoCommons/blob/5a576696390cecaac111fa97fde581e0c1afb9b8/src/main/java/no/bekk/bekkopen/date/NorwegianDateUtil.java#L231-L233
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java
AbstractClassEmptyMethods.visitCode
@Override public void visitCode(Code obj) { """ overrides the visitor to filter out constructors. @param obj the code to parse """ if (Values.CONSTRUCTOR.equals(methodName) || Values.STATIC_INITIALIZER.equals(methodName)) { return; } Method m = getMethod(); ...
java
@Override public void visitCode(Code obj) { if (Values.CONSTRUCTOR.equals(methodName) || Values.STATIC_INITIALIZER.equals(methodName)) { return; } Method m = getMethod(); if (m.isSynthetic()) { return; } if (!interfaceMethods.contains(new QMe...
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "if", "(", "Values", ".", "CONSTRUCTOR", ".", "equals", "(", "methodName", ")", "||", "Values", ".", "STATIC_INITIALIZER", ".", "equals", "(", "methodName", ")", ")", "{", "ret...
overrides the visitor to filter out constructors. @param obj the code to parse
[ "overrides", "the", "visitor", "to", "filter", "out", "constructors", "." ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java#L110-L124
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/BarcodeEANSUPP.java
BarcodeEANSUPP.placeBarcode
public Rectangle placeBarcode(PdfContentByte cb, Color barColor, Color textColor) { """ Places the barcode in a <CODE>PdfContentByte</CODE>. The barcode is always placed at coordinates (0, 0). Use the translation matrix to move it elsewhere.<p> The bars and text are written in the following colors:<p> <P><TABL...
java
public Rectangle placeBarcode(PdfContentByte cb, Color barColor, Color textColor) { if (supp.getFont() != null) supp.setBarHeight(ean.getBarHeight() + supp.getBaseline() - supp.getFont().getFontDescriptor(BaseFont.CAPHEIGHT, supp.getSize())); else supp.setBarHeight(ean.getBarHeig...
[ "public", "Rectangle", "placeBarcode", "(", "PdfContentByte", "cb", ",", "Color", "barColor", ",", "Color", "textColor", ")", "{", "if", "(", "supp", ".", "getFont", "(", ")", "!=", "null", ")", "supp", ".", "setBarHeight", "(", "ean", ".", "getBarHeight",...
Places the barcode in a <CODE>PdfContentByte</CODE>. The barcode is always placed at coordinates (0, 0). Use the translation matrix to move it elsewhere.<p> The bars and text are written in the following colors:<p> <P><TABLE BORDER=1> <TR> <TH><P><CODE>barColor</CODE></TH> <TH><P><CODE>textColor</CODE></TH> <TH><P>Resu...
[ "Places", "the", "barcode", "in", "a", "<CODE", ">", "PdfContentByte<", "/", "CODE", ">", ".", "The", "barcode", "is", "always", "placed", "at", "coordinates", "(", "0", "0", ")", ".", "Use", "the", "translation", "matrix", "to", "move", "it", "elsewhere...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BarcodeEANSUPP.java#L129-L143
JM-Lab/utils-elasticsearch
src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java
JMElasticsearchIndex.sendData
public String sendData(String jsonSource, String index, String type) { """ Send data string. @param jsonSource the json source @param index the index @param type the type @return the string """ return sendData(jsonSource, index, type, null).getId(); }
java
public String sendData(String jsonSource, String index, String type) { return sendData(jsonSource, index, type, null).getId(); }
[ "public", "String", "sendData", "(", "String", "jsonSource", ",", "String", "index", ",", "String", "type", ")", "{", "return", "sendData", "(", "jsonSource", ",", "index", ",", "type", ",", "null", ")", ".", "getId", "(", ")", ";", "}" ]
Send data string. @param jsonSource the json source @param index the index @param type the type @return the string
[ "Send", "data", "string", "." ]
train
https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java#L248-L250
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java
ZipUtil.unGzip
public static String unGzip(byte[] buf, String charset) throws UtilException { """ Gzip解压缩处理 @param buf 压缩过的字节流 @param charset 编码 @return 解压后的字符串 @throws UtilException IO异常 """ return StrUtil.str(unGzip(buf), charset); }
java
public static String unGzip(byte[] buf, String charset) throws UtilException { return StrUtil.str(unGzip(buf), charset); }
[ "public", "static", "String", "unGzip", "(", "byte", "[", "]", "buf", ",", "String", "charset", ")", "throws", "UtilException", "{", "return", "StrUtil", ".", "str", "(", "unGzip", "(", "buf", ")", ",", "charset", ")", ";", "}" ]
Gzip解压缩处理 @param buf 压缩过的字节流 @param charset 编码 @return 解压后的字符串 @throws UtilException IO异常
[ "Gzip解压缩处理" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L567-L569
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java
OverrideService.updateResponseCode
public void updateResponseCode(int id, String responseCode) { """ Update the response code for a given enabled override @param id enabled override ID to update @param responseCode updated value of responseCode """ PreparedStatement statement = null; try (Connection sqlConnection = sqlServic...
java
public void updateResponseCode(int id, String responseCode) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { String queryString = "UPDATE " + Constants.DB_TABLE_ENABLED_OVERRIDE + " SET " + Constants.ENABLED_OVERRIDES_RE...
[ "public", "void", "updateResponseCode", "(", "int", "id", ",", "String", "responseCode", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "Stri...
Update the response code for a given enabled override @param id enabled override ID to update @param responseCode updated value of responseCode
[ "Update", "the", "response", "code", "for", "a", "given", "enabled", "override" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L260-L281
ribot/easy-adapter
demo/src/main/java/uk/co/ribot/easyadapterdemo/PersonViewHolder.java
PersonViewHolder.onSetValues
@Override public void onSetValues(Person person, PositionInfo positionInfo) { """ Override onSetValues() to set the values of the items in the views. """ imageViewPerson.setImageResource(person.getResDrawableId()); textViewName.setText(person.getName()); textViewPhone.setText(person...
java
@Override public void onSetValues(Person person, PositionInfo positionInfo) { imageViewPerson.setImageResource(person.getResDrawableId()); textViewName.setText(person.getName()); textViewPhone.setText(person.getPhoneNumber()); }
[ "@", "Override", "public", "void", "onSetValues", "(", "Person", "person", ",", "PositionInfo", "positionInfo", ")", "{", "imageViewPerson", ".", "setImageResource", "(", "person", ".", "getResDrawableId", "(", ")", ")", ";", "textViewName", ".", "setText", "(",...
Override onSetValues() to set the values of the items in the views.
[ "Override", "onSetValues", "()", "to", "set", "the", "values", "of", "the", "items", "in", "the", "views", "." ]
train
https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/demo/src/main/java/uk/co/ribot/easyadapterdemo/PersonViewHolder.java#L52-L57
kaazing/gateway
util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java
Asn1Utils.decodeOctetString
public static short[] decodeOctetString(ByteBuffer buf) { """ Decode an ASN.1 OCTET STRING. @param buf the DER-encoded OCTET STRING @return the octets """ DerId id = DerId.decode(buf); if (!id.matches(DerId.TagClass.UNIVERSAL, ASN1_OCTET_STRING_TAG_NUM)) { throw new IllegalArgu...
java
public static short[] decodeOctetString(ByteBuffer buf) { DerId id = DerId.decode(buf); if (!id.matches(DerId.TagClass.UNIVERSAL, ASN1_OCTET_STRING_TAG_NUM)) { throw new IllegalArgumentException("Expected OCTET STRING identifier, received " + id); } int len = DerUtils.decodeL...
[ "public", "static", "short", "[", "]", "decodeOctetString", "(", "ByteBuffer", "buf", ")", "{", "DerId", "id", "=", "DerId", ".", "decode", "(", "buf", ")", ";", "if", "(", "!", "id", ".", "matches", "(", "DerId", ".", "TagClass", ".", "UNIVERSAL", "...
Decode an ASN.1 OCTET STRING. @param buf the DER-encoded OCTET STRING @return the octets
[ "Decode", "an", "ASN", ".", "1", "OCTET", "STRING", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L195-L209
OnyxDevTools/onyx-database-parent
onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java
PersistenceApi.executeQueryPostAsync
public com.squareup.okhttp.Call executeQueryPostAsync(Query query, final ApiCallback<QueryResponse> callback) throws ApiException { """ Execute Query (asynchronously) Execute query with defined criteria @param query Query defined with criteria (required) @param callback The callback to be executed when the API ...
java
public com.squareup.okhttp.Call executeQueryPostAsync(Query query, final ApiCallback<QueryResponse> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) {...
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "executeQueryPostAsync", "(", "Query", "query", ",", "final", "ApiCallback", "<", "QueryResponse", ">", "callback", ")", "throws", "ApiException", "{", "ProgressResponseBody", ".", "ProgressListener", "...
Execute Query (asynchronously) Execute query with defined criteria @param query Query defined with criteria (required) @param callback The callback to be executed when the API call finishes @return The request call @throws ApiException If fail to process the API call, e.g. serializing the request body object
[ "Execute", "Query", "(", "asynchronously", ")", "Execute", "query", "with", "defined", "criteria" ]
train
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java#L662-L687
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/ConfigUtil.java
ConfigUtil.normalizeYaml
public static DescriptorProperties normalizeYaml(Map<String, Object> yamlMap) { """ Normalizes key-value properties from Yaml in the normalized format of the Table API. """ final Map<String, String> normalized = new HashMap<>(); yamlMap.forEach((k, v) -> normalizeYamlObject(normalized, k, v)); final Desc...
java
public static DescriptorProperties normalizeYaml(Map<String, Object> yamlMap) { final Map<String, String> normalized = new HashMap<>(); yamlMap.forEach((k, v) -> normalizeYamlObject(normalized, k, v)); final DescriptorProperties properties = new DescriptorProperties(true); properties.putProperties(normalized); ...
[ "public", "static", "DescriptorProperties", "normalizeYaml", "(", "Map", "<", "String", ",", "Object", ">", "yamlMap", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "normalized", "=", "new", "HashMap", "<>", "(", ")", ";", "yamlMap", ".", ...
Normalizes key-value properties from Yaml in the normalized format of the Table API.
[ "Normalizes", "key", "-", "value", "properties", "from", "Yaml", "in", "the", "normalized", "format", "of", "the", "Table", "API", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/ConfigUtil.java#L48-L54
authlete/authlete-java-common
src/main/java/com/authlete/common/util/TypedProperties.java
TypedProperties.getEnum
public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass, TEnum defaultValue) { """ Get the value of the property identified by the key as Enum. If {@code key} is null or there is no property for the key, {@code defaultValue} is returned. """ String name = getString(key); ...
java
public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass, TEnum defaultValue) { String name = getString(key); if (name == null) { return defaultValue; } try { return Enum.valueOf(enumClass, name); } ...
[ "public", "<", "TEnum", "extends", "Enum", "<", "TEnum", ">", ">", "TEnum", "getEnum", "(", "String", "key", ",", "Class", "<", "TEnum", ">", "enumClass", ",", "TEnum", "defaultValue", ")", "{", "String", "name", "=", "getString", "(", "key", ")", ";",...
Get the value of the property identified by the key as Enum. If {@code key} is null or there is no property for the key, {@code defaultValue} is returned.
[ "Get", "the", "value", "of", "the", "property", "identified", "by", "the", "key", "as", "Enum", ".", "If", "{" ]
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L355-L372
looly/hutool
hutool-core/src/main/java/cn/hutool/core/annotation/AnnotationUtil.java
AnnotationUtil.getAnnotationValue
public static <T> T getAnnotationValue(AnnotatedElement annotationEle, Class<? extends Annotation> annotationType) throws UtilException { """ 获取指定注解默认值<br> 如果无指定的属性方法返回null @param <T> 注解值类型 @param annotationEle {@link AccessibleObject},可以是Class、Method、Field、Constructor、ReflectPermission @param annotationType...
java
public static <T> T getAnnotationValue(AnnotatedElement annotationEle, Class<? extends Annotation> annotationType) throws UtilException { return getAnnotationValue(annotationEle, annotationType, "value"); }
[ "public", "static", "<", "T", ">", "T", "getAnnotationValue", "(", "AnnotatedElement", "annotationEle", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ")", "throws", "UtilException", "{", "return", "getAnnotationValue", "(", "annotationEle",...
获取指定注解默认值<br> 如果无指定的属性方法返回null @param <T> 注解值类型 @param annotationEle {@link AccessibleObject},可以是Class、Method、Field、Constructor、ReflectPermission @param annotationType 注解类型 @return 注解对象 @throws UtilException 调用注解中的方法时执行异常
[ "获取指定注解默认值<br", ">", "如果无指定的属性方法返回null" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/annotation/AnnotationUtil.java#L75-L77
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java
DefaultElementProducer.createPhrase
public Phrase createPhrase(Object data, Collection<? extends BaseStyler> stylers) throws VectorPrintException { """ Create a Phrase, style it and add the data @param data @param stylers @return @throws VectorPrintException """ return initTextElementArray(styleHelper.style(new Phrase(Float.NaN), dat...
java
public Phrase createPhrase(Object data, Collection<? extends BaseStyler> stylers) throws VectorPrintException { return initTextElementArray(styleHelper.style(new Phrase(Float.NaN), data, stylers), data, stylers); }
[ "public", "Phrase", "createPhrase", "(", "Object", "data", ",", "Collection", "<", "?", "extends", "BaseStyler", ">", "stylers", ")", "throws", "VectorPrintException", "{", "return", "initTextElementArray", "(", "styleHelper", ".", "style", "(", "new", "Phrase", ...
Create a Phrase, style it and add the data @param data @param stylers @return @throws VectorPrintException
[ "Create", "a", "Phrase", "style", "it", "and", "add", "the", "data" ]
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L213-L215
wcm-io/wcm-io-sling
commons/src/main/java/io/wcm/sling/commons/request/QueryStringBuilder.java
QueryStringBuilder.params
public @NotNull QueryStringBuilder params(@NotNull Map<String, Object> values) { """ Add map of parameters to query string. @param values Map with parameter names and values. Values will be converted to strings. If a value is an array or {@link Iterable} the value items will be added as separate parameters. @re...
java
public @NotNull QueryStringBuilder params(@NotNull Map<String, Object> values) { for (Map.Entry<String, Object> entry : values.entrySet()) { param(entry.getKey(), entry.getValue()); } return this; }
[ "public", "@", "NotNull", "QueryStringBuilder", "params", "(", "@", "NotNull", "Map", "<", "String", ",", "Object", ">", "values", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Object", ">", "entry", ":", "values", ".", "entrySet", "(...
Add map of parameters to query string. @param values Map with parameter names and values. Values will be converted to strings. If a value is an array or {@link Iterable} the value items will be added as separate parameters. @return this
[ "Add", "map", "of", "parameters", "to", "query", "string", "." ]
train
https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/QueryStringBuilder.java#L78-L83
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/render/HCRenderer.java
HCRenderer.getAsNode
@SuppressWarnings ("unchecked") @Nullable public static IMicroNode getAsNode (@Nonnull final IHCNode aSrcNode, @Nonnull final IHCConversionSettingsToNode aConversionSettings) { """ Convert the passed HC node to a micro node using the provided conversion settings. @para...
java
@SuppressWarnings ("unchecked") @Nullable public static IMicroNode getAsNode (@Nonnull final IHCNode aSrcNode, @Nonnull final IHCConversionSettingsToNode aConversionSettings) { IHCNode aConvertNode = aSrcNode; // Special case for HCHtml - must have been done separate...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Nullable", "public", "static", "IMicroNode", "getAsNode", "(", "@", "Nonnull", "final", "IHCNode", "aSrcNode", ",", "@", "Nonnull", "final", "IHCConversionSettingsToNode", "aConversionSettings", ")", "{", "IH...
Convert the passed HC node to a micro node using the provided conversion settings. @param aSrcNode The node to be converted. May not be <code>null</code>. @param aConversionSettings The conversion settings to be used. May not be <code>null</code>. @return The fully created HTML node
[ "Convert", "the", "passed", "HC", "node", "to", "a", "micro", "node", "using", "the", "provided", "conversion", "settings", "." ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/render/HCRenderer.java#L192-L231
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java
DatatypeFactory.newDurationYearMonth
public Duration newDurationYearMonth( final boolean isPositive, final int year, final int month) { """ <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified <code>year</code> and <code>month</code> as defined in <a href="http://www.w3...
java
public Duration newDurationYearMonth( final boolean isPositive, final int year, final int month) { return newDuration(isPositive, year, month, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFIN...
[ "public", "Duration", "newDurationYearMonth", "(", "final", "boolean", "isPositive", ",", "final", "int", "year", ",", "final", "int", "month", ")", "{", "return", "newDuration", "(", "isPositive", ",", "year", ",", "month", ",", "DatatypeConstants", ".", "FIE...
<p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified <code>year</code> and <code>month</code> as defined in <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthyDuration"> XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p> <p>A {@link DatatypeConstants...
[ "<p", ">", "Create", "a", "<code", ">", "Duration<", "/", "code", ">", "of", "type", "<code", ">", "xdt", ":", "yearMonthDuration<", "/", "code", ">", "using", "the", "specified", "<code", ">", "year<", "/", "code", ">", "and", "<code", ">", "month<", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java#L653-L660
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java
AbstractIoSession.notifyIdleness
public static void notifyIdleness(Iterator<? extends IoSession> sessions, long currentTime) { """ Fires a {@link IoEventType#SESSION_IDLE} event to any applicable sessions in the specified collection. @param currentTime the current time (i.e. {@link System#currentTimeMillis()}) """ IoSession s; ...
java
public static void notifyIdleness(Iterator<? extends IoSession> sessions, long currentTime) { IoSession s; while (sessions.hasNext()) { s = sessions.next(); notifyIdleSession(s, currentTime); } }
[ "public", "static", "void", "notifyIdleness", "(", "Iterator", "<", "?", "extends", "IoSession", ">", "sessions", ",", "long", "currentTime", ")", "{", "IoSession", "s", ";", "while", "(", "sessions", ".", "hasNext", "(", ")", ")", "{", "s", "=", "sessio...
Fires a {@link IoEventType#SESSION_IDLE} event to any applicable sessions in the specified collection. @param currentTime the current time (i.e. {@link System#currentTimeMillis()})
[ "Fires", "a", "{", "@link", "IoEventType#SESSION_IDLE", "}", "event", "to", "any", "applicable", "sessions", "in", "the", "specified", "collection", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java#L1199-L1205
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java
SparkUtils.writeStringToFile
public static void writeStringToFile(String path, String toWrite, Configuration hadoopConfig) throws IOException { """ Write a String to a file (on HDFS or local) in UTF-8 format @param path Path to write to @param toWrite String to write @param hadoopConfig Hadoop configuration, for example from...
java
public static void writeStringToFile(String path, String toWrite, Configuration hadoopConfig) throws IOException { FileSystem fileSystem = FileSystem.get(hadoopConfig); try (BufferedOutputStream bos = new BufferedOutputStream(fileSystem.create(new Path(path)))) { bos.write(toWrite.getBytes("...
[ "public", "static", "void", "writeStringToFile", "(", "String", "path", ",", "String", "toWrite", ",", "Configuration", "hadoopConfig", ")", "throws", "IOException", "{", "FileSystem", "fileSystem", "=", "FileSystem", ".", "get", "(", "hadoopConfig", ")", ";", "...
Write a String to a file (on HDFS or local) in UTF-8 format @param path Path to write to @param toWrite String to write @param hadoopConfig Hadoop configuration, for example from SparkContext.hadoopConfiguration()
[ "Write", "a", "String", "to", "a", "file", "(", "on", "HDFS", "or", "local", ")", "in", "UTF", "-", "8", "format" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L96-L101
jqno/equalsverifier
src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java
PrefabValues.giveOther
public <T> T giveOther(TypeTag tag, T value) { """ Returns a prefabricated value of the specified type, that is different from the specified value. @param <T> The type of the value. @param tag A description of the desired type, including generic parameters. @param value A value that is different from the va...
java
public <T> T giveOther(TypeTag tag, T value) { Class<T> type = tag.getType(); if (value != null && !type.isAssignableFrom(value.getClass()) && !wraps(type, value.getClass())) { throw new ReflectionException("TypeTag does not match value."); } Tuple<T> tuple = giveTuple(tag);...
[ "public", "<", "T", ">", "T", "giveOther", "(", "TypeTag", "tag", ",", "T", "value", ")", "{", "Class", "<", "T", ">", "type", "=", "tag", ".", "getType", "(", ")", ";", "if", "(", "value", "!=", "null", "&&", "!", "type", ".", "isAssignableFrom"...
Returns a prefabricated value of the specified type, that is different from the specified value. @param <T> The type of the value. @param tag A description of the desired type, including generic parameters. @param value A value that is different from the value that will be returned. @return A value that is different f...
[ "Returns", "a", "prefabricated", "value", "of", "the", "specified", "type", "that", "is", "different", "from", "the", "specified", "value", "." ]
train
https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/prefabvalues/PrefabValues.java#L104-L121
knowm/XChange
xchange-cryptonit/src/main/java/org/knowm/xchange/cryptonit2/CryptonitAdapters.java
CryptonitAdapters.adaptTicker
public static Ticker adaptTicker(CryptonitTicker cryptonitTicker, CurrencyPair currencyPair) { """ Adapts a CryptonitTicker to a Ticker Object @param cryptonitTicker The exchange specific ticker @param currencyPair (e.g. BTC/USD) @return The ticker """ BigDecimal open = cryptonitTicker.getOpen(); ...
java
public static Ticker adaptTicker(CryptonitTicker cryptonitTicker, CurrencyPair currencyPair) { BigDecimal open = cryptonitTicker.getOpen(); BigDecimal last = cryptonitTicker.getLast(); BigDecimal bid = cryptonitTicker.getBid(); BigDecimal ask = cryptonitTicker.getAsk(); BigDecimal high = cryptonitT...
[ "public", "static", "Ticker", "adaptTicker", "(", "CryptonitTicker", "cryptonitTicker", ",", "CurrencyPair", "currencyPair", ")", "{", "BigDecimal", "open", "=", "cryptonitTicker", ".", "getOpen", "(", ")", ";", "BigDecimal", "last", "=", "cryptonitTicker", ".", "...
Adapts a CryptonitTicker to a Ticker Object @param cryptonitTicker The exchange specific ticker @param currencyPair (e.g. BTC/USD) @return The ticker
[ "Adapts", "a", "CryptonitTicker", "to", "a", "Ticker", "Object" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-cryptonit/src/main/java/org/knowm/xchange/cryptonit2/CryptonitAdapters.java#L162-L186
keenlabs/KeenClient-Java
core/src/main/java/io/keen/client/java/http/UrlConnectionHttpHandler.java
UrlConnectionHttpHandler.sendRequest
protected void sendRequest(HttpURLConnection connection, Request request) throws IOException { """ Sends a request over a given connection. @param connection The connection over which to send the request. @param request The request to send. @throws IOException If there is an error sending the request. """...
java
protected void sendRequest(HttpURLConnection connection, Request request) throws IOException { // Set up the request. connection.setRequestMethod(request.method); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("Authorization", request.authoriza...
[ "protected", "void", "sendRequest", "(", "HttpURLConnection", "connection", ",", "Request", "request", ")", "throws", "IOException", "{", "// Set up the request.", "connection", ".", "setRequestMethod", "(", "request", ".", "method", ")", ";", "connection", ".", "se...
Sends a request over a given connection. @param connection The connection over which to send the request. @param request The request to send. @throws IOException If there is an error sending the request.
[ "Sends", "a", "request", "over", "a", "given", "connection", "." ]
train
https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/http/UrlConnectionHttpHandler.java#L65-L90
to2mbn/JMCCC
jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java
YggdrasilAuthenticator.refreshWithPassword
public synchronized void refreshWithPassword(String username, String password) throws AuthenticationException { """ Refreshes the current session manually using password. @param username the username @param password the password @throws AuthenticationException If an exception occurs during the authentication...
java
public synchronized void refreshWithPassword(String username, String password) throws AuthenticationException { refreshWithPassword(username, password, null); }
[ "public", "synchronized", "void", "refreshWithPassword", "(", "String", "username", ",", "String", "password", ")", "throws", "AuthenticationException", "{", "refreshWithPassword", "(", "username", ",", "password", ",", "null", ")", ";", "}" ]
Refreshes the current session manually using password. @param username the username @param password the password @throws AuthenticationException If an exception occurs during the authentication
[ "Refreshes", "the", "current", "session", "manually", "using", "password", "." ]
train
https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java#L326-L328
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
LostExceptionStackTrace.prescreen
public boolean prescreen(Code code, Method method) { """ looks for methods that contain a catch block and an ATHROW opcode @param code the context object of the current code block @param method the context object of the current method @return if the class throws exceptions """ if (method.isSynth...
java
public boolean prescreen(Code code, Method method) { if (method.isSynthetic()) { return false; } CodeException[] ce = code.getExceptionTable(); if (CollectionUtils.isEmpty(ce)) { return false; } BitSet bytecodeSet = getClassContext().getBytecodeS...
[ "public", "boolean", "prescreen", "(", "Code", "code", ",", "Method", "method", ")", "{", "if", "(", "method", ".", "isSynthetic", "(", ")", ")", "{", "return", "false", ";", "}", "CodeException", "[", "]", "ce", "=", "code", ".", "getExceptionTable", ...
looks for methods that contain a catch block and an ATHROW opcode @param code the context object of the current code block @param method the context object of the current method @return if the class throws exceptions
[ "looks", "for", "methods", "that", "contain", "a", "catch", "block", "and", "an", "ATHROW", "opcode" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java#L123-L135
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java
AnycastOutputHandler.handleControlBrowseStatus
private final void handleControlBrowseStatus(SIBUuid8 remoteME, SIBUuid12 gatheringTargetDestUuid, long browseId, int status) { """ Method to handle a ControlBrowseStatus message from an RME @param remoteME The UUID of the RME @param browseId The unique browseId, relative to this RME @param status The status ...
java
private final void handleControlBrowseStatus(SIBUuid8 remoteME, SIBUuid12 gatheringTargetDestUuid, long browseId, int status) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleControlBrowseStatus", new Object[] {remoteME, gatheringTargetDestUuid, Long.valueOf(br...
[ "private", "final", "void", "handleControlBrowseStatus", "(", "SIBUuid8", "remoteME", ",", "SIBUuid12", "gatheringTargetDestUuid", ",", "long", "browseId", ",", "int", "status", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc...
Method to handle a ControlBrowseStatus message from an RME @param remoteME The UUID of the RME @param browseId The unique browseId, relative to this RME @param status The status
[ "Method", "to", "handle", "a", "ControlBrowseStatus", "message", "from", "an", "RME" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java#L1447-L1475
unbescape/unbescape
src/main/java/org/unbescape/properties/PropertiesEscape.java
PropertiesEscape.escapePropertiesKey
public static void escapePropertiesKey(final String text, final Writer writer) throws IOException { """ <p> Perform a Java Properties Key level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> <em>Lev...
java
public static void escapePropertiesKey(final String text, final Writer writer) throws IOException { escapePropertiesKey(text, writer, PropertiesKeyEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET); }
[ "public", "static", "void", "escapePropertiesKey", "(", "final", "String", "text", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "escapePropertiesKey", "(", "text", ",", "writer", ",", "PropertiesKeyEscapeLevel", ".", "LEVEL_2_ALL_NON_ASCII_PLUS...
<p> Perform a Java Properties Key level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> <em>Level 2</em> means this method will escape: </p> <ul> <li>The Java Properties Key basic escape set: <ul> <li>The <em>Single Escap...
[ "<p", ">", "Perform", "a", "Java", "Properties", "Key", "level", "2", "(", "basic", "set", "and", "all", "non", "-", "ASCII", "chars", ")", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", ...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L994-L997
alrocar/POIProxy
es.alrocar.poiproxy/src/main/java/es/alrocar/jpe/parser/handler/BaseContentHandler.java
BaseContentHandler.startNewElement
public void startNewElement(String localName, Attributes atts) { """ Compares the localname with the {@link FeatureType#getFeature()} attribute of the current {@link FeatureType} of the {@link DescribeService} If the current tag being parsed is equals to {@link FeatureType#getFeature()} then the {@link JPEC...
java
public void startNewElement(String localName, Attributes atts) { String arg0 = localName; this.currentKey = arg0; if (isEndElement(arg0)) { endNewElement(); if (writerContentHandler != null) { this.currentFeatureGeoJSON = writerContentHandler.startFeature(); this.currentGeometryGeoJSON = writerConte...
[ "public", "void", "startNewElement", "(", "String", "localName", ",", "Attributes", "atts", ")", "{", "String", "arg0", "=", "localName", ";", "this", ".", "currentKey", "=", "arg0", ";", "if", "(", "isEndElement", "(", "arg0", ")", ")", "{", "endNewElemen...
Compares the localname with the {@link FeatureType#getFeature()} attribute of the current {@link FeatureType} of the {@link DescribeService} If the current tag being parsed is equals to {@link FeatureType#getFeature()} then the {@link JPEContentHandler#startFeature()} and {@link JPEContentHandler#startPoint()} are thr...
[ "Compares", "the", "localname", "with", "the", "{", "@link", "FeatureType#getFeature", "()", "}", "attribute", "of", "the", "current", "{", "@link", "FeatureType", "}", "of", "the", "{", "@link", "DescribeService", "}" ]
train
https://github.com/alrocar/POIProxy/blob/e1dabe738a862478b2580e90d5fc4209a2997868/es.alrocar.poiproxy/src/main/java/es/alrocar/jpe/parser/handler/BaseContentHandler.java#L326-L352
mercadopago/dx-java
src/main/java/com/mercadopago/core/MPCache.java
MPCache.addToCache
static void addToCache(String key, MPApiResponse response) { """ Inserts an entry to the cache. @param key String with cache entry key @param response MPApiResponse object to be cached """ HashMap<String, MPApiResponse> mapCache = getMapCache(); mapCache.put(key, response); ...
java
static void addToCache(String key, MPApiResponse response) { HashMap<String, MPApiResponse> mapCache = getMapCache(); mapCache.put(key, response); }
[ "static", "void", "addToCache", "(", "String", "key", ",", "MPApiResponse", "response", ")", "{", "HashMap", "<", "String", ",", "MPApiResponse", ">", "mapCache", "=", "getMapCache", "(", ")", ";", "mapCache", ".", "put", "(", "key", ",", "response", ")", ...
Inserts an entry to the cache. @param key String with cache entry key @param response MPApiResponse object to be cached
[ "Inserts", "an", "entry", "to", "the", "cache", "." ]
train
https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCache.java#L35-L38
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/draggable/DraggableContainment.java
DraggableContainment.setArrayParam
public void setArrayParam(Integer x1, Integer y1, Integer x2, Integer y2) { """ Set's the array parameter @param x1 First x coordinate @param y1 First y coordinate @param x2 Second x coordinate @param y2 Second y coordinate """ ArrayItemOptions<IntegerItemOptions> tempArrayParam = new ArrayItemO...
java
public void setArrayParam(Integer x1, Integer y1, Integer x2, Integer y2) { ArrayItemOptions<IntegerItemOptions> tempArrayParam = new ArrayItemOptions<IntegerItemOptions>(); tempArrayParam.add(new IntegerItemOptions(x1)); tempArrayParam.add(new IntegerItemOptions(y1)); tempArrayParam.add(new IntegerItemOpti...
[ "public", "void", "setArrayParam", "(", "Integer", "x1", ",", "Integer", "y1", ",", "Integer", "x2", ",", "Integer", "y2", ")", "{", "ArrayItemOptions", "<", "IntegerItemOptions", ">", "tempArrayParam", "=", "new", "ArrayItemOptions", "<", "IntegerItemOptions", ...
Set's the array parameter @param x1 First x coordinate @param y1 First y coordinate @param x2 Second x coordinate @param y2 Second y coordinate
[ "Set", "s", "the", "array", "parameter" ]
train
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/draggable/DraggableContainment.java#L256-L266
Squarespace/cldr
runtime/src/main/java/com/squarespace/cldr/MessageFormat.java
MessageFormat.emit
private void emit(int pos, int end, String arg) { """ Append characters from 'raw' in the range [pos, end) to the output buffer. """ while (pos < end) { char ch = format.charAt(pos); if (ch == '#') { buf.append(arg == null ? ch : arg); } else { buf.append(ch); } ...
java
private void emit(int pos, int end, String arg) { while (pos < end) { char ch = format.charAt(pos); if (ch == '#') { buf.append(arg == null ? ch : arg); } else { buf.append(ch); } pos++; } }
[ "private", "void", "emit", "(", "int", "pos", ",", "int", "end", ",", "String", "arg", ")", "{", "while", "(", "pos", "<", "end", ")", "{", "char", "ch", "=", "format", ".", "charAt", "(", "pos", ")", ";", "if", "(", "ch", "==", "'", "'", ")"...
Append characters from 'raw' in the range [pos, end) to the output buffer.
[ "Append", "characters", "from", "raw", "in", "the", "range", "[", "pos", "end", ")", "to", "the", "output", "buffer", "." ]
train
https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/MessageFormat.java#L813-L823
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/assembly/AssemblyFiles.java
AssemblyFiles.addEntry
public void addEntry(File srcFile, File destFile) { """ Add a entry to the list of assembly files which possible should be monitored @param srcFile source file to monitor. The source file must exist. @param destFile the destination to which it is eventually copied. The destination file must be relative. ""...
java
public void addEntry(File srcFile, File destFile) { entries.add(new Entry(srcFile,destFile)); }
[ "public", "void", "addEntry", "(", "File", "srcFile", ",", "File", "destFile", ")", "{", "entries", ".", "add", "(", "new", "Entry", "(", "srcFile", ",", "destFile", ")", ")", ";", "}" ]
Add a entry to the list of assembly files which possible should be monitored @param srcFile source file to monitor. The source file must exist. @param destFile the destination to which it is eventually copied. The destination file must be relative.
[ "Add", "a", "entry", "to", "the", "list", "of", "assembly", "files", "which", "possible", "should", "be", "monitored" ]
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/AssemblyFiles.java#L49-L51
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java
LocaleFormatter.getFormatted
@Nonnull public static String getFormatted (@Nonnull final BigInteger aValue, @Nonnull final Locale aDisplayLocale) { """ Format the passed value according to the rules specified by the given locale. All calls to {@link BigInteger#toString()} that are displayed to the user should instead use this method. @p...
java
@Nonnull public static String getFormatted (@Nonnull final BigInteger aValue, @Nonnull final Locale aDisplayLocale) { ValueEnforcer.notNull (aValue, "Value"); ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale"); return NumberFormat.getIntegerInstance (aDisplayLocale).format (aValue); }
[ "@", "Nonnull", "public", "static", "String", "getFormatted", "(", "@", "Nonnull", "final", "BigInteger", "aValue", ",", "@", "Nonnull", "final", "Locale", "aDisplayLocale", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aValue", ",", "\"Value\"", ")", ";", ...
Format the passed value according to the rules specified by the given locale. All calls to {@link BigInteger#toString()} that are displayed to the user should instead use this method. @param aValue The value to be formatted. May not be <code>null</code>. @param aDisplayLocale The locale to be used. May not be <code>nu...
[ "Format", "the", "passed", "value", "according", "to", "the", "rules", "specified", "by", "the", "given", "locale", ".", "All", "calls", "to", "{", "@link", "BigInteger#toString", "()", "}", "that", "are", "displayed", "to", "the", "user", "should", "instead...
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java#L113-L120
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/TSAClientBouncyCastle.java
TSAClientBouncyCastle.getTimeStampToken
protected byte[] getTimeStampToken(byte[] imprint) throws Exception { """ Get timestamp token - Bouncy Castle request encoding / decoding layer """ byte[] respBytes = null; try { // Setup the time stamp request TimeStampRequestGenerator tsqGenerator = new TimeStampRe...
java
protected byte[] getTimeStampToken(byte[] imprint) throws Exception { byte[] respBytes = null; try { // Setup the time stamp request TimeStampRequestGenerator tsqGenerator = new TimeStampRequestGenerator(); tsqGenerator.setCertReq(true); // tsqGenera...
[ "protected", "byte", "[", "]", "getTimeStampToken", "(", "byte", "[", "]", "imprint", ")", "throws", "Exception", "{", "byte", "[", "]", "respBytes", "=", "null", ";", "try", "{", "// Setup the time stamp request\r", "TimeStampRequestGenerator", "tsqGenerator", "=...
Get timestamp token - Bouncy Castle request encoding / decoding layer
[ "Get", "timestamp", "token", "-", "Bouncy", "Castle", "request", "encoding", "/", "decoding", "layer" ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TSAClientBouncyCastle.java#L141-L185
grpc/grpc-java
alts/src/main/java/io/grpc/alts/internal/AltsTsiHandshaker.java
AltsTsiHandshaker.createFrameProtector
@Override public TsiFrameProtector createFrameProtector(int maxFrameSize, ByteBufAllocator alloc) { """ Creates a frame protector from a completed handshake. No other methods may be called after the frame protector is created. @param maxFrameSize the requested max frame size, the callee is free to ignore. @...
java
@Override public TsiFrameProtector createFrameProtector(int maxFrameSize, ByteBufAllocator alloc) { Preconditions.checkState(!isInProgress(), "Handshake is not complete."); byte[] key = handshaker.getKey(); Preconditions.checkState(key.length == AltsChannelCrypter.getKeyLength(), "Bad key length."); ...
[ "@", "Override", "public", "TsiFrameProtector", "createFrameProtector", "(", "int", "maxFrameSize", ",", "ByteBufAllocator", "alloc", ")", "{", "Preconditions", ".", "checkState", "(", "!", "isInProgress", "(", ")", ",", "\"Handshake is not complete.\"", ")", ";", "...
Creates a frame protector from a completed handshake. No other methods may be called after the frame protector is created. @param maxFrameSize the requested max frame size, the callee is free to ignore. @param alloc used for allocating ByteBufs. @return a new TsiFrameProtector.
[ "Creates", "a", "frame", "protector", "from", "a", "completed", "handshake", ".", "No", "other", "methods", "may", "be", "called", "after", "the", "frame", "protector", "is", "created", "." ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/alts/src/main/java/io/grpc/alts/internal/AltsTsiHandshaker.java#L174-L182